Cubase-MCP-GAJ3T.MusicGen.R.../prompts/step_9_fix.md

123 lines
7.3 KiB
Markdown

# Step 9 fix: Wire every real native writer into the MCP service
## Objective and accepted prerequisites
Read the latest plan continuation and CURRENT report_7_fix/report_8_fix.
Real Riffer .griff/.briff and SD3 .sd3p codecs, saved-file validators and
evidence-backed target subset profiles are implemented. The orchestrator
reviewed both reports and independently reran their new native tests.
Finish the original native-generation functionality end-to-end. Do not merely
keep returning unavailable or native_writer_not_registered. Preserve correct
explicit MIDI fallback where a real configured capability is missing.
No commits, delegation, later prompts, audio analysis, plugin hosting or scope
expansion. Actual native suffixes correct the original request names; agp/sdp
remain accepted request aliases, never misleading artifact suffixes.
## Owned surfaces
- `service.py`, `server.py`, `__main__.py`
- Minimal coherent native preflight helpers if needed; do not replace codecs.
- Target/standard profile default flags and necessary strict validation updates.
- Unit/integration/stdio/installed-distribution/native transaction tests.
- README, architecture, compatibility, profile/format docs and current plan status.
- `prompts/report_9_fix.md`
Preserve all previous reports and unrelated work. Explain/test shared changes.
## Functional integration
1. Register write_riffer/validate_riffer_file and write_sdp/validate_sdp_file
alongside MIDI. Defaults request MIDI and each selected part's actual native
suffix. Explicit native aliases and actual names resolve coherently:
agp -> relevant griff/briff; sdp -> sd3p.
2. Use actual format/suffix/part metadata in artifacts:
`<basename>_lead.griff`, `<basename>_bass.briff`,
`<basename>_drums.sd3p`, combined `<basename>.mid`.
No renamed MIDI or artifact format=agp/sdp fiction.
3. Promote actual evidence-backed target subsets to unambiguous defaults for
their parts once service wiring works. Keep standard profiles available by
explicit ID as fallbacks, not silently relabeled target mappings.
4. Add optional operator CLI `--sd3-template <local-project.sd3p>`, thread the
typed Path through create_server/GenerationService and native preflight/
write/validation. No tool-controlled arbitrary template path.
Missing optional template is known native unavailability; corrupt/unreadable/
unsupported explicitly supplied template is a visible error, never hidden
as fallback. Preserve source template identity/content.
5. Do not auto-bundle/distribute private kit state or factory music. For genuine
local acceptance use the known read-only operator template:
C:\Users\g3\Documents\Toontrack\Superior Drummer 3\sd3-demo.sd3p
Tests must use original synthetic minimal template state and remain portable
without that private file. Current CLI docs/config may show operator paths
but never include private project bytes.
6. Profile listing must accurately describe runtime native readiness, actual
corrected suffixes, version/library/subset limits and any template requirement.
Selected target MIDI maps work even without a native project template.
7. All requested available native outputs must be emitted, even when another
part requires fallback. A missing drum template with allowed fallback should
yield real lead/bass native files plus one combined MIDI, with fallback_for
only drums. Fallback=false must fail before staging/publishing.
8. Only actual known representation/capability limitations may cause fallback.
Native write/read-back corruption, map errors, template errors and IO failures
remain failures. Preflight known native grid/pre-roll/tail/control limitations
when possible; do not stage partial outputs and then claim success.
9. Correct success/fallback coverage, profile IDs, sizes, assumptions/overrides
and per-part warnings. Verified-subset limitations should be visible without
claiming every technique/tuning/library or full application certification.
10. Palm mute on the native lead/bass profiles must be reachable through the
description path and produce actual switch/velocity/native PM/PMP data.
If mixed pitched+drum descriptions request pitched-only techniques, define
and test the intended applicability rather than requesting drum palm mute
or silently dropping a meaningful instruction.
## Multi-file transaction and failures
- Stage at most the requested native/MIDI files under one uniquely owned root
child. Validate every actual saved native/MIDI file before publication.
- Generalize owned filename/size/identity checks and cleanup from the old single
MIDI file. Unknown injected content/reparse points or ownership changes remain
errors; never recursively erase unrelated files or user data.
- Build/validate complete result metadata before the same-volume Windows
no-replace rename commit. No partial final directories, overwrites or merges.
- Failure of the last native writer must clean all owned partial stage files
and publish nothing. Preserve existing destination/sentinel identities.
- Keep root/ancestor checks, concurrent one-winner behavior, trusted ACL/race/
crash limits and stdout/error privacy accurate.
## Required tests
Unit: requested alias/actual-format resolution, target defaults, explicit standard
selection, template absent/valid/corrupt, runtime profile summaries, correct
artifact/warning coverage, no native placeholders, and multi-file cleanup/
ownership/collision/fault paths.
Integration:
- All-parts default/native-only/MIDI-only with a generated original SD3 template.
Validate actual .griff/.briff/.sd3p plus MIDI against the same requested score.
- Different meters/tempo/key/seed and lead/bass palm mute (including correct bass
PMP/C0 band). Assert MIDI switches/velocity and native technique fields.
- Missing template: available Riffer natives survive alongside explicit MIDI
fallback for drums; fallback disabled publishes nothing.
- Corrupt/unsupported supplied template, native write/read-back fault, publication
and cleanup failure never become successful fallback or partial publication.
- Real stdio generate calls, profile/schema discovery and EOF from a different
cwd; installed-wheel full native generation with only original test template.
- Read-only genuine local-template acceptance with original generated music;
retain generated evidence only under ignored test artifacts, not source.
Update old standard-default assertions intentionally: explicitly select standard
IDs where testing the old standard behavior, and separately test new target
defaults. Do not weaken expectations to accommodate accidental regression.
Run the complete current suite, Ruff lint/format, strict mypy, pip check and
affected package/installed-server checks.
## Required report
When complete, write your end-of-step report to ./prompts/report_9_fix.md including: what was implemented, test results (pass/fail with details), any issues encountered, and whether you're ready for the next step
Entire report in exactly one plain triple-backtick fence. Include real default
and alias stdio native outputs, original/genuine-template evidence, actual
format/part/profile/tempo/meter/velocity/content checks, atomic failure results,
exact commands/counts, source preservation and remaining application-only limits.
Do not call existing native codecs unavailable because old research was blocked.