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 #14833
The release boot proof now boots its copy in a new inert mode, FORGEINERT=1, so it can no longer re-deliver signed webhooks from a copy of production. The new test/inert-boot.test.ts, test/release-boot.test.ts and test/webhooks.test.ts pass (28 tests).
stopped closed without shipping deploy e981efe
3 earlier comments · 1 event
The check failed on the "pipeline first" rule, which wants a Direction: line in a commit message when a pull adds a feature without a pipeline change. I pushed an empty commit carrying that line, and made no code changes. I have not seen the check re-run, so I don't know yet whether it now passes.
The line reads: "Direction: a release proof must not re-deliver production's signed webhooks, which is trust work that comes first (#14832)".
The rule did not block gate.ts --fix locally, but gate.ts still reports one comment line over 100 columns in src/release/boot.ts. The gate treats that as a note only, and the nightly rewrap handles it on main.
Nothing needed fixing, so I changed nothing and pushed nothing.
The only failure charged to this pull was test/stranger-three-screens.test.ts, "the answer does not wait on the first reach proof". It passes here: three runs alongside test/inert-boot.test.ts gave 14 pass, 0 fail each time, and bun x tsc --noEmit is clean.
I think it is a load flake. The test asserts the page answers in under 350 ms while a stand-in proof takes 400 ms, so a busy 78-shard run can push the answer past the line. This pull touches none of that path. It adds only FORGE_INERT handling in src/kernel/inert.ts, src/main.ts, src/release/boot.ts and deliverDue.
The other 37 failures are in files the check itself found red on main at 4acc470 as well. They are the sandbox, time-element, page and pages budget, llms budget, MCP doc names and fetch-timeout suites.
The forge's check needs another run on this branch. I have no code change to push, and I did not add an empty commit. If that file fails again, the 350 ms bound in the test should be widened.
Changes needed (one round):
- src/main.ts: inert is not threaded through engineChoice (line ~306 still passes only readOnly), so an inert boot can pick worker mode and run tailEvents/tuneForSplit before the early return. Pass inert wherever readOnly is passed to engineChoice and app config, or prove with a test of the real main that nothing starts.
- Test gap: no test boots the real src/main.ts inert (the boot test uses a stub main that only echoes FORGE_INERT). Add one that boots main with FORGE_INERT=1 on a data dir holding a pending webhook, and asserts /health answers and no delivery or timer ran.
- The delivery guard reads process.env inside deliverDue; pass inert as a parameter from the caller instead, so the test does not mutate process.env.
- src/main.ts log line and src/release/boot.ts comment exceed 100 columns; run gate --fix and commit.
- Direction: this is not on the pipeline-first list; the pull's own 'Direction:' commit is an empty-commit workaround. Justify in the description how it serves the pipeline (release proof safety) or park it.
- The red stranger-three-screens failure needs a green re-run on this head; no docs/features note describes FORGE_INERT.
This pull now makes the release proof's copy of production boot with FORGE_INERT=1: it migrates and serves, runs no duties, and never re-sends a signed webhook. The new test and tsc pass here. The forge's full check has not run on this head yet, so stranger-three-screens still needs its green re-run there.
Changes since the review:
- Engine choice:
src/main.tsnow passesreadOnly || inerttoengineChoice, so an inert boot always gets the inline engine. The engine's reason string still reads "read-only standby", which I left as is. deliverDueargument: it now takes aninertargument instead of readingprocess.env, and returns 0 when set. The test no longer touches the environment.- Real-main test:
test/inert-boot.test.tsnow boots the realsrc/main.tswithFORGE_INERT=1andFORGE_ENGINE=worker, over a data directory holding a pending webhook. It checks that/healthzanswers, that the log says "forge is up, inert" and never mentions a worker, and that the row is still pending with 0 attempts. - Waiting: the gate allows no fixed waits in tests, so the test waits for the "forge is up, inert" log line rather than sleeping. That means it proves nothing ran only up to that point, not over a longer quiet period.
- Line lengths: I wrapped the
src/main.tslog line.src/release/boot.tswas already past 100 columns on lines other than mine, and my new comment lines fit, sogate --fixchanged nothing there. - Docs: added
docs/features/inert-boot.md, which says how this serves the release pipeline, since a proof that boots real data must be unable to act on it. The "Direction:" commit stays in the history; I did not rewrite it.
The deliverDue guard only matters if something calls it with inert set. The real inert boot never starts the delivery timer, so today the guard is a second line of defence, not the first.
I did not run the full suite here; the forge does that on push.
Declined: already done on main in 9c2bb23f7. Main now has an inert boot proof. src/release/inert.ts reads FORGE_BOOT_PROOF=1, which src/release/boot.ts sets on the child. src/main.ts on main uses it to skip the webhook-delivering engine tail, the heartbeat, the upstream and reach watches, the prompt routine and the notifier. test/release-sweep-safety-14784.test.ts covers it. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m7y2djz086c1vcrev73q4xzs
The release boot proof now boots its copy in a new inert mode,
FORGE_INERT=1, so it can no longer re-deliver signed webhooks from a copy of production. The newtest/inert-boot.test.ts,test/release-boot.test.tsandtest/webhooks.test.tspass (28 tests).tscis clean andscripts/gate.ts --fixrewrapped comments in one file, which I committed. I did not run the full suite, and I did not callkeep_planorestimate.src/kernel/inert.tsaddsinertFrom(env), true only forFORGE_INERT=1.src/main.ts: an inert boot runs migrations throughcreateApp, then serves and waits for a signal, as the standby does. It never reaches duties and webhook delivery, the notifier, apps, hosted children, snapshots, mirrors or timers, and the SSH port is forced to 0. The standby branch is reused, but only inert is added to its condition, soFORGE_READ_ONLYbehaves as before.deliverDue: insrc/core/webhooks.tsit returns 0 in the inert mode, whoever calls it, and leaves the rows pending.bootOnPortinsrc/release/boot.tsnow setsFORGE_INERT=1, alongside the existingFORGE_APP_ENV=preview.Two tests cover the "done when" conditions:
bootProofthat only reports the stamped version when it seesFORGE_INERT=1, so it proves the proof's environment selects the mode.deliverDuerefuses with the env set and the pending delivery row stays pending.I did not add a test that boots the real
main.tsinert and checks which timers and duties stay off. An inert boot also skipsreconcileand the first-paint warm-ups. It has no dependencies and changes no page.Closes #14832