Skip to content

Community: bound receipt re-sends and earlier-post requests - #599

Merged
andersalm merged 14 commits into
developfrom
fix/community-resend-limit
Nov 15, 2026
Merged

andersalm merged 14 commits into
developfrom
fix/community-resend-limit

Conversation

@andersalm

Copy link
Copy Markdown
Contributor

Deepen notes

  1. Expert view. Ask what makes a Home read the same range again before limiting the symptom: a batch of incoming Community frames is acknowledged all or nothing, so one frame that cannot be finished holds the whole range.
  2. Raw material. The code at develop 297b5989e (collaboration_transport.rs process_incoming_once and ingest_frame, collaboration_history.rs, the Carrier peek and acknowledge paths), issue Community: chat posts can still fill a Home's 4096-entry intake table (spam can stop Community for hours) #409 for the replay and Undo constraints, and the review reports of each round.
  3. Methods. The real transport driver against the existing Carrier fixture, counting sends per cycle; real provider-request counts for the history cadence; Rust on the Linux box.
  4. Independent check. Tests that fail before and pass after, three review rounds by other model families, and the remote check and full check at the head.

What changes

  • Receipts are sent once per held range. A Home that cannot finish a batch no longer sends the receipts of the frames it already took again on every cycle. Its progress is bound to the frames themselves and dropped when the range is acknowledged, so a range that starts at the same position after leaving and rejoining is never skipped.
  • A receipt that could not be sent is retried from a small queue (at most 32 entries; waits of 5, 10, 20, 40, then 60 seconds; until the message expires) and no longer holds the batch.
  • Earlier posts are requested when there is a reason: on join, on reconnect, when a Home newly appears, and on a short wait (15, 30, then 60 seconds) while Community is open or while nobody answered. With nobody watching and answered passes the wait grows to 15 minutes. Before, a Home asked every 15 seconds without end.
  • No wire or stored-state format changes. Replay records and checks are untouched.

Evidence at 54fb9a109

Check Result
Held batch, acknowledgement fails: receipts per cycle before 8, 8, 8, 8, 8; after 8, 0, 0, 0, 0
Full intake: receipts per cycle before 8, 8, 8, 8, 8; after 8, 0, 0, 0, 0
Same position after leave and join, different frame before: skipped; after: ingested and receipted
Receipt send fails late in a post's life before: no retry; after: retries at 5, 15 and 35 seconds
Quick reopening of Community after a long quiet period before: 7 requests where 8 are due; after: a request within 60 seconds
Remote check and remote full check (Linux) PASS (full: gate 23m38s, Runtime workspace 7m52s, capsules 3m21s)
Mac behaviour suite and source gate PASS (2,339 tests)

Reviews

  • Rounds 1 and 2 were written with Cursor (Claude) and reviewed by GPT (codex-review.sh): FAIL at 9b9b283c0 with four findings, then FAIL at b12943274 with one finding and the other three confirmed fixed.
  • Round 3 was written with Codex (GPT) and reviewed by Claude Fable: PASS, nothing blocking, at head 54fb9a10964a819c32c20bd10dedea04c9bdc0f2, tree ee69fff39b52e2ec8b125bf97cef117f28252192. Transport production code is byte-identical between b12943274 and this head.

Not tested

  • Installed two-Home journeys for these paths, a manual switch away from Chat and back, and Undo.
  • Two real Homes on a network; everything here is the real driver and service against fixtures, plus the Linux gates.

Follow-ups (not blocking, from the reviews)

Refs #409.

andersalm and others added 14 commits November 14, 2026 21:37
Four tests drive the conditions that leave a live batch unacknowledged and
record how many acceptance receipts leave the Home in each 500 ms cycle. The
Carrier replays the same range until the Home acknowledges it, so every cycle
re-ingests the frames the Home already accepted and gossips their stored
receipts again. A fifth test measures what each gossip message costs on the
wire.
The Carrier replays a batch range until the Home acknowledges it. A Home that
cannot acknowledge, because its intake is full or because the acknowledgement
itself fails, read that range again every 500 ms and gossiped the stored
acceptance receipt of every frame in it again.

The driver now counts the frames it ingested from the range the Carrier holds
and resumes at the first frame it has not ingested. A receipt that reaches no
gossip neighbour also leaves the frame ingested: the acceptance is durable, and
each sender re-sends its own frame until a receipt reaches it, which arrives at
a new Carrier position and earns a fresh receipt.

Nothing a Home sends changes shape, and replay protection is untouched: a frame
skipped here is one this Home already accepted and recorded.
A shown Home asked up to four present Homes for their whole retained history
every 15 s for as long as it ran. The request and reply formats stay as they
are; what changes is when a Home sends one.

HistoryCadence makes a pass due at once on a Community join, on a Community
connection that returns, and on a Home that is present now and was absent at
the last pass. A pass that none of those asked for waits twice as long as the
one before it, up to 15 minutes. Ten minutes of Runtime checks now carry six
passes instead of forty.
Each test states the behaviour a person needs. Four of them fail at
9b9b283 and the rest hold the limits the round-1 change keeps.

- A reused consumer cursor skips its first frames, so a reconstructed
  topic loses a post and its receipt.
- A receipt that reached nobody is never sent again, so a delivered
  post stays unconfirmed and its sender re-sends until expiry.
- The history worker keeps its grown wait through a leave and a join.
- The history cadence test counted its own iterator instead of the
  requests the Runtime made.
The reused-cursor test now reports the missing receipt instead of the
reply its skipped send left behind, and the two cadence measurements
stand as their own tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
A Carrier position belongs to a topic buffer, and a leave and a join
recreate that buffer from position 0. The record now names each ingested
frame by its digest and holds one batch, so a frame at a position an
earlier batch used is ingested and receipted. The acknowledged range
drops the record, because the Carrier never replays it.

Co-authored-by: Cursor <cursoragent@cursor.com>
…expires

A receipt that reached nobody left the sender with a delivered post it
believed was unsent, so it re-sent the post to the whole topic until the
post expired. The receipt now waits in its own queue: 5, 10, 20, 40 and
then 60 s between sends, at most 32 posts and 1 MiB of frames, at most
four sends in one live cycle, and no send after the post expires. A
receipt a neighbour took leaves the queue at once.

Co-authored-by: Cursor <cursoragent@cursor.com>
A person who left Community and joined it again kept the grown wait, so
the Runtime could wait a quarter of an hour before it asked for the
posts of the time away. The worker now reads the membership change
itself, both before a check and while a check runs, and both paths use
the one reset the service owns.

Co-authored-by: Cursor <cursoragent@cursor.com>
A pass that reached nobody doubled the wait towards a quarter of an
hour, so a person could wait that long for the posts a returning Home
holds. Only a pass another Home answered grows the wait now; an
unanswered pass stops at a minute, the silence the Community link
already treats as normal.

Every check samples the Homes it sees and the person reading Community,
so a Home that lapses and returns between two passes asks again, and a
person who opens Community asks at the next check. The Home page
heartbeat carries that signal on the presence port History already
reads, so nothing new travels between Homes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@andersalm
andersalm merged commit adb92d5 into develop Nov 15, 2026
16 checks passed
@andersalm

Copy link
Copy Markdown
Contributor Author

Merged on Anders's explicit authorization in chat (15 Nov 2026); required checks green on 54fb9a1.
Review: Claude Fable PASS on 54fb9a1, tree ee69fff39 (round 3); rounds 1 and 2 were reviewed by GPT and their findings are fixed; pull request files unchanged since.
Follow-ups are in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant