← All decisions jacob@stephens.page
Decision Record

A pixel-equality gate over diff review for changes to generated markup

ADR 0010 · Accepted · in production · ~428 words

Context

Sometimes you have to change a frozen, machine-generated front end - a static-site-generator export whose source is long gone - that ships as hundreds of kilobytes of inlined, normalized markup per page. It's full of sharp edges: non-breaking-space entities vs literal characters, en-spaces vs regular spaces, attribute casing the browser silently rewrites, indentation and whitespace that have drifted per page.

The default safety mechanism for any code change is reading the diff in review. Here that gives false confidence in both directions: a textual change that looks alarming (entity vs character) usually renders identically, while a change that looks inert can shift layout. You can't meaningfully read this markup - so you can't certify a change by reading its diff. The problem sharpens when an automated agent is generating the edits at volume.

Decision

Gate promotion on rendered-output equality, not on reading the diff.

Consequences

When I'd revisit

Markup you actually own and can read (plain diff review is fine and cheaper); highly dynamic or personalized pages where "the same render" isn't well-defined; or changes whose whole point is visual, where a human comparing intentionally-different screenshots is the right reviewer.

Narrative writeup: Letting an AI Agent Modernize a Frozen Legacy Site, Safely. One of a set of architecture decision records. Source markdown lives in the infrastructure-patterns repo, which is the canonical copy.