``` STEP 9 CONTROLS FIX — VERIFIED SCOPED MCP CONTROLLER REQUESTS Date: 2026-10-20 Result: COMPLETE. Ready for final native application acceptance. Application open/play/save/reload, audible behavior and Cubase acceptance: UNRUN. SCOPE / IMPLEMENTATION Executed prompts\step_9_fix_controls.md against CURRENT report_9_fix.md and the existing strict contracts, compiler, service, MIDI, Riffer and SD3 codecs. Preserved the pre-existing working tree and earlier reports. No commits, delegation, later prompts, new dependencies, domains, audio/hosting/model features, private templates or guessed vendor-effect mappings. 1. GenerateMusicRequest now accepts optional cc_events, default []. Each strict ScheduledControl has exactly part, beat, controller and value. Parts are lead/bass/drums; beats reuse reduced RationalBeat quarter-note positions; controller/value are strict integers 0..127. Unknown fields, booleans, strings, floats, invalid bounds and sub-tick beats are rejected. JSON Schema exposes the strict item, maximum 100,000 items and explicit selected-part associations. Normalized (part, beat, controller) duplicates fail even with identical values or differently spelled equivalent ratios. Association is checked again after text inference. 2. apply_scheduled_controls runs after ordinary compile_score, reusing ControlChangeEvent/EventTrack/EventPlan and the existing exact tick helper. It adds the common musical-start offset, uses the selected profile channel, preserves all original notes/switches/order keys and score/timeline fields, assigns new unique sequences, and sorts CC before same-tick note-ons. Controls plus all compiled musical/switch events share the existing 100,000 event budget. Beat <= resolved musical duration is required; explicit end resets are valid. No reset or controller-to-technique inference is invented. Empty controls return the original compiled plan unchanged. 3. An explicit CC at an articulation-owned tick/controller is INVALID_REQUEST, even for an identical value. Details identify cc_events, part, tick and controller and say to remove/move the point. No silent articulation override. 4. Existing real MIDI/Riffer codecs retain the controls, without changing their encodings. MIDI preserves every valid requested controller/channel/tick/value. Riffer retains the evidenced CC1 stair lane at native PPQ 480; unsupported controllers remain precise known native unavailability, not dropped messages. 5. SD3 preflight now reports sd3_native_controller_not_supported ONLY after checking channels, note roles, release semantics and exact score/note-event agreement. The observed native subset establishes note triples, not CC triples. Only this new controller-specific reason was added to the existing narrow representation-fallback allowlist; corruption is not allowlisted. Allowed fallback replaces only the affected native target with combined MIDI; other valid native targets survive. Disabled fallback fails before staging. MIDI-only controls bypass native preflight and need no SD3 template. 6. Updated README with a concrete optional cc_events/reset example, exact units/grid/budget/collision rules and native limitations; updated the MCP architecture contract and SD3 codec documentation. ACTUAL REAL STDIO / NATIVE / MIDI EVIDENCE The original portable fixture tests\fixtures\sd3\original-template.sd3p was copied into exclusively owned test workspaces, supplied as an operator CLI template and checked unchanged in bytes/file identity/mtime afterward. No private project or kit state was accessed for this task. Actual isolated Python -I -B module stdio subprocess, different working directory, initialization, live input/output schema discovery, generation, error cases and EOF were exercised. Checkout control acceptance observed 13 valid JSON-RPC stdout lines, empty stderr and exit 0. Request baseline: original seed=42, 137.5 BPM, 2 bars 7/8, Bb minor, quarter rests, palm mute on pitched parts only. MIDI PPQ=960, musical start=0, musical end/EOT=6720; native Riffer PPQ=480, end=3360. Independently expected and read-back MIDI controls (tick, controller, value): lead, channel 0: (0,1,11), (480,1,73), (6720,1,0) bass, channel 1: (0,1,21), (960,1,127), (6720,1,0) Native XML cc-1.Mod/p stair points (native tick, value): lead: (0,11), (240,73), (3360,0) bass: (0,21), (480,127), (3360,0) Both native read-back validators and independent XML parsing confirm every point, including the explicit reset. Mido independently accumulates deltas, checks exact channels and raw [0xB0|channel, controller, value] message bytes, and verifies same-tick CC precedes note-ons. Musical notes/switches and native PM/PMP techniques/velocities continue to pass the original saved validators. Seven successful cases and four rejected cases run through actual stdio: pitched CC1: 6 combined-MIDI CCs, 3 lead + 3 bass native stair points; actual outputs mid, griff, briff; complete, no native fallback. all-part drum CC: adds channel-9 (320,4,96), (6720,4,0), 8 combined-MIDI CCs total; actual outputs mid, griff, briff; fallback_for=["drums"] ONLY; warning reason sd3_native_controller_not_supported. unsupported lead Riffer CC74: adds lead (320,74,127), (6720,74,0), 8 combined-MIDI CCs total; actual outputs mid, briff, sd3p; fallback_for=["lead"] ONLY; warning reason unsupported_native_controller. Bass and drum natives survive. explicit MIDI-only mixed controls: lead/bass CC1, lead CC74 and drum CC4, 10 exact CCs total; one actual .mid, complete with fallback disabled, no fallback warning. exact one-tick MIDI-only CC: lead/channel-0 CC1=99 at tick 1 (beat 1/960), exactly one CC; no rounding, no implicit reset, complete. controls omitted / controls []: four actual outputs each, zero CCs; all four byte-identical to each other AND pinned to the original report_9_fix pre-controls SHA-256 baseline. rejected drum CC with fallback=false: NATIVE_FORMAT_UNAVAILABLE / sd3_native_controller_not_supported. rejected unsupported lead CC with fallback=false: NATIVE_FORMAT_UNAVAILABLE / unsupported_native_controller. rejected drum CC on inferred lead-only request: INVALID_REQUEST / resolved_part_association. rejected CC at tick 6721: INVALID_REQUEST / beat_after_musical_end. All rejected stdio cases leave the output directory snapshot unchanged: no staged/partial artifacts, mislabeled native output or successful fallback. Successful cases produce exactly 19 artifacts across their seven directories per control acceptance run; every saved artifact is independently validated. NO-CONTROL ORIGINAL BYTE REGRESSION SHA-256 values independently checked for BOTH omitted and empty controls: MIDI: 8fc4cfbe66c0706f223ec33a61692ead046a56a9dba51c6566f967690cee186c lead griff: fe7a2a5c98d0ae16f6894e681e7f001a658c90d11b3f1beb313d5c98b6c810c9 bass briff: 5da9b05e92e6989366f41f8abf22a0f8b88ae14591bc8b544e4c7c0cf47827c4 drums sd3p: 8bee8a86a7e60320d02c4404e36d818639af1d8f4ebce27f6c23a25e7ebd0589 These are the original fixture/request hashes recorded before cc_events existed, not newly generated golden values that merely compare the implementation to itself. INSTALLED-WHEEL ACCEPTANCE The affected distribution tests build the real sdist then wheel offline, install the wheel noneditably with --no-index --no-deps --no-cache-dir --target, and run the installed server outside the checkout under isolated Python. Existing assertions verify all 16 package/submodule locations under the install target, metadata and all six packaged JSON profile resources against the wheel. Dependencies are reused from the existing venv; this is not a claimed clean installation of the complete dependency environment. The same seven successful/four rejected control cases above run against this actual installed stdio server, with live input/output schema comparisons, independent Mido/XML/native saved-content validation, the copied original portable SD3 fixture, byte-pinned no-control regression and exact fallback checks. The configured installed native-process sequence has 17 valid JSON-RPC stdout lines, empty stderr and exit 0 (including the existing three baseline native/default/alias/MIDI requests and profile discovery). The original template bytes/identity/mtime remain unchanged. Existing installed codec probes and standard-profile/default/alias/error/privacy/EOF acceptance also pass. UNIT / SERVICE EVIDENCE 37 new unit cases cover strict items/schema, rational normalization, duplicate projection, part/grid/bounds, exact offset/order/channel/value/reset behavior, unchanged original note/switch events, unique ordering keys, empty identity, no invented reset, actionable articulation collisions and native preflight. The offset test uses score origin 7 beats, common pre-roll 120 ticks and exact 1/3-beat CC at tick 440; end reset is tick 3960, not score-absolute beat 11. The real 100,000 combined-event boundary succeeds; adding controls without budgeting compiled notes/switches is rejected. 7 new integration cases include real stdio, inferred-part preflight, actual 100,000-item request plus composed-event budget rejection before _new_stage, and four corruption injections. Wrong drum channel, altered drum note, wrong note role and nonzero release velocity combined with otherwise valid CCs each remain SERIALIZATION_ERROR with no artifacts, never controller fallback. Corresponding precise native preflight unit cases also pass. EXECUTED VALIDATION — FINAL ALL PASS Windows, existing .venv, CPython 3.13.13. .\.venv\Scripts\python.exe -m pytest tests\unit\test_cc_controls.py tests\integration\test_cc_stdio.py tests\integration\test_distribution.py -q PASS: 47 passed in 21.47s. .\.venv\Scripts\python.exe -m pytest -q PASS: 1413 passed in 62.18s; 0 failures, 0 skips, 0 xfails. Original current suite: 1369; 44 new unit/integration cases added. All native/default/alias/transaction/profile/MIDI regressions remain. .\.venv\Scripts\python.exe -m pytest tests\integration\test_cc_stdio.py::test_real_stdio_exact_controls -q -s PASS: 1 passed in 1.92s; printed independent exact CC/output/fallback evidence. .\.venv\Scripts\python.exe -m ruff check src tests PASS: all checks passed. .\.venv\Scripts\python.exe -m ruff format --check src tests PASS: 46 files already formatted. .\.venv\Scripts\python.exe -m mypy --strict src tests PASS: no issues found in 46 source files. .\.venv\Scripts\python.exe -m pip check PASS: no broken requirements found. git --no-pager diff --check PASS: no whitespace errors. Editor Problems for all touched Python files: PASS: no errors. Editor runTests discovered no tests; actual explicit pytest runs above provide execution evidence, not an invented editor pass. ISSUES / CLEANUP / READINESS Initial new-test runs exposed two test-setup mistakes: a nonzero score origin without shifting its logical note, and an empty-control expected dictionary lookup. Corrected those fixtures/assertions; no expected-failure markers or weaker success checks were introduced. Ruff formatting/import ordering and strict test dictionary annotations were corrected. Final runs are all green. All exclusively owned cc-controls-* and distribution-* workspaces were removed by fixture cleanup. No new incomplete service stage remains; every subprocess was closed and awaited. Existing ignored native/private evidence trees and prior work were preserved. No private template was copied into source. No dependency manifests changed and no dependency restore was needed. READY for final native application acceptance of the declared software subset. No implementation blocker remains. Actual Eclipse/Ray5/SD3 open/inspect/play/ save/close/reload, audible controller behavior and Cubase routing/import still require application acceptance and are explicitly UNRUN, not test passes. No vendor vibrato/effect semantics, broader controller encoding, new native techniques, libraries or playback compatibility are claimed. ```