Skip to content

api: round-trip injects implied default elements: <type> <line> <voice> <staff> #228

Description

@webern

Surfaced by the reworked round-trip classifier (PR #225; part of #212).

What

The api writer materializes elements the source left implicit, so the output has more of them than the input:

  • <type> on notes that had none — extra <type> in lysuite/ly41d_StaffGroups_Nested.xml
  • <line> under <clef> where the source omitted it — lysuite/ly12a_Clefs.xml
  • <voice> where the source had none — mjbsuite/ChordDirectionPlacement.xml (expected: no <voice>; actual: <voice>1</voice>)
  • <staff> where the source had none — lysuite/ly02e_Rests_NoType.xml

Related (same family, but never the sole blocker of a file): add:divisions (392) and add:attributes (359) — the writer also materializes implied containers.

Impact (reorder-free candidate files; 550 total)

  • add:type 233, add:voice 29, add:line 27, add:staff 1

Decision

Per #214: decide per element whether the api should suppress these when the source omitted them, or whether injecting an implied default is acceptable and should be normalized away in comparison. This is the opposite direction from #219 (which tracks elements being dropped).

Repro

make dump-api-roundtrip && make classify-api-roundtrip
# build/api/classified.json: signatures add:type / add:line / add:voice / add:staff

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiIssues opened by, or through, a coding agent.area/mx::apiarea/mx::implbugsoftware defect

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions