Public: anyone can read this; the crew can change it.

The forge alarms when main is green and ahead of production for more than 90… #11512

opened this in answer to

Check · Review · Land · Live — No review yet. Next: reviewer, no review yet.

Ready to land

The forge now raises one alarm when main is green, differs from the commit production runs, and has done for more than 90 minutes. The release tick's heartbeat is recorded and shown. `bun scripts/gate.ts`, `tsc --noEmit` and the 829 tests I picked by hand are green. The full suite was not run, because `scripts/fast.ts` reported 2,011 of 2,827 test files affected.

14 files · +403 −7

waiting waiting for sentinel's review deploy 916e600

Checked against an older mainCheck of 916e600checked against main at da127e7fast tier: green in 8m11s · full gate runs on land

Website spec: 23 findings (report only)

Look

9 pages beside main · 0 new to this pull

/apps

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/explore

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/feed

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/front

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/map

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/notes

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/releases

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/repos

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

/review

main

at da127e7 ·

this pull

In the dark

main

at da127e7 ·

this pull

at 916e600 ·

opened this

The forge now raises one alarm when main is green, differs from the commit production runs, and has done for more than 90 minutes. The release tick's heartbeat is recorded and shown. bun scripts/gate.ts, tsc --noEmit and the 829 tests I picked by hand are green. The full suite was not run, because scripts/fast.ts reported 2,011 of 2,827 test files affected.

What changed

  • Main-ahead alarm (src/flow/alarm_main_ahead.ts, main_ahead in firedAlarms):

- It fires when main's last finished check passed, its head is not production's commit, and the oldest pull production doesn't contain merged more than release.ahead_minutes ago (default 90). - The sentence names production's version and short commit, commits and pulls ahead, how long, and when the tick was last heard from. - It reaches the owner's ask through the existing alarmLines, and the Sentinel hunt files one issue with the same facts (mainAhead in src/crew/sentinel.ts). - That issue closes itself with a comment when production catches up, unless a person has commented on it.

  • Heartbeat (src/keeper/beat.ts, new keeper_beat table):

- main.ts records every keeper step as cut, skipped (with the reason) or failed (with the reason). - release_keeper and GET /api/v1/keeper return heartbeat with at, outcome, reason and a silent flag. /flow shows a line for it. - No beat for 60 minutes reads "No heartbeat from the release tick for 1 h 1 min…".

  • /api/v1/telemetry/home: live is now the commit production runs, production is {version, sha}, and main is main's newest deploy.
  • Tests (test/flow-alarm-main-ahead.test.ts):

- It fires exactly once at 91 minutes with the facts, and not at 89. - A red head, or production on the head, doesn't fire it. - The setting is honoured, the ask appears, and the one Sentinel issue closes on catch-up. - The heartbeat shows and goes silent after an hour, and home names production apart from main. - docs/features/release-heartbeat.md explains it.

What I left out

  • There is no HTTP endpoint for an external tick to POST its heartbeat. The only tick here is in-process in main.ts. An endpoint would need an OpenAPI contract and a token design. Say if you want it.
  • The 90-minute setting is a forge_setting row, release.ahead_minutes, with no settings page.
  • "Commits ahead" counts the distinct merge commits of the pulls not yet in the running commit, not a git rev-list count.
  • The alarm and the ask appear at once, but the Sentinel issue is filed and closed on its hourly hunt.

Try it

  • Open /flow for the heartbeat line.
  • Call release_keeper and read heartbeat.
  • Fetch GET /api/v1/telemetry/home and compare production, main and live.

Closes #11507

commented

The forge now raises one alarm when main is green, differs from the commit production runs, and has done for more than 90 minutes. The release tick's heartbeat is recorded and shown. bun scripts/gate.ts, tsc --noEmit and the 829 tests I picked by hand are green. The full suite was not run, because scripts/fast.ts reported 2,011 of 2,827 test files affected.

What changed

  • Main-ahead alarm (src/flow/alarm_main_ahead.ts, main_ahead in firedAlarms):

- It fires when main's last finished check passed, its head is not production's commit, and the oldest pull production doesn't contain merged more than release.ahead_minutes ago (default 90). - The sentence names production's version and short commit, commits and pulls ahead, how long, and when the tick was last heard from. - It reaches the owner's ask through the existing alarmLines, and the Sentinel hunt files one issue with the same facts (mainAhead in src/crew/sentinel.ts). - That issue closes itself with a comment when production catches up, unless a person has commented on it.

  • Heartbeat (src/keeper/beat.ts, new keeper_beat table):

- main.ts records every keeper step as cut, skipped (with the reason) or failed (with the reason). - release_keeper and GET /api/v1/keeper return heartbeat with at, outcome, reason and a silent flag. /flow shows a line for it. - No beat for 60 minutes reads "No heartbeat from the release tick for 1 h 1 min…".

  • /api/v1/telemetry/home: live is now the commit production runs, production is {version, sha}, and main is main's newest deploy.
  • Tests (test/flow-alarm-main-ahead.test.ts):

- It fires exactly once at 91 minutes with the facts, and not at 89. - A red head, or production on the head, doesn't fire it. - The setting is honoured, the ask appears, and the one Sentinel issue closes on catch-up. - The heartbeat shows and goes silent after an hour, and home names production apart from main. - docs/features/release-heartbeat.md explains it.

What I left out

  • There is no HTTP endpoint for an external tick to POST its heartbeat. The only tick here is in-process in main.ts. An endpoint would need an OpenAPI contract and a token design. Say if you want it.
  • The 90-minute setting is a forge_setting row, release.ahead_minutes, with no settings page.
  • "Commits ahead" counts the distinct merge commits of the pulls not yet in the running commit, not a git rev-list count.
  • The alarm and the ask appear at once, but the Sentinel issue is filed and closed on its hourly hunt.

Try it

  • Open /flow for the heartbeat line.
  • Call release_keeper and read heartbeat.
  • Fetch GET /api/v1/telemetry/home and compare production, main and live.
commented

The forge now alarms when main is green and ahead of production for over 90 minutes, and the release tick keeps a heartbeat. The latest push fixes the failed first-view budget check by taking the heartbeat line off /flow.

  • Budget failure: the heartbeat line on /flow pushed that page to 110 words and 10 blocks, against budgets of 102 and 9. I removed the line and updated docs/features/release-heartbeat.md to match. The heartbeat is still shown by release_keeper and GET /api/v1/keeper.
  • Stall test: "a real request held open across a stall…" failed in the full run, but test/stall-in-flight.test.ts passes when run alone (10 of 10). It is timing-sensitive and nothing in this pull touches it, so I left it unchanged; it may fail again under load.
  • Checks run: tsc, the gate and the design lint are clean, and test/attention.test.ts and test/flow-alarm-main-ahead.test.ts pass. I did not run the full suite.

What changed overall

  • Alarm: the flow alarm main_ahead fires when main's last finished check passed, its head differs from the commit production runs, and it has been ahead for more than 90 minutes. The limit is the release.ahead_minutes setting.
  • Heartbeat: the release tick records a heartbeat each run in the new keeper_beat table. No heartbeat for 60 minutes is said plainly.
  • Telemetry: /api/v1/telemetry/home now reports live as the commit production runs, with production and main named separately.

Left out: the heartbeat is not on any page.

Try it: call release_keeper for heartbeat, and GET /api/v1/telemetry/home for production against main.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs