Skip to main content

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

difftrial-0.1.0.tar.gz (72.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

difftrial-0.1.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

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

Hashes for difftrial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3a9f6979b07207e89d85a423428b50c5040b7ba08be43cacfec4d4510a6c5a4e
MD5 6b6f9fd88cc7d482af314ee1301fb64e
BLAKE2b-256 8120d207116fe4e220b813f07c1e7a0839cdc90b3edb75fc6e1c925e65ee0a55

See more details on using hashes here.

Provenance

The following attestation bundles were made for difftrial-0.1.0.tar.gz:

Publisher: release.yml on ShreeDharshan/difftrial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for difftrial-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca9d549c64b50bde31cad55849ce8d0791d622ce3cdd83901f4c7625ace8a8c5
MD5 550c8ff32e5244f85baf2ec96d48e8f9
BLAKE2b-256 0a9ae8169ce091ad206be700c5452ee03db51bfbfc50741283df0ec3a17940fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for difftrial-0.1.0-py3-none-any.whl:

Publisher: release.yml on ShreeDharshan/difftrial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page