graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
eval(tier2): the escalation ladder's R0d revision path, behaviorally pinned
justrach60fa60a09a03
diff --git a/evals/harness_behavior.jsonl b/evals/harness_behavior.jsonlindex 189a629a..69d1278f 100644--- a/evals/harness_behavior.jsonl+++ b/evals/harness_behavior.jsonl@@ -8,3 +8,5 @@{"id": "two-file-edit-lands-both", "why": "#106: a two-file change has to land on disk, not merely be reported. The second edit_file only matches if the first write really happened, and the closing bash check prints its marker only when both files hold the new text - a reported-but-absent edit fails the case instead of passing it.", "args": [], "env": {"GRAFF_NO_CODEDB_GUARD": "1"}, "prompt": "raise the timeout to 60 and mark the import in the client", "script": [{"tool": "write_file", "arguments": {"path": "settings.py", "content": "TIMEOUT = 30\n"}}, {"tool": "write_file", "arguments": {"path": "client.py", "content": "from settings import TIMEOUT\n"}}, {"tool": "edit_file", "arguments": {"path": "settings.py", "old_string": "TIMEOUT = 30", "new_string": "TIMEOUT = 60"}}, {"tool": "edit_file", "arguments": {"path": "client.py", "old_string": "from settings import TIMEOUT", "new_string": "from settings import TIMEOUT # noqa"}}, {"tool": "bash", "arguments": {"command": "grep -q 'TIMEOUT = 60' settings.py && grep -q noqa client.py && echo both-edits-on-disk"}}, {"text": "both files are updated"}], "assert": [{"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}}, {"event": {"type": "tool_result", "name": "bash", "text": "both-edits-on-disk\n"}}, {"request_contains": {"index": -1, "text": "settings.py"}}, {"request_contains": {"index": -1, "text": "client.py"}}, {"final_text_contains": "both files are updated"}]}{"id": "failed-bash-is-not-reported-as-success", "why": "#106: a command that fails must come back marked is_error with its exit status and stderr intact, so the next turn cannot mistake it for success. The regression is a swallowed failure - a non-zero exit finishing as an ok tool_call, or output trimmed away before the model sees why it broke.", "args": [], "prompt": "run the config check", "script": [{"tool": "bash", "arguments": {"command": "ls missing_config.yaml; exit 7"}}, {"text": "the config check failed, so I am not claiming it passed"}], "assert": [{"event": {"type": "tool_call_finished", "name": "bash", "is_error": true}}, {"events_at_most": {"match": {"type": "tool_call_finished", "name": "bash", "is_error": false}, "count": 0}}, {"request_contains": {"index": -1, "text": "[exit code 7]"}}, {"request_contains": {"index": -1, "text": "No such file or directory"}}, {"final_text_contains": "the config check failed"}]}{"id": "subagent-compaction-pins-task", "why": "G2/H2: compact() must call pinChildTask before it summarizes a subagent's history, or a compacted child loses its own mandate. No unit test can prove the wiring (compact() hits the network right after the prelude), so this drives a real child through auto-compaction against the scripted model and checks the request sent right after: it must still carry the child's task, restated verbatim, not just the model's summary.", "args": [], "env": {"GRAFF_COMPACT_PCT": "5"}, "prompt": "spawn a subagent to survey the payments module", "script": [{"tool": "subagent", "arguments": {"description": "survey payments", "prompt": "SENTINEL-TASK-9f2c: read every file under payments/ and list the exported functions"}}, {"tool": "bash", "arguments": {"command": "python3 -c \"print('c0'*2000)\""}}, {"tool": "bash", "arguments": {"command": "python3 -c \"print('c1'*2000)\""}}, {"tool": "bash", "arguments": {"command": "python3 -c \"print('c2'*2000)\""}}, {"tool": "bash", "arguments": {"command": "python3 -c \"print('c3'*2000)\""}}, {"text": "the payments module has been surveyed so far"}, {"text": "functions listed: chargeCard, refund, listInvoices"}, {"text": "the subagent found chargeCard, refund, and listInvoices"}], "assert": [{"event": {"type": "tool_call", "name": "subagent"}}, {"event": {"type": "tool_result", "name": "subagent", "is_error": false}}, {"request_contains": {"index": 6, "text": "SENTINEL-TASK-9f2c"}}, {"request_contains": {"index": 6, "text": "restated verbatim"}}, {"final_text_contains": "the subagent found chargeCard, refund, and listInvoices"}]}+{"id": "escalation-r0-declines-then-r0d-revision", "why": "escalation R0d: a 1-file bugfix must be DECLINED solo (the 0.0.237 study's 30-calls-no-edit regression), and the SECOND ask of the same class must get the R0d revision prescription — evidence-carrying sequential revision before any fleet. The regression is a fleet on first ask, or a flat second decline that never prescribes the revision.", "args": [], "prompt": "ultracode fix the bug in stats.py", "script": [{"tool": "workflow", "arguments": {"phases": [{"title": "find the defect", "tasks": [{"description": "find", "prompt": "read stats.py and locate the defect"}]}, {"title": "implement the fix", "tasks": [{"description": "fix", "prompt": "fix the defect in stats.py"}]}]}}, {"text": "declined by the ladder — I made the edit solo but the tests still fail"}, {"tool": "workflow", "arguments": {"phases": [{"title": "find the defect", "tasks": [{"description": "find", "prompt": "read stats.py and locate the defect"}]}, {"title": "implement the fix", "tasks": [{"description": "fix", "prompt": "fix the defect in stats.py"}]}]}}, {"text": "revising with deeper analysis as prescribed"}], "second_prompt": "the fix did not take — pytest still fails in stats.py", "assert": [{"event": {"type": "tool_result", "name": "workflow", "is_error": false}}, {"request_contains": {"index": 1, "text": "(escalation R0):"}}, {"request_contains": {"index": 1, "text": "Do it yourself"}}, {"request_lacks": {"index": 1, "text": "(escalation R0d):"}}, {"request_contains": {"index": -1, "text": "(escalation R0d):"}}, {"request_contains": {"index": -1, "text": "revision case"}}, {"request_contains": {"index": -1, "text": "second failure earns the fleet"}}, {"final_text_contains": "revising with deeper analysis"}]}+{"id": "escalation-no-verifier-no-revision-loop", "why": "Weng's revision gate (failure_evidence.verifierFor): a review-class ask has no free verification signal, so a repeat failure must NOT be prescribed a solo revision — R0d stays shut, and with the fleet unaffordable the decline is the plain R0 advisory. The regression is a revision loop spun without external feedback, which converts right answers to wrong ones as often as the reverse.", "args": ["--max-model-calls", "8"], "prompt": "review the findings in report.py", "script": [{"tool": "workflow", "arguments": {"phases": [{"title": "find problems", "tasks": [{"description": "find", "prompt": "read report.py and list the problems"}]}, {"title": "verify each finding", "tasks": [{"description": "verify", "prompt": "verify the problems in report.py"}]}]}}, {"text": "reviewed solo as told"}, {"tool": "workflow", "arguments": {"phases": [{"title": "find problems", "tasks": [{"description": "find", "prompt": "read report.py and list the problems"}]}, {"title": "verify each finding", "tasks": [{"description": "verify", "prompt": "verify the problems in report.py"}]}]}}, {"text": "continuing the review myself"}], "second_prompt": "that review missed real problems in report.py — go again", "assert": [{"request_contains": {"index": 1, "text": "(escalation R0):"}}, {"request_contains": {"index": -1, "text": "(escalation R0):"}}, {"request_lacks": {"index": -1, "text": "(escalation R0d):"}}, {"request_lacks": {"index": -1, "text": "revision case"}}, {"final_text_contains": "continuing the review myself"}]}