Skip to content

fix(audit): stop presenting a guess as the change being proposed - #27

Merged
adamXbot merged 1 commit into
mainfrom
fix/suggestions-are-not-patches
Sep 1, 2026
Merged

adamXbot merged 1 commit into
mainfrom
fix/suggestions-are-not-patches

Conversation

@adamXbot

@adamXbot adamXbot commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

report() rendered RENAMED and SIMILAR through the same loop, in the same before/after diff shape, separated only by a colour that --no-colour strips. In a CI pull request body that leaves one word telling a reader which findings were applied and which are guesses — and the guess arrives pre-formatted as a patch, ready to paste.

The case

WhiteSur's weekly watch opened three pull requests this week, one per channel, each advertising:

  SIMILAR  #placesToolbar  →  #PlacesToolbar
           no exact match; closest live name is #PlacesToolbar

    chrome/WhiteSur/parts/places.css:116
    - #placesToolbar {
    + #PlacesToolbar {

directly beneath the RENAMED block it had applied, in identical formatting. Those are different elements in different documents — the Library window's toolbar in places.xhtml, and the browser window's bookmarks toolbar in browser.xhtml. Applying it would have moved Library styling onto the bookmarks bar.

Nothing applied it: write_patch only emits renamed, and the attached patch was the unrelated fix alone. But it was recommended, three times, in the shape of a change already made.

Three changes

A near-miss finding now carries replacement_home — the document the suggested name actually lives in. The pack has always known; nothing asked it. This is the line that makes the whole class of error self-evident:

  SIMILAR  #placesToolbar  →  #PlacesToolbar  (a guess, not applied)
           no exact match; closest live name is #PlacesToolbar
           #PlacesToolbar belongs to browser.xhtml
           check what reads that name before using it -- a close
           spelling can belong to an unrelated element

    chrome/WhiteSur/parts/places.css:116
      #placesToolbar {

Suggestions no longer render as a diff. The current line is shown unadorned. The +/- shape is the thing that invites a paste.

The watch template splits the body — the applied patch under its own heading, the full report folded into a <details>, so suggestions read as context rather than as part of the proposal.

Not changed

Which findings are produced, and how exact matches are handled: still a diff, still patched. Verified byte-identical against WhiteSur on Firefox 153 — same RENAMED block, same generated patch.

263 unit tests. The new ones pin that an exact match still renders as a diff, that a guess does not, that it says it was not applied, that it names the replacement's document, and that the two remain distinguishable with colour stripped.

Note

0.20.0 already reclassifies this particular finding as healthy, so the #placesToolbar suggestion is gone from WhiteSur regardless. This is about the next near-miss, whatever it turns out to be.

🤖 Generated with Claude Code

`report()` rendered RENAMED and SIMILAR through the same loop, in the same
before/after diff shape, separated only by a colour that `--no-colour`
strips. In a CI pull request body that left one word telling a reader which
findings had been applied and which were guesses -- and the guess arrived
pre-formatted as a patch, ready to paste.

WhiteSur is the case. Its weekly watch opened three pull requests, one per
channel, each advertising `#placesToolbar` -> `#PlacesToolbar` in that
format. They are different elements in different documents: the Library
window's toolbar in places.xhtml, and the browser window's bookmarks toolbar
in browser.xhtml. Applying it would have moved Library styling onto the
bookmarks bar. Nothing applied it -- write_patch only emits `renamed` -- but
it was recommended, three times, in the same shape as the real fix.

Three changes, none of which touch which findings are produced:

  - A near-miss finding now carries `replacement_home`, the document the
    suggested name actually lives in. The pack already knew; nothing asked
    it. "#PlacesToolbar belongs to browser.xhtml" is the single line that
    makes this class of error self-evident.
  - Suggestions no longer render as a diff. The current line is shown
    unadorned, marked "(a guess, not applied)", with a note to check what
    reads the replacement first. The +/- shape is what invites the paste.
  - The watch template puts the applied patch under its own heading and
    folds the full report into a <details>, so suggestions read as context
    rather than as part of the proposal.

Exact matches are untouched: still a diff, still patched, byte-identical
output verified against WhiteSur on Firefox 153.

Co-Authored-By: Claude Fable 5 <[email protected]>
@adamXbot
adamXbot force-pushed the fix/suggestions-are-not-patches branch from 6287341 to b778d52 Compare September 1, 2026 06:09
@adamXbot
adamXbot merged commit 6e65e18 into main Sep 1, 2026
10 checks passed
@adamXbot
adamXbot deleted the fix/suggestions-are-not-patches branch September 1, 2026 06:22
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