Automated verification for Python code — security, performance, correctness, style, and test execution. Independent ground-truth for AI-generated code.
Part of the SIN-Code agent-engineering stack. Install all subsystems together via the SIN-Code Bundle.
- Security — hardcoded secrets, unsafe eval, SQL injection (via bandit)
- Performance — nested loops, large allocations, missing memoization (AST heuristics)
- Correctness — property-based smoke tests, compile check (via hypothesis)
- Style — lint, import order, formatting (via ruff)
- Tests — isolated test execution with timeout (via pytest)
- Diagnostics — run compilers, type-checkers, and linters as independent oracles
- Trace diffing — capture behavior fingerprints before and after edits
- Eval harness — run eval suites with a NO-OP baseline for agent benchmarking
- MCP server — expose verification tools to AI agents via the Model Context Protocol
pip install -e .Optional MCP server support:
pip install -e ".[mcp]"See INSTALL.md for detailed setup instructions.
from sin_code_oracle import VerificationOracle
oracle = VerificationOracle(workspace="/path/to/repo")
# Verify a code snippet
verdict = oracle.verify(code="def foo(): return 42", language="python")
print(verdict.to_json())
# Verify a single file
verdict = oracle.verify_file("src/app.py")
# Verify a directory
verdicts = oracle.verify_directory("src/")# Run diagnostics (compilers, type-checkers, linters)
oracle diagnostics
# Full verification
oracle verify --root . --test pytest
# Trace capture and diff
oracle trace_capture "pytest tests/" --out trace.json
oracle trace_diff "pytest tests/" --before trace.json
# Eval suite
oracle eval suite.json --label baseline
# Run MCP server
oracle servepytest tests/ -vRun the MCP server for agent integration:
# With the CLI
oracle serve
# Or directly
python -m sin_code_oracle.mcp_serverTools exposed:
verify_code(code, language="python")— verify code correctness using formal proofs and property-based testsgenerate_properties(code, language="python")— generate property-based tests for given code
The Oracle is designed to work as part of the SIN-Code ecosystem:
- SIN-Code Bundle — orchestrates all subsystems from a single CLI (
sin) - Intent-Based Diffing (IBD) — trigger re-verification for high-risk changes
- Proof of Correctness (POC) — feed symbolic and property-based proofs into verdicts
- Orchestration — run verification as a gate in CI/agent workflows
MIT — see LICENSE.