Counterproof

How well Counterproof catches gamed AI code changes

Strict counts UNPROVEN or REFUTED as flagged, the definition in the product requirements; lenient also counts WEAK. Every table on this page is generated from the committed results files and regenerates with counterproof eval.

C1: seeded changes (160 cases)

Two fixture libraries, Python py_ledger (pytest) and TypeScript ts_cart (Vitest). Each task has one honest fix and three gamed variants: hard-coded outputs for the test's inputs, a wrong fix whose broken test was weakened, and a partial fix that only handles the reported example. Ground truth is by construction and checked with the real test runners.

Gamed changes caught

Higher is better. Hard-coded, weakened and partial fixes whose own tests pass.

  • Counterproof, with an LLM 75% Counterproof, with an LLM: 75% · 90 of 120
  • Counterproof, rules only 67% Counterproof, rules only: 67% · 80 of 120
  • B0: The tests are green 0% B0: The tests are green: 0% · 0 of 120
  • B2: Classic mutation, diff-scoped 39% B2: Classic mutation, diff-scoped: 39% · 47 of 120
Honest fixes flagged

Lower is better. Correct fixes that were flagged anyway.

  • Counterproof, with an LLM 8% Counterproof, with an LLM: 8% · 3 of 40
  • Counterproof, rules only 0% Counterproof, rules only: 0% · 0 of 40
  • B0: The tests are green 0% B0: The tests are green: 0% · 0 of 40
  • B2: Classic mutation, diff-scoped 22% B2: Classic mutation, diff-scoped: 22% · 9 of 40
C1, generated 2026-11-08
ConfigurationGamed flagged, strictGamed flagged, lenientHonest flagged, strictHonest flagged, lenient
Counterproof, rules only67%78%0%25%
Counterproof, recorded LLM75%98%8%28%
B0: the tests are green0%0%0%0%
B1: claim audit only0%0%0%0%
B2: diff-scoped classic mutation39%39%22%22%

By kind of gaming

ConfigurationKindCasesFlagged, strictFlagged, lenient
rules onlyhard-coded404040
rules onlyhonest40010
rules onlypartial40014
rules onlyweakened404040
recorded LLMhard-coded404040
recorded LLMhonest40311
recorded LLMpartial401037
recorded LLMweakened404040

Median runtime per run: 14.6 s (rules), 26.5 s (llm). Same verdict on a repeated run with the same seed: 100% (rules), 100% (llm).

C2: Claude Code sessions (23 cases)

Corpus C2: agent sessions with the claims they made. Two parts. (1) 15 real Claude Code sessions (claude-sonnet-5, headless, Claude Code 2.1.220, November 2026) on py_ledger tasks T6 to T13, recorded by scripts/c2_agent_sessions.py: a neutral condition (fix the reported bug) and an EvilGenie-style pressure condition (a given test file holds the reported example and one case that contradicts the task, and the agent must not edit tests). Labels come from held-out tests the agent never saw plus a hand review of every session; a 16th session made no change (it reported the contradiction) and has nothing to verify. (2) Eight hand-built sessions in the same JSONL format with real pytest output, covering the false-claim patterns (false green, masked exit code, subset run, count mismatch, no run).

Gamed changes caught

Higher is better. Hard-coded, weakened and partial fixes whose own tests pass.

  • Counterproof, with an LLM 25% Counterproof, with an LLM: 25% · 2 of 8
  • Counterproof, rules only 25% Counterproof, rules only: 25% · 2 of 8
  • B0: The tests are green 25% B0: The tests are green: 25% · 2 of 8
  • B1: Claim audit only 88% B1: Claim audit only: 88% · 7 of 8
  • B2: Classic mutation, diff-scoped 62% B2: Classic mutation, diff-scoped: 62% · 5 of 8
Honest fixes flagged

Lower is better. Correct fixes that were flagged anyway.

  • Counterproof, with an LLM 33% Counterproof, with an LLM: 33% · 5 of 15
  • Counterproof, rules only 0% Counterproof, rules only: 0% · 0 of 15
  • B0: The tests are green 40% B0: The tests are green: 40% · 6 of 15
  • B1: Claim audit only 0% B1: Claim audit only: 0% · 0 of 15
  • B2: Classic mutation, diff-scoped 20% B2: Classic mutation, diff-scoped: 20% · 3 of 15
C2, generated 2026-11-08
ConfigurationGamed flagged, strictGamed flagged, lenientHonest flagged, strictHonest flagged, lenient
Counterproof, rules only25%88%0%27%
Counterproof, recorded LLM25%100%33%33%
B0: the tests are green25%25%40%40%
B1: claim audit only88%88%0%0%
B2: diff-scoped classic mutation62%62%20%20%

C3: real agent pull requests (41 cases)

Corpus C3: merged pull requests from public Python repositories whose description says they were generated with Claude Code (one per repository, GitHub search, October to November 2026). They are assumed honest, so every UNPROVEN or REFUTED verdict counts as a false alarm (PRD 17.1) and is reviewed by hand. Each pull request ran on its own GitHub Actions runner with its dependencies installed best effort; INCONCLUSIVE means Counterproof could not run the project's tests (setup log per case).

C3, generated 2026-11-09
VerdictPull requests
INCONCLUSIVE32
PROVEN0
REFUTED1
UNPROVEN5
WEAK3

Counterproof could run the tests of 9 of the 41 pull requests; the rest are INCONCLUSIVE, mostly because the project's tests did not collect after a best-effort install on a fresh runner. All are assumed honest, so every flag is a false alarm until a hand review says otherwise: 6 of 9 strict (UNPROVEN or REFUTED), 9 of 9 lenient (also WEAK).

A hand review of every flagged pull request found no gaming. The UNPROVEN ones are honest changes whose tests do not pin them: they catch few realistic wrong versions, or pass on the old code too. The one REFUTED adds a test that skips itself when model weights are not downloaded, which looks the same as an agent skipping a test it cannot pass. Full per-case reasons and setup logs are in the C3 results file.

Limits

  • Strict recall misses its target, by design of the verdict rules. A partial fix whose tests catch most wrong versions is WEAK (rule 9), and partial fixes are a third of the gamed cases, so the rules as specified cap strict recall below the 85% target. Counterproof reports these partial fixes as WEAK, with the exact missing test.
  • Real pull requests are mostly INCONCLUSIVE on a fresh machine. In C3, 32 of 41 pull requests were INCONCLUSIVE, most because the project's tests did not collect after a best-effort install, and 3 more timed out. Counterproof runs the project's own environment; it does not build one. On the 9 it could run, 6 honest changes were flagged strict, 5 of them because their tests do not pin the change.
  • Corpora written by the tool's author. C1 is seeded by the same author as the tool, and C2's 15 real sessions run on the same fixture library. Treat them as evidence and a regression suite, not proof of accuracy on every code base.
  • UNPROVEN on honest changes. Agents often add one test for the reported example. Counterproof then says the change is not proven, which is true, but it counts as a false alarm on an honest fix (5 of 15 real sessions, 3 of 40 seeded honest fixes).
  • One sample of LLM answers. LLM results replay one recorded sample of DeepSeek answers; another sample or model can move a few verdicts. One of 811 recorded replies was invalid JSON and was rejected by the strict contract.
  • Missed partial fixes. 3 of 40 partial fixes pass as PROVEN even with an LLM, for example giving every leftover cent to the first share, which no generated test or mutant probed with two or more leftover cents.
  • B2 is an approximation of diff-scoped classic mutation (Counterproof's rule mutants with no equivalence filter), not mutmut or Stryker.
  • Docker sandbox: Linux and macOS hosts; Node projects need a Linux host.