fix(02): revise plans based on checker feedback
This commit is contained in:
@@ -25,7 +25,7 @@ must_haves:
|
||||
provides: "Integration test with ffprobe validation and zero-packet guard test"
|
||||
contains: "TestMP3Valid"
|
||||
- path: "cmd/netsynth/main.go"
|
||||
provides: "-o flag wiring with timestamp default"
|
||||
provides: "-o flag wiring with timestamp default, snapshot slice accumulator stub"
|
||||
contains: "outputPath"
|
||||
key_links:
|
||||
- from: "encode/mp3.go"
|
||||
@@ -225,7 +225,7 @@ Write tests FIRST, using `os.CreateTemp` for output files and `exec.Command("ffp
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Wire -o output flag into CLI</name>
|
||||
<name>Task 2: Wire -o output flag and snapshot accumulator stub into CLI</name>
|
||||
<files>cmd/netsynth/main.go</files>
|
||||
<read_first>
|
||||
- cmd/netsynth/main.go (current Cobra flag setup, run function)
|
||||
@@ -255,9 +255,16 @@ Add the `-o` / `--output` flag to main.go. Per D-15: defaults to `netsynth-<time
|
||||
|
||||
4. Add `"time"` to the imports.
|
||||
|
||||
5. Add a comment in the snapshot consumption loop marking where Phase 3 will wire synthesis:
|
||||
5. Add a snapshot slice accumulator alongside the existing snapshot consumption loop, and a TODO for Phase 3 wiring. Replace the current `for snap := range snapshots` block to also collect snapshots into a slice:
|
||||
```go
|
||||
// TODO(phase-3): Pass snapshots to encode.RunSynthesis(snapshots, outputPath)
|
||||
// Accumulate snapshots for synthesis (Phase 3 will pass to encode.RunSynthesis)
|
||||
var collectedSnapshots []classify.WindowSnapshot
|
||||
for snap := range snapshots {
|
||||
collectedSnapshots = append(collectedSnapshots, snap)
|
||||
aggregate.AccumulateTotals(totals, snap)
|
||||
}
|
||||
|
||||
// TODO(phase-3): Pass collectedSnapshots to encode.RunSynthesis(collectedSnapshots, outputPath)
|
||||
```
|
||||
|
||||
Do NOT import the encode package yet — Phase 3 handles that. The flag must be functional (parseable, shows in --help) even though the synthesis pipeline isn't wired.
|
||||
@@ -271,10 +278,12 @@ Do NOT import the encode package yet — Phase 3 handles that. The flag must be
|
||||
- cmd/netsynth/main.go contains `netsynth-%s.mp3`
|
||||
- cmd/netsynth/main.go contains `time.Now().Format("20060102-150405")`
|
||||
- cmd/netsynth/main.go imports `"time"`
|
||||
- cmd/netsynth/main.go contains `var collectedSnapshots []classify.WindowSnapshot`
|
||||
- cmd/netsynth/main.go contains `TODO(phase-3)` referencing `encode.RunSynthesis`
|
||||
- `go build ./cmd/netsynth/` exits 0
|
||||
- `go run ./cmd/netsynth/ --help` output contains `-o, --output`
|
||||
</acceptance_criteria>
|
||||
<done>The -o/--output flag is registered in Cobra, defaults to netsynth-<timestamp>.mp3, visible in --help. Build succeeds. Phase 3 will wire it to RunSynthesis.</done>
|
||||
<done>The -o/--output flag is registered in Cobra, defaults to netsynth-<timestamp>.mp3, visible in --help. Snapshot slice accumulator stub is in place for Phase 3 wiring. Build succeeds.</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
@@ -284,12 +293,14 @@ Do NOT import the encode package yet — Phase 3 handles that. The flag must be
|
||||
- `ffprobe` validates the test-generated MP3 (within encode test)
|
||||
- `go run ./cmd/netsynth/ --help` shows `-o, --output` flag
|
||||
- `grep "no packets captured" encode/mp3.go` confirms zero-packet error message
|
||||
- `grep "collectedSnapshots" cmd/netsynth/main.go` confirms snapshot accumulator stub
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
- encode/mp3.go produces valid MP3 files from synthetic WindowSnapshots (validated by ffprobe)
|
||||
- Zero-packet guard prevents file creation and returns descriptive error (OUT-03)
|
||||
- -o flag registered in CLI with timestamp default (OUT-01)
|
||||
- Snapshot slice accumulator ready for Phase 3 wiring
|
||||
- Full test suite passes: `CGO_ENABLED=1 go test ./...`
|
||||
- Complete Phase 2 audio pipeline validated end-to-end against synthetic data
|
||||
</success_criteria>
|
||||
|
||||
Reference in New Issue
Block a user