Skip to content
NEZ®

Engineering · · 2 min read

What senior code review looks like when the code is generated

NEZ Engineering

Essay cover: Senior review of generated code

In 2026, most of the code in a diff was probably not typed by a person. That changed the economics of software in one specific way: writing is cheap, and trusting is expensive. Review became the bottleneck, which means review became the job.

Reviewing generated code line by line is a losing game. The volume is too high, and the lines are usually locally plausible. The failures live at a different altitude, so that is where the review happens.

Boundaries. Who owns this state, and does the new code respect that ownership? Generated code loves to reach across layers, read what it should not, and duplicate a source of truth. The first question is never about syntax; it is about whether this change belongs where it landed.

Invariants. Every system has rules that must always be true: an order has exactly one owner, a balance never goes negative, a deleted record stays deleted. Models do not know your invariants unless someone wrote them down. The reviewer checks each one the diff could threaten.

Migrations. Schema changes are where generated confidence does the most damage. Is the migration reversible? Does it lock a hot table? Does it assume data cleanliness that production does not have? A wrong function ships and gets patched; a wrong migration becomes an incident with a timeline.

Error paths. Generated code handles the happy path beautifully and improvises everywhere else. What happens when the third API call in the sequence fails? When the webhook arrives twice? When the user closes the tab mid-flow? If the diff cannot answer, it is not done.

Tests that assert behavior. Generated tests often assert the implementation back at itself, which proves nothing. A useful test states what the user or the caller experiences, and would survive a full rewrite of the internals.

Just as important is what we deliberately let slide: style preferences, naming debates, the internal shape of a function that is small, well tested, and behind a stable interface. Spending review attention there is spending it away from the places that page you later.

The review question used to be “is this correct?” It is now “should this exist, and will it survive contact with production?” That question requires judgment about systems, not familiarity with syntax, and it is precisely the part of the work that did not get cheaper.