Repository navigation
prototype(dev): pnpm dev compare and film show a change before and after - #726
Closed
allisonmahmood wants to merge 3 commits into
Closed
allisonmahmood wants to merge 3 commits into
allisonmahmood wants to merge 3 commits into
Conversation
Part of #725. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e, video reference plays inline Co-Authored-By: Claude Opus 5.5 <[email protected]>
…'s rules Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 16, 2026
allisonmahmood
added a commit
that referenced
this pull request
Oct 19, 2026
…803) ## 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). <!-- patchy-dev:compare:allison --> #### 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**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/patches` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 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**  No visible change at 1280px. | Width | Before | After | | --- | --- | --- | | 390px | No visible change |  | <!-- /patchy-dev:compare:allison --> <!-- patchy-dev:film:find-a-patch --> #### 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. https://github.com/user-attachments/assets/63035395-64f3-4985-b633-94a351979f5c <!-- /patchy-dev:film:find-a-patch --> **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` (#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:** #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 - [x] **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. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Owner
Author
|
The build landed. #725 shipped as #803, on throwaway evidence instances instead of reusing this prototype's environment, and with |
3 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prototype, not for merge. Part of #725. It's up so the team can try the two commands and see what they produce on a real PR. What we learn goes on #725.
A UI or flow change is quick to review as code but slow to check by eye: today that means checking out the branch and running a dev server. This prototype gives agents two commands that put the evidence in the PR instead:
pnpm dev compare <person> <path>...shoots each page on the PR's base and on the working tree, at 1280 and 390px, and writes the Before/After section below.pnpm dev film <person> <flow.ts>records a short Playwright flow on both sides, with a cursor, click rings and step captions, and joins the two takes side by side.Both sides run the same scenario. The base is a shared clone of the repo beside the environment folder, running its own
pnpm dev up, and stays up between runs. This worktree restarts first, so "after" is always the current code.pnpm dev downremoves both.What it produced
Everything below is the commands' own output, uploaded with
gh pr edit --attach. The base isadb9aa1^, from before the card got tabs (#717) and before the Home polish in #718 to #721, so both comparisons show changes that landed today./as Allison Mahmood (admin)1280px, after
1280px, before: adb9aa1^ (0fd3764)
/patches/kudosas Allison Mahmood (admin)1280px, after
1280px, before: adb9aa1^ (0fd3764)
Flow: card-tabs, as Allison Mahmood (admin)
side-by-side.mp4
The base stops at "Its versions" because the tabs didn't exist yet. The take keeps the failure on screen, captioned, so the "before" still shows something.
What we learned
The approach works, and
gh --attachhandles all the hosting. Fixed along the way: tsx's__namebreaking page code, full page loads wiping the overlay, Playwright's 30-second wait,ghignoring bare video paths, and tables shrinking desktop shots. Still open: "No visible change" rarely fires because of minute-level timestamps, patch frames are cut at the viewport, and the worktree's data drifts. The full write-up and the recommended shape for the build are on #725.Try it
From cold, both sides take about a minute and a half, most of it the base's install and scenario. Warm re-runs take 13 to 30 seconds.
Made by Claude Opus 5.5 in Claude Code, running in T3 Code.