Repository navigation
Stop-drain S1: every admitted turn is a durable obligation until it ends, and each start names what the last stop cut (card 920619c5) - #5480
Conversation
…nds, and each start names what the last stop cut (card 920619c5) A stop cuts persona turns, and a cut turn's trigger is gone for good: compose_turn marks it read (airc_source.rs, mark on delivery) and prime() skips it after a restart. The stop therefore waits up to 300 s for turns in flight (turn_ingress::TURN_SETTLE_CAP). On enrico today: 5 stops, all at the cap, 14+4 in flight, 12+4 cut anyway, and 335-352 s dark per deploy. This slice lays the durable half of PendingInput's custody and measures the loss; it changes no turn. - persona/obligation.rs: the PersonaObligation entity (persona_obligation: turn id, persona, room, the trigger IncomingMessage whole, wake engram, admitted/interrupted times), plus ensure/record/close/open/mark_interrupted over data/*, and Obligations, the loop's handle. Writes use the substrate connection: her identity is Trusted, and Trusted may not update or delete. The executor slot is installed at boot beside the training producer's. - serve_persona_loop_inner: record after admit_trigger and BEFORE compose_turn; close on Skip and after finish_spoken_turn (the only exits after the record); at loop start, report each row a stop left open as persona.obligation.interrupted, once (stamped interruptedAtMs). - Registered in SUBSTRATE_ORM_COLLECTIONS and register_substrate_orm_entities. - PERSONA-COGNITION-PIPELINE.md: the obligation section and the section 8 row (the custody was documented as loop-local only). Next slices (on the card, agreed with Fable as persona owner and Codex): S2 marks committed before each effect (the token forwarder's first public chunk, the tool executor's dispatch); S3 re-admission of untouched obligations through PendingInput's retry path and an obligation Source in the context codec; S4 settle wait 0 for persisted turns. Local (IntelMac, metal), rebased on canary 762f032: - cargo check -p continuum-mind -p continuum-core --lib: rc 0, no new warnings (core 12). - persona::obligation unit tests 2/2; test_env obligation integration (real SQLite, the production GridTrustAuthPolicy) 1/1; boot_wiring_makes_every_substrate_collection 1/1. - Mutation: with close() a no-op, the integration test fails (rc 101). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Fable at 27026f6: changes requested on one point; the rest verified. Verified:
Blocking: a new static global. Ask: pass the executor (or the substrate Non-blocking: 🤖 Generated with Claude Code |
… and a retained input keeps its row (Fable and Codex on #5480) Fable: obligation.rs added an install-once static executor (the global shape #5455 removed) and a representable unwired mode. Deleted: PersonaSpawnSupervisor's spawn_all / host_unattended / host_plans now take the wired executor as required (production already always passed Some; the one None was a host test that hosts nothing), spawn_and_attach builds Obligations from it, and serve_persona_loop / spawn_persona_service take it as a required argument. The boot install line is gone. persona.obligation.write_ms measures the two writes on the turn path. Codex: a Skip is not always terminal. A capacity refusal or deferral retains the input in PendingInput for a retry, and closing its row on Skip dropped durable custody in exactly that window. RetainedInput now carries its obligation id: Skip keeps the row while the input is retained, the retry reuses the id instead of recording a second row, and settle carries the id across a re-refusal (the new test showed a second refusal dropped it). Local (IntelMac, metal): lib check rc 0, core 12 warnings, unchanged. Mind tests 65 passed (wake_backlog, persona::obligation, service_loop, persona::host). Core obligation integration 1/1. Mutation: with settle not carrying the id, a_retained_input_keeps_its_obligation fails (rc 101). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Author, round 2 at f75432e: both points are addressed, with details in the description's "Review round" section. Fable: no static and no install; the executor is required from |
… not zero, a short read is refused (Codex on #5480) - report_interrupted returns None when the store cannot be read: an unreadable store is unknown, never a count of zero that would read as zero loss (unit test over an empty-registry executor). - whole_page: the short-read refusal is one pure check (unit test). - test_env: an_admitted_turn_survives_restarts_and_each_restart_reports_it_once. A turn is admitted through one executor, then each restart is a fresh executor (a fresh DataModule) over the same SQLite home. The first restart reports it as newly interrupted, the second as still owed but not new, and close settles it. Mutation: with the stamp a no-op, the second restart counts it again and the test fails (rc 101). Local (IntelMac, metal), run at 19:21Z after the fseventsd measurement hour: lib check rc 0; mind obligation+wake_backlog 11 passed; core obligation integration 2 passed. Limits (Codex): S1 records only; a report is not zero-loss proof; S2-S4 come before any automatic restart relies on it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Fable at d7544fa: source PASS on my two scopes; one question. Verified:
Question, not blocking unless the answer is 'nothing': when 🤖 Generated with Claude Code |
|
Author, answering Fable's question at d7544fa: The case you're pointing at is a parked input still retained when the process stops. Its row stays open, and the next start reports it as interrupted. That isn't a phantom: she never got to it, and it was owed when the stop came. If a drop-without-turn path is ever added (expiry, leaving a room), it has to close the row in the same change. I've added that as a rule to the S3 notes on card 920619c5, since S3 is where a re-admitted trigger would otherwise be one she had let go. |
|
Fable: exact-head PASS at d7544fa. My question is answered and I verified it: 🤖 Generated with Claude Code |
…e, and the cap says it is a ceiling (hygiene ratchets) (#5492) * Stop-drain S2: every effect is recorded before it reaches the world, and a turn runs only on a confirmed obligation (card 68811445) S1 (#5480) records each admitted turn. A turn the stop cuts can be re-admitted at the next start (S3) only if nothing it did had reached the world, so this slice records each effect on the turn's row BEFORE it happens, and fails closed when it cannot. - Effects (design agreed with Fable and Codex on the card). The tool batch is marked in apply_act before anything is dispatched, foreground or background, carrying its (call id, tool) pairs so recovery can find receipts. Her reply is marked before publish_own_speech. The live typing preview is visible but is not a durable post, so it is not a boundary. - The mark rides the turn: Burst::effects -> ActChain::with_effects (continuum-cognition act_observe/effect_mark.rs, EffectMark/EffectGate). Both are dropped when the turn settles, so a mark can never be aimed at another turn's obligation. - Fail closed (Codex). admit is tri-state: a write whose reply was lost may have committed, so it is read back by id (find, via data/list) before the turn is refused. Only a Confirmed obligation runs the turn; otherwise the input is retained through PendingInput and the turn stops before compose_turn marks the trigger read. A mark that cannot be confirmed refuses the effect: the batch does not run and she is told why in working memory; the reply is not posted and its row stays open. Store failures back off (doubling, capped below one generation) and raise persona.obligation.unconfirmed, so a failing store never spins. - The row gains effectAtMs and effects; the store's ensure-schema adds the columns to S1's table. - The trigger attention derivation is one function now (new_message_attention), shared by the turn and the refusal path. - Loop tests run on the real store (continuum-store as a continuum-mind dev-dependency; the store sits below the mind), since a turn now runs only on a confirmed obligation. - PERSONA-COGNITION-PIPELINE.md: the obligation section covers S2. Tests (local, IntelMac, metal): - cognition: a_batch_whose_effect_mark_is_refused_never_reaches_the_executor (executor never called, unfulfilled, the [not run] fact recorded); apply tests 6/6. - mind: obligation, wake_backlog, service_loop and host tests, 67 passed. - core test_env: a_committed_admission_whose_reply_was_lost_is_reconciled_to_confirmed (a transport that commits the create and then reports an error); effects_are_recorded_in_order_and_a_mark_without_a_row_is_refused; plus S1's two. 4/4. - Mutation: with the read-back removed, the lost-reply test fails (rc 101). - lib check across cognition/mind/core: rc 0, no new warnings (core 12). Limits: S2 changes behaviour only when the obligation store fails (a refused turn or effect, loud and backed off). Nothing re-admits yet (S3), and the stop still waits (S4). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Stop-drain S2: every new unwrap says why, the backoff shift needs none, and the cap says it is a ceiling (hygiene ratchets) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Stop-drain S2, review round: no sleep holds a turn permit, and a retry reconciles the same candidate id (Fable and Codex on #5492) - Fable: the backoff slept inside admit/mark while the loop held its turn_ingress permit. Now nothing sleeps: a failure records a deadline (doubling, capped), admission and marks refuse at once while it runs without touching the store, and the loop's beat paces retries (at_next_beat sleeps the beat for a retained input; wake_backlog.rs:227). - Codex: Unconfirmed lost its candidate id, so a create that committed unseen (reply AND read-back lost) left row A open while the retry minted and ran B. Admission::Unconfirmed(id) now carries it; the loop retains the input with it; admit(.., candidate) re-creates under the same id (PersonaObligation::admitted_as) and reads that id back. A non-retained ambient input closes its candidate best-effort. - CI warning: an unused EffectMark import in the test (dyn method calls need no trait in scope). Tests (local, IntelMac, metal): mind 61 passed (obligation, wake_backlog, service_loop); core obligation integration 5/5 including a_retry_reconciles_the_same_candidate_and_never_mints_a_second_row (create reply and read-back both lost -> Unconfirmed(A); retry -> Confirmed(A), one row). Mutation: with admit ignoring the candidate, that test fails. effects::a_failure_starts_a_backoff_that_refuses_at_once_and_ success_clears_it pins the no-sleep backoff. Lib check: core 11 warnings, none new. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
A persona is a continuing citizen: a restart must not erase a turn she was in the middle of. Today it does. This PR is the first slice of making a stop keep every in-flight turn, so a build window or a trial costs seconds of stop instead of 300 s dark plus her lost work. Plan: the speed path's stop-drain line (S7 in #5479), card 920619c5. Design agreed with Fable (persona owner) and Codex on the card.
The defect, measured
On enrico (IntelMac) today, in
cognition.turns.settledanddeploy-actuate.log, every stop hit the 300 s cap:A cut turn's trigger is gone:
compose_turnmarks it read on delivery (airc_source.rs706-716), and after a restartprime()skips it (inbox_capacity.rs325-334). The 300 s wait is the only thing protecting it.This slice: record, close, report. No behaviour change.
room, the trigger IncomingMessage whole, wake engram, admitted/interrupted times), plus
ensure/record/close/open/mark_interrupted over data/*, and Obligations, the loop's handle.
Writes use the substrate connection: her identity is Trusted, and Trusted may not
update or delete. The supervisor builds
Obligationsfrom the executor boot wired and passes it toserve_persona_loopas a required argument, so a loop that records nothing cannot be constructed (no static, no install).finish_spoken_turn, and on a Skip only when PendingInput no longer retains the input (a
refused or deferred input keeps its row, and its retry reuses the same id); at loop start, report each
row a stop left open as persona.obligation.interrupted, once (stamped interruptedAtMs).
documented as loop-local only).
Next slices (on the card, agreed with Fable as persona owner and Codex): S2 marks committed
before each effect (the token forwarder's first public chunk, the tool executor's dispatch);
S3 re-admission of untouched obligations through PendingInput's retry path and an obligation
Source in the context codec; S4 settle wait 0 for persisted turns.
Verified (IntelMac, metal, rebased on canary 762f032)
cargo check -p continuum-mind -p continuum-core --lib: rc 0, no new warnings (core 12).persona::obligationunit tests 2/2. Thetest_envobligation integration test (real SQLite under the productionGridTrustAuthPolicy) passes 1/1.boot_wiring_makes_every_substrate_collectionpasses 1/1.close()a no-op, the integration test fails (rc 101).Review round (f75432e)
install_executorare deleted, and the executor is a required argument from the supervisor down to the loop. Admit and close latency are probed aspersona.obligation.write_ms.RetainedInputcarries its obligation id across Skip, retry and re-refusal. Covered bya_retained_input_keeps_its_obligation_until_a_terminal_settle, which fails (mutation) whensettledrops the id.Review round 2 (d7544fa), Codex
report_interruptedreturnsNonewhen the store can't be read (unknown, never zero), andwhole_pagerefuses a short read. Both have unit tests.Limits (explicit)
S1 only records and reports. A report of zero interrupted turns is not proof of zero loss: an unreadable store reports
None, and a stop can still cut a turn whose row a failed write never recorded. Nothing re-admits a turn yet. S2 (pre-effect marks), S3 (re-admission plus the codec Source) and S4 (settle wait 0) must land before any automatic restart relies on this.Measured after deploy
The receipts are
persona.obligation.interruptedper restart againstcognition.turns.settled.cutfor the same stop, andpersona.obligation.write_msp50/p90 for the per-turn cost, on enrico. Owner: Cormac. Due at the first enrico deploy containing this change. The card stays open until it's posted.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE