Illustrative example, Fictional data, Not a client result
A merge harness for agent pull requests
The gates a small team can put around coding agents before trusting them with the backlog, shown on one dependency bump. The repository, tools and results are invented.
- Before
- Agents run with broad permissions, pull requests are large and mixed, and review means skimming the diff late at night.
- After
- Agents follow one instruction file and open small pull requests that must pass CI, and every merge goes through a checklist an engineer signs.
Inspect the sample
01 Input
Three engineers run Tidewren, a fictional scheduling product with paying customers. The Postgres upgrade has slipped for two quarters, and their first agent pull requests broke tests nobody had written.
How it moves
- Write the instruction file How to run the tests, which directories are off-limits, how to name branches, and what done means.
- Tests first An engineer writes or approves the tests that define the change before the agent implements it.
- Gate it in CI Lint, type checks, tests, a secret scan and a dependency check run on every agent pull request.
- Review and merge An engineer reads the diff against the checklist and merges it, or sends it back with a note.
02 Output
| Gate | What it checks | Runs on | Result | Blocks the merge if |
|---|---|---|---|---|
| Instruction file | The agent stayed within the allowed directories | Agent run log | Pass | Any file outside the allowed list changed |
| Tests | The existing suite plus two new tests for the upgrade | CI | Pass after one fix | Any test fails or coverage drops |
| Types and lint | No new type errors or lint warnings | CI | Pass | Any new error appears |
| Secrets and dependencies | No keys in the diff; licence and advisory check | CI | Pass | A secret or a known advisory appears |
| Human review | An engineer reads the diff and the migration plan | Pull request | Approved by the second engineer | The reviewer cannot explain the change |
03 Review
Where a person decides
An engineer who understands the change approves every merge. The team lead approves any change to the instruction file or to the CI gates themselves.
Limits of this example
Fictional repository and results. Gates reduce risk; they do not make code correct. The right checks depend on your stack, and production releases follow your own process.
See whether this fits your work, and what it would take.