Skip to content

A launch from a pinned slot takes tail_tools before its /props answer - #5538

Merged
joelteply merged 4 commits into
canaryfrom
fable/tail-tools-at-launch
Oct 29, 2026
Merged

joelteply merged 4 commits into
canaryfrom
fable/tail-tools-at-launch

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the minds' speed (plan path 1, order-of-work line 2: a mind's context as an epoch). A restart must not throw away every resident's warm prefix.

What

After a restart the lane's tail_tools evidence stayed unknown until some reconcile read /props, and unknown counted as "no". So each resident's first act sent all 38 tools and her next act sent the learned head. That is two head changes, two full re-prefills and one view turnover per restart.

  • launch.rs: expect_launched_engine (it replaces forget_served_engine) seeds the evidence from the launched binary's slot stamp. An unstamped binary stays unknown.
  • reconcile.rs: observe_launched_engine reads the new lane's /props as soon as the launch answers ready, so the engine's own report replaces the stamp before any act reaches it.

Measured

Removed: forget_served_engine.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

After a restart, the serving lane's tail_tools evidence was unknown until a
reconcile happened to read /props, and unknown read as "no". Every
resident's first act sent the full 38-verb surface, and her next act the
learned head. That was two head changes, two full re-prefills, and a view
turnover per restart (the M5, 2026-10-27 17:53Z: restores matched 32 tokens
of ~150k; Aiko's recall block re-rendered).

- launch.rs seeds the evidence from the launched binary's slot stamp
  (expect_launched_engine replaces forget_served_engine). An unstamped
  binary stays unknown.
- reconcile.rs reads the new lane's /props as soon as a launch answers
  ready (observe_launched_engine), so the engine's own word replaces the
  stamp before her acts reach it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Blocking finding at exact 07644dc: launch_prepared calls expect_launched_engine before restoration validation, install receipt confirmation, local-input validation, transition acquisition, checkpointing and retirement. Those paths may refuse while the incumbent still serves, but the global capability has already been replaced by the candidate binary's stamp. Requests can then select tail_tools using evidence for an engine that never launched.

Publish candidate evidence only after excluding incumbent consumers and establishing the owned candidate process, with failed/cancelled launch cleanup bound to that incarnation. Add a launch-path refusal regression where incumbent and intended candidate differ in capability and an early validation/transition refuses. The new pure test directly constructs ServedEngine and does not test this ordering. This review is not a PASS despite current green CI.

joelteply and others added 2 commits October 29, 2026 16:32
…as spawned

Codex at 07644dc: expect_launched_engine published the intended binary's
stamp as the serving lane's evidence at launch_prepared entry, before
validate_restoration, the receipt and inputs checks, transition_if, the
checkpoint and the retirement. Any of those could refuse while the incumbent
kept serving, so the incumbent was advertised the unlaunched candidate's
tail_tools capability.

- engine_features.rs owns the publication: LaunchedEvidence publishes the
  slot stamp for the spawned incarnation (pid + start time + port) and, when
  dropped unkept, puts the incumbent's evidence back unless a newer reading
  replaced it.
- launch.rs publishes right after install_child: the transition has drained
  the incumbent's readers and the candidate exists. ReadyTail carries the
  publication, so the kept-launch machinery decides its fate: publish keeps
  it (Kept::disarm), a kept loading launch keeps it, and a failed, cancelled
  or discarded launch withdraws it.
- The lane's evidence cell is a field on LlamaServerProcess (the serving
  lane's static for the live lane, none for an ephemeral one), so the launch
  tests drive the real ordering against their own cell.
- reconcile.rs: observe_launched_engine moved out of the middle of
  keep_incumbent's doc comment.

Tests (late_ready.rs): a launch refused at its admission leaves the
incumbent's (pinned) evidence; a published launch keeps the candidate's
(unstamped) evidence; a discarded launch withdraws it to the incumbent's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: M and removed size: S labels Oct 29, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

At exact 2b37cbf the premature-publication finding is fixed: publication follows transition and install_child. One remaining rollback defect: LaunchedEvidence::drop restores the previous incumbent snapshot, but launch_prepared has already checkpointed/retired/killed that incumbent before publishing the candidate. On a discarded candidate, restoring that dead process capability is false evidence. The new a_discarded_launch_withdraws_the_candidates_evidence test explicitly asserts this restoration.

Withdraw to unknown/empty (only if this publication is still current); preserve incumbent evidence only on early refusal before any replacement publication, as the new early-refusal test already checks. Invert the discarded-launch expectation and retain newer-reading protection. Also require a known owned incarnation before a stamped candidate capability is published; publish currently accepts None while takes_tail_tools only examines build. Narrow follow-up requested, not a reopening of the already-fixed ordering issue.

@joelteply

Copy link
Copy Markdown
Contributor Author

Source review PASS at ec11c47, carrying forward the prior full source review and rechecking this two-file repair. Both follow-up findings are resolved: discarded publication clears only its own still-current evidence, rather than restoring the retired incumbent; a missing process incarnation cannot publish the slot build. Early refusal remains before publication. The discarded-launch regression now asserts empty evidence and no tail_tools capability.

Independently observed exact-head continuum-engine CI SUCCESS (plus mind/cognition/serving and source hygiene). Core and dreaming were still running at this check; merge remains subject to those required checks. No local execution or live deployment certification claimed. Unknown-incarnation guard is source-verified; this patch does not add a stamped-artifact regression for it. My source review no longer blocks this head.

@joelteply
joelteply merged commit 0aef796 into canary Oct 29, 2026
31 checks passed
@joelteply
joelteply deleted the fable/tail-tools-at-launch branch October 29, 2026 22:15
joelteply added a commit that referenced this pull request Oct 29, 2026
…and no stale owned launch (Codex on #5535)

Merge: canary (ef6a641) and fable/tail-tools-at-launch (ec11c47, #5538, not yet on canary).
engine_features.rs conflict: #5538's LaunchedEvidence replaces #5535's forget_served_engine
(launch.rs had already dropped its call); #5535's served_engine_reading stays as the receipt's
reader.

1. Provenance is typed in the one evidence owner. ServedEngine is now
   Unknown | Launched{incarnation, slot_build} | Observed{incarnation, build}. LaunchedEvidence
   publishes Launched (Unknown for an unreadable incarnation); a /props answer replaces it with
   Observed; a transient error keeps a Launched stamp Launched, never promoting it. tail_tools
   (takes_tail_tools) reads either; the deploy receipt reads only observed_reading(), so
   deploy-verify cannot pass on a slot stamp the live engine never reported.

2. No stale owned launch. hold_current_engine_to_pin returns Result<PinHeld, EngineUnpinned>
   (NoSlots, Unpinned, Untargeted, PromoteRefused, DeployInFlight), decided by the pure settle().
   engine_bin refuses through engine_for_launch before resolving any binary, so prepare returns
   LlamaServerError::EngineUnpinned before any transition. The reconcile keeps a fitting
   incumbent (keep_incumbent, never signalled), takes no rollback relaunch, and reports a blocked
   engine convergence once (serving.engine.convergence_blocked) instead of relaunching onto an
   unpinned binary. The "a mute resident is worse" serve-on-anything policy is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
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