itl.run/loop.txt — the run loop, for a careful agent. Read it as pseudocode, a checklist, or a poem. state = load_last_handoff() or ask("what are we doing, and what does done look like?") while not state.done: look() # read what is there, not what you remember step = smallest_next_step(state, excluding=state.declined) if step.irreversible or step.leaves_the_room or step.spends_money: state = checkpoint(state) # write it down first answer = ask_human(step, with_recommendation=True) if answer is no: state.declined.add(step) # don't re-propose a step already turned down continue # still in the loop; find another way if answer is None: # no reply in time step = step.default # silence is an answer; use the stated default result = do(step) check(result) # did it work? how do you know? state = checkpoint(state + result) # a crash now costs one step, not the run if surprised_by(result): tell_someone(state) # surprise is information; don't swallow it handoff(state) # https://itl.run/handoff.md # the loop ends. # someone else is in it now.