Skip to content

fix(airc): the attach asks for the cursor heartbeat it persists — every boot since Sep 14 replayed a week of every room - #4318

Merged
joelteply merged 1 commit into
canaryfrom
ac4bca50/every-core-boot-since-sep-14-replays-a-w
Sep 21, 2026
Merged

joelteply merged 1 commit into
canaryfrom
ac4bca50/every-core-boot-since-sep-14-replays-a-w

Conversation

@joelteply

@joelteply joelteply commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Card ac4bca50. Every attach cursor under ~/.continuum/state/ on this node was last
written 2026-09-14 17:20 — the afternoon airc #1417 (5120d5a) made the daemon's
AttachCursorAdvanced frame opt-in per attach, to end the WARN floods on airc-lib's
subscribe streams (cards c5466b56 / e28889cc). inbound_attach.rs persists its watermark
and names that frame its SOLE advance source (WATERMARK DISCIPLINE, #261) — and never
opted in (grep -rn cursor_heartbeat core/ was empty). airc.cursor.advanced probes
since: 0.

So every core boot on every node has resumed each room from a week-old watermark and
streamed the gap as live events. Measured on the IntelMac at 18:15Z today, right after the
kickstart onto 5c5aa28: chat projections per minute 1,229 / 3,636 / 2,711, then 110, then
~1 — about 7,700 events of the fleet room replayed in three minutes into the bus, the
positron chat projection and the capacity ledger, each stamped heard-now. The grid fold
then read beacons the senders had published days earlier as fresh readings and posted
[fleet] <node> runs build c2344d758 (#5446) … behind; continuum reboot there for three
nodes — one of them this node, judging itself — before "caught up" an hour of
transcript later. Fable measured 2f0aed7f at that minute: 899e5d0 (#5571), == HEAD.
This is the 2026-07-30 glass-box shape ("each reboot re-fed days of transcript as fresh
inbox to every mind"), back via a pin bump.

Two halves, both small:

  1. attach_request_for_cursor: .with_cursor_heartbeat() on both arms. The resume
    arm has no coalesced seam, so the heartbeat is its only advance; the first-attach arm
    gets the seam summary once and the heartbeat keeps the watermark ≤1 s behind after it.
  2. GridCapacityLedger::hear: an offer the sender stamped earlier than the one already
    held for that peer is dropped — the sender's clock against the sender's own clock, so
    receiver skew never enters; equal (a re-sent frame) and unstamped (at_ms == 0, an
    older core) still fold. replays_an_older_reading is the pure rule. Half 1 removes the
    cause; half 2 keeps the fold honest if a gap is ever replayed for another reason (a
    fresh cursor file, a newly adopted room).

Tests, in the existing mods: every_attach_asks_for_the_cursor_heartbeat_it_persists
(both arms — drop either call and it is red); a_replayed_older_reading_never_overwrites_a_fresher_row
(older stamp dropped, equal and unstamped fold, the rule pinned on 0/equal/older).

Receipt at fe40c0c: cargo test -p continuum-core --features metal,accelerate -j 2 --lib -- airc::inbound_attach::tests capacity::gossip::tests → 17 passed / 0 failed, REAL_EXIT 0.

Not covered, said plainly: the live proof is a node that boots on this and shows
airc.cursor.advanced probes within a minute of attach and a cursor file with today's
mtime — then a second boot with a projection burst bounded by its downtime instead of a
week. I have not measured how much of the 7,700 reached a resident's inbox versus being
filtered downstream; a resident's inbox size in the minute after boot, with and without
this, is the discriminating read for that.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…played beacon never moves a ledger row backwards

Card ac4bca50. Every attach cursor under ~/.continuum/state/ froze on
2026-09-14 17:20 — the afternoon airc #1417 (5120d5a) made the daemon's
`AttachCursorAdvanced` frame opt-in per attach to end the WARN floods on
airc-lib's subscribe streams (c5466b56 / e28889cc). This consumer persists
its watermark and names that frame its SOLE advance source (WATERMARK
DISCIPLINE, #261), and never opted in: `grep cursor_heartbeat core/` was
empty. `airc.cursor.advanced` probes since: 0.

So every core boot on every node resumed each room from a week-old
watermark and streamed the gap as live events. IntelMac, 2026-09-21
18:15Z: 1,229 / 3,636 / 2,711 chat projections per minute for three
minutes, then ~1 — 7,700 events of the fleet room into the bus, the
chat projection and the capacity ledger, each stamped heard-now. The
grid fold then judged three nodes (one of them THIS node) "behind" from
beacons their senders had published days earlier, and posted "reboot
there" for each — the 07-30 glass-box shape returned by a pin bump.

1. `attach_request_for_cursor`: `.with_cursor_heartbeat()` on both arms.
   The resume arm has no coalesced seam, so the heartbeat is its only
   advance; the first-attach arm gets the seam summary once and the
   heartbeat keeps the watermark ≤1 s behind after it.
2. `GridCapacityLedger::hear`: an offer the sender stamped earlier than
   the one already held for that peer is dropped — sender's clock against
   the sender's own clock, no receiver skew; equal (a re-sent frame) and
   unstamped (0, an older core) still fold. `replays_an_older_reading`
   is the pure rule.

Tests: `every_attach_asks_for_the_cursor_heartbeat_it_persists` (both
arms; drop either call → red), `a_replayed_older_reading_never_overwrites_
a_fresher_row` (older stamp dropped, equal and unstamped fold, rule pinned).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply joelteply changed the title fix(airc): the attach asks for the cursor heartbeat it persists; a replayed beacon never moves a ledger row backwards fix(airc): the attach asks for the cursor heartbeat it persists — every boot since Sep 14 replayed a week of every room Sep 21, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE at exact head fe40c0ca0. I read both files end to end this time — I got a review wrong an hour ago by reading a fragment and asserting about the whole, so: inbound_attach.rs and capacity/gossip.rs, both hunks and both tests.

Two fixes at two levels, and that is why this closes it. The attach fix removes the cause; the ledger fix makes the symptom impossible even if old frames arrive by some other route. Either alone would have left a way back in.

The attach half is the root and the comment is the best kind — it names the thing that made it invisible. airc #1417 made the cursor heartbeat opt-in per attach, for a real reason (WARN floods on airc-lib subscribe streams), and this consumer never asked. So the sole advance source for a persisted watermark was silently switched off on 2026-09-14 16:27, and every boot on every node has resumed each room from a week-old mark since. 7,700 events of the fleet room in three minutes. Nothing failed; a thing simply stopped happening.

replays_an_older_reading is right to be pure and right in its two refusals:

  • equal is not older — a re-sent frame is harmless and dropping it would be its own bug
  • an unstamped side (0) is never judged — an older core's beacon cannot be ordered, so it is folded as before rather than discarded on an absence

That second one is the discipline this whole evening kept turning on: an absence is not a quantity. A cheaper version of this fix would have treated at_ms == 0 as "very old" and quietly dropped every legacy peer.

Sender's clock against the sender's own clock is the detail that makes it correct rather than approximately correct — no receiver skew enters, so this cannot misfire on a node whose clock drifts.

The pattern, because this is now the third instance tonight

An optional thing whose absence silently disables a downstream invariant:

absent consequence
staged_revision_id omitted at submit credit never binds; submit reports success
claim_id supplied but stale refusal that named neither id (#4310)
cursor heartbeat never opted into every boot replays a week, for a week

The third is the most expensive and the least visible, because the opt-in was added elsewhere — in airc — for a good reason, and the consumer that depended on it was never audited. A capability that becomes opt-in needs its existing consumers checked, or it is a silent removal for whoever did not hear about it. That is worth more than this fix.

Nothing blocking. 17 passing, both new tests pin the thing that broke.

@joelteply
joelteply merged commit 7229ea0 into canary Sep 21, 2026
6 checks passed
@joelteply
joelteply deleted the ac4bca50/every-core-boot-since-sep-14-replays-a-w branch September 21, 2026 19:22
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