# Blind Verifiers Stop AI Test Contamination: 100% vs. 86.5% Spec Purity (N=3)

> 💡 **AI Labo Benchmark Series — Experiment `E48` (Swarm Shared Board & Blind Verifier)**
>
> Part of our controlled benchmark series testing AI coding agent harnesses inside network-isolated Proxmox VMs (`N=3` counterbalanced `AB`/`BA`/`AB` trials, `temperature=0.7`, 3-UID grading, 90% prefix-cache cost accounting).
> * 🚀 **[Master Benchmark Hub & All Pattern Rankings](https://tappers.hashnode.dev/ai-agent-harness-patterns-benchmark)**
> * 🛡️ **[Anti-Cheating Proxmox & systemd Sandbox Architecture](https://tappers.hashnode.dev/air-gapped-proxmox-systemd-agent-sandbox)**

When a multi-agent workflow passes a task down a chain—Planner ➔ Implementer ➔ Reviewer—two hidden failure modes emerge. Either handoff summaries balloon into tens of thousands of tokens to avoid "Telephone Game" spec drift, or a code-visible reviewer writes unit tests that silently assert the implementer's private quirks instead of the original specification.

We tested whether replacing a serial subagent summary relay with an **append-only Shared Message Board (`#seq` primary anchoring)** and an **implementation-blind `@blind_verifier`** eliminates **Test Specification Contamination** on `models/gemini-4-carbon` (`thinkingLevel="MEDIUM"`, `N=3`).

---

## TL;DR — Key Empirical Findings

* **1. Functional Parity at `32.00 ± 0.00 / 32` (`100.0%`)—Zero Strawman Penalties:** With unclipped handoff summaries, `Baseline (Serial Subagent Relay)` preserved accuracy by writing `34,535.0 ± 2,102.7` chars of re-stated specs across 3 handoffs (`planner` alone averaged `18,993.7` chars), matching `Candidate (Swarm Shared Board)` at `32/32` functional tests—while hitting `0.33 ± 0.58` repair rounds and `0.67 ± 1.15` decoy reads (`0.00` for Candidate).
* **2. Blind Verification Eliminates Test Specification Contamination (`100.0%` vs. `86.5%` Spec Purity):** When grading `candidate_tests.py` against `golden_ref`, `Baseline`'s code-visible reviewer leaked implementation-specific assumptions into `5 / 37` tests across **all `3/3` trials** (`32/37 = 86.5%` purity), dropping its Golden-validated 8-mutant kill rate to `7.33 ± 0.58 / 8` (`91.67%`, missing `mutant_04_bool_duration_accepted` in Trials 2 & 3). `Candidate`'s `@blind_verifier` hit **`40 / 40` (`100.0%`) spec purity** and **`8.00 ± 0.00 / 8` (`100.0%`) mutant kill rate** (raw unvalidated kills were `8/8` on both, proving contamination rather than weak assertions).
* **3. `-87.2%` Planning Tax & `2.36x` Tighter Cost Variance for `+4.32%` Mean Cost:** Anchoring `TASK.md` at board `#1` cut `coordinator` planning cost in Trial 1 to `` `$0.0280` `` vs. `planner`'s `` `$0.2058` `` (`-87.2%`), and cut total effective cost SD by **`-57.59%`** (`` `$0.8218 ± $0.1839` `` vs. `` `$0.8573 ± $0.0780` ``, `+4.32%` / `` `+$0.0355` `` mean due to `+4` `read_board` calls).

| Metric (`N=3` Trials, `Mean ± SD`) | Baseline: `Serial Subagent Relay` (Code-Visible) | Candidate: `Swarm Board + Blind Verifier` | Delta / Effect |
| :--- | :---: | :---: | :--- |
| **Hidden Functional Suite (`32` Cases)** | **`32.00 ± 0.00`** (`100.0%`) | **`32.00 ± 0.00`** (`100.0%`) | `100%` functional parity |
| **Test Spec Purity (`golden_ref` Match)** | `32 / 37` (`86.5%`, `10.67 ± 3.51`) | **`40 / 40` (`100.0%`, `13.33 ± 1.15`)** | **`+13.5 pt` (`0/3` vs. `3/3` contaminated)** |
| **Golden-Validated Mutants (`8` Cases)** | `7.33 ± 0.58` (`91.67% ± 7.22%`) | **`8.00 ± 0.00` (`100.0% ± 0.0%`)** | **`+8.33 pt` (`1/3` vs. `3/3` full 8/8)** |
| **Repair Rounds / Decoy Reads** | `0.33 ± 0.58` / `0.67 ± 1.15` | **`0.00 ± 0.00` / `0.00 ± 0.00`** | **Zero rework & zero decoy drift** |
| **Agent Handoff / Board Text** | `34,535.0 ± 2,102.7` chars | **~`6,581` chars (`#2`–`#5` in T1)** | **`-81%` relay prose via `#1` pointer** |
| **LLM Calls (`model_calls`)** | **`10.00 ± 1.73`** (`[9–12]`) | `14.00 ± 0.00` (`[14–14]`) | `+4.0` lightweight `read_board` calls |
| **Visible Output (`candidates`)** | `32,550.3 ± 10,735.0` | **`31,378.3 ± 2,885.4`** | **`-3.60%`** (`3.7x` tighter SD) |
| **Elapsed Time (Serial Harness)** | **`994.41s ± 171.64s`** | `1,001.32s ± 188.63s` | `+0.69%` (single-process serial run) |
| **Effective Cached Cost (90% OFF)** | **`` `$0.8218 ± $0.1839` ``** | `` `$0.8573 ± $0.0780` `` | **`+$0.0355` (`+4.32%`), SD `-57.59%`** |
| **List-Price Upper Bound (No Cache)** | **`` `$0.9109 ± $0.2529` ``** | `` `$0.9446 ± $0.0772` `` | `+3.70%`, SD `-69.47%` |
| **Output Cap Hits (`capped_termination`)** | `0 / 3` | `0 / 3` | Zero truncation |

---

## 1. Experiment Design & Architecture

```text
+-----------------------------------------------------------------------+
| Proxmox VM252 (0 NICs, gemini-4-carbon MEDIUM, temp=0.7, N=3 AB/BA)   |
| Task: 4-Stage GPU Billing & Netting Pipeline (32 Tests + 8 Mutants)   |
|                                                                       |
| Baseline (Serial Subagent Relay + Code-Visible Reviewer):             |
|   planner (18,994c) -> impl_metering (9,885c) -> impl_clearing (5,657c)|
|   -> reviewer_tester (reads .py impls -> writes contaminated tests)   |
|   --> 10.0 calls | $0.8218 eff. | 32/32 func | 7.33/8 golden mutants  |
|                                                                       |
| Candidate (Swarm Shared Board #1 + Implementation-Blind Verifier):    |
|   SHARED_BOARD.jsonl #1 (12,573c TASK.md)                             |
|   -> coordinator (#2 brief) -> @author_metering -> @author_clearing   |
|   -> @blind_verifier (DENIED read on 4 .py impls; reads #1 + contracts)|
|   --> 14.0 calls | $0.8573 eff. | 32/32 func | 8.00/8 golden mutants  |
+-----------------------------------------------------------------------+
```

Both modes used identical 4-role structures, identical `max_output_tokens=24576`, and zero artificial summary length caps. In `Baseline`, `reviewer_tester` read the candidate `.py` files and asserted non-standard defensive `ValueError` checks invented by `impl_metering` (Trial 1) and `impl_clearing` (Trials 2 & 3)—bundling them with `bool` validation tests so `golden_ref` rejected the entire contaminated test function and lost coverage of `mutant_04_bool_duration_accepted`.

---

## 2. Drop-In Implementation Recipe: `SharedBoardWorkspaceGuard`

Enforce append-only primary spec anchoring, disjoint file ownership per `@author`, and hard read/write isolation for `@blind_verifier` at the tool layer:

```python
import json
from pathlib import Path


class SharedBoardWorkspaceGuard:
    """Enforces #1 spec anchoring, disjoint module ownership, and blind verification."""

    ROLE_RULES = {
        "author_metering": {"rw": {"usage_meter.py", "credit_allocator.py"}, "deny_read": set()},
        "author_clearing": {"rw": {"netting_engine.py", "audit_manifest.py"}, "deny_read": set()},
        "blind_verifier": {
            "rw": {"candidate_tests.py"},
            "deny_read": {
                "usage_meter.py", "credit_allocator.py",
                "netting_engine.py", "audit_manifest.py",
            },
        },
    }

    def __init__(self, workdir: Path) -> None:
        self.workdir = workdir
        self.board_path = workdir / "SHARED_BOARD.jsonl"

    def append_post(self, author: str, message: str) -> int:
        seq = sum(1 for _ in self.board_path.open()) + 1 if self.board_path.exists() else 1
        with self.board_path.open("a", encoding="utf-8") as fh:
            fh.write(json.dumps({"seq": seq, "author": author, "body": message}) + "\n")
        return seq

    def inspect_file(self, role: str, rel_path: str) -> str:
        if rel_path in self.ROLE_RULES[role]["deny_read"]:
            raise PermissionError(f"BLIND_VERIFIER_DENIED: '{role}' cannot read '{rel_path}'")
        return (self.workdir / rel_path).read_text(encoding="utf-8")

    def write_file(self, role: str, rel_path: str, content: str) -> None:
        if rel_path not in self.ROLE_RULES[role]["rw"]:
            raise PermissionError(f"OWNERSHIP_DENIED: '{role}' cannot modify '{rel_path}'")
        (self.workdir / rel_path).write_text(content, encoding="utf-8")
```

* **Why this works:** Stripping read access to candidate `.py` files makes collusive overfitting physically impossible—the verifier can only derive assertions from `#1` (`TASK.md`) and `0444` interface contracts, guaranteeing `100%` spec-pure regression suites.

---

## 3. Threats to Validity & When NOT to Use This

1. **Serial vs. Parallel Wall-Clock Time:** To keep token/cache telemetry strictly controlled via a single QGA relay, Candidate's `@author` workers ran sequentially (`1,001.32s` vs. `994.41s`). In production swarms (`workspace: "share"`), disjoint `@author` execution parallelizes implementation latency down to `max(workers)` plus merge overhead.
2. **Ceiling Effect & Sample Size (`N=3`):** At 4 editable modules, `Baseline` compensated for serial handoffs by emitting ~`19k`-char summaries; on 50+ file tasks exceeding single-turn output caps, serial relay accuracy is expected to degrade. Function-level `golden_ref` filtering also explains why Trials 2–3 lost `mutant_04` despite `raw_unvalidated_kill_count = 8/8` (`N >= 10` is needed for narrow mean-cost hypothesis tests).
3. **When Baseline Is Enough:** For single-module hotfixes or throwaway scripts where long-lived black-box regression suites are unnecessary, spawning 4 board-reading swarm roles adds `+4` calls and `+$0.0355` overhead without payoff.

<details>
<summary>📋 Experiment Metadata & Reproducibility</summary>

* **Experiment ID:** `E48` (`C044` / Benchmark v2.1)
* **Run ID:** `e48-20261117-vm252-01` (`N=3` trials: `AB` ➔ `BA` ➔ `AB`, `temperature=0.7`)
* **Sandbox Environment:** Proxmox Isolated VM `VM252` (0 NICs, `PrivateNetwork=yes`, 3-UID isolation: `labexp48` / `labrunner48` / `labjudge48`)
* **Model & Thinking Level:** `models/gemini-4-carbon` (`thinkingLevel="MEDIUM"`, `max_output_tokens=24576`)
* **Cost Accounting:** Google 90% implicit prefix-cache discount (`effective_cached_micro_usd`) as primary metric; list-price upper bound reported alongside.

</details>

---

**Discussion:** In your multi-agent reviews, do you let the test-writing agent read the implementation diff, or do you isolate it to specs and public interfaces only?

### 🔗 Continue Reading the Series
* 🚀 **Master Benchmark Hub:** [AI Agent Harness Patterns Benchmark](https://tappers.hashnode.dev/ai-agent-harness-patterns-benchmark)
* 🛡️ **Methodology & Sandbox Architecture:** [How to Benchmark AI Agents Without Eval Cheating or API Key Leaks: Designing a Proxmox & systemd Sandbox](https://tappers.hashnode.dev/air-gapped-proxmox-systemd-agent-sandbox)
* ⬅️ **Previous Post (`E47`):** [Measuring the Double-Thinking Tax on Gemini 4 Carbon: Subtracting Legacy Scaffolding Cuts Effective Cost by 30.9% (N=3)](https://tappers.hashnode.dev/e47-carbon-harness-subtraction-tax)
* ➡️ **Next Post (`E49`):** [The +38% Compliance Audit Tax: Spec-Conflict Gates on Gemini 4 Carbon (N=3)](https://tappers.hashnode.dev/e49-carbon-spec-conflict-escalation)
* 🧪 **Related Blind TDD (`E06`):** [Why AI Agents Write Weak Tests for Their Own Code: Single-Agent TDD vs. Two-Agent Blind TDD (0% vs. 100% Mutant Kill Rate)](https://tappers.hashnode.dev/e06-blind-tdd-worktrees)
