How many attempts, by how many agents, and what has to be true before it stops
Twelve steps, four parts, three runnable jobs — eight switchable layers, and one rule you can apply before writing any code.
- All 12 steps, read online
- Runnable labs to download (plain Python, runs offline)
- Free updates whenever it's revised
- 14-day refund (conditions)
Introduction
Your agent handles the easy cases and then, on the rest, does one of three things: it spins, it gives up, or it announces an answer that is wrong. You have read that the fix is more agents, and you are about to build a crew of four, because that is what the examples show.
Two failures that look the same and are not
Everything in this volume rests on telling these two apart, because almost every technique in the subject treats only the first one.
| the failure | what the loop sees | what more turns do |
|---|---|---|
| it knows it failed | the check says not done | help — step 6 measures how much |
| it thinks it succeeded | the check says done, and it is wrong | nothing, ever — step 9 |
More turns help a loop that knows it has failed. They do nothing at all for a loop whose own check is satisfied by the wrong answer — and no amount of retrying, budgeting or stall detection changes that, because none of those layers is looking at whether the answer is right.
What loop engineering is
Loop engineering is the practice of deciding how many attempts an agent gets, who makes them, and what has to be true before it is allowed to stop.
Eight switchable layers in four phases. This volume measures what each one buys by holding the model fixed — it is scripted and deterministic — and turning the layers on and off around it. A change in the outcome can only have come from the loop.
| phase | the question it answers | layers | stages |
|---|---|---|---|
| more time | how long before you stop? | budget · stall | 5–6 |
| another go | what if one attempt was not enough? | retry · escalate | 7–8 |
| more agents | what if one worker is not enough? | split · review | 9–10 |
| keeping them honest | what does splitting break? | handoff · arbitrate | 11–12 |
The honest headline, up front
Is this for you?
| if… | then |
|---|---|
| your agent stops early and says it is done | step 9 — and more turns are not the answer |
| you are about to split one task across several agents | step 7, which counts what that costs before it counts what it buys |
| you have a crew of four and one of them is wrong | step 7's second half: someone has to be allowed to settle it |
| you are adding layers in order and it is getting worse | step 11 — that is measured here, and it recovers |
| your loop finishes, correctly, and you cannot say why | step 4. Nothing else in this volume works until a turn is defined |
The three jobs
One task each, made of four parts, so a run can be partly right. They are chosen to differ on the one property step 11 turns into a rule.
| job | the task | what a wrong answer looks like | can a second attempt see its own failure? |
|---|---|---|---|
| A | fix-a-test — one program, four bugs | the suite goes red | yes |
| B | triage — one failure, four artifacts | a plausible wrong cause | no |
| C | answer — one question, four documents | a figure with a qualifier | yes |
How the measurement works
One scripted model, one fixed turn order, and every figure reproducible byte for byte.
--ablate prints four blocks rather than one, and the reason is a finding in
its own right:
| block | what it does | what it hides |
|---|---|---|
| the ladder | turn the layers on one at a time, cumulatively | that adding the next layer can make things worse |
| leave-one-out | remove each layer from a complete loop | any layer whose job is to repair another layer's damage |
| split baseline | remove each layer from a loop that has only been split | nothing — this is where phase 4 becomes visible |
| stress | each layer on, then off, against a complete loop | the same blind spot as leave-one-out, one layer at a time |
The third block exists because of the result in step 7: a layer that repairs damage caused by another layer measures as worthless in any configuration where the damage is already repaired. That is a fact about the instrument, not about the layer.
How to read the source labels
| label | means |
|---|---|
| concept | argued from first principles, quotes nothing from a lab |
| measured | a lab compares configurations and reports the difference |
| hands-on | you run it on your own material |