---
title: "Comment by Paul Pham on \"Reviewing an AI coding agent's changes: three checks\" | Hashnode"
description: "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."
url: "https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f/comment/6b03b51812274fbf20cd695e"
---

[Discussion](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f)

Comment [Reviewing an AI coding agent's changes: three checks](https://hashnode.com/posts/reviewing-an-ai-coding-agent-s-changes-three-checks/6affba033044cda0c23cf55f)

[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)

[9h 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.
