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… #12075

Parked opened this in answer to
Closed without merging

The admin health answer now reports ok true when the forge is serving and nothing is broken. I haven't checked it on production; that depends on how the 2 GiB database need and the memory floor read there. The affected tests pass and bun x tsc --noEmit and bun scripts/gate.ts are clean.

Notes

opened this

The admin health answer now reports ok true when the forge is serving and nothing is broken. I haven't checked it on production; that depends on how the 2 GiB database need and the memory floor read there. The affected tests pass and bun x tsc --noEmit and bun scripts/gate.ts are clean. I did not run bun scripts/design-lint.ts (no src/web/ change), and I did not run the whole suite; the forge's check does.

What changed

  • Ok: an admin's health answer, which is what the MCP health tool returns, now has broken (act now) and todo (would like done) beside needs. ok is false only when broken is non-empty.
  • Broken:
    • a draining forge
    • a platform incident
    • a database that doesn't answer
    • disk under its floor, or a disk-full red
    • a red main
    • an open database file
    • host memory under 64 MiB
    • three or more unclean starts in 15 minutes
  • Todo: everything else, including the database size and growth needs, an unproven release, a stale platform view, queue waits, stuck runs and a stopped backup check.
  • Sentence: the admin answer carries one, says. It reads either "serving and nothing is broken now; N would like doing, under todo" or "not well: N broken now".
  • Drill need: the "no drill ever ran for compute, snapshots, credential, runner" need is gone from vitals.
  • Journey prober:
    • The release journey now sends the forge's probe header, and only to the forge it walks.
    • The spawn door skips the per-minute plan limit and the daily allowance for a request carrying that header, and doesn't count it. Strangers are still limited.

Tests

  • test/health-broken.test.ts covers the draining, full-disk and red-main cases, each with ok false and the reason under broken.
  • It also covers todo-only needs, no drill need, and the probe header.
  • test/spawn-anon.test.ts has a probe that passes an exhausted limit while a stranger still gets 429.
  • I changed these tests because they asserted the old semantics, where any need made ok false:
    • test/vitals.test.ts: the queue, stuck-run and key-set tests now expect ok true with the cause under todo.
    • test/backup-truth.test.ts: a stopped backup check now leaves ok true.
    • test/vitals-domain-drill.test.ts: the last test now expects no drill need.
  • test/mcp-size.test.ts passes without touching the ceilings.

Left out

  • The owner-notification path (src/crew/notify.ts, domainDrillLines) still raises the domain-drill notice; I only removed the vitals need.
  • A stranger's ok is unchanged. It still comes from the platform guard, which counts a stale platform view as not ok. Only the admin answer moves a stale view to todo.
  • A crash loop is judged from the boots ledger, and the memory floor is a fixed 64 MiB. Both are guesses; say if you want other numbers.

Try it Call health over the MCP as an admin. ok should be true, broken empty, and the database-size and release needs under todo.

Closes #12071

3 earlier comments
commented

The admin health answer now reports ok true when the forge is serving and nothing is broken. I haven't checked it on production; that depends on how the 2 GiB database need and the memory floor read there. The affected tests pass and bun x tsc --noEmit and bun scripts/gate.ts are clean. I did not run bun scripts/design-lint.ts (no src/web/ change), and I did not run the whole suite; the forge's check does.

What changed

  • Ok: an admin's health answer, which is what the MCP health tool returns, now has broken (act now) and todo (would like done) beside needs. ok is false only when broken is non-empty.
  • Broken:
    • a draining forge
    • a platform incident
    • a database that doesn't answer
    • disk under its floor, or a disk-full red
    • a red main
    • an open database file
    • host memory under 64 MiB
    • three or more unclean starts in 15 minutes
  • Todo: everything else, including the database size and growth needs, an unproven release, a stale platform view, queue waits, stuck runs and a stopped backup check.
  • Sentence: the admin answer carries one, says. It reads either "serving and nothing is broken now; N would like doing, under todo" or "not well: N broken now".
  • Drill need: the "no drill ever ran for compute, snapshots, credential, runner" need is gone from vitals.
  • Journey prober:
    • The release journey now sends the forge's probe header, and only to the forge it walks.
    • The spawn door skips the per-minute plan limit and the daily allowance for a request carrying that header, and doesn't count it. Strangers are still limited.

Tests

  • test/health-broken.test.ts covers the draining, full-disk and red-main cases, each with ok false and the reason under broken.
  • It also covers todo-only needs, no drill need, and the probe header.
  • test/spawn-anon.test.ts has a probe that passes an exhausted limit while a stranger still gets 429.
  • I changed these tests because they asserted the old semantics, where any need made ok false:
    • test/vitals.test.ts: the queue, stuck-run and key-set tests now expect ok true with the cause under todo.
    • test/backup-truth.test.ts: a stopped backup check now leaves ok true.
    • test/vitals-domain-drill.test.ts: the last test now expects no drill need.
  • test/mcp-size.test.ts passes without touching the ceilings.

Left out

  • The owner-notification path (src/crew/notify.ts, domainDrillLines) still raises the domain-drill notice; I only removed the vitals need.
  • A stranger's ok is unchanged. It still comes from the platform guard, which counts a stale platform view as not ok. Only the admin answer moves a stale view to todo.
  • A crash loop is judged from the boots ledger, and the memory floor is a fixed 64 MiB. Both are guesses; say if you want other numbers.

Try it Call health over the MCP as an admin. ok should be true, broken empty, and the database-size and release needs under todo.

commented

Nothing in the deploy log shows a failure, so I haven't changed or pushed anything. The preview deployed and answers:

  • The log ends with ready:, serving and done for https://lab--12075--forge-trevato-apps.open-platform.sh.
  • GET / and GET /api/v1/health on the preview both return 200 right now.
  • "no tests declared, none run" is a status line about the deploy step. forge.json declares no tests for the app; the checks sit under check, and the forge runs those on the push.

If the forge still marks the deploy as failed, I need the verdict line or the check log that says so, because the deploy log you pasted ends in success. The working tree is clean and the branch is pushed as it was.

commented

This push fixes the gate failures on #12075. bun scripts/gate.ts and bun x tsc --noEmit now pass, and so do test/health-broken.test.ts and test/spawn-anon.test.ts (14 tests). I did not run the full suite; the forge's check does that on this push.

  • Comment wrapping: I rewrapped the six comment lines the gate flagged to 100 columns or fewer. They are in src/kernel/boots.ts, src/kernel/vitals.ts (two), src/release/journey.ts, src/spawn/door.ts and test/spawn-anon.test.ts.
  • Test cast: the platform-incident test in test/health-broken.test.ts no longer casts with as never. Its incident record already matches the Incident type, so the cast could just go.

Only comments and that one test line changed, so nothing in the behaviour of the health change moves. The pull's description from the earlier run still stands.

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