'docs(09):_add_research_validation_strategy'

This commit is contained in:
2026-04-13 10:23:47 +02:00
parent 73ea2d7fed
commit 84a350f233
@@ -0,0 +1,89 @@
---
phase: 9
slug: ux-tech-debt-closure
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-04-13
---
# Phase 9 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** | pytest >= 8.0 (+ pytest-playwright for e2e) |
| **Config file** | none — pytest discovers `tests/` by default |
| **Quick run command** | `pytest tests/ -x -q --ignore=tests/e2e` |
| **Full suite command** | `pytest tests/ -v` |
| **E2E command** | `pytest tests/e2e/ -v` (requires `playwright install chromium`) |
| **Estimated runtime** | ~20s unit/integration, ~15s e2e |
---
## Sampling Rate
- **After every task commit:** Run `pytest tests/ -x -q --ignore=tests/e2e`
- **After every plan wave:** Run `pytest tests/ -v`
- **Before `/gsd:verify-work`:** Full suite (including `tests/e2e/`) must be green
- **Max feedback latency:** 30 seconds
---
## Per-Task Verification Map
| Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
| 9-01-01 | 01 | 1 | UX-01 | integration | `pytest tests/test_driver_upload.py::test_upload_500_regression -x` | ❌ W0 | ⬜ pending |
| 9-01-02 | 01 | 1 | UX-01 | integration | `pytest tests/test_driver_upload.py::test_upload_500_regression -x` | ❌ W0 | ⬜ pending |
| 9-01-03 | 01 | 1 | UX-01 | integration | `pytest tests/test_driver_upload.py::test_upload_returns_oob_when_called_from_form -x` | ❌ W0 | ⬜ pending |
| 9-01-04 | 01 | 1 | UX-01 | integration | `pytest tests/test_driver_upload.py::test_upload_oob_autoselects_new_driver -x` | ❌ W0 | ⬜ pending |
| 9-01-05 | 01 | 1 | UX-01 | integration | `pytest tests/test_printer_form.py -x` | ✅ | ⬜ pending |
| 9-02-01 | 02 | 2 | UX-02 | e2e | `pytest tests/e2e/test_port_autofill.py -v` | ❌ W0 | ⬜ pending |
| 9-03-01 | 03 | 1 | UX-03 | integration | `pytest tests/test_script_download.py -x` | ❌ W0 | ⬜ pending |
| 9-03-02 | 03 | 1 | UX-03 | integration | `pytest tests/test_packages.py::TestCommandPreview::test_detail_page_shows_script_links -x` | ❌ W0 | ⬜ pending |
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
*Task IDs above are placeholders — planner refines to match actual PLAN.md task numbering.*
---
## Wave 0 Requirements
- [ ] `tests/test_driver_upload.py` — add stubs: `test_upload_500_regression`, `test_upload_returns_oob_when_called_from_form`, `test_upload_oob_autoselects_new_driver` (UX-01)
- [ ] `tests/e2e/__init__.py` + `tests/e2e/conftest.py` — live server fixture (uvicorn thread on 127.0.0.1, readiness poll via `/health`, session-scoped tmp data dir) (UX-02)
- [ ] `tests/e2e/test_port_autofill.py` — stub Playwright test for UX-02
- [ ] `tests/test_script_download.py` — stubs for `.ps1` URL shape routes (UX-03)
- [ ] `tests/test_packages.py::TestCommandPreview::test_detail_page_shows_script_links` — stub (UX-03)
- [ ] Dev deps install: add `pytest-playwright` and `playwright` to `requirements-dev.txt`; run `pip install -r requirements-dev.txt && playwright install chromium`
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| Live browser visual confirmation of IP→port auto-fill | UX-02 | Success criterion explicitly requires "observed live in a real browser and recorded in VALIDATION.md" | Run `pytest tests/e2e/test_port_autofill.py -v --headed`, observe the browser window, save terminal output snippet here when executed |
| Live browser visual confirmation of driver upload OOB refresh | UX-01 | Success criterion explicitly requires "without manually reloading the page" — Playwright headless covers this, but a live eyeball check is recommended once | Start app, open printer form, upload driver ZIP, confirm dropdown updates without F5 |
| Live browser click of 3 script download links | UX-03 | Success criterion says "can click direct download links ... individually" | Start app, open printer detail page with a driver selected, click each of the 3 links, confirm `.ps1` file downloads |
*Automated coverage is primary; manual checks serve as the live-verification evidence required by the phase success criteria.*
---
## 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 < 30s (quick suite)
- [ ] `nyquist_compliant: true` set in frontmatter (after planner finalizes task IDs)
**Approval:** pending