The Deterministic Pre-Push Gate for Modern Python
Catches what line coverage misses. Evaluates in-memory AST mutations, synthesizes ready-to-run pytest unit tests for surviving mutants, scans for OWASP vulnerabilities and leaked credentials, and blocks dependency hallucinations before you push.
What is DeployProof?
DeployProof is a local pre-push gate that checks whether your code changes are verified by tests, free from security vulnerabilities, and safe to deploy — before a single commit reaches your remote repository or CI pipeline.
--no-check-cve).
__DEPLOYPROOF_MUTANT__ environment switches.pytest unit tests to kill surviving mutants and eliminate test suite gaps.Why 100% Line Coverage is a Dangerous Lie
Line coverage measures what code was executed by your interpreter, not what code was verified by assertions. An automated test can execute 100% of your codebase without asserting a single value, masking critical vulnerabilities.
def test_calculate_discount():
# Only tests the happy path!
# Line coverage tool reports 100% green,
# but misses boundary and operator regressions.
assert calculate_discount(100.0, 0.2) == 80.0# DeployProof mutates operators in warm RAM:
# [1] calculator.py:2 if rate > 0.5: --> if rate > 1.5:
# [2] calculator.py:3 return price * 0.5 --> return price / 0.5
#
# Result: 3 Surviving Mutants (FAILED - 57.1% Score)
# Auto-Heal: deployproof check --heal-testsis_admin(user) without checking that non-admins return False, a line coverage tool gives you a green 100% checkmark. DeployProof flips == to != and alerts you immediately: MUTANT SURVIVED (0% Mutation Score).
🔬 Interactive Gate Explorer
Click any verification gate below to inspect how DeployProof analyzes AST syntax trees, catches security flaws, and synthesizes self-healing tests in real time.
The 7 Verification Gates (Deep Dive)
Gate 1: In-Memory Schemata Mutation Testing
Traditional mutation tools write thousands of files to disk, creating heavy I/O bottlenecks. DeployProof compiles all AST mutants into a unified conditional AST in warm RAM, executing tests in parallel across multi-worker sandboxes with zero file locks.
def is_admin(user: dict) -> bool:
if os.environ.get('__DEPLOYPROOF_MUTANT__') == '42':
return user.get('role') != 'superadmin' # Mutated in warm memory!
return user.get('role') == 'superadmin'Gate 2: Actionable Self-Healing Test Synthesizer
When a mutant survives your test suite, DeployProof analyzes function signatures, AST types, and boundary conditions to synthesize ready-to-run pytest unit tests automatically with --heal-tests.
# Auto-generated by DeployProof to kill surviving mutants
def test_kill_calculate_discount_boundary_rate():
"""Kills mutant: Replace 0.5 with 1.5 on line 2"""
assert calculate_discount(100.0, 0.5) == 50.0
def test_kill_calculate_discount_capped_rate():
"""Kills mutant: Replace binary operator '*' with '/' on line 3"""
assert calculate_discount(100.0, 0.8) == 50.0Gate 3: AST OWASP Top 10 SAST Scanner
Inspects AST nodes for high-severity security vulnerabilities including SQL injection, command execution with shell=True, unsafe deserialization (pickle.loads, yaml.load without SafeLoader), SSRF, and hardcoded JWT secrets.
# 1. SQL Injection via string formatting
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}") # BLOCKED: Formatted SQL execution
# 2. Command Injection via shell=True
subprocess.Popen(f"ping {host}", shell=True) # BLOCKED: shell=True execution
# 3. Insecure Deserialization (Remote Code Execution)
data = pickle.loads(untrusted_payload) # BLOCKED: Unsafe pickle deserializationGate 4: Secrets & 50-Commit Git History Scanner
Combines verified regex patterns for OpenAI, Anthropic, AWS, GitHub, Stripe, and Slack API keys with Shannon entropy analysis ($\text{Entropy} \ge 3.8$) across both the working tree and the past 50 commits (git log -p).
# Verified Pattern Signatures Caught in Diff & Git History:
OPENAI_KEY = "sk-proj-abc1234567890..." # BLOCKED: OpenAI API Key pattern
GITHUB_TOKEN = "ghp_1234567890abcdef..." # BLOCKED: GitHub Personal Access Token
AWS_KEY = "AKIAIOSFODNN7EXAMPLE" # BLOCKED: AWS Access Key ID
HIGH_ENTROPY = "a8f9c2d1e0b345f879102938a1..." # BLOCKED: Shannon Entropy >= 3.8Gate 5: Dependency CVE & Slopsquatting Defense
Cross-references dependencies against the OSV vulnerability database and queries the PyPI JSON API to detect hallucinated LLM package names and packages registered within the last 30 days (slopsquatting / typosquatting).
dependencies = [
"langchain-super-tools", # BLOCKED: Does not exist on PyPI (Hallucinated by LLM)
"fastapi-auth-quick", # WARNING: Registered on PyPI < 30 days ago (Slopsquatting risk)
"urllib3==1.26.4", # BLOCKED: CVE-2021-33503 High severity vulnerability detected
]Gate 6: CWE-61 Symlink Sandbox Escape Gate
Resolves all symbolic links and flags any target that traverses outside the repository root boundary, neutralizing sandbox traversal tricks and confidential data disclosure (GhostApproval).
Gate 7: Control Flow & Swallowed Exceptions Gate
Detects blanket except Exception: pass anti-patterns, dead code after unconditional returns, and mock leakages that mask broken production implementations.
try:
process_payment(order)
except:
pass # BLOCKED: Bare swallowed exception completely silences critical runtime errors!2-Minute Quickstart
Zero configuration required. Install and verify your changes in seconds.
1. Install DeployProof
# Recommended: Isolated global CLI
pipx install deployproof
# Or in active virtual environment
pip install deployproof2. Run Verification on Staged Changes
# Verifies modified files in git diff (significantly faster than full-sweep tools)
deployproof check3. Install Pre-Push Git Hook
# Installs .git/hooks/pre-push to automatically guard git push
deployproof init🔧 Interactive Quick-Fix Mode (-i / --interactive)
DeployProof allows you to inspect surviving mutants and apply self-healing tests directly inside your terminal with a single keystroke:
$ deployproof check -i
[?] Fix 1/2: src/auth.py:14 (Missing Key Fallback Assertion)
Apply to 'tests/test_auth.py'? [Y/n/q/all] (default: Y): y
[+] Appended 'test_kill_verify_roles_line_14' to tests/test_auth.py!
🎉 All self-healing tests applied! Mutation Score: 100.0%sys.stdin.isatty()) and safely skips prompts without hanging builds.
GitHub Actions & CI/CD Recipes
Add .github/workflows/deployproof.yml to automatically annotate pull requests and write rich Markdown step summaries to $GITHUB_STEP_SUMMARY:
name: DeployProof Verification Gate
on: [push, pull_request]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -e . && pip install deployproof pytest
- run: deployproof check --github-actions --workers 4Pre-Commit Framework Integration
Add DeployProof to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/SVSPraveen/deployproof
rev: v1.1.19
hooks:
- id: deployproof-checkConfiguration (pyproject.toml)
DeployProof natively supports standard PEP 518 pyproject.toml configuration under [tool.deployproof]:
[tool.deployproof]
threshold = 85.0
workers = 8
timeout = 15.0
strict_mocks = true
strict_error_handling = true
sast_scanning = true
history_secrets_scanning = true
cve_scanning = true
generate_tests = "tests/test_deployproof_healed.py"| Setting | Type | Default | Description |
|---|---|---|---|
threshold |
float |
80.0 |
Minimum mutation score percentage required to pass verification gate. |
workers |
int |
CPU count |
Number of parallel worker processes for mutation test sandboxes. |
timeout |
float |
10.0 |
Per-mutant test runner timeout in seconds. |
strict_mocks |
bool |
false |
Hard gate blocking newly introduced mock imports in test diffs. |
strict_error_handling |
bool |
false |
Hard gate blocking swallowed exceptions and dead code. |
CLI Reference & Commands
DeployProof provides an extensive command-line interface with fine-grained control over all 7 verification gates:
Core Commands
| Command | Syntax | Description | Default |
|---|---|---|---|
| check | deployproof check [options] |
Runs all 7 deterministic pre-push verification gates on the modified files in the current git working tree session. | Diff-scoped check against HEAD |
| init | deployproof init |
Automatically installs the DeployProof pre-push hook into .git/hooks/pre-push and initializes pyproject.toml configuration. |
Installs executable hook |
| diff | deployproof diff |
Displays detected git diff status, modified source files, and test files currently in scope without running tests. | Current session diff status |
| --version | deployproof --version |
Displays the current installed version of DeployProof. | deployproof 1.1.19 |
| --help | deployproof --help |
Displays full interactive command usage and flag descriptions. | Interactive CLI manual |
Mutation Testing & Self-Healing Options
| Option / Flag | Type | Description | Default |
|---|---|---|---|
-t, --threshold FLOAT |
float |
Minimum mutation score percentage required to pass verification gate (e.g. --threshold 85.0). |
80.0 |
-w, --workers INT |
int |
Number of isolated parallel worker processes for mutation sandboxes (e.g. --workers 12). |
Auto-detected CPU count |
--heal-tests [PATH] |
path |
Synthesizes verified, ready-to-run pytest test cases with boundary inversion heuristics to kill surviving mutants. | tests/test_deployproof_healed.py |
-i, --interactive |
flag |
Interactive terminal prompt with single-keystroke [y/N] confirmation to inspect and append synthesized tests. |
Disabled (auto-detects CI TTY) |
--timeout FLOAT |
float |
Per-mutant test runner timeout in seconds. | 10.0s |
--full-repo |
flag |
Audits all tracked Python files across entire repository root using isolated multi-worker sandboxes. | Diff-scoped |
--files PATHS... |
paths |
Explicitly evaluate specific files or directories, bypassing git diff resolution. | Git diff resolution |
--base REF |
string |
Base git reference (branch, commit hash, or tag) to calculate diff against (e.g. --base origin/main). |
Auto-detected upstream |
--wsl |
flag |
Delegates mutation testing to native Linux environment inside WSL (Windows only). | Native OS execution |
Security & Quality Gates
| Flag | Description | Default |
|---|---|---|
--sast / --no-sast |
Enable or disable the AST-based OWASP Top 10 static security analysis scanner (SQLi, command injection, insecure deserialization, path traversals). | Enabled (true) |
--scan-git-history / --no-scan-git-history |
Scan past git commits using Shannon entropy analysis to catch committed API keys, tokens, and credentials. | Enabled (true) |
--history-depth INT |
Number of past git commits to analyze for credential leaks. | 50 commits |
--check-cve / --no-check-cve |
Query the open OSV database in real time for known CVE advisories affecting dependencies. | Enabled (true) |
--strict-mocks / --no-strict-mocks |
Fail the gate (exit code 1) if modified tests introduce mock imports (unittest.mock, mocker, monkeypatch). |
Disabled (false) |
--strict-error-handling / --no-strict-error-handling |
Fail the gate (exit code 1) if bare except:, swallowed exceptions, or unreachable code are detected. |
Disabled (false) |
Reporting, CI/CD & Configuration
| Flag | Description | Default |
|---|---|---|
-o, --output PATH |
Custom destination file path to save the full verification report. Automatically defaults to .deployproof/report.txt. |
.deployproof/report.txt |
--suggest-tests |
Print auto-synthesized test suggestions inline for surviving mutants in terminal report. | Disabled (concise terminal) |
--json |
Output structured machine-readable JSON containing all findings across all 7 verification gates. | Terminal table output |
--github-actions, --ci |
Emit inline GitHub Actions PR annotations (::error::, ::warning::) and write rich Markdown step summaries to $GITHUB_STEP_SUMMARY. |
Auto-detected in GitHub Actions |
--config PATH |
Explicit path to a pyproject.toml or custom configuration file. |
Auto-discovers pyproject.toml in root |
Windows Subsystem for Linux (WSL) Delegation
On Windows host machines, full-scale mutation testing tools (like mutmut) rely heavily on POSIX process forking. DeployProof provides a high-performance WSL bridge via the --wsl flag:
C:\Users\John Doe\...) into POSIX mount paths (/mnt/c/Users/John\ Doe/...) using safe argument quoting.2. Native POSIX Forking: Executes
mutmut inside a native Linux virtual environment (~/.deployproof-wsl-venv) inside WSL.3. Seamless Console Streaming: Streams live mutation results, killed counts, and failure diagnostics back to your Windows PowerShell or Command Prompt terminal.
One-Time WSL Setup
To configure your Linux WSL environment with mutmut and pytest, run the following command once from Windows PowerShell:
wsl bash -c "python3 -m venv ~/.deployproof-wsl-venv && ~/.deployproof-wsl-venv/bin/pip install mutmut pytest"
Running DeployProof with WSL
# Run DeployProof on Windows delegating mutation execution to WSL
deployproof check --wsl
# Target specific files with WSL delegation
deployproof check --files src/app.py --wsl
Note: If WSL or the Linux venv is not configured, DeployProof automatically detects this and gracefully falls back to the native in-memory AST engine without failing.
Architecture & Benchmarks
Traditional mutation testing tools (like mutmut or Cosmic Ray) rewrite source files to disk for every mutant and run the full test suite each time — a process that gets slower as the codebase grows. DeployProof's in-memory schemata engine compiles all mutants into a single conditional AST in warm RAM, avoiding disk I/O entirely and scaling with the size of your diff rather than your entire repo.
| Engine Feature | Traditional Mutation Tools | 🛡️ DeployProof |
|---|---|---|
| Mutation Execution | Slow disk writes per mutant on NTFS | In-Memory AST Schemata in Warm RAM |
| Test Selection | Runs all tests sequentially | Per-line dynamic test context targeting |
| Worker Sandboxes | Shared file locks / collisions | Isolated PID-keyed sandboxes |
| Test Synthesizer | None (Manual test writing) | Automated Self-Healing Pytest Synthesizer |
| Security Gates | Mutation only (Zero security) | SAST + Secrets + CVEs + Symlink Gate |
Deterministic pre-push gate passed: 100% AST mutation score (all generated mutants caught by test suite), zero leaked secrets, zero OWASP SAST vulnerabilities, clean dependency registry verification.
Frequently Asked Questions
Does DeployProof make any outbound network requests?
DeployProof is 100% local-first and zero-telemetry. No source code or verification results ever leave your machine. The only outbound network requests are read-only HTTP queries to (1) the official PyPI registry to verify package existence and prevent LLM dependency hallucinations, and (2) the open OSV database to detect CVE advisories (which can be disabled via --no-check-cve or offline execution).
How is DeployProof so fast on large projects?
DeployProof defaults to diff-scoped verification, mutating only the lines modified in your active session. For full repository audits, it utilizes in-memory AST schemata compilation and multi-worker parallelism across your CPU cores.
Can DeployProof run in CI/CD pipelines?
Yes! With --github-actions or --ci, DeployProof automatically outputs GitHub PR inline annotations and publishes visual summary dashboard tables to $GITHUB_STEP_SUMMARY.