Miguel Sanz

Why your AI agents keep starting from zero

The problem is not only memory: without a contract, verification and closure, every session explores again and can declare victory without evidence.

Rutas de exploración de un repositorio convergen en una corriente verificada con puntos de evidencia.

An agent can know your rules and still close a task badly. It can read the architecture, inspect the right files and then claim it finished without exercising the affected behavior.

That is the reset that matters: not forgetting one piece of information, but improvising the working process again in every session.

Context does not replace control

Repository instructions solve a real part of the problem. AGENTS.md, folder rules and shared skills help different tools find the same standard.

But an instruction describes what must be respected. By itself, it does not guarantee that the agent will:

  1. declare the result it is going to deliver;
  2. turn that result into observable criteria;
  3. run the right test;
  4. fix the failure;
  5. close only when evidence exists.

Without that sequence, a session can accumulate context and still operate blindly.

Memory sustains the work. The loop decides whether the work is actually done.

The failure pattern

The cycle usually looks like this:

  • the agent explores files without an exit condition;
  • it finds a plausible implementation;
  • it changes code;
  • it runs partial validation or none at all;
  • it summarizes its intention as if it were a result;
  • the next session finds the failure and starts exploring again.

The bill is not only repeated tokens. It also appears as unnecessary diffs, regressions and human time spent reviewing claims that have no command behind them.

Externalize the loop

Cardumen turns that discipline into repository infrastructure.

1. Declare the result before code

C.R.E.A. forces a contract: deliverable, acceptance criteria and verification command. The idea stops living only inside the model's context window.

2. Verify with the real system

The agent does not evaluate itself. Authority comes from the test, build, browser or operational check that matches the modified surface.

3. Retry until green

A failure does not become a defensive paragraph. It becomes the next loop input: read the evidence, fix the cause and run again.

4. Split without losing the exit condition

For a large feature, cardumen run --tree preserves the global result and closes every leaf against evidence before moving on. Decomposition stops being a decorative list.

What changes for a local or cheaper model

A less expensive model does not need a promise of “intelligence”. It needs a narrower path:

  • less directionless exploration;
  • rules available before deciding;
  • a concrete test at the end of every step;
  • a mechanism that prevents premature success claims.

This does not make all models equal. It reduces the operational discipline each model has to invent internally.

How to test it without buying the story

Take a representative task and define two runs:

  1. same repository;
  2. same model;
  3. same prompt;
  4. one run with the harness and one without it;
  5. external judge: tests, build or adversarial review;
  6. record tokens, time, steps and failures.

One run does not demonstrate a trend. It can reveal whether the mechanism avoids a specific failure. Repeat, keep the bad cases and publish the limit alongside the result.

Limit

The harness does not fix a false specification or turn an incapable model into a capable one. It also depends on the repository having real signals: useful tests, maintained rules and reproducible commands.

The smallest — and most defensible — thesis is this: an explicit loop makes it harder to finish without evidence.

Traceability

Sources and scope

  1. Introducing Codex — OpenAI

    Confirms the role of tests, linters and file citations as reviewable evidence of an agent's work.

  2. AGENTS.md — an open format for guiding agents

    Supports versioned instructions close to the code for guiding different agents inside the same repository.

  3. Cardumen evidence

    Documents Cardumen's on/off methodology, small samples and benchmark limits.