---
title: "Discussion on \"Reviewing an AI coding agent's changes: three checks\" | Hashnode"
description: "Discussion on \"Reviewing an AI coding agent's changes: three checks\". The diff, a whole-project check, and tests"
url: "https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Reviewing an AI coding agent's changes: three checks](https://andrew-ryan.hashnode.dev/reviewing-an-ai-coding-agent-s-changes-three-checks?utm_source=hashnode&utm_medium=feed)

The diff, a whole-project check, and tests

4d ago · 5 min read · andrew-ryan.hashnode.dev  
Read the article

-   [#ai](https://hashnode.com/tag/ai)
-   [#code-review](https://hashnode.com/tag/code-review)
-   [#testing](https://hashnode.com/tag/testing)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#blazor](https://hashnode.com/tag/blazor)

## Written by

[Ryan Andrew](https://hashnode.com/@randrew)

@randrew · Osaka, Japan

  
[View profile](https://hashnode.com/@randrew)

## Responses 6

Markdown supported · ⌘↵ to post

[Paul Pham](https://hashnode.com/@paulpham157)

[1d ago](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b03b51812274fbf20cd695e)

Who writes the tests in check three? I once had 1,154 passing tests while validation let junk strings through, because the agent had rewritten them to pass.

[Ryan Andrew](https://hashnode.com/@randrew)

[10h ago](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b03b51812274fbf20cd695e#reply-6b0500703252b36eec6aafc8)

Fair question, and 1,154 green tests around a validation hole is exactly what a pass count can't show. In the project from the post the agent writes the tests too, so they are not trusted on the count alone. Two things keep that in check. Test files go through the first check like everything else: an edited assertion in an existing test is a changed line, and it has to map to a sentence in the request. If nobody asked for the expected behaviour to change, that edit is the first thing to question. And a new test has to be seen failing once, with the change taken out, before its pass counts for anything.

[Paul Pham](https://hashnode.com/@paulpham157)

[10h ago](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b03b51812274fbf20cd695e#reply-6b05078ccfdd0d5f0046fb3b)

So the fail-once check, is that done by hand at review time, or does CI back the change out and rerun the new test?

[Ryan Andrew](https://hashnode.com/@randrew)

[8h ago](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b03b51812274fbf20cd695e#reply-6b05196e35263856acc3b112)

In the project from the post it's done by hand, at the time the change is made, and not in CI. The agent takes out the one line the new test is supposed to protect, runs that single test, shows the failure, and puts the line back. Backing out the whole change automatically would say less: a test can fail without the change for reasons that have nothing to do with what it claims to check, for example because the screen element it looks for no longer exists. Removing only the line it guards answers the narrower question. Mutation-testing tools automate the same idea across a codebase; this is the one-test version of it.

[Salman Parvez | ML Systems](https://hashnode.com/@ml-systems)

[4d ago](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b002c14595f81e2cac57465)

"Does every changed line map to a sentence in the request" is the check I'd teach first. On a job, a change order lists exactly what's being changed, and anything outside it is extra work nobody approved. The removed element that still had two references in another file is the classic one: the trouble was in a room nobody walked. Three checks that each see something different is why inspections are staged. We're building our review the same way at ML Systems.

[Ryan Andrew](https://hashnode.com/@randrew)

[10h ago](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b002c14595f81e2cac57465#reply-6b0500933252b36eec6ab046)

The change order is a good way to put it: anything outside it is work nobody approved, and the diff is where that shows up. The two leftover references are the other half of the picture. They sat in a file the change never opened, so no amount of reading the diff would have found them, and that is why a check that walks every room comes second. Each check catches a kind of mistake the others can't see, so dropping one leaves that kind unexamined. Thanks for reading.
