Skip to content

A core holds its node to the engine its source pins (card a3e92354) - #5535

Open
joelteply wants to merge 16 commits into
canaryfrom
fable/deploy-manifest
Open

joelteply wants to merge 16 commits into
canaryfrom
fable/deploy-manifest

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

How this serves the minds: a resident's restart cost depends on the engine that saved her pages. On 2026-10-27 a stale engine made every restart re-prefill ~140k tokens per resident, and nothing noticed. This advances plan line 1 (the build loop) and line 3b (one live engine, minds' memory moved by us).

What changed

  • engine_pin.rs owns the pin. It holds PINNED_ENGINE (compiled from vendor/LLAMA_CPP_PIN, moved here from engine_features). Before every launch (prepare.rs) and before the reconcile's engine convergence (reconcile.rs), it holds the current slot to the pin:
  • ping reports enginePin and engineStamp. PingResult.ts is regenerated.
  • deploy-verify (and so every reboot) fails with "ENGINE NOT PINNED" when the stamp is not the pin, after giving the core up to 60 s to re-pin.
  • docs/architecture/NODE-DEPLOYMENT.md: a node's deployment as one record, each fact's owner, and the open lines, each with an owner.

Measured

  • Incident (M5, 2026-10-27):
  • Tests (M5, serving down, 17:46–17:55Z):
    • continuum-engine engine_pin + engine_features: 3 passed.
    • continuum bin deploy_verify: 1 passed.
    • continuum-core lib health + ping bindings: 33 passed.
  • After deploy (owner Fable, by the next M5 deploy window):
    • ping shows engineStamp == pin.
    • A deliberately stale current is re-pinned at launch, read from the serving.engine.repinned probe.

Not in this PR

  • deploy --here (3922030f, Fable).
  • The Unix stamp naming the gitlink, not the working-tree submodule (Codex, under a3e92354).

Reviewer: @codex (serving).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

The M5 ran fork e7e1077b3 from 14:05Z to 16:38Z on 2026-10-27 under cores
pinning 741b0175b. A worktree `install --core` promoted the main checkout's
older pin, and two `reboot --prebuilt` deploys printed "deploy verified"
about the core alone. That engine saved pages with only their head
checkpoint, so a restore matching 151,069 of 154,040 tokens re-prefilled
~140k per resident.

- engine_pin.rs owns PINNED_ENGINE (moved from engine_features) and holds the
  current slot to it before every launch and before the reconcile's engine
  convergence. It promotes a slot holding the pin on the same backend
  (verified first), or fires serving.engine.unpinned once and keeps serving.
  Never under an operator override or a deploy claim.
- ping reports enginePin and engineStamp (PingResult.ts regenerated).
- deploy-verify fails "ENGINE NOT PINNED" when the stamp is not the pin,
  after up to 60 s for the core to re-pin.
- docs/architecture/NODE-DEPLOYMENT.md: a node's deployment as one record,
  its owners, and the open lines (deploy --here 3922030f; the Unix stamp
  naming the gitlink, Codex).

Tests (M5, serving down): engine_pin + engine_features 3 passed;
deploy_verify 1 passed; continuum-core health/ping bindings 33 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: 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 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
@joelteply

Copy link
Copy Markdown
Contributor Author

Review at exact f90724a: changes requested.

  1. deploy-verify proves the installed pointer, not the running engine. Ping.engine_stamp calls current_engine_stamp -> installed_engine_stamp. hold_current_engine_to_pin can promote the pointer while the old engine still runs (reconcile/checkpoint/relaunch can fail or remain in progress), and engine_verdict immediately prints engine verified for that installed stamp. Report installed and served incarnation/build separately and require the live owned engine to match before success. Regression: pinned current slot plus mismatching live engine must fail until actual adoption/relaunch is verified.

  2. engine_verdict returns Ok when enginePin is missing/empty or engineStamp is absent. Those are indistinguishable from missing evidence, yet bypass verification under an older-core/operator explanation. Remove the backward-compatibility success and encode explicit supported non-serving/operator modes if needed; missing required managed-engine evidence must refuse. Tests currently require this false success and need inversion.

Also choose() constrains only the second stamp field (backend), ignoring the CUDA architecture suffix and accepting any backend when current stamp is missing. Use the existing platform/artifact compatibility authority, not an unconstrained missing-current fallback. Add missing-current and incompatible-architecture cases.

joelteply and others added 2 commits October 29, 2026 16:51
…ot pointer (Codex on #5535)

Codex at f90724a: ping.engineStamp was the INSTALLED slot stamp, and
hold_current_engine_to_pin promotes that pointer before the lane relaunches,
so "engine verified" could print while the old engine still served. A
missing pin or stamp also returned success, and choose() matched only the
backend word, ignoring CUDA architectures, with any backend accepted when
the current stamp was missing.

- engine_report.rs (new) owns the ping engine report and the verdict.
  EngineReport::Owned { pin, installed, served } keeps the installed slot
  stamp apart from the served engine: the reconcile's own /props build_info
  reading (engine_features SERVED_ENGINE), counted only when its incarnation
  is the live lane's, OS-confirmed, plus the slot stamp the lane's binary
  was launched from. EngineReport::Operator { pin, bin } is the typed
  LLAMA_SERVER_BIN mode, never an absence.
- engine_verdict passes only for a live owned engine that reports the pin
  and runs from the installed slot. No install, an unpinned slot, no served
  reading, a stale or unreadable build, or a binary from another slot
  refuses (ENGINE NOT VERIFIED / PINNED / ADOPTED). A ping without
  `engine` refuses. deploy-verify waits DEFAULT_SERVING_WAIT (one cold
  relaunch) instead of a flat 60 s.
- engine_pin: EngineStamp parses commit + target; a candidate must carry
  exactly the current slot's verified target (backend and CUDA archs, the
  installer's STAMP_WANT). A current slot with no readable stamp promotes
  nothing (PinChoice::Untargeted, serving.engine.untargeted).
- ping: engine_pin/engine_stamp replaced by `engine` (no back-compat);
  PingResult.ts, EngineReport.ts, ServedEngineReport.ts written to the
  ts-rs shape (regenerate to confirm).

Tests (not run; serving node): engine_report 3 new (pinned slot + stale
live engine fails until adopted; missing evidence refuses, operator mode
named; a reading counts only for the live incarnation); engine_pin adds
CUDA-arch mismatch and missing-current cases. Old deploy_verify test that
required the false success is removed with the verdict it tested.

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

Copy link
Copy Markdown
Contributor Author

Review of 9205d0c: the previous missing-owned-evidence and CUDA-target-selection findings are addressed, with useful regressions. Two remaining integration/policy issues prevent a full PASS:

  1. Keep launch evidence distinct from observed serving evidence when integrating A launch from a pinned slot takes tail_tools before its /props answer #5538. This PR's ServedEngine::reading returns any incarnation/build pair as the engine's own /props result. A launch from a pinned slot takes tail_tools before its /props answer #5538 ec11c47 publishes a slot-derived build into that SAME cell before /props and retains it on a transient read failure. Combining the two can make deploy-verify assert that the live engine reported its build when it has never answered. Preserve provenance in the evidence owner (e.g. typed launched vs observed state), allow the launch capability consumer its intended evidence, but require observed /props evidence for this deployment receipt. Add a combined regression: known live incarnation + pinned launch stamp + no successful props => not adopted; successful matching props => adopted.

  2. hold_current_engine_to_pin still returns unit and prepare proceeds to engine_bin when Unpinned/Untargeted or promotion fails. The new source explicitly says it keeps serving the old engine because a mute resident is worse. Joel's current instruction expressly rejects these fallback policies. A new owned launch without a compatible pinned artifact must return a typed refusal, propagated through prepare; an incumbent transition must preserve custody/state while reporting the blocked convergence. Test missing pin, unknown target, and promotion failure cannot launch the stale binary. This is an implementation requirement, not a request to abruptly kill an incumbent.

No local test execution claimed. The deployment report's explicit operator mode is distinct from missing owned evidence; the remaining launch-policy issue is not resolved merely by making deploy-verify fail afterward.

joelteply and others added 2 commits October 29, 2026 17:14
…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
@joelteply

Copy link
Copy Markdown
Contributor Author

Follow-up at 1dd2baa: typed Launched/Observed provenance and observed_reading resolve the false /props evidence finding, and the refusal path now reaches prepare before transition. The combined evidence regression covers launch-only, failed props and successful props. Source-scoped PASS on those changes; no test execution claimed.

Remaining P1: the checked artifact is not the launched artifact. hold_current_engine_to_pin reads current and its stamp, returns only PinHeld, then prepare::engine_for_launch calls server_bin(), which rereads current and may select a different slot (or Legacy/Path if the selector disappeared). This is particularly explicit in settle(Pinned, deploy_owns_pointers=true), which permits launch while the deploy can change that selector. A concrete interleaving is: validate pinned engine-a; deploy promotes engine-b; server_bin resolves engine-b without checking its pin. The launch can still violate this PR's core invariant.

Return a checked launch artifact containing the resolved path/stamp and its installation custody, consume that artifact through spawn, and avoid re-resolving current after validation. A claim snapshot or second read alone does not exclude concurrent replacement. Use the existing artifact/custody owner rather than another independent lock scheme. Add an interleaving regression that changes current between validation and launch: launch must retain the validated, protected artifact or refuse, never launch an unchecked replacement or Legacy/Path. NoSlots refusal is correct; the current DeployInFlight exception is not proven safe.

joelteply and others added 3 commits October 29, 2026 17:32
# Conflicts:
#	core/continuum-engine/src/inference/llama_server/engine_features.rs
#	core/continuum-engine/src/inference/llama_server/reconcile.rs
…rrent` (Codex P1 on #5535)

hold_current_engine_to_pin returned only a verdict; prepare then called server_bin(),
which re-read `current` and could launch a slot a deploy promoted after validation, or
the pre-slot install / PATH when the selector vanished.

- The hold now returns a CheckedEngine artifact (llama_server/checked_engine.rs): the
  validated slot's binary, its root, slot name and stamp (or an operator's own engine).
  PinChoice::Pinned and PinHeld carry the slot and stamp; PinHeld::Operator is gone.
- PreparedLocalLaunch carries the artifact in place of engine_program; every reader takes
  the program from it. server_bin is no longer on the launch path (Legacy/Path cannot launch).
- Custody reuses the slot rule idle_slot already enforces: it never builds into the current
  slot, nor one a live lane's record names. CheckedEngine::confirm re-reads "still current
  with the validated stamp" at the launch's two brackets beside the install receipt's
  confirm (before the transition, and right before the spawn); the lane record takes over
  once spawned. A promotion, vanished selector or rebuilt stamp refuses with
  EngineUnpinned::Superseded. The deploy-in-flight pinned-slot launch stays, because the
  same confirm refuses a promotion made during it.
- Deleted: engine_for_launch and its test, note_unowned_launch (its bare-PATH launch can no
  longer happen), server_bin's import into the launch path.

Test: checked_engine::a_selection_moved_after_validation_never_changes_what_launches
(promote another slot, remove the selector, rebuild the slot; with and without a deploy
holding the claim).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ry builder honors it (Codex on #5535)

Custody is a reservation in the slot owner, not an observation. engine_slots::SlotReservation
is a file under <slot root>/reservations/ naming its owner (pid + OS start time), so the
installer's `continuum engine idle-slot` (install-llama-server.sh and windows-service.ps1 both
select through it, in another process) honors it like a lane record.

- engine_slots::select_idle_slot is the one selection: installer exclusions, then live
  reservations, then live lane records (reservations read first: a launch drops its
  reservation only after its record is written, so a selection never misses both).
  run_verb's idle-slot uses it.
- A reservation whose owner is verified gone decays and is removed; an unreadable owner or
  file holds its slot; a file naming no slot fails the read (fail closed).
  engine_residency::process_liveness_with is the one pid+start-time rule, now shared by
  EngineIncarnation and the reservation.
- prepare takes the reservation right after the pin hold (CheckedEngine::reserve, which then
  observes the validated stamp: a build that chose the slot first has already removed it).
  launch_prepared takes it before retiring the incumbent (a relaunched retained recipe
  reserves anew); a refusal there preserves the incumbent. The launch drops it once the lane
  record is written; if the record write failed it is retained beside the child and released
  at verified exit, like the page-dir reservation.
- CheckedEngine::confirm is now an observation only: the slot still holds the validated stamp
  (EngineUnpinned::Rebuilt); EngineUnpinned::Unreserved for a reservation that could not be taken.

Tests: checked_engine::a_reserved_slot_is_never_built_over_and_the_launch_runs_what_it_validated
(promote away and remove the selector while reserved: idle-slot never chooses the slot, the
launch keeps the validated binary; drop releases it; a slot rebuilt before the reservation is
refused), engine_slots::tests::reservations::launch_reservations_hold_until_their_owner_is_verified_gone.

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

Copy link
Copy Markdown
Contributor Author

#5535 29906ec reservation review: still blocked on atomic build-vs-launch admission. select_idle_slot reads reservation files and RETURNS an idle path, but acquires no builder claim. SlotReservation::acquire publishes a launch file independently. Concrete interleaving: builder selects A while unreserved; pause builder before stamp removal; launch reserves A and confirm sees old matching stamp; builder resumes and overwrites A. The comment that a build which chose first has already removed its stamp is false: idle-slot selection and shell mutation are separate operations/processes. Existing regression reserves first then selects; it cannot expose this ordering.

Move selection plus builder claim and launch reservation into the SAME cross-process custody transaction, retained by the builder until publication/exit and by the launch through lane-record handoff. A snapshot file and second stamp read do not exclude a writer that already selected the slot. Test select/claim-first vs launch-first interleavings with barriers, including delay before invalidation; exactly one incompatible claim must succeed. Reuse the deployment/slot custody owner rather than a launch-only advisory file protocol.

joelteply and others added 2 commits October 29, 2026 17:58
…ke (Codex on #5535)

idle-slot printed an UNCLAIMED path: a builder could select engine-a, pause, and overwrite it
after a launch had reserved and validated it. Now both take the same claim before acting:
<slot root>/reservations/<slot>, created with create_new (O_EXCL), recording kind, owner pid
and its OS start time. Exactly one owner holds a slot.

- `continuum engine idle-slot --owner-pid <pid>` is select-AND-claim (engine_slots/claim.rs
  claim_idle_slot): it claims candidates in the idle preference order, then verifies the claimed
  slot against FRESH lane records and `current` (a launch releases its claim only after its
  record is written), releasing and moving on when it is no longer idle. The path is printed
  only once the claim exists; the claim belongs to the installer's process.
- `continuum engine release-slot <slot> --owner-pid <pid>` releases it (only the owner's).
  install-llama-server.sh passes $$ and releases from an EXIT trap; windows-service.ps1 passes
  $PID and releases in finally blocks (Prepare-CoreServiceEngine, and every refusal in
  Select-CoreEngineSlot / Get-CoreEngineIdleSlot after a claim). Help gates match the new verbs.
- A claim whose owner is verified gone is reaped by the next claimant (moved aside atomically and
  re-checked; a claim taken meanwhile is restored with hard_link, which never overwrites); an
  unreadable owner or unparseable claim holds (fail closed).
- The launch's SlotClaim creates the same file (kind=launch), shared in-process by the live and
  ephemeral lanes' launches and removed by the last; a held claim refuses Unreserved in prepare,
  before any retirement. Deleted: the read-then-skip reservation reader (reserved_slots) and
  select_idle_slot.

Tests: checked_engine::a_build_and_a_launch_never_hold_one_slot_and_the_launch_runs_what_it_validated
(builder claims A then a launch is Unreserved; launch holds A then builds claim C or NoIdleSlot
across a promotion and a vanished selector; drop releases), engine_slots::tests::reservations::
one_claim_per_slot_reaped_only_when_its_owner_is_verified_gone (dead builder reaped, unreadable
holds, release only by owner, in-process launch sharing), install-llama-server-slots.test.sh
(claims for the installer pid and releases it; passes locally), the PowerShell fixtures updated
(not run here: no pwsh on this host).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…scratch files are swept (Codex on #5535)

A crash between create_new and writing the owner left an EMPTY claim that held its slot until
an operator removed it. Claims are now written complete and fsynced to a uniquely named scratch
file in the claims dir (`.claim.<pid>.<start_s>.<nonce>`), then published with
std::fs::hard_link, which fails with AlreadyExists when the claim exists (the same exclusive
create) and never exposes an empty or partial claim; the scratch file is removed after. Reap
tombstones carry their writer the same way (`.reaped.<pid>.<start_s>.<nonce>`), and the restore
still uses hard_link.

- sweep_strays (run before every claim) removes scratch files whose writer, named in the file
  name, is verified gone; a live writer's are kept.
- An unparseable claim can now only be corruption: it keeps holding, and says so with the
  typed probe serving.engine.claim_corrupt naming the file.

Test: engine_slots::tests::reservations::a_claim_is_published_whole_or_not_at_all_and_dead_strays_are_swept
(a staged-but-unlinked claim leaves no claim and the slot claimable; a dead writer's staged
claim and tombstone are swept, a live writer's kept; the published claim is whole).

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

Copy link
Copy Markdown
Contributor Author

Review at 06d21dc: shared atomic publication is the right direction, but two paths still break exclusivity.

[P1] reap_if_dead can move a LIVE successor claim out of the namespace. Interleaving: reapers R1 and R2 both read dead claim D; R1 renames/removes D and owner A links a live claim; R2 now renames path (A) to its tombstone based on its stale read of D. Before R2 re-reads/restores A, owner B hard-links its claim into the now-empty path. A and B have both succeeded and can mutate/use the slot concurrently. R2's restoration gets AlreadyExists, discards A's tombstone, and reports an error, but that cannot revoke either granted owner. Rename-and-recheck is not conditional removal. Serialize reap/publication/release with one cross-process lock in this owner, or use a proven OS-lock lifetime protocol; retain the complete owner/generation identity on release. Add a barrier regression with two reapers and a newly published live owner, asserting it can never be displaced or coexist with a second winner.

[P1] the script capability branch silently bypasses claims for the currently installed old CLI. install-llama-server.sh now requires help containing idle-slot --owner-pid, but on failure goes through the pre-slot direct install path. windows-service.ps1 likewise returns null then Select-CoreEngineSlot uses the process-table fallback. Any CLI with existing slots but without this new option takes the unsafe path instead of refusing. This is precisely the mixed-version deployment where the new custody matters. Require the supported claim-capable CLI (or stage the matching lifecycle tool first), refuse missing capability, and remove the legacy/process-table write fallback. Add fixtures for an old slot-capable CLI missing --owner-pid and assert zero build/mutation. No backwards-compatibility exception is authorized by Joel's current requirement.

No independent execution claimed; no custody PASS yet.

… cannot claim is refused (Codex on #5535)

1. Reaper race. Two reapers could both read a dead claim; after one reaped it and a new owner
published, the second (acting on its stale read) displaced that LIVE claim, and a third owner
could publish too. Rename-and-recheck was not a conditional removal.
- One exclusive OS file lock, `<slot root>/reservations/.lock` (std File::lock: flock on unix,
  LockFileEx on Windows; the OS drops it with its holder, so it is never stuck), is held across
  every claim transition: sweep of dead scratch files, judge-and-reap of a dead claim, publish
  (scratch write + hard_link) and release. Held for the transition only, never across a build
  or a launch.
- Under the lock a reap is a plain conditional remove: the rename/tombstone/restore dance is
  deleted. Release verifies the owner's full identity (kind, pid AND start time, so a reused
  pid is another owner); a launch claim keeps its Owner for that.
- Regression (claim.rs tests): reaper R1 is stopped INSIDE its judgment of the dead claim by a
  barrier in its probe while reaper R2 and a fresh publisher A start; neither runs until R1
  finishes; exactly one winner, and the claim on disk is the winner's.

2. Script fallback. A CLI without `idle-slot --owner-pid` is now refused, with no build and no
write:
- install-llama-server.sh checks it before anything is written (before the placement record in
  config.env), exits 1 naming the lifecycle tool to update; the pre-slot direct install for an
  old CLI is deleted. start-server.sh's build-only pass hands the installer the CLI that deploy
  just built.
- windows-service.ps1: Get-CoreEngineIdleSlot throws the same refusal (missing CLI, unreadable
  help, or no --owner-pid) and the process-table selection in Select-CoreEngineSlot is deleted.
- Fixtures: the bash test's old slot-capable CLI is refused with the home tree byte-identical and
  no engine verb called (passes locally); windows-service.test.ps1 refuses an old CLI and a
  missing one, with and without -SkipIfBusy, and asserts no CLI action and `current` unchanged;
  the receipt-migration scope mocks the selector (not run here: no pwsh on this host).

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

Copy link
Copy Markdown
Contributor Author

Scoped source review PASS at 1969bda for the two findings in my preceding review: the OS file lock now serializes reap/judge/publication/release; release matches the full owner; and missing claim-capable CLI no longer selects an unclaimed write path. The barrier regression covers competing reapers and publisher under that lock. This is not an execution receipt or a full deployment approval.

Please move the Windows claim-capability check before the already-pinned promotion path as discussed. Missing capability should refuse before slot mutation. Keeping an incumbent alive on installation refusal preserves its custody; report refusal explicitly rather than successful installation/adoption.

@joelteply

Copy link
Copy Markdown
Contributor Author

Exact-head CI follow-up for 1969bda:

  • Engine tests fail to compile: E0615 in core/continuum-engine/src/inference/llama_server/late_ready.rs:403 accesses kept.engine_program as a field after it became a method. Native interop preceding this passed 108/0; Rust custody tests have not passed.
  • Source hygiene: claim.rs:135 uses SystemTime::now outside the shared EpochMs clock boundary. Use the existing uniqueness primitive for the staged filename instead of exempting this code.
  • Core job stops at warning ratchet, 14 vs baseline 13. Log includes unused import in inference/engine_slots.rs:28; fix the introduced warning, do not increase baseline. It did not reach a successful core test verdict.
  • Windows custody/lifecycle jobs were skipped; the short windows-msvc status does not establish Windows runtime behavior.

Prior scoped source review is not a green-head or deployment approval. Please rerun after repairs, including the Windows pre-promotion capability check already discussed.

…d no clock (pid + start time + counter); the test-only claim re-export is cfg(test); Windows checks claim capability before any promotion (one Assert-CoreEngineClaimCapable) (Codex)

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

Copy link
Copy Markdown
Contributor Author

PR sweep (Claude, 2026-11-14): left open. Conflicts with canary in 7 engine files (inference/engine_residency.rs, llama_server.rs, llama_server/control.rs, ready_tail.rs, reconcile.rs, ...), base 2026-10-29, and the engine_slots promotion it builds on predates plan line 3b (one live engine). PINNED_ENGINE still lives in llama_server/engine_features.rs:19 on canary. Owner (Fable) to decide: port the pin check onto the current engine lifecycle, or close.

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