Repository navigation
The stop's checkpoint condemns the acts it handed back, and one owner awaits a process's exit as an event (card b5b9bef3) - #5988
Merged
Conversation
… handed back, and every wait is an event (card b5b9bef3) The stop's resident checkpoint (page_io.rs) took the endpoint's writer while the turns the settle had just handed back still held their act guards, with nothing to end them: the M5 stopped saving at 00:51:56Z and 23:40:21Z (4 turns handed back, waited_ms=0) and the core served minds until a manual SIGTERM 100 s later (7 min at 19:19Z). It now goes through drain_for_replacement: condemn first, then the writer, as a relaunch already does. One graceful stop on every platform: drain, receipt, commit, and the core exits itself through the same _exit its SIGTERM path takes (unix used to save, then kill from the CLI). The CLI waits on the core's exit EVENT (continuum-host::process_exit_event: kqueue NOTE_EXIT, pidfd, a signalled process handle), never a poll, and reports stop-requested -> exited as the lifecycle.stop.exited probe. Polls in the stop path replaced by events: the CLI's 200 ms exit poll, the kill's 30 x 100 ms TERM wait, confirm_gone's doubling poll (the engine's exit under --engine), and the page-IO settle's 50 ms poll (AdmissionGate::drained). A watchdog that fires names its step (extensions::settling). Not compiled locally: this machine serves live minds; CI is the compiler. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… their ratchet cleanup (card b5b9bef3) The coordinator's timer audit: nothing in core could await another process's exit, so every stop, reboot, kill and engine retirement polled pid_alive. continuum_host::process_exit::exited(pid) -> ExitObserved is that one owner (kqueue NOTE_EXIT, pidfd, a signalled process handle, on a detached thread), replacing the separate process_exit_event module. Its first caller is the adopted engine's retirement (adopted_retirement.rs), which polled liveness every 100 ms. The CLI stop path (graceful_stop.rs, stop.rs, processes.rs) and continuum_process::confirm_gone are reverted to canary here: touching those files requires them to end with no OS branches, private sysinfo probes or unjustified unwraps (29 + 12 + 6 sites), a refactor of its own. They are the next PR's rows (C1, C2, C3, confirm_gone). The SIGTERM path's 8 s stall now names the settle step it was stuck in. Not compiled locally: this machine serves live minds; CI is the compiler. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…he test binds its client (card b5b9bef3) Both fixtures hold no acts, and the process-wide condemnation would end other tests' acts in the same binary. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Nov 14, 2026
…e ratchets Rule 10/11 text: canary's #5986 wording kept, plus the shape-ratchet section, its baselines and the correction that time_bounds and wall_clock never counted sleeps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Nov 14, 2026
…6004) Live receipt for #5987 on the M5 (canary 7f875cc, 2026-11-14 07:48-07:53Z): the stop's checkpoint saved one resident of four (07:48:28Z, slot 3, Benchy); the new engine (fork pin b5534b531) and core attached the ledger (loaded=1) and restored Benchy, while Aiko, Aris and Atlas came up cold (cold_turn cause="no_page"). The key matched (same fingerprint; Benchy restored) and the page store evicted nothing (every pass declined page_io_busy). The cause: the stop condemns acts in flight (#5988), and a cut act's drop forgets her attribution (TurnAdmission::drop -> forget_resident), so checkpoint_pool, which saved only `holders`, had nobody to save in those slots. KvSlotPool::stop_residents is the checkpoint's resident set: every attributed resident, plus each slot still holding a sequence of a mind attributed nowhere (LiveSequences::held): a confirmed sequence when at least as new as her page, an unconfirmed one (her cut act) only when she has no page. One save per page. Test: a_mind_whose_act_the_stop_cut_is_saved_and_restores_after_the_boot (engine A, a cut act, the stop, engine B and a new core: both minds restore what their slots held). Not compiled locally (the M5 is serving); CI is the compiler. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Opus 5.5 <[email protected]>
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:
continuum stopkept the M5's core serving residents for minutes after it was asked to stop, so serving could not come down and back up near-immediately. This advances plan line 3b: one live engine, a dynamic lifecycle. This PR fixes the stall itself and adds the one owner that lets every stop wait on a process's exit as an event.Measured (the defect, M5,
~/.continuum/logs/continuum-core-server.log*)system:shutdownfirst publishedcognition.turns.settled+kv_page.settledin_flight_at_close=4 handed_back=4 waited_ms=0The SIGTERM path's own save and exit takes ~2.2 s ("65 modules stopped, all state durable, 2233ms"). "Stopping N modules" (runtime.rs:14) never logged after either settle, so
Runtime::shutdownwas never entered. Meanwhilecognition.turn_ingress.depth in_flight=4kept sampling every 15 s.Trace (file:line on canary 7a29474)
stoprunsstop_with_policy(stop.rs:152). On unix,targetis forced toNone(stop.rs:170,cfg!(windows)), so the stop goes throughsystem/shutdown(graceful_stop.rs:354) and the CLI kills the core after the receipt (stop.rs:260).begin_shutdown(TURN_SETTLE_CAP)(shutdown.rs:171), thensettle_before_stop(service_profile.rs:261), thenrt.shutdown().TurnsSettlehands the 4 confirmed turns back at once (turn_ingress.rs:184).PageIoSettle(page_io.rs:62) then callscheckpoint_every_endpointwith ~300 s of cap left (page_io.rs:72).checkpoint_endpoint→transition_for_generation(page_io.rs:118) →gate.write_owned().await(engine_generation.rs:182). The writer waits for every admitted act's read guard. The settle had just handed those turns back, but nothing ended their acts, so the stop waited on their decodes. A relaunch already solves this exact shape withdrain_for_replacement(engine_generation.rs:221): condemn first, then take the writer.GRACEFUL_STOP_BUDGET(320 s) for the receipt, and the operator gave up first.Fix (this PR)
Root: the stop's checkpoint drains through
drain_for_replacement, so acts let go on condemnation before the writer is taken. The condemnation is injected, so a test drives a local one.One owner for "a process exited":
continuum_host::process_exit::exited(pid) -> ExitObserved. The OS adapters hold only the diff:EVFILT_PROC/NOTE_EXITpidfd_open+poll(-1)OpenProcess(SYNCHRONIZE)+WaitForSingleObject(INFINITE)The wait runs on a detached thread, so a caller's watchdog never pins its runtime's drop. The owner has no timer of its own; a caller's bound only reports. It merges into the existing
process_exitmodule, next toexited_unreaped.First caller: the adopted engine's retirement (
adopted_retirement.rs::await_adopted_exit) waits on the exit event, then re-reads the identity. It used to poll liveness every 100 ms.The page-IO settle waits on an event:
AdmissionGate::drained(), aNotifypublished by the release that empties a closed gate. The 50 ms poll is deleted.A stall names its step:
extensions::settling()records the participant being waited on. The SIGTERM path's 8 s stall message now says "stalled in thepage_iosettle", which was the M5's exact case: a manual SIGTERM joining a stalled stop.Tests (each with
// what this catches:)slots::tests::stop_checkpoint::the_stop_checkpoint_condemns_held_acts_before_it_takes_the_writer: 4 acts that let go only on condemnation. The checkpoint gets past the writer instead of running into its cap. This is the incident's regression test.process_exit::tests::exited_resolves_on_the_childs_exit_and_not_before: a spawned child; the wait is pending while the child runs and resolves on its exit. Nothing in the test sleeps.process_exit::tests::an_absent_pid_has_already_exited: resolves at once.admission_gate::tests::drained_is_published_by_the_last_release_of_a_closed_gateextensions::tests::the_participant_a_stop_waits_on_is_named_until_the_settle_endsadopted_retirement::tests::adopted_exit_wait_retains_custody_until_observed_exit(existing) now runs on the exit event.Lines
+452 / −26 across 12 files. The host seam is ~200 lines and the tests ~150. Removed: two poll loops (page IO, adopted retirement). No production unwrap, OS branch outside continuum-host, or swallowed error was added.
Follow-ups: next PR, same owner (Fable)
The touched-file ratchets (
os_branches,private_probes,unjustified_unwraps,required_inputs) require each file to end clean. The first push of this PR touched these files and failed on 29 + 12 + 6 + 1 pre-existing sites, so the cleanup comes first:graceful_stop.rs:273exited_within(200 ms poll) →process_exit::exited, behind a watchdog that only reports. Needsteardown_authoritymoved into continuum-host and the Windows-only items moved intoelevated_teardown.processes.rs:439, 503TERM → 100 ms × 30 poll → KILL. The drain receipt should decide, with the kill as the error path only. Needs the 12sysinfosites moved to the process-table owner.core_service.rs:653-659(macOS reboot), plus C4 (:748-785, Windows).continuum_process::confirm_gone(owned.rs:173, doubling poll), plus the other inventory rows: launch.rs:137-147, code_shell_kill_result.rs:297, and the bounded_command.rs try_wait loops.TurnsSettle(turn_ingress.rs:207, 200 ms poll): its predicate reads the turn ledger, so the ledger has to publish confirmations first.Not compiled locally
This machine serves live minds. CI is the compiler.
Live receipt (after deploy)
On the M5,
continuum stop --engineshould showkv_page.stop_checkpointwithin seconds ofkv_page.settled, then "Stopping N modules", and the core's exit, with no manual SIGTERM. Owner: whoever deploys next. The card stays open until it is posted.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo