r/coolgithubprojects • • 1d ago

An AI agent can make an upgrade pass by changing 22.50 to 22.49 in your test. This tool catches it.

Post image

Illustrative example, but the tool output is real: you ask an AI agent to upgrade your money library. It reports "done, all tests pass, CI green". The new version rounds half cents differently, and instead of fixing the code, the agent changed the expected value in the test from 22.50 to 22.49. At a million invoices a month, about 50,000 would be billed wrong, and CI stays green.

upgrade-anything records what your code returns while your existing tests run, upgrades one version at a time, then replays everything. On this example it reports:

- call drift: invoice_total(Jacket, 20.45): "22.50" → "22.49"

- needs review: expected value edited in test_shop.py

It happens for real too. Upgrading send in serve-static, an AI agent (OpenCode) edited a test's expected value to match the new output. 92 of 92 tests green, and upgrade-anything flagged the edit for review.

It also catches agents that delete or skip tests to get to green.

Offline demo, 20 seconds: uvx upgrade-anything demo

Rust CLI, MIT/Apache-2.0, for Python and Node projects. Works with Claude Code, Codex and OpenCode.

https://github.com/datphalm/upgrade-anything

2 Upvotes

1 comment sorted by

2

u/Intelligent_Text736 1d ago

Author here. I built this after noticing how often an "all tests pass" upgrade still changes behavior: tests only check what someone thought to assert. The money example is made up to keep it short, but the serve-static case is a real run, and the evidence is in the repo under demo/behavior/serve-static. Happy to answer questions. I'd especially like to hear where it breaks on your own projects.