Companion draft, separately versioned. Version: draft 0.1, for ASR format version 0.1 and ATIF v1.8. Not part of core conformance.ATIF (Agent Trajectory Interchange Format) is a JSON format that stores a whole agent trajectory in a single document, used for evaluation, supervised fine-tuning and reinforcement learning. ASR is the primary record; ATIF is an export target. This companion defines the export so that two exporters produce the same trajectories from the same stream.
Export
One document per path
ATIF steps are linear. An exporter writes one ATIF document per head (see Structure): the steps follow the head’s active path. By default it exports only the primary head; other heads are exported on request, each as a separate document. The active path is used, not the context view: ATIF keeps records that a compaction replaced, “for auditability”, and marks the compaction with a context-management step.Document fields
Steps
Steps are numbered from 1 in path order.
When the parts of one message carry their own
author or origin (see Messages), the exporter applies the table to each part’s effective values, and writes consecutive parts with the same source as one step.
Messages with status: "withdrawn" are not exported. Tool calls that a program made (requestedBy: "code") are not tool calls of an agent step; the exporter lists them in the extra of the step that holds the enclosing call.
Field details:
tool_calls[]:tool_call_id=callId,function_name=name,arguments=input(an object), or{"_text": inputText}when the input is text.observation.results[]:source_call_id=callId;contentfrom the result’scontenttext, or itsdisplayContentwhencontentis absent (noted inextra).timestamp= the first entry’sts, omitted when absent.metrics:prompt_tokensis all input tokens including cache (ATIF counts cache inside prompt tokens):input.totalwhenincludesCacheistrue;uncached + cacheRead + cacheWritewhen all three are known; otherwise omitted.completion_tokens=output.total;cached_tokens=cacheRead;cost_usd=cost.amountwhencurrencyisUSD.cacheWriteandoutput.reasoninggo inmetrics.extra.is_copied_context: trueon every step built from copied records (see Lineage). Steps of unknown originality are marked inextraand SHOULD be excluded from training sets.extra["org.agent-session"]on each step: the record IDs it came from.
opaque parts and signatures are never exported. data parts are exported as JSON in the step’s extra. Records with audience: "user" are exported as system steps flagged in extra, or omitted on request.
Metrics
final_metrics comes from the stream’s effective session-scope usage_summary when one exists with known coverage. Otherwise, it comes from the sum of the exported steps’ metrics. The two sources are never combined (ASR-321). Copied records are not counted (ASR-417).
Subagents
When asubagent record announces a child session and the child’s stream is available, the exporter embeds it as a trajectory in subagent_trajectories with its own trajectory_id, and references it from the delegating tool call’s observation result through subagent_trajectory_ref. A child whose stream is not available is referenced by session_id only.
Losses
The export does not carry: branches other than the exported head,file_change, vcs, workspace_state and checkpoint records (except as tool content), permission and input_request records, memory_change and delivery records, hook and terminal records, turn triggers, participants and conversations, state and config_change history, capture states (summarized in extra), redaction records, opaque reasoning and signatures, and timestamps of individual records within a step. An exporter MUST NOT describe an ATIF export as a complete representation of the stream (ASR-617).
Import
An ATIF document imports as one ASR stream:producer.method: "import",producer.source: {"format": "atif", "formatVersion": <schema_version>}.- The session key:
agent.namemapped through the registry (or a reverse-DNS name supplied by the importer) andsession_idassessionIdwhen present; otherwise the importer cannot form a session key without inventing one and MUST be given one. - Steps become a linear sequence of records in step order, with record IDs and message IDs derived from
step_id(idSource: derived). tool_call_idbecomescallIdwithcallIdSource: native; observation results withsource_call_idbecometool_resultrecords withlinkage: exact.metricson a step withllm_call_count1 become aninferencewith a derived ID. Steps with a higher or absent count put their metrics in ausage_summarywithscope: turnandcallCountwhen known.- Because ATIF includes cache in
prompt_tokens, usage isinput.totalwithincludesCache: true, andcacheReadfromcached_tokens. is_copied_contextcannot becomecopiedFrom(ATIF does not name the source session). The importer keeps it in_metaand declares the losscopies.subagent_trajectoriesbecome separate streams withlineage.spawnedBy(evidence: native_structure).- Declared losses typically include
timestamps(when steps lack them),branches,file_changeandcopies.