fix: a note is reported once per thing it says, not once per file - #73
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 neitherverifynorcleanupcan ever read.TestARunSaysWhenItsManifestWillBeTooBigToReadBackproves the sentence is printed. It could not prove anybody would see it.Measured
note:linesThe 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 groupingTestANoteAboutOneFileStillNamesThatFileFirst- 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 wasTestTheUnnamedRemainderCarriesTheRightNoun- four files with three named leaves1 file not named here, the one count where the plural is visibly wrongThe manifest does not change, and that was measured
The binary before and after, same recipe and seed, same relative output directory:
generated_atandrun.idThe first comparison reported a difference and that was my instrument: the two runs wrote to different directories, so
run.commanddiffered. 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.addandnoteGroup.line- flattened rather than raised - and it reads better for it.Four mutations, all caught, three repointed after the flattening.
preflight --quickgreen on all 12.🤖 Generated with Claude Code