token overlimitWrite a postSign in

Side by side

Compare the approach, not just the result.

Keep the goal, setup and observations together. A different context can change what works.

Each column keeps the version selected. Missing information is not inferred.

discussion · version 1

My coding agents kept adding hard gates. One gap in 281 facts killed a two-hour run.

Read this version · Latest

I’ve watched coding agents fill agent pipelines with hard gates, and I have a guess about why. Here’s the case, then the questions I’d like other people’s experience on.

What happened

I started with a rule-based data pipeline built with Claude Code. Clean data went through fine. Real filings aren't clean. The same account has a different name at every company, the spacing varies, and plenty of line items carry company-specific codes instead of the standard taxonomy codes. The rules kept missing them.

So I rebuilt it as an agentic pipeline. Agents read the filing, pull out accounts and values, and map them to our internal accounts. Deciding what a line item means is semantic work, and rules were never going to do it well.

For a while Claude wrote the code and GPT reviewed it. Claude was slow and wordy for my taste, and GPT's judgment felt better for this work, so from version 5 I had Codex (gpt-5.6 sol) do the design, the code, and the review. I deployed the new version to the dev server. Almost every run failed.

It took a while to find out why. Every stage had hard gates. In one run, 281 facts were saved, and 149 of them were accepted financial statement facts. One statement for one fiscal year was missing. A readiness check decided the run wasn't complete and failed the job after about two hours. No file. The user got a failure message.

I was going to tell the agent to take the gates out. Then I realized the gates were just the part I could see. The design assumed the agent inside the pipeline couldn't be trusted, so every step had some deterministic check, state, or fallback wrapped around it.

The numbers that told me it wasn't one bug

When I finally measured it, the semantic extraction core alone was 40,091 lines in 19 files. One service file was 15,443 lines. The extraction agent had 37 tools. In the four days before I stopped, one Codex instance implemented and another reviewed, 20 rounds in a row, and all 20 reviews came back CHANGES_REQUESTED. Every fix broke something else.

Some of that was my process. The SPEC-driven harness wrote very detailed specs, and the agents implemented every line of them.

What I changed

  • Rebuilt it simple-first (version 6). Filing, agent extraction and mapping, intermediate results, template workbook. That's the whole path. I redesigned around it and stopped using the SPEC harness for implementation.
  • Took the quality gates out of the data path. Missing coverage, unresolved mappings, and partial results are warnings now. The run keeps whatever it found.
  • Then did the same for the Excel step. Once data was landing in the database reliably, workbook generation became the thing that failed. It had its own pile of hard gates.
  • Kept gates only where a rule can actually decide: template structure, formulas, file integrity, auth, storage. If the file would come out broken, the run stops. If a value is missing, the cell stays blank and a diagnostics sheet says why.
  • Put it in AGENTS.md. In August the pattern showed up again in a different feature, where an evaluator's result was turned into a completion gate. I reverted it and added these rules (excerpt, translated from Korean):
  • Do not add deterministic hard gates that replace a semantic task with rule-based logic, even when the agent does not behave as expected.
  • Do not fail a workflow deterministically because the response content or shape, tool call order, evaluator score, or domain result differs from what was expected.
  • Evaluator results are feedback the agent uses to decide on rework. Do not use them as a completion or failure gate.
  • Use deterministic validation only for system faults: auth and permissions, transport and provider errors, parsing and protocol errors, tool availability, storage and transaction integrity, security boundaries.
  • Fix unexpected agent behavior first through prompts, skills, and context.

These days I add rules like this to AGENTS.md or CLAUDE.md in any project where the product is an agent or its output is non-deterministic.

Where it stands now

Data reaches the database reliably. After I allowed gaps and removed the gates, the hit rate went up. The Excel step now produces the workbook, with blanks and diagnostics where data is missing.

My read (not tested)

If I see 99 of 100 values filled in, I think: fine, I'll fill the last one. The coding agents I used treated any gap as a failure. My guess is that coding work rewards passing every test and handling every case, and the agents bring that habit into systems whose output is probabilistic. In my pipeline, that thoroughness was the problem.

I've built several agent products since, and newer models haven't changed this for me. I've seen it with Opus 5.5, gpt-6.1-sol, Fable, and Astra, with and without the SPEC harness. I'm back to using Opus 5.5 (it's much less wordy now) about as often as gpt-6.1-sol, and I add the rule for both. I haven't run a controlled comparison, so take this as an impression.

What I don't know yet

  • Do you see the same thing with other models or harnesses? If not, what in your setup prevents it?
  • Apart from rules in AGENTS.md or CLAUDE.md, have you found another way to stop agents from adding quality gates?
  • Where do you draw the line between a gate that protects the output and one that blocks it?

If you've tried something similar, I'd like to hear how it went, including if it didn't work.


Setup & context

Agent environment
Claude Code, Codex
Model
Claude Opus 4.8 (early versions); gpt-5.6 sol (review, then design, implementation, and review from version 5)
Instructions and prompts
AGENTS.md rules added after the fix: no deterministic hard gates that replace semantic work; don't fail a workflow because output shape, tool order, evaluator score, or domain result differs from expectations; evaluator results are rework feedback, not completion gates; deterministic checks only for system faults; fix agent behavior through prompts, skills, and context first.
Plugins
SPEC-driven harness (MoAI), used until version 6

Strictly necessary cookies keep you signed in and remember this choice. They are always on.

Read the Cookie policy and Privacy policy.