Skip to content

Plan the Authorization Core role-store adoption (staff allowlist retirement) - #45

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
claude/role-adoption-plan
Jul 30, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
claude/role-adoption-plan

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Summary

Docs-only: docs/ROLE_ADOPTION_PLAN.md plus a PROJECT_PLAN pointer. pegma.dev is the ecosystem's second host to need stored, audited roles — the reference host (retiregolden.org) completed its adoption on 2026-07-29 — and this plan pins how the Support Desk staff env allowlist (SUPPORT_STAFF_EMAILS / SUPPORT_STAFF_PRINCIPALS, which SUPPORT_COMPOSITION.md itself calls "not a full role store") gets replaced.

Deliberately smaller than the reference host's migration: no billing ledger, no derived entitlements, no frozen offline wire contract here. The worker already composes @pegma/identity, @pegma/sessions, @pegma/authorization-identity, and resolveAccess over one D1-backed Store — the only missing piece is @pegma/authorization-storage and a policy with a Support role.

The phases

  1. Policy (schema-validated) + createRoleStore(store, 'pegma.dev') at the composition root — application id is one value, forever. Admin named in prose but not mapped until a surface exists to check it.
  2. Staff gate reads roles per request (uncached — the library's 60s staff-check bound), allowlist honored as legacy fallback: the lockout-safe order proven on the reference host.
  3. One-time bootstrap seed (PEGMA_SUPPORT_BOOTSTRAP_PRINCIPALS) with the two properties the reference host learned the hard way: deterministic assignment id so a revoked operator stays revoked while the var is still set, and human-managed despite the system actor.
  4. Allowlist deleted whole — fail-closed 503 afterward, no quiet second gate.
  5. Shared admin surface — GATED on authorization-core#23 / #24: this second consumer is the extraction trigger, but extracting before those decisions would bake the reference host's index workaround into a public package right as the library may absorb it. The generic/host seam and the last-admin TOCTOU treatment the extracted component must carry are recorded.

Hard rule restated in the plan: nothing is copied between hosts — shared capability arrives as a published package or not at all; one admin tool per site, nothing crossing between them.

🤖 Generated with Claude Code

…rement).

pegma.dev is the ecosystem's second host to need stored, audited roles;
the reference host (retiregolden.org) completed its adoption 2026-07-29.
docs/ROLE_ADOPTION_PLAN.md pins the five phases: policy + role store over
the existing D1 Store; staff gate reads roles with the allowlist as the
legacy fallback (the lockout-safe order proven on the reference host);
one-time bootstrap seed with a deterministic assignment id so revocation
stays durable; allowlist deleted whole (fail-closed 503 after); and the
shared admin-surface extraction recorded as GATED on
authorization-core#23/#24 so a host-side workaround is not baked into a
public package right as the library may absorb it. Nothing is copied
between hosts — shared capability arrives as a published package or not
at all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 30, 2026 14:27
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a docs-only, phase-based migration plan for replacing pegma.dev’s Support Desk staff environment allowlist with the Authorization Core role store, and records the plan pointer in the project plan backlog.

Changes:

  • Add docs/ROLE_ADOPTION_PLAN.md describing a five-phase adoption/migration plan (policy + role store binding, dual-gate transition, bootstrap seeding, allowlist removal, and a gated shared admin surface).
  • Update docs/PROJECT_PLAN.md near-term backlog to reference the new role-store adoption plan.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/ROLE_ADOPTION_PLAN.md New migration plan document for adopting the Authorization Core role store and retiring the staff allowlist safely.
docs/PROJECT_PLAN.md Adds a backlog entry pointing to the new role adoption plan and its gating dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0dde794fdf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ROLE_ADOPTION_PLAN.md Resolved
The plan gated the management surface on an Admin role that Phase 1 left
unmapped and no phase granted — unreachable by construction. Phase 5 now
activates in order: map Admin, run the one-time lockout-safe Admin
bootstrap (deterministic assignment id, human-managed after the write,
var deleted once the first admin exists), then ship the surface — so the
last-admin guard is meaningful from its first request.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit 32b8d7c into main Jul 30, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/role-adoption-plan branch July 30, 2026 14:39
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.

2 participants