Repository navigation
feat(id/idset): exact Admin role at the frontier (#6798) - #6833
Merged
Merged
Conversation
…admin-at-frontier source (#6798) The membership layer records Admin as Manage, so expand() clamped every Admin role_min to Manage: an Admin-threshold admission (and exclusion) was broader than the set author wrote. The Expander now takes an AdminsAtPosition source beside Membership::members_at_position (modelled on the groups fold admins_at_position replay): members the source names at the pinned frontier are marked Role::Admin in the snapshot, clamp_admin_thresholds is deleted, and a source with no admin data fails closed (Admin admits nobody) instead of widening to Manage. Tests (writer_set_expansion, 15/15): the pinned clamp test is replaced by a fail-closed baseline; new tests pin an admin admitted while a non-admin manager is not, and a member promoted to Admin only after the frontier not admitted by the earlier version.
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 7, 2026 06:19
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
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.
Closes #6798 (follow-up to #4998 / PR #6787, from the Codex P2 exactness half).
What changed
pkgs/id/src/idset/expand.rs:Expander::newnow takes anAdminsAtPositionsource beside the membership layer:Fn(&[Hash frontier], Hash group) -> BTreeSet<AuthorKey>— the author keys holding the Admin policy role in that group at that frontier. The model implementation is the groups fold'sadmins_at_positionreplay; a caller adapts it by closing over its fold state and event index.group_membersupgrades members the source names toRole::Adminin the pinned snapshot (admin status never creates membership — a named non-member stays absent).clamp_admin_thresholdsandhas_admin_thresholdare deleted: Admin thresholds are evaluated as written. A source with no admin data fails closed (Admin admits nobody) instead of silently widening to Manage — the pre-id(writer-set): exact Admin role at the frontier — plumb fold admin state into expansion (follow-up to #4998) #6798 clamped behaviour is gone, not just bypassed.Tests — oracle: the membership layer fed a known causal history, as the suite already works
cargo test --test writer_set_expansion(pkgs/id): 15 passed, 0 failed.test_expand_role_min_admin_without_admin_data_admits_nobody(fail-closed baseline; Manage still answered exactly by the layer).test_expand_role_min_admin_admits_admin_not_non_admin_manager— Alice (admin per source) admitted by an Admin entry; Erin, a non-admin manager, is not (a Manage entry at the same frontier admits both, proving the distinction did the work).test_expand_role_min_admin_promoted_after_frontier_is_not_admitted— Erin's Admin exists only at the later frontier in the source's answer; the earlier pinned version admits nobody, the later one admits Erin (Admin analogue of spec test 6).Implemented by lane code-b in fallback mode (queue backend down, code#6619), claimed on #6798.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.