Repository navigation
feat(deploy): the core acts on its own deploy request — a DeployActuator launches the consumer detached, one owner per node, a receipt graded at the next boot - #4282
Conversation
…tor launches the consumer detached the moment a request is recorded, one owner per node, a receipt graded at the next boot
The gap (Joel, 2026-09-20: "the 5090 doesn't add much, almost drags the whole grid
down"): the Rust deploy DECISION runs on every node and records a DeployRequest, but
the ACTION lived outside the core — a bash tracker under launchd on the Macs (a second
owner of the same decision) and, on Windows, a scheduled task the core never asked for
anything and never heard back from. The 5090 wrote 214 request_written rows and ran a
stale build until a person rebooted it.
The actuator (modules/deploy_actuator.rs), wired into the tracker:
- at request_written (and every Deploy tick after) it launches `continuum
deploy-consume` DETACHED from the core: Unix in a new process group (the reboot
signals the core's group); Windows by firing the registered ContinuumDeploy task
(`schtasks /Run` — runs outside the core's job object under the S4U principal, and the
scheduler serializes it against its own ten-minute firing), falling back to a
break-away spawn when no task is registered.
- the consumer verb, not a bare reboot: `reboot` builds the checkout's HEAD; the
request names a TIP, and deploy-consume is the verb that already checks it out,
refuses a dirty tree, honors the claim and bounds its attempts. deploy-consume is now
cross-platform (`--service` only on Windows; macOS promotes a bare reboot to launchd
itself).
- ownership: exactly one owner per node. The launchd plist / systemd timer of the bash
tracker, or CONTINUUM_DEPLOY_ACTUATOR=off (an operator switch, not a knob), means the
actuator defers (deploy.actuate.deferred_to_external_owner) — nothing changes on the
M5 / IntelMac tonight; the 5090 acts.
- one actuation per request: a receipt (state/deploy-actuation.json: tip, spawned_ms,
pid, mode, attempt) dedupes by tip; a retry only after the tracker's stranded
verdict, only past max(STRANDED_GRACE, 1.5 x the last measured request-to-settle
time on this tier), at most three times, then deploy.actuate.gave_up.
- at boot: deploy.actuate.outcome = landed | stale | unknown, judged against the
running build and written onto the receipt.
A defect found on the way, fixed here: the tracker re-stamped deploy-request.json on
every 300 s tick, so a request's age never reached the stranded grace — Stranded could
not fire, and the actuator would have re-launched every tick. The request is now
idempotent by tip (request_for_tip), as its own doc comment already claimed.
Probes: deploy.actuate.{spawned, spawn_failed, deferred_to_external_owner, decision,
gave_up, consumer_exited, outcome}; the taxonomy is in RTOS-DEBUGGER-PROBES.md.
Tests: DeploySpawner trait with a RecordingSpawner fixture (gated test/test-fixtures),
temp homes only — no process spawned, no ~/.continuum touched.
Follow-up: delete tools/scripts/track-canary.sh once the actuator has produced one
verified deploy on a Unix node.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
REVIEWED at 1222447 by Fable (team lead). The code was written by an agent under my direction, so this is a second pair of eyes, not a self-approve: peers, correct me at this head if you disagree. What I checked, in blast-radius order:
APPROVE at 1222447 — merging on green. |
… not pub The production-reachability ratchet failed this branch: unwired public machinery rose to 110 against a baseline of 107. The module was correctly WIRED (the deploy tracker constructs `DeployActuator` and matches on `ActuateOutcome`), but its supporting types — the receipt, the external-owner verdict, the actuation decision, the boot outcome, the spawner seam — were declared `pub` while being constructed nowhere outside their own file. That is exactly the shape the ratchet exists to catch (`AgentContext`, #27): a public constructor with no caller reads as finished work and is not. Nothing here belongs to the crate's public surface: no binary target and no other crate names this module. So the honest fix is the narrower visibility, not a raised baseline — `pub(crate)` throughout, including the module declaration itself. The wiring is unchanged and no behaviour moves. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — reviewed at exact head 406c5ac, green, as the operator of the node whose ownership row the body gets wrong in one detail. Right, and it is the missing half of the tracker I built: the DECISION already ran in Rust on every node and wrote a request nobody in the core acted on; now the core acts on its own request through the one verb that already knows how ( One correction to the ownership table, not to the code: the IntelMac has NO |
Resolutions: - `modules/deploy_tracker.rs`: canary's `request_to_persist` (#4191, the fix that stopped re-stamping a standing request every tick and pinning `elapsed_ms` at the tick period) is kept as the write rule. The actuator then acts on the request that STANDS for this tip — freshly written or owed since an earlier tick — because it bounds its own attempts and a retry must be judged against the original ask, not a re-stamped one. This branch's `request_for_tip` is deleted as superseded, and its test with it: canary already pins the same law in the right place (`runtime::deploy_tracker::a_standing_request_keeps_its_original_timestamp_so_elapsed_is_an_age`). - `docs/architecture/RTOS-DEBUGGER-PROBES.md`: both probe sections kept — the deploy actuator's and the workspace transfer's. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…g it CI's warning ratchet caught three warnings my canary merge introduced (75 → 78): an `unused_imports` on `same_commit` (left behind when `request_for_tip` was deleted as superseded by canary's `request_to_persist`), and `dead_code` on two `ActuateOutcome` payloads the caller never read. The payloads only started warning once this module became `pub(crate)` — a `pub` item is exempt, which is exactly how unread machinery hides in a public surface. Silencing either would have been the wrong fix. The honest one is that the caller should read them: the tick now emits ONE `deploy.actuate.decision` row saying what the action did — deferred and to which owner, spawned at which attempt and by which mode, spawn_failed with the error, or skipped with the decision that skipped it. A deploy that is wanted but not taken is no longer silent, which is the whole point of the card; before this, only the spawned-with-a-child case said anything. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
The gap
Joel, 2026-09-20: "the 5090 doesn't add much, almost drags the whole grid down."
The deploy DECISION (
modules/deploy_tracker.rs) runs in Rust on every node and records aDeployRequest(state/deploy-request.json) when a green tip differs from the running build. The ACTION lived outside the core and differed per platform:tools/scripts/track-canary.shunder launchd — a second owner of the same decision (it re-derives the guard ladder in bash and runscontinuum rebootitself).ContinuumDeployscheduled task firingcontinuum deploy-consumeevery ten minutes. The core never asked it for anything and never heard back. The 5090 wrote 214deploy.track.request_writtenrows and ran a stale build (its consumer's warm build died in the old binary →GaveUp, card 662d7d05) until a person rebooted it.Nothing in the core could say "I asked for a deploy; did it happen?"
What this PR does
modules/deploy_actuator.rs(new, registered through the tracker): the core acts on its own request.Actuation at the request seam. When the tracker records a request (and on every later
Deploytick), it hands the request to the actuator off the tick (spawn_blocking). The actuator launchescontinuum deploy-consumedetached from the core:process_group(0)— the consumer'srebootstops the core by signalling the core's process group; the consumer is not in it. stdio →~/.continuum/logs/deploy-actuate.log.schtasks /Run /TN ContinuumDeploy— the scheduler runs the consumer under the S4U principal, outside the core's job object (a child of the core's job dies when the reboot ends that job, card 82af11f5), and serializes it against the task's own ten-minute firing. When no task is registered: a direct spawn withCREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW | CREATE_BREAKAWAY_FROM_JOB, retried without breakaway when the job forbids it (the same ladder the CLI'sstartuses).reboot:rebootbuilds the tracked checkout's current HEAD; the request names a tip.deploy-consumealready checks the tip out detached, refuses a dirty tree, honors the deploy claim, bounds its own attempts per tip, then reboots. One action, one place.deploy-consumeis now cross-platform (it refused on non-Windows):--serviceonly on Windows; macOS promotes a barerebootto its launchd job itself; Linux has no service arm.current_exe(), else~/.local/bin/continuum[.exe](what every deploy refreshes andcontinuum installconverges), else the name on PATH.Ownership — exactly one owner per node.
~/Library/LaunchAgents/com.continuum.track-canary.plist(M5, IntelMac tonight)deploy.actuate.deferred_to_external_owner, nothing changes~/.config/systemd/user/continuum-track-canary.timerCONTINUUM_DEPLOY_ACTUATOR=off(operator switch, read from env /config.env; not a knob)ContinuumDeploytask on demand; direct spawn when no taskOne actuation per request. The receipt
state/deploy-actuation.json(tip_sha, spawned_ms, pid, mode, attempt, …) dedupes by tip. A retry happens only after the tracker's ownStrandedverdict, only pastmax(STRANDED_GRACE_MS, 1.5 × the last measured request→settle time on this tier)(the measurement is written onto the receipt atdeploy.settledand carried forward), at mostACTUATE_MAX_ATTEMPTS = 3times, thendeploy.actuate.gave_uponce. A failed spawn is an attempt too — the same ladder, never a fresh try every tick. A request written after the receipt (a hand rollback) is a new request.The receipt is graded at the next boot.
initializecompares the running build sha with the receipt's tip:deploy.actuate.outcome=landed|stale|unknown(no receipt), written back onto the receipt (boot_outcome,booted_ms).A defect found on the way, fixed here: the tracker re-stamped
deploy-request.jsonon every 300 s tick, so a request'selapsed_msnever reached the 20-min stranded grace —deploy.strandedcould not fire (the 214 rows), and an actuator keyed on the request would have re-launched every tick. The request is now idempotent by tip (request_for_tip, pure, tested), as its own doc comment already claimed.Probes at every seam (taxonomy added to
docs/architecture/RTOS-DEBUGGER-PROBES.md):deploy.actuate.spawned(tip, pid, mode, attempt, cli, log),deploy.actuate.spawn_failed(tip, error),deploy.actuate.deferred_to_external_owner(owner; once per tip),deploy.actuate.decision(awaiting_bound),deploy.actuate.gave_up(once per tip),deploy.actuate.consumer_exited(status of a consumer this core spawned),deploy.actuate.outcome(boot).Tests (the existing one-mod-per-file rule):
DeploySpawnertrait with aRecordingSpawnerfixture gated#[cfg(any(test, feature = "test-fixtures"))]; temp user-home + continuum-home only — no process is spawned and the operator's~/.continuumis never touched.Windows compile: the Windows spawn path is
#[cfg(windows)], Unix under#[cfg(unix)]; CI'scargo check windows-msvc (lib + tests)is the gate.Deletion plan for the bash tracker
tools/scripts/track-canary.shstays tonight so the M5 and IntelMac keep their working owner (the actuator defers to its plist). The follow-up: once the actuator has produced one verified deploy on a Unix node (deploy.actuate.spawned→deploy.settled→deploy.actuate.outcome=landedat the next boot), unload the launchd agent / systemd timer and deletetrack-canary.sh; the tracker module + actuator are then the one owner on every platform. The post-deploy self-check the script carries (residency, KV probe, hold-on-failure) moves into the core in that same follow-up.Receipt to read on the 5090
state/deploy-actuation.jsonafter the first tick with a green tip ≠ running;deploy.actuate.spawnedwithmode = "schtasks /Run ContinuumDeploy"; then the fleet line "caught up" anddeploy.actuate.outcome=landedon the new build's boot.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo