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

Parked opened this in answer to
Closed without merging

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.

Notes

opened this

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' needs is replaced by broken (act now) and todo (would like done). Each degraded entry now carries a tier. Only broken makes ok false.
  • 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 makes ok false 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 health tool's description now says ok is false only for what is broken now, and that todo is 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 answer ok:false with the reason under broken. A database over 2 GiB sits under todo with ok true. No drill need appears.
  • Added a probe-exempt spawn case to test/spawn-anon.test.ts and a header case to test/release-journey.test.ts.
  • Existing tests that read needs now read broken and todo. Tests that expected ok:false for a stuck run, an old queue or a red backup now expect ok:true with the cause listed. This is deliberate.
  • Failures I did not fix:
    • test/cookie*.test.ts fails on home_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 health tool as an admin on the preview: ok is true, and the database need, if the preview's database is large, is under todo.
  • bun test test/health-broken.test.ts

Closes #12071

5 earlier comments · 2 events
commented

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' needs is replaced by broken (act now) and todo (would like done). Each degraded entry now carries a tier. Only broken makes ok false.
  • 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 makes ok false 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 health tool's description now says ok is false only for what is broken now, and that todo is 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 answer ok:false with the reason under broken. A database over 2 GiB sits under todo with ok true. No drill need appears.
  • Added a probe-exempt spawn case to test/spawn-anon.test.ts and a header case to test/release-journey.test.ts.
  • Existing tests that read needs now read broken and todo. Tests that expected ok:false for a stuck run, an old queue or a red backup now expect ok:true with the cause listed. This is deliberate.
  • Failures I did not fix:
    • test/cookie*.test.ts fails on home_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 health tool as an admin on the preview: ok is true, and the database need, if the preview's database is large, is under todo.
  • bun test test/health-broken.test.ts
commented

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:

  • unreached fails because src/crew/week_burn.ts is imported by nothing under src/.
  • header-width fails because header comments run over 160 columns in home_flow.ts, lanes_read.ts, lanes.ts and surfaces-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-batched and attention tests.

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.

commented

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.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

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 function brokenCause is gone. A new cause can no longer become todo by accident, because the call must name its tier. Broken are disk, disk-floor, disk-red and red:<repo>. Every other call is todo.
  • Tier tests: test/health-broken.test.ts asserts the tier of red:, disk, disk-floor and a disk-NN mark. The existing tests already cover the database size.
  • Health and the pager agree: I removed domainDrillLines from src/crew/notify.ts, its call in the notifier and its test block in test/notify-causes.test.ts. The pager no longer announces a domain drill need that health dropped. The explanatory comment in vitals.ts is removed too. The restore-drill line (drillLines) stays, since health still raises that one as a todo.
  • headersFor helper: the long ternary-and-cast line in src/release/journey.ts is now a headersFor(url, own) helper, and call is 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 ;; in test/capacity.test.ts is now a plain function that reads .broken and .todo. I did not use allNeeds, 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

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

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/main in 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-names and OpenAPI failures name the broker commit a32d4b6fa, which is already on main. It adds /settings/origins/broker/callback, a broker top-level page, and the BROKER_COOKIE and VIEW_COOKIE cookie 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-line on 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' needs is replaced by broken (act now) and todo (would like done). Each degraded entry carries a tier, and only broken makes ok false.
  • 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 makes ok false 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/health on the preview and check ok, broken and todo.
  • Run bun test test/health-broken.test.ts test/vitals.test.ts.
  • Once main is green again, a re-run of the check should show only this pull's own results.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs