feat(song): wire caged + guideTones chord-template fields (§6.6) - #544
Merged
Merged
Conversation
Mirror the voicing field for the two deferred FEP #24 harmony annotations on ChordTemplate: - caged: str ("C"/"A"/"G"/"E"/"D", "" = unset) - guideTones: list[int] (semitone offsets 0..11 above the root, [] = unset) Both are default-omitted on the wire and sanitized on decode (caged enum-guarded, guideTones filtered to in-range ints, rejecting bool) so a malformed value can't round-trip. GP import is untouched — GP carries no CAGED / guide-tone data. Teaching annotations only; never fed to a grader. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
byrongamatos
force-pushed
the
feat/template-caged-guidetones-wire
branch
from
June 21, 2026 09:51
914bee7 to
cbb2e6d
Compare
byrongamatos
added a commit
that referenced
this pull request
Jun 21, 2026
…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 #334. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13 tasks
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.
Part of #334
First of three stacked PRs completing the deferred FEP #24 pair (
caged+guideTones), mirroring the already-shippedvoicingfield end-to-end.What this PR does (core wire)
lib/song.py:ChordTemplatedataclass: addcaged: str = ""andguideTones: list = field(default_factory=list)next tovoicing.chord_template_to_wire: emitcaged/guideTonesonly when non-empty (default-omitted, likevoicing).arrangement_from_wiredecoder: sanitize on the way in —cagedaccepted only when it's one ofC/A/G/E/D, else""(_sanitize_caged).guideToneskept only as int entries in0..11, dropping non-ints (bool rejected — it's an int subclass) and out-of-range values (_sanitize_guide_tones). A malformed value can't round-trip.voicing).Teaching annotations only — not wired into any scoring / NoteVerifier path.
Tests
tests/test_song.py— for each field, mirrors the threevoicingtests: round-trip, omit-when-default, and malformed-tolerance (parametrized).Verified locally
pytest tests/test_song.py→ 153 passed (incl. 9 new).(CI may be red on infra; the above is what I verified locally.)
🤖 Generated with Claude Code