// compaction is lossy on purpose. What survives is a
design decision.
The gate// continue or exit
The only question that matters.
Every lap ends at one if-statement. Checks green:
return. Anything left: around again. Going around again is the
feature.
# loop.py: the whole agentdefrun(task) -> Answer: state = State(task)whileTrue: # the ring you just walked state = turn(state)if state.done(): # the gatereturn state.answer
// exit on verified todos, not on the model feeling done.
That's one turn.
now give it a real task
Live// task: fix the flaky retry test
Now watch it compound.
Every lap starts with what the last one learned.
The trail is the record.
reproduce the failureturn 02
locate the causeturn 03
write the patchturn 04
re-run the suiteturn 04
write it upturn 05
// verify caught its own bad patch on turn 04.
The loop is the safety net.
Return// gate open5 turns · ctx 42k
It earned the exit.
Five turns, one failure, caught and fixed by the
loop itself. The answer leaves the only way it can: through the gate.
The drawing, complete
The loop is the product.
The model was one stop: the only line you don't write. Every other
stop is a design decision. That is loop engineering.