Skip to content

Stop-drain S4: a stop waits only for turns not yet durable; a confirmed turn is handed back, not waited for (card f78d7a22) - #5717

Merged
joelteply merged 1 commit into
canaryfrom
cormac/stop-drain-s4
Nov 3, 2026
Merged

joelteply merged 1 commit into
canaryfrom
cormac/stop-drain-s4

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The IntelMac, 2026-11-02 15:13Z: a stop took 302 s, the settle at its 300 s cap on turns stuck
behind a busy engine. On enrico 10-26 every stop was 335-352 s dark. Since S1-S3, every turn
that passes admission holds a CONFIRMED obligation: a durable row, pre-effect marks before each
effect (S2), and a cut turn handed back by the next start (S3). Waiting for it buys nothing
but the dark window.

  • turn_ledger: the turn's in-flight mark gains confirm(), called by the service loop right after
    Admission::Confirmed; the mark ends with the turn. in_flight_turns reports each turn's
    confirmed flag (InFlightTurn, named fields in place of a positional pair), and
    confirmed_in_flight counts them.
  • turn_ingress::settle: the bound is sized from the unconfirmed turns only, and the wait runs
    only while an admitted turn holds no confirmed obligation (waits_for, pure). A turn admitted
    and not yet durable is still waited for, exactly as before. The receipt says handed_back
    (confirmed turns left for the next start) apart from cut (the loss), and the bound source
    all_confirmed when nothing was waited for.

Test: the_settle_waits_only_for_turns_not_yet_confirmed (waits_for over confirmed and
unconfirmed counts; a begun turn is unconfirmed, confirm() moves it, its end clears it).
Mutation receipt: waits_for waiting on every in-flight turn fails it. vitals turn_* 4/0;
continuum-mind --tests check clean.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…ed turn is handed back, not waited for (card f78d7a22)

The IntelMac, 2026-11-02 15:13Z: a stop took 302 s, the settle at its 300 s cap on turns stuck
behind a busy engine. On enrico 10-26 every stop was 335-352 s dark. Since S1-S3, every turn
that passes admission holds a CONFIRMED obligation: a durable row, pre-effect marks before each
effect (S2), and a cut turn handed back by the next start (S3). Waiting for it buys nothing
but the dark window.

- turn_ledger: the turn's in-flight mark gains confirm(), called by the service loop right after
  Admission::Confirmed; the mark ends with the turn. in_flight_turns reports each turn's
  confirmed flag (InFlightTurn, named fields in place of a positional pair), and
  confirmed_in_flight counts them.
- turn_ingress::settle: the bound is sized from the unconfirmed turns only, and the wait runs
  only while an admitted turn holds no confirmed obligation (waits_for, pure). A turn admitted
  and not yet durable is still waited for, exactly as before. The receipt says `handed_back`
  (confirmed turns left for the next start) apart from `cut` (the loss), and the bound source
  `all_confirmed` when nothing was waited for.

Test: the_settle_waits_only_for_turns_not_yet_confirmed (waits_for over confirmed and
unconfirmed counts; a begun turn is unconfirmed, confirm() moves it, its end clears it).
Mutation receipt: waits_for waiting on every in-flight turn fails it. vitals turn_* 4/0;
continuum-mind --tests check clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 31ce6aa (Fable, independent; the commits carry session 01FRQWzg, not mine).

Claim verified: a stop now waits only for turns whose obligation is not yet confirmed. A confirmed turn is handed back, not waited for, and the confirmation ends with the turn. Read at this head:

  • serve_persona_loop_inner.rs: turn_in_flight.confirm() runs only in the Admission::Confirmed arm, after obligations.admit. The Unconfirmed arm never confirms.
  • turn_ingress::settle: the bound is sized from the unconfirmed turns only, and the loop runs while waits_for(in_flight(), confirmed_in_flight()) = in_flight > confirmed.
    • in_flight() counts every ingress admission. A turn admitted but not yet begun on the ledger is never in CONFIRMED, so it is still waited for (conservative).
    • All confirmed: unconfirmed is empty, so the bound comes only from the uncounted term, and bound_source reads all_confirmed.
  • TurnInFlight::drop removes from CONFIRMED before IN_FLIGHT, so a finished turn can never be counted as handed back.
  • cut = in_flight().saturating_sub(handed_back): the loss is the unconfirmed remainder.

Test-isolation check: the new test asserts an exact CONFIRMED count on a process-global set. git grep begin_turn on canary finds no other caller in continuum-vitals tests, so nothing in this binary races it.

Note, no change asked: CONFIRMED is keyed by persona, as IN_FLIGHT already is, so both assume one turn per mind at a time. If a mind ever runs two concurrent turns, the first drop clears both marks. That's the existing contract, not new here.

@joelteply
joelteply merged commit 0685402 into canary Nov 3, 2026
18 checks passed
@joelteply
joelteply deleted the cormac/stop-drain-s4 branch November 3, 2026 05:21
joelteply added a commit that referenced this pull request Nov 3, 2026
…turns that consumed input (#5725)

S4 (#5717) let a stop skip turns already confirmed durable, but the IntelMac's first receipt
after it (07:26Z, 2026-11-03) still waited the full settle cap: in_flight 4, handed_back 0,
cut 4. The four were self-ticks (Wake::Tick / Wake::Mind served inline under the gate permit),
which open no obligation and never reach the ledger's confirm(), so S4 could not count them.

A self-tick consumes no external input: everything its cycle writes (settle_work,
note_initiative, settle_self, notices_read) is in-memory and recomputed from world state on
the next beat (Fable, room 52af77be, wake_backlog.rs:162). Cutting one loses nothing a
restart doesn't rebuild. So:
- turn_ledger: begin_self_tick() returns a SelfTickInFlight guard counting live self-ticks;
  the persona loop holds it for serve_self_tick's duration.
- turn_ingress settle: what is not waited for is confirmed + self-ticks; a stop with nothing
  else in flight settles at once ("none_to_wait_for"), and the receipt reports on_ledger
  and self_ticks beside handed_back and cut.

continuum card 161d2590


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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