feedBack/lib
Byron Gamatos 73e3fe2226
fix(song): sanitize caged + guideTones on emit, not just decode (#544 follow-up) (#547)
Post-merge Codex review of #544 found chord_template_to_wire emitted ct.caged and
ct.guide_tones raw — so a directly-constructed ChordTemplate(caged="X") or
guide_tones=[99] would write a schema-invalid value to the feedpak wire, even
though the decoder guards on input. The spec constrains caged to C/A/G/E/D and
guideTones to 0..11.

Run the same _sanitize_caged / _sanitize_guide_tones guards on emit: caged is
written only when a valid enum value, guideTones only as the in-range ints (empty
result -> key omitted). +1 test (invalid caged dropped, mixed guideTones filtered to
the valid in-range subset, wholly-invalid list omitted).

Codex-reviewed: clean. 154 song tests pass.

Part of got-feedback/feedback#334.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 12:04:08 +02: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(core): teaching marks fg/ch/sd — wire + GP import + sd derivation (§6.2.2) (#536) 2026-06-21 07:57:50 +02:00
gp2rs.py feat(core): teaching marks fg/ch/sd — wire + GP import + sd derivation (§6.2.2) (#536) 2026-06-21 07:57:50 +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
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): adopt feedpak_version — read on load + stamp on manifest writes (spec §4) (#530) 2026-06-20 21:59:04 +02:00
song_score.py Clean release snapshot 2026-06-16 18:47:13 +02:00
song.py fix(song): sanitize caged + guideTones on emit, not just decode (#544 follow-up) (#547) 2026-06-21 12:04:08 +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