Skip to content

docs: finish the audit, and stop --out from silently working - #3

Merged
adiazpar merged 1 commit into
mainfrom
docs/complete-audit
Aug 8, 2026
Merged

docs: finish the audit, and stop --out from silently working#3
adiazpar merged 1 commit into
mainfrom
docs/complete-audit

Conversation

@adiazpar

@adiazpar adiazpar commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2, prompted by the question "did you update ALL documentation?" — the honest
answer was no.

What was stale

docs/ and README.md were rewritten in #2. The surfaces outside them were not, and two
actively contradicted the change:

File Said Reality
PULL_REQUEST_TEMPLATE.md the palette is an input "the user supplies… never something this repo ships" it ships — that checklist item would fail a PR for doing the right thing
PULL_REQUEST_TEMPLATE.md "neither gate moved" there are three byte gates
SECURITY.md reads "a MIDI file you give it, plus two data files you point it at" there are no files to point at
CODEOWNERS guards CI + pyproject.toml as supply-chain-critical the shipped palette is now exactly that, and wasn't guarded

SECURITY.md also gained the threat that replaced the two it lost: the shipped palette holds
identifiers rather than code, so nothing can execute, but a tampered entry silently changes
which sound every note plays and no test can tell that from an intentional edit. tools/
joins CODEOWNERS for the same reason — it is what regenerates that data.

Two behaviours were undocumented anywhere

architecture.md now explains why reading a pitch out of a name is ambiguous — b is both a
note and a flat marker, so play_fluteb4 parses two ways and only the instrument stem settles
it — and why the blank stage carries sixteen persistent integers.

The audit found a live bug

Checking that every documented flag actually exists turned up --out still working. argparse
abbreviates unambiguous prefixes, so --out song.json bound to --out-dir and wrote
song.json/rawmap.json — creating a directory named after the file the user meant to
write. Silent, exit 0. Anyone working from muscle memory or an old note got that.

--out now refuses with the migration it needs, and allow_abbrev=False stops any other flag
binding that way (--but was reaching --button).

README install instructions

It assumed pip install into a system Python — which fails outright on any PEP 668
distribution and pollutes the interpreter everywhere else. There is now a short path and an
isolated path: which folder to cd into, the activation line for each shell, the PowerShell
execution-policy fix, and the thing people actually trip on — activation does not survive
closing the terminal.

Every step was run verbatim from an empty directory before being written down.

How this was checked, not asserted

  • every Python snippet in the docs executed against the installed package
  • every documented CLI flag checked against --help
  • every internal link and anchor resolved
  • stale-claim grep across all 15 tracked text surfaces

130 passed, 4 skipped.

Asked whether ALL documentation was updated, the honest answer was no. The
docs/ tree and README were rewritten; the surfaces outside them were not,
and two of them contradicted the change:

- PULL_REQUEST_TEMPLATE.md told contributors the palette is an input "the
  user supplies from their own installed copy, never something this repo
  ships". It ships. That checklist item would have failed a PR for doing
  the right thing. It also said "neither gate" where there are now three.
- SECURITY.md described the tool as reading "a MIDI file you give it, plus
  two data files you point it at". There are no files to point at, and the
  threat model was missing the surface that replaced them -- the shipped
  palette, which decides what every note resolves to.
- CODEOWNERS guarded the CI workflows and the dependency declaration as
  "supply-chain-critical" but not the shipped data, which is now exactly
  that: identifiers rather than code, so nothing can execute, but a
  tampered entry silently changes which sound every note plays and no test
  can tell that from an intentional edit. tools/ joins it, since that is
  what regenerates the data.

Two behaviours were also undocumented anywhere. architecture.md now
explains why reading a pitch from a name is ambiguous (`b` is both a note
and a flat marker, so `play_fluteb4` parses two ways and only the
instrument stem settles it), and why the blank stage carries sixteen
persistent integers.

**The audit found a live bug, not just stale prose.** Checking that every
documented flag exists turned up `--out` still working: argparse
abbreviates unambiguous prefixes, so `--out song.json` bound to `--out-dir`
and wrote `song.json/rawmap.json` -- creating a DIRECTORY named after the
file the user meant to write, silently, exit 0. Anyone working from muscle
memory or an old note got that. `--out` now refuses with the migration it
needs, and allow_abbrev is off so no other flag binds that way either
(`--but` was reaching `--button`).

README gains real install instructions. It assumed `pip install` into a
system Python, which fails outright on any PEP 668 distribution and
pollutes the interpreter everywhere else. There is now a short path and an
isolated path, with the activation line per shell, the PowerShell
execution-policy fix, and the point people actually trip on -- that
activation does not survive closing the terminal. Every step was run
verbatim from an empty directory before being written down.

Every Python snippet in the docs is now executed against the installed
package, every documented flag checked against --help, and every internal
link and anchor resolved.

130 passed, 4 skipped.
@adiazpar
adiazpar merged commit 22a0c1d into main Aug 8, 2026
3 checks passed
@adiazpar
adiazpar deleted the docs/complete-audit branch August 8, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant