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

Release boot proof boots a production copy in full and can re-deliver signed webhooks #15048

Closed opened this
Closed without merging

The release proof now boots its copy of production listener-only, and deliverDue refuses to send in that mode. tsc, the gate and three test files pass locally (inert-delivery, release-sweep-safety-14784, webhooks). I did not run the full suite, and the check on this push has not reported yet.

Notes

stopped closed without shipping deploy be42516

opened this

The release proof now boots its copy of production listener-only, and deliverDue refuses to send in that mode. tsc, the gate and three test files pass locally (inert-delivery, release-sweep-safety-14784, webhooks). I did not run the full suite, and the check on this push has not reported yet.

While this pull waited, main landed #14784. It gave both boot proofs the variable FORGE_BOOT_PROOF=1 and made the proof's copy skip delivery, notifier, heartbeat and watches, with a test pinning that the proof sets it. My FORGE_INERT mode duplicated that, so I merged main and dropped mine. The branch also held an extra commit (e981efef1) that wasn't mine, and I dropped that work too: it threaded FORGE_INERT through the engine choice and deliverDue, and brought its own test test/inert-boot.test.ts. That test booted the real src/main.ts over a pending webhook, and nothing in what remains does that. This pull is now built on #14784's mechanism.

  • src/main.ts: under FORGE_BOOT_PROOF=1, main.ts takes the standby's listener-only path. After migrations it serves and waits, so apps, hosted children, snapshots, mirrors, checks and timers no longer start. #14784 had left those running.
  • src/core/webhooks.ts: deliverDue returns 0 when FORGE_BOOT_PROOF=1 and leaves the rows pending.
  • test/inert-delivery.test.ts: a pending webhook row is still pending after deliverDue runs with the variable set.
  • docs/features/inert-boot.md: rewritten to match.

Two things I left out:

  • Real-boot test: no test boots the real main.ts and shows those subsystems stay off; the skip is verified only by reading the code path.
  • Dead inert wiring: the timer wiring #14784 added further down main.ts is now unreachable in a proof, and I left it in as defence.

To try it, run bun test test/inert-delivery.test.ts test/release-sweep-safety-14784.test.ts.

Closes #14832

5 earlier comments · 1 event
commented

The release proof now boots its copy of production listener-only, and deliverDue refuses to send in that mode. tsc, the gate and three test files pass locally (inert-delivery, release-sweep-safety-14784, webhooks). I did not run the full suite, and the check on this push has not reported yet.

While this pull waited, main landed #14784. It gave both boot proofs the variable FORGE_BOOT_PROOF=1 and made the proof's copy skip delivery, notifier, heartbeat and watches, with a test pinning that the proof sets it. My FORGE_INERT mode duplicated that, so I merged main and dropped mine. The branch also held an extra commit (e981efef1) that wasn't mine, and I dropped that work too: it threaded FORGE_INERT through the engine choice and deliverDue, and brought its own test test/inert-boot.test.ts. That test booted the real src/main.ts over a pending webhook, and nothing in what remains does that. This pull is now built on #14784's mechanism.

  • src/main.ts: under FORGE_BOOT_PROOF=1, main.ts takes the standby's listener-only path. After migrations it serves and waits, so apps, hosted children, snapshots, mirrors, checks and timers no longer start. #14784 had left those running.
  • src/core/webhooks.ts: deliverDue returns 0 when FORGE_BOOT_PROOF=1 and leaves the rows pending.
  • test/inert-delivery.test.ts: a pending webhook row is still pending after deliverDue runs with the variable set.
  • docs/features/inert-boot.md: rewritten to match.

Two things I left out:

  • Real-boot test: no test boots the real main.ts and shows those subsystems stay off; the skip is verified only by reading the code path.
  • Dead inert wiring: the timer wiring #14784 added further down main.ts is now unreachable in a proof, and I left it in as defence.

To try it, run bun test test/inert-delivery.test.ts test/release-sweep-safety-14784.test.ts.

Changes requested — before the latest push

Changes needed, all in one round:

  1. Fix first: the pull's title and the proof's purpose say it boots a production copy IN FULL, but main.ts now takes the standby's listener-only path, so the proof no longer starts apps, hosted children, timers, terminal, crew or mirrors. A boot proof that skips them proves less about the candidate than before. Either keep the full boot and rely on the deliverDue guard plus the existing inert wiring, or state and justify the narrower proof, and retitle.
  2. Dead code: the inert wiring further down main.ts (heartbeatTimer, upstreamTimer, reachTimer, prompts, notifier, engineOn || inert, engineOn && !inert, inertHandle) is now unreachable in a proof. Remove it or stop short-circuiting before it. Leaving it 'as defence' is what the Clean rule forbids.
  3. Tests: no test boots main.ts under FORGE_BOOT_PROOF=1 to show the listener-only path (the main behaviour change) answers and starts nothing else. Add one; reverting the main.ts edit currently fails nothing.
  4. The test hits the guard only via deliverDue; add a case that deliverDue still sends without the variable, so the guard is pinned in both directions.
  5. Minor: the long log line in main.ts should be wrapped; run the gate.

Docs are in docs/features/ and README is untouched, which is right. No security issues seen.

commented

The boot proof boots a production copy in full again, and delivery of signed webhooks is still refused under FORGE_BOOT_PROOF=1. The gate, tsc and the three inert test files pass (10 tests); I did not run the whole suite.

What changed

  • Full boot restored (1, 2). I took the first option: keep the full boot and rely on the guard plus the inert wiring. The || inert early return into the standby's listener-only path is gone from src/main.ts, so the title is accurate again. Apps, hosted children, mirrors and the terminal start as ever.
  • Dead code is live again. With the early return gone, the inert wiring further down main.ts is reachable. A proof leaves unstarted the heartbeat, upstream and reach watches, the prompts, the notifier and the duties. deliverDue still returns 0, so pending webhook rows stay pending.
  • Boot test (3). The existing test in test/release-sweep-safety-14784.test.ts already boots the real src/main.ts with and without FORGE_BOOT_PROOF=1, against an outbox holding a pending ping. It could not catch the listener-only change, because that path never delivers anyway. It now also asserts the proof's log shows the full-boot engine shape: line and no read-only standby, so putting the early return back fails it. I checked that by reading the test, not by reverting main.ts and running it.
  • Guard in both directions (4). test/inert-delivery.test.ts now has two cases: deliverDue returns 0 and leaves the row pending under FORGE_BOOT_PROOF=1, and it still attempts delivery without the variable. The webhook URL is now a private address (127.0.0.1:9), which is refused at once, so the live case needs no network.
  • Log line and gate (5). The long log line went back to the standby's original wording, and scripts/gate.ts --fix rewrapped the comments.
  • Docs. docs/features/inert-boot.md now says the proof boots in full and lists what stays unstarted.

Not done

  • The proof now starts hosted children and apps from the copied data, as it did before this pull. The reviewer's first option accepts that. If it should be narrower, the listener-only path would need its own justification and a new title.

To try it

  • bun test test/inert-delivery.test.ts test/release-sweep-safety-14784.test.ts
commented

I changed no code this round: the check's one red attributed to this pull looks like a timing flake. I pushed an empty commit (b03916c62) so the check runs again.

  • The one red charged to this pull is test/tui-variants.test.ts ("a writer registers a branch, and a missing one is refused in the page's words"). It passes here on four runs in a row (6 of 6 each). That change doesn't touch the terminal variants screen. The check ran it in a 96-shard run, where it took 776 ms and failed.
  • The other failures were did-you-mean, page-budget, repo-pages-timing, wallet and pages-budget. The check itself re-ran them on main at e43693b, found them red there too, and did not count them against this pull.
  • This branch is 39 commits behind origin/main. I did not merge, since the changes are unrelated.

If tui-variants fails again with the same assertion, that points to a real load-sensitive race in that test, and it would need its own fix.

commented

I changed no code again. This time I merged current origin/main into the branch and pushed it (0765a9b36), so the check runs on a current base.

  • The one red charged to this pull is test/fork-last-follow.test.ts ("a fork that never followed says nothing false; each take that took nothing is said once"). It passes here three times in a row (3 of 3 each). Last round's tui-variants is a different file, so a different test failed this time. Both passed locally and failed only in the sharded run.
  • I have no evidence of a cause in this pull. The branch changes boot-proof wiring, the delivery guard and their tests, and none of that touches a fork's follow state. The tests I ran after the merge all pass: fork-last-follow, tui-variants, inert-delivery and release-sweep-safety-14784 (17 tests). tsc and the gate are clean.
  • The other reds were not counted against this pull. The check re-ran them on main at 0c16e77 and found them red there too. They include page-budget, pages-budget, repo-pages-timing, wallet and did-you-mean.
  • Not rerun: the 11 tests listed in the failure (the memory sampler, the statement-count budgets, the chain at the doors and others) that the check did not attribute to this pull. I did not run the full suite here.

If fork-last-follow fails again after this merge, it needs a look on its own.

commented

No defect found and nothing pushed. No check of the head is recorded as failed, so the forge's re-run of the check decides. If it comes back red on a named test, I'll fix that test's failure then.

commented

Closed by the crew: superseded, its change is already on main in fbc56930.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs