Expand description
Annotation sidecar for testbench tapes.
An annotation file (<tape>.annotations.jsonl) is the durable form of
human judgment over a recorded run. Each annotation references a tape
event by its immutable TapeRecord::seq number and carries a
structured kind + evidence + author so downstream pipelines (eval
rubrics, friction roll-ups, crystallization candidate detection,
replay-for-teaching) can read the same artifact.
§File layout
run.tape # the unified event tape
run.tape.annotations.jsonl # annotations sidecar (this format)Like the tape itself, the annotations file is line-delimited JSON. The
first line is a header; every subsequent line is one annotation. Empty
lines and lines starting with # are tolerated so external tools can
emit comments without breaking interop.
§Schema
-
Header (one line, always first):
{ "type": "header", "schema_version": 1, "tape_path": "run.tape", "tape_content_hash": "<blake3>", "harn_version": "0.8.6" } -
Annotation (zero or more, after the header):
{ "type": "annotation", "id": "ann_001", "event_id": 42, "kind": "hypothesis", "evidence": "checkout incident — see runbook", "author": {"id": "alice", "kind": "human", "surface": "burin-code"}, "timestamp": "2026-05-10T17:00:00Z", "hypothesis_status": "active" }
Optional fields default to their None / empty form so older readers
roll forward when newer fields appear. Unknown AnnotationKind
values surface as AnnotationKind::Unknown so a validator can
still report on the rest.
Structs§
- Annotation
- One annotation record on a tape event. Every field except
event_idandkindis optional so authoring tools can emit minimal records. - Annotation
Author - Provenance for an annotation. Surfaces the difference between a human who clicked through Burin Code and an agent that auto-flagged a turn during a self-eval.
- Annotation
Header - Header record at the top of every annotations file. Captures the schema version and a back-reference to the tape so a validator can detect mismatched bundles.
- Annotation
Link - Annotation
Span - Span over a contiguous range of events.
start_event_idmust equal the wrapping annotation’sevent_id;end_event_idmust be greater than or equal to the start. The validator enforces both invariants. - Annotation
Tape - Fully-loaded annotation tape — header plus every record. Built by
AnnotationTape::loadand consumed by the validator, the replay surface, and the export pipeline. - Annotation
Validation Report - Result of validating annotations against a tape.
- Crystallize
Anchor - One event the human-judgment loop has flagged as worth crystallizing.
The candidate detector consumes a
Vec<CrystallizeAnchor>alongside inferred candidates so the two paths converge into one ranked list.
Enums§
- Annotation
Kind - Closed taxonomy of annotation kinds. New kinds must be added here so
the validator can reason about them; older readers receive
AnnotationKind::Unknownfor kinds they don’t recognize. - Annotation
Problem - Validation problem detected by
validate_against_tape. Each variant carries enough context for a CLI report or a CI annotation comment. - Author
Kind - Hypothesis
Status - Lifecycle of a hypothesis-kind annotation. Mirrors the human-hypothesis loop in harn-cloud#54 / burin-code#277.
Constants§
- ANNOTATIONS_
SIDECAR_ SUFFIX - Conventional sidecar suffix appended to a tape path.
run.tapepairs withrun.tape.annotations.jsonl. - ANNOTATION_
SCHEMA_ VERSION - Format version of the annotations sidecar. Bump on any breaking change. Loaders refuse files with a higher version.
Functions§
- annotation_
to_ friction_ event - Adapt a friction-kind annotation into a
FrictionEvent. ReturnsNonewhen the annotation is not a friction record or is missing the requiredfriction_kind. - annotations_
for_ record - Convenience: pair a tape record with all annotations that reference its seq. Used by the replay surface and the export pipeline.
- compute_
tape_ content_ hash - BLAKE3 hex digest of a tape’s logical content. Implemented by hashing the deterministically-serialized record stream so the digest is stable across runs that produce the same tape — and changes when any record content does.
- validate_
against_ tape - Validate an annotations file against its target tape. Returns a structured report so the CLI can emit either pretty-printed problems or a machine-readable JSON payload.