# SPRINT v0.1.39 - NEXT FOR GLM
## Open-Project Editing Runtime + Coherence With Less Symmetry

**Owner:** GLM via OpenCode  
**Reviewer:** Codex  
**Fecha:** 2026-04-03  
**Mode:** Edit existing project, not generate new song

Primary benchmark project:

- `C:\Users\ren\Desktop\song Project\song.als`

Reference docs:

- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\docs\SPRINT_v0.1.38_VALIDATION_REPORT.md`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\docs\PROJECT_AUDIT_song_2026-04-03.md`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\docs\SPRINT_v0.1.36_NEXT_KIMI_PROJECT_EDITING.md`

---

## 1. Reviewer Baseline

v0.1.38 was useful but not closed.

GLM did make real progress:

- MCP project-editing surface is broader
- session clip editing is real
- project auditing is now useful

But the benchmark set still shows the real musical problem the user cares about:

- too much symmetry
- too many silences
- too few sound decisions
- continuity depends on repeating the same handful of sources

### Current live truth from Codex review

- tempo: `95 BPM`
- tracks: `16`
- returns: `4`
- scenes: `6`
- harmonic support track exists as `HARMONY_AMIN_PLUCK`
- current live state:
  - `session_clip_count = 1`
  - `arrangement_clip_count = 0`

`audit_current_project()` on the open set currently shows:

- `longest_drum_gap = 56 beats`
- `longest_harmonic_gap = 92 beats`
- `repeated_clip_overuse = 8`
- `structure_mismatch = Expected ~384 beats, got 356`

This matches the screenshot-level problem:

- repeated mirrored blocks
- obvious 32-beat restatements
- same samples reused as if copied by grid
- arrangement islands instead of sustained flow

---

## 2. What Codex Fixed After v0.1.38

These fixes are already in the tree and are the new baseline.

### 2.1 Runtime / MCP bug fixes

Codex fixed:

- arrangement-editing timeouts:
  - `create_arrangement_clip`
  - `duplicate_clip_to_arrangement`
  - `create_arrangement_audio_pattern`
- `get_device_parameters()` on non-quantized parameters
- legacy `_send_command_to_ableton(...)` bridge used by old validators
- `humanize_set()` so it reads the real `get_all_tracks()` / `get_clips()` shape instead of reporting `0` by accident
- duplicate MCP tool registrations for:
  - `delete_clip`
  - `set_clip_name`
  - `set_clip_loop`
- duplicate `audit_project_coherence()` definition in `server.py`

### 2.2 Validation baseline

Passing locally:

- `test_runtime_truth.py`
- `test_selection_coherence.py`
- `test_piano_forward.py`
- `python -m py_compile` on:
  - `server.py`
  - `abletonmcp_init.py`
  - `abletonmcp_runtime.py`

Important:

- because `abletonmcp_init.py` and `abletonmcp_runtime.py` changed, you must restart Ableton and OpenCode before live validation

---

## 3. Code Review: Why The Song Still Feels Symmetric And Empty

This is the main product problem now.

### 3.1 The system still places too much material with fixed-step repetition

In `reference_listener.py`, many roles are still placed through repeated `add_range(...)` with constant steps across entire sections.

Examples:

- kicks and hats in intro/build/drop
- perc/top loop in drop
- synth loop in drop
- bass loop over long spans with minimal local variation

The result is predictable:

- same source
- same spacing
- same section length
- same restart point

This creates visible and audible symmetry.

### 3.2 Variation is often achieved by omission, not transformation

The current project does not mainly suffer from “too many sounds”.
It suffers from:

- too few sound identities
- too much mute-space between those identities

The system is still solving variation by:

- dropping a layer
- delaying a layer
- omitting sparse-support layers

Instead of:

- alternating sources inside the same family/pack
- overlapping support across boundaries
- using transformed variants of a stable backbone

### 3.3 Musical support layers are still too easy to omit

The benchmark project shows:

- strong bass continuity
- weak harmonic continuity
- empty harmonic MIDI in Arrangement

Support layers like harmonic MIDI and keys support are still too easy to lose or omit.
That directly causes the empty bars the user hears.

### 3.4 Coherence is too rigid at the sample level

Right now coherence often collapses into:

- same pack
- same family
- same exact sample

That is not musical coherence.
That is mechanical sameness.

The next step is:

- keep pack/family coherence
- relax sample identity enough to avoid “copy same clip every 32 beats”

---

## 4. Product Direction For v0.1.39

This sprint has two equal priorities:

1. make open-project editing in MCP more reliable in live runtime
2. make the edited song less symmetrical and less empty without breaking coherence

This sprint is explicitly **not**:

- generating a brand-new song
- adding more piano timbre
- adding vocals
- making the track busier just to hide holes

It is:

- fixing the editing runtime
- repairing the current project
- making coherence more musical and less mechanical

---

## 5. Semantic Rule About “Piano Roll”

The user comes from FL.

When the user asks for `piano roll`, interpret that as:

- harmonic MIDI support
- note backbone
- Arrangement MIDI continuity

It does **not** mean:

- make the song piano-forward
- add piano audio everywhere
- swap the sound identity to piano timbre

For this sprint:

- `HARMONY_AMIN_PLUCK` / `HARMONY_PIANO_MIDI` style tracks are harmonic MIDI lanes
- they must help fill harmonic gaps across the song
- they do not justify forcing a piano sound

---

## 6. P0 Tasks

## P0.1 Re-validate live runtime after restart

Restart:

1. Ableton
2. OpenCode

Then validate against the actual open benchmark project.

Minimum required calls:

- `get_session_info()`
- `get_tracks()`
- `get_track_info(track_index=15)`
- `audit_current_project()`

You must prove:

- whether the timeout fix for Arrangement editing is now live
- whether `HARMONY_AMIN_PLUCK` is still session-only
- whether the project audit still matches the user’s screenshot complaint

Required evidence:

- exact calls
- exact outputs

---

## P0.2 Close real Arrangement editing on the open project

You must validate real Arrangement editing on `song.als`.

The goal is not session-only editing.
The goal is:

- create or duplicate MIDI into Arrangement
- re-inspect Arrangement
- prove it persisted

Required live proof:

1. one real Arrangement edit on the harmonic MIDI track
2. `get_clips(...)` or equivalent re-inspection showing `arrangement_clip_count > 0`
3. a second re-inspection after another read

If Arrangement still times out or disappears after re-inspection:

- this sprint is not complete

---

## P0.3 Add arrangement-specific inspection for project editing

The MCP still needs cleaner inspection for project editing.

Add one of:

- `get_arrangement_clip_info(track_index, start_time, track_type="track")`
- or extend `get_clip_info(...)` with `view="session" | "arrangement"`

Minimum returned fields:

- clip name
- start time
- length
- audio vs midi
- loop state when available
- track type

This must be usable against the open project, not just tests.

---

## P0.4 Add first-class project repair tools driven by coherence

Stop adding only primitives.
Add bounded repair tools for the open project.

Required new MCP tools:

- `repair_harmonic_gaps(...)`
- `extend_track_continuity(...)`
- `reduce_repeated_clip_overuse(...)`

These can be narrow in v1, but they must:

- return actions taken
- name tracks touched
- report clips created/duplicated/extended
- be usable on `song.als`

Good first scopes:

- fill one long harmonic gap with Arrangement MIDI support
- extend one rhythmic support track to avoid empty islands
- replace or alternate one repeated-source hotspot with a same-family/same-pack alternative

---

## P0.5 Make coherence less rigid and less symmetrical

This is the most important musical task of v0.1.39.

The current system overuses:

- fixed-step placement
- exact sample reuse
- section mirror logic
- silence as the main variation device

You must make the system more selective and more free without breaking identity.

Required behavior change:

- keep pack/family coherence
- reduce exact same-sample looping
- allow section-local alternates inside the same pack/family
- avoid perfect mirrored restart points across sections
- reduce long empty spans

Do **not** solve this by randomizing everything.

Do solve it by:

- same-family alternate sources
- same-pack variants
- longer support overlaps
- section-specific density transforms
- controlled offsets instead of identical block restarts

---

## 7. Concrete Musical Acceptance Targets

These are required for the open benchmark after editing.

### Continuity

- `longest_drum_gap <= 24 beats`
- `longest_harmonic_gap <= 32 beats`

### Repetition

- reduce the top repeated-source hotspot count materially
- no single support loop should dominate the song by obvious copy-paste symmetry

### Harmonic support

- harmonic MIDI must exist in Arrangement
- harmonic MIDI must span multiple sections, not just one token clip

### Arrangement shape

- fewer empty islands
- less obvious 32-beat mirroring
- more staggered continuity between bass / synth / support layers

### Coherence

- preserve pack/family identity
- do not explode into unrelated sounds
- do not trade symmetry for chaos

---

## 8. P1 Tasks

## P1.1 Add symmetry/silence metrics to project auditing

Extend project auditing so the problem becomes measurable.

Required new metrics:

- `largest_contiguous_silence_by_track`
- `max_symmetric_repeat_run`
- `unique_sources_per_track`
- `harmonic_backbone_presence`
- `section_density_profile`

These should describe the open project, not a manifest-only abstraction.

---

## P1.2 Connect repair tools to audit output

The audit should not stop at diagnosis.

At minimum, a repair tool should be able to consume:

- harmonic gap data
- repeated-source hotspots
- empty harmonic support tracks

and return a bounded repair result.

Do not build a fake black box.
Return:

- before
- action
- after

---

## 9. Non-Goals

Do not spend this sprint on:

- new song generation paths
- vocals
- piano-forward timbre design
- stylistic remake polish
- new M4L device work

This sprint is:

- editing a real open project
- reducing symmetry
- reducing silences
- strengthening coherence through repair, not through brute repetition

---

## 10. Required Files

Primary:

- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\server.py`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\abletonmcp_init.py`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\abletonmcp_runtime.py`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\reference_listener.py`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\song_generator.py`
- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\tests\test_runtime_truth.py`

Benchmark:

- `C:\Users\ren\Desktop\song Project\song.als`

---

## 11. Required Validation

Minimum local:

```powershell
python -m py_compile "C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\server.py" "C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\abletonmcp_init.py" "C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\abletonmcp_runtime.py"
python "C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\tests\test_runtime_truth.py"
python "C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\tests\test_selection_coherence.py"
python "C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\AbletonMCP_AI\AbletonMCP_AI\MCP_Server\tests\test_piano_forward.py"
```

Required live validation:

- inspect current project before edits
- perform one real Arrangement MIDI edit
- re-inspect and prove persistence
- run `audit_current_project()`
- run `audit_project_coherence()`
- demonstrate reduced gaps or reduced repeated-source overuse on at least one repaired track

---

## 12. Deliverable

Write:

- `C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\docs\SPRINT_v0.1.39_VALIDATION_REPORT.md`

Must include:

### A. Runtime truth

- restart evidence
- MCP connection evidence
- benchmark project evidence

### B. Tool/runtime validation

- exact call
- exact output
- pass/fail

### C. Arrangement editing proof

- action
- immediate result
- re-inspection proof
- persistence proof

### D. Coherence before/after

- gaps
- repeated-source hotspots
- harmonic support state
- explanation of what changed

### E. Reviewer conclusion

Only one of:

- `COMPLETED`
- `PARTIAL`
- `BLOCKED`

Do not call it `COMPLETED` if:

- Arrangement editing still does not persist
- harmonic MIDI is still absent from Arrangement
- the song still looks like mirrored blocks with long empty islands

---

## 13. Final Rule

Do not optimize for “more tools” alone.

This sprint is successful only if:

- MCP edits the open project reliably
- the edited benchmark becomes less symmetrical
- the long silences materially shrink
- coherence improves without collapsing into the same exact sample everywhere
