DiffTrial
DiffTrial is a bounded red-to-green regression-transition verifier for Git repositories. It checks one tracked evidence file against a committed base and candidate revision: the base must fail for the expected deterministic reason, the candidate must pass, and selected shared regression tests must not regress.
This is bounded evidence, not proof of complete correctness.
Install
From PyPI:
python -m pip install difftrial
From a source checkout:
python -m pip install .
Example
Suppose the base commit contains:
# app.py
def value():
return 1
# tests/test_regression.py
from app import value
def test_value_is_positive():
assert value() > 0
The candidate commit changes value() to return 2 and adds this tracked
evidence file:
# tests/test_selected.py
from app import value
def test_value():
assert value() == 2
With both revisions committed and the candidate checked out at HEAD, run:
difftrial verify --base HEAD^ --evidence tests/test_selected.py \
--test-id tests/test_selected.py::test_value \
--phase call --outcome failed \
--exception-category AssertionError \
--regression tests/test_regression.py
The same tracked evidence is overlaid onto the base worktree and tested with the same supplied interpreter and environment. A successful run emits a report such as:
# DiffTrial verification report
- Verdict: VERIFIED_TRANSITION
The baseline failure contract is matched exactly by phase and outcome, with optional exception category, assertion signature, and output fragments. An assertion signature is the exact normalised failure message captured from pytest, which can include evaluated values rather than the original source expression.
Exit codes are 0 for a verified transition, 1 for a completed but unverified transition, 2 for usage or input errors, and 3 for expected operational or infrastructure failures.
Boundaries
DiffTrial targets Python 3.11–3.13 on POSIX systems. macOS is locally verified, and Linux is verified through GitHub Actions. Windows is unverified and unsupported for v0.1. Execution is trusted-local-only and is not a sandbox: do not run code the operator does not trust.
The candidate tree must be clean and committed. v0.1 applies exactly one tracked candidate evidence file to the base. Reports may contain absolute paths, repository details, and captured test output. The Python API and experimental JSON schema may change before 1.0.
Report ordinary bugs through GitHub Issues. Follow SECURITY.md for sensitive reports.
Development
python -m pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file difftrial-0.1.0.tar.gz.
File metadata
- Download URL: difftrial-0.1.0.tar.gz
- Upload date:
- Size: 72.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a9f6979b07207e89d85a423428b50c5040b7ba08be43cacfec4d4510a6c5a4e
|
|
| MD5 |
6b6f9fd88cc7d482af314ee1301fb64e
|
|
| BLAKE2b-256 |
8120d207116fe4e220b813f07c1e7a0839cdc90b3edb75fc6e1c925e65ee0a55
|
Provenance
The following attestation bundles were made for difftrial-0.1.0.tar.gz:
Publisher:
release.yml on ShreeDharshan/difftrial
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
difftrial-0.1.0.tar.gz -
Subject digest:
3a9f6979b07207e89d85a423428b50c5040b7ba08be43cacfec4d4510a6c5a4e - Sigstore transparency entry: 2341367529
- Sigstore integration time:
-
Permalink:
ShreeDharshan/difftrial@bc1728af77a3d4ddc568c1fb93ab3919e6851361 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ShreeDharshan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc1728af77a3d4ddc568c1fb93ab3919e6851361 -
Trigger Event:
release
-
Statement type:
File details
Details for the file difftrial-0.1.0-py3-none-any.whl.
File metadata
- Download URL: difftrial-0.1.0-py3-none-any.whl
- Upload date:
- Size: 52.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca9d549c64b50bde31cad55849ce8d0791d622ce3cdd83901f4c7625ace8a8c5
|
|
| MD5 |
550c8ff32e5244f85baf2ec96d48e8f9
|
|
| BLAKE2b-256 |
0a9ae8169ce091ad206be700c5452ee03db51bfbfc50741283df0ec3a17940fb
|
Provenance
The following attestation bundles were made for difftrial-0.1.0-py3-none-any.whl:
Publisher:
release.yml on ShreeDharshan/difftrial
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
difftrial-0.1.0-py3-none-any.whl -
Subject digest:
ca9d549c64b50bde31cad55849ce8d0791d622ce3cdd83901f4c7625ace8a8c5 - Sigstore transparency entry: 2341367539
- Sigstore integration time:
-
Permalink:
ShreeDharshan/difftrial@bc1728af77a3d4ddc568c1fb93ab3919e6851361 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ShreeDharshan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc1728af77a3d4ddc568c1fb93ab3919e6851361 -
Trigger Event:
release
-
Statement type: