--- phase: 9 slug: admin-panel-rearchitecture status: draft nyquist_compliant: false wave_0_complete: false created: 2026-06-12 --- # Phase 9 — Validation Strategy > Per-phase validation contract for feedback sampling during execution. --- ## Test Infrastructure | Property | Value | |----------|-------| | **Framework** | pytest (backend) + manual browser/vitest (frontend) | | **Config file** | `backend/pytest.ini` | | **Quick run command** | `cd backend && pytest tests/test_admin_overview.py -x` | | **Full suite command** | `cd backend && pytest -v` | | **Estimated runtime** | ~60 seconds | --- ## Sampling Rate - **After every task commit:** Run `cd backend && pytest tests/test_admin_overview.py -x` (after overview endpoint tasks) - **After every plan wave:** Run `cd backend && pytest -v` - **Before `/gsd:verify-work`:** Full suite must be green - **Max feedback latency:** 60 seconds --- ## Per-Task Verification Map | Task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status | |---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------| | overview-endpoint | 09-0N | Wave 1 | ADMIN-11 | Admin data leak | Response never contains `credentials_enc`, doc content | Integration | `pytest tests/test_admin_overview.py::test_overview_aggregate` | No — Wave 0 gap | ❌ | | overview-no-sensitive | 09-0N | Wave 1 | ADMIN-11 | Sensitive field exposure | `credentials_enc` and document content absent from response | Security | `pytest tests/test_admin_overview.py::test_overview_no_sensitive_fields` | No — Wave 0 gap | ❌ | | admin-guard | 09-0N | Wave 2 | ADMIN-12 | Privilege escalation | Non-admin navigating to `/admin/users` redirected to `/` | Integration (browser) | Manual browser test or Playwright | N/A | ❌ | | adminview-deleted | 09-0N | Wave 3 | ADMIN-08 | Dead code | `AdminView.vue` absent from repo | Static | `grep -r "AdminView" frontend/src/ \| grep -v AdminLayout \| grep -v AdminOverview` | N/A | ❌ | | tailwind-safelist | 09-0N | Wave 3 | CODE-06 | Visual regression | Dynamic provider color classes render in prod build | Build | `npm run build` + visual check | N/A | ❌ | --- ## Wave 0 Gaps Test files that must be created before feature code: - `backend/tests/test_admin_overview.py` — covers ADMIN-11 aggregate query + security invariants (no sensitive fields) --- ## Security Invariants (Must All Pass) - [ ] `GET /api/admin/overview` never returns `credentials_enc`, `password_hash`, or document content - [ ] `GET /api/admin/overview` is admin-only (`get_current_admin` dep enforced) - [ ] Non-admin user accessing `/admin/*` routes is redirected to `/` by `beforeEach` guard - [ ] Admin user accessing non-admin routes (`/`, `/settings`, etc.) is redirected to `/admin`