DEV Community

Cover image for Where else should this diff have gone? Five shapes from 90 daily code reviews

Where else should this diff have gone? Five shapes from 90 daily code reviews

Pierre-Laurent Medori on October 27, 2026

One view out of three. Two templates out of three. Three prompt builders out of four. Six languages out of eleven. Two platforms out of three. Eac...
Collapse
 
madhabcoder profile image
Nilamadhab Senapati •

'The diff is usually right. The defect sits where the diff didn't go' is the best one-line summary of code review I've read this year. The missed-twin problem is exactly where AI reviewers struggle too, because most of them only ever see the diff. Did the agent get better at spotting twins once it had the dated notes, or is that still mostly you?

Collapse
 
pierrelaurentmedori profile image
Pierre-Laurent Medori •

Thanks !

Honestly, it’s mostly the agent. It doesn’t only see the diff: it has the repositories cloned, and the notes tell it what was already checked, so it doesn’t spend the morning on the same code twice. Most of the twins in the article are its findings, several of them in my own commits. That part still impresses me.

The part that scares me is the other side of the notes. They record what it flagged, and what it checked and found correct. A wrong finding shows up the next morning and gets withdrawn, like the banned channel. A twin it never saw leaves no note at all. After 90 reports, I know a lot about what it catches and almost nothing about what it misses.

The only misses I can count are the ones production finds for me.

Collapse
 
madhabcoder profile image
Nilamadhab Senapati •

'I know a lot about what it catches and almost nothing about what it misses' is the most honest line about AI review I've seen. One idea: plant a known twin every now and then and see whether it shows up in the next morning's notes. Production shouldn't be the only eval you get.

Collapse
 
dexoryn profile image
Dexoryn •

The idea that a diff can be correct but still belong in the wrong place is an underrated code review lesson. Moving logic into the right abstraction isn't just about cleaner files; it makes responsibilities clearer and future changes safer. I like the focus on recognizing patterns across reviews instead of treating every diff as an isolated problem.

Collapse
 
pierrelaurentmedori profile image
Pierre-Laurent Medori •

Thanks Dexoryn. One small nuance: in most of these notes the diff was in the right place. It just wasn’t in every place that needed it.

Your point on abstractions raises a question I hadn’t asked: is this worse with microservices? The twins in the article mostly sit inside one repository (three views, three templates, four prompt builders), so a monolith doesn’t prevent them. It just keeps them one grep away. Across services, the twin moves to a repo nobody searches, and the review hits the same wall: its worst mistake of the month was a switch living in a system it doesn’t clone.

So I’d say services don’t create the shape, they hide it. Do you see it more inside one codebase or across services?

Collapse
 
panthpatel profile image
Panth Patel •

Shape five is one I have myself. On my ticket board a card moves the moment you drag it. If the server then refuses the command, the card slides back to its old column, and that is all the user gets. No toast, no message. Agent sessions go the other way: the orchestrator retries a crashed session up to a limit, then marks the ticket with a red dot on the board. Did the review ever flag a silent UI rollback like that, or does it stay in backend code?

Collapse
 
pierrelaurentmedori profile image
Pierre-Laurent Medori •

Thanks Panth, great example. Not that exact one, but the review doesn't stay in backend code: it reads our JavaScript too, and the closest it found is the mirror image of yours. Our widget editor shows its own copy of the preview, then asks the server for the full one, guard included. The catch around that call is empty, so when it fails, the unguarded copy stays and nobody knows.

Yours goes back quietly, ours stayed put quietly. I like the contrast you point out: the agents get retries and a red dot, while a person gets a card sliding home, which looks a lot like a missed drop. Maybe the humans deserve a red dot too.

Collapse
 
panthpatel profile image
Panth Patel •

An empty catch that leaves the unguarded copy on screen is the worse of the two: mine at least ends in the true state, yours keeps looking fine. You're right about the missed drop; nothing tells a person the server said no. Was the empty catch new when the agent flagged it, or had it sat there for a while?

Thread Thread
 
pierrelaurentmedori profile image
Pierre-Laurent Medori •

It had sat there a while. It came in April with a refactor, a couple of weeks before the daily review started, so the commit that wrote it never came through the review. The agent flagged it in late August, four months later.

What brought it up was a support case: clicking a link in the preview opened the editor inside its own preview. The fix put a guard against that into every preview the server builds, and the review went looking for the other places a preview gets built. The browser builds its own, and that one stays on screen whenever the server's call fails.

That's usually how old code gets a look: the review reads each day's commits, and reaches old lines when something new lands next to them. You're right that ours was the worse one: it looked fine until someone clicked a link.

Thanks for the question, I had never checked its date before.

Collapse
 
maxritter profile image
Max Ritter •

The twin nobody fixed is the one I see most with coding agents too. They fix the exact spot the ticket points at and stop there. What helped me was asking the agent to list every caller and sibling of the changed code before it plans the fix, and then checking the diff against that list. Computing the family works for prompts as well as for tests.

Collapse
 
pierrelaurentmedori profile image
Pierre-Laurent Medori •

Thanks Max. Listing callers and siblings before planning the fix is the right reflex, and checking the diff against that list afterwards is what makes it stick.

Two things I'd add. First, the list is only as good as the way it's produced. If the agent writes it from reading, it's one more hand-typed list, and it can miss a member exactly like the test missed the refine builder. When it comes out of a search (find references, grep on the guard or the string), the check gets much more reliable.

Second, the siblings are the hard half. Many of the twins in the article aren't linked by any call: the third template, the five languages, the other view with the same guard. They're copies, so they only show up when you search for the shape of the fix rather than for the function it touched.

Do you have the agent run that search itself, or do you hand it the list?