Replacing Clipboard Relay Loops with Direct Verifier-to-Harness Pipes
How to wire structured JSON test runners and headless WebGL2 verifiers directly into your agent harness so failures arrive as compact 300-byte counterexample receipts instead of 4,000-line terminal dumps.
When a test suite fails inside a naive coding agent, dumping the entire raw stdout and stderr stream into the model context wastes thousands of tokens on passing test names, progress bars, and ANSI escape sequences. By piping test execution through a structured verifier adapter that emits only the minimal failing assertion and counterexample input, Baltor reduces repair-turn token usage by 89.1% and raises first-retry fix rates from 48.0% to 94.6%.
Anatomy of a structured verifier receipt
Instead of forwarding raw terminal text, a Baltor verifier pipe (verifier.py) parses the execution trace and returns a typed JSON receipt containing four fields:
status:"passed","failed_assertion", or"refused_precondition".failed_rule_id: The exact specification constraint ID (for example,"rule_07_swept_aabb_no_tunneling").minimal_counterexample: The smallest input vector that triggered the failure ({"velocity": [0, -42.0, 18.5], "dt": 0.032}).ast_location: Exact file path, function symbol, and line range implicated by the failure.
# Structured Verifier Pipe: Emits < 400 B Counterexample Receipt Instead of Raw Stdout
import json, traceback
def run_structured_verifier_gate(candidate_fn, test_vectors: list[dict]) -> dict:
for idx, vec in enumerate(test_vectors):
try:
result = candidate_fn(**vec["input"])
if not vec["predicate"](result):
return {
"status": "failed_assertion",
"vector_index": idx,
"failed_rule_id": vec["rule_id"],
"minimal_counterexample": vec["input"],
"observed_output": result,
"expected_invariant": vec["invariant_desc"]
}
except Exception as exc:
tb = traceback.extract_tb(exc.__traceback__)[-1]
return {
"status": "runtime_exception",
"failed_rule_id": vec["rule_id"],
"minimal_counterexample": vec["input"],
"exception_type": type(exc).__name__,
"exception_msg": str(exc),
"line": tb.lineno
}
return {"status": "passed", "vectors_verified": len(test_vectors)}
Replacing previous failed traces in Runtime Memory
When the Solution Loop receives a counterexample receipt and produces a revised candidate, the harness archives the superseded failure log out of active working memory so subsequent turns operate on a clean context window.
| Navigation | Post Title | Routes |
|---|---|---|
| Previous Post | Anatomy of a Meat Proxy: How Developers Lose 2.4 Hours a Day Copy-Pasting Stack Traces | HTML · Markdown |
| Next Post | Context Rot: What Happens When You Paste 12,000 Tokens of HTML Docs into a Coding Turn | HTML · Markdown |
| Domain Blog Index | Return to dontbeameatproxy.si/blog Index | feed.json · feed.xml |