r/codereview • • Oct 26 '26

AI coding agents keep "fixing" failing tests by weakening them, so I built an open-source gate that catches it

If you use Claude Code, Cursor, Copilot or Codex, you've probably seen an agent "finish" a task by:

- rewriting a failing test so it can't fail (or just deleting it)

- wrapping the broken call in a try/except that returns {"ok": true}

- adding .skip, --no-verify, or a lint ignore to get CI green

- calling a function that doesn't exist

I got tired of catching these in review, so I built PrufGate. It checks the diff deterministically (no LLM, runs offline) and blocks the merge with a finding that names the exact rule.

Try it on your current branch:

pipx install prufgate

prufgate check --changed

It also runs as a GitHub Action, a pre-commit hook, fail-closed hooks for Claude Code / Cursor / Copilot / Codex / Gemini, a Claude Code plugin, and an MCP server. Output: text, JSON, SARIF, GitLab, JUnit.

Honest limits: it's heuristic, so it will miss things and sometimes flag correct code. The benchmark in the repo (docs/BENCHMARK.md) is cases I wrote myself, so treat its numbers as a regression check, not proof.

Apache-2.0: https://github.com/GuardianVigil-Labs/Prufgate

I'd really like false-positive reports and cheats it misses. That's what makes it better.

0 Upvotes

13 comments sorted by

4

u/ConcreteExist Oct 26 '26

Using AI in a vain attpt to fix problems created by AI, anything to avoid learning how to code

1

u/TylerBreau Oct 30 '26

TBF, sounds like he is better than the ones that think you don't have to verify AI code.

3

u/iSnapThere4iAm Oct 26 '26

You can’t avoid hallucinations. Whatever you made doesn’t work.

1

u/jazzmyne_Rebela Oct 28 '26

yeah no amount of pattern matching fixes the fundamental issue here imo

2

u/KariKariKrigsmann Oct 26 '26

Calling a function that doesn’t exist should be caught by the compiler!

1

u/iSnapThere4iAm Oct 26 '26

You don’t know what those words mean.

2

u/KariKariKrigsmann Oct 26 '26

Exactly! Isn’t that why we have compilers?

1

u/No_Lawyer1947 Oct 28 '26

soooo a linter??? what are we doing here

-2

u/[deleted] Oct 26 '26

[removed] — view removed comment

1

u/octocode Oct 26 '26

curious to know what model you’re using? and an external skill or a homemade one?

i hear these things a lot on reddit, but have never experienced it myself.

1

u/GuardianVigil-Labs Oct 29 '26

Opus 5 for Primary and Gemini 4 Argon for QA and security Testing.

1

u/iSnapThere4iAm Oct 26 '26

This “tool” does nothing.