docs(phase-16.3): add validation strategy

This commit is contained in:
2026-10-11 00:18:10 +02:00
parent 9907fa94cd
commit 5e3c552aa1

View File

@@ -0,0 +1,79 @@
---
phase: "16.3"
slug: "backend-admin-personal-api-tokens-with-scopes"
# status lifecycle: draft (seeded by plan-phase) → validated (set by validate-phase §6)
# audit-milestone §5.5 distinguishes NOT-VALIDATED (draft) from PARTIAL (validated + nyquist_compliant: false) (#2117)
status: draft
nyquist_compliant: false
wave_0_complete: false
created: "2026-10-11"
---
# Phase 16.3 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** | Go `testing` (+ testcontainers-go Postgres for DB suites); vitest + @vue/test-utils + happy-dom for the admin SPA |
| **Config file** | `admin/vitest.config.ts` |
| **Quick run command** | `go test ./modules/cabana ./modules/bouncer ./modules/pact -run 'Token|Scope|Allows' -count=1` |
| **Full suite command** | `go vet ./... && go test ./... && npm --prefix admin test && (cd ../sm-journal-plugin && go vet ./... && go test ./...)` |
| **Estimated runtime** | ~180 seconds (Postgres suites need a Docker host) |
---
## Sampling Rate
- **After every task commit:** Run the quick run command plus `go vet ./...`
- **After every plan wave:** Run the full suite command (Postgres suites on a Docker host)
- **Before `/msd-verify-work`:** `scripts/check-phase16.3.sh` must be green (no skips, no zero-test stages)
- **Max feedback latency:** 180 seconds
---
## Per-Task Verification Map
Filled in by the planner from the RESEARCH.md test map (SC-1 to SC-5). Rows are added per task once PLAN.md files exist.
| Task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------|
| 16.3-TBD | TBD | TBD | SC-1..SC-6 | T-16.3-* | see RESEARCH.md Security Domain | unit / Postgres / vitest | see RESEARCH.md Validation Architecture | ❌ W0 | ⬜ pending |
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
---
## Wave 0 Requirements
- [ ] `modules/cabana/token_*_test.go` — Allows / scope cover / compile / guard / inventory classification (Docker-free)
- [ ] `modules/cabana/account_tokens_test.go` — account token API via the `adminHandler` harness
- [ ] `modules/cabana/commands_test.go` additions — token commands (stdout purity)
- [ ] `admin/tests/components/ApiTokensPanel.test.ts` — UI-SPEC backstops
- [ ] `../sm-journal-plugin/journal_api_tokens_test.go` — Journal token writes via `newPostsEnv`
- [ ] `scripts/check-phase16.3.sh` — phase gate
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| Clipboard copy of the show-once token in a real browser | SC-3 | Clipboard API permissions differ from happy-dom | Create a token in the admin SPA, copy it, use it as `Authorization: Bearer` against a Journal write route |
---
## Validation Sign-Off
- [ ] All tasks have `<automated>` verify or Wave 0 dependencies
- [ ] Sampling continuity: no 3 consecutive tasks without automated verify
- [ ] Wave 0 covers all MISSING references
- [ ] No watch-mode flags
- [ ] Feedback latency < 180s
- [ ] `nyquist_compliant: true` set in frontmatter
**Approval:** pending