Skip to content

fix: round-trip part-name/print-object instead of forcing print-object="no"#233

Merged
webern merged 1 commit into
mainfrom
claude/fix-227-part-name-print-object
Jun 20, 2026
Merged

fix: round-trip part-name/print-object instead of forcing print-object="no"#233
webern merged 1 commit into
mainfrom
claude/fix-227-part-name-print-object

Conversation

@webern

@webern webern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

mx force-wrote print-object="no" onto every <part-name> / <part-abbreviation>, silently hiding otherwise-visible part names. The 2016 code blamed the MusicXML 2.0 deprecation note, but that note deprecates only the name's formatting attributes (font, color, justify, print-style position) in favor of the *-display elements — not print-object, which is a separate, non-deprecated visibility attribute.

This models name/abbreviation visibility faithfully and handles the deprecation the way mx::api wants it: one model, written to the modern location.

  • print-object is modeled on PartData as a tri-state (namePrintObject / abbreviationPrintObject) and round-tripped faithfully; the forced "no" is gone.
  • Deprecated <part-name> formatting is migrated into the display model on read and emitted only at the non-deprecated *-display elements on write (never back onto <part-name>); a present *-display wins.
  • PartData::effectiveName() / effectiveAbbreviation() give a usable name when <part-name> is empty but a <part-name-display> is present, without mutating the round-tripped fields.
  • The "two places, one model" reasoning is documented in api/PartData.h.

Grows the pinned api round-trip pass-list from 4 to 32 files.

Incidental finding: the generic impl::setPrintObject template is broken (inverted has-check and no api::BoolYesNo conversion, so it always writes "yes"). It is unused for writing elsewhere; this PR uses the manual converter idiom and leaves the helper alone.

Testing

  • mxtest-api-roundtrip regression over the pinned baseline: 32 passed, 0 failed
  • Discovery: 32 PASS (was 4); 28 newly green, including a part-name-display override file (ly41i) and the visible-name case (ly01b)
  • Full mxtest suite: 4126 assertions in 274 cases, all pass
  • clang-format --Werror clean on the changed sources

References

@webern webern added bug software defect non-breaking fixes or implementation that do not require breaking changes area/mx::api area/mx::impl ai Issues opened by, or through, a coding agent. labels Jun 20, 2026 — with Claude
@github-actions

Copy link
Copy Markdown

gen-quality gen/

gen-quality: 84.5 / 100   (floor 84.5, +0.0)

  structure     86.5  x0.50   [fn 90.5 / file 82.6]
  cyclomatic    88.4  x0.25
  cognitive     76.6  x0.25

  409 functions across 31 files, 7702 lines (largest file 1044)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:956    _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      34
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      96
  size       gen/plates/build.py:533    _value_plate                       89
  size       gen/plates/build.py:956    _validate_config_against_ir        89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit 943a54c8887de498f272bde5c31c9f92372eac89.

Base automatically changed from claude/fix-226-encoding-shell to main June 20, 2026 20:59
…t="no" (#227)

mx force-wrote print-object="no" onto every <part-name>/<part-abbreviation>,
silently hiding otherwise-visible part names. The 2016 code justified this with
the MusicXML 2.0 deprecation note, but that note deprecates only the name's
*formatting* attributes (font, color, justify, print-style position) in favor of
the *-display elements -- it says nothing about print-object, which is a separate,
non-deprecated attribute controlling visibility.

- model print-object on PartData as a tri-state (namePrintObject /
  abbreviationPrintObject) and round-trip it faithfully
- stop force-writing print-object="no"
- on read, migrate any deprecated <part-name> formatting into the display model;
  on write, emit name formatting only at the non-deprecated *-display elements
  and never back onto <part-name> (a present *-display wins)
- add PartData::effectiveName()/effectiveAbbreviation() so an empty <part-name>
  with a <part-name-display> still yields a usable name without mutating the
  round-tripped fields
- document the "two places, one model" reasoning in api/PartData.h
- grow the pinned api round-trip pass-list from 4 to 32 files

The three file-based ApiTester baselines whose sources carry print-object="no"
now set namePrintObject to match the (now faithfully modeled) data.
@webern webern force-pushed the claude/fix-227-part-name-print-object branch from a4b9cec to 7c18907 Compare June 20, 2026 21:05
@github-actions

Copy link
Copy Markdown

Coverage report

Core-dev coverage src/private/mx/core/

Metric Coverage Covered / Total
Lines 77.9% 28539 / 36624
Functions 74.4% 6360 / 8550
Branches 50.7% 22672 / 44725

API coverage src/private/mx/{api,impl,utility}/

Metric Coverage Covered / Total
Lines 75.2% 5644 / 7509
Functions 60.1% 1897 / 3159
Branches 45.5% 4736 / 10419

Core HTML report | API HTML report

Commit 943a54c8887de498f272bde5c31c9f92372eac89.

@webern webern merged commit efe5d5d into main Jun 20, 2026
@webern webern deleted the claude/fix-227-part-name-print-object branch June 20, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Issues opened by, or through, a coding agent. area/mx::api area/mx::impl bug software defect non-breaking fixes or implementation that do not require breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: forces print-object="no" on part-name/part-abbreviation, hiding visible names

1 participant