Evidence diffing
A passing run can still hide a broken layout, a missing field, or a latency regression. reflow evidence diff pairs every retained artifact from two runs—screenshots, Browser aria.yaml and macOS accessibility trees, JSON and MCP responses, SQL rows, command output, downloads, motion recordings, and step durations—and reports what changed without requiring stored baselines.
Quickstart
Section titled “Quickstart”Compare any two runs (such as a pull request’s base and head runs, or a run against its reference run) and write visual diff artifacts to a directory:
reflow evidence diff <base-run-id> <head-run-id> --output-dir /tmp/evidence-diffWhen --output-dir is supplied, Reflow writes base, head, and highlighted diff images for every changed screenshot. Use --json for structured machine-readable output.
Served build: different (http://127.0.0.1:3000 executable sha256 changed)Step timing: 1 slower beyond A/A noise expect acme.breadcrumb.item.0: 74 ms -> 4294 ms (58x slower; controls <= 112 ms)
Summary: 2 changed, 1 noise, 9 same, 0 only-base, 0 only-head (3 bookkeeping not compared)
CHANGED snapshots/Invite member/team-invitation/aria.yaml text row "Admin Built-in [20 -> 9]", row "Member Built-in [6 -> 5]"CHANGED snapshots/Invite member/team-invitation/screenshot.png text row "Admin Built-in [20 -> 9]", row "Member Built-in [6 -> 5]" 1.8% pixels changed (largest region 312x48 at 410,224)How artifacts are paired
Section titled “How artifacts are paired”reflow evidence diff, reflow ci report, and the post-apply comparison pair named Browser snapshots by step name and snapshot name using the key snapshots/<step name>/<snapshot name>/<file> (appending #2, #3 when a step repeats a name). Inserting an unrelated step before a snapshot keeps the pair intact rather than producing false only-base and only-head entries, and two different snapshots that land on the same retained path are never compared against each other.
A snapshot without name= (or with the default name snapshot) pairs by retained path and is flagged unnamed. Everything other than named Browser snapshots pairs by its retained path in the run.
What gets compared
Section titled “What gets compared”| Evidence type | Pairing and comparison behavior |
|---|---|
Browser screenshots (screenshot.png) + aria.yaml | Pixel-by-pixel comparison with dense-region detection, #FF00FF mask exclusion, and paired aria.yaml accessibility text diffing. Per-step screenshots are included only with --steps because they often land mid-animation. |
macOS windows + ax/*.json | Compares accessibility node text (ignoring layout) and relative sibling order among common unique identities under the same parent, paired with the window PNG. |
| Structured checkpoints (SQL, CLI, MCP, summaries) | JSON compares value by value and reports changes by JSON pointer (e.g. /items/5/annotations/readOnly: false -> true). JSON embedded in a string (such as an MCP tool result) compares inside it (/text#/total); fenced json blocks in rendered summaries compare under /json-block-1/.... Other text compares line by line. |
| Downloads | Compared by metadata record rather than pixels: prints Download <n> as same or changed with filename, size, and SHA-256 on each side (separate from summary counts; downloads in --json). |
Motion recordings (site.record) | Compared by check verdicts (still, starts, moves, loops, resumes) and whole-second moving/still intervals rather than raw frames. |
| Failed runs | Reported ahead of captures: names the failing step, recorded assertion error (expected vs. received), and unreached steps so checkpoints the failing run never reached are never reported as silent only-base. |
| Bookkeeping artifacts | Files beside screenshots or accessibility snapshots that are not primary evidence are listed explicitly as not compared so a zero-change summary never hides omitted files. |
Filter run-to-run noise with A/A controls
Section titled “Filter run-to-run noise with A/A controls”Run-specific content—clocks, temporary paths, volatile counters—changes even between two runs of the same commit. Pass one or more repeat runs of the same commit as A/A controls (--control or --history) so only differences beyond measured noise are flagged:
reflow evidence diff <base-run-id> <head-run-id> \ --control base=<earlier-base-run-id> \ --control head=<earlier-head-run-id> \ --output-dir /tmp/evidence-diff- Strict noise matching: A difference counts as noise only when a control changed the exact same place and the head value stays within what controls produced there: an observed value, a number within measured drift, or a random token of the same shape (such as a test-data slug or digest of noisy content). A label edit on a line carrying a volatile number stays
CHANGED. - Per-place numeric drift: A stable decimal gets no last-digit tolerance just because controls exist. For example,
196.6 KBbecoming196.7 KBor capacity62.8 GBbecoming62.9 GBremainsCHANGEDwhen controls kept those figures, even beside a drifting free-space readout. A whole number off by one unit that tracks a drifting decimal in the same snapshot is listed explicitly as a possible derived change. - Identity-matched arrays: An array whose items shifted or appeared/disappeared across controls (such as an activity feed) compares by item identity field instead of array index.
- Clock drift vs. time-zone bugs: A wall-clock time that moved across controls is noise only while it tracks elapsed wall time between runs. A clock rendered in the wrong time zone (
Last scan 13:31becoming20:35across runs four minutes apart) staysCHANGED. - Priority ordering: With controls, changed items appear first: changed text first (most differences beyond A/A noise at the top), each followed immediately by its paired changed screenshot, then other changed captures, and finally
pixels onlyredraws (charts, icons, colors, layout) so small data regressions are never buried behind noisy redraws. - Environment parity and failed controls: Supply controls from the same CLI, provider, browser, and viewport; mismatched environments widen noise masks. A failed control still measures noise for steps it passed; its failing step counts only if the primary run failed that same step.
The command inspects evidence only—no baseline is stored, and the caller judges every difference.
Catch latency regressions and stale builds
Section titled “Catch latency regressions and stale builds”Step timing (SLOWER, FASTER, NEAR-TIMEOUT)
Section titled “Step timing (SLOWER, FASTER, NEAR-TIMEOUT)”Step durations are reported separately from capture verdicts because a regression can stall rendering without altering the final frame. Each provider step duration—and each action in a retained macOS executor timeline.json—is compared against the spread observed in --control and --history runs:
SLOWER/FASTER: Reported when duration shifted by more than1 sand more than2×the controls’ largest difference, by more than2×and the square of their largest factor, and beyond the rest of the same run (filtering out host-wide load).NEAR-TIMEOUT: Reported when an action with a recorded timeout reached80%or more of its limit.
For example, expect acme.breadcrumb.item.0: 74 ms -> 4294 ms (58x slower ...) surfaces under Step timing: 1 slower beyond A/A noise even when the capture summary reads 0 changed.
Served build checks
Section titled “Served build checks”When reflow apply admits new work against a loopback target, it records the listening process for each target, granted, and readiness origin: process ID, start time, executable SHA-256, and—for Go binaries—embedded vcs.revision and -cover. Apply prints this under Served build and warns if a compiled server started before the checkout last moved or was built from another commit.
reflow evidence diff compares both runs’ served-build records:
| Status | Meaning |
|---|---|
different | Lists the origins whose listening executable changed between base and head. |
same-process | Warning: the same process instance served both runs (it was never restarted, so code changes in between did not take effect). |
same-executable | Warning: the compiled executable bytes were identical across both runs. |
unknown | Served-build records are stored locally in the applying device’s profile; runs applied on another device compare as unknown. |
Read one observation across matrix base and head
Section titled “Read one observation across matrix base and head”A flow checking a pull request against both builds with matrix: {side: [base, head]} retains observations from each variant (CLI JSON output, SQL rows, MCP results). Use --select <step>[/<file>][#<pointer>] with --request (or --result-file) to isolate and diff that exact observation:
reflow evidence diff side=base side=head --request <apply-request-key> \ --select '4/stdout.txt#/received' \ --control base=<base-rerun-id> --control head=<head-rerun-id>- Selector syntax:
<step>is the step index or recorded step name.<file>selects a retained file (stdout.txt,rows.json,observation.json) across every call directory of that step, or one specific call (call-subclass/stdout.txt).#<pointer>scopes JSON diffing to one JSON Pointer subtree. - Variant selection: Name variants with
--request <apply-request-key>(printed at admission) or--result-file <path>(an apply’s--jsonreceipt):side=base side=head, or'flow [side=base]'when an apply ran multiple matrix flows. Explicit run IDs also work. - Verdicts: Every selected value is classified as
gained(head only),lost(base only),changed,unchanged, ornoise(explained by A/A controls).
gained lost changed unchanged noisevalues 20 2 0 9 0documents 4 1 0 1 (6 selected)
Lost (2 values in 1 document) 2-call-subclass/stdout.txt (/received gone in head; outside /received: /outcome "sent" -> "threw"; -/status 204; -/uri "/scalars"; and 2 more) - /received/x-int64: "7" - /received/x-plain: "plain"Counts appear first, followed by lost, changed, and gained values—one line per document with up to five values each, ordered lost-first. When a call succeeded on base and threw on head (losing its entire selected subtree), the reading summarizes what else shifted outside the pointer. Differences explained by A/A controls appear separately under noise, and documents missing because a step failed read as all lost or all gained while naming that step.
Every reading closes with an audit of what it left out: the selected step’s status on each side (passed, failed, or absent), unselected files in the step, file counts from other steps, and value counts outside the pointer. Pass --json to get the exact run, step, retained path, evidence ID, and JSON pointer for every entry—then inspect source files with get_run_evidence before citing them.
The reading is advisory and never posts automatically. See Matrix runs and parallel execution for running base/head matrices and Pull request code reviews for publishing agent reviews with reflow pr review.
Extract frames from motion recordings
Section titled “Extract frames from motion recordings”Cut full-resolution PNG frames from any retained site.record recording using reflow evidence frames:
reflow evidence frames <run-id> --name hero-player --from 3s --to 6s --output-dir /tmp/heroThis writes frame-<ms>.png files alongside frames.json recording each frame’s changed pixel share. Add --crop x,y,width,height to crop every extracted frame to a single region of interest. See the Browser plugin for all site.record arguments and limits.
Comparison rules and thresholds
Section titled “Comparison rules and thresholds”Pixel regions and small-stroke clusters
Section titled “Pixel regions and small-stroke clusters”- Standard floor: An image is
CHANGEDwhen more than0.5%of its pixels differ, or when a dense local region changed below that global floor (such as one edited text line or metric). Changed regions are listed largest first. - Glyph-sized clusters with A/A controls: A compact cluster of
12–63changed pixels away from measured control noise counts as a small change. - Grouped small strokes (two controls): With two distinct same-size control images, when no standard floor is reached, at least three compact
6–11-pixel components totaling at least24changed pixels within a144×144capture-pixel neighborhood qualify together—each spanning at least2 pxper axis, filling at least25%of its bounding box, and sitting clear of measured noise. Isolated strokes, sparse speckles, and highly fragmented images (>256candidate strokes) do not qualify. - Browser masks: Pixels inside or on the border of a Browser snapshot mask box (solid
#FF00FF) on either side are treated as noise, so a masked element moving or resizing does not trigger a visual change. Masked elements’ text is omitted fromaria.yaml, whereas an element merely overlapped by a mask box retains its text.
Accessibility trees, sibling order, and render-only classification
Section titled “Accessibility trees, sibling order, and render-only classification”- Text normalization: Clock times and opaque identifiers are normalized in accessibility diffs; computed product values (durations, sizes, counts) compare as captured, so
took 2 sbecomingtook 0 minisCHANGED. - Sibling order: JSON accessibility snapshots with captured node paths compare relative sibling order among common unique identities under the same identifiable parent. Stable order reversals remain
CHANGEDeven with identical pixels (reporting captured tree order, not a verified screen-reader sequence). Only child pairs whose order varied in an A/A control or history pair count as order noise. Absolute indices, JSON key order, inserted/removed children, and ambiguous identities never invent reorderings; groups with more than200children report as order uncompared. - Unchanged reported AX node areas: When a changed accessibility snapshot includes lines whose reported node boxes kept identical pixels in the paired window capture, those lines appear below primary changes under
changes with unchanged reported AX node areaswith visibility marked unconfirmed (virtual AX frames may not locate drawn glyphs). Unchanged area pixels alone never classify lines as A/A noise, and the mixed snapshot remainsCHANGED. - Render-only window captures: A window capture whose paired accessibility tree is unchanged reads
render-onlywhen changed pixels sit beside A/A noise or within a trusted text redraw (fitting a text frame at most96capture pixels tall—roughly two lines—whose frame pixels actually changed when A/A controls altered text). At least64changed pixels more than4 pxaway from measured noise stay a drawn change unless explained by a trusted text redraw. Changes to non-text drawings (gauges, charts, icons, ink color shifts) or unmodeled clocks/IDs stayCHANGED.
Normalized structured context
Section titled “Normalized structured context”In JSON and structured text diffs, digests, durations, and counts compare strictly; only UUIDs and wall-clock timestamps are normalized (and still counted). On an already CHANGED structured artifact, bounded normalized JSON leaf changes appear beneath actual changes under normalized differences as captured (context only; excluded from verdict)—showing, for example, a timestamp alongside a changed output hash—while artifacts containing only SAME or NOISE rolling timestamps stay quiet.