Errata¶
chronicle.errata attaches a correction or addendum to an experiment, a variation, or an asset after the fact — typically an agent that spots an error in a prior report and writes the fix against it.
An erratum is a first-class errata_report asset bound to exactly one target. The target can itself be another erratum (point asset_id at one), so errata-on-errata falls out for free.
Targets¶
A target is exclusive: pass the experiment (optionally narrowed to a variation) or the asset, never both. Mixing asset_id with experiment_id/variation raises ValueError.
| Target | Pass |
|---|---|
| Experiment | experiment_id |
| Variation | experiment_id + variation |
| Asset (incl. another erratum) | asset_id |
Both create and delete require Write on the target.
Two kinds of content¶
The body arrives one of two ways, picked by argument — exactly one is required. Passing pdf= alongside markdown=/latex= raises ValueError.
| Kind | Pass | What happens |
|---|---|---|
| authored | markdown= or latex= |
The body is stored as the correction source and compiled to PDF server-side when a compiler is configured. |
| imported | pdf= (str, Path, or bytes) |
The SDK presigns, PUTs, and finalizes; the server extracts report.md from the PDF. |
Authoring an erratum¶
erratum = chronicle.errata.create(
asset_id="ast_9Fk", # correcting a prior report asset
markdown="## Correction\n\nFigure 3 used Re=500, not Re=1000.",
name="re-number fix",
)
print(erratum["asset"]["id"]) # the new errata_report asset
create returns the hydrated erratum: {asset, target, created_by, created_at}. Swap in latex= for a LaTeX body. name is optional.
Importing a PDF¶
chronicle.errata.create(
experiment_id="exp_7Qk",
variation=2,
pdf="./corrections/variation-2-addendum.pdf",
)
The presign → PUT → finalize round-trip runs inside the one call, so the returned erratum is already attached and finalized.
Listing¶
list returns the errata correcting one object, in chronological order. Scope it the same way you target a create — asset_id, experiment_id, or experiment_id + variation:
Detaching¶
delete detaches an erratum from its target, keyed by the erratum's own asset id:
See methodic.errata.ErrataAPI for the full signatures, and the reports guide for compiling the documents an erratum corrects.