Skip to content

chore: strip editorial boilerplate from synthetic feature fixtures#239

Merged
webern merged 9 commits into
mainfrom
claude/synthetic-strip-editorial-vsvcas
Jun 23, 2026
Merged

chore: strip editorial boilerplate from synthetic feature fixtures#239
webern merged 9 commits into
mainfrom
claude/synthetic-strip-editorial-vsvcas

Conversation

@webern

@webern webern commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

The audit generator stamps <footnote>/<level> editorial onto nearly every synthetic single-feature fixture, but editorial appears in zero real-world corpus files — all 382 editorial-bearing files were under data/synthetic/. That boilerplate implied mx::api needed editorial support it does not actually need for the wild corpus, which is why #236 was closed without merging.

This removes the <footnote>x</footnote>/<level>x</level> boilerplate from every synthetic fixture except the dedicated footnote/level probes, which keep only their own target element. One uniform rule does this safely: the boilerplate is always the plain >x< form, while each probe's target is always attributed (<footnote default-x=...>, <level reference=...>), so deleting the plain form strips the noise everywhere and preserves every probe's intent.

  • 382 fixtures changed (379 stripped fully; the footnote/level probes keep their attributed target)
  • *.features.xml sidecars and corpus.xml regenerated

Testing

  • corert: 832 test cases pass, pinned corpus count unchanged (the now-empty part-groups round-trip)
  • api round-trip regression gate: 38/38
  • Full mxtest: 4268 assertions in 307 test cases (ApiLoadSmokeTest walks every stripped file)
  • No code changes; clang-format not applicable

Notes

While regenerating sidecars, audit files --force also corrected a stale <audited-version> (3.0 → 3.1) in data/custom/segno_coda_roundtrip.3.1.features.xml. That file belongs to #235, so the correction was reverted out of this PR to keep it focused — worth fixing on the #235 branch.

References

webern added 8 commits June 21, 2026 10:17
…suite

Closes #204. Registers segno.{3.0,3.1}.xml and coda.{3.0,3.1}.xml (under
data/synthetic/) in MxFileRepository::initializeNameSubdirectoryMap() so the
api file-walking suite (ApiLoadSurvivalTest) exercises the public
DocumentManager read path over them. The 3.1 variants additionally carry id
and smufl; all four load and yield a part.

segno/coda write fidelity is already covered at the impl layer by the
segnoAndCodaRoundTrip DirectionWriter test (#203).
Adds dedicated minimal fixtures custom/segno_coda_roundtrip.{3.0,3.1}.xml that
isolate the segno/coda surface (3.0 base attributes; 3.1 adds id + smufl) in a
score that round-trips losslessly through the public DocumentManager
createFromFile -> getData -> createFromScore -> writeToStream path, and pins
them in roundtrip-baseline.txt so the test-api-roundtrip CI gate enforces
strict DOM-equal read->write->read for segno and coda.

The audit synthetic/segno.*.xml and synthetic/coda.*.xml probes cannot serve
this gate: they carry editorial part-group/direction children
(footnote/level/voice) the api omits and have no notes (so the api synthesizes
<divisions>), diverging for reasons unrelated to segno/coda. Those remain
covered for load survival via the file-walking suite (previous commit).

Also registers the two fixtures in MxFileRepository and adds their audit
*.features.xml sidecars.
The two custom/segno_coda_roundtrip.{3.0,3.1}.xml fixtures are eligible corpus
files, so the corert pinned-counts case (intentionally fails on count drift)
must be updated. Both round-trip through mx::core cleanly (832 corert cases
pass). Also regenerates the audit data/corpus.xml aggregate (831 total, 442
wild) via 'python3 -m audit all'.
Renames ApiLoadSurvivalTest -> ApiLoadSmokeTest (class, file, display name) and
documents that it only proves a file imports without crashing, not that the data
is correct -- the read->write->read gate is the correctness check. Also adds, in
the fewest lines possible, the data/ corpus invariants that bit this PR's CI:
adding/removing a corpus file requires bumping the CoreRoundtripTest.cpp pinned
count and running 'make audit', and 'make check' is clang-format only.
Per review: every numeric/color attribute now carries a distinct, non-default
value (default-x=1.1, default-y=2.2, relative-x=3.3, relative-y=4.4, font-size
differs per element, color=#12345678 / #9ABCDEF0, halign/valign differ) so a
writer or reader that assigns a value to the wrong attribute is caught instead
of hiding behind uniform 1s and #FF000000. Colors are uppercase per the MusicXML
color schema type. Both variants still round-trip exactly.
Address review feedback: reword the ApiLoadSmokeTest comment so it no
longer says the import 'yields a part' (it asserts a non-empty parts
list), and trim the segno/coda baseline comment to state what the
fixtures are rather than transitory context about other files.
Read and write the editorial-voice <voice> on a <direction> so a direction's
voice assignment survives the api round-trip. It is emitted only when the
direction also writes direction-type content, so a voice carried in from a
figured-bass or harmony element never produces an empty <direction>.

Strip the footnote/level editorial boilerplate from the synthetic segno/coda
fixtures -- no file in the wild corpus uses editorial, so the api does not model
it -- and give each measure a divisions plus a note so it round-trips. Pin the
four fixtures in the api read->write->read gate.
The audit generator stamps <footnote>/<level> onto nearly every synthetic
single-feature fixture, even though editorial appears in zero real-world corpus
files. That noise implied mx::api needed editorial support it does not (see #236,
closed). Remove the <footnote>x</footnote>/<level>x</level> boilerplate from every
synthetic file except the dedicated footnote/level probes, which keep only their
own attributed target. Regenerate the *.features.xml sidecars and corpus.xml.
@webern webern added testing non-breaking fixes or implementation that do not require breaking changes ai Issues opened by, or through, a coding agent. labels Jun 22, 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 ac8922bdc871b8a6a2890b302a9b8ba4b86635bd.

@github-actions

Copy link
Copy Markdown

Coverage report

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

Metric Coverage Covered / Total
Lines 77.8% 28487 / 36624
Functions 74.3% 6349 / 8550
Branches 50.6% 22632 / 44725

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

Metric Coverage Covered / Total
Lines 78.1% 5874 / 7518
Functions 62.1% 1962 / 3159
Branches 47.5% 4956 / 10431

Core HTML report | API HTML report

Commit ac8922bdc871b8a6a2890b302a9b8ba4b86635bd.

@webern webern force-pushed the claude/issue-237-roundtrip-vsvcas branch from 86e5978 to 1366899 Compare June 23, 2026 05:28
Base automatically changed from claude/issue-237-roundtrip-vsvcas to main June 23, 2026 05:29
@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 8f9b9c9ad3c79b1b50c862ba9c4f5f849e920f17.

@github-actions

Copy link
Copy Markdown

Coverage report

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

Metric Coverage Covered / Total
Lines 77.8% 28487 / 36624
Functions 74.3% 6349 / 8550
Branches 50.6% 22632 / 44725

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

Metric Coverage Covered / Total
Lines 78.1% 5874 / 7518
Functions 62.1% 1962 / 3159
Branches 47.5% 4956 / 10431

Core HTML report | API HTML report

Commit 8f9b9c9ad3c79b1b50c862ba9c4f5f849e920f17.

@webern webern merged commit ae1d788 into main Jun 23, 2026
7 checks passed
@webern webern deleted the claude/synthetic-strip-editorial-vsvcas branch June 23, 2026 05:48
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. non-breaking fixes or implementation that do not require breaking changes testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant