- compose-test-sync: fix 3 failing tests (NOTE_TO_MIDI, DrumLoopAnalyzer mock, section name) - generate-song: CLI wrapper + RPP validator (6 structural checks) + 4 e2e tests - reascript-hybrid: ReaScriptGenerator + command protocol + CLI + 16 unit tests - 110/110 tests passing - Full SDD cycle (propose→spec→design→tasks→apply→verify) for all 3 changes
2.7 KiB
Proposal: compose-test-sync
Intent
Sync 3 failing tests to the new compose.py API. The compose.py rewrite removed root_to_midi and DrumLoopAnalyzer, and changed build_melody_track signature. Tests are calling old APIs that no longer exist.
Scope
In Scope
- Fix
test_melody_uses_pentatonic— remove staleanalysisarg and ensure single-section test works - Fix
test_main_without_render_produces_rpp— remove obsoleteDrumLoopAnalyzermock - Fix
test_root_to_midi— replace removedroot_to_midiwithNOTE_TO_MIDIdict lookup - Run full suite to confirm all 90 pass
Out of Scope
- No new features
- No compose.py changes — only test fixes
Capabilities
No spec-level capabilities change. Tests are sync fixes only.
- None — test-only change, no capability modification
Approach
-
test_root_to_midi: Replacefrom scripts.compose import root_to_midiwith directNOTE_TO_MIDIdict access.root_to_midiwas removed; the constantNOTE_TO_MIDI({"A": 69, "C": 60, ...}) is the correct replacement. -
test_main_without_render_produces_rpp: Remove bothpatch("scripts.compose.SampleSelector")andpatch("scripts.compose.DrumLoopAnalyzer"). The rewrite moved drumloop logic tobuild_drumloop_trackwhich usesPath(ABLETON_DRUMLOOP_DIR)directly — no class-based analyzer. Keep onlySampleSelectorpatch if still needed for other path. -
test_melody_uses_pentatonic: The call signature is nowbuild_melody_track(sections, offsets, "A", True, seed=42)—analysisarg removed. Howeverbuild_lead_track(called bybuild_melody_track) only generates clips for sections namedchorus,chorus2, orfinal. The test uses"verse"which produces zero clips. Fix: change section name to"chorus"OR add a second section named"final".
Affected Areas
| Area | Impact | Description |
|---|---|---|
tests/test_section_builder.py |
Modified | Replace root_to_midi with NOTE_TO_MIDI |
tests/test_render_cli.py |
Modified | Remove DrumLoopAnalyzer mock, adjust patches |
tests/test_compose_integration.py |
Modified | Fix call signature, use chorus section |
Risks
| Risk | Likelihood | Mitigation |
|---|---|---|
| Test fix breaks another test | Low | Run full suite after each change |
| compose.py behavior changed unexpectedly | Low | 87/90 tests already pass |
Rollback Plan
Revert test files to prior commit. git checkout HEAD~1 -- tests/ restores all three to original state.
Dependencies
- None — test-only fix, no external deps
Success Criteria
- All 90 tests pass (
pytest tests/ -q) - No compose.py files modified (only test files changed)