Files
renato97 48bc271afc feat: SDD workflow — test sync, song generation + validation, ReaScript hybrid pipeline
- 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
2026-05-03 22:00:26 -03:00

1.6 KiB
Raw Permalink Blame History

Tasks: compose-test-sync

Phase 1: Fix test_root_to_midi (test_section_builder.py)

  • 1.1 In tests/test_section_builder.py line 121124, replace from scripts.compose import root_to_midi with from scripts.compose import NOTE_TO_MIDI
  • 1.2 Change root_to_midi("A", 4) to NOTE_TO_MIDI["A"] + 12 * (4 - 3) (transposes A4 up one octave)
  • 1.3 Change root_to_midi("C", 4) to NOTE_TO_MIDI["C"] + 12 * (4 - 3) (transposes C4 up one octave)

Phase 2: Fix test_main_without_render_produces_rpp (test_render_cli.py)

  • 2.1 In tests/test_render_cli.py lines 4480, remove patch("scripts.compose.DrumLoopAnalyzer") from the with statement (line 58)
  • 2.2 Remove the DrumLoopAnalysis import from src.composer.drum_analyzer (line 46) — no longer needed
  • 2.3 Remove fake_analysis fixture creation (lines 4955)
  • 2.4 Remove mock_a = MagicMock() and its .analyze.return_value = fake_analysis assignment (lines 6869)
  • 2.5 Remove mock_a_cls.return_value = mock_a assignment (line 70)

Phase 3: Fix test_melody_uses_pentatonic (test_compose_integration.py)

  • 3.1 In tests/test_compose_integration.py line 204, remove the analysis = _fake_analysis() line (dead code — function no longer takes analysis arg)
  • 3.2 Line 205: change SectionDef(name="verse", ...) to SectionDef(name="chorus", ...) (build_lead_track only generates for chorus/chorus2/final)

Phase 4: Verification

  • 4.1 Run python -m pytest tests/ -q — confirm 90/90 tests pass
  • 4.2 Run git diff --name-only scripts/ — confirm no files in scripts/ were modified