Skip to main content

RunProof

RunProof is a Python library for recording, validating, replaying, and comparing real computational runs. It turns a Python execution into an inspectable artifact containing inputs, outputs, code references, environment metadata, checks, and an execution trace.

The distinctive feature is Explainable Diff: when two runs differ, RunProof compares input fingerprints, schemas, output summaries, step status, code fingerprints, and environment metadata, then reports evidence-backed causes instead of only saying that the runs are different.

What it is

RunProof is a local-first execution record and reproducibility layer for Python workflows. It is useful for data analysis, reports, ML experiments, research software, API workflows, and any process where the result must be explained later.

RunProof is not a reverse-engineering tool, a code generator, a replacement for Git, or a guarantee that a scientific conclusion is correct. It records and validates the execution that was declared to it.

Quick start

from runproof_engine import verified


def clean_rows(rows):
    return [row for row in rows if row["amount"] >= 0]


def total(rows):
    return sum(row["amount"] for row in rows)

with verified("sales_total", root="runs") as run:
    rows = run.input("sales.json", name="sales")
    cleaned = run.step("clean_rows", clean_rows, rows)
    result = run.step("total", total, cleaned)
    run.assert_true(result >= 0, "total must be non-negative")
    run.output("total.json", {"total": result})

print(run.result.status)
print(run.result.artifact_dir)

This creates a run directory with a manifest, input metadata, output metadata, trace events, checks, and an environment snapshot. The input is not silently replaced by generated data. File contents are fingerprinted, while copying full inputs is explicit and configurable.

Automatic capture

For whole-process observation, use auto_run. It installs a Python execution observer for the lifetime of the context. On Python 3.12 and newer it uses sys.monitoring when available; otherwise it falls back to sys.settrace. The observer records bounded call, return, and exception events without requiring every function to be wrapped manually.

from pathlib import Path
from runproof_engine import auto_run

with auto_run(
    "automatic-report",
    root="runs",
    include_paths=[Path("src")],
) as run:
    report = build_report(real_input)
    run.observe(report, name="report")
    run.output("report.json", report)

Automatic capture is an evidence layer, not a sandbox. It does not serialize every local variable, intercept every native extension, or make external services deterministic. Use adapters or explicit run.input, run.step, and run.external_call calls when a boundary needs stronger evidence.

Optional real-library adapters

When an optional dependency is installed, auto_run discovers and activates its adapter by default. The current adapters observe real operations through documented hooks or narrowly scoped wrappers:

Integration Captured evidence Boundary behavior
pandas DataFrame reads/writes, summaries, file hashes Local file outputs can be archived; in-memory and native execution remain bounded
Polars DataFrame reads/writes, summaries, file hashes Requires the optional polars package
requests Prepared URL, redacted headers, status code Response bodies are not consumed automatically; live network remains a boundary
HTTPX Sync and async request/response hooks Streaming bodies are not consumed automatically; live network remains a boundary
SQLite SQL statements and database path Database transaction state is a boundary; mutable files can become non_reproducible
SQLAlchemy and psycopg Cursor statements and database dialect Requires the optional database package and a live database policy
subprocess Command summary, return code, stdout/stderr digests Process environment and side effects remain a boundary
Boto3 Service operation, redacted parameters, response summary Cloud object/service state remains a boundary
Jupyter/nbclient Notebook execution lifecycle Kernel state and external effects remain a boundary
Torch and joblib Model save/load file evidence Device/native runtime state may remain a boundary

The optional adapters never execute installation commands and never send captured data to RunProof services. They can be disabled or replaced by passing an explicit adapters= collection to auto_run.

Provenance, environment, and distributed tracing

Every completed run now contains provenance.json, a graph connecting the run to inputs, steps, values, outputs, checks, observations, and evidence boundaries. It is available through load_run(path).provenance and is designed to make later diffs explainable without pretending to prove causality.

The artifact also contains environment/environment.lock.json. It records the interpreter, platform, and installed package versions and can be compared with compare_environment_lock(...). reconstruction_plan(...) returns reviewable pip commands but deliberately marks them as requiring approval; RunProof never installs packages silently. Package locks do not reproduce operating-system state, hardware, external services, or changing data.

For service-to-service workflows, use run.span(...) and propagate run.traceparent(). Spans are stored in execution/spans.json using a dependency-free W3C traceparent-compatible format. OpenTelemetry exporters can be added as adapters without making OpenTelemetry a runtime dependency.

Replay and comparison

from runproof_engine import load_run

previous = load_run("runs/sales_total/20260823-101500-abc123")
replayed = previous.replay(mode="strict")
print(replayed.status)

comparison = previous.diff(replayed)
print(comparison.to_dict())
print(comparison.render())

Without a runner, replay() verifies the captured artifact and reports replay_ready; it does not silently re-execute arbitrary Python. To perform a real replay, provide a user-controlled runner that invokes the original workflow and returns the new artifact. The resulting run can then be compared with the previous run to identify evidence-backed changes.

Statuses

  • verified: execution completed and all declared checks passed with no recorded evidence boundary.
  • verified_with_boundaries: execution completed and the artifact is intact, but one or more external or non-deterministic effects remain outside the captured evidence.
  • verified_with_warnings: execution completed but comparability or external-source evidence is limited.
  • failed: execution or a required check failed.
  • blocked: a declared policy prevented a sensitive action.
  • non_reproducible: replay was attempted but did not match the captured run.

Privacy and real data

RunProof records metadata and hashes by default. Full input copying is opt-in. Secrets are redacted from environment snapshots and trace values. External adapters must provide privacy-safe request metadata instead of storing credentials or raw authorization headers.

Project status

The current repository implements the local core, automatic observation, provenance graph, environment lock, distributed trace context, and optional real-library integrations. It remains useful without a cloud account or a specific AI provider. Automatic observation still has explicit coverage boundaries; it is not a universal sandbox or a guarantee of perfect replay for arbitrary Python.

License

Apache-2.0. See LICENSE.

Metadata

Release files for runproof-engine 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 runproof-engine 0.2.0
File Size Uploaded Provenance Actions
runproof_engine-0.2.0.tar.gz 45.2 kB With provenance Details for runproof_engine-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for runproof-engine 0.2.0
File Interpreter ABI Platform Actions
runproof_engine-0.2.0-py3-none-any.whl Python 3 none any Details for runproof_engine-0.2.0-py3-none-any.whl

Total release size: 86.9 kB

Release files / runproof_engine-0.2.0.tar.gz

Download URL runproof_engine-0.2.0.tar.gz
Size 45.2 kB
Tags Source
SHA-256 checksum
How to use checksums
84240ef693cef36bfcf29a70ad4459ccaafa51a35f430bdad943107826a70c8f
BLAKE2b-256 checksum
How to use checksums
95f27821ad319ac2f00de1c0930c5350706bbc8583442eca30aa430439364c92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

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

Download URL runproof_engine-0.2.0-py3-none-any.whl
Size 41.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
674fd1876ed4efc8f6f535ad316a8888547a4786e13111a6947333a5972e8545
BLAKE2b-256 checksum
How to use checksums
446ef003d5292dee8b42dcd55edffe82c1f3d3e1890222305a917589461c0dac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Security for runproof-engine 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for runproof_engine-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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