AI agents can generate code quickly, but review, validation, and maintenance do not automatically become faster. The practical response involves limits on diff size, behavior-focused tests, and ADRs that control explanation debt.
Coding Agents Ship Faster, but Comprehension Lags
A Hacker News front-page discussion raised a concrete question: What should engineers do with AI-generated code they do not understand but have already shipped?
The original discussion is item 50151036:
https://news.ycombinator.com/item?id=50151036
The HN summary quotes a Meta engineer who posted the following on LinkedIn:
“I'm a Meta engineer, and I've never felt so uncomfortable with my work when using AI to write code.”
The issue is not whether AI can generate code. It is who remains accountable after the code ships. A model may produce hundreds of lines of diff in minutes, but an engineer still has to inspect them line by line. Validation consumes some of the time saved by generation.
Why a Meta Engineer Felt Uncomfortable
Traditional software development usually includes a natural braking mechanism:
- An engineer writes the implementation.
- Debugging forces the engineer to examine the control flow.
- Colleagues provide review feedback.
- Production failures bring the developer back into the code.
The process is slow, but it creates understanding along the way.
LLMs compress the middle of that process. An engineer provides the requirements, and the model returns a complete implementation. The syntax may be correct, the directory structure may be clean, and the tests may even pass on the first attempt.
The problem is that code can look finished without being maintainable.
The Meta engineer quoted in the HN summary did not say the code was completely incomprehensible. The concern was that the engineer understood the system design without understanding every implementation detail.
If code is completely incomprehensible, an engineer is unlikely to merge it directly. Partial understanding presents the greater danger.
The developer knows why the requirement exists and how the result will be used. But the recursion, cache invalidation, lock ordering, and retry boundaries added by the model cannot necessarily be proven correct on sight.
Unfamiliar code encourages caution. Partially understood code encourages confidence. The latter is more dangerous.
Generation Speed Is Not the Scarce Resource
Local coding agents can already modify files in parallel, run tests, fix lint errors automatically, and repeatedly attempt compilation.
That creates a misleading team metric:
Lines of code generated per unit of time.
This number will usually rise, but it does not measure delivery efficiency on its own. Teams also need to consider:
- How long review takes;
- Whether tests cover real behavior;
- How long production fixes require;
- Who can take over the code in three months;
- How much the change would be affected if models, dependencies, or internal interfaces changed.
Generation is only one part of the cost. Once generation becomes cheaper, the costs of validation, explanation, and organizational knowledge become more visible.
A team that accepts 800 lines of not-fully-understood code every day has not added 800 lines of useful assets. It may also have added 800 lines of explanation debt.
When I use tools such as Claude Code or Cursor, the biggest gains appear in boilerplate, dependency upgrades, test scaffolding, and mechanical changes across files.
The parts that require engineering judgment have not disappeared:
- Where state should live;
- Whether an operation can be retried safely after failure;
- Whether an API contract is stable;
- Which constraints the type system must enforce;
- Whether logs can reconstruct the state of a failure.
The more frequently code is committed, the faster mistakes can be replicated in bulk.
Set an Explanation Budget for AI Code
Rather than requiring every line to be understood, teams can give pull requests an enforceable explanation budget.
I would begin with three rules:
- Limit a single diff in a high-risk module to roughly 200 lines. Split anything larger into separate PRs; generating more code is not a reason to merge.
- Require the contributor to explain key design choices, non-obvious branches, and failure modes in critical implementations. Unexplained code does not enter the main branch.
- Require behavior tests for code involving permissions, money, data deletion, migrations, or external APIs. Record long-lived design decisions in an ADR.
200 lines is not a universal standard. Database migrations and protocol redesigns may naturally require larger changes. The limit is intended to bound the cognitive batch size.
The goal is to keep each review within a defined boundary.
An ADR is an Architecture Decision Record. It does not need to be long, but it should answer at least these questions:
- Why was this approach selected?
- Which alternatives were rejected?
- What conditions would invalidate the decision?
- How will the team monitor risk after deployment?
The explanation should not live only in a chat window or depend on one engineer's memory three weeks later.
Use Failing Tests to Reject Code That Merely Looks Complete
Syntax pass rate is a poor measure of LLM coding quality. Models are highly capable of producing syntactically valid code.
A more useful approach is to write failing tests before asking the model to implement the behavior.
The following Python example specifies pricing behavior:
from decimal import Decimal
def calculate_total(unit_price: str, quantity: int, discount_percent: int = 0) -> str:
unit_price = Decimal(unit_price)
subtotal = unit_price * quantity
discount = subtotal * Decimal(discount_percent) / Decimal(100)
return str(subtotal - discount)
assert calculate_total("19.90", 3) == "59.70"
assert calculate_total("10.00", 2, 25) == "15.00"
try:
calculate_total("10.00", 1, 101)
except ValueError:
pass
else:
raise AssertionError("discount above 100 must fail")
The test does not cover invalid paths such as a negative unit price or quantity. To enforce those constraints, the function would also need input validation.
A test that fails first usually demonstrates that it constrains behavior the implementation does not yet provide. Once that failure is confirmed, the implementation can be handed to the LLM.
I would track two metrics separately:
- Syntax pass rate: Whether the code parses, imports, and runs;
- Behavior coverage: How many specified scenarios, boundary conditions, and failure paths are constrained by tests.
The first metric can easily approach 100 percent. The second reveals whether the model actually understood the requirements.
Tests should express external behavior. Do not rewrite a test merely because the implementation uses a particular internal helper, and do not make the test depend on incidental details to make the model's job easier.
Reject the merge if generated code fails the tests. If the code passes but the contributor cannot explain its critical branches, postpone the merge.
This process adds a validation step, but it puts risk in the right place.
Editorial Perspective
The significance of this discussion is not the Meta engineer's subjective discomfort. It is that generation, validation, and accountability are losing their previous balance.
Engineers used to write most implementations themselves, so understanding developed alongside production. Once LLMs separate implementation from comprehension, the person committing the code becomes its guarantor. They must demonstrate that the behavior is correct and explain why maintainers can trust it.
In my view, the scarce resource in the next phase of AI-agent development is not a longer context window or faster autocomplete. It is a team's ability to preserve causal understanding at low cost. Failing tests, ADRs, bounded diffs, and reproducible benchmarks matter more than generation speed alone.
This differs from Copilot-style completion. Completion usually fills in the function at hand, while a coding agent can submit changes across multiple files and run commands on its own. Its impact is broader, so review methods cannot simply be carried over unchanged.
One question remains unanswered: If a team accepts lower comprehension in exchange for throughput, is an explanation budget genuine engineering discipline or merely decoration in the release process? There is not enough evidence to settle that question. What is clear is that accountability does not transfer to the model.