Repository navigation
A core handoff closes in-engine training admission before its hold read, so no run starts between the guard and the stop (card 91921d0f) - #5553
Merged
joelteply merged 2 commits intoOct 28, 2026
Conversation
…ad, so no run starts between the guard and the stop (card 91921d0f) Codex on #5551: the deploy's hold guard was one preflight read, so a training run admitted after it and before the stop was still killed. - Engine (serving_lifecycle + new serving_lifecycle/handoff.rs): LifecycleGate holds a reversible handoff close owned by a process (pid + OS start time). close_for_handoff takes the gate, so an admission deciding now finishes and publishes its hold first; every later admission is refused GateRefusal::Handoff (a wait, never a failure) until reopen_after_handoff(token) or the owner's verified death (a reused pid is dead; an unreadable table is not). A stale token never reopens a newer close. - serving/handoff-close {ownerPid} -> Closed{token} | Busy (a serving operation holds the gate) | NoServing; serving/handoff-reopen {token} -> {reopened}. Privileged. - deploy_hold::verdict(close, observed, force): a free hold proceeds only with admission closed or nothing to close; a busy or failed close defers (forceable, said); a core that predates the close (asked by name through its commands/list) proceeds on the read alone and says the window stays open. - reboot(): closes before observe_engine_hold; a thin wrapper reopens on any error, since a handoff that did not stop the core must admit again (past the stop the core is gone, and a restored or new one boots open). running_core_call carries params; running_core_provenance is it with none. Tests (local): handoff::only_a_verified_dead_owner_releases_a_close, serving_lifecycle::a_handoff_close_refuses_admission_until_its_own_token_reopens_it (mutant ignoring the close fails it), deploy_hold::a_free_hold_proceeds_only_with_ admission_closed_or_nothing_to_close, serving handoff::name_and_access_wired. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…at its own path, and a malformed command list is a failure (Codex on #5553) At 2e30920: - continuum.rs put #[path = "continuum/reboot.rs"] on mod handoff_admission, leaving mod reboot without its path (E0583 in CI). Each module now has its own path. - close_for_handoff replaced any standing close, so handoff B could close then reopen (or die) while handoff A, which had already read a free hold, went on to its stop with admission open. A close held by a live or unverifiable owner is now never replaced (HandoffCloseOutcome::Taken, serving/handoff-close -> taken{ownerPid}, which the CLI defers on); only a verified-dead owner's close is. Another handoff's token never reopens it. - A commands/list reply without a commands array mapped to NotSupported (proceed on the read alone); only a well-formed list lacking the command is an older core, anything else is Failed (defers). Regression: serving_lifecycle::a_second_handoff_never_releases_a_live_owners_close (a mutant that replaces a live close fails it). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply
deleted the
91921d0f/a-core-handoff-closes-in-engine-training
branch
October 28, 2026 07:00
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.
How this serves the minds: a persona's training run is never started into a core that's about to stop, so a deploy can't kill a run that #5551's guard didn't see coming. This advances the lifecycle work (deploys that preserve work) and goal 8, whose runs these are. It completes the race Codex scoped out of #5551, card 91921d0f.
Why
#5551's guard reads the node's training hold (
serving/statusheld_for) once, then stops the core. A run admitted after that read and before the stop was killed anyway (Codex on #5551).The engine's last gate before
POST /trainis the serving lifecycle gate.training_admission::wait_for_training_memory_boundtakes it, leases memory, and records the engine residency thatheld_forreads, all under the gate. A refusal there means "wait and retry", never "fail". So closing admission there, and only then reading the hold, makes the read final.system/shutdown-draincan't do this job: it is one-way by design (AdmissionGate::close,ShutdownOperation.started), and a refused handoff has to admit again.Change
serving_lifecycle.rs, newserving_lifecycle/handoff.rs):LifecycleGateholds a reversible handoff close, owned by a process identified by pid plus OS start time.close_for_handofftakes the gate, so an admission deciding right now finishes and publishes its hold first. Every later admission is refused withGateRefusal::Handoff, a wait.reopen_after_handoff(token)releases it, or the owner's verified death does. A reused pid counts as dead; an unreadable process table does not. A stale token never reopens a newer close.continuum-serving, both Privileged):serving/handoff-close {ownerPid}returns one of:Closed { token };Busy: a serving operation holds the gate, and nothing is closed;NoServing: this core admits no in-engine training.serving/handoff-reopen {token}returns{ reopened }.continuum-cli-lifecycledeploy_hold::verdict(close, observed, force), pure):--forceoverrides it and says so.commands/listfor the command by name, so a deploy away from an old core is never blocked.reboot()(continuum-corebin):observe_engine_hold.running_core_callnow carries params;running_core_provenanceis it with none.Tests
handoff::only_a_verified_dead_owner_releases_a_closeserving_lifecycle::a_handoff_close_refuses_admission_until_its_own_token_reopens_itHandoff. A stale token reopens nothing. The right token reopens. A close waits for an admission that is deciding.deploy_hold::a_free_hold_proceeds_only_with_admission_closed_or_nothing_to_closehandoff::name_and_access_wiredcontinuum-corebinary.Measured after deploy
Owner: Cormac, with Codex on the consumer. When: the first deploy on a node that has this build.
What it should show:
serving.handoff.closed, then the hold read, then either the stop, or a refusal followed bytraining admission reopened.core_handoffas its admission refusal, then admits on the new core.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE