Skip to content

feat(cycle): token approval cycle (#16)#35

Merged
lex00 merged 1 commit into
mainfrom
feat/token-approval-cycle
Jun 19, 2026
Merged

feat(cycle): token approval cycle (#16)#35
lex00 merged 1 commit into
mainfrom
feat/token-approval-cycle

Conversation

@lex00

@lex00 lex00 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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 to group:scope names.
  • Decision: approve when every requested permission is in allowedPermissions; otherwise the policy default applies (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

  • New TokenApprovalPolicy on OrgConfig.tokenApproval; LiveTokenRequest + pure evaluateTokenRequest in the diff (unit-tested). Decisions emit token-request UPDATE entries; manual-review requests produce no entry.

Verification

  • npx tsc --noEmit clean
  • npm test green (450 tests; +14 in token-approval.test.ts)
  • Action bundle rebuilt for the CI freshness check

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

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>
@lex00 lex00 merged commit 3af6bb8 into main Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cycle: token approval

1 participant