Skip to content

canary → main: channel_gist convergence (#321) — oldest gist wins - #322

Merged
joelteply merged 2 commits into
mainfrom
merge-321
Apr 29, 2026
Merged

joelteply merged 2 commits into
mainfrom
merge-321

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Critical convergence fix for substrate unification. With multiple duplicate gists on the same gh account (from accidental host-takeovers / re-creates), peers were splitting silently — sends looked successful, peers on different gists heard nothing. find_existing now returns OLDEST by created_at (deterministic). 5 unit tests, 68 bearer tests + 5 monitor + 4 smoke all pass.

joelteply and others added 2 commits April 29, 2026 11:00
Symptom: 'I can manually message them' / 'they ain't gonna notice
they are all broken' (Joel 2026-04-29). Confirmed: my account had
TWO #general gists (9740e0e1... and d469970...). My broadcasts went
to one; peers were polling the other. Sends looked successful, peers
heard nothing.

Root cause: channel_gist.find_existing returned whichever matching
gist appeared first in gh's list-response. gh list-response is
recency-ordered, so the 'first match' could differ across peers and
across calls. Two peers polling at slightly different times could
pick DIFFERENT duplicates of the same channel → substrate split.

Fix: convergence rule. When N gists describe the same channel,
return the OLDEST by created_at. Deterministic across every peer
regardless of when they polled. Same rule mesh.sh:_mesh_find already
uses for the legacy 'airc mesh' singleton; bringing channel_gist
into line.

#290 contract preserved: canonical single-channel gists still take
priority over legacy multi-channel mesh gists. The oldest tiebreak
applies WITHIN each pass.

TDD: test_channel_gist.py (5 cases) — two-dup, three-dup, canonical-
beats-older-legacy, none-match, all-legacy-still-oldest.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit c84434b into main Apr 29, 2026
@joelteply
joelteply deleted the merge-321 branch April 29, 2026 16:00
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