{
  "schema": "vedokrok.public-item.v1",
  "release_id": "MHC-RPUB-20260920-75ad787a",
  "url": "/knowledge/write-the-completion-condition-before-the-agent-starts-iterating",
  "id": "MHC-D-RESEARCH-0946",
  "version": "0.1.0",
  "title": "Write the completion condition before the agent starts iterating",
  "summary": "An agent loop cannot finish reliably if 'done' exists only in the model's mood.",
  "kind": "protocol",
  "body": "Define the observable completion state outside the loop: tests pass, required files exist, all checklist items are satisfied, source coverage reaches a threshold, or another verifiable condition. Keep subjective quality separate from mandatory completion so the agent does not keep polishing indefinitely.",
  "limits": [
    "Open-ended creative work may need a human accept/reject condition rather than an objective test."
  ],
  "topics": [
    "union-agent-loop-reliability"
  ],
  "intents": [],
  "source_ids": [
    "RS-86F401513BF07EEC"
  ],
  "evidence": [
    {
      "claim": "Agent-loop frameworks rely on explicit completion conditions; evaluation guidance likewise recommends unambiguous tasks and success criteria.",
      "source_id": "RS-86F401513BF07EEC",
      "role": "supports",
      "note": "Open-ended creative work may need a human accept/reject condition rather than an objective test.",
      "locator": "See source record"
    }
  ],
  "use_when": [
    "An agent is told to 'keep improving' or 'work until done' without an external definition of done."
  ],
  "avoid_when": [
    "Open-ended creative work may need a human accept/reject condition rather than an objective test."
  ],
  "example": "For a repo task, completion means the requested files changed, tests pass and the final diff contains no unrelated edits—not 'the implementation looks good now.'",
  "check": "A separate evaluator could decide done/not-done from artifacts and state.",
  "steps": [
    "Completion is observable outside the model's narrative.",
    "Mandatory outputs are explicit.",
    "Quality improvements are separated from hard done criteria.",
    "A human or grader can verify the state without trusting 'I finished.'"
  ],
  "sources": [
    {
      "id": "RS-86F401513BF07EEC",
      "title": "Agent Looping",
      "url": "https://learn.microsoft.com/en-us/agent-framework/agents/looping"
    }
  ],
  "relations": [
    {
      "from": "MHC-D-RESEARCH-0946",
      "to": "MHC-D-RESEARCH-0319",
      "type": "use_before",
      "url": "/knowledge/keep-an-eval-set-that-can-embarrass-the-agent"
    }
  ],
  "collections": [
    {
      "id": "RC-043A908C9263BF6A",
      "title": "Make the agent loop finish, recover and stay inspectable",
      "url": "/collections/make-the-agent-loop-finish-recover-and-stay-inspectable"
    }
  ]
}
