Public: anyone can read this; the crew can change it.
The main-ahead alarm fires on the commit gap alone when production's commit has no check row #15471
Check · Review · Land · Live done — Landed and live in production.
The main-ahead flow alarm no longer stays silent when production's commit has no check row here. In that case it falls back to the number of commits main is past the newest release tag, and it fires once that gap is older than the existing release.aheadminutes limit (default 90 min).
shipped production is serving it deploy 0adf720
The main-ahead flow alarm no longer stays silent when production's commit has no check row here. In that case it falls back to the number of commits main is past the newest release tag, and it fires once that gap is older than the existing release.ahead_minutes limit (default 90 min).
src/release/behind.ts: the release watch keeps its last read of the newest tag and main's commits past it, andtagAhead()returns that read. It comes from the git store the watch already reads every ten minutes, so nothing new is read on a request.src/flow/alarm_main_ahead.ts: the fallback is used only when there are no waiting pulls, no saved read of what production contains, and no check row for production's commit. A saved read that finds nothing waiting is still trusted, as before. When the fallback fires, the card names the gap and how long ago the last tag was cut: "Main is green and 369 commits ahead of production (0.7.629 at cab90cf) for 21 h 0 min; the last release tag, v0.7.629, was cut 1 day ago; …". The issue's facts give the tag's cut time as an absolute timestamp, so the evidence does not change as the clock moves.- No false alarm without a tag: with no tag read, as on a fresh forge or a fork with no tags, the fallback gives nothing and the alarm stays quiet. The new test covers this.
test/release-behind-main-ahead.test.ts: the new test sets up main's head as green, production's commit unchecked, and main 369 commits pastv0.7.629. It checks the no-tag case is quiet and that the tag gap fires with the expected wording. It fails without the change tosrc/flow/alarm_main_ahead.ts; I checked by stashing that change and running it.docs/OPERATING.md: the sentence about this case is replaced. The alarm now stays silent only whilerelease.ahead_minutesis longer than the wait, or when there is no release tag at all. I also renamed one test intest/flow-alarm-main-ahead-cold.test.tsthat still called this case silent.
Not done: the fallback does not check that production serves the tag it counts from. If production is behind that tag, the count is a lower bound on the real gap, and the release:behind cause already reports that version gap. The release workflow and the chart are untouched.
Checks: bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. scripts/fast.ts named 3,307 test files for this diff, so I ran the files that cover the alarm and the release watch myself: 25 files, 190 tests, all passing. The forge runs the full check on the push.
To try it: bun test test/release-behind-main-ahead.test.ts test/flow-alarm-main-ahead-cold.test.ts
🤖 Generated with Claude Code
The main-ahead flow alarm no longer stays silent when production's commit has no check row here. In that case it falls back to the number of commits main is past the newest release tag, and fires once that gap is older than release.ahead_minutes (default 90 min).
src/release/behind.ts: the release watch keeps its last read of the newest tag and main's commits past it, andtagAhead()returns it. That read comes from the git store the watch already reads every ten minutes, so a request reads nothing new.src/flow/alarm_main_ahead.ts: the fallback applies only when no pulls are waiting, no saved read of what production contains exists, and there is no check row for production's commit. A saved read that finds nothing waiting is still believed. The message names the gap and the tag's age: "Main is green and 369 commits ahead of production (0.7.629 at cab90cf) for 21 h 0 min; the last release tag, v0.7.629, was cut 1 day ago; …". The facts give the tag's cut time as an absolute timestamp, so the evidence does not change as the clock moves.- No tag stays quiet: on a fresh forge or a fork with no tags the fallback is empty and the alarm says nothing. The new test covers both a missing watch and a watch that reads no tag.
test/release-behind-main-ahead.test.ts: builds the case (main green, production's commit unchecked, main 369 commits pastv0.7.629). It fails without the alarm change; I checked by stashing that change and re-running it. It puts back theprocess.envvalues it sets in afinallyblock; the first push restored them inafterAll, which the gate's environment rule refused.docs/OPERATING.md: the sentence saying the alarm stays silent in this case is replaced. It now stays silent only whilerelease.ahead_minutesis longer than the wait, or when no release tag exists at all. A test name intest/flow-alarm-main-ahead-cold.test.tsthat still called this case silent is renamed.
Not done: the fallback does not check that production serves the tag it counts from. If production is behind that tag, the count understates the gap, and the existing release:behind cause already reports the version gap. The release workflow and the chart are untouched.
Checks: bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 3,307 test files for this diff, too many to run here, so I picked the ones that cover the alarm and the release watch: 25 files, 190 tests, all passing. After the gate fix I re-ran test/release-behind-main-ahead.test.ts and the two test/flow-alarm-main-ahead* files: 28 tests, all passing.
Try it: bun test test/release-behind-main-ahead.test.ts test/flow-alarm-main-ahead-cold.test.ts
🤖 Generated with Claude Code
The alarm now falls back to main's commits past the newest release tag when production's commit has no check row, stays quiet with no tag, and names the gap and the tag age. The new test covers both and restores env in a finally. The preview answers 200. I could not see the card itself: it only fires on the production state. Two things I would do next: (1) verify production serves the tag the count is measured from, so the fallback cannot understate the gap; (2) show the tag age on the /flow card as a distinct line, not only inside the sentence.
The main-ahead flow alarm no longer stays silent when production's commit has no check row here. In that case it falls back to the number of commits main is past the newest release tag, and it fires once that gap is older than the existing
release.ahead_minuteslimit (default 90 min).src/release/behind.ts: the release watch keeps its last read of the newest tag and main's commits past it, andtagAhead()returns that read. It comes from the git store the watch already reads every ten minutes, so nothing new is read on a request.src/flow/alarm_main_ahead.ts: the fallback is used only when there are no waiting pulls, no saved read of what production contains, and no check row for production's commit. A saved read that finds nothing waiting is still trusted, as before. When the fallback fires, the card names the gap and how long ago the last tag was cut: "Main is green and 369 commits ahead of production (0.7.629 at cab90cf) for 21 h 0 min; the last release tag, v0.7.629, was cut 1 day ago; …". The issue's facts give the tag's cut time as an absolute timestamp, so the evidence does not change as the clock moves.test/release-behind-main-ahead.test.ts: the new test sets up main's head as green, production's commit unchecked, and main 369 commits pastv0.7.629. It checks the no-tag case is quiet and that the tag gap fires with the expected wording. It fails without the change tosrc/flow/alarm_main_ahead.ts; I checked by stashing that change and running it.docs/OPERATING.md: the sentence about this case is replaced. The alarm now stays silent only whilerelease.ahead_minutesis longer than the wait, or when there is no release tag at all. I also renamed one test intest/flow-alarm-main-ahead-cold.test.tsthat still called this case silent.Not done: the fallback does not check that production serves the tag it counts from. If production is behind that tag, the count is a lower bound on the real gap, and the
release:behindcause already reports that version gap. The release workflow and the chart are untouched.Checks:
bun scripts/gate.ts --fixandbun x tsc --noEmitare clean.scripts/fast.tsnamed 3,307 test files for this diff, so I ran the files that cover the alarm and the release watch myself: 25 files, 190 tests, all passing. The forge runs the full check on the push.To try it:
bun test test/release-behind-main-ahead.test.ts test/flow-alarm-main-ahead-cold.test.ts🤖 Generated with Claude Code
Closes #15467