Skip to content

Stop-drain S4b: a self-tick is never waited for; a stop settles only turns that consumed input - #5725

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

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

Conversation

@joelteply

@joelteply joelteply commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Stop-drain S4b (card 161d2590), on S4 (#5717): a stop never waits for a self-tick.

Why

S4's first IntelMac receipt (continuum stop --engine, 2026-11-03 07:26–07:31Z, canary 0685402) still hit the settle cap: in_flight 4, handed_back 0, cut 4. The four were self-ticks. Wake::Tick / Wake::Mind are served inline under the gate permit (serve_self_tick), never through begin_turn, so they open no obligation and never reach confirm(), and S4 couldn't 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.

Change

  • turn_ledger: begin_self_tick() returns a #[must_use] SelfTickInFlight guard that counts live self-ticks. The persona loop holds it for serve_self_tick's duration.
  • turn_ingress settle: what isn't waited for is now confirmed + self-ticks. A stop with nothing else in flight settles at once (bound_source = "none_to_wait_for"). The receipt reports on_ledger and self_ticks beside handed_back and cut, and cut no longer counts self-ticks.
  • Test a_self_tick_is_never_waited_for: waits_for(2, 2) is false and waits_for(3, 2) is true. The guard increments the count and its drop decrements it.

Validation

  • cargo run -p source-hygiene --bin ratchets -- origin/canary: exit 0, 83/83 on base and head.
  • Not built locally: continuum-vitals pulls in continuum-engine (llama.cpp), and this node keeps its CPU for serving. CI is the build and test receipt. I'll ask for review after CI is green.

Measured after deploy (owner Cormac, the next IntelMac stop; card stays open until posted)

  • The TurnSettle receipt on the next continuum stop: self_ticks reported, cut excluding them, and the settle time against 07:26Z's full cap (~5 min) with only self-ticks in flight.
  • Dark window from stop to serving again.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…turns that consumed input

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

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

Review at c18878a (Fable): PASS.

Claims verified:

  1. A self-tick is never counted twice. begin_turn has one caller in the service loop, the message arm (serve_persona_loop_inner.rs:246), and self_tick.rs never calls it. So a self-tick is never both on the ledger and in SELF_TICKS, and not_waited can't exceed what's really safe to cut.
  2. The mark's scope is the self-tick's. _self_tick lives in the Wake::Tick | Wake::Mind arm and drops at its continue, after serve_self_tick(...).await, whether it returns or unwinds.

Right:

  • uncounted subtracts the self-ticks, so a stop with only self-ticks in flight settles at once (none_to_wait_for) instead of waiting the cap.
  • cut excludes self-ticks, so the receipt counts only real loss.
  • The test pins both waits_for edges and the guard's increment and decrement.

Note, non-blocking: in_flight() and not_waited() are separate reads. A self-tick ending between them makes the settle wait one more poll, which is the safe direction. Starting one is gated off at stop, so it can't make the settle skip a message turn.

Measured after deploy stays as you wrote it (the next IntelMac stop: self_ticks on the receipt, settle time against 07:26Z's 5-minute cap).

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