Skip to content

A refused engine replacement keeps serving on the verified incumbent; it never empties a healthy node (card 931cfd22) - #5413

Merged
joelteply merged 3 commits into
canaryfrom
931cfd22/a-refused-elective-engine-replacement-ke
Oct 25, 2026
Merged

joelteply merged 3 commits into
canaryfrom
931cfd22/a-refused-elective-engine-replacement-ke

Conversation

@joelteply

@joelteply joelteply commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

How this serves the minds: enrico's residents were unhosted for 5+ hours because a refused engine replacement emptied a node whose engine worked. A working engine must keep serving its residents while a replacement waits (plan path step 1, "no relaunch while serving", and goal 9: a mind is never starved by its own substrate).

Card 931cfd22, handed to me by Codex, who keeps the fb58 geometry/budget work.

The outage (enrico / MacBookPro.lan, receipts in #continuum-dev)

  • From at least 04:21Z to 09:15Z, across the 09ac639, 9cac36c, 0051802 and eb4cf44 deploys, serving.reconcile read active=<none> ready=false on every tick, and citizen.health.hour read resident=0 verdict="empty".
  • serving/status: degraded_reason: "llama-server spawn failed: adopted checkpoint requires a known pool".
  • The incumbent, PID 29131, answered /health ok and a real /completion.
  • The chain: the daemon wanted a relaunch (--cache-ram 256 against 1,217 MiB wanted). Protect resident checkpoints before engine retirement #5348's checkpoint_adopted_before_replacement refused, because this core never installed a pool for an engine it didn't spawn. The refusal surfaced as Spawn(..), the outcome went Degraded, and the host reconciler (await_ready_serving) seated no one.
  • Restored by hand at 09:14Z (SIGTERM to the orphan; the core spawned its own engine). Ready at 09:15:43Z, 2 citizens hosted.

Change

  • LlamaServerError::RetirementRefused. retire_adopted's refusals made before any signal are now their own variant: custody refused, identity unverified, or the recorded lane belongs to another endpoint. Errors after a signal stay Spawn. It's no longer a spawn failure, so roll_back_engine_after_failed_launch (which matched Spawn) no longer rolls the engine binary back on a custody refusal. That was a second, latent harm of the same outage.
  • serve_or_adopt. On RetirementRefused, keep_incumbent returns AlreadyServing only when the incumbent serves the target model AND passes the same decode proof adoption uses (decode_smoke_ok; an all-occupied engine answers from /slots, never with a synthetic decode over a mind's KV, per A smoke decode never takes a slot holding a mind (the M5's cold misses) #5405). Anything else is Degraded, so a condemned engine is never advertised ready and another model is never reported as the target.
  • Probe. serving.replace.refused_kept_incumbent says each refusal once, not every 5 s tick.
  • Custody is untouched. The known-pool requirement stands and no KV is cleared.

Proof

tests/reconcile.rs::a_refused_replacement_keeps_a_verified_incumbent_and_only_that:

  • a healthy incumbent on the target, with a starved window forcing a relaunch and the retirement refused, is AlreadyServing (and the replacement was attempted once);
  • a decode-wedged incumbent is Degraded;
  • an incumbent on another model is Degraded.

Cost, stated

While the replacement stays wanted, each reconcile tick retries the refused retirement (a cheap refusal) and re-proves the incumbent. On an occupied engine that's one /slots read. On an idle one with empty slots it's a short generation, the same per-tick decode check orphan adoption already does. Making the replacement satisfiable (installing a pool for an adopted engine, so custody can checkpoint) is a separate step on the same card if Codex wants it.

Measured

  • Not compiled locally (enrico is serving); CI is the compile.
  • After deploy (owner Cormac, within a day): an adopted engine with a refused replacement shows refused_kept_incumbent once, ready=true, and residents hosted, instead of degraded_reason with nothing serving.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

… it never empties a healthy node (card 931cfd22)

enrico 2026-10-25, >=04:21Z to 09:15Z: the daemon wanted to replace an adopted
engine (--cache-ram 256 vs 1217 MiB wanted); #5348's checkpoint custody
refused ("adopted checkpoint requires a known pool"); the refusal surfaced as
LlamaServerError::Spawn, the outcome went Degraded, the snapshot read active
none / ready false, and no resident was seated while the incumbent decoded.

- LlamaServerError::RetirementRefused: retire_adopted's refusals before any
  signal (custody refused, identity unverified, another endpoint's lane) are
  their own variant. Not a spawn failure, so it no longer rolls the engine
  binary back either (roll_back_engine_after_failed_launch matched Spawn).
- serve_or_adopt: a RetirementRefused relaunch keeps the incumbent
  (AlreadyServing) only when it serves the target model AND passes the same
  decode proof adoption uses; otherwise Degraded, so a condemned engine is
  never advertised ready and another model is never reported as the target.
  serving.replace.refused_kept_incumbent says each refusal once.
- Custody is untouched: the known-pool requirement stands, no KV is cleared.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply and others added 2 commits October 25, 2026 04:31
…d back open (Codex on #5413)

- keep_incumbent also requires the KNOWN loaded adapter set to equal the
  target's (an unreadable or different set stays Degraded, so target genes
  are never published as loaded), and proves decode on every refusal with
  decode_smoke_ok (its seat is the scratch slot, an empty engine, or /slots
  when every slot holds a mind, so it never decodes over a mind's KV).
- The transition that closed the endpoint records what it found
  (found_ready, from send_replace's prior value); launch hands it back on a
  RetirementRefused (hand_back_unchanged), reopening only what was open and
  only while no owned generation or uncertain paging took its place.
  serving.replace.refused_handed_back says whether it reopened.
- Fixtures: changed genome + refused and unreadable genome + refused stay
  Degraded; on the real endpoint, an open endpoint refused with no known
  pool reopens and admits a turn, a closed one stays closed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply merged commit a7fdefd into canary Oct 25, 2026
36 of 39 checks passed
@joelteply
joelteply deleted the 931cfd22/a-refused-elective-engine-replacement-ke branch October 25, 2026 09:54
joelteply added a commit that referenced this pull request Oct 25, 2026
…ger race one admission store (card ee7753e7) (#5414)

fake_instance(name) used a fixed /tmp/fake-supervisor-test/{name}; 8 tests
share Paige and 5 Pax, and materialize_adapters opens the persona's
admission store before the factory, so two parallel tests could refuse a
seat at random (AdmissionRestore). Seen on #5413's mind job:
forwards_profile_errors_without_calling_factory build_count 0, expected 1.
The home is now unique per fixture, keyed by its fresh peer id.


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant