Summary
Three packages contain let declarations — a thesis violation. Score's core rule: zero let, zero class. All state must be expressed as new values, not mutations.
Locations (from roadmap)
@score/midi — let violations (critical)
@score/cli — play.ts has let violations (high)
@score/components — fm.ts has let violations (high)
How to fix
For each let:
- If it's reassigned → refactor to a pure function that returns the new value, use
const at each assignment site
- If it's a loop variable → use
reduce, map, or recursion instead
- If it's a WebAudioAPI boundary (audio nodes that must mutate) → it's allowed internally but must be documented with a
// AUDIO BOUNDARY — internal mutation permitted comment
Rules
From docs/THESIS_COMPLIANCE.md:
const everywhere — no let, no var
- Functional loops —
map, filter, reduce over for/while
- Mutations at WebAudio boundaries are permitted but must be annotated
Notes
- Run
grep -rn "^\s*let " packages/midi/src packages/cli/src packages/components/src to find all violations
- Each package can be a separate commit
- Must not break existing tests
Good first issue — mechanical refactor, clear rules, good way to learn the codebase's functional style.
Summary
Three packages contain
letdeclarations — a thesis violation. Score's core rule: zerolet, zeroclass. All state must be expressed as new values, not mutations.Locations (from roadmap)
@score/midi—letviolations (critical)@score/cli—play.tshasletviolations (high)@score/components—fm.tshasletviolations (high)How to fix
For each
let:constat each assignment sitereduce,map, or recursion instead// AUDIO BOUNDARY — internal mutation permittedcommentRules
From
docs/THESIS_COMPLIANCE.md:consteverywhere — nolet, novarmap,filter,reduceoverfor/whileNotes
grep -rn "^\s*let " packages/midi/src packages/cli/src packages/components/srcto find all violationsGood first issue — mechanical refactor, clear rules, good way to learn the codebase's functional style.