name: iterate description: "Internal Harness instruction source for iterate. Route through visible Harness aliases or hook contracts instead of invoking directly."
Iterate
Use this only for WF10 experiment-loop state. It owns iteration_log.json; it
never writes stage transitions into PROJECT_STATE.json or .auto_iterate/**.
Read First
- Workflow, context, contract, lesson, code-style, review, language, docs, and
commit checkpoint rules under
../../../.agents/references/ - Research supervision assets:
research-supervision-patterns.md,research-supervision/experiment-and-build-canvas.md, andresearch-supervision/ai-assisted-research-workflow.md ../../../.agents/references/run-artifact-contract.md./references/iteration-log-schema.json,./references/iteration-context.md,./references/iteration-constraints.mditeration_log.json,PROJECT_STATE.json,CLAUDE.md, evaluation/baseline contracts, glossary, and lessons when present
State Rules
iteration_log.jsonis the experiment source of truth.- New or migrated logs use
schema_version: "2"with per-iterationaction_stateandimplementation. $orchestratorownsPROJECT_STATE.jsontransitions.- Stable file/interface changes sync
project_map.jsonwhen present. - Auto-iterate may invoke phases through a runtime adapter, but it only reads
iteration_log.jsonpostconditions. - Active context belongs in
.agents/state/iterations/<iter-id>/context.jsonplus.agents/state/current_iteration.jsononly when needed.
Preflight
Load active iteration plus 5 recent summaries; reference full history and Gate
ledger by path. Resolve latest id, status, decision,
config_diff.planned_command, target script, git_commit, run_manifest, and
metrics/report availability.
Scan auto_paper_output/*/run_request_register.{json,md} and fold the highest
priority unclosed request into planning unless a higher-priority WF10 blocker
exists.
Recommend exactly one next command unless asked for a playbook. Prefer
action_state.next_action; migrate legacy logs with
tooling/evidence/migrate_iteration_log_v2.py or map status:
planned|coding -> code, ready_to_run -> run_screening|run_full,
running|ready_to_eval -> eval, needs_debug -> debug,
needs_more_evidence -> compare, candidate_for_promotion|promoting -> promote,
completed/NEXT_ROUND -> plan, terminal -> stop.
If run-local code becomes reusable, recommend $iterate promote or
$change classify before merging into stable src/, scripts, tests, or
project_map.json.
Commands
next: execute oneaction_state.next_action, updatelast_action,next_action,reason, andblocked_by, then stop.plan: refuse ordinary new work while an iteration iscodingorrunning; allocate ID; check lessons; record hypothesis, files,config_diff, expected effect, screening recommendation, dominant improvement axis, falsifier, assurance axis, minimum artifact, claim/figure implication, canonicalcodex_review, and implementation scope:config_only,run_local_code,stable_candidate, ordelegated_build. Readdocs/context/experiments.mdwhen present and consume one queued item or explain the priority choice. Use legacydocs/40_iterations/Experiment_Queue.mdonly when the project has not migrated to dynamic-context-v2.code: select latest planned iteration, write context, apply code-style checklist, preserve slice/glossary boundaries, route implementation through$code-debug, and run asliceorexperimentcommit checkpoint before statusready_to_run. Forrun_local_codeorstable_candidate, writeruns/wf10/<iter>/code_manifest.json.run_screening/run_full: select latestready_to_run; resolve Train/Eval scripts fromCLAUDE.md; runconfig_diff.planned_commandexactly when present; verify run-local config paths; create or verify a Semantic Execution Commit covering stable code, configs, eval logic, and run-local code/configs; recordrun_manifest,pre_train_commit, artifacts, screening result when relevant, and protocol metrics. Setready_to_eval,needs_debug, orneeds_more_evidence; never invent metrics.register: record externally executed/manual run paths and expected outputs without inventing metrics; setready_to_evalonly when the bundle is complete.debug,compare,ablate: operate inside the same iteration unless an explicit ablation command creates sub-iterations; updateaction_state.eval: refresh context; invoke$evaluatewhen useful; compare baseline, previous, and best metrics; create or verifypre_eval_commit, or recordpre_eval_commit_NOT_CHANGED; record metrics or documented failure, decision, lessons, assurance axis, claim delta evidence, slice/drift/complexity notes, reports, and completion state. Write mutable observations todocs/context/experiments.md, including concrete next experiments, mutable observations, and stable searchable findings, or reportNOT_RUN. Legacydocs/45_discoveries/Discovery_Ledger.md,docs/40_iterations/Experiment_Queue.md, anddocs/45_discoveries/Research_Wiki.mdmay be updated only for not-yet-migrated projects. Refresh the light Evidence layer withtooling/evidence/build_light_evidence_index.py; runtooling/evidence/build_experiment_evidence_index.pyonly when detailed claim/writing evidence is needed, or reportNOT_RUN.promote: readimplementation.code_manifest_path, write/verifyimplementation.promotion.plan_path, run acceptance commands or reportNOT_RUN, merge only approved candidate code into stable surfaces, and updateproject_map.json/Codebase_Map.mdwhen stable structure changes.discard,status,log: preserve canonical schema and history behavior.
Lesson And Gate Rules
- Append
MEMORY.mdonly for accepted lessons satisfyinglesson-quality-rule.md; raw observations stay in iteration reports ordocs/context/experiments.md; candidates may be promoted intodocs/context/memory.md. - When
iteration_log.json, lesson files, accepted memory, reports, queue/wiki docs, claim delta evidence, or evidence indexes change, report a Gate ledger. - Run
check_workflow_state.pynear WF10 handoff points; for routine in-loop updates, report whether it was run or deferred. - After Grill establishes an Automation Policy, WF10 auto-proceeds within that policy. Do not ask for human approval during run/eval loops unless the action would leave the policy, run an explicit approval tool, or perform an irreversible external submission.
- Use commit hashes, Gate ledgers, Claim Delta Evidence, Experiment Queue, and Research Wiki updates for traceability.
Durable Docs Render
After stable Markdown is finalized, invoke $docs-site or report
docs_site_boundary_report / docs_site_render_or_NOT_RUN; do not render
temporary drafts.