Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

test: stress peer inbox ownership and persistence boundaries

yxlyxda61c3b39d16
diff --git a/evals/harness_behavior.jsonl b/evals/harness_behavior.jsonl
index 5f9fe0f4..9e1f0e8d 100644
--- a/evals/harness_behavior.jsonl
+++ b/evals/harness_behavior.jsonl
@@ -81,3 +81,4 @@
{"id": "render-html-hands-back-an-opaque-view", "why": "The model's own drawing surface must be advertised, dispatch to the snapshot writer, and put only the opaque path into the transcript - a page the model drew must never come back to it as a second copy of the markup.", "args": [], "prompt": "draw the retry flow as a page", "script": [{"tool": "render_html", "arguments": {"html": "<h1 id=\"flow\">Retry flow</h1><p>the second attempt is declined</p>"}}, {"text": "drawn above"}], "assert": [{"request_contains": {"index": 0, "text": "render_html"}}, {"events_at_least": {"match": {"type": "tool_call", "name": "render_html"}, "count": 1}}, {"event": {"type": "tool_result"}}, {"request_contains": {"index": -1, "text": "[Rendered view]"}}, {"request_contains": {"index": -1, "text": "/.graff/views/"}}, {"final_text_contains": "drawn above"}]}
{"id": "bundled-mcp-skill-loads", "why": "The bundled invocation skill must be discoverable and load its connection instructions after adding an MCP server.", "prompt": "Load the bundled mcp skill before adding a server.", "script": [{"tool": "skill", "arguments": {"name": "mcp"}}, {"text": "MCP instructions loaded."}], "assert": [{"event": {"type": "tool_call", "name": "skill"}}, {"request_contains": {"index": -1, "text": "graff mcp add"}}, {"request_contains": {"index": -1, "text": "/mcp trust"}}, {"final_text_contains": "MCP instructions loaded."}]}
{"id": "peer-inbox-preserves-live-body-865", "why": "#865: inject a device-room user message after the first drain; full body must survive deliverInbound and inbox tool dispatch without entering the wake.", "prompt": "Run the fixture injection, then read the peer inbox twice.", "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'\"'\"':'\"'\"'fixture-peer'\"'\"','\"'\"'from_user'\"'\"':True,'\"'\"'text'\"'\"':'\"'\"'prefix full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload BODY_END_865'\"'\"'})+'\"'\"'\\n'\"'\"'); f.close()'"}}, {"tool": "peer_message", "arguments": {"action": "inbox"}}, {"tool": "peer_message", "arguments": {"action": "inbox"}}, {"text": "fixture complete"}], "assert": [{"request_lacks": {"index": 1, "text": "[peer message from fixture-peer"}}, {"request_contains": {"index": 2, "text": "[peer message from fixture-peer"}}, {"request_contains": {"index": 2, "text": "[peer message from fixture-peer \\u00b7 device]: prefix full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload full body payload BODY_END_865"}}, {"request_contains": {"index": 3, "text": "inbox empty"}}, {"no_event": {"type": "tool_call_finished", "name": "peer_message", "is_error": true}}]}
+{"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"}}]}
diff --git a/src/main.zig b/src/main.zig
index 9cd4dd38..4ffb6d0b 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -591,7 +591,7 @@ test { // ── Unit tests (`zig build test`): pull in tests from imported modu
_ = @import("goal_flow.zig");
_ = @import("goal_todo.zig");
_ = @import("goal_pacing.zig");
- _ = .{ @import("presence_record.zig"), @import("peer_inbox_content_test.zig"), @import("peer_inbox_failure_test.zig") };
+ _ = .{ @import("presence_record.zig"), @import("peer_inbox_content_test.zig"), @import("peer_inbox_failure_test.zig"), @import("peer_inbox_storage_test.zig"), @import("peer_inbox_sequence_test.zig"), @import("peer_inbox_snapshot_test.zig") };
_ = @import("acp_agents.zig");
_ = @import("subagent_activity.zig");
_ = @import("subagent_recovery.zig");
diff --git a/src/peer_inbox.zig b/src/peer_inbox.zig
index eb219fbb..d6821c25 100644
--- a/src/peer_inbox.zig
+++ b/src/peer_inbox.zig
@@ -21,7 +21,15 @@ const Owner = worktree_lease.Owner;
pub const inbox_cap: usize = 8;
// Owned independently of the delivery arena, which resets between steps.
-const storage = std.heap.page_allocator;
+var test_storage: Allocator = std.heap.page_allocator;
+const storage = if (@import("builtin").is_test) &test_storage else &std.heap.page_allocator;
+
+/// Clear with the previous allocator before changing ownership domains.
+pub fn setStorageAllocatorForTest(allocator: Allocator) void {
+ if (!@import("builtin").is_test) @compileError("test-only inbox allocator override");
+ clear();
+ test_storage = allocator;
+}
const Parked = struct {
from: []const u8,
text: []const u8,
diff --git a/src/peer_inbox_sequence_test.zig b/src/peer_inbox_sequence_test.zig
new file mode 100644
index 00000000..be383603
--- /dev/null
+++ b/src/peer_inbox_sequence_test.zig
@@ -0,0 +1,152 @@
+//! Seeded state-machine regression for ADR 0111. The oracle is a plain FIFO
+//! of immutable corpus entries, not a second ring or a read from the inbox.
+const std = @import("std");
+const testing = std.testing;
+const inbox = @import("peer_inbox.zig");
+const Message = @import("presence_chan.zig").Message;
+const util = @import("util.zig");
+
+const Entry = struct { from: []const u8, text: []const u8, dm: bool, device: bool };
+const senders = [_][]const u8{ "", " \t\r\n", "zero\x00sender", "sender-" ++ util.repeatBytes("長🙂", 20) };
+const bodies = [_][]const u8{ "", "\x00", " \t\r\n ", "BEGIN\n" ++ util.repeatBytes("complete🙂 payload\n", 50) ++ "END \t" };
+const flags = [_][]const u8{ "", " · DM", " · device", " · device DM" };
+
+const Model = struct {
+ queue: std.ArrayList(Entry) = .empty,
+ lost: usize = 0,
+
+ fn clear(self: *Model) void {
+ self.queue.clearRetainingCapacity();
+ self.lost = 0;
+ }
+
+ fn append(self: *Model, entry: Entry) !void {
+ // Deliberately use a shifting list and the specified capacity, not the
+ // production head/length arithmetic or its capacity constant.
+ if (self.queue.items.len == 8) {
+ _ = self.queue.orderedRemove(0);
+ self.lost += 1;
+ }
+ try self.queue.append(testing.allocator, entry);
+ }
+
+ fn check(self: *const Model, a: std.mem.Allocator) !void {
+ try testing.expectEqual(self.queue.items.len, inbox.unread());
+ try testing.expectEqual(self.lost, inbox.dropped());
+ try testing.expectEqual(self.queue.items.len != 0 or self.lost != 0, inbox.pending());
+ const saved = try snapshot(a);
+ try testing.expectEqual(self.queue.items.len, saved.array.items.len);
+ for (self.queue.items, saved.array.items) |entry, value| {
+ const obj = value.object;
+ try testing.expectEqualStrings(entry.from, obj.get("from").?.string);
+ try testing.expectEqualStrings(entry.text, obj.get("text").?.string);
+ try testing.expectEqual(entry.dm, obj.get("dm").?.bool);
+ try testing.expectEqual(entry.device, obj.get("device").?.bool);
+ }
+ }
+
+ fn read(self: *Model, a: std.mem.Allocator) !void {
+ var expected: std.Io.Writer.Allocating = .init(a);
+ defer expected.deinit();
+ if (self.queue.items.len == 0 and self.lost == 0) {
+ try expected.writer.writeAll("inbox empty");
+ } else {
+ if (self.lost != 0) try expected.writer.print("[peer inbox: {d} dropped message(s) could not be retained; the room log keeps the originals]\n", .{self.lost});
+ for (self.queue.items) |entry| {
+ const flag: usize = @as(usize, @intFromBool(entry.dm)) + 2 * @as(usize, @intFromBool(entry.device));
+ try expected.writer.print("[peer message from {s}{s}]: {s}\n", .{ entry.from, flags[flag], entry.text });
+ }
+ try expected.writer.writeAll("(inbox cleared — reply with peer_message; omit session for the room, or name one peer to DM)");
+ }
+ try testing.expectEqualStrings(expected.writer.buffered(), try inbox.takeAll(a));
+ self.clear();
+ try self.check(a);
+ }
+};
+
+fn snapshot(a: std.mem.Allocator) !std.json.Value {
+ var out: std.Io.Writer.Allocating = .init(a);
+ defer out.deinit();
+ var json: std.json.Stringify = .{ .writer = &out.writer };
+ try inbox.writeJson(&json);
+ return std.json.parseFromSliceLeaky(std.json.Value, a, out.writer.buffered(), .{ .allocate = .alloc_always });
+}
+
+fn next(state: *u64) usize {
+ state.* = state.* *% 6364136223846793005 +% 1442695040888963407;
+ return @intCast(state.* >> 32);
+}
+
+fn parkBatch(model: *Model, state: *u64, count: usize) !void {
+ for (0..count) |_| {
+ // Every batch mixes local and device traffic; independently chosen
+ // target bits exercise all four flag combinations, including empties.
+ const local = Entry{ .from = senders[next(state) % 4], .text = bodies[next(state) % 4], .dm = next(state) % 2 != 0, .device = false };
+ const device = Entry{ .from = senders[next(state) % 4], .text = bodies[next(state) % 4], .dm = next(state) % 2 != 0, .device = true };
+ const lm = Message{ .from_session = local.from, .text = local.text, .to = if (local.dm) "recipient" else "" };
+ const dm = Message{ .from_session = device.from, .text = device.text, .to = if (device.dm) "recipient" else "" };
+ try testing.expectEqual(@as(usize, 2), inbox.parkHeard(&.{lm}, &.{dm}));
+ try model.append(local);
+ try model.append(device);
+ }
+}
+
+test "peer inbox sequence: seeded FIFO oracle across overflow persistence failed reads and retry" {
+ inbox.setStorageAllocatorForTest(testing.allocator);
+ defer inbox.setStorageAllocatorForTest(std.heap.page_allocator);
+ for ([_]u64{ 1, 865, 893, 0xdeadbeefcafef00d }) |seed| {
+ inbox.clear();
+ var model: Model = .{};
+ defer model.queue.deinit(testing.allocator);
+ var state = seed;
+ for (0..240) |step| {
+ // All temporary snapshots/results are reclaimed every transition;
+ // the oracle and inbox retain only eight bounded corpus entries.
+ var arena = std.heap.ArenaAllocator.init(testing.allocator);
+ defer arena.deinit();
+ const a = arena.allocator();
+ // A scripted prefix guarantees each transition, then seeded mixes
+ // explore differing queue occupancy and histories of loss.
+ const op = if (step < 10) step else next(&state) % 10;
+ switch (op) {
+ 0, 1, 2, 3 => try parkBatch(&model, &state, 1 + next(&state) % 13),
+ 4 => {
+ const saved = try snapshot(a);
+ const loss_json = try std.json.Stringify.valueAlloc(a, model.lost, .{});
+ const loss = try std.json.parseFromSliceLeaky(std.json.Value, a, loss_json, .{});
+ inbox.clear();
+ inbox.restoreJson(saved);
+ inbox.restoreDropped(loss);
+ },
+ 5 => {
+ var failing = testing.FailingAllocator.init(testing.allocator, .{ .fail_index = 0 });
+ if (model.queue.items.len != 0 or model.lost != 0) {
+ try testing.expectError(error.OutOfMemory, inbox.takeAll(failing.allocator()));
+ try testing.expect(failing.has_induced_failure);
+ try model.check(a);
+ } else {
+ try testing.expectEqualStrings("inbox empty", try inbox.takeAll(failing.allocator()));
+ try testing.expect(!failing.has_induced_failure);
+ }
+ try model.read(a);
+ },
+ 6 => try model.read(a),
+ 7 => {
+ inbox.clear();
+ model.clear();
+ },
+ 8 => {
+ const loss = next(&state) % 17;
+ inbox.restoreDropped(.{ .integer = @intCast(loss) });
+ model.lost += loss;
+ },
+ 9 => try testing.expectEqual(@as(usize, 0), inbox.parkHeard(&.{}, &.{})),
+ else => unreachable,
+ }
+ try model.check(a);
+ }
+ var arena = std.heap.ArenaAllocator.init(testing.allocator);
+ defer arena.deinit();
+ try model.read(arena.allocator());
+ }
+}
diff --git a/src/peer_inbox_snapshot_test.zig b/src/peer_inbox_snapshot_test.zig
new file mode 100644
index 00000000..52bd3497
--- /dev/null
+++ b/src/peer_inbox_snapshot_test.zig
@@ -0,0 +1,146 @@
+//! Adversarial mailbox snapshots through the session serialization boundary.
+const std = @import("std");
+const testing = std.testing;
+const Allocator = std.mem.Allocator;
+const Value = std.json.Value;
+const Agent = @import("agent.zig").Agent;
+const inbox = @import("peer_inbox.zig");
+const session = @import("session_peer.zig");
+const presence = @import("presence.zig");
+const main = @import("main.zig");
+const Fingerprint = @import("session_writer.zig").Fingerprint;
+const util = @import("util.zig");
+
+const Fixture = struct {
+ arena: std.heap.ArenaAllocator,
+ unattended: bool,
+
+ fn init() Fixture {
+ const old = main.unattended;
+ main.unattended = false;
+ inbox.setStorageAllocatorForTest(testing.allocator);
+ presence.resetRoomCursorForTest();
+ return .{ .arena = .init(testing.allocator), .unattended = old };
+ }
+
+ fn deinit(self: *Fixture) void {
+ inbox.setStorageAllocatorForTest(std.heap.page_allocator);
+ presence.resetRoomCursorForTest();
+ main.unattended = self.unattended;
+ self.arena.deinit();
+ }
+
+ fn restore(self: *Fixture, value: Value) void {
+ // Exercise mailbox dispatch without markCaughtUp's private channel
+ // latch: cursor dispatch has separate session_peer coverage.
+ var obj = value.object;
+ _ = obj.swapRemove("chan_off");
+ _ = obj.swapRemove("device_off");
+ var root: Agent = undefined;
+ root.arena = self.arena.allocator();
+ root.io = testing.io;
+ root.messages = std.json.Array.init(root.arena);
+ session.restore(&root, obj);
+ }
+
+ fn parse(self: *Fixture, text: []const u8) !Value {
+ return std.json.parseFromSliceLeaky(Value, self.arena.allocator(), text, .{ .allocate = .alloc_always });
+ }
+
+ fn save(self: *Fixture) !Value {
+ var aw: std.Io.Writer.Allocating = .init(self.arena.allocator());
+ defer aw.deinit();
+ var s: std.json.Stringify = .{ .writer = &aw.writer };
+ try s.beginObject();
+ try session.writeFields(&s);
+ try s.endObject();
+ return self.parse(aw.writer.buffered());
+ }
+};
+
+fn fingerprint() u64 {
+ var f = Fingerprint.init();
+ session.mixFingerprint(&f);
+ return f.final();
+}
+
+test "peer inbox snapshot: malformed entries do not consume capacity or count as evictions" {
+ var fixture = Fixture.init();
+ defer fixture.deinit();
+ var source = try fixture.parse("{\"peer_inbox\":[],\"peer_inbox_dropped\":4}");
+ const items = &source.object.getPtr("peer_inbox").?.array;
+ const malformed = try fixture.parse("[null,7,false,[],{}, {\"from\":9,\"text\":\"bad\"},{\"from\":\"bad\",\"text\":null},{\"from\":\"missing text\"},{\"text\":\"missing sender\"}]");
+ for (0..inbox.inbox_cap + 3) |i| {
+ for (malformed.array.items) |bad| try items.append(bad);
+ const raw = try std.fmt.allocPrint(fixture.arena.allocator(), "{{\"from\":\"peer\",\"text\":\"{d}\"}}", .{i});
+ try items.append(try fixture.parse(raw));
+ }
+ fixture.restore(source);
+ try testing.expectEqual(inbox.inbox_cap, inbox.unread());
+ try testing.expectEqual(@as(usize, 7), inbox.dropped());
+ const saved = try fixture.save();
+ for (saved.object.get("peer_inbox").?.array.items, 3..) |item, i| {
+ const expected = try std.fmt.allocPrint(fixture.arena.allocator(), "{d}", .{i});
+ try testing.expectEqualStrings(expected, item.object.get("text").?.string);
+ }
+}
+
+test "peer inbox snapshot: empty and escaped bytes survive and invalid flags default false" {
+ var fixture = Fixture.init();
+ defer fixture.deinit();
+ const source = try fixture.parse(
+ \\{"peer_inbox":[{"from":"","text":""},{"from":"a\u0000\n\t\u00e9\ud83d\ude80","text":"\u0000\u0001\b\f\n\r\t\"\\\u96ea\ud83d\ude80","dm":"true","device":1},{"from":"peer","text":"flags","dm":null,"device":{}},{"from":"peer","text":"true flags","dm":true,"device":true}]}
+ );
+ fixture.restore(source);
+ for (0..3) |_| {
+ const saved = try fixture.save();
+ const items = saved.object.get("peer_inbox").?.array.items;
+ try testing.expectEqual(@as(usize, 4), items.len);
+ for (items, source.object.get("peer_inbox").?.array.items, 0..) |item, original, i| {
+ try testing.expectEqualStrings(original.object.get("from").?.string, item.object.get("from").?.string);
+ try testing.expectEqualStrings(original.object.get("text").?.string, item.object.get("text").?.string);
+ try testing.expectEqual(i == 3, item.object.get("dm").?.bool);
+ try testing.expectEqual(i == 3, item.object.get("device").?.bool);
+ }
+ try testing.expectEqualStrings("a\x00\n\té🚀", items[1].object.get("from").?.string);
+ try testing.expectEqualStrings("\x00\x01\x08\x0c\n\r\t\"\\雪🚀", items[1].object.get("text").?.string);
+ fixture.restore(saved);
+ }
+}
+
+test "peer inbox snapshot: unsigned dropped count is stable through repeated saves and restores" {
+ if (@bitSizeOf(usize) < 64) return error.SkipZigTest;
+ var fixture = Fixture.init();
+ defer fixture.deinit();
+ fixture.restore(try fixture.parse("{\"peer_inbox\":[],\"peer_inbox_dropped\":18446744073709551614}"));
+ const expected: usize = std.math.maxInt(usize) - 1;
+ const initial = fingerprint();
+ for (0..5) |_| {
+ try testing.expectEqual(expected, inbox.dropped());
+ try testing.expectEqual(@as(usize, 0), inbox.unread());
+ const saved = try fixture.save();
+ try testing.expectEqualStrings("18446744073709551614", saved.object.get("peer_inbox_dropped").?.number_string);
+ fixture.restore(saved);
+ try testing.expectEqual(expected, inbox.dropped());
+ try testing.expectEqual(initial, fingerprint());
+ }
+}
+
+test "peer inbox snapshot: fingerprints cover suffixes flags and dropped-only changes" {
+ var fixture = Fixture.init();
+ defer fixture.deinit();
+ const a = fixture.arena.allocator();
+ const body = &util.repeatBytes("b", 220);
+ const sender = &util.repeatBytes("s", 60);
+ var hashes: [6]u64 = undefined;
+ for (&hashes, 0..) |*hash, i| {
+ const raw = try std.fmt.allocPrint(a, "{{\"peer_inbox\":[{{\"from\":\"{s}{s}\",\"text\":\"{s}{s}\",\"dm\":{s},\"device\":{s}}}],\"peer_inbox_dropped\":{d}}}", .{ sender, if (i == 1) "X" else "A", body, if (i == 2) "X" else "A", if (i == 3) "true" else "false", if (i == 4) "true" else "false", @as(usize, if (i == 5) 1 else 0) });
+ fixture.restore(try fixture.parse(raw));
+ hash.* = fingerprint();
+ const saved = try fixture.save();
+ inbox.clear();
+ fixture.restore(saved);
+ try testing.expectEqual(hash.*, fingerprint());
+ for (hashes[0..i]) |previous| try testing.expect(previous != hash.*);
+ }
+}
diff --git a/src/peer_inbox_storage_test.zig b/src/peer_inbox_storage_test.zig
new file mode 100644
index 00000000..d3ca97f2
--- /dev/null
+++ b/src/peer_inbox_storage_test.zig
@@ -0,0 +1,131 @@
+//! Storage ownership and allocation failures, with leak-tracked backing memory.
+const std = @import("std");
+const testing = std.testing;
+const inbox = @import("peer_inbox.zig");
+const Message = @import("presence_chan.zig").Message;
+const payload = @import("util.zig").repeatBytes("full body 🙂\n", 200);
+
+fn park(i: usize) !void {
+ const from = try std.fmt.allocPrint(testing.allocator, "sender-{d}", .{i});
+ defer testing.allocator.free(from);
+ const text = try std.fmt.allocPrint(testing.allocator, "body-{d}:{s}", .{ i, payload });
+ defer testing.allocator.free(text);
+ const m: Message = .{ .from_session = from, .text = text, .to = if (i % 2 == 0) "recipient" else "" };
+ const heard = if (i % 2 == 0) inbox.parkHeard(&.{m}, &.{}) else inbox.parkHeard(&.{}, &.{m});
+ try testing.expectEqual(@as(usize, 1), heard);
+}
+
+fn snapshot() ![]const u8 {
+ var writer: std.Io.Writer.Allocating = .init(testing.allocator);
+ defer writer.deinit();
+ var json: std.json.Stringify = .{ .writer = &writer.writer };
+ try inbox.writeJson(&json);
+ return writer.toOwnedSlice();
+}
+
+fn parkingFailure(full: bool, allocation: usize) !void {
+ var failing = testing.FailingAllocator.init(testing.allocator, .{});
+ inbox.setStorageAllocatorForTest(failing.allocator());
+ // Must release all allocations while failing is still alive.
+ defer inbox.setStorageAllocatorForTest(std.heap.page_allocator);
+ if (full) for (0..inbox.inbox_cap + 2) |i| try park(i);
+ const before = try snapshot();
+ defer testing.allocator.free(before);
+ const old_len = inbox.unread();
+ const old_loss = inbox.dropped();
+ failing.fail_index = failing.alloc_index + allocation;
+ try park(99);
+ try testing.expect(failing.has_induced_failure);
+ try testing.expectEqual(old_len, inbox.unread());
+ try testing.expectEqual(old_loss + 1, inbox.dropped());
+ try testing.expect(inbox.pending());
+ const after = try snapshot();
+ defer testing.allocator.free(after);
+ // Byte-exact JSON includes FIFO order, full payloads, senders and flags.
+ try testing.expectEqualStrings(before, after);
+ const result = try inbox.takeAll(testing.allocator);
+ defer testing.allocator.free(result);
+ try testing.expect(std.mem.indexOf(u8, result, "body-99:") == null);
+ try testing.expect(!inbox.pending());
+ try testing.expectEqual(failing.allocated_bytes, failing.freed_bytes);
+}
+
+test "inbox storage: first parking allocation fails on empty ring" {
+ try parkingFailure(false, 0);
+}
+
+test "inbox storage: second parking allocation fails on empty ring without leaking sender" {
+ try parkingFailure(false, 1);
+}
+
+test "inbox storage: first parking allocation fails on wrapped full ring without eviction" {
+ try parkingFailure(true, 0);
+}
+
+test "inbox storage: second parking allocation fails on wrapped full ring without eviction" {
+ try parkingFailure(true, 1);
+}
+
+test "inbox storage: eviction restore clear and allocator switch release owned bytes" {
+ var tracked = testing.FailingAllocator.init(testing.allocator, .{});
+ inbox.setStorageAllocatorForTest(tracked.allocator());
+ defer inbox.setStorageAllocatorForTest(std.heap.page_allocator);
+ for (0..inbox.inbox_cap * 3) |i| try park(i);
+ const saved = try snapshot();
+ defer testing.allocator.free(saved);
+ {
+ const parsed = try std.json.parseFromSlice(std.json.Value, testing.allocator, saved, .{ .allocate = .alloc_always });
+ defer parsed.deinit();
+ inbox.restoreJson(parsed.value);
+ }
+ const restored = try snapshot();
+ defer testing.allocator.free(restored);
+ try testing.expectEqualStrings(saved, restored);
+ try testing.expectEqual(@as(usize, 0), inbox.dropped());
+ inbox.clear();
+ inbox.clear();
+ try testing.expectEqual(tracked.allocated_bytes, tracked.freed_bytes);
+ try park(100);
+ inbox.setStorageAllocatorForTest(testing.allocator);
+ try testing.expectEqual(tracked.allocated_bytes, tracked.freed_bytes);
+ try testing.expect(!inbox.pending());
+ try park(101);
+ inbox.restoreJson(.null);
+ try testing.expect(!inbox.pending());
+}
+
+test "inbox storage: output allocation sweep frees partial reads and retains storage until retry" {
+ inbox.setStorageAllocatorForTest(testing.allocator);
+ defer inbox.setStorageAllocatorForTest(std.heap.page_allocator);
+ for (0..inbox.inbox_cap + 2) |i| try park(i);
+ const expected = try inbox.takeAll(testing.allocator);
+ defer testing.allocator.free(expected);
+ for (0..128) |fail_index| {
+ for (0..inbox.inbox_cap + 2) |i| try park(i);
+ const before = try snapshot();
+ defer testing.allocator.free(before);
+ var failing = testing.FailingAllocator.init(testing.allocator, .{ .fail_index = fail_index });
+ const result = inbox.takeAll(failing.allocator()) catch |err| {
+ try testing.expectEqual(error.OutOfMemory, err);
+ try testing.expect(failing.has_induced_failure);
+ try testing.expectEqual(failing.allocated_bytes, failing.freed_bytes);
+ try testing.expectEqual(inbox.inbox_cap, inbox.unread());
+ try testing.expectEqual(@as(usize, 2), inbox.dropped());
+ const after = try snapshot();
+ defer testing.allocator.free(after);
+ try testing.expectEqualStrings(before, after);
+ const retry = try inbox.takeAll(testing.allocator);
+ defer testing.allocator.free(retry);
+ try testing.expectEqualStrings(expected, retry);
+ try testing.expect(!inbox.pending());
+ continue;
+ };
+ defer failing.allocator().free(result);
+ try testing.expect(!failing.has_induced_failure);
+ try testing.expect(fail_index > 0);
+ try testing.expectEqualStrings(expected, result);
+ try testing.expect(!inbox.pending());
+ return;
+ }
+ return error.AllocationSweepDidNotFinish;
+}