PR reviewGitHub · Python & pytest

A PR comment should be a failing test.

A GitHub pull-request reviewer that comments only when a generated pytest passes 3/3 on the base commit and fails 3/3 on the head commit, plus a one-line command to reproduce it. If it cannot prove a behavior change, it stays silent.

Built for: Python engineering teams who want failing-test proof on pull requests instead of noisy LLM commentary.

Recorded walkthrough of the live replay playground across recorded bug catches and filtered refactors.Try the interactive replay ↗
  • 3/3 gateCandidates must pass 3/3 on base and fail 3/3 on head; flaky tests are dropped
  • 80% catch (mock)16/20 seeded bugs caught on catchbench using recorded completions
  • 0% false alarms0/20 on harmless refactors in catchbench mock mode (vs 6/20 for read-only fixtures)
  • Split CI securityUntrusted PR job runs with contents:read & zero secrets; workflow_run comments
Problem & solution

A comment should be a failing test, not a suspicion.

The problem

Prose guesses on every diff.

Traditional AI PR reviewers read a diff and post prose guesses. Developers end up wading through false positives on harmless refactors because the bot never actually executes code.

The fix

Proof, or silence.

Following Meta’s JIT catching-test design (Becker et al., FSE 2026), two diff-aware generators write pytests, execute them in isolated git worktrees on base and head, run deterministic assessors, and output a one-line catchpr repro command.

Verified capabilities

What the code actually does.

Intent-aware generator

Infers PR intent, generates mutants of base, and discards tests that don’t kill their mutant.

Dodgy-diff generator

Treats the diff itself as the mutant with no intent assumptions.

Deterministic assessors

Rejects tests with missing/renamed symbols or ImportError, and filters tests that depend on random, wall-clock time, or environment state.

Intent check

Checks PR-declared intent plus optional --judge abstention.

CI-ready outputs

Sticky PR markdown comments, SARIF, and JSON. Stale sticky comments are deleted when a later push proves clean.

One-line repro

Every finding carries a catchpr repro --base ... --head ... --test-b64 ... line. Supports Mock (default), Groq, or any OpenAI-compatible provider with on-disk caching.

How it works

Diff → generated test → base vs. head → verdict.

  1. Read the diff

    Two diff-aware generators propose pytests for the pull request.

  2. Run on base and head

    Each candidate runs in isolated git worktrees — it must pass 3/3 on base and fail 3/3 on head.

  3. Filter deterministically

    Assessors drop broken, flaky, or environment-dependent tests.

  4. Comment with proof

    Only surviving tests become a sticky PR comment with a one-line repro. Otherwise, silence.

Orchestrator

A reliability layer for multi-agent pipelines.

catchpr.orchestra is an optional Python module in the same repo. It runs typed agent pipelines with schema-checked handoffs and makes every step bounded, escalated, approved, and logged. It is separate from the PR reviewer above.

Confidence routing

  1. Llama 3.1 8B

    Fast tier tries first.

  2. Llama 3.3 70B

    Low-confidence or failed steps move up.

  3. DeepSeek-V3.2

    Strongest enabled tier.

  4. Claude slot

    Off until an Anthropic key is approved; skipped until then.

  5. Human review

    Anything still unsure waits in a review queue, then resumes.

Retries and timeouts

Each attempt retries with backoff under its own timeout. A timed-out attempt cannot make further model calls or trigger a send.

Budget caps

Per-run caps on tokens, dollars, and wall-clock time. Worst-case cost is reserved before each call, so a call that would cross the cap is never sent. Unpriced models are refused.

Signed approval before any send

No email or other side effect runs without an Ed25519-signed token bound to the exact action, target, and payload. Tokens expire and work once; a ledger blocks duplicate sends.

Tamper-evident audit log

Hash-chained log of hashed inputs and outputs, model, tokens, cost, and latency. verify detects edits; replay re-runs a recorded run offline and reports any difference.

CLI and trace view

catchpr-orch runs pipelines, lists and resolves reviews, issues approvals, and renders text or HTML traces.

Tested under failure

144 tests with about 95% coverage, including injected timeouts, budget overruns, forged or reused tokens, and tampered logs. CI runs Python 3.10 to 3.13.

Limits: runs in a single process, and its network guard is a tripwire, not a sandbox.

Honest scope

Scope & benchmark disclosures

  • Python only, and pytest only; the runner puts the worktree on PYTHONPATH and runs a single generated test file without installing new dependencies.
  • The catchbench 80% / 0% numbers above are from MockProvider replaying recorded completions across 40 small Python cases; no live LLM catch rate is claimed until run with catchbench.live.
  • Figures from Meta’s FSE 2026 paper are cited in the repo for context only and are not measurements of catchpr.
FAQ

Questions, answered plainly.

When does catchpr comment?

Only when a generated test passes 3/3 on the base commit, fails 3/3 on the head commit, and survives the deterministic assessors. Otherwise it stays silent.

Is the 80% catch rate from a live model?

No. It is from catchbench mock mode, replaying recorded completions across 40 small Python cases. No live LLM catch rate is claimed yet.

Does it see our secrets?

The untrusted PR job runs with contents:read and zero secrets; a separate workflow_run job posts the comment.

Which languages are supported?

Python and pytest only, today.

What does it cost?

It is MIT open source and free to run via GitHub Actions. A pilot means help wiring the split workflow and evaluating it on your PR history.

Book a pilot

Pilot catchpr on your Python repositories.

MIT open-source and free to run via GitHub Actions. Want help wiring the split workflow and evaluating it on your PR history? Reach out below.

  1. 1Send the form — about 30 seconds — or email if you prefer. Kevin reads every one.
  2. 2Kevin reads it and replies personally.
  3. 3We agree scope in writing before any work starts.

Kevin replies within 1 business day. Prefer email? kfairley9999@gmail.com

Book a pilot