Vibe Coding

All Checks Green, Still Wrong: Isolated Verification in AI Coding

Key Takeaways

Two approved review rounds, tests and mutation checks passing, a cluster shutdown drill that worked — and an external black-box acceptance test still found a defect that could generate the same request twice. The main problem was not a weak model, but that criteria, tests, and review all came from the same plan. This post covers isolated verification in Loop Engineering: keep some of the eyes away from the plan, and let them read only the requirements and hunt for counterexamples.

December 1, 2026
20 min read
In this article

Part seven. The first six covered why you need a Loop, building one with Claude Code + Codex, stopping drift with Task Packets, turning prompt rules into machine gates, keeping the Loop itself from becoming the bottleneck, and helping the Loop learn from repeated mistakes. This one asks a more unsettling question: every check passed and the result was still wrong — what is the Loop missing?

An all-green mistake

The feature itself was simple. When a service instance is being shut down, it may be holding generation tasks that are in the middle of being submitted upstream. The old behavior was to mark them failed and refund the user. The new behavior: if this upstream call has already clearly failed, hand the task to another instance and let it try a different channel.

The most important red line here: the same request must never be generated twice.

The change went through every check we could think of at the time: two independent review rounds both approved, dozens of targeted tests and nearly twenty mutation checks all passed, the full regression run showed no new failures, a real shutdown drill on the shared test cluster handed tasks over successfully, and the smoke test in the test environment passed too.

The same day, an external two-instance black-box acceptance test came back: fail.

The most serious issue was this. On the first submission, the upstream returned HTTP 202 together with its own task ID — meaning "got it." The new code treated that hop as a clear failure and handed the task to a second instance, which picked another channel and submitted again. Against the mock upstream, both channels received a generation request and the platform ended up showing the second order as successful — the red line was crossed. With the feature off, and on the old version, there was only ever one submission.

We then started a separate agent and gave it only the original requirements, the red lines, and the code locations — no plan, no task packet, no tests — with one job: prove the change wrong. It raised 11 more counterexamples and risks. One of them: gateway timeouts at the proxy layer (504, 524) were also treated as clear failures and handed over, even though the upstream may already have accepted the request — another risk of submitting twice.

Every step was checking the same thing

Lay this verification chain out flat and it looks like this:

text
criteria written in the plan → tests written from the criteria → mutations derived from the criteria → a review that checks the code against the plan → an environment drill that ran a single happy path

Every step checked "the implementation matches the plan." None of them asked "are the plan's criteria right?"

The 202 case is the textbook example. The code's decision only looked at whether there was a status code, and did not recognize the acceptance information in the response. The tests were written around that decision, the mutations were derived from it, and so of course every mutation check passed — what it proved was that the tests catch code that deviates from the decision, not that the decision itself was correct. The reviewer read the code with the plan in hand and saw a consistent, well-tested implementation, anchored by the same plan.

So the main problem was not "a single model" but "a single frame." As long as the input is the same plan, a stronger model is no guarantee of escaping the same misunderstanding.

Two more things surfaced that were even more sobering. First, one guard test had faithfully locked in a wrong design: the design said the health history should not keep the inherited hop, so the test asserted that it didn't. Tests don't just miss mistakes — they can also freeze them. Second, the implementer had declared on its own that one risk was "acceptable," on the grounds that the fallback path only adds one extra hop — without measuring it, and without asking anyone.

Keep some of the eyes away from the plan

Our fix comes down to one move: make some of the verifiers unable to see the plan.

The first is an adversarial reviewer. After coding and testing, and before the first review round, we start a review that gets only the requirements, the red lines, and the diff — never the plan, the task packet, or the tests. Its goal is not to confirm the change is right but to find where it is wrong: every kind of response the upstream might return, every entry path, the combinations of switches actually turned on in production. For each counterexample it finds, the implementer has exactly three options: fix it and add a test, show with measurements that the path is unreachable, or hand it to a human to decide.

The second is the review itself. The reviewer does not read the plan first. It reads only the requirements and writes down what the change should and should not do, and only then reads the code. Wherever expectation and implementation disagree is a suspect — and it cannot be dismissed with "that's what the plan says," only with the original requirements or measured evidence.

On top of that, we re-enforced an old boundary: whether a risk is acceptable is a human decision; the AI can only propose it, with measurements attached. Earlier posts in this series already said so. The lesson this time is that the implementer stepped over it — and once that line gives way, both of the isolation steps above have a back door.

A second pair of eyes from somewhere else

Isolation answers "what gets looked at." There is also "who is looking."

Part two argued that, as long as the review conditions are independent, two models from the same family can still review each other usefully. That still holds. On top of it we are trialing one more step: the adversarial reviewer now defaults to a model from a different vendor (we use Codex; the implementer and the main reviewer are Claude, in separate sessions), and for high-risk changes we add another vendor's model in parallel during review. Switching vendors is meant to bring in a view from a different source — how much it actually adds is something we still need to watch.

One engineering detail is worth calling out when wiring in outside models: finished running is not the same as finished reviewing. We have seen a model refused permission to run a command return an empty report with exit code 0, and we have seen it reply "unable to complete" — also with exit code 0. So the calls go through a wrapper script that lets the machine catch failed calls and empty reports instead of trusting exit codes; a non-empty report still has to be checked item by item for an actual conclusion.

Isolated verification has a cost: every applicable work package needs at least one extra model call. So it only applies to standard- and strict-level work packages that change executable behavior; fast-track work and ops-repo packages skip it. It also comes with a review condition: if it still finds nothing useful after a few work packages, it gets scaled back. As the previous post put it, a healthy Loop has to be able to delete things — new rules included.

Closing

In this verification chain, mutation checks proved the tests catch code that deviates from the decision, review confirmed the code matched the plan, and the environment drill proved the path the plan described actually works. All of that matters, but all of it stood inside the same understanding.

Green tests prove the implementation matches your understanding; only eyes standing outside that understanding have a chance to tell you the understanding is wrong.

In AI coding, standing outside doesn't happen on its own. This time, the plan, the tests, and the review all followed the same criteria, and could only confirm one another. What isolated verification does is plain: deliberately keep some of the eyes away from the plan, let them read only the requirements, and send them looking for counterexamples.

Generate one yourself with JIUFENG

Create AI images and videos with sound in your browser: write a prompt, pick a model, download the result. 5 free credits on sign-up, no credit card.

Start creating free