Trajectory schema (ALE-v1.0)

The canonical record ALE emits for every run. Each agent's deployer translates its native logs into this shape, so every run reads the same way regardless of the harness underneath. This page is the field-by-field specification.

Conventions

Trajectory

Trajectory is the top-level object: one complete episode.

FieldTypeReqMeaning
schema_version"ALE-v1.0"yesFormat version (constant).
episode_idstringyesUnique id for this episode.
agentAgentInfoyesWhich agent produced the trajectory.
task_pathstringyesThe task this run is for (run context).
variant_indexintegeryesWhich task variant (run context).
instructionstringnoThe prompt handed to the agent. Default "".
stepsStep[]noThe ordered interaction. Default [].
final_metricsFinalMetrics | nullnoTrajectory-wide totals and outcome (set at finalize).
started_atstringnoWhen the episode began (ISO-8601).
ended_atstring | nullnoWhen it ended.
subagent_trajectoriesTrajectory[]noFull nested traces of any sub-agents the agent spawned. Default [].
continued_trajectory_refstring | nullnoWhen an episode is split across files, the relative path of the previous chunk. Walk the chain back until null, then concatenate steps.
extraobjectnoAgent-specific metadata that doesn't fit the standard shape. Default {}.

AgentInfo

FieldTypeReqMeaning
namestringyesAgent identifier, e.g. "claude-code", "ale-claw".
versionstring | nullnoCLI version or commit.
modelstring | nullnoThe LLM id the agent used.
extraobjectnoAgent-specific metadata.

Step

One turn in the interaction. Its shape varies by source.

FieldTypeReqMeaning
step_idinteger (≥ 1)yesOrdinal position, starting at 1.
timestampstringnoWhen the step occurred (ISO-8601).
source"system" | "user" | "agent" | "environment"yesWho produced the step (see below).
messagestring | ContentPart[] | nullnoText, or multimodal content.
reasoningstring | nullnoThe agent's reasoning trace, when exposed.
tool_callsToolCall[]noTools the agent invoked this step. Default [].
observationObservation | nullnoThe environment's response.
metricsStepMetrics | nullnoLLM accounting for this step.
extraobjectnoStep-specific metadata (e.g. screenshot_index, screenshot_path). Default {}.

The four source values carry different fields:

ToolCall

A single tool invocation emitted by the agent within a step.

FieldTypeReqMeaning
idstringnoUnique call id; a later ToolResult references it. Auto-generated (call_…) if absent.
namestringyesTool name.
argumentsobjectnoArguments passed. Default {}.

Observation

The environment's response to one or more tool calls. results align with the tool_calls of the previous step, matched by id. A pure state update (no preceding call) may leave results empty and carry content on the step's message.

FieldTypeReqMeaning
resultsToolResult[]noOne result per preceding tool call. Default [].
errorstring | nullnoAn environment-level error, if any.

ToolResult

FieldTypeReqMeaning
tool_call_idstringyesThe ToolCall.id this answers.
contentContentPart[]noThe result: text and/or image. Default [].
is_errorbooleannoWhether the tool failed. Default false.

ContentPart

One piece of structured content: either text or an image.

FieldTypeReqMeaning
type"text" | "image"yesWhich kind of content.
textstring | nullcond.Set when type = "text".
imageImageSource | nullcond.Set when type = "image".

ImageSource

A reference to an image. path is preferred. Inline base64 (data) is accepted from deployers but discouraged for long episodes. The framework moves captured base64 to screenshots/NNNN.png and rewrites the reference to type = "path" before the trajectory is persisted.

FieldTypeReqMeaning
type"path" | "url" | "base64"noHow the image is referenced. Default "path".
pathstring | nullcond.Relative path under the run dir.
urlstring | nullcond.Remote URL.
datastring | nullcond.Inline base64 (transient, moved to disk).
media_typestringnoMIME type. Default "image/png".
alt_textstring | nullnoOptional description.

StepMetrics

Per-step LLM accounting. Every field is optional: populate what the agent reports.

FieldTypeReqMeaning
input_tokensinteger | nullnoPrompt tokens.
output_tokensinteger | nullnoGenerated tokens.
cache_read_tokensinteger | nullnoPrompt tokens served from cache.
cache_creation_tokensinteger | nullnoTokens written to cache.
cost_usdfloat | nullnoThis step's API cost.
duration_msinteger | nullnoWall-clock for this step.

FinalMetrics

Trajectory-wide totals plus the outcome. The token, cost, and duration totals are summed from per-step StepMetrics; reward and status are not rolled up from steps. They are filled in by the grader and the runner at the end.

FieldTypeReqMeaning
total_stepsintegernoNumber of steps. Default 0.
total_input_tokensintegernoSum of step input tokens.
total_output_tokensintegernoSum of step output tokens.
total_cache_read_tokensintegernoSum of cache reads.
total_cache_creation_tokensintegernoSum of cache writes.
total_cost_usdfloatnoSum of step costs. Default 0.0.
total_duration_msintegernoTotal wall-clock.
rewardfloat | nullnoThe grader's score, set at evaluation. Not a step metric.
status"completed" | "timeout" | "failed"noHow the run ended. Default "completed".
Where this lives
The Pydantic models are in ale_run/base_interface/trajectory.py; deployers populate them via TrajectoryBuilder. How a run's files fit together is covered in Trajectories & artifacts.