Adopted from studying Claude Code's /goal (completion judged by a fresh
model, never the one doing the work) and pi-goal-x's auditor (isolated
session, read-only tools, explicit approval marker, rejects scaffold-only
and proxy-metric completions).
complete_goal no longer closes a goal on the caller's word:
- It now takes a required `evidence` claim, and permission/argument gates
run before any audit spend.
- The audit is an isolated tool-turn loop: fresh conversation (the auditor
never sees the executor's transcript), read-only workspace tools (no
run_command), strict auditor instructions, at most 6 iterations.
- Only an explicit <approved/> closes the goal (recorded with the audit
verdict). <disapproved/>, no marker, or an exhausted budget all leave the
goal active and hand the decisive gap back to the caller as the tool
result.
- The handler moved from the sync dispatcher into the run loop's async
routing because it needs provider access; the goal-review prompt warns
that substanceless claims will bounce.
AGENTS.md documents both this and the web-access contract.