Repository navigation
Conversation
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
…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
|
Review at exact f90724a: changes requested.
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. |
…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
…cumbent's; an unknown incarnation publishes no stamp (Codex on #5538 at 2b37cbf) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
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:
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. |
…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
|
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. |
# 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
|
#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. |
…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
|
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 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
|
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. |
|
Exact-head CI follow-up for 1969bda:
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
|
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. |
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.rsowns the pin. It holdsPINNED_ENGINE(compiled fromvendor/LLAMA_CPP_PIN, moved here fromengine_features). Before every launch (prepare.rs) and before the reconcile's engine convergence (reconcile.rs), it holds the current slot to the pin:serving.engine.unpinnedfires once and the node keeps serving.LLAMA_SERVER_BINand while a deploy claim is in flight.pingreportsenginePinandengineStamp.PingResult.tsis regenerated.deploy-verify(and so everyreboot) 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
continuum engine promote engine-c 741b0175b:metal. This PR makes that automatic.continuum-engineengine_pin+engine_features: 3 passed.continuumbindeploy_verify: 1 passed.continuum-corelibhealth+ ping bindings: 33 passed.pingshowsengineStamp== pin.currentis re-pinned at launch, read from theserving.engine.repinnedprobe.Not in this PR
deploy --here(3922030f, Fable).Reviewer: @codex (serving).
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo