feat(opsl): accept OPSL 0.3 artifacts alongside 0.2 #3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/opsl-0.3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Phase 4a of OPSL alignment: bring Pedalboard3's OPSL reader/exporter up to
spec with OPSL 0.3.0 (vendored from
opsl-public@730919c, tagv0.3.0),while continuing to accept existing 0.2 artifacts.
docs/opsl/schemas/(device,movemap.layout, movemap.bundle, and the new movemap.session) byte-exact
from
v0.3.0, with aVERSIONmarker file (v0.3.0 730919c).OpslReadernow acceptsschema_version"0.2"/"0.2.x"and"0.3"/"0.3.x"(previously"0.2"exact-match only); anything elsestill hits the existing hard-error path.
OpslDeviceExporternow stamps exported documents withschema_version: "0.3".(optional
canonical_id/transforms/param tags, device rolescapture/derived, top-levelx-extension fields) beyond the versiongate itself — the existing non-throwing, forward-compatible parse policy
already handles them.
OpslAdapter::Protocol,OpslBinding::AddressType,OpslAdapter::Direction,OpslSlotBinding::Role/Action, orOpslTransformSpec::Typeenums.Nothing in the codebase branches on these beyond "is it
unknown", sothere's no functional benefit, and a near-miss while investigating
OpslTransformSpec::Typeshowed widening it would make behaviorworse (an unimplemented type would silently fall back to a linear
transform instead of explicitly warning). New 0.3 vocabulary (e.g. the
sysex_bulkadapter protocol used by real hardware devices) stilldecodes to
unknownwith an explicit warning, by design.Testing
Built and ran via the documented CLAUDE.md workflow:
Result: 72 OPSL test cases, 1775 assertions, all passing.
Also ran the full suite to check for collateral damage:
Result: 390/391 test cases pass. The one failure
("Push 2 display transport emits framed RGB565 payloads with row padding
and xor") is pre-existing and unrelated — confirmed via
git log/git diffthat this branch touches none oftests/push2_surface_test.cpp,src/Push2DisplayTransport.{h,cpp}, andthat file was last changed by an unrelated commit on
main.CTest is also wired up (
catch_discover_tests) and confirms the sameOPSL coverage independently:
(note: the filter is case-sensitive and test names are
OPSL ...,uppercase —
-R opslmatches nothing). Result: 62/62 CTest-registeredOPSL tests pass.
New fixtures added under
tests/fixtures/opsl/:legacy-0.2-o1nk-device.json— 0.2 back-compat (byte-exact fromopsl-public).
access-virus.pad.device.json— a real 0.3 hardware device (role: "patch",kind: "hardware") exercisingmanufacturer_id,bulk_state, lineage, and the as-yet-unmodeledsysex_bulkprotocol(byte-exact from opsl-public).
device-with-extension.json— same device plus a top-levelx-toolextension field, to assert extensions are inert (byte-exact from
opsl-public).
The four existing shared o1nk/toilville fixtures had only their
schema_versionbumped in place to"0.3", rather than being replacedwholesale with upstream's versions: upstream's
v0.3.0examples fix twocorpus quirks (a dangling
select_pagetarget and a fader role) thatexisting
OpslReaderTest/OpslControlSurfaceMapTestcases specificallyassert as regression coverage for malformed-input handling. JSON Schema
doesn't enforce those cross-artifact invariants, so the fixtures remain
fully schema-conformant under 0.3 with just the version bump.
New
OpslReaderTestcases cover: the version gate's accept/rejectboundaries (0.2, 0.2.x, 0.3, 0.3.x accepted; 0.1/0.4/garbage rejected), a
0.2 document still loading, the hardware device loading with exactly the
one expected
sysex_bulkwarning, thex-field being ignored (noadditional warnings/param changes vs. the same fixture without it), a
document omitting
canonical_id/transforms/tags loading cleanly, anddevices with
capture/derivedroles loading.This branch also carries a one-commit prerequisite fix
(
cmake/CPM.cmakebeing force-included despite the repo's*.cmake.gitignore glob) that three sibling branches — including the in-flight
codex/integrate-pending-20260920— had each independently rediscoveredand fixed identically; without it,
cmake --preset releasecannotconfigure from a fresh clone/worktree at all.
Impact Statement
existing OPSL reader/exporter/catalog/control-surface tests continue to
pass unmodified except for 3 assertions that intentionally now expect
"0.3"instead of"0.2"as the exporter's emitted schema version.OpslReader's public surface isunchanged;
kSupportedSchemaVersionis replaced bykCurrentSchemaVersion("0.3") andkMinimumSupportedSchemaVersion("0.2"). Any external caller referencing the old constant name will
need to update.
docs/opsl/schemas/*.schema.jsonupdated to v0.3.0verbatim;
movemap.session.schema.jsonadded (not yet consumed by anyC++ reader — parsing that artifact kind is out of scope for this PR).
schema_version: "0.3". This is self-consistent (the exporter's actualoutput already satisfied the stricter parts of the 0.2 schema and
continues to satisfy 0.3), but any downstream consumer that
exact-matches on
"0.2"should be checked.non-conformance relative to the formal schema is pre-existing and
unchanged by this PR (documented in
docs/opsl/README.md).corpus-quirk fixtures used in mapping regression tests were
deliberately kept as-is (only re-versioned), not replaced.
to load exactly as before; only documents declaring an unsupported
version (0.1, 0.4, non-numeric, etc.) are rejected, same as before.
Docs
docs/opsl/README.mdrewritten to describe: v0.3.0 provenance(
opsl-public@730919c), the 0.2/0.3 version gate, the reader'shard-error/warning/silence policy, which 0.3-only fields remain
unmodeled at the C++ layer (
lineage,shape_hash,state_hash,manufacturer_id,revision,plugin_format,program_location,bulk_state,opaque_state, and themovemap.sessionartifact kindentirely), and the pre-existing OSC-protocol/exporter schema caveat.