schema reference ────────────────────────

Schema

2026-03-31

Runtime agent support. Adds execution_context discriminator and runtime outcome signals for action-trajectory agents.

Read the full schema documentation for design rationale and usage guides, or see contributing to the schema to propose changes.

TraceRecord

Root record. One per session, one JSONL line.

fieldtypedescription
schema_versionstringreqe.g. "0.2.0"
trace_idstringreqUUID for this trace
session_idstringreqAgent's native session ID
content_hashstringSHA-256 for deduplication
timestamp_startstringISO 8601 start
timestamp_endstringISO 8601 end
taskTaskTask metadata
agentAgentreqAgent identity
environmentEnvironmentOS, shell, VCS, languages
system_promptsdictDeduplicated prompts keyed by hash
tool_definitionsdict[]Available tool schemas
stepsStep[]TAO-loop steps
outcomeOutcomeSession outcome
dependenciesstring[]Project dependencies
metricsMetricsAggregated metrics
securitySecurityMetadataSecurity tier and redactions
attributionAttributionCode attribution (experimental)
metadatadictExtensible key-value pairs
execution_contextstring | null"devtime" (code-editing agent) or "runtime" (action-trajectory / RL agent). Null for pre-0.2 traces.
Task

Task metadata for filtering and grouping.

fieldtypedescription
descriptionstringWhat the task is
sourcestringuser_prompt, cli_arg, skill, etc.
repositorystringowner/repo format
base_commitstringStarting commit SHA
Agent

Agent identity.

fieldtypedescription
namestringreqclaude-code, cursor, codex, etc.
versionstringAgent version
modelstringprovider/model-name
Environment

Runtime context.

fieldtypedescription
osstringdarwin, linux, etc.
shellstringzsh, bash, etc.
vcsVCStype, base_commit, branch, diff
language_ecosystemstring[]python, typescript, etc.
Step

One LLM API call in the TAO loop.

fieldtypedescription
step_indexintreqSequential index
rolestringreqsystem | user | agent
contentstringMessage content
reasoning_contentstringChain-of-thought
modelstringModel for this step
system_prompt_hashstringKey into system_prompts
agent_rolestringmain, explore, plan, etc.
parent_stepintParent step index
call_typestringmain | subagent | warmup
subagent_trajectory_refstringSub-agent session ID
tools_availablestring[]Available tool names
tool_callsToolCall[]Tool invocations
observationsObservation[]Tool results
snippetsSnippet[]Extracted code blocks
token_usageTokenUsageToken breakdown
timestampstringISO 8601
ToolCall

A tool invocation within a step.

fieldtypedescription
tool_call_idstringreqID for linking to observations
tool_namestringreqTool name
inputdictInput parameters
duration_msintWall-clock time
Observation

Tool result linked to its ToolCall.

fieldtypedescription
source_call_idstringreqLinks to ToolCall
contentstringFull output
output_summarystringLightweight preview
errorstringError info if failed
TokenUsage

Per-step token breakdown.

fieldtypedescription
input_tokensintInput tokens
output_tokensintOutput tokens
cache_read_tokensintFrom cache
cache_write_tokensintWritten to cache
prefix_reuse_tokensintVia prefix caching
Outcome

Session outcome for reward modeling.

fieldtypedescription
successbooleanGoal achieved
signal_sourcestringDefault: "deterministic"
signal_confidencestringderived | inferred | annotated
descriptionstringOutcome description
patchstringUnified diff
committedbooleanChanges committed to git
commit_shastringCommit SHA
terminal_statestring | null"goal_reached", "interrupted", "error", or "abandoned". Meaningful for runtime agents.
rewardfloat | nullNumeric reward signal from an RL environment or evaluator.
reward_sourcestring | nullCanonical values: "rl_environment", "judge", "human_annotation", "orchestrator".
Attribution

Code attribution (experimental).

fieldtypedescription
experimentalbooleanAlways true in v0.1.x
filesAttributionFile[]Per-file line ranges
Metrics

Session-level aggregates.

fieldtypedescription
total_stepsintStep count
total_input_tokensintSum of input tokens
total_output_tokensintSum of output tokens
total_duration_sfloatWall-clock seconds
cache_hit_ratefloat0.0 to 1.0
estimated_cost_usdfloatEstimated cost
SecurityMetadata

Security mode and redaction record.

fieldtypedescription
tierint1 (auto), 2 (review)
flags_reviewedintFlags reviewed
redactions_appliedintRedactions applied
classifier_versionstringClassifier version
Example
{
  "schema_version": "0.2.0",
  "trace_id": "a4f2b8c1-e2d3-4f5a-b6c7-d8e9f0a1b2c3",
  "session_id": "sess_0x8f2a1b3c",
  "content_hash": "e3b0c44298fc1c14...",
  "timestamp_start": "2026-03-27T14:30:00Z",
  "task": {
    "description": "Add input validation to the signup form",
    "repository": "acme/webapp",
    "base_commit": "a1b2c3d4"
  },
  "agent": {
    "name": "claude-code",
    "version": "1.0.32",
    "model": "anthropic/claude-sonnet-4-20250514"
  },
  "environment": {
    "os": "darwin",
    "shell": "zsh",
    "vcs": { "type": "git", "branch": "main" },
    "language_ecosystem": ["typescript"]
  },
  "system_prompts": {
    "abc123": "You are Claude Code..."
  },
  "steps": [
    {
      "step_index": 0,
      "role": "user",
      "content": "Add Zod validation to the signup form"
    },
    {
      "step_index": 1,
      "role": "agent",
      "content": "I'll add Zod validation...",
      "model": "anthropic/claude-sonnet-4-20250514",
      "system_prompt_hash": "abc123",
      "agent_role": "main",
      "call_type": "main",
      "tool_calls": [{
        "tool_call_id": "tc_001",
        "tool_name": "Edit",
        "input": { "file_path": "src/signup.tsx" },
        "duration_ms": 120
      }],
      "observations": [{
        "source_call_id": "tc_001",
        "output_summary": "Added Zod schema to signup form",
        "content": "File edited successfully"
      }],
      "token_usage": {
        "input_tokens": 4200,
        "output_tokens": 1800,
        "cache_read_tokens": 3800,
        "prefix_reuse_tokens": 3800
      }
    }
  ],
  "outcome": {
    "success": true,
    "signal_source": "deterministic",
    "signal_confidence": "derived",
    "committed": true,
    "commit_sha": "f5e6d7c8"
  },
  "metrics": {
    "total_steps": 2,
    "total_input_tokens": 8400,
    "total_output_tokens": 1800,
    "cache_hit_rate": 0.9,
    "estimated_cost_usd": 0.24
  },
  "security": { "tier": 2, "redactions_applied": 1 }
}