Skip to content

id(writer-set): exact Admin role at the frontier — plumb fold admin state into expansion (follow-up to #4998) #6798

Closed

Description

@dezren39

Problem

idset::expand (PR #6787, for #4998) evaluates a group entry's role_min against the member's role at the pinned frontier, read from the membership layer. The membership layer records Admin as Manage — Admin is a policy role the groups fold tracks apart from access (record.admins, with admin_at_position replaying it at a causal position in pkgs/id/src/groups/fold.rs). The layer therefore cannot distinguish an admin from any other manager at a frontier.

Current behaviour (pinned by test_expand_role_min_admin_is_answered_at_manage_the_layers_top_role in pkgs/id/tests/writer_set_expansion.rs): a role_min: Role::Admin entry is evaluated at Role::Manage. Admins are admitted, but so are non-admin managers — an Admin-threshold admission is broader than the set's author wrote, and an Admin-threshold exclusion is broader too.

What exact resolution needs

Plumb the fold's admin-at-frontier state into expansion so a snapshot can carry Role::Admin for members who held Admin at the set version's pinned frontier:

  • an admins_at(group, frontier) source beside Membership::members_at_position (the fold's admin_at_position replay is the existing model), or fold the distinction into the membership layer itself;
  • Expander takes that source and marks those members Role::Admin in the GroupMembers snapshot it builds, dropping the Manage clamp in clamp_admin_thresholds;
  • tests: an admin admitted by an Admin entry while a non-admin manager is not; a member promoted to Admin only after the frontier not admitted by the earlier version (the Admin analogue of spec test 6).

Evidence

  • Codex P2 finding on PR feat(id): store-wired writer-set expansion — expand/expand_retro over the membership layer (#4998) #6787 (comment 4500186199) raised the original form of this (Admin entries expanding to empty); the clamp fixed the empty-expansion half, this issue tracks the exactness half.
  • pkgs/id/src/idset/expand.rs module doc states the limitation and names this follow-up.
  • The pure projection (idset::view::expand_set) already handles Admin correctly when a snapshot carries it — only the store wiring lacks the data.

Parent context: #4998 (spec §9 item 2), #3789.

Activity

  1. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor
  3. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Picked up by repo-worker-code-b — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-b posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  5. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Progress from repo-worker-code-b: verified + implementing: id-core has no Admin (grep: zero hits); Expander gets a required admins_at(frontier, group) source modeled on fold::admins_at_position, snapshot marks sourced members Role::Admin, clamp_admin_thresholds deleted; tests per issue (admin admitted / non-admin manager not; promotion after frontier not admitted). Worktree on laptop next

  6. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Progress from repo-worker-code-b: implementation in worktree ~/git/fleet/6798-admin (branch queue/6798-exact-admin-role): expand.rs + tests edited; cargo test --test writer_set_expansion compiling/running on laptop

  7. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Progress from repo-worker-code-b: pr_opened: branch queue/6798-exact-admin-role (d668980) pushed; tests 15/15 on laptop; next: PR checks + Codex watch, then merge

  8. added a commit that references this issue on Nov 7, 2026
  9. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Released by repo-worker-code-b (outcome: done). DONE fixed_merged (fallback, lane code-b): implemented exact Admin role at the frontier - Expander takes an AdminsAtPosition source beside members_at_position (modelled on the fold admins_at_position replay), snapshot marks sourced members Role::Admin, clamp_admin_thresholds deleted, no-data source fails closed. PR #6833 MERGED as fbf8cf7 (branch queue/6798-exact-admin-role, d668980); cargo test --test writer_set_expansion 15/15 pass on the laptop incl. the two issue-specified tests (admin admitted / non-admin manager not; promotion after frontier not admitted) plus a fail-closed baseline replacing the pinned clamp test; no new rustfmt diffs vs baseline; no Codex findings existed. Verified on fresh main: AdminsAtPosition present, clamp gone. Issue #6798 CLOSED by the merge. Labels status/needs-triage on #6798 are moot post-close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/enhancementpriority/normalOrdinary priority (the default)status/needs-triageNot yet triaged; needs a first lookstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions