# Pull requests as receipts
Table of Contents
A pull request usually does two jobs: people review the code, and CI checks it before merging.
In my setup, both happen before a pull request even exists. Two independent agents review every change. The agent that built it proves it works with evidence. And a script runs the full suite of checks on my own machine before anything gets pushed.
That leaves the pull request with one job: acting as a receipt. It records what changed, why, and how it was verified.
One way to main
Everything reaches main through one script. When I say “ship”, the agent runs it:
- Rebase on main, unless the branch already contains it.
- Figure out which checks the change needs.
- Run those checks locally: the web build and tests, the .NET build and tests, and the end-to-end run.
- Push the branch and open or update its pull request with an agent-written description.
- Record a sign-off on the commit: a status showing which checks passed and on which machine.
- Fast-forward main to that exact commit.
If anything fails, nothing reaches main. If main moves while the checks run, the push gets rejected, and running the script again rebases and tests the new combination.
The sign-off step comes from 37signals, which moved CI back to developer machines. Basecamp’s gh-signoff turns this into one command: run tests locally and post a green status on the commit when they pass. My script uses the same pattern with an agent running it.
Two rules guard this process:
- I decide when something ships, and only the exact version that was reviewed.
- The script is the only door. A hook stops the agent from pushing to main any other way.
Only the tests a change can affect
Running every test on every change gets slow fast. The script picks checks based on the touched files:
- Web app changes run the web build and tests.
- Module changes run that module’s tests, plus the tests of any module that depends on it.
- Shared changes, like the build setup or test helpers, run everything.
- Unrecognised changes also run everything.
That last rule matters most. A mistake in test selection costs time, never a skipped test. To catch anything the selection might miss, the full suite runs on main every night.
The script is the gate
On a private repository, GitHub branch protection is a paid feature. Without it, nothing on GitHub blocks a direct push to main. So the script acts as the gate: main only moves once the checks are green and the sign-off is on the commit. If the sign-off can’t be recorded, nothing ships.
The agent does the pushing, and a hook forces it to use the script. A human typing git push in a terminal isn’t blocked, which is an easy trade-off for a solo developer.
The pull request is the record
No CI runs on the pull request. The script opens it after checks pass, signs off the commit, fast-forwards main to it, and GitHub marks it as merged.
What makes the PR worth keeping is the description. The agent writes it in a fixed format:
- Why: the problem, in two lines.
- What changed: one line per module, with commits.
- Scope: what was deliberately left out, with links to issues.
- Tradeoffs: the choices made and what they cost.
- Blast radius: what else could break, and the one fact making it safe.
- Verification: the commands, measurements, and screenshots from the evidence step.
Months later, this is what I want to find. A pull request is easy to search and link to, while an issue comment gets buried.
What it costs
Shipping isn’t instant. With the end-to-end run included, it takes over twenty minutes, so the agent runs it in the background and reports back when finished. Two ships can’t run at once on the same machine because they compete for ports, so they queue up one at a time.
Main’s own CI still runs after the push before deploying. It repeats the local checks, serving as a final verification on a separate machine before hitting production.
The regression gate
The script also replays the key user journeys from the first post in this series: the saved end-to-end scripts for the flows that bring in money. A red one stops the ship. Nothing reaches main unless the code builds, the tests pass and the core journeys still work.
Where to start
- Write a ship script and make it the only way to main. Even a basic script that runs tests and pushes is a solid start.
- Block the other doors. Use a hook or permission rule to stop the agent from pushing directly to main.
- Select tests by what changed, defaulting to everything. Run the full suite nightly to catch missed edge cases.
- Keep a receipt for every change. Store it somewhere searchable, like a pull request description.
Start with the script. Once there’s one way to ship, every other improvement has an obvious place to go.
Grab the ship script, check selection, push hook, and PR template from shipping-with-an-agent/shipping, copy them into your repo, and adjust the commands.