Repository navigation
Accepted differences and --rerun-failed - #14
Merged
Merged
Conversation
--accept "<reason>" records each band, region and size difference of the run in renderdiff.accepted.json (next to the config, or in cwd), scoped by the run's routes and widths. Later runs report a shot whose every change matches as accepted: its own summary line, no threshold failure, a results.json flag and a report badge. Stale entries are listed and pruned by the next --accept over them. --rerun-failed keeps the out dir, reruns only shots that weren't clean or accepted, and merges them back in route and width order; a run that doesn't repeat the previous one exits 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fingerprint a change by a hash of every pixel under it (4 bits a channel) instead of a 4x4 mean-colour grid, and require the elements an entry recorded to be named again, so a same-size, same-tone redraw surfaces. - Never accept a shot whose padding no band or region covers (width delta, or a height delta that didn't align); the size fingerprint is gone. - Leave accepted shots out of summary.mean/worst, the --progress summary and the report's aggregate line. - Hash the resolved config, hook and locate sources included, into meta.config, and refuse --rerun-failed when it changed. - --accept re-reads the file before writing, merges, sorts by route then width, writes through a temp file and rename, and skips the write when nothing changed. - Document that meta describes the rerun, not the reused shots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
For the migration loop: record what already differs between the untouched local build and prod, change code, re-check only what's red.
--accept "<reason>"Runs as usual, then writes every difference not yet accepted to
renderdiff.accepted.json, next to the config file (or in cwd without one). Each entry has the route (as the summary names it), the width, a fingerprint and the reason.Why this UX: there's no new filter syntax. You scope an accept the way you scope any run, by passing only those routes and
--widths. One flag both records and prunes: the stale entries for the routes and widths the run measured are dropped. The file has one entry per line, so committing it gives a reviewable diff of what was accepted and why.On later runs:
accepted. It goes on anaccepted:line likeclean:, and it doesn't count toward "routes differ", the verdict's worst, or--threshold."accepted": trueinresults.json(each matched band or region carries its reason, and the summary hasacceptedandstale) and a badge in the report.1 accepted, and itsdomline skips the accepted changes.stale accepted:line, insummary.stale, and in a report section.Fingerprint
There is one fingerprint per band or region, so an accepted header change can't hide a new footer change. Two changes match when all of these hold:
x,wandh: regions on the 16px grid, bands as exact rows.yis left out, so a change above can push it down the page;domelements, the same elements with the same changed values. An unprobed or timed-out run doesn't match.A shot is never accepted if its widths differ, or if its heights differ without the rows aligning into bands. That padding belongs to no band or region, so no fingerprint covers it.
The tradeoff is false alarms over hidden changes. Noise that crosses a 4-bit step, a probe timeout, or a new change that re-aligns repeated rows all make an accepted change show up again. The remaining blind spot is a shade change under one step that crosses no step boundary. The README documents this.
--rerun-failedresults.jsonin--outand keeps every shot that is clean or accepted, checked against the accepted file as it is now.results.jsonandreport.htmlin route/width order.rerun: N shot(s) on R route(s), M reused, U route(s) untouched.meta.config, a hash of the resolved config including hook andlocatesources), and whenresults.jsonis missing.--acceptand--rerun-failedare rejected together with--dry-run.Tests
tests/visual/accepted.test.tsincludes controls for:--acceptthat prunes;Docs: small, self-contained additions to the README (a new section plus two table rows), SKILL.md (one paragraph) and reference.md (triage rows, a rationalization, gotchas).
🤖 Generated with Claude Code