Skip to content

feat: report non-fatal translation diagnostics - #437

Merged
webern merged 2 commits into
m/mxdev-errinfofrom
m/mxdev-errwarn
Sep 16, 2026
Merged

webern merged 2 commits into
m/mxdev-errinfofrom
m/mxdev-errwarn

Conversation

@webern

@webern webern commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

Adds an optional Diagnostics collector to the getScore, intoScore, and fromScore translation APIs. Callers can inspect reports after a call or receive them synchronously through a handler while fatal failures remain in Result.

The first reports cover two existing recoveries: an out-of-range time-signature staff number being applied to all staves, and an octave-shift stop with no matching start using the MusicXML default size of 8. Diagnostics carry score locations and have a canonical formatter. More than 16 concurrent numbered spanners remains fatal, but now returns a located tooManyElements error instead of an unlocated internal error.

Testing

  • Diagnostics tests: 55 assertions in 7 test cases
  • make api-test: 5580 assertions in 617 test cases
  • make api-roundtrip: 414 passed, 0 failed
  • make test-all
  • make wasm-test
  • make fmt

References

@webern
webern added this pull request to stack #438 September 16, 2026 08:40
@webern webern added the feature new feature request label Sep 16, 2026
@webern webern changed the title feat: report non-fatal translation diagnostics (#432) feat: report non-fatal translation diagnostics Sep 16, 2026
@webern webern added api Affects the mx::api layer ai Issues opened by, or through, a coding agent. design Not a simple fix. Requires design decisions. labels Sep 16, 2026
Comment thread .agents/skills/mx-api-doctrine/SKILL.md Outdated
Comment thread src/include/mx/api/Diagnostics.h Outdated
Comment thread src/include/mx/api/MusicXml.h
Comment thread src/private/mx/api/LocationFormatting.cpp Outdated
Comment thread src/private/mx/impl/DiagnosticsContext.h Outdated
Comment thread src/private/mx/impl/ScoreReader.cpp Outdated
Comment thread src/private/mx/impl/SpannerResolver.cpp
Comment thread src/private/mx/impl/MeasureReader.cpp Outdated
@webern
webern marked this pull request as ready for review September 16, 2026 13:15
@webern
webern merged commit 30d48d3 into main Sep 16, 2026
8 checks passed
@webern
webern deleted the m/mxdev-errwarn branch September 16, 2026 17:08
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. api Affects the mx::api layer design Not a simple fix. Requires design decisions. feature new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant