attestation-schema
The core run record that experiment producers write and
attestation reads:
attestation.run/1, frozen 2026-11-19: a record valid today stays valid,
and any change -- an additive optional field included -- is a new version
(attestation.run/2) that readers dispatch on. Standard library only.
from attestation_schema import (
RunRecord, Producer, CodeIdentity, Metric, HistoryWriter, write, read, read_history,
)
run_dir = "runs/run-3f2a9c01b7de"
with HistoryWriter(run_dir) as hist: # streams attestation/history.jsonl
loss = hist.series("loss", split="eval")
for step, value in [(0, 0.9), (500, 0.4), (1000, 0.25)]:
hist.point(loss, step, value) # at=format_timestamp(...) if known
record = RunRecord(
run_id="run-3f2a9c01b7de", family="lr-sweep", arm="lr=1e-3", status="complete",
started_at="2026-11-19T10:00:00Z", finished_at="2026-11-19T10:42:13Z",
producer=Producer(name="train.py", version=None),
code=CodeIdentity(git_sha=None, dirty=None, repo=None, version=None,
provenance="unknown", evidence=None),
config={"lr": 0.001}, data=[],
metrics=[Metric(name="loss", value=0.25, direction="min", step=1000, split="eval",
unit=None, labels={})],
history=hist.ref, # {path, sha256, series, points}; None = no curve recorded
seeds={"python": 0},
dependencies=None, # None = could not observe the environment; [] = observed, none
ext={},
)
write(record, run_dir) # -> runs/run-3f2a9c01b7de/attestation/run.json
assert read(run_dir) == record # never opens history.jsonl
curves = read_history(run_dir) # verifies the sha256, then parses
dumps/writeare the only sanctioned writers: validate, then RFC 8785 canonical JSON, so the same record is always the same bytes.loads/readrefuse anything non-conforming with aRecordErrornaming the path (metrics[2].direction); nothing is coerced or defaulted. They dispatch onschema, so later versions can still read older records.- Curves never go in
run.json.metricsholds final values; logged curves go to the sidecarattestation/history.jsonl(attestation.history/1: JSON Lines, one canonical line per series declaration or point, streamable and deterministic), written withHistoryWriter(incrementally, finalized atomically on close) orwrite_history(run_dir, series), and bound to the record by sha256.read_historyraisesHistoryMissingError,HistoryDigestErrororHistoryFormatError(allRecordError). Write order: outputs and history ->layout.write_manifest->write. ext.<namespace>carries producer data the core does not model, untouched.attestation_schema.layoutfixes the run directory (attestation/run.json,attestation/state.json,attestation/digests.json,attestation/history.jsonl,steps/NN-<name>/,logs/);attestation_schema.jobsis the job-backendProtocol, andattestation_schema.stateis what every backend shares:state.json(attestation.state/1:read_state,init_state,transition), its cross-process lock (state_lock, POSIXflock; refused on Windows), andsettle-- end a job exactly once, an existing record deciding, writingterminal_recordfor a job that died without one. A job's record carries itsJobSpec'srun_id,family,arm,configandextverbatim.attestation_schema/schemas/run-1.schema.json(the record),history-1.schema.json(one sidecar line) andstate-1.schema.json(state.json) are JSON Schemas for other languages: necessary, not sufficient — the Python reader is the reference. They are frozen and pinned by digest.- Package version 0.1.0: the formats are frozen; the Python API may still change in a 0.x minor release until the job-state API has a consumer.
Releasing
Tag schema-v<version> (the version in this package's pyproject.toml, which
the workflow checks), independent of attestation's v<version> tags:
git tag schema-v0.1.0 && git push origin schema-v0.1.0
.github/workflows/release.yml builds the sdist and wheel, runs this
package's tests on CPython 3.11 against the wheel, and publishes to PyPI
through trusted publishing (environment pypi, no token). Release it before
an attestation release whose attestation-schema>=X floor is new.
Design: docs/superpowers/specs/2026-11-19-core-run-record-design.md in the
attestation repository.
Metadata
Release files for attestation-schema 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| attestation_schema-0.1.0.tar.gz | 49.6 kB | With provenance | Details for attestation_schema-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| attestation_schema-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for attestation_schema-0.1.0-py3-none-any.whl |
Total release size: 87.5 kB
Release files / attestation_schema-0.1.0.tar.gz
| Download URL | attestation_schema-0.1.0.tar.gz |
|---|---|
| Size | 49.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cb5818285ca9e956e87ba84104531908abe4847f3d8f4d26836d596e70436cd
|
|
BLAKE2b-256 checksum How to use checksums |
7537ce2a4ea2e62731b28c8dfb8ce066d189e5cf31f74b4da0386e8578775232
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 19, 2026.
Transparency logRelease files / attestation_schema-0.1.0-py3-none-any.whl
| Download URL | attestation_schema-0.1.0-py3-none-any.whl |
|---|---|
| Size | 37.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e83a09c00b418fc065beee22efdde5a0e05c43c7e5379d81123ff5059f92de1
|
|
BLAKE2b-256 checksum How to use checksums |
05a83620191cc23e1d024524cab8f3b17d5a3324d2eb50a280080a6723bdfea2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 19, 2026.
Transparency logSecurity for attestation-schema 0.1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for attestation_schema-0.1.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 Nov 19, 2026.
Transparency logA 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.