Skip to content

Phase 4: delete the staff allowlist; the Support role gate fails closed - #48

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
claude/role-allowlist-retirement
Jul 30, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
claude/role-allowlist-retirement

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Completes Phase 4 of docs/ROLE_ADOPTION_PLAN.md. Gated on and now unblocked by the live bootstrap seed: the audited Support assignment (bootstrap-support-…, actor system:bootstrap) plus its durable marker were verified in production D1 on 2026-07-30, and the staff queue loads with no allowlist configured.

Deleted whole

  • SUPPORT_STAFF_EMAILS / SUPPORT_STAFF_PRINCIPALS parsing (parseStaffAllowlist, StaffAllowlist, emptyStaffAllowlist) and the legacy staffAccessContext — the allowlist must not survive as a quiet second gate.
  • The staffAllowlist API option and its index.ts wiring; SupportRuntimeEnv no longer documents the vars.

Fail-closed posture

requireStaffAccess is role-only: no role store wired → 503 support_not_configured; role-store failure → 503 service_unavailable (logged error) — never a quiet allow or a misleading 403. Same posture as the reference host's retirement.

Tests (195 node + 2 D1 green, tsc + astro check clean)

  • Staff-surface tests grant the stored Support role instead of an allowlist; grantSupport promoted to module scope.
  • Allowlist unit tests and the email-allowlist test deleted with the feature.
  • Fallback-matrix test rewritten: unconfigured host → 503, and a role-store outage → 503 even for a principal whose durable grant is real — outage must never quietly deny.

Also

  • Staff UI copy no longer mentions an allowlist (role wording).
  • SUPPORT_COMPOSITION.md staff section is role-only + fail-closed contract; plan Phase 4 boxes ticked.

Operational notes

  • The live worker never had the allowlist vars set, so there is nothing to delete from Worker configuration.
  • Reminder tracked separately: delete the PEGMA_SUPPORT_BOOTSTRAP_PRINCIPALS secret now that the seed is confirmed (Phase 3's final box stays unticked until then).
  • Worker deploys: until Deploy the worker from CI alongside the Pages site #47 lands, this needs a manual npm run worker:deploy after merge.

🤖 Generated with Claude Code

The stored Support role is now the only staff gate (live seed verified
2026-07-30): SUPPORT_STAFF_EMAILS / SUPPORT_STAFF_PRINCIPALS parsing and
the legacy staffAccessContext are deleted whole, per the plan's rule that
the allowlist must not survive as a quiet second gate. A host wired
without a role store answers staff routes 503 support_not_configured; a
role-store failure is 503 service_unavailable — never a quiet allow or a
misleading 403. Staff UI copy and composition docs updated to role-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 30, 2026 16:24
@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.

@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: faf1781b93

ℹ️ 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 src/pages/staff/support.astro Resolved

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 completes Phase 4 of docs/ROLE_ADOPTION_PLAN.md by removing the legacy Support Desk staff allowlist path and making staff authorization depend solely on the audited stored Support role, with a fail-closed 503 posture when the role store is missing or unavailable.

Changes:

  • Deleted the staff allowlist env vars and parsing/resolution path (SUPPORT_STAFF_EMAILS / SUPPORT_STAFF_PRINCIPALS) and removed the API wiring for staffAllowlist.
  • Updated staff-route authorization to be role-only and fail closed: no role store → 503 support_not_configured; role-store failure → 503 service_unavailable.
  • Updated tests and UI/docs copy to reflect role-only staff access.

Reviewed changes

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

Show a summary per file
File Description
worker/src/support-desk.ts Removes documentation of legacy allowlist runtime env vars.
worker/src/support-api.ts Deletes allowlist option/wiring and enforces role-only, fail-closed staff authorization.
worker/src/support-api.test.ts Updates fixtures/tests to grant stored Support role and verifies fail-closed 503 behavior.
worker/src/support-access.ts Deletes allowlist parsing and the legacy staff access-context resolver.
worker/src/index.ts Removes allowlist parsing from worker handler wiring; role store is the only gate.
src/pages/staff/support/ticket.astro Updates staff UI copy to refer to Support role instead of allowlist.
src/pages/staff/support.astro Updates staff UI copy to refer to Support role instead of allowlist.
docs/SUPPORT_COMPOSITION.md Documents the new fail-closed role-only contract and notes allowlist deletion.
docs/ROLE_ADOPTION_PLAN.md Marks Phase 4 allowlist retirement checklist items as completed.

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

Comment thread worker/src/support-api.ts Resolved
Comment thread worker/src/support-api.test.ts Resolved
… type

- Staff page <Base> descriptions, the composition doc's site-page table
  and privacy bullet, and one test name still described allowlisted
  operators; all now say Support role.
- roleAccess declared with the explicit awaited return type instead of an
  evolving let.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit f5fd895 into main Jul 30, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/role-allowlist-retirement branch July 30, 2026 17:13
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