Documentation onetrace 0.9.1

Everything you need to record, check and compare your AI pipeline's runs.

Start with a 15-minute walk-through, then add onetrace to your own code. Each guide below is one task.

$ pip install onetrace
1

Start here

New to onetrace? Record a tiny example and compare two runs, in about 15 minutes. The console pins the onetrace release it runs on (console 0.9.1: onetrace 0.9.0): with a newer onetrace, give the console an environment of its own.

2

Add it to your code

Let your coding agent add it, or add two decorators yourself. Guides for your framework.

3

Check and compare

Check that a record holds, and find the first stage where two runs differ.

4

Sign and timestamp

Show who recorded a run with your own key, and when, with an outside timestamp.

5

When something fails

Every error onetrace prints has a one-line fix. Look it up here.

6

Record features

Decisions, the span context, nesting, streaming, storage in a bucket, and the model-call record.

R

Reference

The full manual, the record format, and exactly what onetrace does and doesn't claim.

How onetrace works

onetrace makes a pipeline write a record as it runs: one receipt per stage, and a manifest that chains the receipts together. Anyone can then check the record, and compare two runs, with tools that don't trust your code.

This is onetrace 0.9.1 and onetrace-verify 0.9.1. Start with the quickstart.

What onetrace is

What onetrace is Each stage of your pipeline writes one receipt. The receipts are hash-chained in the run folder by MANIFEST.json, ending in the chain head; artifacts/ holds each stage's outputs. onetrace-verify reads the run folder and prints one row per check, each PASS, FAIL or NOT-RUN, then the result: exit 0 for PASS, 1 for FAIL, 2 for NOT VERIFIED or refused. Anchors and signatures sit beside the chain, never part of it. your pipeline stage 1 stage 2 stage 3 writes run folder receipt 1 receipt 2 receipt 3 MANIFEST.jsonthe receipts in order, ending in the chain head artifacts/: each stage's outputs onetrace-verifyreads the run folder one row per check:PASS · FAIL · NOT-RUN the resultexit 0: PASS · exit 1: FAILexit 2: NOT VERIFIED or refused anchors/timestamp over the chain head signatures/Ed25519 over the chain head optional: beside the chain, never part of it
  • One receipt per stage. Each receipt says what the stage read and what it wrote, by sha256 digest; which tool did the work and how it was configured; and how the stage ended.
  • A manifest chains the receipts in order, ending in a chain head. Change, remove or reorder any receipt and the chain no longer matches.
  • A run folder holds MANIFEST.json, receipts/ and artifacts/: each stage's outputs, which can include documents, prompts and answers. Treat run folders like logs that may contain sensitive data.
  • onetrace-verify reads the run folder and prints one row per check, each PASS, FAIL or NOT-RUN, then the result. Exit code 0 is PASS: the record is consistent and unbroken. Exit code 1 is FAIL, and the [FAIL] rows say which check failed. Exit code 2 is NOT VERIFIED or refused: a receipt's format this verifier doesn't implement, with nothing failed, or a manifest it can't read.
  • Beside the chain, never part of it: an anchor in anchors/, a timestamp proof over the chain head from a party outside the recorder, and a signature in signatures/, an Ed25519 signature over the chain head by a key you hold. Signing changes no byte that was there before.

Install and run

Install and run, in four steps Step 1, install: pip install onetrace. Step 2, decorate: @ot.run and @ot.stage. Step 3, run it: a run folder is written under runs/. Step 4, verify: onetrace-verify with the run folder. 1 · Installpip installonetrace 2 · Decorate@ot.run@ot.stage 3 · Run ita run folderunder runs/ 4 · Verifyonetrace-verify<run folder>
  1. Install: pip install onetrace. onetrace-verify, the reference verifier, comes with it.
  2. Add two decorators: @ot.run on the function that does the whole job once, and @ot.stage on each step. Change nothing else.
  3. Run it: the run writes a folder under runs/, named by its run id.
  4. Verify it: onetrace-verify --require-artifacts runs/<run id>. When a run closes, onetrace prints that command for it.

Comparing two runs

Comparing two runs onetrace diff A B calls the reference verifier on both runs first, then gives every stage one verdict: same, FIRST DIFFERENCE, downstream, reconverged or COULD NOT CHECK, and one overall result with its exit code: identical 0, diverged 1, not comparable 2, refused 3, could not check 4. localize names the first difference and its cause; diff --text shows the text that changed. run A run B onetrace diff A Bcalls the verifier on both first each stage: one verdictsame · FIRST DIFFERENCEdownstream · reconvergedCOULD NOT CHECK one result, its exit codeidentical 0 · diverged 1 · not comparable 2refused 3 · could not check 4 further localize: the first difference, and its cause diff --text: the text that changed in its outputs
  • onetrace diff A B calls the reference verifier first. A run the verifier refuses is refused by the verb too.
  • Then every stage gets exactly one of five verdicts: same, FIRST DIFFERENCE, downstream, reconverged or COULD NOT CHECK. A verdict is always about a stage's output.
  • onetrace localize finds the first unclean stage in one run, or the first difference between two runs, and its cause.
  • onetrace diff A B --text shows the first stage that differs and the text that changed in its outputs, checked against the receipts first.
The overall result of diff, and its exit code
ResultExit code
identical0
diverged1
not comparable2
refused3
could not check4

What each verdict and result means.

What it does not show

  • onetrace does not check whether a pipeline's output is true. It checks what was recorded, and whether an independent verifier can confirm that record is internally consistent and its chain unbroken.
  • same does not mean "nothing changed". It means a stage's output digest matched.
  • A signature does not show that the key wasn't stolen or misused, or who the person behind the key is.

Everything onetrace does not claim.

Where next