feat(cycle): membership & roles reconcile cycle (#6)#24
Merged
Conversation
Reconciles org membership/roles: lists admins+members (paginated),
PUT /orgs/{org}/memberships/{user} to add/re-role, DELETE to remove.
Deletes stay ownership-gated (safe default: add/re-role only). Tests
prove adminFloor and removalDeltaCap trip via the runner.
Registered, exported, action bundle rebuilt.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 #6.
Adds the membership cycle — org members and roles (admins/members), third of the npm-gate set (#5–#9).
What it does
GET /orgs/{org}/members?role=admin|member— paginated live listing, role-taggedPUT /orgs/{org}/memberships/{user}— add a member / set role (create + update)DELETE /orgs/{org}/memberships/{user}— remove from org (delete)Safety (the crux of this issue)
diffMembersonly emits adeletewhen the caller suppliesDiffOptions.isOwned. With the default runner wiring this cycle only adds/re-roles declared members — it never removes anyone.adminFloorblocks an apply that would drop below 2 admins (asserted throughrunReconcilein apply mode —guardrailBlocked, zero mutating calls).removalDeltaCaptrips when >25% of members would be removed.Scope note
Outside collaborators are a distinct per-repo concept not modelled by
MemberConfig; intentionally out of scope here and left as future inventory work.Verification
npx tsc --noEmitcleannpm testgreen (286 tests; +14 inmembership.test.ts)🤖 Generated with Claude Code