feedBack/lib
Bret Mogilefsky b0338849f8
feat(core): read .jsonc data files (strip C-style comments) (feedpak-spec §8)
feedpak-spec §8 (FEP #3 / PR #13) allows .jsonc files (JSON with C-style
// line and /* */ block comments) anywhere .json is specified. A Reader MUST
strip comments before parsing. Core's sloppak/feedpak readers parsed every
side file with bare json.loads, so a .jsonc arrangement / notation / drum_tab
/ song_timeline / lyrics / keys would fail to load.

- lib/jsonc.py (new): shared parse_jsonc(text) + load_json(path). String-aware
  regex (mirrors the spec reference validator in feedpak-spec/tools/validate.py)
  — keeps comment-like text inside JSON string literals. load_json auto-detects
  .jsonc by suffix; plain .json goes straight through json.loads.
- lib/sloppak.py: import load_json; replace the 6 json.loads(...read_text...)
  side-file read sites (arrangement, notation, drum_tab, song_timeline,
  lyrics, keys) with load_json(<path>). Removed the now-unused `import json`.
- scripts/lift_keys_notation.py: import load_json; replace the 3 read sites
  (song_timeline, arrangement beats fallback, arrangement lift). `import json`
  stays (json.dumps write at the notation sidecar emit).

Additive (MINOR) change: older readers parse .jsonc as plain JSON and ignore
comments via the spec's forward-compatibility rules, so no existing pack needs
regeneration.

Tests: tests/test_sloppak_jsonc_load.py (16 tests) — parse_jsonc unit cases
(line/block/multiline/string-boundary/malformed/plain), and end-to-end loads
for all 6 side-file types via .jsonc with comments, plus the lift helper
reading .jsonc song_timeline + .jsonc arrangement beats, plus the
string-boundary preservation rule through the full loader. 122 sloppak/lift
tests pass.
2026-06-20 14:10:04 -07:00
..
audio.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
diagnostics_bundle.py Clean release snapshot 2026-06-16 18:47:13 +02:00
diagnostics_hardware.py Clean release snapshot 2026-06-16 18:47:13 +02:00
diagnostics_redact.py Fix two regressions in the terminology purge 2026-06-16 21:19:16 +02:00
drums.py Clean release snapshot 2026-06-16 18:47:13 +02:00
gp2midi.py Clean release snapshot 2026-06-16 18:47:13 +02:00
gp2notation.py feat(core): adopt feedpak_version — read on load + stamp on manifest writes (spec §4) (#530) 2026-06-20 21:59:04 +02:00
gp2rs_gpx.py feat(gp): extract GP chord-diagram fingerings + GP8 chord names (E3) (#522) 2026-06-20 20:44:45 +02:00
gp2rs.py fix(gp): GP5 chord enrichment — gate on diagram-matches-played + decouple name/fingers (#523) 2026-06-20 21:04:12 +02:00
gp8_audio_sync.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
gp_autosync.py Clean release snapshot 2026-06-16 18:47:13 +02:00
jsonc.py feat(core): read .jsonc data files (strip C-style comments) (feedpak-spec §8) 2026-06-20 14:10:04 -07:00
logging_setup.py Clean release snapshot 2026-06-16 18:47:13 +02:00
loosefolder.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
lyrics_transcribe.py Clean release snapshot 2026-06-16 18:47:13 +02:00
midi_import.py Clean release snapshot 2026-06-16 18:47:13 +02:00
notation_lift.py Clean release snapshot 2026-06-16 18:47:13 +02:00
notation.py Clean release snapshot 2026-06-16 18:47:13 +02:00
progression.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
safepath.py Clean release snapshot 2026-06-16 18:47:13 +02:00
scan_worker.py Clean release snapshot 2026-06-16 18:47:13 +02:00
sloppak.py feat(core): read .jsonc data files (strip C-style comments) (feedpak-spec §8) 2026-06-20 14:10:04 -07:00
song_score.py Clean release snapshot 2026-06-16 18:47:13 +02:00
song.py feat(core): consume song_timeline tempos + time_signatures + per-chart tempos (feedpak 1.2.0) (#529) 2026-06-20 21:35:07 +02:00
songmeta.py feat(core): adopt feedpak_version — read on load + stamp on manifest writes (spec §4) (#530) 2026-06-20 21:59:04 +02:00
tailwind_rebuild.py Clean release snapshot 2026-06-16 18:47:13 +02:00
tones.py Clean release snapshot 2026-06-16 18:47:13 +02:00
tunings.py Clean release snapshot 2026-06-16 18:47:13 +02:00
vocal_pitch.py Repoint dead slopsmith URLs -> got-feedback 2026-06-17 11:02:04 +02:00
wem_decode.py Improve wording in terminology cleanup 2026-06-16 19:43:45 +01:00
xp.py Clean release snapshot 2026-06-16 18:47:13 +02:00