Skip to main content

Reviewing an AI coding agent's changes: three checks

The diff, a whole-project check, and tests

Updated 5 min readMarkdown

When an AI coding agent changes an app, a person still answers for the result. That person needs a way to know the change is right without re-reading everything it touched.

Three checks do that job here: the diff, a whole-project check, and tests. Between them they have caught two mistakes that the diff alone didn't show.

Background

The examples come from a business app built with Codeer.LowCode.Blazor (CLB), a low-code library for Blazor made by Codeer, where I work. Every screen is a JSON design file with small C#-style scripts next to it. All of it sits in git, and the agent edits those files directly.

None of the steps depend on that setup. Each one below says what it relies on, so the same thing can be looked for in another stack.

1. Read the diff, and expect it to be small

This one only works if a small request produces a small change.

Take one request: a read-only history list had an unused column on the right edge, a header nobody needed over its button column, and a button that sat off-centre. The agent's change was seven lines in three files: one page setting removed, one label blanked, and five lines of CSS.

Two questions cover it. Did the agent touch anything that wasn't asked for? Does every changed line map to a sentence in the request? At that size it's a quick read. If a small request comes back as a big diff, that is the first thing to ask the agent about.

2. Let a machine check that everything still fits together

This needs a check that covers the whole project and not just the files that changed. In most stacks that's the compiler or the type checker, plus whatever validates the configuration.

In this project the scripts are interpreted when the app runs, so there's no compiler pass. The Designer's command-line design check does that job. It loads every design file, checks the scripts for syntax, references and types, and confirms that every database column a screen maps to really exists.

Here is what it caught. The agent took a layout element off a card, and the changed files looked fine. The check reported two lines in a script that still referred to that element by name. Those lines weren't part of the change, so they weren't in the diff. The agent fixed both and the check came back clean. Nothing had been run yet.

The diff only showed what the agent touched, and the problem was in a file it hadn't.

3. Test the behaviour

This step depends on tests being cheap enough to write for small changes too.

Here, part of that comes from generated page objects. The Designer can produce Selenium classes for the screens, with typed access to each field, built on the Codeer.LowCode.Blazor.SeleniumDrivers package. They come from the same JSON the agent just edited. Where they aren't used, every field still carries its name in the page, so a test can find it directly. Either way a test reads a lot like the request: open the record, add a card, type a title, save, check the card is there. If a stack doesn't provide this, a page-object layer kept by hand does the same job.

That's what caught the second mistake. A larger change passed the diff and passed the design check. Then a test failed on something nobody had asked about: a page that reported unsaved changes the moment it opened. The agent's script was writing values back into fields that already held them, and a field that exists only for display was being counted as a change. A couple of guards and one setting fixed it, and that test now runs with the rest.

Neither the diff nor the design check would have shown that. It only appears when the page actually runs.

Tests only cover what they exercise, so when a mistake does get through, it gets a test of its own.

Why three steps and not one

The three steps cover different things. The diff shows that the agent did what was asked and nothing more. The whole-project check shows that the files still fit together, which a diff can't. The tests show that the screen behaves.

All of this works because the structure the agent edits is small and regular. A screen has one shape, a field is a setting with a type, and scripts stay short because loading, saving and validation belong to the framework. With so little room to improvise, there is less to review.

That part carries over to any tool. Give an agent a structure whose output can be checked mechanically, and then check it every time.


Examples from CLB 1.3.66; checked against 1.3.68 and the official documentation on 2026-11-16. Disclosure: I work at Codeer, the company behind Codeer.LowCode.Blazor. This post was drafted with AI assistance; the workflow and the examples are from my own project, and I checked every claim against the product and its documentation.

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.

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.

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?

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.

I'll try pulling just the guarded line by hand before putting anything in CI.

"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.

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.