Invar provides mechanical verification for AI-generated code. Pre-commit hooks catch violations before they reach your repository.
Three layers of mechanical verification
Static analysis checks architecture rules, contract presence, file sizes, and purity. Catches issues before they become bugs.
@pre/@post decorators document and enforce function behavior. Invalid inputs fail fast with clear messages.
Automatic enforcement on every commit. Violations block the commit. No exceptions, no "I forgot to run tests."
Separate what CAN fail from what SHOULD NOT fail
pip install python-invar
invar init
invar guard