Skip to content

fix(gui): thesis — replace let with const in @score/midi, @score/cli, @score/components #129

@bwyard

Description

@bwyard

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/midilet violations (critical)
  • @score/cliplay.ts has let violations (high)
  • @score/componentsfm.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions