Skip to content

Snapshots and review

A snapshot is the evidence a command retains. It might be a browser screen, a terminal’s output or a set of database rows. Your agent compares that evidence with an earlier run and checks the change against your application’s rules. Reflow stores no approved baseline: a difference never fails a run, and the agent judges whether it is an expected change or a regression.

Ask your agent:

Add snapshots at the points that explain this journey. Run it, inspect the changed screens and outputs, and fix regressions within the scope of my change. Show me the evidence and anything still unresolved before preparing the PR.

Use a named browser snapshot after the relevant assertion:

site.expect selector="[data-testid=invitation-form]"
site.snapshot name="team-invitation" selector="[data-testid=invitation-form]"

This Browser snapshot command is the visual checkpoint. It retains screenshot.png, the page text aria.yaml, state.json and render.md under plugins/<step>/<call>-<binding>-snapshot/. Capturing compares nothing and cannot fail on a visual difference.

Scope each snapshot tightly, so that a difference means something:

  • name= always. The name is what pairs the same snapshot across runs.
  • selector= captures one visible element with stable bounds instead of the viewport. Missing or ambiguous targets fail without a viewport fallback.
  • mask= covers regions that change for good reasons, such as a timestamp; mask_optional= does the same for elements that may be absent.
site.snapshot name="hero" selector="#hero" mask=".timestamp"

See the Browser plugin for all capture arguments, timeouts and animation behavior.

Here the invitation form still exists, so the assertion passes. The screenshot shows that its role selector disappeared during a copy change.

changes#482 Update invitation copy copy/invitations

run 3

a41c9e2CI ↗ 3 flows queued running3 passed12 unchanged
  1. waitingrunningpassed
  2. Invite a teammate3 steps · not started3/3 · 3.3s
  3. Sign in4 steps · not started4/4 · 2.1s
  4. Change the billing plan5 steps · not started5/5 · 4.8s
  5. unchanged · 12
  6. not run again; earlier results carried over
flows/invite-member.md · read onlynot run yet7 lines passed
  1. ---
  2. title: Invite a teammate
  3. providers:
  4. ui: {use: Browser, binding: site}
  5. ---
  6. # Invite a teammate
  7. An owner invites a teammate and chooses their role before the invitation is sent.
  8. ## Open team settings
  9. The workspace owner opens the team page.
  10. ```rfl step="Open team settings"
  11. ```
  12. ## Open the invitation form
  13. The invitation form offers an email address and a role.
  14. ```rfl step="Open the invitation form"
  15. ```
  16. ## Send the invitation
  17. The teammate appears as a pending invitation with the chosen role.
  18. ```rfl step="Send the invitation"
  19. ```

waitingrunningpassedInvite a teammate

An owner invites a teammate and chooses their role before the invitation is sent.

not started · 3 steps planned following live viewing step passed · 3.3s · earlier run: main, 2 days ago

1 · Open team settings

not startedrunningpassed · 1.3s

The workspace owner opens the team page.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

EARLIER RUNmain · 2 days ago
this runNOW
What this step didWhat this step doesWhat this step does

line 161 of 2

Opened /settings/team

ui.open url="/settings/team"
Status
passed
Time
took 1.2s, starting 0ms into the step

line 172 of 2

Kept the snapshot team-members

ui.snapshot name="team-members"
Status
passed
Time
took 140ms, starting 1.2s into the step
What it kept · team-members
this run
heading “Team”
button “Invite member”
table: 3 rows (Owner, Editor, Viewer)

2 · Open the invitation form

not startedrunningpassed · 580ms

The invitation form offers an email address and a role.

This step has not started. What it keeps appears here when it ends.

running: Open the invitation form. The picture is the page after step 1, Open team settings.
EARLIER RUNmain · 2 days ago
this runNOW
What this step didWhat this step doesWhat this step does

line 251 of 2

Clicked “Invite member”

ui.click selector="[data-testid=invite-member]"
Status
passed
Time
took 420ms, starting 0ms into the step
Target
[data-testid=invite-member]matched 1 element

line 262 of 2

Kept the snapshot team-invitation

ui.snapshot name="team-invitation" selector="[data-testid=invitation-form]"
Status
passed
Time
took 160ms, starting 420ms into the step
Target
[data-testid=invitation-form]matched 1 element
What it kept · team-invitation
earlier run · main
heading “Invite a teammate”
text “Add someone to your workspace.”
textbox “Email address”
combobox “Role”: Editor
button “Send invitation”
this run
heading “Invite a teammate”
text “Invite someone to work with you in Acme.”
textbox “Email address”
button “Send invitation”

3 · Send the invitation

not startedrunningpassed · 1.4s

The teammate appears as a pending invitation with the chosen role.

This step has not started. What it keeps appears here when it ends.

running: Send the invitation. The picture is the page after step 2, Open the invitation form.
EARLIER RUNmain · 2 days ago
this runNOW
What this step didWhat this step doesWhat this step does

line 341 of 3

Filled “Email address” with sam@acme.test

ui.fill selector="[name=email]" value="sam@acme.test"
Status
passed
Time
took 310ms, starting 0ms into the step
Target
[name=email]matched 1 element

line 352 of 3

Clicked “Send invitation”

ui.click selector="[data-testid=send-invitation]"
Status
passed
Time
took 890ms, starting 310ms into the step
Target
[data-testid=send-invitation]matched 1 element

line 363 of 3

Kept the snapshot invitation-sent

ui.snapshot name="invitation-sent"
Status
passed
Time
took 150ms, starting 1.2s into the step
What it kept · invitation-sent
earlier run · main
status “Invitation sent to sam@acme.test”
row “sam@acme.test”: Pending · Editor
this run
status “Invitation sent to sam@acme.test”
row “sam@acme.test”: Pending · Member
Agent reviewon pull request #482Outside scope

The role selector disappeared.

This pull request changes invitation copy. The form no longer offers a role, and the invitation went out as Member where the earlier run on main sent Editor. Owners still need to choose a role before sending an invitation.

knowledge · team-access.md
← → steps · 1 2 3 earlier / split / nowThe agent compares the two runs and judges; Reflow keeps what each step saw.

A screenshot shows one moment. To verify that an element plays, loops, starts on scroll, or stays still, record it with site.record and assert on frame changes:

site.record (
name="hero-player"
selector="#hero-player"
duration=20000
actions=json(
[{"at": 0, "scroll": 0.3, "as": "peek"}, {"at": 3000, "scroll": 1, "as": "show"}]
)
expect=json(
{
"still": {"from": 1500, "to": "show"},
"starts": {"after": "show", "within": 1500},
"moves": {"after": "show", "for": 5000}
}
)
)

site.record captures the target element at 5 fps (configurable from 1–10 fps), runs timed scroll or click entries in actions, and judges expect purely from frame-to-frame pixel differences:

CheckHolds when
stillNothing changed between from and to.
startsThe first change after after arrives within within ms (and not before notBefore, if set).
movesAfter that first change, motion continues for for ms with no pause longer than gap.
loopsTwo frames from the first pass reappear in order within within (after standing still for hold, if set).
resumesThe frame after one action matches the frame before another.

Any unmet or undecidable check (a limit within two frame intervals of a change, an off-screen element, or a recording ending early) fails the step with guidance on what to adjust.

Each recording retains its artifacts under plugins/<step>/<call>-<binding>-record/:

  • screenshot.png — 12-frame contact sheet above a per-frame pixel-change chart.
  • clip.png — real-timing animated PNG (with off-screen cards and an END OF RECORDING closing card).
  • recording.json — per-sample measurements and check verdicts.
  • frames/*.png — full-resolution key frames (such as frames/first-change.png).

Extract any full-size time range or cropped box from a retained recording:

Terminal window
reflow evidence frames <run-id> --name hero-player --from 3s --to 6s --output-dir /tmp/hero

This writes frame-<ms>.png files plus frames.json with each frame’s changed share; add --crop x,y,width,height to crop every frame to one region. reflow evidence diff compares two recordings by verdicts and whole-second moving/still intervals rather than raw pixels. Recordings run in bundled Chromium; see the Browser plugin for all arguments and limits, and Evidence diffing for full reflow evidence frames options.

LocalBash and DockerUbuntu retain command results, including standard output, standard error and exit status. Wrap an application CLI command in a flow:

worker.bash command="./bin/fulfill order-1042"

Command output is retained automatically, without a terminal screenshot command. Here both versions exit successfully, but one stops returning tracking information. See LocalBash or DockerUbuntu for connection settings, command arguments and file capture.

changes#604 Batch carrier requests perf/carrier-batching

run 4

5b0f7a2CI ↗ 3 flows queued running3 passed6 unchanged
  1. waitingrunningpassed
  2. Dispatch a paid order2 steps · not started2/2 · 1.9s
  3. Cancel before dispatch3 steps · not started3/3 · 1.7s
  4. Split shipment4 steps · not started4/4 · 5.2s
  5. unchanged · 6
  6. not run again; earlier results carried over
flows/fulfill-order.md · read onlynot run yet2 lines passed
  1. ---
  2. title: Dispatch a paid order
  3. providers:
  4. worker: {use: LocalBash, binding: fulfilment}
  5. ---
  6. # Dispatch a paid order
  7. The fulfilment worker dispatches a paid order and returns the tracking number the shipment notification links to.
  8. ## Seed a paid order
  9. A paid order 1042 is waiting for fulfilment.
  10. ```rfl step="Seed a paid order"
  11. ```
  12. ## Run the fulfilment worker
  13. The worker dispatches the order and prints what it did. Reflow keeps stdout, stderr and the exit code.
  14. ```rfl step="Run the fulfilment worker"
  15. ```

waitingrunningpassedDispatch a paid order

The fulfilment worker dispatches a paid order and returns the tracking number the shipment notification links to.

not started · 2 steps planned following live viewing step passed · 1.9s · earlier run: main, 2 days ago

1 · Seed a paid order

not startedrunningpassed · 610ms

A paid order 1042 is waiting for fulfilment.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

THIS RUNstdout.txt
order 1042 created
status: paid
What this step didWhat this step doesWhat this step does

line 161 of 1

Ran ./bin/seed-order 1042 --paid, exit 0

worker.bash command="./bin/seed-order 1042 --paid"
Status
passed
Time
took 610ms, starting 0ms into the step

2 · Run the fulfilment worker

not startedrunningpassed · 1.3s

The worker dispatches the order and prints what it did. Reflow keeps stdout, stderr and the exit code.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

EARLIER RUNmain · 2 days ago
order: 1042
status: dispatched
tracking_number: TRK-1042

exit 0 · stderr.txt empty
THIS RUNstdout.txt · exit 0
order: 1042
status: dispatched

exit 0 · stderr.txt empty
What this step didWhat this step doesWhat this step does

line 241 of 1

Ran ./bin/fulfill order-1042, exit 0; kept fulfill-order

worker.bash command="./bin/fulfill order-1042" checkpoint="fulfill-order"
Status
passed
Time
took 1.3s, starting 0ms into the step
What it kept · fulfill-order
earlier run · main
order: 1042
status: dispatched
tracking_number: TRK-1042

exit 0 · stderr.txt empty
this run
order: 1042
status: dispatched

exit 0 · stderr.txt empty
Agent reviewon pull request #604Outside scope

The tracking number is missing.

Both runs exit 0 and the worker still reports dispatched, but it no longer returns a tracking number: the earlier run on main printed TRK-1042, this run prints none. Can the shipment notification still include a tracking link?

← → stepsThe agent compares the two runs and judges; Reflow keeps what each step saw.

A query can capture the business state behind the screen:

db.query sql="SELECT id, status, refunded FROM orders ORDER BY id" key="id" checkpoint="orders"

Use a unique, non-null key for stable row ordering. The snapshot retains query rows; your agent relates the difference to the application’s refund rules. See SQL: PostgreSQL and ClickHouse for setup, limits and write controls.

changes#517 Round refund amounts in the ledger fix/refund-rounding

run 2

c93e1d4CI ↗ 3 flows queued running3 passed9 unchanged
  1. waitingrunningpassed
  2. Refund an order in full2 steps · not started2/2 · 960ms
  3. Partial refund3 steps · not started3/3 · 2.6s
  4. Monthly ledger export2 steps · not started2/2 · 3.9s
  5. unchanged · 9
  6. not run again; earlier results carried over
flows/refund-order.md · read onlynot run yet2 lines passed
  1. ---
  2. title: Refund an order in full
  3. providers:
  4. worker: {use: LocalBash, binding: shop}
  5. db: {use: PostgreSQL, binding: orders-test}
  6. ---
  7. # Refund an order in full
  8. A support agent refunds order 1042 in full, and the order row records the whole payment returned.
  9. ## Refund order 1042
  10. The shop refunds the whole payment for order 1042.
  11. ```rfl step="Refund order 1042"
  12. ```
  13. ## Read the order rows
  14. A read-only query keeps the orders around the refund, keyed by id.
  15. ```rfl step="Read the order rows"
  16. ```

waitingrunningpassedRefund an order in full

A support agent refunds order 1042 in full, and the order row records the whole payment returned.

not started · 2 steps planned following live viewing step passed · 960ms · earlier run: main, 2 days ago

1 · Refund order 1042

not startedrunningpassed · 840ms

The shop refunds the whole payment for order 1042.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

THIS RUNstdout.txt
order 1042: refund issued
kind: full
What this step didWhat this step doesWhat this step does

line 171 of 1

Ran ./bin/refund-order 1042 --full, exit 0

worker.bash command="./bin/refund-order 1042 --full"
Status
passed
Time
took 840ms, starting 0ms into the step

2 · Read the order rows

not startedrunningpassed · 120ms

A read-only query keeps the orders around the refund, keyed by id.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

EARLIER RUNmain · 2 days ago
idstatusrefunded
1041paid0.00
1042refunded25.00
1043paid0.00
THIS RUNorders · 3 rows
idstatusrefunded
1041paid0.00
1042refunded20.00
1043paid0.00
What this step didWhat this step doesWhat this step does

line 251 of 1

Kept 3 rows as orders

db.query sql="SELECT id, status, refunded FROM orders ORDER BY id" key="id" checkpoint="orders"
Status
passed
Time
took 120ms, starting 0ms into the step
What it kept · orders
earlier run · main
id     status    refunded
1041   paid      0.00
1042   refunded  25.00
1043   paid      0.00
3 rows · key id · amounts in USD
this run
id     status    refunded
1041   paid      0.00
1042   refunded  20.00
1043   paid      0.00
3 rows · key id · amounts in USD
Agent reviewon pull request #517In scope

The order says refunded. $5.00 is missing.

Full refunds return the entire $25.00 payment. The rows this run kept show $20.00 returned for order 1042, where the earlier run on main returned 25.00. Check the refund amount before merging.

knowledge · refunds.md
← → stepsThe agent compares the two runs and judges; Reflow keeps what each step saw.
CommandRetained evidence
site.snapshot name="…" selector="…"A named screenshot of one element; omit selector for the viewport.
worker.bash command="…"Command output, errors and exit status.
db.query … checkpoint="…"Query result rows.
Custom plugin commandThe state and artifacts declared by that provider.

These are command excerpts. Declare aliases and binding names in your flow, and initialize the application plugin lock; see Write a flow. Use list_plugins to inspect the installed command schemas. Every plugin invocation returns a terminal snapshot, but only some commands capture a screen or a named review checkpoint. A click’s result does not replace an intentional screenshot of the outcome.

To show the state around a step’s action side by side in the dashboard’s step inspector, give exactly one call before the action checkpoint="before" and one call after it checkpoint="after", for example the same worker.bash or db.query. Each call keeps its usual view (command, exit status, output, rows), and screenshots both calls retain under the same name compare in a slider.

Browser steps (compact Browser statements, Browser plugin calls such as site.click or TypeScript) also keep a fresh screenshot from just before their action once a page is open, unless the run is private or nearly out of time. Without one, the inspector shows the previous step’s screenshot labelled as a stand-in; a prerequisite or a flow’s first step has no before screen. A step that passes before anything has opened a page (the browser is still on about:blank, for example after API-only site.script calls) keeps no screenshot: the inspector and the step’s tile say that no page had loaded. A failed step keeps its screenshot either way.

Terminal window
reflow plan
reflow apply
reflow status
reflow dashboard

When earlier steps or covered source files change, the next plan automatically includes affected steps and their dependents. Apply runs that work. An unchanged, completed step can reuse its evidence; you do not need to taint it after every edit. A flow with a Browser step is the exception: when any of its steps must run, the whole flow replays from its first step, because its browser closed with the earlier run. Only a failed run held with reflow apply --hold continues from the failed step.

If the external application changed without a source or input change, request fresh evidence with reflow taint flow-name, then plan and apply. Your agent can select flow-name#step-name to start from a particular step; Reflow also includes affected dependents. In a flow with a Browser step that means every step from the first, to open the browser again.

A difference is a question for your agent to investigate. It can update an obsolete test or fix a product regression, rerun the affected work and show the resulting delta. See Repair and rerun for that workflow.

Reflow stores no baseline, and nothing approves one. After reflow apply reaches terminal, each succeeded run that executed steps itself has its snapshots compared with a reference run of the same flow, and each real difference is reported.

A difference never fails the run: ok, outcome and the exit code are unchanged. The calling agent looks at both images and judges whether the difference is an expected change or a regression.

In this order:

  1. base_run: when apply was given --ci-context with a base_sha, the run at that pull request base commit, else the newest run on an ancestor of it.
  2. default_branch: the most recent succeeded run of the same flow whose commit is reachable from the repository’s default branch (origin/HEAD, else origin/main or origin/master, else local main or master). This is tested locally with git; nothing is fetched.
  3. previous_run: otherwise, the most recent earlier succeeded run on another commit than this checkout’s. This may be the agent’s own earlier pass, so judge it with that in mind.

The run itself and other runs of the same apply never qualify.

A run stands for its commit only when its working tree was clean. An apply from a checkout with uncommitted changes records its commit as <sha>+dirty, which never qualifies as a base_run or default_branch reference; it can still serve as a previous_run marked reference.dirty: true. reference.same_commit: true indicates the reference ran on the checkout’s own commit, so with uncommitted changes it may be the caller’s own earlier pass.

The human output has one short block per flow with differences. It names the step and snapshot, the share of pixels that differ, and the command that shows both images:

Terminal window
reflow evidence diff <reference-run-id> <this-run-id> --output-dir /tmp/evidence-diff

Through MCP, use get_run_evidence with each run ID and the evidence_id.

In reflow apply --json, each entry of runs[] may carry an additive visual object:

visual: {
status: "compared" | "no_reference" | "no_snapshots" | "unavailable",
reason?: string,
reference: { run_id, source: "default_branch" | "base_run" | "previous_run",
commit_sha, finished_at, same_commit?: true, dirty?: true } | null,
limits: { channelThreshold: 32, ratioFloor: 0.005 },
compared: number, same: number, // snapshots both runs have; those that match
to_judge: number, // differences.length, including one-sided ones
judgement_required: boolean,
differences: [{ step, snapshot, unnamed?: true,
verdict: "changed" | "only-reference" | "only-head" | "uncompared",
ratio, changedPixels, region, extent, text_changed, text_changes?: string[],
reference: { evidence_id, path, sha256 } | null,
head: { evidence_id, path, sha256 } | null }]
}
StatusMeaning
comparedThe snapshots were compared; differences lists each one that differs.
no_referenceThe flow has no qualifying earlier passing run, for example on its first passing run.
no_snapshotsThe flow takes no snapshot.
unavailableThe comparison did not happen: the backend does not yet list reference runs, a read failed, or the 30 second bound for the whole apply was reached. reason says which. Never read it as “same”.

Through MCP, manage_execution apply returns at admission. The same visual object, with visual_next_action when a judgement is required, is on manage_execution action: "run" for a succeeded run’s compact read (no details). Pass visual_compare: false to skip it.

No comparison happens for --no-wait, for a cancelled or errored apply, for a fully reused run, inside a coverage session, or for reflow ci run: reflow ci report compares each flow with its run in the baseline CI run instead. reflow apply --no-visual-compare skips it.

Reflow stores no verdict. The agent states, for each difference, whether it is an expected change or a regression, and why, in its own report. Inside a change review it adds the same as a note with the review_changes annotate action.

A passing run can still show a broken screen, a missing field, or a latency regression. To compare all retained captures between any two runs—such as a base run and a head run, or a run against its reference run—run:

Terminal window
reflow evidence diff <base-run-id> <head-run-id> --output-dir /tmp/evidence-diff

reflow evidence diff pairs named Browser snapshots by step and snapshot name (snapshots/<step name>/<snapshot name>/<file>) and compares:

  • Visual and accessibility captures: pixel diffs, dense-region detection, #FF00FF mask exclusions, Browser aria.yaml, and macOS ax/*.json node text and sibling order.
  • Structured checkpoints and downloads: JSON pointer diffs across SQL rows, CLI output, MCP tool calls, and rendered summaries, plus download metadata (filename, size, SHA-256).
  • A/A noise filtering (--control / --history): suppresses volatile clocks, temporary paths, and measured drift so changed text and real regressions rank first.
  • Step timing and served builds: flags SLOWER / NEAR-TIMEOUT steps and warns when same-process or same-executable loopback servers answered both runs.
  • Matrix observations (--request + --select): isolates one JSON pointer across side=base and side=head variants.

See Evidence diffing for complete flags, A/A control rules, matrix --select readings, reflow evidence frames, and comparison thresholds. When ready to share findings with reviewers, embed captures in a Review app or post keyed inline comments with Pull request code reviews.

flowKey is the exact key declared in the comparison inventory: inspect base.checks[].key or head.checks[].key (and matching runs[].key). It is not implicitly a flow slug, UUID, file path or display name. An inventory can use login-smoke as its key; use that string only when the inventory actually declares it.

For a storyboard screen bound to that check, set flowKey: "login-smoke" and checkpoint: "org-home" only if that check captures a snapshot named org-home. checkpoint uses the authored snapshot name (the capture’s displayName in comparison reads), not the step label. Provider captures also expose a retained internal name, such as provider_snapshot:<hash>; an exact internal name is accepted too. The name must identify at most one capture on each side of the selected flow. A step move can change the internal key between sides; the storyboard retains both originals as a before/after pair. Repeated names within one side, or a name that also matches another capture’s internal key on that side, are ambiguous. Use unique snapshot names or an unambiguous internal key; Reflow never picks the first matching capture.

The review distinguishes a flow outside the comparison, a checkpoint missing from a selected flow, an ambiguous name, and an unavailable retained screenshot.

Omit both fields when no existing inventory check and named capture are known. A storyboard binding maps review evidence; it does not create a test or prove the flow ran.

get_run_evidence lists provider screenshots using the authored checkpoint name, step, and invocation number whenever the retained Browser manifest records the name. Multiple captures with the same name retain separate evidence IDs. Missing or unreadable metadata falls back to a step/call label without preventing image access, and labels never alter image identity or checksum verification.

For volatile timestamps or branch labels, author a CSS mask on site.snapshot. See Browser snapshots for exact syntax and pixel behavior. A mask hides those pixels from comparison; it does not judge a difference elsewhere in the capture.

A change comparison uses the frozen knowledge reviews explicitly selected as knowledge.base and knowledge.head; the application’s current knowledge root is not attached automatically. Include the storyboard document in each review’s selected paths to show it alongside the retained captures.

Each selected knowledge review must have a repository label matching the comparison and a non-null gitCommit matching that side’s exact revision commit. When base and head commits differ, publish two knowledge reviews with their respective labels, even if both select the same unchanged corpus revision. One shared review with gitCommit: null does not satisfy either side. The labels are caller-supplied context; they do not prove Git ancestry or execution.

Inspect these labels before publishing the comparison. A published comparison’s selection is immutable: changing the current knowledge root cannot attach a map or repair its selected Git labels. A new comparison is needed to change those selections. Resolving an existing snapshot name does not require editing the map or republishing the captures.

Share evidence in review apps and PR reviews

Section titled “Share evidence in review apps and PR reviews”

To hand a reviewer a curated interactive page with before/after image sliders (<reflow-compare>), embedded flows (<reflow-flow>), live run step rails (<reflow-run>), and highlighted retained files (<reflow-file>), publish a Review app with manage_review_apps.

To post a pull request summary, link that review app, and attach keyed inline diff comments as reflow-code-review[bot], use Pull request code reviews (reflow pr review and reflow pr comment).