Repository navigation
Phase 4: delete the staff allowlist; the Support role gate fails closed - #48
Conversation
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>
|
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. |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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 forstaffAllowlist. - 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.
… 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>
Completes Phase 4 of docs/ROLE_ADOPTION_PLAN.md. Gated on and now unblocked by the live bootstrap seed: the audited
Supportassignment (bootstrap-support-…, actorsystem: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_PRINCIPALSparsing (parseStaffAllowlist,StaffAllowlist,emptyStaffAllowlist) and the legacystaffAccessContext— the allowlist must not survive as a quiet second gate.staffAllowlistAPI option and itsindex.tswiring;SupportRuntimeEnvno longer documents the vars.Fail-closed posture
requireStaffAccessis role-only: no role store wired → 503support_not_configured; role-store failure → 503service_unavailable(loggederror) — never a quiet allow or a misleading 403. Same posture as the reference host's retirement.Tests (195 node + 2 D1 green,
tsc+astro checkclean)Supportrole instead of an allowlist;grantSupportpromoted to module scope.Also
SUPPORT_COMPOSITION.mdstaff section is role-only + fail-closed contract; plan Phase 4 boxes ticked.Operational notes
PEGMA_SUPPORT_BOOTSTRAP_PRINCIPALSsecret now that the seed is confirmed (Phase 3's final box stays unticked until then).npm run worker:deployafter merge.🤖 Generated with Claude Code