# Replacing Clipboard Relay Loops with Direct Verifier-to-Harness Pipes

Published: 2026-10-18 | Domain: https://dontbeameatproxy.si | Related Surface: https://harness.baltor.ai

## Outcome first: 300-byte structured counterexamples beat 4,000-line terminal logs

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:

1. **`status`**: `"passed"`, `"failed_assertion"`, or `"refused_precondition"`.
2. **`failed_rule_id`**: The exact specification constraint ID (for example, `"rule_07_swept_aabb_no_tunneling"`).
3. **`minimal_counterexample`**: The smallest input vector that triggered the failure (`{"velocity": [0, -42.0, 18.5], "dt": 0.032}`).
4. **`ast_location`**: Exact file path, function symbol, and line range implicated by the failure.

```python
# 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.
