Definition

Goal-Seeking Loop

Iterate until a discrete completion condition is met. Build new things from specs. IO-1 in the iteration-objective taxonomy.

definitionai-agentsiteration-objectiveautomation

Iterate until a discrete completion condition is met. Build new things from specs. IO-1 in the iteration-objective taxonomy.

A goal-seeking loop iterates until a discrete, binary completion condition is satisfied: “the system compiles,” “three consecutive submissions succeed,” “all specs are built.” Unlike metric-ratcheting (IO-2), there is no scalar to optimize; the loop either reaches its goal or stalls. The canonical vault instance is the Ralph Loop, which iterates over spec files until each component is built. The Lever Ralph Loop added a completion promise (LEVER_GREEN = three consecutive submits) as the termination signal.

How It Works

Define completion condition → attempt one unit of work → check condition → if met, stop; if not, diagnose, hypothesize, apply ONE fix → re-check. The key discipline is single-variable changes: each iteration modifies one thing, so diagnosis can attribute cause.

Signal Type

Binary: done or not done. No gradient information: the loop doesn’t know “how close” it is. This makes goal-seeking loops vulnerable to stalling when the completion condition requires multiple simultaneous fixes. Mitigation: break the goal into staged sub-goals (the Lever Ralph Loop used stages 0-5).

Academic Exemplars

  • Voyager (Wang et al. 2023): LLM agent in Minecraft with automatic curriculum of goals. Each goal is binary (craft diamond pickaxe: yes/no). Skills compound via a persistent library.
  • RepairAgent (Bouzenia et al. ICSE 2025): Autonomous bug repair. Goal: all tests pass. FSM-guided tool invocation prevents aimless iteration.

Vault Instances

  • Ralph Loop: iterate over spec files, one agent per spec
  • Lever Ralph Loop: 12 iterations to LEVER_GREEN (3 consecutive submits)
  • Dashboard QA Loop: one ralph loop per issue, highest severity first