- 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
2.7 KiB
Tasks: reascript-hybrid
Phase 1: Foundation — Protocol Layer
- 1.1 Create
src/reaper_scripting/commands.pywithReaScriptCommandandReaScriptResultdataclasses matching the JSON schemas in the spec - 1.2 Implement
write_command(path: Path, cmd: ReaScriptCommand) -> None— serializes to JSON withversion: 1 - 1.3 Implement
read_result(path: Path) -> ReaScriptResult— deserializes JSON; raisesProtocolVersionErrorifversion != 1 - 1.4 Add
ProtocolVersionErrorexception class
Phase 2: Core — ReaScript Generator
- 2.1 Create
src/reaper_scripting/__init__.pywithReaScriptGeneratorclass - 2.2 Implement
generate(path: Path, command: ReaScriptCommand) -> None— writes a self-contained Python ReaScript - 2.3 The generated script must include hand-rolled JSON parser (~20 lines of string splitting) — no
import json - 2.4 The generated script must call
GetFunctionMetadatato verify API availability on startup - 2.5 The generated script must implement the full Phase 2 pipeline: open project → verify FX → calibrate tracks → render → measure LUFS → write result
- 2.6 The generated script must handle errors and write
{"status": "error", "message": "..."}on failure - 2.7 Write
tests/test_commands.py— test JSON round-trip, version mismatch raisesProtocolVersionError - 2.8 Write
tests/test_reagenerator.py— parse generated script withast.parse, verify it contains required API calls (Main_openProject,TrackFX_GetCount,TrackFX_GetFXName,SetMediaTrackInfo_Value,CreateTrackSend,Main_RenderFile,CalcMediaSrcLoudness)
Phase 3: Integration — CLI Orchestration
- 3.1 Create
scripts/run_in_reaper.pyCLI entry point - 3.2 CLI must accept
python scripts/run_in_reaper.py <rpp_path> [--output <wav_path>] [--timeout <seconds>] - 3.3 CLI generates ReaScript file to
REAPER ResourcePath()/scripts/fl_control_phase2.py - 3.4 CLI writes command JSON to
REAPER ResourcePath()/scripts/fl_control_command.json - 3.5 CLI polls for
fl_control_result.jsonuntil it exists or timeout reached - 3.6 CLI parses result and prints LUFS metrics; exits 0 on success, 2 on timeout, 1 on error
- 3.7 CLI writes
output/song_lufs.jsonandoutput/song_fx_errors.jsonon success
Phase 4: Integration Test (Manual)
- 4.1 Run
pytest tests/test_phase2.py -k integrationagainst live REAPER with registered custom Action — skipped in CI - 4.2 Verify full pipeline: .rpp opens, FX verified, tracks calibrated, render completes, LUFS measured
- 4.3 Verify
fx_errorscorrectly identifies a missing plugin slot (empty string fromTrackFX_GetFXName) - 4.4 Verify timeout exits with code 2 when REAPER is not running