|
| 1 | +# POC 02: Status Monitor |
| 2 | + |
| 3 | +## Objective |
| 4 | + |
| 5 | +Define a minimal, additive status-monitor layer that improves confidence in `ClaudeMCP_Remote` runtime health without modifying the core Remote Script, the 220-action router, or any live-performance behavior. |
| 6 | + |
| 7 | +## Scope |
| 8 | + |
| 9 | +- Build on the validated Windows smoke-test workflow from POC 01. |
| 10 | +- Focus on read-only runtime signals already exposed by the repo and the host environment. |
| 11 | +- Standardize how to confirm that the Control Surface loaded, the TCP server is listening, and basic session health can be queried safely. |
| 12 | +- Capture evidence from both Ableton logs and TCP responses for later review. |
| 13 | + |
| 14 | +## Non-goals |
| 15 | + |
| 16 | +- No edits to `ClaudeMCP_Remote/__init__.py`. |
| 17 | +- No edits to `ClaudeMCP_Remote/liveapi_tools.py`. |
| 18 | +- No changes to the static action router. |
| 19 | +- No event subscription or observer subsystem. |
| 20 | +- No attempt to stream real-time session state. |
| 21 | +- No live-performance automation, transport control, or write actions. |
| 22 | + |
| 23 | +## Current Known Signals |
| 24 | + |
| 25 | +From repo inspection and runtime validation, the following read-only signals already exist: |
| 26 | + |
| 27 | +- Ableton log messages emitted through `c_instance.log_message(...)`. |
| 28 | +- Startup log lines including: |
| 29 | + - `Socket server started successfully on port 9004` |
| 30 | + - `ClaudeMCP Remote Script initialized (Queue-based, Thread-Safe)` |
| 31 | + - `Socket server listening on port 9004` |
| 32 | + - `Client connected from ...` |
| 33 | +- TCP listener on `127.0.0.1:9004`. |
| 34 | +- Read-only TCP actions: |
| 35 | + - `ping` |
| 36 | + - `health_check` |
| 37 | + - `get_session_info` |
| 38 | + |
| 39 | +## Proposed Monitor Surface |
| 40 | + |
| 41 | +The status monitor for this phase should be a wrapper-level workflow, not a new core feature. |
| 42 | + |
| 43 | +### Layer 1: Process and startup evidence |
| 44 | + |
| 45 | +- Confirm Ableton Live is running. |
| 46 | +- Confirm `ClaudeMCP_Remote` is selected as a Control Surface. |
| 47 | +- Confirm recent Ableton log lines show successful script startup rather than an import or bind failure. |
| 48 | + |
| 49 | +### Layer 2: Listener evidence |
| 50 | + |
| 51 | +- Confirm Windows shows `127.0.0.1:9004` in `Listen` state. |
| 52 | +- Record the owning process ID when available. |
| 53 | + |
| 54 | +### Layer 3: Read-only protocol evidence |
| 55 | + |
| 56 | +- Run `ping` to prove command/response flow works. |
| 57 | +- Run `health_check` to capture: |
| 58 | + - `ok` |
| 59 | + - `message` |
| 60 | + - `tool_count` |
| 61 | + - `ableton_version` |
| 62 | + - `queue_size` |
| 63 | +- Run `get_session_info` to capture: |
| 64 | + - playback state |
| 65 | + - tempo |
| 66 | + - time signature |
| 67 | + - track count |
| 68 | + - scene count |
| 69 | + - loop values |
| 70 | + |
| 71 | +### Layer 4: Evidence capture |
| 72 | + |
| 73 | +- Save raw request and raw response payloads. |
| 74 | +- Save a short Ableton log extract around startup and the client connection event. |
| 75 | +- Keep outputs timestamped for side-by-side review across runs. |
| 76 | + |
| 77 | +## Proposed Artifacts |
| 78 | + |
| 79 | +This phase does not require core-code changes. The likely additive outputs are: |
| 80 | + |
| 81 | +- a small Windows-native wrapper script for repeated status checks |
| 82 | +- a status log file under `logs/` |
| 83 | +- a short runbook section or dedicated doc for interpreting the captured signals |
| 84 | + |
| 85 | +The current repo already includes most of the needed pieces: |
| 86 | + |
| 87 | +- `scripts/windows/run_smoke_test.ps1` |
| 88 | +- `scripts/poc/smoke_test_client.py` |
| 89 | +- `docs/smoke-test-runbook.md` |
| 90 | + |
| 91 | +## Proposed Command Sequence |
| 92 | + |
| 93 | +```powershell |
| 94 | +.\scripts\windows\deploy_control_surface.ps1 |
| 95 | +``` |
| 96 | + |
| 97 | +Restart Ableton Live, select `ClaudeMCP_Remote`, then run: |
| 98 | + |
| 99 | +```powershell |
| 100 | +.\scripts\windows\run_smoke_test.ps1 |
| 101 | +``` |
| 102 | + |
| 103 | +Optional direct checks: |
| 104 | + |
| 105 | +```powershell |
| 106 | +Get-NetTCPConnection -LocalPort 9004 -ErrorAction SilentlyContinue | Format-Table -AutoSize LocalAddress,LocalPort,State,OwningProcess |
| 107 | +Get-Content "$env:APPDATA\Ableton\Live 12.3.6\Preferences\Log.txt" -Tail 200 |
| 108 | +``` |
| 109 | + |
| 110 | +## Verification Steps |
| 111 | + |
| 112 | +1. Confirm Ableton starts without obvious Control Surface load errors. |
| 113 | +2. Confirm `127.0.0.1:9004` is in `Listen` state from Windows. |
| 114 | +3. Run the smoke-test wrapper and confirm the first action remains read-only. |
| 115 | +4. Confirm `ping`, `health_check`, and `get_session_info` all return valid JSON with `"ok": true`. |
| 116 | +5. Review the raw request/response capture and the recent Ableton log tail together. |
| 117 | +6. Confirm the captured `tool_count` and `ableton_version` remain plausible across repeated runs. |
| 118 | + |
| 119 | +## Risks |
| 120 | + |
| 121 | +- This repo still has no event-driven status feed, so the monitor is polling-based and coarse. |
| 122 | +- `health_check` is useful but limited; it reports queue size and version, not full runtime internals. |
| 123 | +- WSL-side socket visibility was unreliable on this machine, so status checks must be treated as Windows-native. |
| 124 | +- The exact Ableton log path can vary by installed version. |
| 125 | +- A successful listener check does not guarantee every action path is implemented correctly. |
| 126 | + |
| 127 | +## Pass/Fail Criteria |
| 128 | + |
| 129 | +Pass: |
| 130 | + |
| 131 | +- Ableton startup evidence is present in the log. |
| 132 | +- Windows shows `127.0.0.1:9004` listening. |
| 133 | +- Read-only status requests succeed consistently. |
| 134 | +- Raw request/response and log evidence are captured together. |
| 135 | +- No core Remote Script changes are required for the monitor workflow. |
| 136 | + |
| 137 | +Fail: |
| 138 | + |
| 139 | +- The script does not load or does not stay loaded. |
| 140 | +- The port is not listening. |
| 141 | +- Read-only requests fail, time out, or return malformed JSON. |
| 142 | +- The monitoring workflow depends on WSL-only checks that do not reflect the real Windows runtime. |
| 143 | + |
| 144 | +## Rollback Approach |
| 145 | + |
| 146 | +- Deselect `ClaudeMCP_Remote` in Ableton Preferences if needed. |
| 147 | +- Remove the deployed control surface copy from the Ableton scripts directory if this POC must be backed out. |
| 148 | +- Delete only additive logs and wrapper outputs. |
| 149 | +- Leave core repo code unchanged. |
| 150 | + |
| 151 | +## Recommendation |
| 152 | + |
| 153 | +Proceed with POC 02 as a documentation-and-wrapper phase first. Do not introduce a new monitoring subsystem in the Remote Script until repeated Windows-native runs show a stable need for more granular observability. |
0 commit comments