← Back to Home

AI on Both Sides of the Pull Request

A research series on putting a human in the loop when AI writes code and AI reviews code.

AI code tools can write a change fast. They can also introduce bugs that a tired reviewer misses. This series presents a model that keeps a human in the loop on both sides: a generator instance that drafts the change from the specification, and a reviewer instance that checks the pull request against a standards catalogue. The developer confirms the intent before the generator starts and decides the findings before the merge.

The two-instance model

Two separate AI instances work on the same pull request, each with a defined duty.

Generator instance

Writes the change from the specification, the requirements, and the constraints. It does not guess the intent. It follows the brief the developer confirmed at the intent seat.

Reviewer instance

Checks the pull request against the standards catalogue: specification conformance, Clean Code maintainability, ISO/IEC 25010 review questions, named security issues, and tests of the claimed requirements.

The human in the loop

The developer holds two seats. Both are mandatory.

Intent seat

Before the generator starts, the developer confirms the specification, the requirements, and the constraints. The generator works from this confirmed brief, not from a vague prompt.

Review seat

After the reviewer instance returns its findings, the developer decides each one: accept, reject with a reason, or override with a documented justification. The merge happens only after this decision.

The standards catalogue

The reviewer instance checks the pull request against five entries.

  • Specification conformance — the change implements what the specification says.
  • Clean Code maintainability — the code is readable, changeable, and follows the team's conventions.
  • ISO/IEC 25010 review questions — the change is checked against the standard's quality characteristics.
  • Named security issues — the reviewer names the specific issue (XSS, injection, leaked secret), not a generic warning.
  • Tests of claimed requirements — every claimed requirement has a test that proves it.

What the research shows

AI code tools change the speed of development. They also change the risk profile.

Faster completion

Peng et al. found that developers using AI coding assistants completed tasks 55.8% faster than those working without them.

Higher bug rate

Uplevel Data Labs found a 41% higher bug rate in code written with AI assistance, showing that speed without review introduces risk.

The revision cycle

When the reviewer finds issues, the cycle continues with four stops.

  • Accept — the developer agrees with the finding and the generator fixes it.
  • Reject — the developer disagrees with the finding and documents the reason.
  • Override — the developer accepts the risk and documents the justification.
  • Round cap — the cycle stops after a defined number of rounds to prevent infinite loops.