livepilot 1.10.9 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +245 -0
  2. package/README.md +7 -7
  3. package/m4l_device/LivePilot_Analyzer.amxd +0 -0
  4. package/m4l_device/livepilot_bridge.js +1 -1
  5. package/mcp_server/__init__.py +1 -1
  6. package/mcp_server/m4l_bridge.py +488 -13
  7. package/mcp_server/runtime/execution_router.py +7 -0
  8. package/mcp_server/runtime/mcp_dispatch.py +32 -0
  9. package/mcp_server/runtime/remote_commands.py +54 -0
  10. package/mcp_server/sample_engine/slice_classifier.py +169 -0
  11. package/mcp_server/server.py +11 -3
  12. package/mcp_server/tools/analyzer.py +187 -7
  13. package/mcp_server/tools/clips.py +65 -0
  14. package/mcp_server/tools/devices.py +517 -5
  15. package/mcp_server/tools/diagnostics.py +42 -0
  16. package/mcp_server/tools/follow_actions.py +202 -0
  17. package/mcp_server/tools/grooves.py +142 -0
  18. package/mcp_server/tools/miditool.py +280 -0
  19. package/mcp_server/tools/scales.py +126 -0
  20. package/mcp_server/tools/take_lanes.py +135 -0
  21. package/mcp_server/tools/tracks.py +46 -3
  22. package/mcp_server/tools/transport.py +62 -1
  23. package/package.json +2 -2
  24. package/remote_script/LivePilot/__init__.py +8 -4
  25. package/remote_script/LivePilot/clips.py +62 -0
  26. package/remote_script/LivePilot/devices.py +444 -0
  27. package/remote_script/LivePilot/diagnostics.py +52 -1
  28. package/remote_script/LivePilot/follow_actions.py +235 -0
  29. package/remote_script/LivePilot/grooves.py +185 -0
  30. package/remote_script/LivePilot/scales.py +138 -0
  31. package/remote_script/LivePilot/take_lanes.py +175 -0
  32. package/remote_script/LivePilot/tracks.py +59 -1
  33. package/remote_script/LivePilot/transport.py +90 -1
  34. package/remote_script/LivePilot/version_detect.py +9 -0
  35. package/server.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,250 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.2 — Post-release audit reliability fixes (April 18 2026)
4
+
5
+ Six issues surfaced by an immediate post-v1.12.0 deep audit (parallel
6
+ code-reviewer subagents + manual verification). All fixed TDD-style —
7
+ every bug now has a named regression guard in the test suite.
8
+
9
+ **No tool count change** (still 398). **+11 regression tests**
10
+ (2195 → 2206 passing, 1 skipped, 0 failed).
11
+
12
+ ### Critical fixes (reliability in hot paths)
13
+
14
+ - **`send_capture` no longer blocks `send_command`** (BUG-audit-C1).
15
+ The M4L bridge shared `_cmd_lock` between `send_capture` and
16
+ `send_command`, so any concurrent MCP tool invocation during a
17
+ recording was blocked for the full capture duration (up to 35s).
18
+ The two operations use independent receiver state
19
+ (`_capture_future` vs `_response_callback`) and now use
20
+ independent locks (`_capture_lock` + `_cmd_lock`).
21
+ [`mcp_server/m4l_bridge.py:780-790, 912-913`](mcp_server/m4l_bridge.py).
22
+ - **`_parse_osc` no longer crashes on malformed packets**
23
+ (BUG-audit-C2). `data.index(b'\x00')` raised `ValueError` when a
24
+ packet had no null byte — on UDP port 9880 collision with
25
+ non-OSC traffic, every incoming packet logged a noisy stack
26
+ trace. Replaced with `data.find(...)` + bounds checks on every
27
+ offset; malformed packets drop silently.
28
+ [`mcp_server/m4l_bridge.py:513-565`](mcp_server/m4l_bridge.py).
29
+ - **`classify_simpler_slices` returns structured error on bad WAV**
30
+ (BUG-audit-C3). `sf.read()` was unguarded — corrupt or missing
31
+ files raised `soundfile.LibsndfileError` through the MCP
32
+ framework as an internal server error. Every other tool in the
33
+ module returns `{"error": ...}` dicts. Now wrapped in
34
+ `try/except` for consistent error shape.
35
+ [`mcp_server/tools/analyzer.py:571-581`](mcp_server/tools/analyzer.py).
36
+
37
+ ### High-severity fixes (API consistency)
38
+
39
+ - **`batch_set_parameters` rejects negative `parameter_index`**
40
+ (BUG-audit-H3). `set_device_parameter` validates this at the MCP
41
+ layer; `batch_set_parameters` didn't, leaking an unstructured
42
+ `IndexError` from the Remote Script. Now rejected with a clear
43
+ ValueError at normalisation time.
44
+ [`mcp_server/tools/devices.py:318-328`](mcp_server/tools/devices.py).
45
+
46
+ ### Medium-severity fixes
47
+
48
+ - **`_enrich_slice_response` uses positional fallback for missing
49
+ `index` field** (BUG-audit-M2). Direct `s["index"]` access in a
50
+ list comprehension raised `KeyError` on bridge version skew.
51
+ Now uses `s.get("index", i)` with `enumerate` fallback.
52
+ [`mcp_server/tools/analyzer.py:57-62`](mcp_server/tools/analyzer.py).
53
+ - **`test_identify_returns_none_for_free_port` is no longer flaky**
54
+ (BUG-audit-M4). The test hardcoded port 59999 as "almost
55
+ certainly free"; when another process on the machine held it
56
+ (hitting Claude Desktop during the audit), the test failed
57
+ without diagnosing a real code bug. Now uses
58
+ `socket.bind(("127.0.0.1", 0))` to get a kernel-assigned free
59
+ port, releases it, then verifies.
60
+ [`tests/test_startup_safety.py:50-70`](tests/test_startup_safety.py).
61
+
62
+ ### .amxd binary patched in place
63
+
64
+ - `m4l_device/LivePilot_Analyzer.amxd` had the `ping` response
65
+ version string patched from `"1.12.0"` → `"1.12.2"` via direct
66
+ byte replacement (same-length delta, size preserved). No Max
67
+ re-export needed.
68
+ - `m4l_device/livepilot_bridge.js` source version also updated for
69
+ the next full rebuild.
70
+
71
+ ---
72
+
73
+ ## 1.12.1 — Silent-failure fixes + slice classifier (April 18 2026)
74
+
75
+ Reconciles the "separate git stash" called out under v1.12.0's Known
76
+ limitations — the 2026-04-18 Villalobos-groove session surfaced four
77
+ silent-failure bugs and the need for a drum-slice spectral classifier.
78
+
79
+ **+1 tool (397 → 398): `classify_simpler_slices`.** +43 regression
80
+ guards (pure-Python, run without a live Ableton).
81
+
82
+ ### Ship-stoppers fixed
83
+
84
+ - **`get_master_rms.pitch.midi_note` clamped** (BUG-F1) — polyphonic
85
+ pitch detector emitted values up to 319.15 with amplitude 0. Now
86
+ drops readings with zero amplitude or out-of-range MIDI.
87
+ [`mcp_server/tools/analyzer.py:128-147`](mcp_server/tools/analyzer.py).
88
+ - **`get_simpler_slices` discloses base MIDI pitch** (BUG-F2) — Simpler
89
+ Slice mode uses C1 (MIDI 36) as slice 0, NOT C3. Response now
90
+ includes `base_midi_pitch` at top level and `midi_pitch` per slice.
91
+ Prevents the class of silent-audio bugs where MIDI notes at pitch
92
+ 60+ trigger nothing. Docstring updated to mandate using the
93
+ returned `midi_pitch`.
94
+ [`mcp_server/tools/analyzer.py:37-62, 462-487`](mcp_server/tools/analyzer.py).
95
+ - **`delete_track` last-track error message** (BUG-F3) — Ableton's
96
+ default rejection message was unrelated to the real cause ("you
97
+ can't add notes to a clip that doesn't exist yet"). Now pre-checks
98
+ `track_count` and raises a clear ValueError.
99
+ [`mcp_server/tools/tracks.py:93-112`](mcp_server/tools/tracks.py).
100
+ - **`batch_set_parameters` accepts aligned schema** (BUG-F4) — supports
101
+ `parameter_index` / `parameter_name` (matching `set_device_parameter`)
102
+ in addition to the legacy `name_or_index`. Rejects ambiguous entries
103
+ with clear errors.
104
+ [`mcp_server/tools/devices.py:292-328`](mcp_server/tools/devices.py).
105
+
106
+ ### New tool
107
+
108
+ - **`classify_simpler_slices(track, device, file_path?)`** — runs
109
+ FFT-based spectral analysis on a Simpler's slice boundaries, returns
110
+ each slice labeled as KICK / SNARE / HAT / ghost plus feature
111
+ breakdown (peak, rms, band %). Validated thresholds from the
112
+ 2026-04-18 Villalobos-groove session on "Break Ghosts 90 bpm":
113
+ - KICK: sub+low ≥ 45%, high < 40%
114
+ - HAT: high ≥ 70% AND mid < 25%
115
+ - SNARE: mid ≥ 25% AND high ≥ 40% AND peak ≥ 0.6
116
+ - ghost: peak < 0.35
117
+ Eliminates the "assume slice 0 = kick" class of bug.
118
+
119
+ ### New module
120
+
121
+ - **`mcp_server/sample_engine/slice_classifier.py`** — pure-Python
122
+ band-energy + peak classifier. Testable without Ableton
123
+ (`tests/test_slice_classifier.py` uses synthesized drum hits).
124
+ Exported `classify_segment()` and `classify_slices()` for direct
125
+ use outside MCP as well.
126
+
127
+ ### Documented bug entries
128
+
129
+ - `BUGS.md` gains a new **"F. 2026-04-18 Villalobos-groove creative
130
+ session"** section: F1-F4 fixed here, F5-F7 scoped to v1.13+, F8
131
+ wontfix (workaround documented).
132
+
133
+ ### Not included in this release
134
+
135
+ - `package.json` / `server.json` / plugin manifests / skill tool-count
136
+ sync — release-discipline is a separate task per CLAUDE.md's
137
+ "Version Bump" section. Run `python3 scripts/sync_metadata.py --fix`
138
+ before the next release.
139
+ - Registering `classify_simpler_slices` in
140
+ `tests/test_tools_contract.py::test_analyzer_tools_registered` — the
141
+ total-count assertion there already passes if regenerated; the
142
+ registration list is additive and can land with the metadata sync.
143
+
144
+ ---
145
+
146
+ ## 1.12.0 — Live 12 LOM completeness (April 18 2026)
147
+
148
+ Thirteen chunks closing the gap between LivePilot and Ableton Live 12.3.6's
149
+ Live Object Model. **325 → 397 tools (+72). 45 → 51 domains (+6).** Every
150
+ addition is hasattr-probed where the underlying API varies by Live version
151
+ — Core (12.0+), Enhanced (12.1.10+), and Full Intelligence (12.3+) tiers
152
+ keep their graceful degradation contract.
153
+
154
+ ### New tools by chunk
155
+
156
+ - **Chunk 1 — Song scale awareness (4 tools):** `get_song_scale`,
157
+ `set_song_scale`, `set_song_scale_mode`, `list_available_scales` — exposes
158
+ Live 12.0's Scale Mode at the song level. Remote Script probes
159
+ `song.scale_name` / `song.root_note`; missing on pre-12 falls back to
160
+ "Scale awareness unavailable".
161
+ - **Chunk 2 — Per-clip scale override (3 tools):** `get_clip_scale`,
162
+ `set_clip_scale`, `set_clip_scale_mode` — Live 12.0 MIDI clip-level override
163
+ for the song scale. Honors `clip.scale_name` and `clip.scale_mode`.
164
+ - **Chunk 3 — Tuning System (4 tools):** `get_tuning_system`,
165
+ `set_tuning_reference_pitch`, `set_tuning_note`, `reset_tuning_system` —
166
+ Live 12.1 microtonal tuning. Writes to `song.tuning_system`,
167
+ `tuning.reference_pitch`, and individual tuning-note cents.
168
+ - **Chunk 4 — Follow Actions (8 tools):** Clip-level Live 12.0 revamp
169
+ (multi-action enum, `follow_action_time`, `follow_action_enabled`) +
170
+ scene-level Live 12.2+ (`scene.follow_action`, `scene.follow_action_time`)
171
+ + preset wrapper for "A→B→C chain" common shapes.
172
+ - **Chunk 5 — Groove Pool (7 tools):** Pool enumeration, per-clip assignment,
173
+ master groove dial. Exposes Live 11+ `song.groove_pool` and the swing /
174
+ timing / random / velocity amount on each groove.
175
+ - **Chunk 6 — Take Lanes (6 tools):** Enumeration, creation, per-lane clip
176
+ creation. Live 12.0 read surface + 12.2 write surface — both paths handled
177
+ with `hasattr` probes so older hosts degrade cleanly.
178
+ - **Chunk 7 — Rack Variations + Macro CRUD (8 tools):** Variation
179
+ store/recall/delete + macro add/remove/randomize on Instrument/Audio-Effect
180
+ Racks (Live 11+).
181
+ - **Chunk 8 — Sample Slice CRUD (6 tools):** `insert_slice`, `move_slice`,
182
+ `remove_slice`, `clear_slices`, `reset_slices`, `import_slices_from_onsets`.
183
+ Writes to `SimplerDevice.sample.slices` (Live 11+).
184
+ - **Chunk 9 — Wavetable Modulation Matrix (5 tools):** Targets,
185
+ routing, amounts — completes the Wavetable surface alongside the existing
186
+ parameter tools (Live 11+).
187
+ - **Chunk 10 — Song/Track long-tail primitives (12 tools):** `tap_tempo`,
188
+ `nudge_tempo_down/up`, exclusive arm/solo, `capture_and_insert_scene`,
189
+ `count_in`, Ableton Link state, `jump_in_session_clip`, performance-impact
190
+ read, `appointed_device`.
191
+ - **Chunk 11 — Device A/B Compare (3 tools):** State read, toggle, copy
192
+ direction. Uses Live 12.3+ `Device.is_ab_state_enabled` / `ab_state`
193
+ where available; all three tools hasattr-probe so they return a clear
194
+ "unsupported on this Live build" error on 12.2 and older.
195
+ - **Chunk 12 — ControlSurface enumeration (2 tools):** `list_control_surfaces`,
196
+ `get_control_surface_info`. Always-available diagnostic for multi-surface
197
+ setups.
198
+ - **Chunk 13 — MIDI Tool bridge (4 tools):** `install_miditool_device`,
199
+ `set_miditool_target`, `get_miditool_context`, `list_miditool_generators`.
200
+ Exposes Live 12 MIDI Tools (Generators + Transformations) backed by
201
+ LivePilot generators (euclidean_rhythm, humanize, tintinnabuli). Ships
202
+ with both `.amxd` files pre-built from Live's factory templates — install
203
+ via `install_miditool_device()` which copies to the correct User Library
204
+ subfolders. **Note**: end-to-end Max-side integration is a known
205
+ follow-up; Max's `[js]` object may not locate `miditool_bridge.js` on
206
+ every machine without the folder being added to Max's File Preferences →
207
+ File Search Path. Server-side tools and config dispatch work standalone;
208
+ full round-trip notes-in-clip requires that Max path setup. Hence:
209
+ server shipped, Max-side user-setup step documented.
210
+
211
+ ### New domains (45 → 51)
212
+
213
+ Source of truth is module layout — six new files registered @mcp.tool()
214
+ decorators:
215
+
216
+ - `mcp_server/tools/scales.py` — serves both scales (Chunks 1–2) AND tuning
217
+ (Chunk 3) since both live on the Song object.
218
+ - `mcp_server/tools/follow_actions.py` — Chunk 4.
219
+ - `mcp_server/tools/grooves.py` — Chunk 5.
220
+ - `mcp_server/tools/take_lanes.py` — Chunk 6.
221
+ - `mcp_server/tools/diagnostics.py` — Chunk 12.
222
+ - `mcp_server/tools/miditool.py` — Chunk 13.
223
+
224
+ Chunks 7–11 extended existing domains (devices, clips) and did not introduce
225
+ new modules.
226
+
227
+ ### Known limitations
228
+
229
+ - **MIDI Tool bridge (Chunk 13) — Max-side file search**: the `.amxd` files
230
+ reference `js miditool_bridge.js` relatively. Max normally searches the
231
+ .amxd's folder first, but Live's MIDI Tool instantiation context can
232
+ bypass that. If `Max → Window → Max Console` shows "can't find file
233
+ miditool_bridge.js" when you fire the tool: open Max → Options → File
234
+ Preferences → add `~/Music/Ableton/User Library/MIDI Tools/Max Generators`
235
+ and `~/Music/Ableton/User Library/MIDI Tools/Max Transformations` to the
236
+ File Search Path, save, reload the device.
237
+ - A separate git stash ("pre-existing drift before LOM completeness work"
238
+ with `classify_simpler_slices` in flight) was left intact; the user will
239
+ reconcile it in its own release.
240
+
241
+ ### Not a breaking change
242
+
243
+ Every new tool is additive. No existing tool names, parameters, or return
244
+ shapes changed. Remote Script still boots cleanly on Live 12.0 — the 12.1+
245
+ and 12.3+ tools just return `STATE_ERROR` with a clear message when the host
246
+ lacks the underlying LOM attribute.
247
+
3
248
  ## 1.10.9 — Second-pass audit + deferred-bugs shipped (April 18 2026)
4
249
 
5
250
  Completes every non-feature item on the v1.10.8 audit backlog. 2116 → 2132
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  <p align="center">
19
19
  An agentic production system for Ableton Live 12.<br>
20
- 325 tools. 45 domains. Device atlas. Splice integration. Auto-composition. Spectral perception. Technique memory.
20
+ 398 tools. 51 domains. Device atlas. Splice integration. Auto-composition. Spectral perception. Technique memory.
21
21
  </p>
22
22
 
23
23
  <br>
@@ -79,8 +79,8 @@ Most MCP servers are tool collections — they execute commands. LivePilot is an
79
79
  │ └─────────────────┼──────────────────┘ │
80
80
  │ ▼ │
81
81
  │ ┌─────────────────┐ │
82
- │ │ 325 MCP Tools │ │
83
- │ │ 45 domains │ │
82
+ │ │ 398 MCP Tools │ │
83
+ │ │ 51 domains │ │
84
84
  │ └────────┬────────┘ │
85
85
  │ │ │
86
86
  │ Remote Script ──┤── TCP 9878 │
@@ -120,7 +120,7 @@ Most MCP servers are tool collections — they execute commands. LivePilot is an
120
120
 
121
121
  ## The Intelligence Layer
122
122
 
123
- 12 engines sit on top of the 325 tools. They give the AI musical judgment, not just musical execution.
123
+ 12 engines sit on top of the 398 tools. They give the AI musical judgment, not just musical execution.
124
124
 
125
125
  ### SongBrain — What the Song Is
126
126
 
@@ -172,7 +172,7 @@ Every engine follows: **measure before → act → measure after → compare**.
172
172
 
173
173
  ## Tools
174
174
 
175
- 325 tools across 45 domains. Highlights below — [full catalog here](docs/manual/tool-catalog.md).
175
+ 398 tools across 51 domains. Highlights below — [full catalog here](docs/manual/tool-catalog.md).
176
176
 
177
177
  <br>
178
178
 
@@ -360,7 +360,7 @@ The V2 intelligence layer. These tools analyze, diagnose, plan, evaluate, and le
360
360
  | Creative Constraints | 5 | constraint activation, reference-inspired variants |
361
361
  | Preview Studio | 5 | variant creation, preview rendering, comparison, commit |
362
362
 
363
- > **[View all 325 tools →](docs/manual/tool-catalog.md)**
363
+ > **[View all 398 tools →](docs/manual/tool-catalog.md)**
364
364
 
365
365
  <br>
366
366
 
@@ -587,7 +587,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for architecture details, code guidelines
587
587
 
588
588
  | Document | What's inside |
589
589
  |----------|---------------|
590
- | [Manual](docs/manual/index.md) | Complete reference: architecture, all 325 tools, workflows |
590
+ | [Manual](docs/manual/index.md) | Complete reference: architecture, all 398 tools, workflows |
591
591
  | [Intelligence Layer](docs/manual/intelligence.md) | How the 12 engines connect — conductor, moves, preview, evaluation |
592
592
  | [Device Atlas](docs/manual/device-atlas.md) | 1305 devices indexed — search, suggest, chain building |
593
593
  | [Samples & Slicing](docs/manual/samples.md) | 3-source search, fitness critics, slice workflows |
Binary file
@@ -95,7 +95,7 @@ function anything() {
95
95
  function dispatch(cmd, args) {
96
96
  switch(cmd) {
97
97
  case "ping":
98
- send_response({"ok": true, "version": "1.10.9"});
98
+ send_response({"ok": true, "version": "1.12.2"});
99
99
  break;
100
100
  case "get_params":
101
101
  cmd_get_params(args);
@@ -1,2 +1,2 @@
1
1
  """LivePilot MCP Server — bridges MCP protocol to Ableton Live."""
2
- __version__ = "1.10.9"
2
+ __version__ = "1.12.2"