Repository navigation
Description
Summary
The versioned group.event wire codec landed today in PR #5212 (pkgs/id/src/groups/event.rs, for #163) accepts three shapes that no sibling codec in pkgs/id accepts: duplicate causal predecessors in after, an event that names itself as a causal predecessor, and a create body that lists the same member twice with conflicting roles. Its check_bounds enforces only counts (≤256 predecessors / create members) and the decline-names-a-group rule — it never deduplicates, and neither the encode nor the decode path compares after against the event's own id.
Evidence (verified on origin/main @ 3adad8f, this run)
pkgs/id/src/groups/event.rs:218-241—check_bounds()checksafter.len() > MAX_AFTER, create-member count, and the friendship-decline group rule only.encode_group_event(event.rs:134) anddecode(event.rs:160, which callscheck_boundsagain at the end) both gate on it, so one missing check leaves both paths open.- Sibling precedent in the same crate:
pkgs/id/src/chain.rs:222—ChainExt::validate()refuses a repeatedafterhash with the named errorChainError::DuplicateAfter, and its tests pin that refusal (chain.rs:601-606). The same bug class inartifact.rswas filed and fixed as id(artifact): check() accepts duplicate after hashes — the same hash can fill all 32 frontier slots, unlike chain.rs which refuses DuplicateAfter #3196 ("check() accepts duplicate after hashes — the same hash can fill all 32 frontier slots, unlike chain.rs"). - The group fold itself treats a repeated create member as malformed:
pkgs/id/src/groups/fold.rs—FoldError::BadMembers, "The members list repeats an account, or names the author." So a wirecreatewith a duplicated member is an event the codec blesses that the fold can only refuse.
Verified with a laptop probe at origin/main 3adad8f (~/git/fleet/probe-2026-11-03-laneA-groupevent/pkgs/id/tests/probe_groupevent.rs, cargo test --test probe_groupevent — 1 passed):
- Control: an ordinary
joinevent round-trips encode → decode unchanged. after = [H, H](same predecessor twice):encode_group_event= Ok,decode= Ok with 2 predecessors.after = [own id](self-predecessor):encode_group_event= Ok,decode= Ok with 1 predecessor.createwith members[([6;32], Read), ([6;32], Admin)](same key, conflicting roles):encode_group_event= Ok,decode= Ok with 2 members.
Why it matters
This codec is the wire format group events will sync by, and it has no production consumer yet — now is the cheapest moment to tighten it, before lax acceptance is baked into peers' stored logs. A duplicated predecessor inflates the causal frontier with noise every later consumer must tolerate; a self-predecessor is an unplaceable causal cycle (the group log's fold "refuses an after it cannot place", and a self-reference can never be placed); a duplicated create member carries two contradictory roles for one account in a single signed object, and which one wins depends on the reader. Every other causal codec in pkgs/id refuses these shapes at the boundary (DuplicateAfter in chain.rs, the #3196 artifact fix, duplicate refusals in chat links #4857 and tag claims #4765) — this one should match the house rule while it is still version 1 with no deployed peers.
Acceptance criteria
-
check_bounds(or an equivalent single gate used by bothencode_group_eventanddecode) refuses a repeated hash inafterwith anEventError::Shapenaming the duplication, mirroringChainError::DuplicateAfter. - The same gate refuses an
afterentry equal to the event's ownid(a self-predecessor / one-node causal cycle). - The same gate refuses a
createbody whosememberslist names the same key twice (regardless of role), matching the fold'sBadMembersrule. - Tests in
groups/event.rscover all three refusals on the decode path (hand-built CBOR, not just encode) plus the existing round-trip/golden tests staying green. - Existing groups tests still pass (
cargo test -p id groupson the laptop/CI).
Activity
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
afterpredecessors, a self-predecessor, and a create body with a duplicated member key — probe:~/git/fleet/probe-2026-11-03-laneA-groupevent(cargo test --test probe_groupevent, 1 passed). Enqueued as a small_fix packet on the repo-health-code-pilot queue.hidden_files/issue-groupevent-codec-dup-after.mdin the goal workspace.dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 4, 2026
🤖 Agent note · picked up
after, self-predecessor, and duplicate create members. Fresh check: issue id(groups): group.event wire codec accepts duplicate/self causal predecessors and duplicate create members — check_bounds counts but never deduplicates #5217 OPEN, no hard-stop labels, no existing PR. Worktree on laptop~/git/fleet/8952-5217-groupevent, branchqueue/8952-5217-groupevent-dedupfrom origin/main.cargo test -p id groupson laptop, then merge under standing criteria or park on CI.50 remaining items
dezren39 commentedon Nov 4, 2026
🤖 Agent note · attention — protocol gap (missing agent note)
This item carries
work/*/queue/claimedlabels but has NO comment containingagent-note:v1— the holding agent did not leave the required agent note (lifecycle protocol §2/§6). Flagged withuser/review+meta/protocol-gap. The gap itself needs a human/Muse review of why the protocol was not followed.dezren39 commentedon Nov 7, 2026
Picked up by
repo-worker-code-s— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-code-sposts progress markers; after 30 minutes of silence any other worker may pick this up.)dezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-s: verified: PR #5246 mergeable clean, Codex no findings, fix absent on main; merging under standing criteriadezren39 commentedon Nov 7, 2026
🤖 Agent note · reviewed — proceeding to merge
user/reviewreviewer. Fresh verification: issue id(groups): group.event wire codec accepts duplicate/self causal predecessors and duplicate create members — check_bounds counts but never deduplicates #5217 OPEN with NO hard-stop labels (no held / user/owned / do-not-merge / do-not-auto-edit); PR id(groups): refuse duplicate/self predecessors and duplicate create members in group.event codec #5246 OPEN at head 366b7b1, mergeable=clean; the dedup fix is NOT on main yet (no seen_after/seen_members in main's event.rs); Codex review completed with NO findings; checks: production-line-guard SUCCESS, CodeRabbit neutral; lane K's recorded laptop tests: groups::event 6 passed, groups:: 116 passed. Diff is exactly the issue scope (check_bounds refuses duplicateafter, self-predecessor, duplicate create members + tests for encode and hand-built-CBOR decode).dezren39 commentedon Nov 7, 2026
Released by
repo-worker-code-s(outcome: done). Reviewed canonical PR #5246 as user/review reviewer: mergeable clean, Codex no findings, fix absent on main, lane K laptop tests groups:: 116 passed. Merged PR #5246 (squash, merge commit 3d69199); issue #5217 CLOSED; lifecycle labels cleaned. Prior author-based parks were a misread: hard stops are labels, none present.