Executive Summary
1 min summary
AI-assisted PRs often pass every mocked test while hiding production-killing bugs like reconnect storms, silent config mismatches, and broken rolling deployments. I spend review time on what is expensive to undo (contracts, database rollouts, failure loops, and real-environment evidence) instead of diff polish. Authors stay accountable for explaining behavior and proving risky paths; good review feedback teaches that judgment without lowering the safety bar.
I have reviewed plenty of AI-assisted pull requests that looked spotless, read cleanly from top to bottom, and came with a green test suite. Two of them stand out.
In one JavaScript change, reconnection logic for a SharedWorker passed every automated test. Once real users hit it, a dropped connection triggered an endless reconnect loop that hammered the browser and killed the app. In another, RSocket fragmentation handling looked fine in isolated test contexts, then failed silently on deployment, the exact kind of production mismatch I wrote about in The Trail That Went Cold.
Both diffs were tidy. Both had passing tests. Both broke when they met reality.
My stance on AI-assisted code is simple: I don’t care whether you wrote a function by hand or generated it in ten seconds. I care whether you understand what it commits us to in production, and whether you can prove it survives real failure modes. Code is cheap to regenerate. A broken API contract, a locked production table, or a reconnect storm is expensive to unwind.
In Old Growth, New Trails, shared patterns gave incoming teams a safe path into a large migration. Code review is the daily version of that work: making engineering judgment explicit so the team catches high-consequence failures without routing every decision through one senior engineer.
Review What Is Hard to Undo
Formatting, naming nits, and basic lint rules belong in CI. If a human reviewer is spending twenty minutes debating variable names on a 400-line AI-generated PR, nobody is checking the boundaries that can page on-call at 2 AM.
I put review time into three places where reverting a git commit does not undo the damage:
Contracts and Boundaries
Start with the business invariant and the consumers already in production. Does an event mean “requested” or “completed”? Is a missing JSON field treated differently from null? If a PR renames a field or shifts an error code, can older clients and services still talk to it during a rolling deploy?
Be skeptical of tests built exclusively around freshly generated mocks. A generated test suite will happily confirm that the producer and its own mock agree while hiding that a real consumer (or a real Spring autoconfiguration path) behaves differently. Ask for evidence from the actual boundary: contract tests against supported versions, representative production payloads, or verification in a real runtime context.
Databases and Rollout Order
A migration script that passes against an empty test container can still lock a hot table in production. Check constraints and defaults against existing rows, inspect the query plan at realistic volume, and check whether old and new application instances can coexist while the deployment rolls out.
Keep risky schema changes in three safe stages:
- Additive changes first: Add new columns nullable, and avoid direct
SET NOT NULLin PostgreSQL (which scans the whole table under anACCESS EXCLUSIVElock). Instead, add aCHECK (col IS NOT NULL) NOT VALIDconstraint (or use PostgreSQL 18’s nativeNOT NULL ... NOT VALID). - Idempotent backfill and validation second: Run
ALTER TABLE ... VALIDATE CONSTRAINTin a separate transaction (taking only aSHARE UPDATE EXCLUSIVElock), and confirm what happens if the backfill stops halfway or runs twice. - Promote or drop last: Only remove old columns after old binaries are gone. Reverting the application binary never rolls back transformed rows, so the author needs to state upfront whether the change is reversible or requires repairing forward.
Retries, Reconnects, and Operational Limits
AI tools are remarkably good at writing the happy path and remarkably bad at writing bounded failure loops. The SharedWorker reconnect storm looked something like this in spirit:
// Passes unit tests that simulate a single disconnect,
// but spirals endlessly when the worker keeps dying in a live tab.
function connect() {
const worker = new SharedWorker('/sync-worker.js');
worker.port.start();
worker.port.onmessage = ({ data }) => {
if (data.type === 'disconnected') setTimeout(connect, 200);
};
worker.onerror = () => setTimeout(connect, 200);
}
The unit test simulated one drop, saw connect() fire, and turned green. Under real browser lifecycle events, there was no exponential backoff, no retry cap, no single-flight guard against overlapping timers, and no circuit breaker to surface a degraded state to the user. A bounded version makes those limits explicit (illustrative pattern):
let attempt = 0; // reset to 0 after a healthy handshake
let reconnectTimer = null;
const MAX_ATTEMPTS = 7;
function scheduleReconnect(onDegraded) {
if (reconnectTimer !== null) return; // single-flight guard
if (attempt >= MAX_ATTEMPTS) return onDegraded();
const baseMs = Math.min(30_000, 500 * 2 ** attempt++);
const jitterMs = Math.floor(Math.random() * 250);
reconnectTimer = setTimeout(() => {
reconnectTimer = null;
connect(onDegraded);
}, baseMs + jitterMs);
}
Whenever a PR touches networking, workers, queues, or infrastructure config, look directly at timeouts, backoff ceilings, retry caps, and blast radius. Check whether permissions are scoped to what the workload actually needs and what alert will fire when the feature degrades silently.
Checking contracts, rollouts, and retry limits takes real focus, and that focus collapses the moment someone drops a 400-line AI-assisted diff with a blank description.
Require Context Before Reading Line One
If an author opens a large AI-assisted PR with an empty description and expects me to reverse-engineer the intent from the diff, I send it back. Before I dive into the code, I want four short answers in the PR description:
- Intent and invariants: What changes for callers, and what must never break?
- Changed commitments: Which APIs, events, schemas, or permissions are touched?
- Real evidence: What was tested outside mocks (query plans, consumer compatibility, failure paths), and what is still uncertain?
- Rollout and recovery: In what order does this ship, and how do we recover if it misbehaves?
Skip that four-question template on small, reversible internal refactors, copy tweaks, or test-only PRs that touch no external contract, database schema, retry loop, or permission boundary. Requiring heavy ceremony on trivial diffs breeds rubber-stamping; reserving it for high-consequence boundaries keeps reviewers sharp where failure actually hurts.
That handoff gives me a map, then I still trace the risky paths myself: walk a request through authorization and state transitions, trace what happens on duplicate delivery, and look closely at loops and retry branches.
One trap I see teams fall into: using a second AI reviewer to rubber-stamp AI-written code. An LLM reviewer is fine for spotting obvious null checks or suggesting an edge case to investigate, and I use it as a helper. It has zero accountability for production and no context on the legacy consumer sitting in another repo. Generated code plus generated tests plus an AI review can still encode the exact same wrong assumption three times.
Rule of thumb: Treat generated tests as proof that the code compiles and matches the prompt, not proof that it survives production. If a PR changes a schema, external contract, or retry loop, demand one piece of evidence from outside mocks before approving.
Catching a risky boundary protects today’s deploy, yet how you write the review comment decides whether you will catch the exact same mistake again next Tuesday.
Write Feedback That Teaches Judgment
Review comments should make urgency unmistakable. Label items clearly: Blocker for correctness, security, compatibility, or reliability issues; Question for missing context; Suggestion for optional improvements. Never disguise a blocker as a polite suggestion, and never bury a real risk under twelve style comments.
Here is the difference between feedback that creates a back-and-forth and feedback that teaches how to think about production risk.
On an API change:
Before: “Can we update the consumer?”
After: “Blocker: This renames
statustostate. Which deployed consumers still readstatus? Keep both fields during rollout or show compatibility against the current consumer version, since the new mock only covers the renamed shape.”
On a database migration:
Before: “Can we add a migration test?”
After: “Blocker: This adds
NOT NULLbefore the backfill completes. What happens to existingnullrows and writes from old instances mid-deploy? Split the additive column, backfill, andNOT VALIDconstraint, and note how we recover if the backfill stalls.”
Good comments name the failure mode and ask for evidence. When a thread turns into a design debate, stop typing in GitHub, jump on a ten-minute call or pair on the boundary, and write the decision back into the PR so the next engineer can read the reasoning.
Crucially, let the author do the investigation and fix the code. If I rewrite the PR myself to save twenty minutes, I ship one change faster and guarantee I’ll review the exact same mistake next week.
Over time, graduate engineers from reviewing bounded, low-risk PRs to owning high-risk boundaries while keeping required approvals and security checks intact. That is the core of technical leadership, and the only way team augmentation scales without turning your most senior engineer into a permanent merge bottleneck.
My Three-Question Filter Before Approving
When I’m about to hit Approve on an AI-assisted pull request, I check three things:
- Can the author explain the risky path? If the person who opened the PR cannot walk me through how retries, migrations, or permissions behave when things fail, the PR isn’t ready, no matter how clean the code looks.
- Did the tests touch reality? Were real consumers, realistic data volumes, and failure loops exercised, or did generated tests just validate generated mocks?
- Can we survive a bad deploy? Is the rollout safe with mixed versions running, and do we know whether to roll back or repair forward if production disagrees with staging?
If all three answers are solid, ship it. If any one is hand-waved, hold the merge and work through it together. Tidy diffs and green generated tests are effortless now; these three checks are what keep reality from breaking them.
Building a team that can review and own AI-assisted changes with confidence? Explore technical leadership, team augmentation, and our fixed-scope 2-Week Architecture Review, or let’s talk about your team.