Skip to content

fix: a note is reported once per thing it says, not once per file - #73

Merged
donislawdev merged 1 commit into
mainfrom
stability/grouped-notes
Sep 6, 2026
Merged

fix: a note is reported once per thing it says, not once per file#73
donislawdev merged 1 commit into
mainfrom
stability/grouped-notes

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

Stability report finding T7. Reproduced on today's tree before fixing.

What was wrong

A run of 25 000 one-byte text files emitted 25 001 note: lines on stderr, one per file, every one of them the same sentence about the label not fitting. The advice was per file for a decision that is per target.

That is a stability question rather than a cosmetic one because of what it buried. A run whose manifest will be too big for this build to read back warns about it first, in a note: line typographically identical to the 25 000 that follow it - and that warning is the only thing standing between somebody and a directory neither verify nor cleanup can ever read.

TestARunSaysWhenItsManifestWillBeTooBigToReadBack proves the sentence is printed. It could not prove anybody would see it.

Measured

before after
stderr lines 25 003 4
note: lines 25 001 2
note: 25000 files: The label needs 32 B and the file is 1 B, so this file carries
no label. Its name and the manifest still identify it. Named: files_0001.txt,
files_0002.txt, files_0003.txt. 24997 files not named here.

The same reasoning was already applied in this tree - the progress bar is throttled to 10 Hz and silent when stderr is not a terminal, because "thousands of redrawn lines in a CI log are worse than no bar" (cli/progress.go). Notes had not had it applied to them.

Three guards, and the second is the sharp one

  • TestNotesAreGroupedByWhatTheySayRatherThanOneLinePerFile - the grouping
  • TestANoteAboutOneFileStillNamesThatFileFirst - a note about one file still leads with that file's name. Grouping that dropped the name would pass every count and example check in the first guard while making the common case worse than it was
  • TestTheUnnamedRemainderCarriesTheRightNoun - four files with three named leaves 1 file not named here, the one count where the plural is visibly wrong

The manifest does not change, and that was measured

The binary before and after, same recipe and seed, same relative output directory:

  • manifest identical apart from generated_at and run.id
  • 40 notes over 40 files still stored per entry
  • all 40 generated files byte for byte the same

The first comparison reported a difference and that was my instrument: the two runs wrote to different directories, so run.command differed. Worth recording, because it is the shape that would have had me hunting a regression that was not there.

Ratchet

The first version pushed the nesting ratchet from 51 to 52. Split into noteGroups.add and noteGroup.line - flattened rather than raised - and it reads better for it.

Four mutations, all caught, three repointed after the flattening. preflight --quick green on all 12.

🤖 Generated with Claude Code

A run of 25 000 one byte text files emitted 25 001 "note:" lines on stderr,
one per file, every one of them the same sentence about the label not fitting.
The advice was per file for a decision that is per target.

That is a stability question rather than a cosmetic one because of what it
buried. A run whose manifest will be too big for this build to read back warns
about it first, in a "note:" line typographically identical to the 25 000 that
follow it - and that warning is the only thing standing between somebody and a
directory that neither verify nor cleanup can ever read.
TestARunSaysWhenItsManifestWillBeTooBigToReadBack proves the sentence is
printed. It could not prove anybody would see it.

Measured: 25 003 stderr lines become 4, and 25 001 notes become 2.

The same reasoning was already applied to the progress bar, which is throttled
and silent when stderr is not a terminal because "thousands of redrawn lines in
a CI log are worse than no bar". Notes had not had it applied to them.

A note about a single file still leads with that file's name. That is the
sharper of the three guards: grouping that dropped the name would pass every
count and example check while making the common case worse than it was.

The manifest does not change, and that was measured rather than reasoned
about - the binary before and after, same recipe and seed and the same relative
output directory: manifest identical apart from generated_at and run.id, 40
notes over 40 files still stored, all 40 files byte for byte the same. The
first comparison reported a difference and that was my instrument: the two runs
wrote to different directories, so run.command differed.

Split into noteGroups.add and noteGroup.line because the ratchet on nesting
went from 51 to 52. Flattened rather than raised, and it reads better for it.

Four mutations, all caught, three of them repointed after the flattening.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@donislawdev
donislawdev merged commit b176bd4 into main Sep 6, 2026
18 checks passed
@donislawdev
donislawdev deleted the stability/grouped-notes branch September 6, 2026 20:07
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