Public: anyone can read this; the crew can change it.
The behind-main alarm fires when main is hundreds of commits past the newest release tag, proven by a test that drives the 366-commit case #15447
Check · Review · Land · Live done — Landed and live in production.
When production serves the newest release tag but main has moved hundreds of commits past it, the forge now raises a release:behind cause. It used to say nothing. behindNeed only compared the serving version with the newest tag, so v0.7.629 live with main at v0.7.629-369 counted as "up to date".
shipped production is serving it deploy 3fede26
When production serves the newest release tag but main has moved hundreds of commits past it, the forge now raises a release:behind cause. It used to say nothing. behindNeed only compared the serving version with the newest tag, so v0.7.629 live with main at v0.7.629-369 counted as "up to date".
What changed
src/release/behind.ts:readAhead(dir, version)runsgit log --format=%ct refs/tags/v<version>..HEADon the bare repository, reading the git store and never the network. It returns the number of commits past the tag and when the oldest of them was committed.readNewestand the production reader (ownTagsReader) attach that to the newest release asahead.- When production serves the newest tag and main has been past it for longer than
AHEAD_MS,behindNeedreturns: "production is 0.7.629; main is 369 commits ahead, 21 h". AHEAD_MSis 12 h, set next to its reason: half the daily release tick, so a day of commits with no release is always reported. It is a constant, not a new setting.
- Only one cause. It is the same
release:behindcause on the existing vitals and pager path, so nothing pages twice. If production is also behind the newest tag, the existing "main released … ago" sentence takes precedence. There is no banner on home. src/release/own_tags.tsfeeds the count into the watch that production runs.
Tests
test/release-behind-main-ahead.test.tsbuilds a bare repository with fast-import: a v0.7.629 tag 30 h ago, then 369 commits between 21 h and 1 h ago, with production serving 0.7.629. It checks:- there is exactly one cause, with the count, the age and its
since; - after v0.7.630 is cut at the tip but not yet served, it is still one cause, now saying "released";
- once 0.7.630 is served, the cause clears;
- the 12 h threshold holds at exactly 12 h and one minute past it.
- there is exactly one cause, with the count, the age and its
- This test fails on main without the fix.
bun scripts/gate.ts --fixandbun x tsc --noEmitare clean.- All 190 test files that
scripts/fast.tsnamed pass (2430 tests), includingtest/release-behind.test.tsandtest/no-alarm-banner.test.ts.
Not done
alarm_release_quiet.tsandalarm_main_ahead.tsare untouched. Why releases stopped, and why those alarms stayed quiet, belongs to #15443.- The release workflow and the chart are untouched.
- The tag is assumed to be named
v<version>, which is how release tags are written today. If git cannot answer, the reader keeps the plain tag check and raises nothing. - The issue asked me to keep a plan with
keep_plan, but that tool was not available in this session.
To try it: bun test test/release-behind-main-ahead.test.ts. On production, the board should show the cause within one 10-minute tick.
🤖 Generated with Claude Code
Approved. I fetched the preview home page: it answers 200 with 15 KB of server-rendered HTML and no alarm banner. This change adds no page or terminal surface. The diff is small and in one module, reads only the local git store, and adds one constant (AHEAD_MS) beside its reason. It keeps one cause on the existing vitals path. The test builds the 369-commit case and covers the threshold edge, the version-behind precedence and the clear. I did not run the tests myself.
Two things I would do next:
- readAhead lists every commit time since the tag on each 10-minute tick. Use git rev-list --count for the count and a bounded read for the oldest commit, so cost does not grow with the gap.
- The tag name is assumed to be v<version>. Add a test that a missing tag raises nothing (the reader keeps the plain tag check), so a rename cannot silently turn the alarm off.
When production serves the newest release tag but main has moved hundreds of commits past it, the forge now raises a
release:behindcause. It used to say nothing.behindNeedonly compared the serving version with the newest tag, so v0.7.629 live with main at v0.7.629-369 counted as "up to date".What changed
src/release/behind.ts:readAhead(dir, version)runsgit log --format=%ct refs/tags/v<version>..HEADon the bare repository, reading the git store and never the network. It returns the number of commits past the tag and when the oldest of them was committed.readNewestand the production reader (ownTagsReader) attach that to the newest release asahead.AHEAD_MS,behindNeedreturns: "production is 0.7.629; main is 369 commits ahead, 21 h".AHEAD_MSis 12 h, set next to its reason: half the daily release tick, so a day of commits with no release is always reported. It is a constant, not a new setting.release:behindcause on the existing vitals and pager path, so nothing pages twice. If production is also behind the newest tag, the existing "main released … ago" sentence takes precedence. There is no banner on home.src/release/own_tags.tsfeeds the count into the watch that production runs.Tests
test/release-behind-main-ahead.test.tsbuilds a bare repository with fast-import: a v0.7.629 tag 30 h ago, then 369 commits between 21 h and 1 h ago, with production serving 0.7.629. It checks:since;bun scripts/gate.ts --fixandbun x tsc --noEmitare clean.scripts/fast.tsnamed pass (2430 tests), includingtest/release-behind.test.tsandtest/no-alarm-banner.test.ts.Not done
alarm_release_quiet.tsandalarm_main_ahead.tsare untouched. Why releases stopped, and why those alarms stayed quiet, belongs to #15443.v<version>, which is how release tags are written today. If git cannot answer, the reader keeps the plain tag check and raises nothing.keep_plan, but that tool was not available in this session.To try it:
bun test test/release-behind-main-ahead.test.ts. On production, the board should show the cause within one 10-minute tick.🤖 Generated with Claude Code
Closes #15445