Skip to content

spec(port): port the group context hash consistency guard (Refs #8883) - #9915

Merged
1 commit merged into
Trinity-S-AI-DNA:masterfrom
dmitrii-f-t27:port/cr-chat-03-j
Oct 17, 2026
Merged

1 commit merged into
Trinity-S-AI-DNA:masterfrom
dmitrii-f-t27:port/cr-chat-03-j

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

The tenth CR-CHAT-03 ring target (W3, tracker #8883, epic Trinity-S-AI-DNA/trios#1812): port of crates/trios-chat/rings/CR-CHAT-03/src/group_context_hash_consistency_guard.rs (Wave-59 Lane B, R-CHAT-4).

The group context hash pins the tree, the epoch and the membership; two members holding different hashes are a split-brain an attacker opens by tampering a Welcome, withholding an update path or injecting divergent commits. Rules, in the original's order:

  1. reports ≥ 2 members,
  2. per report, in order: non-zero epoch, non-zero hash, fresh member identifier (no duplicates), hash equal to the first report's reference.

Carried as the D5 verdict — all six original error variants carry no payload, so the code is the whole verdict. Note: the original's prose lists a hash-length rule with a WrongHashLength variant, but its hash is a fixed [u8; 32] array and no code path ever answers it — the variant stays in the enum, declared and unreachable exactly as in the original (the declared-unreachable convention).

Adaptations (t27 conventions): member identifier widens from u32 to usize (t27's loop counters are usize; every fixture value fits both); the BTreeSet of seen identifiers → scan over the reports already visited; the Option<&[u8; 32]> reference hash → has-reference flag over the record fields.

All 10 original GCHC tests transcribed with exact asserts (including the 50-member loop and the mismatch-at-the-end fixtures), plus 3 helper tests and a rule-order ladder stacking all four per-report violations on one report (14 total).

Checks (conventions 0-14): t27b test 14 passed 0 failed, 0 blockers; t27c test-report 14/14, 0 vacuous; gen-rust output compiles under rustc (0 'static str, 0 Vec<const); coverage Untested 0; ASCII only; seal saved, all hashes MATCH; ledger row added to docs/reports/t27b_expectations.json.

Refs #8883

…ty-S-AI-DNA#8883)

The tenth CR-CHAT-03 ring target (W3, R-CHAT-4): the group
context consensus rules, in the original's order - the
member floor (two), then per report the zero-epoch probe,
the zero-hash probe, the duplicate-member probe and the
reference-hash comparison against the first report - as the
D5 verdict (all six original variants carry no payload, so
the code is the whole verdict), the original's rule order,
and all ten GCHC tests transcribed plus helper and
rule-order tests. The original's prose lists a hash-length
rule with a WrongHashLength variant, but its hash is a
fixed thirty-two-byte array and no code path ever answers
it - the variant stays in the enum, declared and
unreachable exactly as in the original.

The member identifier widens from u32 to usize - t27's
loop counters are usize and every fixture value fits both.
The original's BTreeSet of seen identifiers becomes a scan
over the reports already visited; the Option reference hash
becomes a has-reference flag over the record fields.

Checks (conventions 0-14): t27b test 14 passed 0 failed; t27c
test-report 14/14, 0 vacuous; gen-rust output compiles under rustc;
coverage Untested 0; ASCII only; seal saved, all hashes MATCH;
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

All required checks green (validate, check-linked-issue, parse-ratchet, t27b-native-linux, t27b-native-macos); cli-tri / duplicate-bodies / t27b-native-ratchet are the known non-required reds. Steward READY. Tenth CR-CHAT-03 target (10/47 T-PORT) — requesting owner merge when convenient, Refs #8883.

This was referenced Oct 17, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 17, 2026 18:14
@gHashTag
gHashTag disabled auto-merge October 17, 2026 18:42
@gHashTag gHashTag closed this pull request by merging all changes into Trinity-S-AI-DNA:master in 12f5af8 Oct 17, 2026
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.

2 participants