Skip to content

Stamp v1 version when converting a v0 config with musica-cli - #983

Merged
K20shores merged 3 commits into
mainfrom
convert-stamp-v1-version
Jul 24, 2026
Merged

Stamp v1 version when converting a v0 config with musica-cli#983
K20shores merged 3 commits into
mainfrom
convert-stamp-v1-version

Conversation

@K20shores

@K20shores K20shores commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Problem

musica-cli --convert <v0-config> -o out.json produces a v1-structured mechanism, but the output is stamped "version": "0.0.0". convert_configuration does parse() then export(), and the v0 parser stamps the mechanism version as 0.0.0. On the next load, Parse() reads that version and dispatches to the v0 parser, which then looks for camp-files and fails — the converted file is v1-structured.

This blocks the intended workflow of converting a v0 config and embedding the result as an inline mechanism in a music_box v1 configuration.

Fix

Re-label the mechanism as 1.0.0 in convert_configuration before export, since the command's job is to emit a v1 document. Added a test asserting the exported file carries "version": "1.0.0".

Note: fully round-tripping a v0 config to a loadable v1 mechanism also needs the companion v0-parser fixes in NCAR/MechanismConfiguration#309 (diffusion coefficient, merged) and NCAR/MechanismConfiguration#310 (THIRD_BODY, per-reaction gas phase, surface-name prefix). This PR addresses only the version stamp.

🤖 Generated with Claude Code

`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>
@K20shores
K20shores requested a review from boulderdaze July 24, 2026 15:44
@codecov-commenter

codecov-commenter commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.04%. Comparing base (0e9e356) to head (3ce0943).

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     
Flag Coverage Δ
cpp_fortran 62.96% <ø> (ø)
javascript 94.59% <ø> (ø)
python 74.18% <100.00%> (+0.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@K20shores
K20shores merged commit a3d61a1 into main Jul 24, 2026
52 checks passed
@K20shores
K20shores deleted the convert-stamp-v1-version branch July 24, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants