VERDICT: MERGE. No blocking finding. F1, F4 and X10 are fixed as claimed, F2's heartbeat s

From mnema-talk v3.3.13, rendered on this site.

REVIEW of #779 round 3 delta (head 347d3f1bd, five commits on origin/main cd402e0bf) -- fourth reviewer, 2026-11-11 Status: COMPLETE (seed sweep result appended at the end). Read-only; nothing edited, committed or pushed in the repository. Evidence: all numbers are from MY runs in scratch worktrees (head; main cd402e0bf with the head's groupRoom.fixture.ts copied in; a third worktree stepped through the five commits). Tests and outputs: audit-run/review-779d-scratch/ (zzd1 split, attacks, X10 honest cases; zzd2 edge cases; zzd3/zzd4 traces; c2/d1/d2 outputs for head and main; suite-per-commit.txt). Code delta read in full: groupMerge.ts, groupSync.ts (renewOwn), groupEpoch.ts:98-99, groupRoom.fixture.ts, the new tests, SECURITY.md. group.ts and groupVet.ts are byte-identical to the head of the last review (e8f81234c): no acceptance rule was edited.

FINDINGS (none blocking)

D1. SHOULD-FIX, follow-up (liveness, no media only) -- a welcome from a lowest id I never got a handshake from is refused, and the next offer is the same package. web/src/lib/media/group.ts:145 and :154-155 (the sender must be in my room), groupMerge.ts:90-95 (asks is per lead, the package is renewed only when the SAME lead was offered it), groupMerge.ts:138-146 (a verified heartbeat is a sign but not heard). Scenario (zzd2 S6, trace in d3-s6-trace-wthead.txt, production timing, no media): one group {1,2,3,4,5}; 4 and 5 are cut off until each half removed the other; id 1 leaves the Talk during the cut; the halves meet. Id 2 is now the room's lowest. It joined before 4 and 5 and never committed while they were in, so they hold its leaf key but never "heard" it. 218 s id 2's heartbeat verifies at 4 and 5 (sign recorded), but id 2 is not reachable for them, so no offer. 1781 s id 3's renewal commit is the first handshake: 3 is now their lowest heard id, they offer. 1784 s id 2 (committer over there) welcomes 4. 4 refuses: the sender is not in its room until the next sync. 1787 s 5 offers, has heard 2 by now, takes its welcome. 1814 s 4 offers again, now "to id 2": no ask on record for 2, so the SAME package goes out; 2 has seen it, nothing. 2024 s id 2's next heartbeat is the newer sign; 4 offers a new package, 2 swaps the leaf, one group. Member 4's own state, read in the run (d5-s6-member4-wthead.txt): at 230 s signs=[2,3], heard=[1,5], room=[5]; the welcome at 1784 s meets room=[3,5]; at 1816 s asks hold m3@1784 and m2@1814, both "same package as held". One group after 2024 s; the split whose lowest id was heard takes 237 s (with fix (b) this one would too). With media: 32 s. Main: never without media. So this is no regression and no safety matter; it is the remaining slow path of F2 and of F7's family. Fix: (a) in mergeOffer renew whenever this package was offered before from inside this group, whoever the lead was (compare against every entry of asks, or keep one "last offered" field); (b) in beatOutside add the id to heard when its heartbeat verifies (a verified signature is stronger than the unverified handshake that sets heard today, so the server gains nothing) and let the tick's room reflect it. Add S6 as a test.

D2. NOTE (text) -- SECURITY.md:842-845 names two of the cases without a usable heartbeat, and one clause is not exact. "A member that never shared a group with that id, or whose record of it is gone because the id reloaded or left the Talk in between, holds no key to check its heartbeats with and waits for its next commit, at most one rotation period." - "record ... gone because the id reloaded": the record is replaced only when a heartbeat of the NEW leaf verifies in my tree. If the id reloaded after it left my tree, the old leaf's key stays, the new tab's heartbeats stay unread (true), and heartbeats the OLD tab signed that I have not seen still count as a sign (zzd1 A2: five such, delivered after the reload, one a minute: offers at 14, 74, 194 and 434 s per member, then none). Only the server holds such heartbeats. - Not named: a member that shared a group with the id for less than a heartbeat period (zzd1 S5: 1467 s without media, 41 s with), and D1's case (key held, id never heard: 2024 s). - "at most one rotation period" is the wait for the commit; the merge follows it (9 to 30 s, 243 s in D1's case). Fix: "... or that took no heartbeat of it while they shared one ...; heartbeats its previous tab signed and I never saw still count, which only the server can supply, at the rate of the wait below".

D3. NOTE -- a sign has no age. groupMerge.ts:67 (dropped only when the id is in my tree or unlisted), :86. zzd1 A1 / zzd2 A1c: new heartbeats of id 2 reach 3 and 4 while id 1 is listed: 0 key packages in 25 min (a member that is not the room's lowest triggers nothing). Id 1 then leaves the Talk: 3 and 4 offer to id 2 at 21 s and 24 s on the 25-minute-old sign, once each, and never again in the next hour. Same for a commit-shaped sign since round 2. It costs one key package per member. Fix if wanted: ignore a sign older than ASK_MAX_MS. Not needed for the merge.

D4. NOTE (text) -- SECURITY.md:826-828 "a new signature key comes only with a start-over, a reload, or the package a group that shrank to one makes for itself". A member WITHOUT a group that offers again also makes one (groupSync.ts:96-105 reofferNow, :138 resend, group.ts:245 after a removal). True if "start-over" is read to include those; one word fixes it.

ANSWERS

  1. F1 -- fixed. zzc2 T1 on the head: shrunk: 0 s of 1200 s apart, 0 commits, 0 welcomes, 15 key packages; control: 0 s, 0, 0, 15. (Last review: 5 s, 2 commits, 2 welcomes, 16.) Bob's offers at 15 / 75 / 195 / 435 / 915 s draw nothing from Carol. Code: mergeOffer renews when the held package is not under my leaf's key (groupMerge.ts:93-94); renewOwn signs with the state's key and the tree's public key (groupSync.ts:265-276). Key hygiene read: the package made alone (new key) is wiped as unused; the copy of the leaf key held by a renewed package is a slice, so wiping it later leaves the state's key alone; after a join the old package's keys go to leafKeys as before.

  2. F2 -- the heartbeat sign is unforgeable and unreplayable under the rules of 1c, and bounded by the give-up wait. Rule (groupMerge.ts:138-146): listed id, not in my tree, I hold a group, a record exists (made only in beatNow from a heartbeat verified under that id's leaf in MY tree), the wire verifies under the record's key over group id, the sender's id, epoch and time, and its time is newer than the record's; the record's time is then raised.

    • Forgery: needs that leaf's private key. The signed bytes name the id, so one member's heartbeat cannot pass as another's.
    • Replay: the record is the same one 1c uses: one per id, newest time per signer key, kept across discard (beatsLeft only clears here), raised by heartbeats for any epoch, dropped only when the id is unlisted (and then no key is left, so nothing verifies after a leave and return). PR's own test re-run in the suite: seen and older ones give 0 offers. The record cannot be made or replaced from outside my tree, so beatOutside cannot weaken 1c; it only raises the time.
    • Not the room's lowest: the sign is stored for any such id but only the lead's is read: 0 offers (A1, A1c). See D3.
    • Old heartbeat from before the id's reload: counts if I never saw it (A2, D2). It buys what a commit-shaped message under that id already buys since round 2 (unverifiable, unlimited supply): my key package, at the wait's rate.
    • Server feeding unseen genuine heartbeats to make members offer again and again (zzd1 A3, halves cut off, 5 heartbeats, one a minute): offers at 24, 84, 204, 444 s per member and none after; the members' own group: 0 s without a common key in the hour, no commit caused. Bound: the wait (60 s doubling to 600 s, at most 9 offers per member per hour) AND the stock (one heartbeat per 5 minutes the server held back); the commit-shaped sign has only the first bound. Split of ONE group (halves shared it for 6 minutes, cut off 25 minutes, then meet), time until one group, head | main: no media: 2+2 237 s | not in 1 h; 2+4 237 | not; 4+2 237 | not; 6+6 234 | not media: 2+2 41 s | 41; 2+4 35 | 35; 4+2 35 | 35; 6+6 6 | 6; 0 s apart in the 10 minutes after, every row The author's 234 to 237 s and 6 to 41 s are confirmed. With media the head equals main: there the call's start-over merges the halves; the heartbeat sign is what merges them without media (main: never). Halves formed apart (zzc3 re-run): 1797 / 1797 / 1794 s without media, 1793 / 26 / 6 s with: as the author says.
  3. F4 -- fixed. zzc2 T3: flap 27 key packages, stay 27 (last review 153 / 27); 0 s apart and 3 commits in both. groupMerge.ts:68: an ask of an unlisted id is kept until its wait plus ten minutes have passed. An id that stays away longer loses the doubling, but then more than the longest wait has passed anyway: no faster than staying.

  4. X10 -- fixed, nothing an honest member needs is refused, no acceptance rule touched. zzc1 on the head | main: hung lowest tab, formed lowest first, room of 3: 0 s of 3600 s, 4 commits, 0 key packages, 0 welcomes | 2104 s, 3, 53, 1; room of 4: 0 s, 5, 0, 0 | 2107 s, 3, 90, 1. Lowest joined last (3, 4, 8, 12) and the silent listed id (3, 4, 8, 12): 0 s on both, identical counts. The commit is two lines (groupEpoch.ts:98-99): at every new epoch, pending packages of ids that ARE in my tree go. pending is read in three places: proposalsFor (already skipped tree members: the entry only mattered after the member was removed, which is the bug), allOffered (only without a group, after discard cleared the map) and dropPackages. The validator, wasRelayed/relayed and vetAdds are untouched.

    • Slow joiner whose package is old but valid (zzd1 X1: the committer hangs, a newcomer offers, nobody can add it until the next member takes over): in after 1284 s on the head, 2582 s on main; 0 s apart in the hour after on both. Its id is not in the tree, so its package stays.
    • Joiner that reloads while its previous package is pending: 1284 s | 2582 s, same as above (the newer package replaces the older in the map, as before). A reload of a member that IS in the tree never used pending (group.ts:109).
    • A member removed for silence that comes back must offer anew. It does: it either hears a commit ahead and starts over, or, if it is the lowest and keeps its old group, its heartbeat is the sign and the others offer (by reading). zzd1 X2 (lowest cut off 25 min, then back): one group 44 s (room of 3) and 41 s (room of 4) after, 0 s apart in the following hour, identical on main. (That test's "others apart while cut off" figure is an artefact of the fixture's engine model, which compares epochs across the cut; traced in d4-x2-trace-wtmain.txt. Disregard it.)
  5. SECURITY.md, every sentence the five commits touch, against the code at the head: True: :819-823 welcome rule, "does not count"; :823-826 one join, init key wiped; :826-827 "signed with the key of the member's leaf" (now exact, F1); :828-831 shrank-to-one package and "the one founder case closed"; :831-835 founding package still opens (zzc2 T2a: e2{2,3,4}; T2b: e2{1,2,5}, as on main); :835-842 offer only after a sign, the three signs, "a copy or an older one is no sign", "nobody without that leaf's key can make one"; :846-850 the offer costs the member's group nothing (T1: 0 commits); :850-854 wait, asked once, "leaving ... does not shorten the wait" (T3); :854-856 roster's lowest swaps; :856-859 lowest heard id, leftover leaf; :859-862 a moved member's heartbeats verify in the group it left and start nobody over (beatElsewhere acts only on the lead); :862-865 the pull; :866-879 commit ahead and the conditions of 1c (beatOutside only raises the stored time, which makes 1c stricter, never looser); :879-881 epoch NUMBER (heartbeat.ts signs group, id, epoch number, time); :881-887 server and replays, "alive only for a verified heartbeat or commit" (beatOutside sets no sign of life); :913-915 "once more"; :953-955. Not exact: :842-845 (D2); :826-828 (D4, wording).

  6. Suite, vitest run src/lib/media --maxWorkers=3, fresh checkout of each commit: fa3fbe891 32 files passed; 329 passed, 8 expected failures, 81 skipped 3b0aaa9d6 32 files; 332, 8, 87 07c1fccee 32 files; 334, 8, 86 9b7b6c433 33 files; 336, 8, 91 347d3f1bd 35 files; 378, 8, 43 So the gate seeds pass and the named known failures fail as expected at each commit. Seed lists change in 3b0aaa9d6, 07c1fccee (one seed), 9b7b6c433 and 347d3f1bd. Full sweep of seeds 1..400 against the lists: see SWEEP below.

NOT DONE: mixed old/new rooms not simulated; a truly frozen tab (timers stopped) that wakes is by reading, the fixture can only cut a tab off or close it; sweeps at commits 3b0aaa9d6 and 07c1fccee not re-run (code unchanged since the last review); the PR text was not checked line by line (the task named SECURITY.md). The Go test of fa3fbe891 was run: go test ./internal/sfu -run Conn -count=1: ok.

SWEEP (my run, the author's harness files copied unchanged, output to my scratch; seeds 1..400 on both relays, 240 s bound) head 347d3f1bd: hostile 26 failing, honest 17 failing, every one invariant 1 ("the room did not agree"), none of 2/3/4. Failing seeds are EXACTLY the HOSTILE and HONEST lists in groupSim.known.test.ts at the head; no gate seed of groupSim.test.ts fails. (Main: 51 / 30.) 9b7b6c433 (X10 commit): hostile 54 failing, honest 37, every one invariant 1; EXACTLY the lists in the known file at that commit; no gate seed fails. So the seed lists match at the two commits whose code is new in this round.

Something wrong on this page? Tell us.