98 lines
4.5 KiB
Markdown
98 lines
4.5 KiB
Markdown
---
|
|||
|
|
phase: 2
|
||
|
|
slug: audio-synthesis-engine
|
||
|
|
status: draft
|
||
|
|
nyquist_compliant: true
|
||
|
|
wave_0_complete: true
|
||
|
|
tdd_model: co-creation
|
||
|
|
created: 2026-03-26
|
||
|
|
---
|
||
|
|
|
||
|
|
# Phase 2 — Validation Strategy
|
||
|
|
|
||
|
|
> Per-phase validation contract for feedback sampling during execution.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Test Infrastructure
|
||
|
|
|
||
|
|
| Property | Value |
|
||
|
|
|----------|-------|
|
||
|
|
| **Framework** | go test (stdlib) |
|
||
|
|
| **Config file** | none — existing Go test infrastructure |
|
||
|
|
| **Quick run command** | `go test ./synth/... ./encode/...` |
|
||
|
|
| **Full suite command** | `go test ./...` |
|
||
|
|
| **Estimated runtime** | ~5 seconds |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## TDD Model
|
||
|
|
|
||
|
|
This phase uses **co-creation TDD**: tests are written within the same task as the implementation, following RED-GREEN-REFACTOR within each task. All TDD tasks are marked with `tdd="true"` in their plan XML. Test files are created as part of the task, not as a separate Wave 0 plan.
|
||
|
|
|
||
|
|
This is explicitly chosen over pre-existing stub TDD because:
|
||
|
|
1. Each task's `<behavior>` block defines expected test cases before implementation begins
|
||
|
|
2. The executor writes tests FIRST (RED), then implementation (GREEN) within the same task
|
||
|
|
3. No test file exists before the task starts — the task creates both test and implementation
|
||
|
|
|
||
|
|
Wave 0 requirements are limited to environment/tooling setup (gcc, ffprobe, go-lame dependency), handled by Plan 01 Task 1.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Sampling Rate
|
||
|
|
|
||
|
|
- **After every task commit:** Run `go test ./synth/... ./encode/...`
|
||
|
|
- **After every plan wave:** Run `go test ./...`
|
||
|
|
- **Before `/gsd:verify-work`:** Full suite must be green
|
||
|
|
- **Max feedback latency:** 5 seconds
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Per-Task Verification Map
|
||
|
|
|
||
|
|
| Task ID | Plan | Wave | Requirement | Test Type | Automated Command | TDD | Status |
|
||
|
|
|---------|------|------|-------------|-----------|-------------------|-----|--------|
|
||
|
|
| 02-01-01 | 01 | 1 | SYNTH-01 | setup | `go version && gcc --version && ffprobe -version && grep "go-lame" go.mod && CGO_ENABLED=1 go build ./...` | n/a | ⬜ pending |
|
||
|
|
| 02-01-02 | 01 | 1 | SYNTH-01, SYNTH-02 | unit | `cd /home/dev/workspace/yoloyolo && go test ./synth/... -v -count=1` | co-creation | ⬜ pending |
|
||
|
|
| 02-02-01 | 02 | 2 | SYNTH-03 | unit | `cd /home/dev/workspace/yoloyolo && go test ./synth/... -run "TestPan\|TestStereo\|TestClamp" -v -count=1` | co-creation | ⬜ pending |
|
||
|
|
| 02-02-02 | 02 | 2 | SYNTH-03 | unit | `cd /home/dev/workspace/yoloyolo && go test ./synth/... -run "TestNewBank\|TestRenderWindow\|TestMixerNoClip\|TestStereoPan\|TestMultipleWindows" -v -count=1` | co-creation | ⬜ pending |
|
||
|
|
| 02-03-01 | 03 | 3 | OUT-02, OUT-03 | integration | `cd /home/dev/workspace/yoloyolo && CGO_ENABLED=1 go test ./encode/... -v -count=1` | co-creation | ⬜ pending |
|
||
|
|
| 02-03-02 | 03 | 3 | OUT-01 | build | `cd /home/dev/workspace/yoloyolo && go build -o /dev/null ./cmd/netsynth/ && go run ./cmd/netsynth/ --help 2>&1 \| grep -q "\-o.*output" && echo "OK"` | n/a | ⬜ pending |
|
||
|
|
|
||
|
|
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Wave 0 Requirements
|
||
|
|
|
||
|
|
- [x] `gcc` — C compiler required for go-lame CGo compilation (Plan 01, Task 1)
|
||
|
|
- [x] `ffprobe` — MP3 validation in acceptance tests (Plan 01, Task 1)
|
||
|
|
- [x] `go get github.com/sjzar/go-lame@v0.0.9` — MP3 encoding dependency (Plan 01, Task 1)
|
||
|
|
- [x] `go-audio/wav` — **Skipped.** Per CONTEXT.md Claude's Discretion grant; write PCM bytes directly to LameWriter (CLAUDE.md updated).
|
||
|
|
|
||
|
|
*Test stubs are co-created with implementation in each TDD task (see TDD Model section above).*
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Manual-Only Verifications
|
||
|
|
|
||
|
|
| Behavior | Requirement | Why Manual | Test Instructions |
|
||
|
|
|----------|-------------|------------|-------------------|
|
||
|
|
| Perceptually distinct drone tones per traffic class | SYNTH-01 | Subjective audio quality | Play output MP3, verify each class sounds distinct |
|
||
|
|
| Amplitude rises/falls audibly with traffic volume | SYNTH-02 | Subjective perception | Listen for volume changes across windows with varying traffic |
|
||
|
|
| Stereo panning creates spatial separation | SYNTH-03 | Subjective audio quality | Listen with headphones, verify bass center and highs spread |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Validation Sign-Off
|
||
|
|
|
||
|
|
- [x] All tasks have `<automated>` verify commands matching plan blocks
|
||
|
|
- [x] Sampling continuity: no 3 consecutive tasks without automated verify (all tasks have automated verify)
|
||
|
|
- [x] Wave 0 covers environment/tooling setup (Plan 01, Task 1)
|
||
|
|
- [x] Co-creation TDD model documented; test expectations defined in `<behavior>` blocks
|
||
|
|
- [x] No watch-mode flags
|
||
|
|
- [x] Feedback latency < 5s
|
||
|
|
- [x] `nyquist_compliant: true` set in frontmatter
|
||
|
|
|
||
|
|
**Approval:** ready
|