feat(core): consume keys.json — song-level key/scale track (loader + WS) - #528
Merged
Conversation
The feedpak spec defines keys.json (instrument-independent key/scale-change
track, §7.7) but core never loaded it. Add it, mirroring the song_timeline /
drum_tab side-file pattern:
- lib/sloppak.py: LoadedSloppak gains a `keys` field; a permissive loader reads
the manifest `keys:` key, path-safety-checks it, and stores a SANITIZED
{version, events:[{t, key, scale?}]} — finite non-bool t (bad-t events dropped,
not rewritten to 0), non-empty string key, optional string scale, sorted.
Missing / unreadable / malformed -> None, never fatal. int-only version
(a float/NaN version can't abort the load).
- server.py: stream a `keys` highway-WS message when present + a `has_keys`
song_info flag so a consumer can light up a key/scale display.
Renderer/HUD surfacing is a thin follow-up; this lands the data plumbing so
the highway, plugins, and the upcoming scale-degree (`sd`) annotation can read
the active key/mode from the WS.
Codex-reviewed (2 rounds: version-int-coercion + bad-t-drop hardening); clean.
+7 loader tests (happy path, absent/permissive variants, sanitize/sort,
non-int-version no-abort). 150 sloppak/load tests pass.
Closes #525. Part of #334.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
byrongamatos
added a commit
that referenced
this pull request
Jun 22, 2026
…cycle (#568) Addresses Codex review of #526/#528: - midi-input discover(): one provider's enumerate() rejection no longer aborts the whole discovery — other providers (e.g. a native/desktop MIDI provider) are still queried; denial is only reported when NO provider enumerates. - Home tour now waits for a 'v3:dashboard-rendered' event (dashboard.js emits it after the #v3-home innerHTML swap) before attaching Shepherd, instead of a single animation frame that could latch onto pre-render nodes the async dashboard render then replaces. - "Play it now" onboarding now arms the tour (armPendingFirstRun) to run the first time the user returns to v3-home, instead of silently never showing it. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The feedpak spec defines
keys.json— a song-level, instrument-independent key/scale-change track (§7.7) — but core never loaded it. This adds it, mirroring thesong_timeline/drum_tabside-file pattern. (Unblocks scale-degreesdin the teaching-marks FEP.)Change
lib/sloppak.py—LoadedSloppakgains akeysfield; a permissive loader reads the manifestkeys:key, path-safety-checks it (no escape), and stores a sanitized{version, events:[{t, key, scale?}]}:t(bad-tevents dropped, not rewritten to 0), non-empty stringkey, optional stringscale, sorted;int-onlyversion(a float/NaNversion can't abort the load);None, never fatal.server.py— streams akeyshighway-WS message when present + ahas_keyssong_info flag so a consumer can light up a key/scale display.Renderer/HUD surfacing is a thin follow-up; this lands the data plumbing so the highway, plugins, and the upcoming
sdannotation can read the active key/mode from the WS.Review
Codex-reviewed (2 rounds — hardened version-int coercion + bad-
tdrop); final pass clean.Tests
+7 loader cases (happy path, absent/permissive variants, sanitize/sort, non-int-version no-abort).
Closes #525. Part of #334.
🤖 Generated with Claude Code