$ python -m regress run -c config/nirman-git.yaml --open

Did we break a page we didn't touch?

regress screenshots every page of two releases, seeded with the same data, and shows you only what really changed.

Demo run: Nirman's HEAD~5 against main, a redesign in five commits
  1. Self-compareSame build twice, every feature0.0%
  2. Failed9 features, 3.7% to 12.9% of pixels9
  3. AddedPages new since HEAD~53
  4. Realigned5–7 bands per failed page, up to 8 px

Default pass threshold 0.5%

Compare against the last release

Unit and API tests don't look at the page. Instead of an assertion per screen, regress asks one question of every page: what changed since stable?

  1. Same data on both sides

    A seed file is replayed into each version through its public API, idempotently, with post_seed_hooks for aggregation jobs. The new write path gets tested too.

  2. No noise before the diff

    Frozen clock, fixed timezone and locale, no animations, fonts loaded, masks on avatars and timestamps. Proven by comparing a build with itself.

  3. Pages paired by what they are

    pages.yaml names features with candidate routes, so a moved route is still compared. A crawler catches pages nobody listed.

  4. A padding shift isn't a failure

    The page is split into 120 px bands, each aligned within shift_px. Movement is absorbed; a wider card or a missing column is not.

Repeatable screenshots

Every source of run-to-run noise regress removes before it diffs.

NoiseWhat regress does
Relative datesDate.now() frozen to a time that matches the seed data
Timezone, localeFixed per app profile
Animations, caretDurations set to 0, reduced motion, caret hidden
Late data, fontsWait for network idle and document.fonts.ready
Avatars, live timestampsmasks paint them, hide removes them
HiDPI, scrollbarsScale factor 1, scrollbars hidden, service workers blocked

What you get

  • Two ways to get versions: URL mode for two deployed environments, git mode to build two refs locally with the app's own up.sh.
  • Perceptual colour diff with the YIQ metric pixelmatch uses, lone anti-aliasing pixels dropped, and a page that grew still fails.
  • An HTML report with failed pages first, stable, new and diff side by side, and a slider to scrub between versions.
  • CI-ready: summary.json per page and exit code 1 on any failure, so a pipeline can gate a release.
  • Re-diff without recapturing: tune shift_px or thresholds against an old run in seconds.
  • Claude Code skills: /generate-playwright-script explores your running app through the Playwright MCP and writes its profile; /visual-regression runs and summarises a comparison.

Set it up

The repository includes a demo on the Nirman app that builds two refs locally with Docker and the Supabase CLI.

  1. 1

    Clone and install

    A virtualenv with the Python requirements and Playwright's Chromium.

    git clone https://github.com/SreekeshOkky/regress.git && cd regress
    python3 -m venv .venv && .venv/bin/pip install -r requirements.txt && .venv/bin/playwright install chromium
  2. 2

    Run the demo

    Compares two git refs of Nirman and opens the report when it's done.

    .venv/bin/python -m regress run -c config/nirman-git.yaml --open
  3. 3

    Compare two deployed environments

    URL mode for real releases; credentials come from environment variables.

    python -m regress run -c config/my-app-url.yaml --stable https://stable.example.com --new https://new.example.com
  4. 4

    Profile your own app

    In Claude Code, against a running instance. It writes profile.yaml and pages.yaml, then checks itself with a self-compare.

    /generate-playwright-script

Know the limits

It answers one question very well, and only that one.

  • Pixels, not DOM: it shows what changed, not why. The diff points you at the page; you read the commit.
  • Chromium only. Cross-browser differences are out of scope.
  • Live feeds, ads and third-party widgets must be masked, hidden or frozen.
  • Git mode runs the two versions one after another: two build cycles per run.
  • Not a replacement for functional tests.

How it was built

The design, the wrong turns and the measurements are in the write-up.

  1. regress: visual regression between releases with a shift-tolerant diff
  2. AI-first SDLC: why development becomes a loop
esc