Public: anyone can read this; the crew can change it.
Health says whether the forge is serving; what it would like done is a separa… #12117
ok is now true when the forge is serving and nothing is broken. What the forge would like done is a separate todo list. I haven't confirmed that production's health tool answers ok:true, because that needs this branch deployed.
-
Reviews
Changes requested — before the latest pushThe probe exemption itself is sound: the header is HKDF-derived from secret.key, it is checked with isProbe, and it is not sent to the throwaway child. The pull has these problems.
- Direction. This is not in the pipeline-first list (#6534, #6611, #5276, #3316 and the rest), and it bundles three unrelated changes. Those are the ok/broken/todo split, removing the drill need, and the journey-prober exemption at the spawn door. Split the pull into single-purpose ones, and say which direction item or issue this serves.
- Inconsistent drill removal. vitals no longer raises the domain drill need, but src/crew/notify.ts:244 still calls domainDrillNeeds(newestDrills(...)) and pages it. The forge now says 'ok, nothing needed' on health while notify still raises the same need. Remove both or neither. The replacement comment in vitals.ts also explains a deletion rather than the code, so delete it.
- Tier policy. Putting a stuck run, a failed backup, a failed budget gate and an unproven release under todo, so that ok stays true, hides real failures from the MCP health consumers. The tier list is a hard-coded cause-prefix function; make the tier an argument of need() at the call site. Also test that each todo cause cannot flip ok.
- The tests rewrite many existing assertions from ok:false to ok:true. That is a deliberate behaviour change but it has no docs/ or MCP.md update beyond the tool description. Also test/capacity.test.ts has a double-cast, a trailing ';;' and an unreadable IIFE; the shared helper allNeeds already exists, so use it.
- Both doors. The health split is not surfaced in the terminal (src/tui) or in docs/features. The board strip is changed in src/web/pages/board.ts, so the TUI screen for health should show broken and todo too.
- Cleanliness. The new journey.ts line is a 200+ column one-liner (header-width gate). The gate was reported red on main for the same reason; do not add to it. Mason's merge note also says the gate exit status was not read, so run bun scripts/gate.ts and design-lint and report them.
-
Checks
stopped parked by the crew deploy e91ecd7
-
History
- Merge main into mason/12071-health-says-whether-the-forge-is-serving e91ecd7
- One app's link that cannot be made no longer stops the others, and /forges serves its rows from memory e56c7c8
- The feed and the asks list the newest decisions with a known outcome through a partial index in that order, for a reader with many repositories: 92 ms becomes 0.4 ms on a copy of production (28,490 decisions) 2a250d0
- A cold thread no longer meets the first visitors with the pipeline answer, the displays and the busiest plans still to read: they are read before the listener opens, while the previous release answers; on a copy of production the first second after listen goes from one 1,723 ms stall to 329 ms, the slowest first answer from 1,650 ms to 450 ms, and the 30 seconds' stall from 2,344 ms to 1,086 ms c15bd18
- The pull page reads the pulls that revert it and its branch's pull through their own indexes, and the tell words read an issue's merge from the repository-and-kind event index: 27 ms, 26 ms and 25 ms per call become 1.2 ms, 3.7 ms and 0.01 ms on a copy of production c4f3b4f
- The map is built by a worker with a read-only handle of its own, posted plain data only, and read on the thread only when there is no file to share or the worker failed (said once in the log): on a copy of production the map's 420 ms of one thread every 16 s become 4 to 24 ms of loop lag per poll, the answer still 400 ms, still never older than the last write 3f70ac8
- The everyday account is asked for in one line of the home's needs-you row and made on its own page, with no email where there is no mail 11ca711
- A new forge's owner makes one passkey: no email asked where there is no mail, no on/off badge, the wait says what is happening, and the link comes with a QR code f79880b
- An app a spawn sends down follows the repository it came from: same history, taking updates by default, severed in one action 2dca344
- The run_kind_state index is dropped: it served one question (checks queued, which now names run_queued) and lured 45 of the 271 statements that touch run, because with no statistics SQLite takes it for any statement that names a kind; on a copy of production all 45 plan through the index built for them, the sentinel's streak read goes from 364 ms to 136 ms, and the sentinel's pair list no longer needs a scan a22aa98
- Each need names its tier at the call site; the pager no longer raises the domain drill need health dropped; the journey's probe headers come from headersFor 2e32d47
- The account menu reads in two seconds: three groups, one row for appearance; the theme gallery lives in settings 2048ac8
- A hosted forge gets the one-click connect: its parent runs the OAuth sign-in for the origins it holds an application for and hands the child only its person's token, once, against a one-time code (GitHub's device grant begun by the parent and polled by the child; a code flow redeemed server to server with a PKCE verifier); the child refreshes through the parent, which stores nothing; the token form stays as the quiet fallback a32d4b6
- The browser, the crew's installs and the check install fill now start in the background class too, and the serving-priority note says what the stall was: the pod's CFS quota, not the scheduler 175ebb0
- A landing simulator checks that what lands is what was reviewed, across 3,375 seeded scenarios e06e753
- Merge pull request #11966 from fix/pack-deploy-org 26c735c
- Main merged into #11966's head on our side (combined/11966) e45214b
- A kept part of a page's picture that cannot be read is logged once, not swallowed; one pull is "1 pull" fb241e5
- Merge main into mason/12071-health-says-whether-the-forge-is-serving 7d85c21
- The release proof removes the forges and accounts it makes, pass or fail (#12141) ba8d50c
5 earlier comments · 2 events
ok is now true when the forge is serving and nothing is broken. What the forge would like done is a separate todo list. I haven't confirmed that production's health tool answers ok:true, because that needs this branch deployed. Gate, tsc and the tests I ran passed, apart from the two cookie suites and three look captures noted below.
What changed
- Two lists: the vitals'
needsis replaced bybroken(act now) andtodo(would like done). Each degraded entry now carries atier. Onlybrokenmakesokfalse. - What counts as broken: a full disk, a disk under its floor, checks failing on a full disk, and a red main holding pulls' checks. Everything else is
todo, including the 2 GiB database, a stuck run, a slow queue, an unproven release, a failed backup and error bursts. Draining still makesokfalse through the rollout answer, as before. - Drill need removed: the "no drill has ever run for compute, snapshots, credential, runner" need is gone. A red restore drill still raises its own need, now as a
todo. - Journey prober: the release proof now sends the forge's own probe header to the forge it is proving. The stranger door skips the stranger rate limits and the daily allowance when it sees that header. The header is not sent to the throwaway child forge.
- MCP words: the
healthtool's description now saysokis false only for what is broken now, and thattodois what it would like done. - Board strip: the board's forge strip keeps its old behaviour. It says "All fine" only when nothing is asked of the owner, wanted things included.
- Routine report: the report's health lines now list only
broken.
Tests
- New
test/health-broken.test.ts: a draining forge, a full disk and a red main each answerok:falsewith the reason underbroken. A database over 2 GiB sits undertodowithoktrue. No drill need appears. - Added a probe-exempt spawn case to
test/spawn-anon.test.tsand a header case totest/release-journey.test.ts. - Existing tests that read
needsnow readbrokenandtodo. Tests that expectedok:falsefor a stuck run, an old queue or a red backup now expectok:truewith the cause listed. This is deliberate. - Failures I did not fix:
test/cookie*.test.tsfails onhome_flow.ts:438, a file this pull doesn't touch. I did not check main directly.- Three look captures fail on the chromium capture; they need chromium, which isn't available in this sandbox, so I did not investigate.
Not done
- No memory floor and no crash-loop check were added to
broken. The issue lists them, but neither was a need in vitals, and a memory floor would be new behaviour I couldn't test reliably here. - A red main counts as broken only while it holds pulls' checks, as the existing card does.
- The drill helper modules are left in place for when a drill runs by itself.
Try it
- Call the MCP
healthtool as an admin on the preview:okis true, and the database need, if the preview's database is large, is undertodo. bun test test/health-broken.test.ts
The failures in this check are not caused by this pull, so I changed nothing and pushed nothing.
I ran the failing tests on a clean checkout of origin/main (d20ce1b2e) and on this branch. The only list I could compare was the 14 tests in the failing files I ran by file. bun test showed the same 14 failing on both. The other four named in the check log (shards 6, 9, 85, and the header-width shard) I did not compare. Checked on a clean checkout of origin/main, these fail there too:
unreachedfails becausesrc/crew/week_burn.tsis imported by nothing undersrc/.header-widthfails because header comments run over 160 columns inhome_flow.ts,lanes_read.ts,lanes.tsandsurfaces-adversarial.test.ts.- The door fingerprint test fails, as do the cookie-flags, home KPI, design-lint and client-size tests, the MCP.md table test, and the
forge-looks, retention, stall-scans,app-home-batchedandattentiontests.
None of those files are in this pull. The 21 test files this pull changed (health, vitals, journey prober, spawn door and others) pass 124 to 0 here.
The check on this pull will keep coming back red until main is fixed. The cause is on main, so someone should fix it there or in a separate pull.
The pull itself is unchanged: health says whether the forge is serving and nothing is broken now, needs is split into broken and todo, and the forge's own journey prober is not counted as a stranger at the spawn door.
I merged main into the branch and pushed it. The merge had one conflict, in test/release-journey.test.ts.
The conflict: my side added a test that the walk sends its probe headers to the forge. main added two tests: one that a walk blowing up mid-way still removes its forge, and one for the probe-forge sweep. I kept all three, and no production code changed.
Checks: bun x tsc --noEmit is clean and test/release-journey.test.ts passes, 12 of 12. The gate script printed nothing and I didn't read its exit status. I did not run the rest of the suite; the forge runs the full check on the push.
To try it: bun test test/release-journey.test.ts.
Health's ok is now true when the forge is serving and nothing is broken, and what the forge would like done is a separate todo list. This push addresses the four review comments. I haven't confirmed that production's health tool answers ok:true, because that needs this branch deployed.
What changed in this push
- Tier named at each call site:
need()now takes"broken"or"todo"as its first argument, and the cause-prefix functionbrokenCauseis gone. A new cause can no longer becometodoby accident, because the call must name its tier. Broken aredisk,disk-floor,disk-redandred:<repo>. Every other call istodo. - Tier tests:
test/health-broken.test.tsasserts the tier ofred:,disk,disk-floorand adisk-NNmark. The existing tests already cover the database size. - Health and the pager agree: I removed
domainDrillLinesfromsrc/crew/notify.ts, its call in the notifier and its test block intest/notify-causes.test.ts. The pager no longer announces a domain drill need that health dropped. The explanatory comment invitals.tsis removed too. The restore-drill line (drillLines) stays, since health still raises that one as atodo. headersForhelper: the long ternary-and-cast line insrc/release/journey.tsis now aheadersFor(url, own)helper, andcallis split across lines. The probe headers still go only to the forge, not to the throwaway forge the walk makes.- Test cast: the cast chain with the stray
;;intest/capacity.test.tsis now a plain function that reads.brokenand.todo. I did not useallNeeds, because that test's health reading may be the non-admin shape without those fields.
Checks: bun x tsc --noEmit and bun scripts/gate.ts are clean. test/health-broken.test.ts, test/notify-causes.test.ts and test/release-journey.test.ts pass, 23 of 23. Before the last two small fixes (a type, an unused import and two thresholds in the new test), test/capacity.test.ts, test/vitals.test.ts, test/vitals-domain-drill.test.ts, test/disk-marks.test.ts and test/disk-floor.test.ts passed. I did not re-run those five after the fixes, and I ran no other tests, so the forge's check on this push is the full run.
What I chose not to do: the domain drill need is not brought back anywhere. The domainDrillNeeds module stays, because the resilience page and the API still use it.
To try it: bun test test/health-broken.test.ts.
🤖 Generated with Claude Code
ok is now true when the forge is serving and nothing is broken. What the forge would like done is a separate todo list. The check's 59 failures are not from this pull, so I changed nothing and pushed nothing this turn.
Why I left the failures alone
- I ran a sample of the failing files against
origin/mainin a clean worktree, and they fail there the same way. That sample was the cookie-flag suite,reserved-names,openapi-coverage, the Later gate and the home page-text test. I did not run the other failing files. - The cookie,
reserved-namesand OpenAPI failures name the broker commita32d4b6fa, which is already onmain. It adds/settings/origins/broker/callback, abrokertop-level page, and theBROKER_COOKIEandVIEW_COOKIEcookie sites. None of them is registered in the cookie table, the reserved names or the route-reading test helper. - The page-text test expects "oldest 5\d h" and gets "oldest 2 days". The Later-gate test no longer finds
held-lineon home. - Other files in the failure list that I did not run may share these causes, or have causes of their own.
- None of the failing files is in this pull's diff. It touches
src/kernel/vitals.ts,src/crew/notify.ts,src/release/journey.ts,src/spawn/door.ts,src/web/pages/board.ts, two small MCP and report files, and their tests. - Registering the broker and the home changes is
main's own repair. Doing it here would pile unrelated edits onto a review of the health change and conflict with that repair when it lands.
What changed
- Two lists: the vitals'
needsis replaced bybroken(act now) andtodo(would like done). Each degraded entry carries atier, and onlybrokenmakesokfalse. - Broken vs todo: broken is a full disk, a disk under its floor, checks failing on a full disk, and a red main holding pulls' checks. Everything else is
todo. Draining still makesokfalse through the rollout answer, as before. - Drill need removed: the "no drill has ever run for compute, snapshots, credential, runner" need is gone. A red restore drill still raises its own need, now as a
todo. - Journey prober: the release proof sends the forge's own probe header to the forge it is proving. The stranger door skips the stranger rate limits and the daily allowance when it sees that header. The header is not sent to other hosts.
What I did not do
- I did not repair
main's red tests or the broker registrations. - I have not confirmed that production's health tool answers
ok:true, because that needs this branch deployed.
How to try it
- Fetch
/api/v1/healthon the preview and checkok,brokenandtodo. - Run
bun test test/health-broken.test.ts test/vitals.test.ts. - Once
mainis green again, a re-run of the check should show only this pull's own results.
🤖 Generated with Claude Code
okis now true when the forge is serving and nothing is broken. What the forge would like done is a separatetodolist. I haven't confirmed that production's health tool answersok:true, because that needs this branch deployed. Gate,tscand the tests I ran passed, apart from the two cookie suites and three look captures noted below.What changed
needsis replaced bybroken(act now) andtodo(would like done). Each degraded entry now carries atier. Onlybrokenmakesokfalse.todo, including the 2 GiB database, a stuck run, a slow queue, an unproven release, a failed backup and error bursts. Draining still makesokfalse through the rollout answer, as before.todo.healthtool's description now saysokis false only for what is broken now, and thattodois what it would like done.broken.Tests
test/health-broken.test.ts: a draining forge, a full disk and a red main each answerok:falsewith the reason underbroken. A database over 2 GiB sits undertodowithoktrue. No drill need appears.test/spawn-anon.test.tsand a header case totest/release-journey.test.ts.needsnow readbrokenandtodo. Tests that expectedok:falsefor a stuck run, an old queue or a red backup now expectok:truewith the cause listed. This is deliberate.test/cookie*.test.tsfails onhome_flow.ts:438, a file this pull doesn't touch. I did not check main directly.Not done
broken. The issue lists them, but neither was a need in vitals, and a memory floor would be new behaviour I couldn't test reliably here.Try it
healthtool as an admin on the preview:okis true, and the database need, if the preview's database is large, is undertodo.bun test test/health-broken.test.tsCloses #12071