Skip to main content

claimtrail

Every number in a report keeps a trail back to the computation that produced it.

tests

pip install claimtrail

A pipeline computes a number, someone (often an AI assistant now) writes it into a report, and someone else signs off. Somewhere along the way the number gets rounded, copied from an old draft, or the data under it changes. claimtrail records each computation, links report sentences to those records, and checks the numbers still match. It's a SQLite file plus some JSON that you commit with your project.

It already caught one in my own work: the hmda-audit README said 5 of its 14 metrics were measured on the full file, and its own ledger says 6.

The idea owes a lot to Mike's post on agent civilizations: failures come from hand-offs where "the information for a good decision exists, it's just split between them, and nobody puts it together." A number in a report is that kind of hand-off.

Use it

import claimtrail

@claimtrail.tracked(data_files=["csv_path"])
def approval_screen(csv_path):
    ...

approval_screen("data/applications.csv")
(run,) = claimtrail.find(function="approval_screen")
claimtrail.claim("Approval gap", claim_id="q3-gap", computation_id=run.id,
                 expect=["result.approval_gap_pts ~= 5.3 +- 0.05"])

Mark the sentence in your report and audit it:

Group A was approved at 41.4% and group B at 36.1%, a gap of 5.3 points.
<!-- ct:q3-gap -->
$ claimtrail audit-report report.md --strict
  DRIFT=1  UNBACKED=1  MATCH=3

DRIFT     line 14    6196a65747f8  basis=MEASURED  verified=unverified
          Of the 20,000 applications, 6,120 came from group B.
          1 of 2 number(s) supported; not supported: 6,120

UNBACKED  line 17    -
          Branch managers reviewed 312 files by hand this quarter.
          1 number(s) with no claimtrail marker

claimtrail verify ID re-runs a computation and logs who checked it, and it tells you when an input file changed since the run. Results from outside Python go in with register_external and get checked with verify --against. For LaTeX papers there's audit-paper.

Try the full demo on synthetic data: python examples/lending-review/run_demo.py.

Limits

Verifier names come from an env var or git config, so they're attribution, not authentication. The log is hash-chained, which makes edits visible but doesn't stop them. Number matching is pattern-based, so treat a DRIFT as "go look".

Background

claimtrail started as qprov, the provenance tool for my NSERC research on q-deformed numbers. import qprov and old .qprov/ stores still work.

MIT license.

Release files for claimtrail 0.5.1

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

Source distribution (sdist)

Source distribution for claimtrail 0.5.1
File Size Uploaded
claimtrail-0.5.1.tar.gz 237.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claimtrail 0.5.1
File Interpreter ABI Platform
claimtrail-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 323.3 kB

Release files / claimtrail-0.5.1.tar.gz

Download URL claimtrail-0.5.1.tar.gz
Size 237.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a8f8b5d2db50261fd9c0d0d63ccfdc7357078f25bcf787847e91b3386f4c96c7
BLAKE2b-256 checksum
How to use checksums
e2569cc38a95c8b3e3c3c97018dfb6504a39e72dcb6913232feb8ab2e4c14087
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 Sep 27, 2026.

Transparency log

Release files / claimtrail-0.5.1-py3-none-any.whl

Download URL claimtrail-0.5.1-py3-none-any.whl
Size 85.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53a742e61091b0cc1b7d87515d180d81fd29a6268f823814628dfa2ddd7a16e1
BLAKE2b-256 checksum
How to use checksums
2a3d8d7e6a7a03c9189710ecadada629b0e67b5b968ad1892c9f3b00fc14f335
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 Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

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