Skip to content

Mask flags, exit 1 on any diff, area page ceiling, base-build reference in the skill - #31

Merged
tmashara merged 5 commits into
mainfrom
feedback-fixes
Oct 29, 2026
Merged

tmashara merged 5 commits into
mainfrom
feedback-fixes

Conversation

@tmashara

@tmashara tmashara commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Fixes from the field feedback on a real CSS-cleanup run (friction items 1, 3, 4 and 6). One commit per change.

⚠️ Breaking: any difference now exits 1

Before, a diff exited 0 unless --threshold was set. Now any shot that differs and isn't accepted exits 1. --threshold <0..1> relaxes that to scores below it, and --threshold 0 never fails on a difference.

  • CI. A job that ran without threshold and relied on a diff passing will now fail. Set threshold: "0" to keep report-only behaviour.
  • Scripts and agents. Anything that treated exit 0 as "ran fine" must now also accept 1.
  • What still exits 0. Accepted differences, including the run that records them with --accept. The exception is a difference that can't be accepted (unstable pixels beside it, a width change, or a height change whose rows don't align): that exits 1 even on the --accept run. A shot whose only problem is unstable pixels or a failed asset also exits 0, as before; it still gets its own row.

The help text, README, action.yml, docs/github-action.md, docs/accepted.md and the skill are all updated. The action's exit-1 verdict now reads "❌ Visual change", and the Renovate recipe no longer needs threshold: "1".

Changes

  1. --mask <sel> and --mask-media.

    • --mask is repeatable. Each one adds a mask on every route, after the config's masks.
    • --mask-media, or config maskMedia: true, adds a preset mask for iframe, video, .vjs-text-track-display.
    • Both reuse the existing mask plumbing, so they're listed in the report and covered by the --rerun-failed config hash.
    • Validation: a missing or empty value is rejected, and maskMedia must be a boolean.
  2. Exit code. Described above.

  3. Skill.

    • When the base can be built, the default reference is now base build vs change build, both local. Production is a second pass.
    • New step: after the baseline, mask whatever differs base vs base, then rerun.
  4. Area ceiling.

    • The 40,000px height ceiling is now a pixel-area ceiling of 1440 × 40,000. A 375px-wide page can be about 153,600px tall, so long pages at narrow widths are no longer dropped.
    • The ceiling never drops below 40,000px, so widths past 1440 lose nothing.
    • The error message names both the size and the limit.
  5. results.json. summary.differing counts the unaccepted shots that have any differing pixel, which is what the default exit 1 checks.

Tests

  • New fixtures: media and long.
  • New tests cover --mask, --mask-media, the maskMedia validation, the exit codes (including --threshold 0) and the area ceiling.
  • Tests that asserted exit 0 on runs that differ now assert 1.
  • npm run lint, format:check, typecheck and test:all all pass locally (on a Mac).

🤖 Generated with Claude Code

tmashara and others added 5 commits October 29, 2026 10:15
--mask (repeatable) adds a mask on every route after the config's masks.
--mask-media, or config maskMedia: true, masks iframe, video and
.vjs-text-track-display, the per-load noise a real run kept explaining away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A diff used to exit 0 unless --threshold was set, a footgun in CI and for
agents. Now any shot that differs and isn't accepted exits 1; --threshold
relaxes that to scores below it, and --threshold 0 never fails on one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the base can be built, compare it locally against the change, with
production as a second pass; production mixed in drift, one-sided embeds and
CSP errors. After the baseline, mask whatever differs base vs base, then rerun.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 40,000px height ceiling dropped legitimate long pages at narrow widths.
It only exists to bound the stitched image, so it now bounds width × height
at 1440 × 40,000 px: a 375px-wide page may be about 153,600px tall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The area ceiling now never drops below 40,000px, so widths past 1440 lose
nothing. results.json's summary gains `differing`, the count the default exit
code uses. A whitespace-only --mask is rejected, and the docs say a difference
that can't be accepted exits 1 even on the --accept run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmashara
tmashara merged commit b60730a into main Oct 29, 2026
3 checks passed
@tmashara tmashara mentioned this pull request Oct 29, 2026
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