---
phase: 09
slug: etapes
status: complete
nyquist_compliant: true
wave_0_complete: true
created: 2026-05-15
---

# Phase 09 - Validation Strategy

> Per-phase validation contract for feedback sampling during execution.

---

## Test Infrastructure

| Property | Value |
|----------|-------|
| **Framework** | Go test |
| **Config file** | `backend/sqlc.yaml`, `backend/justfile` |
| **Quick run command** | `cd backend && go test ./internal/web -count=1` |
| **Full suite command** | `cd backend && go test ./... -count=1` |
| **Estimated runtime** | ~30-90 seconds, DB-backed tests skip unless `TEST_DATABASE_URL` is configured |

---

## Sampling Rate

- **After every task commit:** Run `cd backend && go test ./internal/web -count=1`
- **After every plan wave:** Run `cd backend && go test ./... -count=1`
- **Before `$gsd-verify-work`:** Full suite must be green
- **Max feedback latency:** 90 seconds for local non-DB path; DB-backed path depends on `TEST_DATABASE_URL`

---

## Per-Task Verification Map

| Task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------|
| 09-01-01 | 01 | 1 | ETAPE-01, ETAPE-06 | T-09-01 | Etapes are tablo-owned rows with no parent relationship | migration/sqlc | `cd backend && go test ./internal/web -run 'TestEtapeSchemaIsOneLevelAndTaskAssignmentUnassignsOnDelete|TestEtapeCreateRendersChipAndCount' -count=1` | yes | COVERED |
| 09-01-02 | 01 | 1 | ETAPE-03, ETAPE-04 | T-09-02 | `tasks.etape_id` is nullable and `ON DELETE SET NULL` | migration/sqlc | `cd backend && go test ./internal/web -run 'TestEtapeSchemaIsOneLevelAndTaskAssignmentUnassignsOnDelete|TestEtapeDeleteUnassignsTasks' -count=1` | yes | COVERED |
| 09-02-01 | 02 | 2 | ETAPE-01, ETAPE-02 | T-09-03 | Only tablo owners can create/edit/delete/reorder etapes | handler integration | `cd backend && go test ./internal/web -run 'TestEtape(Update|Delete|Reorder|Ownership)' -count=1` | yes | COVERED |
| 09-03-01 | 03 | 3 | ETAPE-03, ETAPE-05 | T-09-04 | Task assignment rejects etapes outside the task tablo | handler integration | `cd backend && go test ./internal/web -run 'TestTask.*Etape|TestTaskAssignmentRejectsForeignEtape' -count=1` | yes | COVERED |
| 09-04-01 | 04 | 4 | ETAPE-05 | T-09-05 | Reorder preserves `etape_id` and hidden filtered tasks | regression integration | `cd backend && go test ./internal/web -run 'TestTaskReorderPreservesEtapeAssignment|TestTaskOrderPersistsWithEtapeFilter' -count=1` | yes | COVERED |
| 09-04-02 | 04 | 4 | ETAPE-01..06 | - | Full backend suite remains green | full suite | `cd backend && TEST_DATABASE_URL='postgres://xtablo:xtablo@localhost:5432/xtablo?sslmode=disable' go test ./... -count=1` | yes | COVERED |

---

## Wave 0 Requirements

- Existing Go test infrastructure covers the phase.
- Add RED tests before implementation for etape schema behavior, ownership, delete-unassign, assignment, filtering, and reorder preservation.
- `just generate` must run after migration/query/template changes to refresh sqlc and templ generated code.

---

## Manual-Only Verifications

| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| Top-strip chip interaction and kanban filtering | ETAPE-05 | HTMX/browser interaction and active chip state are easier to confirm visually after automated handler tests pass | Start `cd backend && just dev`, open a tablo, create etapes, assign tasks, click etape and `Unassigned` chips, confirm the existing four kanban columns remain usable |
| Drag/drop after filtering | ETAPE-05 | Sortable.js behavior depends on browser DOM events | With an etape filter active, drag a task across columns, reload, and confirm status and etape assignment persist |

---

## Validation Sign-Off

- [x] All tasks have automated verify commands or Wave 0 dependencies
- [x] Sampling continuity: no 3 consecutive tasks without automated verify
- [x] Wave 0 covers all MISSING references
- [x] No watch-mode flags
- [x] Feedback latency target documented
- [x] `nyquist_compliant: true` set in frontmatter

**Approval:** audited 2026-05-16

## Validation Audit 2026-05-16

| Metric | Count |
|--------|-------|
| Gaps found | 1 |
| Resolved | 1 |
| Escalated | 0 |

### Gap Filled

- Added `TestEtapeSchemaIsOneLevelAndTaskAssignmentUnassignsOnDelete` in `backend/internal/web/handlers_etapes_test.go` to verify one-level etape schema, nullable `tasks.etape_id`, and `ON DELETE SET NULL` behavior required by ETAPE-03, ETAPE-04, and ETAPE-06.

### Final Verification

- `cd backend && TEST_DATABASE_URL='postgres://xtablo:xtablo@localhost:5432/xtablo?sslmode=disable' go test ./internal/web -run 'TestEtapeSchemaIsOneLevelAndTaskAssignmentUnassignsOnDelete|TestEtape|TestTask.*Etape|TestTaskAssignmentRejectsForeignEtape|TestTaskReorderPreservesEtapeAssignment|TestTaskOrderPersistsWithEtapeFilter|TestTaskCreateRefreshesEtapeCounts|TestTaskDeleteRefreshesEtapeCounts' -count=1`
