Skip to content

feat(dev): pnpm dev compare and film show a change before and after - #803

Merged
allisonmahmood merged 11 commits into
mainfrom
dev/725-compare-film
Oct 19, 2026
Merged

allisonmahmood merged 11 commits into
mainfrom
dev/725-compare-film

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

What changed

A reviewer can't see a UI or flow change without checking out the branch and running it. Now two pnpm dev commands put the change in the PR body, before and after:

  • pnpm dev compare <person> <path>... takes full-page PNGs of each page at each width on both sides. Patch frames grow to their content.
  • pnpm dev film <person> <flow> records a Playwright flow on both sides and joins the takes side by side.
  • --pr <number> puts the section in the PR body and uploads its files. A re-run replaces only its own section.

Both sides run on evidence instances: throwaway clones at the base and at HEAD, each on fresh scenario data, never the developer's own instance. So the uploads only ever hold scenario data, and a flow that writes runs the same every time. This builds on the prototype in #726.

Closes #725

Look at

1. This PR's own evidence, published with --pr. This branch changes no page, so both runs use --base df65c5b, the commit before the Home redesign (#713–#719).

Before and after, as Allison Mahmood (admin)

Before is df65c5b (--base) and after is ae4fe0f (dev/725-compare-film), both on the brightline scenario, from pnpm dev compare.

/

1280px, after

After: / at 1280px

1280px, before

Before: / at 1280px

Width Before After
390px Before: / at 390px After: / at 390px
/patches

1280px, after

After: /patches at 1280px

1280px, before

Before: /patches at 1280px

Width Before After
390px Before: /patches at 390px After: /patches at 390px
  • Before at 1280px answered 404; 1 browser error(s): Failed to load resource: the server responded with a status of 404 (Not Found).
  • Before at 390px answered 404; 1 browser error(s): Failed to load resource: the server responded with a status of 404 (Not Found).
/brightline/kudos

1280px, after

After: /brightline/kudos at 1280px

No visible change at 1280px.

Width Before After
390px No visible change After: /brightline/kudos at 390px

Flow find-a-patch, as Allison Mahmood (admin)

Before is df65c5b (--base) and after is ae4fe0f (dev/725-compare-film), both on the brightline scenario, from pnpm dev film.

  • Before: stopped at "Search Home for kudos" after 10.2s: locator.fill: Timeout 5000ms exceeded.
  • After: finished in 6.9s

Before is on the left, after on the right.

side-by-side.mp4

2. Cleanup holds however a run ends. Each run takes both instances down and deletes their data on success, on failure and on Ctrl-C. Before this branch, Ctrl-C skipped that: Playwright and embedded-postgres each hook SIGINT and exit the process before Effect's finalizers run. Browsers now launch with Playwright's handlers off and close with their scope, and the supervisor (with embedded-postgres) only loads in supervise. Details are under How it was verified.

How it was verified

  • Focused tests, pnpm exec vitest run scripts/dev (10 files, 48 tests). The new ones cover:

    • the section's insert and replace: before a final "Made by" paragraph, at the end when there is none, in place among other keys, ignoring markers and "Made by" inside code fences, and refusing duplicate or unclosed markers;
    • the layout per width, what each section attaches (an identical "before" is left out), and page errors quoted so their text can't name a file;
    • attachments only from the run's own folder, and which references a partial publication left as local paths, read from the real section rather than a fenced example of one;
    • the lock: a second run refused and the lock freed afterwards, six runs starting together never giving two holders, a dead run's entry deleted, and down refused while a run holds it;
    • the reuse-or-move decision for a clone, and shot filenames for paths that slug alike.
  • Real runs on a shared Linux machine:

    Run Took What it showed
    compare ada / on team, from cold (clone, install, up, both sides) 44 s both instances down afterwards, nothing left running
    compare on five brightline pages at two widths 1 min 59 s patch frames grown to their content (the tier 0 brief to 3,398 px, tier 1 Kudos to 2,594 px); the four patch pages said "No visible change"
    compare … --pr 803, above 1 min 21 s 10 files attached, section replaced in place
    film … --pr 803, above 1 min 3 s 0.25 MB side by side, the base take stopping in red
    both again after the last push, from cold (pnpm dev down had deleted the checkouts) 1 min 54 s and 1 min 5 s each replaced only its own section, now naming ce97595; again at ae4fe0f after round 3
  • Failure paths, run for real:

    • A base before pnpm dev up existed (--base af2aead): before unavailable, with "Bringing the before instance up failed (exit 1)." in the section, after only, exit 0.
    • A flow broken on this branch: footage kept, nothing published, exit 1.
    • A second compare while one ran, and pnpm dev down: both refused at once, naming the running pid. Once the run ended, pnpm dev down printed "Removed the evidence checkouts" and deleted them; it keeps the empty lock folder beside them, since deleting it could cost a starting run its entry. In a worktree that never ran one, it still prints "Nothing to take down." and creates nothing.
    • Ctrl-C during setup and during capture: both instances taken down; no state dir, environment, lock entry or process left. Before the fix in this PR, both exited 130 and left both instances running.
  • --pr checks, before anything starts:

    $ pnpm --silent dev compare allison / --pr 803   # with an uncommitted edit
    Evidence shows commits, and this worktree has uncommitted changes. Commit and push them first, so the PR shows what the evidence shows.
    exit 1
    $ pnpm --silent dev compare allison / --pr 803   # one local commit past the PR
    PR #803's head is bbe4fe5, but HEAD here is 5bfbf35. Push this branch (or check out the PR's head) so the evidence is of the commit the PR shows.
    exit 1
    

    The head check also caught GitHub's lag for real: run straight after a push, it refused until the PR showed the new head a few seconds later.

  • Partial publication, as far as it goes from here. gh 2.102 refuses an empty file and an 11 MB one itself, before uploading anything. Through the publishing code, that left the body unchanged, passed gh's error through and exited 1 saying nothing was published. GitHub accepted random bytes named .png and .mp4, so I couldn't make one upload fail and another succeed. What a partial publication leaves behind is covered by the notUploaded test; gh's help says it updates the body with the uploads that succeeded and exits non-zero. That test section was removed from this body afterwards.

  • What was uploaded: only brightline scenario data. I read every PNG from an identical run without --pr before publishing. Pages show the instance's local hostname.

  • pnpm verify --changed: all passed (format, lint, typecheck, synth and 1,967 tests). It skipped the acceptance suites, since only the runner and docs changed.

  • Hit every surface:

    • The dev loop: docs/DEVELOPMENT.md (the command table and "Showing a change in a PR") and the patchy-dev-loop skill. The seed and the vitest template are unchanged.
    • The evidence skill: pr-evidence gains compare and film and loses the shot caveat. The throwaway-checkout recipe moved to Command output until transcript (dev: pnpm dev transcript shows a CLI change before and after #792) lands.
    • Vocabulary: "evidence instance" is defined in DEVELOPMENT, beside the runner's other terms; no context glossary covers the runner.
    • Reverse states: compare and film make the evidence checkouts, and pnpm dev down deletes them. A run's lock entry goes when it ends, and the next run deletes a dead run's entry.
    • Doesn't apply: the wire contract, the CLI in packages/patchy, migrations, company resources, served pages and the repo layout.
  • Reviewed by GPT 6.1 Sol over three rounds. Round 1 had 1 blocking and 4 should-fix findings; rounds 2 and 3 had no blocking ones, with 2 and 1 should-fix. All are fixed; the summaries are in the comments.

  • Not checked: macOS; a real partial upload; a non-Claude harness reading the skills.

  • Done means: dev: PRs show what changed, with before/after screenshots and recordings #725 has no Done means section. Its spec's tests and docs are covered above, and this body's two sections show both commands working.

Release impact

Tick exactly one.

  • Breaking — requires action from anyone already running this

  • Not breaking — dev tooling and docs; nothing ships to production

  • What does a revert leave behind? Evidence checkouts under $XDG_DATA_HOME/patchy-dev/<label>.evidence/, which the older pnpm dev down doesn't know to delete (rm -rf them), and evidence sections already in PR bodies.

  • Does the release before it still work with that? Yes. Nothing here runs in production.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

allisonmahmood and others added 7 commits October 19, 2026 16:36
Playwright and embedded-postgres each hook Ctrl-C to exit the process at
once, which skipped the evidence finalizers. Browsers launch with their
handlers off and close with the scope, and the supervisor loads only in
`supervise`. A before side that can't come up says which step failed,
never its output, since the reason goes in a public PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sol's first round: attachments came from parsing the section, which quotes
page errors, so an error naming a local image could upload it. The section
builders now name their files and publishing refuses anything outside the
run folder. The lock becomes one entry per run in a lock folder: a run
holds it only when no other live entry is there, and dead entries are
deleted, so there is no takeover to race. `down` takes the lock before
looking for checkouts. Shots carry the page's index so paths that slug
alike don't overwrite each other, and the command-output recipe stays until
`transcript` lands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:xl Over 1,000 changed lines; review in multiple passes labels Oct 19, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol review, round 1 (on 7b0dfa0, before the PR opened): 1 blocking, 4 should-fix. All fixed.

  1. Blocking: any local file could become a public attachment. Attachments came from parsing the section, which quotes page errors, so an error naming ![x](.local/…) would upload that file. Fixed in bbe4fe5: the section builders return the files they made, and publishing refuses anything outside the run's folder. Error text is quoted with backticks stripped. Tests cover both.
  2. Lock takeover was racy. A reader could see a half-written lock, and two runs recovering a stale one could remove each other's. Fixed: each run now writes its own entry into a lock folder (whole, then renamed into place) and holds the lock only when no other live entry is there. A dead run's entry is deleted, so there is no takeover to race. A test starts six runs at once and never sees two holders. A first fix with link and move-aside still allowed two holders about once in 21 runs, so I replaced it.
  3. Paths that slug alike overwrote each other's PNGs. Fixed: filenames carry the page's index. Tested.
  4. Command-output guidance pointed at the developer's instance once the recipe was gone. Fixed: the throwaway-checkout recipe now lives under Command output until transcript (dev: pnpm dev transcript shows a CLI change before and after #792) lands.
  5. pnpm dev down checked for the checkouts before taking the lock. Fixed: it takes the lock first.

…as uncommitted

Sol's second round: notUploaded searched for markers without skipping code
fences, so a fenced example before the real section hid failed uploads; it
now shares placeSection's fence-aware scan. The dirty check skipped untracked
files, so a new source file missing from the evidence passed --pr.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol review, round 2 (on b67bb49): no blocking findings. All five round-1 fixes confirmed, and 2 should-fix, both fixed in 8a541b4:

  1. notUploaded didn't skip code fences. A fenced example of the markers before the real section would have hidden failed uploads. It now shares placeSection's fence-aware scan. Tested.
  2. The uncommitted-changes check skipped untracked files, so a new source file missing from the evidence passed --pr. It now counts them; ignored files, such as flows under .local/, still don't count.

Both sections in the body were re-published at 8a541b4 afterwards.

allisonmahmood and others added 2 commits October 19, 2026 17:26
Taking the lock first in `down` made every worktree's `pnpm dev down` leave
an empty lock folder behind. A run now makes the evidence folder with its
lock before anything else, so `down` looks for the folder, takes the lock
only when it is there, and deletes the lock with the checkouts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…heckouts

Sol's third round: deleting the lock with the checkouts let a run starting at
that moment lose its entry, and a later run then hold the lock beside it. The
lock folder is back beside the checkouts and down never deletes it. Down
returns at once when neither exists, so a worktree that never ran evidence
gets no lock folder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol review, round 3 (on b67bb49..ce97595, the commits after round 2): no blocking findings. Both round-2 fixes confirmed, and 1 should-fix, fixed in ae4fe0f:

  1. Deleting the lock folder with the checkouts allowed two holders. ce97595 had moved the lock inside the evidence folder, so pnpm dev down stopped leaving an empty lock folder in every worktree. But a run starting while down deleted it could lose its entry, and a later run could then hold the lock beside it. The lock folder is back beside the checkouts (<label>.evidence.lock/), and down never deletes it. down returns at once when neither the checkouts nor the lock folder exist, so a worktree that never ran evidence still gets nothing. A new test covers down against a held lock.

Both sections in the body were re-published at ae4fe0f.

@allisonmahmood
allisonmahmood merged commit 4d2e2b8 into main Oct 19, 2026
14 checks passed
@allisonmahmood
allisonmahmood deleted the dev/725-compare-film branch October 19, 2026 16:14
allisonmahmood added a commit that referenced this pull request Oct 19, 2026
…connection (#814)

Release 15's What's new entry, written from `9e4b0df`. It covers
everything merged since release 14's `through` (`7694bab`), and sets the
`patchy` release to `0.15.0` (`packages/patchy/package.json` and
`CURRENT_RELEASE`).

| Change | PRs |
| --- | --- |
| New: Your agent can read a tool's log | #786 |
| Fixed: Tools with server code keep one steady connection | #798 |
| Behind the scenes: an unused open tool lets its server rest | #802 |

#783 is release 14's own entry, so it's left out. #795, #796, #797,
#799, #803, #804, #806 and #807 are agent docs, CI and dev tooling, with
no line.

None of the PRs in the range are `one-way`; #786 and #798 predate the
rollback questions, and their diffs leave nothing an older release can't
run with (a new read-only route and CLI command, and the load balancer's
stickiness setting, which the older commit restores).

If this release misbehaves, roll back to `03891e4` (release 14).

Made by Claude Opus 5.5 via Claude Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:docs Touches the docs area size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dev: PRs show what changed, with before/after screenshots and recordings

1 participant