Repository navigation
Closed
Labels
area:ciCI, shared testing infrastructure, development scripts and toolingenhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent
Description
A CLI change has no screenshots to show. Its output, flags, errors and exit codes are its interface, and agents read them more than people do (ADR-0004). Reviewing one today means running it.
Fix
pnpm dev transcript <script> [--base <ref>] [--scenario <name>] [--timeout <s>] [--pr <number>] [--json]The script
- Format. A plain text file. Each non-blank line is a command, and a
#line captions the commands after it. - Where it runs. On each side's evidence instance (dev: PRs show what changed, with before/after screenshots and recordings #725), on fresh scenario data, as that instance's signed-in CLI.
- How a line runs. Each line runs in its own non-interactive
bash -c, with stdin closed, from the environment's agent workspace.- Nothing carries between lines except files, so chain with
&&on one line.
- Nothing carries between lines except files, so chain with
- Failures and timeouts.
- A non-zero exit is recorded and the script continues, because refusals are often the point.
- A line past its timeout (60 s by default) is killed and recorded as timed out.
- The command fails only when the runner can't run, or when a line times out on the after side.
Closed environment
- Lines get the runner's closed environment, with nothing inherited from the developer's shell. The side's
bincomes first onPATH, and itsPATCHY_STATE_DIRis set. - An ambient
PATCHY_API_TOKENorPATCHY_API_URLwould otherwise override the instance's login. - The agent workspace's rules hold: no
patchy setup, and no global installs.
What each line records: exit code, stdout, stderr and time.
In the PR
- For each line, the after side's output and, when before differs, a diff.
- Identical output says "No change". Long output is cut with a note.
Normalize narrowly
- Before comparing, replace only each instance's origin and filesystem paths, and say so.
- Leave every other difference visible: an id or time that changes may be the change.
One sanitizer, shared with #793
It collects secrets for the whole run and keeps every value it has seen until the last write. It collects from:
- both instances' CLI state, read before the run and after every line, so a login code that a later
patchy logoutclears is still known; - anything shaped like a machine token (
pp_…); - the values of any variable the runner passes whose name marks it as secret.
It runs over everything before it's written: commands, outputs, errors, the JSON and the PR section. The section says which sources were redacted.
Docs and skills
--prpublishes a keyed section through dev: PRs show what changed, with before/after screenshots and recordings #725's code.- Add the entry to PRs open with a merge summary, and a skill lists the ways to show a change #791's skill, to
docs/DEVELOPMENT.md's command table, and to thepatchy-dev-loopskill.
Done means
- A CLI change's PR shows the lines it changed, before and after, with nothing secret in it.
- A script that logs in and then logs out publishes no login code.
Metadata
Metadata
Assignees
Labels
area:ciCI, shared testing infrastructure, development scripts and toolingenhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent
Activity
feat(dev): pnpm dev compare and film show a change before and after (#…
feat(dev): pnpm dev trial has a fresh agent try a task before and aft…