Kid mode 🧒

When Brandon feeds a song into the computer, the computer guesses the song’s key (like “happy C” or “sad A”). For weeks the sheets printed that guess as if it were true — but the guess is only right about 1 out of 4 times. This page finds every chat where that happened and shows the fix: a shared piece of code that now adds a warning and the two keys the computer most often mixes it up with.

The stem chats made the same mistake, over and over

Audit of the past ~3 weeks of stem chats + a fix to the skills · built 2026-07-04
The mistake, in one line: the stem pipeline printed an auto-detected key / BPM as ground truth, with no confidence caveat and without applying the flat-side / relative-key override that a memory rule recorded 44 days ago. Measured accuracy of those keys against the web: 28% exact (see the key-validation report).
8
Stem chats reviewed
4+
Shipped sheets with the mistake
5
Skills that produced it
28%
Key accuracy vs web
1
Shared fix (key_confidence.py)

The stem chats, past ~3 weeks

DateChatStatus
2026-07-03Hooray For Earth — “Racy” IXI analysis + multi-song sheet updatesmistake
2026-07-03Hooray For Earth — “Say Enough” IXI analysismistake
2026-07-03HFE multi-track stem analysis (Racy audit)mistake
2026-07-03IXI sheets audit: tracks missing guitar/bass stemsstem work
2026-07-03HFE-related stems (short session)stem work
2026-07-04Stems-to-MIDI coverage page updates (titles/dates)stem work
2026-07-04Importing chat transcripts for stem processingstem work
2026-07-04Key-detection validation vs web (this fix's trigger)caught it

Where the same mistake shows up (quoted from the shipped sheets)

ArtifactWhat it saidWhy it’s the mistake
HFE “Racy” sheetC minor  ·  129 BPM  ·  4/4Key + BPM printed as established fact in the sheet header. No “detected” qualifier, no confidence, no cross-check.
HFE “Racy” sheet“the form at a glance (97 bars, 4/4, 129 bpm from the chord chart)”The auto-detected BPM is laundered as “from the chord chart” and treated as ground truth in the form table.
HFE “Racy” sheet“the verse states Eb, F, G, Ab low and alone … (b3, 4, 5, b6 against C minor)”The entire scale-degree / modal-color read is built on the unvalidated key. One wrong tonic rotates every degree label.
HFE “Say Enough” sheet“key + chord structure asserted as fact in the shipped HTML”Same pattern, second song. No indication the labels are algorithmic, not verified.

We already knew — the rule existed and the code ignored it

feedback_key_detection_override.md (44 days old) states it plainly: on flat-side / modal rock (Shiner, Failure, Radiohead mid-period, Hooray For Earth, A Perfect Circle), Krumhansl / Aarden / Temperley all agree with each other and all mis-key the same way — toward the subdominant or the relative major over the true tonic — because power-chord rhythm guitar omits the third. The prescribed fix (pass a verified key before trusting cadence counts) was never turned into code. So high “confidence” meant nothing, and three-method agreement was read as reassurance when it is the bias signature.

The 5 skills that produced the mistake — and the fix in each

1. five-stem-song-analyst/analyze_harmonics.py
detect_key_mode() chroma-template, line 160
Mistake: No gate. The detected key then drives every Roman numeral, chord section and scale-degree read in the same file — one wrong key silently rotates the whole analysis.
Fixed: Routes through gate_key(); emits key_caveat + relative/subdominant alternates + low-confidence flag alongside the key.
2. _shared/audio_to_chords.py
estimate_key() Krumhansl-Schmuckler, line 44
Mistake: Manual --key only. When no human passes it, the raw Krumhansl winner is printed as a verified --key for the next tool — the exact contamination path the memory warns about.
Fixed: gate_key() wraps the emit; JSON carries caveat + alternates; the CLI now prints “verify against” the relative/IV if no override.
3. band-book-publish-pipeline/audio_analyze.py
estimate_key() Krumhansl on 30 s, line 75
Mistake: No override path at all. Feeds the book-publish pipeline — the highest-stakes consumer, since a wrong key lands in printed chapters.
Fixed: gate_key(band=song) fires the flat-side flag on named catalogs; song_analysis.json now carries the caveat + alternates.
4. deep-album-analysis/run_album.py
copies harmonics.json key, line 171
Mistake: “provisional” appears only in a code comment; album_overview.md shows a bare Key the chapter step reads as truth.
Fixed: Adds a computed “Key check” column (relative / IV alternates) to album_overview.md unless an analyst.json verified it.
5. music21-bar-harmony/analyze.py
detect_key_methods() all three, line 79
Mistake: Treats three-method agreement as reassurance — but the memory says agreement is the flat-side BIAS SIGNATURE: they agree and are wrong together.
Fixed: gate_key() + an explicit note that agreement is the bias signature; every cadence count now ships with the key caveat.

The fix: one shared gate, wired into all five

New module ~/.claude/skills/_shared/key_confidence.py turns the 44-day-old rule into executable code. gate_key(key, correlation, band=) returns the key plus: a low-confidence flag (Krumhansl correlation below 0.75), a flat-side flag for the named catalogs, the relative + subdominant alternates the detectors most often confuse it with (musically spelled: Eb, Bb, F# minor), and a one-line caveat to embed in any sheet. Every one of the five detectors now routes its key through it, and the coverage dashboard reads the same helper instead of a hand-typed banner.

Verification: key_confidence.py self-test PASS · all 6 edited files py_compile OK · analyze_harmonics.detect_key_mode and music21-bar-harmony.summarize runtime-smoke-tested (gate fields present, override suppresses the caveat). Full audio-pipeline re-run over the HFE catalog is queued, since this pass had no audio inputs loaded.