Skip to article
Quick ID: 272071

Reviewing AI-Generated Pull Requests Starts Before a Human Sees Them

Updated

Reviewers didn't look for the same things, even though everyone followed the same standards. Each person brought their own sense of what mattered most. One reviewer focused on tests, another cared about naming, and another zeroed in on the shape of the design. The same pull request could feel completely different depending on who picked it up, and that uneven emphasis stretched out every review.

Branch policy required three approvals, which meant every change waited three separate times. A typical pull request sat around for a long stretch before anyone finished reviewing it. By the time comments arrived, authors had already lost their mental context and had to reload the whole change from scratch. After a few cycles of back-and-forth, the conversation drifted away from the design and toward individual preferences. The real question, whether the change was right, often arrived after everyone had already spent their attention.

This article is about how we fixed that, and what happened when AI started writing the pull requests too.

Two Jobs Wearing One Name

Understood. Please provide the line to process.

Mechanical work is the predictable part. Some checks have a simple yes-or-no answer. Is the template filled in? Did someone commit a secret? Are there tests? Is a value hardcoded? Does this import cross a layer it shouldn't? This kind of work needs consistency, not judgment. People aren't consistent. Ask five engineers to check the same pull request for style issues and you will get five different lists depending on who is in a hurry.

Contextual work is the part only humans can do. Is this the right level of abstraction? Does it handle the cases the domain actually produces? Will it still make sense when the component grows? These questions aren't abstract design debates. They are about whether the code will survive production with all its edge cases and platform quirks. A machine can't answer that because it doesn't understand what the component is for.

We didn't get faster reviews by pushing people harder. We got faster reviews by taking the mechanical part off their plate. Machines enforced the guardrails, and humans spent their time on what the code meant.

We didn't get faster reviews by pushing people harder. We got faster reviews by taking the mechanical part off their plate.

What We Built: Guardrails, a Checklist, and a Gate

We started with a conversation, not a tool. We asked a simple question: what should a pull request look like before a human ever sees it? Answering that meant writing down rules that had only lived in people's heads.

  • Coding standards
  • Architectural boundaries, including which modules can talk to which, which dependency directions are allowed, and which layers are off-limits
  • Security rules, like no secrets, no vulnerable dependencies, and no outdated packages
  • Test expectations, so new functionality ships with tests that actually cover it
  • Documentation rules, including updating docs on API changes, keeping the docs build green, and generating type docs for new types
  • A pull request template that everyone has to fill in

A guardrail only belongs on the checklist if it's concrete, unambiguous, and enforceable. We used one simple test. If a person can look at a pull request and say, “This violates a rule,” then a machine can check it. Anything that can't be checked objectively stays with humans.

The gate is the CI job that acts like your first reviewer. It's predictable, fast, and intentionally simple. When a pull request arrives, the gate runs the checklist your team agreed on. It checks for secrets and keys, known CVEs, architecture boundaries, guideline and template compliance, missing tests, and broken docs. If something fails, the gate blocks the merge and posts a clear comment explaining what happened and how to fix it. For small issues it can auto-approve. For anything else it stops the change until someone fixes it.

We also had Stash post the gate's comments into a shared developer channel. That changed the feel of review right away. It was no longer happening in silence. People could see a pull request moving or stalling, and authors stopped refreshing the PR page because the feedback showed up in the place they already lived.

Ready.

What Changed: Speed, Consistency, and Culture

The first thing we noticed was that all the mechanical noise disappeared. The gate caught formatting problems, missing tests, broken docs, and committed secrets before a human ever opened the pull request. Reviewers no longer had to spend time on the basics.

That change had an instant impact on merge time. The back-and-forth disappeared, and three rounds of review often shrank to one solid pass. Authors took care of the mechanical issues and the review blockers while they were still in the zone. By the time a subject matter expert picked up the pull request, the fundamentals were already out of the way, so nobody had to sit around waiting for feedback the gate could catch immediately.

Consistency improved at the same time. One standard replaced individual preferences. Pull requests no longer stalled because they landed on the one reviewer who cared deeply about naming or formatting. Everyone started from the same baseline.

All of that created a cultural shift. Review turned into a shared learning loop instead of a private conversation between two people. The tone changed. The process felt lighter. People focused on the design and the intent of the change instead of small mechanical issues. Conversations moved toward whether the change was the right abstraction, and review became a place for expertise and shared understanding instead of policing.

Would the Gate Hold Up Against AI-Written PRs?

We had built everything so far for human authors. Then AI-generated pull requests started showing up in the queue, and the question became whether a gate designed around humans would hold up against a completely different kind of author.

AI-generated pull requests arrived looking great. Clean formatting, consistent naming, no typos. It took only a few of them to learn that clean doesn't mean correct, and consistent doesn't mean safe.

Clean doesn't mean correct, and consistent doesn't mean safe.

These mistakes don't look like human ones. They're systematic. The model follows a pattern perfectly even when the pattern is wrong for the domain. The code compiles and still misbehaves. The documentation sounds right and says something false. The change touches files it shouldn't, and a tidy abstraction quietly breaks the intent of the architecture.

I couldn't skim anymore. I couldn't trust a first impression. I couldn't assume the author understood the domain, because the author was a model. Every AI-generated pull request demanded full attention, even when it looked perfect on the surface.

Here are three real examples.

  • A small refactor made a shared type more generic and quietly broke a downstream component that relied on its specific behavior.
  • A new function arrived with beautifully written documentation that didn't match what the function actually did.
  • A repo-wide formatting fix changed line endings across more than a thousand files in one pull request.

AI can generate a pull request in minutes, and the volume can outrun what reviewers can reasonably read. The gate had to hold back the flood without slowing down the people doing the work. It compares what the AI generated with what we require before a human spends any attention on it.

For AI-generated pull requests, we added three requirements: only one pull request open for review at a time, AI disclosure, and evidence of testing. If any of these are missing, the change doesn't get through. Table 1 shows how the challenges differ between human-written and AI-generated pull requests.

What the Gate Could Not Catch

The pull request with the beautifully written documentation passed every check the gate had. A reviewer caught the problem only because they knew the domain well enough to say, “That isn't how this works.” A gate can only enforce what someone has written down. Undocumented constraints, platform behavior, and old design decisions are still human work.

A gate can only enforce what someone has written down.

AI didn't replace reviewers. It made their job more important and made the guardrails nonnegotiable.

Building This in Your Own Team

Understood.

Turn your guardrails into concrete, enforceable rules. Use the same test every time. If a person can point at a violation, a machine can check for it.

Build a CI gate that blocks the merge and comments directly in the pull request. Start with secrets and vulnerabilities. They pay for themselves right away.

Push feedback somewhere visible. Use Slack, Teams, or whatever your team already lives in. When feedback is visible, one person's lesson becomes everyone's.

If AI is writing pull requests, keep one open for review at a time, require AI disclosure, and ask for screenshots or a short video of what was tested.

Trust the separation. Machines handle mechanics and humans handle meaning. Don't fight that split.

What Went Wrong for Us

We didn't get everything right on the first try. Some of the rules we shipped threw false positives and frustrated people. A few were too strict, and a few were simply wrong once real pull requests started hitting the gate. We had to adjust things, rewrite parts of the checklist, and drop rules that caused more noise than value.

The first couple of weeks came with friction, and we treated that as part of the process. Being honest about what worked and what didn't helped us tune the gate faster than pretending it was perfect from day one.

The Real Outcome: A Cultural Transformation

The biggest change was how review felt. Before the gate, opening a pull request came with a little dread, because you never knew what you were walking into. Now reviewers start from a clean baseline and trust the basics are handled. Authors get feedback while the change is still fresh, so fixing things feels routine instead of personal.

When AI-generated pull requests arrived, the same split between mechanical checks and human judgment held. The gate took the repeatable checks, and reviewers kept their attention for meaning and domain knowledge. Conversations shifted from formatting to whether the change was the right abstraction.

Closing

The gate didn't just speed up review. It gave people room to spend their attention where judgment matters. When AI joined the queue, we kept the same gate and added three rules to keep the volume manageable. If you take one thing from this, start by writing down what a pull request should look like before a human ever sees it.

Open original image