Loop State Contract — Specification
Purpose
Define the persistent state a recurring loop must keep so that a scheduled_stateful_loop —
and any loop_until_done that recurs — remains resumable, auditable, and honest about what is
done, what is in progress, what was escalated, and what risks remain open. State is one of the loop
preconditions in the Objective Gate Policy: a recurring loop without
persistent state is not admissible.
This contract is docs-first: it declares the shape of the state record; it does not implement a store, a scheduler, or a state machine.
Non-goals
- No runtime state store, scheduler, or persistence mechanism — the shape is a declaration; where and how it is stored is a project decision governed elsewhere.
- No restating of loop permission rules — the conditions under which a loop may run at all are in the Objective Gate Policy; this contract only defines what the state must contain once a loop is permitted.
- No parallel audit record — evidence references in the state point into the audit surface defined by the Execution Audit Record.
Declaration shape
loop_state:
loop_id:
last_run:
current_goal:
completed:
- item:
evidence:
in_progress:
- item:
next_action:
escalated:
- item:
reason:
owner:
lessons_learned:
- date:
note:
stop_conditions_met:
- condition:
evidence:
unresolved_risks:
- risk:
mitigation:
next_action:
Normative rules
- Recurring loops must persist state. Any loop that runs more than once across sessions or schedules must maintain this record; without it, each run re-discovers context, repeats work, and loses escalations.
- Completion claims require evidence. Every
completed[]item and everystop_conditions_met[]entry must carry anevidencereference. A loop must not mark its own work done on self-assessment alone (see Maker-Checker Policy). - Escalations must name an owner. Every
escalated[]item must carry areasonand anowner; an escalation without a human or role accountable for it is not an escalation. - Open risk is recorded, not hidden.
unresolved_risks[]must list what the loop knows is unhandled, with its currentmitigation; an empty risk list is a claim that must survive review. - Knowledge Governance restricts what may be persisted. The Knowledge Governance Layer governs source authority, sensitivity, and restrictions. No restricted context may be persisted in loop state or logs: state entries, evidence references, and lessons learned must respect the restricted knowledge usage policy and the sensitivity rules of the knowledge source contract. Persisting restricted content into a long-lived state record is a governance violation, not a convenience.
Related
- Objective Gate Policy — when a loop is permitted at all
- Execution Pattern Selection — where
state_requiredis declared - Execution Pattern Library —
loop_until_doneandscheduled_stateful_loop - Orchestration Contract —
rerun_logicfor orchestrated reruns - Execution Audit Record — where loop evidence is audited
- ADR-008 — Knowledge Governance Layer — persistence restrictions