Repository navigation
fix(deploy): close the deploy loop — a recorded DeployRequest is reconciled against the running build - #4187
Merged
joelteply merged 1 commit intoSep 18, 2026
Conversation
…nciled against the running build
`decide` writes a DeployRequest and NOTHING EVER READ ONE BACK. The only non-test
references to the type in the tree were the struct and `write_deploy_request`, and
there was no completion concept anywhere in the deploy path. So "the deploy I asked
for has arrived" was not a fact the substrate held.
MEASURED on the Intel tier 2026-09-17/18 — both halves of the answer on one machine,
never compared:
~/.continuum/state/deploy-request.json tip_sha c2344d7...
running core 90194be
for ~2 hours, while the only way to learn the deploy had landed was to poll
`continuum ping` until the sha changed.
The worse half: a request that NEVER TOOK is indistinguishable from one still
working, because `continuum reboot` exits 1 while its build continues detached
(card 79faf35d). Tonight's deploy took ~2 h and two full continuum-core compiles;
a failed one would have looked exactly the same from outside.
THIS ADDS: a pure `reconcile_request(request, running_sha, build_in_flight, now)`
beside `decide`, returning Nothing / Settled{waited_ms} / InFlight{elapsed_ms} /
Stranded{elapsed_ms}. The module calls it with two facts it already gathers every
tick, probes `deploy.settled` (and retires the request) or `deploy.stranded`, and
is silent otherwise. No new state, no new file, no new cadence — the seam existed;
only its other half was missing.
`deploy.stranded` is the part nobody has today: a request that silently did not take
is currently invisible until someone notices the node is old. The fleet beacon
already broadcasts the ASK ("node X runs A while this runs B — reboot there");
nothing said the ask was ANSWERED.
ONE DETAIL THAT WOULD HAVE MADE THIS DEAD CODE: `running_sha()` is the SHORT form the
build stamps (`90194bead`) while a DeployRequest holds the FULL tip. An `==`
comparison never fires, `Settled` never returns, and the loop stays open while
looking closed — the same class the change is about. So `same_commit` is a prefix
match with git's 7-character floor, and the test pinning it uses this tier's real
values and fails against `==`.
Probe cadence: `deploy.stranded` is said ONCE per stranded tip, not every tick — the
condition is durable and the request file is the standing evidence; a per-tick repeat
is the chatty-floor failure that buries the line it exists to surface.
Receipt: cargo test -p continuum-core --lib --features llama/mac-cpu-only deploy_tracker
8 passed; 0 failed; 8295 filtered out. REAL_EXIT=0 (cargo's own).
No new rustc warnings (the baseline gate caught an earlier patch of mine tonight).
Card: 2fd80a0e-5b0c-46f4-821e-4aeae033279c
Related: 79faf35d (reboot exits 1 while the build continues detached)
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
deleted the
2fd80a0e/the-deploy-seam-is-write-only-a-deployre
branch
September 18, 2026 05:03
joelteply
added a commit
that referenced
this pull request
Sep 18, 2026
…t — it expired mid-swap on the Intel tier and condemned a healthy deploy (#4190) Measured 2026-09-18 on the Intel tier: `deploy.stranded` fired at 08:56:39Z for a deploy that came up healthy 25 minutes later. 07:50:26Z continuum reboot starts, writes the deploy claim 08:51:40Z deploy.track.request_written tip=ae5e5a3c8... 08:56:39Z deploy.stranded elapsed_ms=300004 <- claim age 66.2 min ~09:00Z "warm artifact validated in 4197s" <- build age 70.0 min ~09:2xZ ae5e5a3 answering, healthy Two defects in one chain. 1. CLAIM_MAX_AGE_MS was sized against the machines that reported first. Its own doc comment said so: "must comfortably exceed a COLD full build ... measured 292s and 530s here, 772s on BIGMAMA (#422). One hour is far above any of those." This tier's WARM build is 4,197s — 5.4x the largest of them. So the claim expired at minute 60 of a 70-minute build: the last ten minutes, which is exactly the swap window the claim exists to protect. From there `blocks()` read false and #422's guard against an implicit autostart minting a core from the pre-swap image was silently off. An expired advisory guard is indistinguishable from no guard. The ceiling now sizes against the risk it actually covers. A live claim is already gated on `owner_alive(pid)`; age only covers "the reboot was kill -9'd and the pid was reused". Four hours is ~3.4x the slowest build on record and still bounded — worst case remains a time-limited degradation of an advisory guard, never a wedge. SLOWEST_OBSERVED_BUILD_MS is named so that invariant is a test rather than a sentence in a doc comment the next slow tier quietly falsifies. 2. reconcile_request (mine, #4187) had no grace. It called Stranded on the first tick that could not see a build — 300004ms is exactly one tick after the request. The claim does not cover a deploy's whole life: stop, handoff, the new core's startup compile and boot all run with NO claim and the OLD sha, which is bit-for-bit what a dead reboot leaves behind. Only duration separates them, by orders of magnitude. STRANDED_GRACE_MS = 20 min, the same shape and reasoning as COLD_BOOT_BELOW_FLOOR_GRACE in the serving planner. Not cosmetic: "stranded" is the signal to relaunch, and a second build races the first on the shared CARGO_TARGET_DIR. Receipt: cargo test -p continuum-core --lib --features metal,accelerate -j 2 \ -- deploy_claim deploy_tracker 15 passed; 0 failed; 8293 filtered out; REAL_EXIT=0 lib test: 75 warnings, none naming deploy_claim or deploy_tracker The existing `a_request_that_did_not_take_is_stranded_not_in_flight` asserted Stranded at 60s with no claim; that assertion WAS the defect, so it now asserts past the grace. Mutation proof is by construction, not a second 30-minute build: against the pre-fix constants both new asserts are arithmetically false (3,600,000 >= 4,197,000 fails; 3,600,000 >= 8,394,000 fails) and pre-fix reconcile_request returns Stranded at 300_004 where the test demands InFlight. The rule worth carrying: a timeout sized against the fastest machines that have reported is not a bound, it is a race the slow tier loses every time — silently. Card: a476ea14-0199-421f-87a5-07ef9cdecd50 Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
joelteply
added a commit
that referenced
this pull request
Sep 19, 2026
…und, and uses the tracker's one sha rule Cormac's review of #4208: the task fires every 10 min, a build takes 50 here (70 on IntelMac), and the request stays on disk until Settled — so tick N+10 fired a second `reboot --service` into the first one's build; `reboot` never consults the claim (deploy_gate is the START verb's). Now consume_verdict reads deploy_claim::in_flight(root, now).blocks() and returns BuildInFlight — the fifth arm, mirroring runtime/deploy_tracker::decide — which outranks dirty and the ledger: nothing about that tick acts. An abandoned claim is still swept by reboot itself. Fable's carry: a tip green on CI can still fail on THIS box; without a bound the consumer rebuilt it every tick until the claim aged out. A per-tip ledger (deploy-consume-attempts.json beside the request) gives up after CONSUME_MAX_ATTEMPTS = 3 and leaves deploy.stranded as the receipt; a new tip resets it; success clears it. Compression: the 7-char sha-equivalence rule lived twice; the tracker's same_commit is pub and the consumer calls it (either spelling as the prefix, the test the #4187 review caught). CLI 47, runtime::deploy_tracker 8, hygiene green. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
joelteply
added a commit
that referenced
this pull request
Sep 19, 2026
…ume turns a DeployRequest into reboot --service on a schedule; --service no longer needs a hand-supplied artifact (82af11f5) (#4208) * feat(deploy): the 5090 consumes its own deploy requests — `continuum deploy-consume` turns a DeployRequest into `reboot --service` on a schedule, and `--service` no longer needs a hand-supplied artifact Card 82af11f5. The DECISION half of the deploy seam is Rust and runs on every node (DeployTrackerModule records state/deploy-request.json). The ACTION half was per-platform: the Macs' launchd script consumes the request and runs `continuum reboot`; on Windows nothing did, so the 5090 ran whatever a hand last typed — five hand deploys in one day while every merged fix sat unfelt on the one seat that mattered (Fable's count, 2026-09-18). - `continuum reboot --service` without `--prebuilt`: the RAM-gated warm build (`warm_build_allowed`, Fable's build-path rule) produces the artifact and the ContinuumCore supervisor takes it, prepared before the old core stops — same check, same ordering, the artifact from the build instead of a hand. With no artifact the service path REFUSES rather than falling back to a child launch (the job-object death this card names). - `continuum deploy-consume` (Windows): reads the request from the same root the tracker writes under; verdict is PURE — no request = nothing owed; the tip already running (7-char prefix) = the tracker retires it; a dirty checkout is REFUSED (a consumer never stashes an operator's tree); else fetch, check the tip out detached, `reboot --service`. The deploy claim it takes is what the tracker's #4187 reconcile reads; `deploy.settled` with no human in the loop is the receipt. - `deploy-consume --install` registers the `ContinuumDeploy` scheduled task (every 10 min, the supervisor's sibling); `--uninstall` removes it. Tests: the_deploy_consumer_deploys_only_a_clean_checkout_toward_a_tip_not_running (verdict vocabulary + option parse); `--service` alone moves from the refusal list to the valid set. CLI test binary 47 green. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc * fix(deploy): the consumer has an in-flight arm and a per-tip retry bound, and uses the tracker's one sha rule Cormac's review of #4208: the task fires every 10 min, a build takes 50 here (70 on IntelMac), and the request stays on disk until Settled — so tick N+10 fired a second `reboot --service` into the first one's build; `reboot` never consults the claim (deploy_gate is the START verb's). Now consume_verdict reads deploy_claim::in_flight(root, now).blocks() and returns BuildInFlight — the fifth arm, mirroring runtime/deploy_tracker::decide — which outranks dirty and the ledger: nothing about that tick acts. An abandoned claim is still swept by reboot itself. Fable's carry: a tip green on CI can still fail on THIS box; without a bound the consumer rebuilt it every tick until the claim aged out. A per-tip ledger (deploy-consume-attempts.json beside the request) gives up after CONSUME_MAX_ATTEMPTS = 3 and leaves deploy.stranded as the receipt; a new tip resets it; success clears it. Compression: the 7-char sha-equivalence rule lived twice; the tracker's same_commit is pub and the consumer calls it (either spelling as the prefix, the test the #4187 review caught). CLI 47, runtime::deploy_tracker 8, hygiene green. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc --------- Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
decidewrites a DeployRequest and NOTHING EVER READ ONE BACK. The only non-testreferences to the type in the tree were the struct and
write_deploy_request, andthere was no completion concept anywhere in the deploy path. So "the deploy I asked
for has arrived" was not a fact the substrate held.
MEASURED on the Intel tier 2026-09-17/18 — both halves of the answer on one machine,
never compared:
for ~2 hours, while the only way to learn the deploy had landed was to poll
continuum pinguntil the sha changed.The worse half: a request that NEVER TOOK is indistinguishable from one still
working, because
continuum rebootexits 1 while its build continues detached(card 79faf35d). Tonight's deploy took ~2 h and two full continuum-core compiles;
a failed one would have looked exactly the same from outside.
THIS ADDS: a pure
reconcile_request(request, running_sha, build_in_flight, now)beside
decide, returning Nothing / Settled{waited_ms} / InFlight{elapsed_ms} /Stranded{elapsed_ms}. The module calls it with two facts it already gathers every
tick, probes
deploy.settled(and retires the request) ordeploy.stranded, andis silent otherwise. No new state, no new file, no new cadence — the seam existed;
only its other half was missing.
deploy.strandedis the part nobody has today: a request that silently did not takeis currently invisible until someone notices the node is old. The fleet beacon
already broadcasts the ASK ("node X runs A while this runs B — reboot there");
nothing said the ask was ANSWERED.
ONE DETAIL THAT WOULD HAVE MADE THIS DEAD CODE:
running_sha()is the SHORT form thebuild stamps (
90194bead) while a DeployRequest holds the FULL tip. An==comparison never fires,
Settlednever returns, and the loop stays open whilelooking closed — the same class the change is about. So
same_commitis a prefixmatch with git's 7-character floor, and the test pinning it uses this tier's real
values and fails against
==.Probe cadence:
deploy.strandedis said ONCE per stranded tip, not every tick — thecondition is durable and the request file is the standing evidence; a per-tick repeat
is the chatty-floor failure that buries the line it exists to surface.
Receipt: cargo test -p continuum-core --lib --features llama/mac-cpu-only deploy_tracker
8 passed; 0 failed; 8295 filtered out. REAL_EXIT=0 (cargo's own).
No new rustc warnings (the baseline gate caught an earlier patch of mine tonight).
Card: 2fd80a0e-5b0c-46f4-821e-4aeae033279c
Related: 79faf35d (reboot exits 1 while the build continues detached)
Co-Authored-By: Claude Opus 5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE