mechanism · 04

The turn loop

Inside execute, the model takes turns: ask for a tool, run it, repeat. It stops when it stops asking — and that is only an opinion until the gate checks it.

maps to as-built §9

inside execute · the model takes turns
Call a tool, run it, repeat, until it stops asking The model sits at the center. On each turn it either calls a tool or stops. When it calls a tool, deadreckon runs that tool inside the sandbox and feeds the result back for the next turn, so the loop continues while the model keeps asking. When the model stops asking and claims it is done, that claim goes to the dr-gate watchdog. If the gate's checks pass, the run is promoted and finishes; if they fail, the run goes back for another turn. There is a hard cap of twelve turns. THE MODEL each turn: think, then call a tool, or stop SANDBOX run the tool: edit, shell, tests (isolated) calls a tool result → next turn loops while it keeps asking · hard cap 12 turns stops asking · claims done dr-gate · the watchdog runs your "done" checks signs only if they pass the agent can't sign for it signed ✓ ACTUALLY DONE: promote checks fail → another turn
Stopping is just the model no longer asking for tools, an opinion. The gate is what turns that opinion into a fact.

Inside the execute phase, the work happens as a series of turns. On each turn the model does one of two things: it asks to run a tool, or it stops. As long as it keeps asking, deadreckon runs the requested tool inside the sandbox (an edit, a shell command, a test run) and hands the result back for the next turn.

Eventually the model stops asking for tools. In an ordinary agent, that is the end: "no more tool calls" is treated as "done." But "I stopped" is just an opinion the model formed about its own work.

deadreckon does not take that opinion at face value. When the model claims it is finished, the claim is handed to the dr-gate watchdog, which runs your definition of done. If the checks pass, the run is promoted and finishes. If they fail, the run goes back for another turn with a corrective hint, up to a hard cap of twelve turns.

The key move. Separating "the model stopped asking" from "the work is actually done" is the whole game. The next two chapters are about the thing that enforces the difference: the gate.

source