jevstrudel.git / tools / measure / CLAUDE.md

For agents, on top of README.md, which they read first.

Notes for agents

Measure after the song, rescore after measuring. A measured: line holds only for the song.js whose hash it records; after editing a song, run nix run .#measure -- --song <theme>/<song> --write, then op-env-run -- node tools/critic/critic.mjs --write --all --song <theme>/<song>, and commit both with the song.

Jev stays unreachable in the measuring tab. The relay is blocked with page.route so the fallbacks play and the numbers describe the song as written. Don't let a measurement call Jev: it would measure one arrangement among many and spend the site's key.

Never a listener's tab. Measuring tabs are headless and pinned to ?session=measure-<pid>-N, unique per run.

Edits are surgical. Only the measured: line is written (setMeasured in website/src/jev/measured.mjs), the same way tools/critic rewrites only its own lines.

Sections are the song's cadence, not its form. A section is .every(N) cycles as written with Jev unreachable, so it matches the song's sections only where the fallback form changes on that cadence. Compare a spec's section promises against the keys the song's form actually uses (its walk fallbacks), not every key in order.

The critic and the page read section totals only. If you add a field to sections, decide whether withoutSectionParts (measured.mjs) and measuredMix (critic.mjs) should carry it: both keep the critic's prompt and every page small.