← Back to the blogVerifying AI code

Additions, omissions, regressions: the three gaps in AI-generated code

AI-written code can pass review and still drift from the spec in three ways. A checkout change shows how to name additions, omissions and regressions.

October 27, 2026 · 7 min read

AI-generated code compiles, passes the tests you already have, and ships. It can still be wrong in ways nobody on the team would call a bug. We find it useful to sort those ways into three buckets, because a problem you can name is a problem you can go looking for.

More output, same reviewers

Coding assistants changed the pace of most teams in about a year. Faros AI’s The AI Productivity Paradox report (July 2025, telemetry from more than 10,000 developers across 1,255 teams) found that teams with high AI adoption merge 98% more pull requests. Review time in those same teams went up 91%. More code arrives, and the people who can judge it are the same people as before.

Confidence lags too. In Sonar’s State of Code Developer Survey (January 2026, more than 1,100 developers), 96% said they don’t fully trust that AI-generated code is functionally correct, and only 48% said they always check it before committing. Put those two numbers together and you get a lot of code that nobody quite believes in, merged anyway.

We don’t think this is a discipline problem. Most reviewers are careful people. The trouble is the question they’re handed. “Is this code correct?” is a question about the code. “Does this code do what we decided?” is a question about intent, and a diff on its own can’t answer it.

Setting up one checkout change

Let’s follow a single change all the way through. You run an online store, and the checkout module already follows three rules that are written down somewhere in the spec.

  1. A customer can apply one promo code per order.
  2. Promo codes don’t apply to items already on sale.
  3. Shipping is free when the order subtotal, after discounts, reaches $50.

Marketing wants a loyalty coupon that gives members $5 off their order. You hand the ticket to your coding assistant. It reads the cart service, the pricing helpers and the shipping calculator, then opens a pull request of a few hundred lines. The tests pass. In the demo, the loyalty coupon works.

Now look at what else happened.

Three gaps, in the order you’ll miss them

1. Additions, or code nobody asked for

While wiring the coupon, the assistant decided loyalty coupons should stack with promo codes, since they are “a different type of discount.” It also added a banner on the cart page reminding members to use their coupon. Both choices are reasonable. Nobody made either of them.

Additions are the hardest gap to object to, because they usually look like help. A banner, an extra log line, a case handled just in case. Yet a behavior nobody requested is a behavior nobody owns. Product never signed off on stacking. Finance has no idea a member can now combine $5 off with a 20% promo. Six months from now nobody will think to test it, and the next pricing change will run straight into it.

To spot an addition, you need the list of what was requested. Reading what was written isn’t enough.

2. Omissions, or a rule with no code behind it

Rule 2 says promo codes don’t apply to sale items. The ticket didn’t say whether the loyalty coupon follows the same rule, and the assistant never asked. Members can now take $5 off a clearance item that is already priced at cost.

You can’t see an omission in a diff. There’s no line to point at, because the missing line was never written. The only way to notice it is to hold an explicit list of expected rules next to the code and see that one of them has nothing behind it.

3. Regressions, or a rule that used to work

To apply the coupon earlier in the pipeline, the assistant reordered two steps in the pricing service. Shipping is now computed on the subtotal before discounts. A $52 cart with the $5 coupon used to pay for shipping, since the customer actually pays $47. Now it ships free.

No one was looking at shipping. The ticket was about coupons. That is the usual shape of a regression: it lands in the part of the module nobody had in mind. To catch it, you need every existing rule of the module in view, including the ones the ticket never mentions.

All three gaps compiled. Two of them would slip through most test suites, since tests cover what somebody thought to test. None of them jumps out of a 300-line diff.

SPECCODERefund within 30 daysEmail the receiptBlock expired cardsKeep order historyrefund()sendReceipt()nothingkeepHistory()autoCoupon()OMISSIONREGRESSIONworked before, broken nowBROKENADDITION
Three gaps between the spec and the code: an omission (specified, not built), a regression (existing behavior broken) and an addition (built, never asked for).

Reviews read code, so they need a reference

Put the three gaps side by side and they share a root cause. A reviewer, human or AI, reads the code. It can tell you the code is tidy and that nothing looks dangerous. It cannot tell you rule 2 is missing if it never knew rule 2 existed, and it cannot flag stacking as unrequested if it never saw the request. Tests share the blind spot. They check the cases someone wrote down, which is how the shipping regression got through, since no test combined a coupon with a cart just above $50.

Each time, the missing piece is a reference. Something that says, for this module, here are the rules, here is where each one lives in the code, and here is what the change was supposed to do.

Checking rule by rule, then looping

Lyriks builds that reference from the software you already have. It reads the code and extracts the spec, meaning features, user journeys, business rules, screens, objects, invariants and testable requirements. Each rule links to the code that implements it. “Free shipping from $50 after discounts” points to the shipping calculator and to the pricing step that feeds it.

When a change is approved, the spec goes to your coding assistant (Claude Code, Cursor or Copilot) over MCP, with its rules and their sources. The assistant writes the code. Then a deterministic engine checks the result against each rule. That verification step is deterministic, so the same code and the same spec always produce the same verdict.

Each gap goes back to the assistant with the rule it concerns. In the checkout example, the regression returns with the shipping rule and the step that changed. The omission returns with rule 2 and an open question about loyalty coupons. Stacking and the banner come back flagged, waiting for someone to keep them or drop them. The loop runs until every rule holds.

Your reviewers stop scanning hundreds of lines hoping to notice something odd. They read a short list of named gaps, each tied to a rule they understand. The Verify AI code page walks through the whole flow.

THE REFERENCE · CHECKOUT MODULERULESENT BACK WITHREGRESSIONFree shipping from $50after discounts, broken by a reorderthe shipping ruleand the step that changedOMISSIONPromo codes skip sale itemsrule 2, no code for the couponrule 2 and an open questionon loyalty couponsADDITIONStacking and cart bannerbuilt, never requesteda flag: someone decidesto keep them or drop themYOUR ASSISTANT FIXESLYRIKS RECHECKSEVERY RULE HOLDS
The reference for the checkout change: each gap is named, tied to its rule and sent back to the assistant, then rechecked until every rule holds.

Every release leaves a record

Each release gets a compliance report that sorts every affected rule as compliant, addition, omission or regression. This report is available today.

Different people read different lines of it. Developers look for what’s left to fix. Product owners check that the change does what was decided. A CTO wants to know whether the existing rules still hold. Over time the team builds a trail of what was verified, release after release, and against which rules.

The report doesn’t decide for you, and that matters most for additions. Sometimes the assistant has a good idea. Maybe letting members stack the loyalty coupon is exactly what marketing wanted and forgot to write down. Then the addition moves into the spec and becomes rule 4, owned and tested like the others. If not, it comes out. Someone chose, and the choice is on record.

Your own checkout, next

Pick a module where a recent change surprised you. Write down the rules you believe it follows, then compare them with what the code does today. If that takes you a week by hand, a demo will do it on your own code, and the next change will come with its first compliance report.

Which of the three gaps do you expect it to find first?

Go further

White paper · free · 15 pages

Verifying AI-written code: a deterministic approach

The verification gap in numbers, the three gaps to look for, why the check must be deterministic, and how a verification loop fits next to code review.

Keep your software in tune

Start with one module. Lyriks recovers its spec, then verifies every change. All it needs is your repository.