Skip to main content

PatchProof

A passing test is useful. A test that fails before the fix is evidence.

PatchProof checks whether the same supplied regression test fails for an expected reason on a base Git commit and passes after a patch. It creates disposable snapshots and saves JSON, HTML, original JUnit reports, and execution evidence.

The distribution name is patchproof-ai. The Python import and command are both patchproof. Python 3.10+, Git, and Linux or macOS are required for verification. No model account is needed.

Install

python -m pip install 'patchproof-ai[runner]'
patchproof --help

The runner extra installs pytest. The base package has no runtime dependencies. Target-project dependencies must already exist in your reviewed environment or container image; PatchProof does not install them automatically.

Verify reviewed code

patchproof run \
  --repo /path/to/reviewed-project --base HEAD \
  --patch /path/to/fix.diff --test /path/to/test_regression.py \
  --expect 'BUG_ADD' --repeat 3 \
  --output /tmp/patchproof-run-001 --trusted-local

Use a fresh output directory outside the source repository. The regression test must contain a meaningful assertion whose failure message includes BUG_ADD. An unrelated failure does not count as reproduction. Existing test suites and per-case expectations can also be compared.

Trusted-local execution is not a sandbox. It runs reviewed Python code as your current user. For an explicitly prepared local Docker image, select --docker-image IMAGE instead. Docker restrictions reduce exposure but are not a hostile-code VM boundary. Read the execution guide before running unfamiliar code.

Python SDK

from pathlib import Path
from patchproof import VerificationRequest, verify_patch
from patchproof.runners import TrustedLocalRunner

# Only for repository and test code you own and have reviewed.
result = verify_patch(
    VerificationRequest(
        repo=Path('/path/to/reviewed-project'),
        base='HEAD',
        patch=Path('/path/to/fix.diff'),
        test=Path('/path/to/test_regression.py'),
        expected_failure='BUG_ADD',
        output=Path('/tmp/patchproof-sdk-001'),
    ),
    runner=TrustedLocalRunner(trust_confirmed=True),
)
print(result['verdict'], result['reason'])

Interpret the evidence

Exit Verdicts Meaning
0 supported Expected fail-before/pass-after evidence observed
1 not_reproduced, fix_failed, regression_detected Checks do not support accepting the change
2 inconclusive, flaky, inconsistent Evidence is incomplete or unstable

Input and runner errors also exit 2. Setup/collection errors, missing reports, skips, timeouts, and unexpected base failures never count as successful reproduction. Repeated runs preserve every attempt.

Actual report from the included controlled fixture

Scope and optional proposals

PatchProof supplies regression evidence, not a proof of complete correctness. Snapshot preparation leaves the source checkout intact, but trusted-local test code can access host resources. Windows process cleanup, binary/rename/copy patches, symlink/submodule snapshots, and arbitrary project fixtures in the injected regression test are not supported.

Optional Claude test proposals require explicit remote opt-in. Selected files are sent to the configured provider; schema/syntax-checked outputs remain untrusted .proposed files. They are never executed automatically. Verification still requires human review and an explicit execution adapter.

Documentation and source

Original project code is MIT licensed. Third-party dependencies retain their own licenses.

Metadata

Release files for patchproof-ai 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patchproof-ai 0.2.0
File Size Uploaded
patchproof_ai-0.2.0.tar.gz 101.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for patchproof-ai 0.2.0
File Interpreter ABI Platform
patchproof_ai-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 123.1 kB

Release files / patchproof_ai-0.2.0.tar.gz

Download URL patchproof_ai-0.2.0.tar.gz
Size 101.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c8845665e90b067406aec9ad3bef7b12e1738a8829f4ea1e9334224c2a5e5f3
BLAKE2b-256 checksum
How to use checksums
7225fc067fed1a0105d234cd6010e169f4f29a52044a6e4d6dbf759e7a30fab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / patchproof_ai-0.2.0-py3-none-any.whl

Download URL patchproof_ai-0.2.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf20c35d80136123a246e4b109bd9ae196fa0c4e0d5c7db9afd2193e2fc7ec3a
BLAKE2b-256 checksum
How to use checksums
02ed169dfe96ac1dafc82082b97a47bd0959d36201065769667ae75211921748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page