- docs/playback-flow-test.md: on-device verification checklist for the runtime (stop / rep / next / relative-goto / boundary / manual-override cases). - editor.html + editor-beta.html: graphical "At end" control (loop / next / stop / goto ±N) plus a rep-count input in the arrangement panel, wired through state.rep/state.end -> currentSetup/currentPatch. Authoring is no longer text-field-only. - src/engine.js: patchToSetup now clamps tempo to [5,300] and defaults to a beep:4 lane when no lanes are given, matching the firmware. The editors keep their "no lanes" hint by checking the raw input for a ':' token instead of parsed lanes. - fixtures: tempo-clamp-high + empty-defaults-to-beep now pass on both engines. Suite: 41 pass / 1 known (only the intentional vol/cd host boundary remains). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| adapters | ||
| fixtures | ||
| .gitignore | ||
| README.md | ||
| run.mjs | ||
Track-format conformance tests
Golden-vector suite that pins the track ("program"/"patch") format to a single meaning and checks that both implementations agree:
- web —
src/engine.js - firmware —
pico-cp/app.py
The spec is docs/track-format.md. Any new implementation (e.g. a Rust engine) must pass the
same vectors — that is what keeps "the same groove on the device and in the browser" true.
Run
node tests/run.mjs # table of pass / known-divergence / FAIL per case
node tests/run.mjs -v # also print expected-vs-actual diffs for unexpected failures
Exit code is non-zero on any unexpected failure or round-trip (idempotency) break, so it works as a CI gate.
Layout
fixtures/track-format.json— the vectors. Each hasin(a patch),norm(expected normalized meaning, see spec §5), astatus, and optionalexpectFaillisting impls known to differ today.adapters/js_adapter.mjs— loads the realsrc/engine.jsgrammar (no copy) and normalizes.adapters/py_adapter.py— extracts the realpico-cp/app.pygrammar functions viaast(no copy) and normalizes.run.mjs— runs every vector through both adapters and reports.
Reading the result
✓ pass— implementation matches the spec for that vector.· known— a divergence/feature listed inexpectFail; expected, not a failure.✗ FAIL— an unexpected mismatch (a regression). Investigate.★ fixed— an impl listed inexpectFailnow passes; remove it fromexpectFail.
When you fix a divergence in code, delete that impl from the case's expectFail. When you
implement the new playback-flow tokens (rep / end), those cases flip to pass.