Goal Loop
Steps
- Parse goal. Read
max_rounds(default5). Reject non-positive integer. - Infer completion criteria from goal and repo context. Record uncertainty as blocker only when it prevents safe next action.
- Choose smallest useful next action. Route through existing skill when one fits.
- Verify with narrowest useful check: test, diff, command output, artifact.
- Critique: what proves or disproves completion? What remains? Smallest next action?
- Criteria evidenced: stop
completed. max_rounds reached: stopmax_rounds. Else repeat from 3.
Rules
A round = one state-changing action + verification. Tool calls are not rounds. Do not spend rounds restating goal, polling without change, or speculative cleanup. Pause before commits, pushes, PR, deploy, production, credentials, irreversible ops.
Status
End with exactly one: completed, blocked (name unblocker), max_rounds (name remaining criteria).