Skip to content

3.7 The Outer Loop

Wrap an agent run in a code-owned loop with a deterministic verifier: a machine-checkable stop condition, structured feedback, a cost cap, and a way to tell futility from progress.

Also called: loop engineering, verify-and-retry, the Ralph loop, autonomous loops.

Stub: scaffolding, not finished writing · planned for a later release. The skeleton below shows the beats this chapter will hit. Contributions welcome.

Why you'd reach for it

The problem, what breaks without it, and when you need it. To be written.

What it actually is

A crisp definition, the maturity call argued with cited evidence, and how it differs from its neighbours. To be written.

How to do it

Code included from a tested file in listing-studio/, so the prose can't drift from working code. To be written.

Gotchas

The real costs and when not to, feeding the Anti-Patterns Catalog. To be written.

In short

A weighted recommendation: what you would actually do. To be written.

Maturity: Established (the verify-and-retry form; the self-improving form is Contested and lives in 9.7) · Grounding: companion repo + research · Last reviewed: 2026-08

Sources

Citations added as the chapter is written. Every non-obvious claim gets a footnote.

See also

Related chapters.