Stamp v1 version when converting a v0 config with musica-cli - #983
Merged
Conversation
`musica-cli --convert` parses a v0 config and re-exports it as a v1 document, but the parser stamps the source version (0.0.0 for v0) and export writes it verbatim. Loading the result then routes back to the v0 parser, which fails since the file is v1-structured. Re-label the mechanism as v1 before export, and cover it with a test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #983 +/- ##
==========================================
+ Coverage 71.83% 72.04% +0.20%
==========================================
Files 135 135
Lines 11631 11632 +1
==========================================
+ Hits 8355 8380 +25
+ Misses 3276 3252 -24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
boulderdaze
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
musica-cli --convert <v0-config> -o out.jsonproduces a v1-structured mechanism, but the output is stamped"version": "0.0.0".convert_configurationdoesparse()thenexport(), and the v0 parser stamps the mechanism version as0.0.0. On the next load,Parse()reads that version and dispatches to the v0 parser, which then looks forcamp-filesand fails — the converted file is v1-structured.This blocks the intended workflow of converting a v0 config and embedding the result as an inline
mechanismin a music_box v1 configuration.Fix
Re-label the mechanism as
1.0.0inconvert_configurationbefore export, since the command's job is to emit a v1 document. Added a test asserting the exported file carries"version": "1.0.0".🤖 Generated with Claude Code