graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
Scope informational turns without requiring code changes
justrach5b36ab25ca7b
diff --git a/docs/adr/0052-lean-oneshot-bounces-prose.md b/docs/adr/0052-lean-oneshot-bounces-prose.mdindex 3c8ebde1..50075815 100644--- a/docs/adr/0052-lean-oneshot-bounces-prose.md+++ b/docs/adr/0052-lean-oneshot-bounces-prose.md@@ -61,3 +61,9 @@ the backstop when the model writes "I fixed it" with zero tools. Nofirst call; do not restore a global force.- Follow-up `-j 6` flakes and the OpenCode A/B are ADR 0053 (graff5/6 in 362s after the retry).++## Scope refinement (#884, ADR 0116)++Explicit informational turns are exempt from the edit-oriented bounce. The+generic fallback now conditions edits on the actual request. Mixed change+requests retain the coding completion policy.diff --git a/docs/adr/0060-named-source-gate-is-per-unanswered-mention.md b/docs/adr/0060-named-source-gate-is-per-unanswered-mention.mdindex b53ffe31..33a3a527 100644--- a/docs/adr/0060-named-source-gate-is-per-unanswered-mention.md+++ b/docs/adr/0060-named-source-gate-is-per-unanswered-mention.md@@ -33,3 +33,10 @@ print `stuck replay`.A greeting after a file question does not re-open the file. Typingthe same prompt again after a reply still runs (learn-auto, a re-type).The history-wide walk stays as a test helper only.++## Scope refinement (#884, ADR 0116)++An informational named-file nudge asks for evidence without demanding an edit.+All named-file nudges carry persisted harness provenance, so they do not become+human requests when saved conversations are reopened. The per-mention retry+limit and change-request obligations remain in place.diff --git a/docs/adr/0116-informational-turns-have-bounded-scope.md b/docs/adr/0116-informational-turns-have-bounded-scope.mdnew file mode 100644index 00000000..ea2f4fa1--- /dev/null+++ b/docs/adr/0116-informational-turns-have-bounded-scope.md@@ -0,0 +1,44 @@+# 0116. Informational turns have bounded scope++Status: accepted++## Context++The coding prompt applied edit completion, testing, orchestration, and+evidence collection requirements to simple repository summaries (#884).+The named-file nudge could explicitly demand an edit to a file the user+only wanted explained. A lean first answer could also be treated as an+unapplied change regardless of the actual request.++## Decision++Keep informational and implementation instructions together in the stable+prefix. The informational branch asks for a broad map and targeted reads,+then a concise answer when purpose, architecture, and constraints are clear.+It does not require a checklist, delegation, exhaustive reads, test commands,+or a separate citation pass. Requested changes keep the existing edit,+root-cause, and project-local verification requirements.++A conservative per-turn hint recognizes explicit informational verbs.+Mixed requests containing execution or mutation verbs keep general handling.+This hint never grants permission, changes tool availability, or completes+an existing goal. Ambiguous requests retain general handling; the model+still has to follow the actual user request and its context.++Informational answers are exempt from the edit-oriented first-answer bounce.+A named-file nudge requests evidence without demanding an edit. After four+model rounds or six tool calls, an informational turn gets one soft checkpoint asking whether+existing evidence suffices, rather than a forced stop. The checkpoint is an+append-only history item marked with harness provenance. It does not rewrite+the stable prefix or impersonate a human message in saved-session views.+The inferred intent and checkpoint are visible in the trace.++## Verification++Regression fixtures cover summary completion, checkpoint insertion, and mixed+mutation requests. Live terminal and GUI runs verify bounded representative+reads, an evidence-based answer, no unrequested edits or test execution, and+saved notification provenance. A live mixed request still applies the root+fix and runs the project tests. A first GUI run exposed a broad read batch+followed by exhaustive shell reads; the tool-count checkpoint covers that+case as well as long sequential runs.diff --git a/docs/adr/README.md b/docs/adr/README.mdindex 5f46f4a9..429735ae 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -125,6 +125,7 @@ record only when you need the evidence or the edge cases.| [0112](0112-mcp-wire-names-preserve-raw-routing.md) | MCP wire names are escaped and bounded; raw server/tool identities control policy and dispatch. || [0113](0113-clipboard-errors-need-evidence.md) | Direct AppKit clipboard failures need typed evidence; generic helper failures never imply Automation permission. || [0114](0114-live-citations-are-terminal-presentation.md) | Live terminal citations use per-stream display filters with independent reasoning state; structured JSON/ACP output stays unchanged. |+| [0116](0116-informational-turns-have-bounded-scope.md) | Summary turns gather bounded evidence; coding completion requirements apply to requested changes. |## When to write onediff --git a/evals/harness_behavior.jsonl b/evals/harness_behavior.jsonlindex f03d7924..408ed68c 100644--- a/evals/harness_behavior.jsonl+++ b/evals/harness_behavior.jsonl@@ -87,3 +87,6 @@{"id": "peer-inbox-live-multidrain-overflow-unicode-clear-865", "why": "#865: two live device-room drains overflow the eight-slot ring cumulatively (10 then 5: 2 then 7 lost); exact tool results prove retained 7..14 order and full 211-character Unicode bodies/device flags, read clears messages and loss, and later arrival has no stale loss. Assertions bind complete tool-result objects to call IDs to exclude scripted-command/history false positives.", "prompt": "Inject the two fixture batches, read the inbox twice, inject the fresh fixture, and read twice again.", "script": [{"tool": "bash", "arguments": {"command": "python3 -c 'import json,os,pathlib; p=pathlib.Path(os.environ['\"'\"'HOME'\"'\"'])/'\"'\"'.graff/live/chan-all.jsonl'\"'\"'; p.parent.mkdir(parents=True,exist_ok=True); f=p.open('\"'\"'a'\"'\"'); [f.write(json.dumps({'\"'\"'from_pid'\"'\"':2147483000,'\"'\"'from_session'\"'\"':'\"'\"'overflow-fixture'\"'\"','\"'\"'from_user'\"'\"':True,'\"'\"'text'\"'\"':'\"'\"'item-%02d:'\"'\"'%i+chr(0x754c)*211+'\"'\"':tail-%02d'\"'\"'%i})+'\"'\"'\\n'\"'\"') for i in range(0,10)]; f.close()'"}}, {"tool": "bash", "arguments": {"command": "python3 -c 'import json,os,pathlib; p=pathlib.Path(os.environ['\"'\"'HOME'\"'\"'])/'\"'\"'.graff/live/chan-all.jsonl'\"'\"'; p.parent.mkdir(parents=True,exist_ok=True); f=p.open('\"'\"'a'\"'\"'); [f.write(json.dumps({'\"'\"'from_pid'\"'\"':2147483000,'\"'\"'from_session'\"'\"':'\"'\"'overflow-fixture'\"'\"','\"'\"'from_user'\"'\"':True,'\"'\"'text'\"'\"':'\"'\"'item-%02d:'\"'\"'%i+chr(0x754c)*211+'\"'\"':tail-%02d'\"'\"'%i})+'\"'\"'\\n'\"'\"') for i in range(10,15)]; f.close()'"}}, {"tool": "peer_message", "arguments": {"action": "inbox"}}, {"tool": "peer_message", "arguments": {"action": "inbox"}}, {"tool": "bash", "arguments": {"command": "python3 -c 'import json,os,pathlib; p=pathlib.Path(os.environ['\"'\"'HOME'\"'\"'])/'\"'\"'.graff/live/chan-all.jsonl'\"'\"'; p.parent.mkdir(parents=True,exist_ok=True); f=p.open('\"'\"'a'\"'\"'); [f.write(json.dumps({'\"'\"'from_pid'\"'\"':2147483000,'\"'\"'from_session'\"'\"':'\"'\"'overflow-fixture'\"'\"','\"'\"'from_user'\"'\"':True,'\"'\"'text'\"'\"':'\"'\"'item-%02d:'\"'\"'%i+chr(0x754c)*211+'\"'\"':tail-%02d'\"'\"'%i})+'\"'\"'\\n'\"'\"') for i in range(15,16)]; f.close()'"}}, {"tool": "peer_message", "arguments": {"action": "inbox"}}, {"tool": "peer_message", "arguments": {"action": "inbox"}}, {"text": "fixture complete"}], "assert": [{"request_contains": {"index": 1, "text": "[peer] 8 unread; 2 dropped"}}, {"request_contains": {"index": 2, "text": "[peer] 8 unread; 7 dropped"}}, {"request_contains": {"index": 3, "text": "{\"role\": \"tool\", \"tool_call_id\": \"call_3\", \"content\": \"[peer inbox: 7 dropped message(s) could not be retained; the room log keeps the originals]\\n[peer message from overflow-fixture \\u00b7 device]: item-07:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-07\\n[peer message from overflow-fixture \\u00b7 device]: item-08:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-08\\n[peer message from overflow-fixture \\u00b7 device]: item-09:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-09\\n[peer message from overflow-fixture \\u00b7 device]: item-10:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-10\\n[peer message from overflow-fixture \\u00b7 device]: item-11:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-11\\n[peer message from overflow-fixture \\u00b7 device]: item-12:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-12\\n[peer message from overflow-fixture \\u00b7 device]: item-13:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-13\\n[peer message from overflow-fixture \\u00b7 device]: item-14:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-14\\n(inbox cleared \\u2014 reply with peer_message; omit session for the room, or name one peer to DM)\"}"}}, {"request_contains": {"index": 4, "text": "{\"role\": \"tool\", \"tool_call_id\": \"call_4\", \"content\": \"inbox empty\"}"}}, {"request_contains": {"index": 6, "text": "{\"role\": \"tool\", \"tool_call_id\": \"call_6\", \"content\": \"[peer message from overflow-fixture \\u00b7 device]: item-15:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-15\\n(inbox cleared \\u2014 reply with peer_message; omit session for the room, or name one peer to DM)\"}"}}, {"request_contains": {"index": 7, "text": "{\"role\": \"tool\", \"tool_call_id\": \"call_7\", \"content\": \"inbox empty\"}"}}, {"events_at_least": {"match": {"type": "tool_call_finished", "name": "peer_message", "is_error": false}, "count": 4}}, {"no_event": {"type": "tool_call_finished", "is_error": true}}, {"request_lacks": {"index": 1, "text": "[peer message from overflow-fixture"}}, {"request_lacks": {"index": 2, "text": "[peer message from overflow-fixture"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-00:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-00\\n"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-01:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-01\\n"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-02:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-02\\n"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-03:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-03\\n"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-04:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-04\\n"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-05:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-05\\n"}}, {"request_lacks": {"index": 3, "text": "[peer message from overflow-fixture \\u00b7 device]: item-06:\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c\\u754c:tail-06\\n"}}]}{"id": "notification-wake-wire", "why": "Generated job wakes remain model-visible user context while saved provenance never reaches provider requests.", "env": {"GRAFF_NO_CODEDB_GUARD": "1"}, "prompt": "Start a background check, do another step, then read the completed check.", "script": [{"tool": "bash", "arguments": {"command": "sleep 0.1; echo notification-ready", "run_in_background": true}}, {"tool": "bash", "arguments": {"command": "sleep 1; echo independent-step"}}, {"tool": "bash_output", "arguments": {"id": 1}}, {"text": "Check completed."}], "assert": [{"request_contains": {"index": 2, "text": "do not poll"}}, {"request_lacks": {"index": 2, "text": "_graff_origin"}}, {"final_text_contains": "Check completed."}]}{"id": "readonly-heredoc-publication-text", "why": "#879: read-only heredoc data containing publication words must execute without triggering publication preflight.", "prompt": "Print the diagnostic text without publishing anything.", "script": [{"tool": "bash", "arguments": {"command": "python3 - <<'PYDATA'\ntext = 'gh pr create'\nprint('inert-data-ok:' + text)\nPYDATA"}}, {"text": "Diagnostic printed."}], "assert": [{"event": {"type": "tool_result", "name": "bash", "text": "inert-data-ok:gh pr create\n"}}, {"events_at_most": {"match": {"type": "tool_call_finished", "is_error": true}, "count": 0}}, {"final_text_contains": "Diagnostic printed."}]}+{"id": "informational-summary-bounded", "why": "#884: repository summaries retain bounded evidence gathering and receive one provenance-marked checkpoint without coding-work completion pressure.", "prompt": "go through the codebase and summarize what it does", "workspace_seed": {"README.md": "# Notebook\nA desktop note-taking app. App owns startup, Controller routes user actions, and Store persists notes. See src/App.swift and src/Controller.swift.\n", "src/App.swift": "struct App { let controller: Controller }\n", "src/Controller.swift": "struct Controller { let store: Store }\n", "src/Store.swift": "struct Store { func save(_ text: String) {} }\n", "src/Feature0.swift": "struct Feature0 {}\n", "src/Feature1.swift": "struct Feature1 {}\n", "src/Feature2.swift": "struct Feature2 {}\n", "src/Feature3.swift": "struct Feature3 {}\n", "src/Feature4.swift": "struct Feature4 {}\n", "src/Feature5.swift": "struct Feature5 {}\n", "src/Feature6.swift": "struct Feature6 {}\n", "src/Feature7.swift": "struct Feature7 {}\n", "src/Feature8.swift": "struct Feature8 {}\n", "src/Feature9.swift": "struct Feature9 {}\n", "src/Feature10.swift": "struct Feature10 {}\n", "src/Feature11.swift": "struct Feature11 {}\n", "tests/Feature0Tests.swift": "// Tests for feature 0\n", "tests/Feature1Tests.swift": "// Tests for feature 1\n", "tests/Feature2Tests.swift": "// Tests for feature 2\n", "tests/Feature3Tests.swift": "// Tests for feature 3\n", "tests/Feature4Tests.swift": "// Tests for feature 4\n", "tests/Feature5Tests.swift": "// Tests for feature 5\n", "tests/Feature6Tests.swift": "// Tests for feature 6\n", "tests/Feature7Tests.swift": "// Tests for feature 7\n", "tests/Feature8Tests.swift": "// Tests for feature 8\n", "tests/Feature9Tests.swift": "// Tests for feature 9\n"}, "script": [{"tool": "read_file", "arguments": {"path": "README.md"}}, {"tool": "read_file", "arguments": {"path": "src/App.swift"}}, {"tool": "read_file", "arguments": {"path": "src/Controller.swift"}}, {"tool": "read_file", "arguments": {"path": "src/Store.swift"}}, {"text": "Notebook is a desktop note-taking application. App owns startup, Controller routes user actions, and Store persists notes. The remaining feature modules and tests support that flow."}], "assert": [{"events_at_most": {"match": {"type": "tool_call"}, "count": 4}}, {"events_at_least": {"match": {"type": "tool_call", "name": "read_file"}, "count": 4}}, {"request_contains": {"index": -1, "text": "Summary scope checkpoint:"}}, {"request_lacks": {"index": 0, "text": "Summary scope checkpoint:"}}, {"request_lacks": {"index": -1, "text": "If the user requested a change, a description alone is not completion:"}}, {"final_text_contains": "Notebook is a desktop note-taking application. App owns startup, Controller routes user actions, and Store persists notes. The remaining feature modules and tests support that flow."}]}+{"id": "informational-summary-no-edit-bounce", "why": "#884: a completed summary of supplied evidence must not trigger the edit-oriented first-answer retry.", "args": ["--lean"], "prompt": "Summarize this architecture: App owns startup, Controller routes user actions, and Store persists notes.", "script": [{"text": "Notebook is a desktop note-taking application. App owns startup, Controller routes user actions, and Store persists notes. The remaining feature modules and tests support that flow."}], "assert": [{"events_at_most": {"match": {"type": "tool_call"}, "count": 0}}, {"request_lacks": {"index": -1, "text": "If the user requested a change, a description alone is not completion:"}}, {"request_contains": {"index": 0, "text": "Task scope: first distinguish"}}, {"final_text_contains": "Notebook is a desktop note-taking application. App owns startup, Controller routes user actions, and Store persists notes. The remaining feature modules and tests support that flow."}]}+{"id": "informational-mixed-request-keeps-mutation", "why": "#884: a mixed fix-and-summary request must still read, apply the root-cause change, and verify in the fixture project.", "prompt": "Fix slug.py so whitespace-only labels return an empty string, add a regression test, run the project tests, and summarize the change.", "workspace_seed": {"slug.py": "def slug(label):\n result = \"-\".join(label.strip().lower().split())\n if not result:\n raise ValueError(\"empty label\")\n return result\n", "test_slug.py": "import unittest\nfrom slug import slug\n\nclass SlugTests(unittest.TestCase):\n def test_words(self):\n self.assertEqual(slug(\"Hello World\"), \"hello-world\")\n", "README.md": "Run tests with python3 -m unittest discover.\n"}, "script": [{"tool": "read_file", "arguments": {"path": "slug.py"}}, {"tool": "read_file", "arguments": {"path": "test_slug.py"}}, {"tool": "read_file", "arguments": {"path": "README.md"}}, {"tool": "edit_file", "arguments": {"path": "slug.py", "old_string": " if not result:\n raise ValueError(\"empty label\")\n", "new_string": ""}}, {"tool": "edit_file", "arguments": {"path": "test_slug.py", "old_string": "import unittest\nfrom slug import slug\n\nclass SlugTests(unittest.TestCase):\n def test_words(self):\n self.assertEqual(slug(\"Hello World\"), \"hello-world\")\n", "new_string": "import unittest\nfrom slug import slug\n\nclass SlugTests(unittest.TestCase):\n def test_words(self):\n self.assertEqual(slug(\"Hello World\"), \"hello-world\")\n\n def test_whitespace_only(self):\n self.assertEqual(slug(\" \\t\\n \"), \"\")\n"}}, {"tool": "bash", "arguments": {"command": "python3 -m unittest discover"}}, {"text": "Whitespace-only labels now return an empty string. Both project tests passed."}], "assert": [{"events_at_least": {"match": {"type": "tool_call", "name": "read_file"}, "count": 3}}, {"events_at_least": {"match": {"type": "tool_call", "name": "edit_file"}, "count": 2}}, {"events_at_most": {"match": {"type": "tool_call_finished", "is_error": true}, "count": 0}}, {"request_contains": {"index": -1, "text": "Ran 2 tests"}}, {"request_contains": {"index": -1, "text": "OK"}}, {"request_lacks": {"index": -1, "text": "Summary scope checkpoint:"}}, {"final_text_contains": "Both project tests passed."}]}diff --git a/src/agent.zig b/src/agent.zigindex 49277a1c..8ef2e7c4 100644--- a/src/agent.zig+++ b/src/agent.zig@@ -334,8 +334,10 @@ pub const Agent = struct {var pending_work: empty_completion.PendingWork = .{};self.completed = null;@import("named_work.zig").beginTurn(self);+ var task_scope = @import("task_intent.zig").State.begin(self);if (!self.sub and !root_turn_prepared.swap(false, .acq_rel)) @import("cancel_source.zig").clear();while (true) {+ try task_scope.beforeRequest(self);if (try @import("turn_chrome.zig").beforeRequest(self)) |paused| return paused;// Esc during a tool join lands here; root consumes, subagents bail.if (esc_cancel.load(.acquire)) {diff --git a/src/agent_empty_completion.zig b/src/agent_empty_completion.zigindex 60c6dd2b..6e75b5d0 100644--- a/src/agent_empty_completion.zig+++ b/src/agent_empty_completion.zig@@ -26,7 +26,7 @@ pub fn shouldRetry(final_text: []const u8, retries: u8) bool {}/// Lean `-p` described a fix and never called a tool. One bounce.-pub const bounce_note = "You described a change but did not call any tool. Inspect and edit the files with read_file / edit_file / write_file; do not claim the tree is already updated.";+pub const bounce_note = "If the user requested a change, a description alone is not completion: inspect and edit the files with read_file / edit_file / write_file; do not claim the tree is already updated. If the request is informational, answer it from sufficient evidence without making unrequested changes.";pub fn shouldBounce(unattended: bool, lean: bool, text_only: bool, review: bool, sub: bool, tool_calls: u64, model_calls: u64, final_text: []const u8) bool {if (!unattended or !lean or text_only or review or sub) return false;@@ -44,6 +44,7 @@ pub fn handle(self: *Agent, final_text: []const u8, hist_len: usize) !bool {try self.say("[model returned an empty completion — retrying ({d}/{d})]\n", .{ self.empty_completion_retries, max_consecutive });return true;}+ if (@import("task_intent.zig").current(self) == .informational) return false;if (!shouldBounce(main_mod.unattended, no_local_tools.lean, self.text_only, self.review_mode, self.sub, self.tool_calls_this_turn, self.model_calls_this_turn, final_text))return false;try self.messages.append(try messages.userNote(self.arena, self.provider.kind, bounce_note));@@ -223,3 +224,24 @@ test "bounce note names the file tools" {try std.testing.expect(std.mem.indexOf(u8, bounce_note, "edit_file") != null);try std.testing.expect(std.mem.indexOf(u8, bounce_note, "write_file") != null);}++test "completed informational answer is not an edit-oriented fake_done retry" {+ var state = std.heap.ArenaAllocator.init(std.testing.allocator);+ defer state.deinit();+ var self = pendingFixture(state.allocator());+ self.empty_completion_retries = 0;+ const old_unattended = main_mod.unattended;+ const old_lean = no_local_tools.lean;+ main_mod.unattended = true;+ no_local_tools.lean = true;+ defer {+ main_mod.unattended = old_unattended;+ no_local_tools.lean = old_lean;+ }+ self.tool_calls_this_turn = 0;+ self.model_calls_this_turn = 1;+ try self.messages.append(try messages.textMessage(self.arena, "user", "Summarize the architecture"));+ const before = self.messages.items.len;+ try std.testing.expect(!try handle(&self, "The app separates its UI, parser, and storage.", before));+ try std.testing.expectEqual(before, self.messages.items.len);+}diff --git a/src/main.zig b/src/main.zigindex 8035a3bd..e8791a2b 100644--- a/src/main.zig+++ b/src/main.zig@@ -49,6 +49,7 @@ const learn_store = @import("learn_store.zig");const learn_eval = @import("learn_eval.zig");const learn_cli = @import("learn_cli.zig");test {+ _ = @import("task_intent.zig");_ = .{ @import("clipboard_native.zig"), @import("clipboard_edge_tests.zig"), @import("clipboard_failure_tests.zig"), @import("process_runner_clipboard_tests.zig") };_ = @import("server_orphan.zig");_ = @import("repo_transaction.zig");diff --git a/src/messages.zig b/src/messages.zigindex c3a34806..b22c6d22 100644--- a/src/messages.zig+++ b/src/messages.zig@@ -43,7 +43,14 @@ pub fn trailingUserIs(messages: []const Value, text: []const u8) bool {}fn userPromptText(msg: Value) ?[]const u8 {+ if (@import("session_wake.zig").isNotice(msg)) return null;if (msg != .object) return null;+ if (msg.object.get("type")) |kind| {+ if (kind == .string and std.mem.eql(u8, kind.string, "user_input")) {+ const content = msg.object.get("content") orelse return null;+ if (content == .string and content.string.len > 0) return content.string;+ }+ }const role = msg.object.get("role") orelse return null;if (role != .string or !std.mem.eql(u8, role.string, "user")) return null;const content = msg.object.get("content") orelse return null;diff --git a/src/named_work.zig b/src/named_work.zigindex f546aada..a954b578 100644--- a/src/named_work.zig+++ b/src/named_work.zig@@ -12,10 +12,12 @@ const Agent = @import("agent.zig").Agent;const messages_mod = @import("messages.zig");pub const max_nudges: u8 = 1;+const task_intent = @import("task_intent.zig");pub const nudge_text ="You named a source file and have not used a tool. Read the named path " ++- "and edit it before answering — do not describe a fix you have not applied.";+ "and apply any changes the user requested before answering — do not describe a fix you have not applied. " +++ "For an informational request, answer from the evidence without editing.";/// Test-only fallback. Production copies onto the Agent so a scout's/// arena cannot leave a dangling pointer for the parent's handle (#714).@@ -153,11 +155,14 @@ pub fn handle(self: *Agent, _: []const u8) !bool {// in an earlier message.if (!hasNamedSource(task)) return false;if (std.mem.eql(u8, task, self.named_work_settled)) return false;- if (std.mem.eql(u8, lastUserText(self), nudge_text)) return false;+ const note = if (task_intent.classify(task) == .informational) task_intent.read_nudge else nudge_text;+ if (std.mem.eql(u8, lastUserText(self), note)) return false;self.named_work_nudges += 1;self.named_work_settled = copyOnto(self, task);self.closeCodexWs();- try self.messages.append(try userNudge(self.arena, self.provider.kind, nudge_text));+ var message = try userNudge(self.arena, self.provider.kind, note);+ try message.object.put(self.arena, @import("session_wake.zig").origin_key, .{ .string = "notification" });+ try self.messages.append(message);return true;}@@ -274,6 +279,28 @@ fn testAgent(arena: std.mem.Allocator, msgs: std.json.Array) Agent {};}+test "informational named-file retries request evidence without demanding an edit" {+ resetForTest();+ defer resetForTest();+ var state = std.heap.ArenaAllocator.init(std.testing.allocator);+ defer state.deinit();+ const a = state.allocator();+ for ([_]@import("provider.zig").Provider.Kind{ .openai, .responses, .anthropic, .interactions }) |kind| {+ var msgs = std.json.Array.init(a);+ try msgs.append(try userNudge(a, kind, "Explain parser.zig"));+ var agent = testAgent(a, msgs);+ agent.provider.kind = kind;+ rememberOn(&agent, "Explain parser.zig");+ try std.testing.expect(try handle(&agent, "The parser processes input."));+ const note = agent.messages.items[agent.messages.items.len - 1];+ try std.testing.expect(@import("session_wake.zig").isNotice(note));+ const encoded = try std.json.Stringify.valueAlloc(a, note, .{});+ try std.testing.expect(std.mem.indexOf(u8, encoded, task_intent.read_nudge) != null);+ try std.testing.expect(std.mem.indexOf(u8, encoded, nudge_text) == null);+ try std.testing.expect(!try handle(&agent, "The parser processes input."));+ }+}+test "#714: a later greeting does not re-fire because history still names SPEC.md" {resetForTest();defer resetForTest();diff --git a/src/prompt_snapshot_tests.zig b/src/prompt_snapshot_tests.zigindex 25684026..e78c8ac1 100644--- a/src/prompt_snapshot_tests.zig+++ b/src/prompt_snapshot_tests.zig@@ -28,6 +28,23 @@ const golden_full_prompt =\\Inspect before you commit to an architecture: say what you found, then\\what you will do, then do it. Do not announce a solution and hunt for\\confirmation of it.+ \\Task scope: first distinguish an informational request from a request to+ \\change or execute something. A request to summarize, explain, or map a+ \\codebase is complete when you have enough evidence to answer accurately.+ \\It does not authorize edits or require coding-work completion checks.+ \\For a summary, start with one broad map and a small set of targeted reads+ \\covering purpose, entry points, architecture, and important constraints.+ \\For repetitive files, inspect a representative sample and qualify what+ \\you inferred. Do not read an entire directory to prove that every file+ \\matches a pattern already established by the sample.+ \\Answer once those are clear; do not exhaustively read every source/test+ \\file, create a todo, delegate, run build/test/lint/review commands, or make+ \\a separate citation pass just because the repository contains many files.+ \\Run a check only when requested or needed to resolve a specific factual+ \\inconsistency relevant to the answer. Use evidence from existing reads.+ \\For mixed requests, preserve every requested change and verification step.+ \\For changes, retain read-before-edit, root-cause fixes, and verification+ \\in the project's own environment. A summary alone does not finish a fix.\\read_file before editing; prefer\\edit_file for changes to existing files and write_file only for new\\files or full rewrites. For a read-only exact-key lookup in one known file,@@ -44,13 +61,14 @@ const golden_full_prompt =\\this exception to an inferred path or to a subagent.\\For independent,\\self-contained chunks of work — exploring several directories, running- \\unrelated checks, summarizing multiple files — fan out: call the+ \\unrelated requested checks — fan out when it helps the task: call the\\subagent tool several times in a single response and the subagents run\\in parallel. For larger fan-out work that needs a synthesis step, use\\the workflow tool: sequential phases of parallel subagents, with\\{{prev}} carrying each phase's results into the next.\\Use todo_write to- \\track multi-step work. Work directly for small sequential steps.+ \\track multi-step implementation work. Reading several files for a summary+ \\does not by itself need a checklist. Work directly for small sequential steps.\\\\The harness writes this run's JSONL event trace beneath .graff/traces\\(`/trace` shows its exact path): one object per line, "ev" of "api" (ms@@ -125,7 +143,8 @@ const golden_full_prompt =\\explicitly asks. Their existing commits and any -w worktree\\auto-checkpoints are the user's safety net; do not blow them away.\\- \\Assume the user wants the work done, not described. Keep going until the+ \\For requested changes, assume the user wants the work done, not described.+ \\Keep going until the\\task is genuinely handled: the change applied, verified with the\\project's own build, test, or lint commands in its OWN environment —\\a green run anywhere else is not evidence — and the failure you were@@ -169,7 +188,8 @@ const golden_full_prompt =\\\\\\Write the final message as an update to a teammate who has not seen your- \\screen. Cite evidence as `path:line` — never dump large file contents into+ \\screen. Use relevant evidence already gathered; cite `path:line` when useful.+ \\Do not run a separate citation pass for an informational answer. Never dump large file contents into\\an answer — and backtick-wrap commands, paths, and identifiers. Scale it\\to the change: a typo fix is one sentence, a feature a short structured\\summary. Close with the next steps that genuinely exist, and nothing more.diff --git a/src/prompt_text.zig b/src/prompt_text.zigindex 2cf1b8d8..e5762935 100644--- a/src/prompt_text.zig+++ b/src/prompt_text.zig@@ -59,7 +59,7 @@ pub const orchestration_note =\\\\For independent,\\self-contained chunks of work — exploring several directories, running- \\unrelated checks, summarizing multiple files — fan out: call the+ \\unrelated requested checks — fan out when it helps the task: call the\\subagent tool several times in a single response and the subagents run\\in parallel. For larger fan-out work that needs a synthesis step, use\\the workflow tool: sequential phases of parallel subagents, with@@ -70,7 +70,8 @@ pub const orchestration_note =pub const todo_note =\\\\Use todo_write to- \\track multi-step work. Work directly for small sequential steps.+ \\track multi-step implementation work. Reading several files for a summary+ \\does not by itself need a checklist. Work directly for small sequential steps.;/// Gate: `caps.local_tools`. The instruction is "read and analyze it": the@@ -194,7 +195,8 @@ pub const git_safety_note =pub const work_note =\\\\- \\Assume the user wants the work done, not described. Keep going until the+ \\For requested changes, assume the user wants the work done, not described.+ \\Keep going until the\\task is genuinely handled: the change applied, verified with the\\project's own build, test, or lint commands in its OWN environment —\\a green run anywhere else is not evidence — and the failure you were@@ -296,7 +298,8 @@ pub const closing_note =\\\\\\Write the final message as an update to a teammate who has not seen your- \\screen. Cite evidence as `path:line` — never dump large file contents into+ \\screen. Use relevant evidence already gathered; cite `path:line` when useful.+ \\Do not run a separate citation pass for an informational answer. Never dump large file contents into\\an answer — and backtick-wrap commands, paths, and identifiers. Scale it\\to the change: a typo fix is one sentence, a feature a short structured\\summary. Close with the next steps that genuinely exist, and nothing more.@@ -371,15 +374,15 @@ pub const lean_intro_note =\\You are a coding agent. Use the cataloged tools; never invent one.\\A file change described in prose is not done — call edit_file or write_file.\\Independent reads belong in ONE response, not one per turn.- \\A passing test and attempt_completion belong in ONE response.+ \\For requested changes, a passing test and attempt_completion belong in ONE response.;pub const lean_work_note =\\- \\Assume the user wants the work done. Verify with the project's own+ \\For requested changes, apply the change and verify with the project's own\\tests in its OWN environment. Use named files and tests directly.\\Do not add unrequested tests. Never repeat a tool call with identical- \\parameters. When the task names a file, read it and edit that path+ \\parameters. When a change request names a file, read it and edit that path\\before answering — do not describe a fix you have not applied.\\When a named SPEC.md is in the task, satisfy every clause\\— a green public test is not the whole spec. Empty input includes@@ -390,7 +393,8 @@ pub const lean_work_note =pub const lean_closing_note =\\- \\Write the final message as a short teammate update. Cite path:line.+ \\Write the final message as a short teammate update. Use existing evidence;+ \\cite path:line when useful, without a separate citation pass for a summary.\\Be direct and concise.;diff --git a/src/prompts.zig b/src/prompts.zigindex 4bcf787e..9bd4c3e7 100644--- a/src/prompts.zig+++ b/src/prompts.zig@@ -56,6 +56,7 @@ pub const Segment = struct { name: []const u8, text: []const u8, gate: Gate };/// two can never drift apart or reorder relative to each other.pub const segments = [_]Segment{.{ .name = "intro", .text = text.intro_note, .gate = .always },+ .{ .name = "task_scope", .text = @import("task_intent.zig").guidance, .gate = .always },.{ .name = "local_tools", .text = text.local_tools_note, .gate = .local_tools },.{ .name = "orchestration", .text = text.orchestration_note, .gate = .subagents },.{ .name = "todo", .text = text.todo_note, .gate = .todos },diff --git a/src/task_intent.zig b/src/task_intent.zignew file mode 100644index 00000000..02815369--- /dev/null+++ b/src/task_intent.zig@@ -0,0 +1,135 @@+//! Conservative per-turn scope hints. These never grant permissions, erase+//! goals, hide tools, or override the user's current request.+const std = @import("std");+const Agent = @import("agent.zig").Agent;++pub const Intent = enum { general, informational };++// Both branches live in the stable prefix. Turn counters and inferred labels+// must not rewrite it on every model request and invalidate history caching.+pub const guidance =+ \\+ \\Task scope: first distinguish an informational request from a request to+ \\change or execute something. A request to summarize, explain, or map a+ \\codebase is complete when you have enough evidence to answer accurately.+ \\It does not authorize edits or require coding-work completion checks.+ \\For a summary, start with one broad map and a small set of targeted reads+ \\covering purpose, entry points, architecture, and important constraints.+ \\For repetitive files, inspect a representative sample and qualify what+ \\you inferred. Do not read an entire directory to prove that every file+ \\matches a pattern already established by the sample.+ \\Answer once those are clear; do not exhaustively read every source/test+ \\file, create a todo, delegate, run build/test/lint/review commands, or make+ \\a separate citation pass just because the repository contains many files.+ \\Run a check only when requested or needed to resolve a specific factual+ \\inconsistency relevant to the answer. Use evidence from existing reads.+ \\For mixed requests, preserve every requested change and verification step.+ \\For changes, retain read-before-edit, root-cause fixes, and verification+ \\in the project's own environment. A summary alone does not finish a fix.+;++fn oneOf(word: []const u8, choices: []const []const u8) bool {+ for (choices) |choice| if (std.ascii.eqlIgnoreCase(word, choice)) return true;+ return false;+}++/// Only unambiguous informational verbs opt out of edit-oriented retries.+/// Mixed/unknown requests retain the general policy. This is a scope hint,+/// not a natural-language permission boundary or an enforced tool allowlist.+pub fn classify(text: []const u8) Intent {+ var informational = false;+ var words = std.mem.tokenizeAny(u8, text, " \t\r\n,;:!?()[]{}\"`");+ while (words.next()) |raw| {+ const word = std.mem.trim(u8, raw, ".");+ if (oneOf(word, &.{ "fix", "edit", "implement", "add", "remove", "delete", "rename", "refactor", "write", "create", "update", "patch", "build", "test", "lint", "run", "merge", "push", "deploy", "commit" })) return .general;+ if (oneOf(word, &.{ "summarize", "summarise", "summary", "explain", "describe", "overview", "map" })) informational = true;+ }+ return if (informational) .informational else .general;+}++pub fn current(self: *const Agent) Intent {+ return classify(@import("messages.zig").latestUserText(self.messages.items));+}++pub const read_nudge = "You named a source file but have not inspected it. Read the named path if its contents are needed, then answer the informational request. Do not edit it merely to satisfy a completion check.";++pub const checkpoint = "Summary scope checkpoint: review the map and targeted evidence already gathered in this turn. A broad batch of reads also counts as exploration; do not follow it with a shell loop reading every remaining file. For repeated scaffolding, explain the sampled pattern and its limits. Can you now explain the repository's purpose, architecture, and important constraints? If so, answer concisely now. Otherwise read only the specific missing evidence. Do not start implementation, a test suite, or a separate citation pass solely to finish a summary. Respect any newer user request that changes the scope.";++pub const State = struct {+ nudged: bool = false,++ pub fn begin(self: *Agent) State {+ if (self.tracer) |tr| tr.note("task_intent", @tagName(current(self)));+ return .{};+ }++ pub fn beforeRequest(state: *State, self: *Agent) !void {+ if (state.nudged or self.sub or current(self) != .informational) return;+ if (self.model_calls_this_turn < 4 and self.tool_calls_this_turn < 6) return;+ var note = try @import("named_work.zig").userNudge(self.arena, self.provider.kind, checkpoint);+ try note.object.put(self.arena, @import("session_wake.zig").origin_key, .{ .string = "notification" });+ try self.messages.append(note);+ state.nudged = true;+ if (self.tracer) |tr| tr.note("summary_checkpoint", "bounded exploration reminder; no forced stop");+ }+};++test "informational intent recognizes summaries and keeps mixed execution requests general" {+ for ([_][]const u8{+ "go through the codebase and summarize what it does at /tmp/repo",+ "Explain src/parser.zig",+ "Give me an OVERVIEW of this application.",+ "Summarise the tests and architecture",+ "Describe the deployment flow",+ }) |text| try std.testing.expectEqual(Intent.informational, classify(text));+ for ([_][]const u8{+ "Fix src/parser.zig and summarize the change", "Explain and then refactor the parser",+ "Run tests and describe the results", "Implement the plan",+ "go on", "hello",+ "Summarize the codebase; then add logging", "Map the project and build it",+ }) |text| try std.testing.expectEqual(Intent.general, classify(text));+}++test "informational hints do not match words inside paths or longer words" {+ try std.testing.expectEqual(Intent.general, classify("Open summary.py"));+ try std.testing.expectEqual(Intent.general, classify("the mapper is broken"));+ try std.testing.expectEqual(Intent.informational, classify("Explain /tmp/fix/parser.zig"));+}++test "summary checkpoint is once, preserves the human request, and respects a newer change request" {+ var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator);+ defer arena_state.deinit();+ const a = arena_state.allocator();+ const messages = @import("messages.zig");+ var agent: Agent = undefined;+ agent.arena = a;+ agent.messages = .init(a);+ agent.sub = false;+ agent.tracer = null;+ agent.provider.kind = .openai;+ agent.model_calls_this_turn = 3;+ agent.tool_calls_this_turn = 0;+ try agent.messages.append(try messages.textMessage(a, "user", "Summarize the codebase"));+ var state = State.begin(&agent);+ try state.beforeRequest(&agent);+ try std.testing.expectEqual(@as(usize, 1), agent.messages.items.len);+ agent.model_calls_this_turn = 4;+ try state.beforeRequest(&agent);+ try std.testing.expectEqual(@as(usize, 2), agent.messages.items.len);+ try std.testing.expect(@import("session_wake.zig").isNotice(agent.messages.items[1]));+ try std.testing.expectEqualStrings("Summarize the codebase", messages.latestUserText(agent.messages.items));+ try state.beforeRequest(&agent);+ try std.testing.expectEqual(@as(usize, 2), agent.messages.items.len);+ try agent.messages.append(try messages.textMessage(a, "user", "Now fix the parser"));+ state = State.begin(&agent);+ try state.beforeRequest(&agent);+ try std.testing.expectEqual(@as(usize, 3), agent.messages.items.len);+ try std.testing.expectEqual(Intent.general, current(&agent));+ try agent.messages.append(try messages.textMessage(a, "user", "Summarize the codebase"));+ state = State.begin(&agent);+ agent.model_calls_this_turn = 1;+ agent.tool_calls_this_turn = 6;+ try state.beforeRequest(&agent);+ try std.testing.expect(state.nudged);+ try std.testing.expectEqual(@as(usize, 5), agent.messages.items.len);+}