Modern codebases contain important safety rules that nobody explicitly writes down. They are scattered across tests, guards, exceptions, and state transitions. Traditional regression testing can miss these rules because the existing test suite may still pass even when a new feature creates a previously impossible behavior. NeverGraph is a Negative Specification Compiler. It uses IBM Bob to recover latent “must-never-happen” invariants directly from repository evidence, compiles them into machine-evaluable forbidden conditions, and explores a context-aware behavioral state graph to determine whether those forbidden states are reachable. In our demo repository, Bob recovered five negative invariants without us manually supplying the rules. One of them is: “A refunded order must never be shipped.” In the safe baseline, the rule is unreachable. We then introduce a Support Restore feature: ordinary tests still pass, but NeverGraph detects a new path where a refunded order is restored to PAID while retaining its refunded history. Using bounded BFS, NeverGraph finds the minimum counterexample: pay → refund → cancel → restore → ship. NeverGraph then converts that witness into an executable Vitest regression test. On the changed implementation, the test fails and reproduces the forbidden behavior. After a minimal repair, the exact same generated test passes and the forbidden state becomes unreachable again. NeverGraph is designed for software engineers and teams working on stateful systems where hidden business rules accumulate over time. Its key distinction is that the rule is recovered before the bug exists. Instead of only preserving observed behavior or reacting after an incident, NeverGraph discovers latent negative specifications from code, compiles them into behavioral states, and proves the shortest violating path when a future change makes one possible. Discover. Compile. Prove.
Category tags: