{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "2akouwu-reverify--gate-ai-rewrite-with-equivalence-tests",
 "repo": "2akouwu/reverify",
 "repo_url": "https://github.com/2akouwu/reverify",
 "repo_slug": "2akouwu-reverify",
 "title": "Test an AI's code rewrite against the original before merging",
 "page_title": "How to test an AI's code rewrite against the original before merging with Reverify",
 "summary": "Run a candidate and a reference implementation on shared inputs and catch any disagreement.",
 "who": "A developer who asked an AI agent to refactor or rewrite a Python or C function and wants proof it still behaves the same.",
 "problem": "An AI refactor can look correct while changing behavior on edge cases, and reading the diff does not prove equivalence.",
 "outcome": "A refuted result comes back with the input and both outputs, so the developer can see exactly where the rewrite differs.",
 "steps": [
  "Run `pip install reverify` to install the tool.",
  "Prepare the reference implementation and the AI's candidate implementation as separate files or functions that Reverify equiv can load. (inferred, check the README)",
  "Run `reverify equiv --lang python` and supply the candidate and reference paths as the README's equiv usage requires. (inferred, check the README)",
  "Read the result: a refutation shows the input and both outputs that disagree.",
  "Fix the candidate and rerun until the check passes before merging."
 ],
 "agent_prompt": "Using the reverify repo at 2akouwu/reverify, run its equiv check with --lang python to compare the AI-rewritten <function file> against the original reference over shared inputs. Report the result and, if refuted, the input and both outputs, and do not accept the rewrite unless the check agrees.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README gives the equiv command name and language flag but not the exact argument format, so the input setup steps here are inferred and need checking against the tool's own help.",
 "category": "Security and science",
 "tags": [
  "Security and science"
 ],
 "lang": "python",
 "requirements": [
  "Python installed",
  "Install with pip install reverify",
  "A binary or source file you are authorized to analyze"
 ],
 "risk": "dual-use",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/2akouwu-reverify/gate-ai-rewrite-with-equivalence-tests/",
 "md": "https://dedupedai.com/use-cases/2akouwu-reverify/gate-ai-rewrite-with-equivalence-tests/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/2akouwu-reverify--gate-ai-rewrite-with-equivalence-tests.json",
 "api_version": "v1"
}
