A loop needs a state you can inspect
A loop repeatedly observes a situation, chooses a permitted action and evaluates the result. Define the state explicitly: waiting for input, preparing, checking, done, blocked or failed. A timestamp showing that a process woke up does not establish that useful work completed.
Consider a weekly source digest. The trigger may be a schedule, but the work identity should name the digest period. Store the input set and the output artifact separately from the scheduler's status. A second invocation for the same period should find existing state rather than silently create another publication.
Recovery is part of the design
Use a stable work identifier to recognize repeated requests. If an external action times out, its outcome may be unknown: the service may have completed it while the response was lost. Blindly retrying can duplicate the effect. Inspect a receipt or use an idempotent operation before trying again.
Bound attempts, elapsed time and resource use. A failure should preserve enough context for diagnosis without retaining secrets. Some failures deserve a retry; a missing authorization or contradictory source usually deserves a stop. Decide that distinction before leaving a process unattended.
Learning requires a comparison
A loop that edits its own prompt has changed, but has not necessarily improved. Keep a fixed evaluation set and compare the candidate with the previous version. Preserve regressions and difficult cases. Promote a change only after a named criterion is met.
In this Academy, reflection and revision are learner-controlled. No hidden model trains on your notes. You can export a record of the initial attempt, feedback and transfer exercise. The same principle applies to an agent system: make the change and its evidence visible before calling it learning.
Explore a bounded agent loop
The same workflow. Three different outcomes.
- 1Observe
- 2Prepare
- 3Check
- 4Done
Observe
Three public source files are available. The requested output is a local comparison draft.
An illustrative trace. No model, tool or external action is executed.
A worked example · Illustrative
A bounded digest loop
Work ID: digest-2026-W38
Trigger: manual invocation in this exercise
States: waiting → drafting → checking → done
Failure states: blocked | failed | outcome-unknown
Budget: 2 attempts, 10 minutes
Retry: only after the previous effect is known
Done: output exists AND every required check passes
Improvement: compare v2 against v1 on fixed fixturesPut the idea to work
Your practice
- Draw the normal path and three failure paths.
- Name the work ID and the evidence required for done.
- Add a timeout case where an external effect is unknown.
- Change one instruction, then compare old and new behavior on the same examples.
