← Wiki · App

The invocation doctrine

Every LLM call in RHA Wrapper is a stateless fresh instance — invoke, read the result, stop. There is no agent that iterates on its own work. What looks like a loop is a series of independent invocations, and the thing that persists between them is never the model's context window: it is the supergit substrate.

Each invocation's context is compiled from the substrate: the frozen contract for the unit being worked, compiler diagnostics, calling-line evidence from the files that consume the unit, and documented prior resolutions (lessons). What is never included: the unit's own broken content, or any previous failed attempt. Feeding a model its failure re-samples the failed distribution — temperature notwithstanding, you are exploring the neighborhood of the mistake. This is why anchored retry plateaus while fresh draws converge.

Why this works

With per-try success probability p, independent tries approach certainty: at p=0.5, five tries reach ~97%. But the tries must actually be independent — decorrelated by fresh context and a temperature ladder. A model shown its own broken output produces correlated tries, which is why naive retry loops grind (170→170→169) instead of converging. The system's stall detectors exist to catch exactly that correlation; the entropy reset restores independence.

One bug at a time, fully resolved, documented as a lesson, generalized mechanically to every same-shape instance — that is the loop. Batching twenty shallow repairs per pass is the anti-pattern this doctrine replaces.