Review: Admin Cleanup — Remove /admin, Everyone is a Player
Verdict: NEEDS_REFINEMENT
Template Completeness
- [x] Type — Feature
- [x] Lineage — references parent #66
- [x] Repo — forgejo_admin/twitch-2k-wager
- [x] User Story — developer story, removing admin hierarchy
- [x] Context — explains dead code removal after V2 lands
- [x] File Targets — 5 targets listed
- [x] Acceptance Criteria — 6 criteria
- [x] Test Expectations — 3 items
- [x] Constraints — dependency ordering + cross-repo noted
- [x] Checklist
- [x] Related
Traceability
- [x] story:player-propose — present on board item, verified in project-twitch-2k-wager user-stories table
- [ ] arch:twitch-2k-wager-app — present on board item, but no backing architecture note found in pal-e-docs. [SCOPE] Create architecture note arch-twitch-2k-wager-app.
- [x] Forgejo issue — forgejo_admin/twitch-2k-wager#73, open
File Targets
- [x]
src/routes/admin/— verified: exists with +layout.server.ts, +page.server.ts, +page.svelte, __tests__/ - [x]
src/lib/admin-auth.ts— verified: exists (1.0k) - [x]
src/routes/api/admin/— verified: exists with result/ subdirectory and __tests__/ - [ ]
src/routes/+page.svelte— ISSUE: file exists but contains zero "admin" references. The AC "remove any /admin links from landing page" is a no-op. Target is inaccurate. - [x] pal-e-deployments overlay — verified: ADMIN_SECRET in
overlays/twitch-2k-wager/dev/deployment.yaml:46andoverlays/twitch-2k-wager/prod/deployment-patch.yaml:26 - [ ]
src/lib/db.ts— MISSING from file targets. Line 181 contains admin queue view comment. Needs cleanup. - [ ]
src/lib/types.ts— MISSING from file targets. Line 71 contains AdminQueueRow type definition. Needs cleanup.
Repo Placement
Cross-repo correctly identified. Primary work in forgejo_admin/twitch-2k-wager, secondary change in forgejo_admin/pal-e-deployments (remove ADMIN_SECRET from both dev and prod overlays). Issue body does not clarify whether the pal-e-deployments change is a separate PR/issue or included in this ticket's scope.
Dependencies
CRITICAL BLOCKER: Issue constraints state "ONLY do this after dashboard + result tickets are merged and validated."
- [ ] #70 (unified player dashboard) — OPEN, backlog column. Not started.
- [ ] #71 (result declaration) — OPEN, backlog column. Not started.
- [ ] Replacement
/api/resultroute — does not exist in codebase yet. - [ ] Replacement
/playdashboard — does not yet subsume admin queue functionality.
Dispatching this ticket now would delete admin routes with no replacement in place, breaking the platform for Marcus.
Acceptance Criteria
- [x] "/admin returns 404" — testable after deletion
- [x] "/api/admin/result returns 404" — testable after deletion
- [x] "admin-auth.ts deleted" — testable via file existence check
- [x] "ADMIN_SECRET env var removed from deployment" — testable, targets confirmed in both overlays
- [ ] "No references to 'admin' in codebase" — incomplete: db.ts and types.ts contain admin references not listed as file targets. Agent would miss these.
- [ ] "All functionality preserved via /play dashboard + /api/result" — untestable: /api/result does not exist yet, /play does not have admin features yet
Blast Radius
Moderate. Admin routes are self-contained (own layout, own auth via admin-auth.ts). No other services import admin-auth.ts. The db.ts query function and types.ts AdminQueueRow type are consumed only by admin pages — once admin is deleted, they become dead code. No downstream consumers outside this repo. Rollback is straightforward (revert PR).
Decomposition Assessment
Apply three-thing limit and five-minute rule:
- 2 repos (twitch-2k-wager + pal-e-deployments)
- ~7 file targets (5 listed + 2 discovered: db.ts, types.ts)
- 6 acceptance criteria + 3 test expectations
- All changes are deletion/removal — straightforward, no design decisions
On the edge of the three-thing limit but manageable in a single agent pass. The work is pure deletion with no new code to write. No decomposition needed — but the cross-repo pal-e-deployments change should be clarified (same PR or separate issue).
Recommendation
- [BODY] Add missing file targets:
src/lib/db.ts(remove admin queue query/comment at line 181) andsrc/lib/types.ts(remove AdminQueueRow type at line 71). - [BODY] Update or remove the file target for
src/routes/+page.svelte— no admin references exist in this file. The "remove /admin links" AC is already satisfied or was never needed. - [BODY] Clarify cross-repo strategy: will pal-e-deployments ADMIN_SECRET removal be a separate issue/PR or included in this ticket?
- [LABEL] Add
track:devopslabel since the ticket includes pal-e-deployments changes. - [SCOPE] Create architecture note
arch-twitch-2k-wager-appfor the SvelteKit app component. - [SCOPE] This ticket is blocked by #70 and #71. Do not move to next_up until both are merged and validated.