Repository navigation
spec(port): port the concurrent add remove reconciler (Refs #8883) - #9906
Closed
dmitrii-f-t27 wants to merge 2 commits into
Closed
dmitrii-f-t27 wants to merge 2 commits into
dmitrii-f-t27 wants to merge 2 commits into
Conversation
…8883) The fourth CR-CHAT-03 ring target (W3, L-CHAT-3-add, RFC 9420 12.2): the concurrent proposal reconciliation - the canonical class order (updates, then removes, then adds, ties broken by leaf then hash id ascending), the exact duplicate sort key rejected up front, and each proposal applied against the intermediate membership (an update must find its leaf a member, a remove must find it a member, an add must find it absent, each violation answering with the leaf it names) - as the D5 verdict with every payload field: the error leaf, and on success the whole membership delta by value (the added, removed and updated lists in canonical application order, the final membership), the original's rule order, and all ten CAR tests transcribed plus helper and rule-order tests. The original's stable sort becomes a selection sort over a local copy of the proposals, ordered by a lexicographic before-probe over priority, leaf and hash id - the same permutation the original's sort produces, the tie key making it total. The BTreeSet of members becomes a fixed member array plus its length: contains a scan, insert an append, remove a shift-left compaction. The original's tenth test pinned the priority constants alone, which fold at compile time in the reference path - the port pins the gate live instead (the WPS-10 precedent), so no test passes vacuously. Checks (conventions 0-14): t27b test 15 passed 0 failed; t27c test-report 15/15, 0 vacuous; gen-rust output compiles under rustc; coverage Untested 0; ASCII only; seal saved, all hashes MATCH;
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. Fourth CR-CHAT-03 target (4/47 T-PORT) — requesting owner merge when convenient, Refs #8883. |
This was referenced Oct 17, 2026
Merged
Merged
Merged
This was referenced Oct 17, 2026
spec(policy): l2_generation -- gen/json/ is t27c gen-json's backend directory (Closes #10079)
#10082
Merged
Merged
Merged
Merged
Merged
# Conflicts: # docs/reports/t27b_expectations.json
Contributor
Author
|
Superseded by #10175: the remaining CR-CHAT targets now land as one port-wave batch per specs/policy/pr_budget.t27 (#10067/#10074), which asks for one PR per ring batch instead of one per file. The spec body, seal and ledger row in this PR are unchanged there; the batch also carries one self-consistent duplicate-body bless. Closing this one-file PR keeps the merge queue and the Actions queue small. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fourth CR-CHAT-03 ring target (W3, tracker #8883, epic gHashTag/trios#1812): port of
crates/trios-chat/rings/CR-CHAT-03/src/concurrent_add_remove.rs(Wave-20, L-CHAT-3-add, RFC 9420 12.2).Two members racing to commit against the same base epoch need a deterministic order; the wrong order leaves a ghost member, resurrects a removed leaf, hides which racing KeyPackage won, or aborts a commit on a duplicate remove.
apply_concurrentsorts the proposal set by the (priority, leaf, hash_id) triple — Updates → Removes → Adds, ties by leaf then hash id ascending — rejects an exact duplicate sort key up front (caller canonicalisation bug), then applies each proposal against the intermediate membership:UpdateNonMember(leaf)), recorded inupdated;RemoveNonMember(leaf)), dropped from membership, recorded inremoved;AddExisting(leaf)), inserted, recorded inadded.Carried as the D5 verdict with every payload field: the error leaf, and on success the whole
MembershipDeltaby value — the three lists in canonical application order and the final membership (fixed capacities + lengths; the BTreeSet semantics read through a set-membership helper in tests, exactly the W2 by-value-verdict precedent).Adaptations (t27 conventions): the original's stable sort → selection sort over a local copy ordered by a lexicographic before-probe (same permutation; the tie key makes the order total);
BTreeSetmembers → fixed array + length (contains = scan, insert = append, remove = shift-left compaction); proposal enum → kind enum + one record form. The original's tenth test pinned the priority constants alone — those fold at compile time in the reference path, so the port pins the gate live (WPS-10 precedent); 0 vacuous.All 10 original CAR tests transcribed with exact asserts (ghost, resurrection, duplicate add/remove, self-remove-with-update, empty set, determinism, tie-break, duplicate key), plus 4 helper tests and a rule-order test (15 total).
Checks (conventions 0-14):
t27b test15 passed 0 failed, 0 blockers;t27c test-report15/15, 0 vacuous; gen-rust output compiles under rustc (0'static str, 0Vec<const); coverage Untested 0; ASCII only; seal saved, all hashes MATCH; ledger row added todocs/reports/t27b_expectations.json.Refs #8883