feat(cycle): token approval cycle (#16)#35
Merged
Conversation
Auto-decides pending fine-grained PAT requests against policy: approves when every requested permission is allowed, else auto-deny or leave for manual review. New TokenApprovalPolicy + LiveTokenRequest + pure evaluateTokenRequest + token-request diff type (decisions as UPDATE entries). App-only platform wall documented. Mock-tested; verify against a real App/test-org later. Registered, exported, action bundle rebuilt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 19, 2026
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 #16. Built mock-tested now (per roadmap decision); verify against a real App/test-org before relying on it.
Adds the token-approval cycle — auto-decides pending fine-grained PAT requests against policy.
What it does
GET /orgs/{org}/personal-access-token-requests— list pending requests (paginated); permissions flattened togroup:scopenames.allowedPermissions; otherwise the policydefaultapplies (deny or manual = leave pending).POST /orgs/{org}/personal-access-token-requests/{id}{action}— approve / deny.Platform wall
These request endpoints are App-only. Admins can only approve/deny — they can't change the repo scope a creator chose — so the policy decides approve/deny only.
Modeling
TokenApprovalPolicyonOrgConfig.tokenApproval;LiveTokenRequest+ pureevaluateTokenRequestin the diff (unit-tested). Decisions emittoken-requestUPDATE entries; manual-review requests produce no entry.Verification
npx tsc --noEmitcleannpm testgreen (450 tests; +14 intoken-approval.test.ts)With this merged, every actionable roadmap issue is addressed; only #20 (extract harness to a chant primitive) remains, deferred by design until a second git-host warden exists.
🤖 Generated with Claude Code