{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://github.github.com/gh-aw/schemas/unified-session.schema.json",
  "title": "Unified agent session file",
  "description": "Generated from actions/setup/js/types/{agent_session,unified_session}.d.ts. Run make session-schemas; do not edit by hand.",
  "type": "array",
  "items": {
    "type": "object",
    "required": ["type", "data", "provenance"],
    "properties": { "type": { "type": "string", "pattern": "\\." }, "data": { "type": "object" }, "provenance": { "$ref": "#/definitions/SessionProvenance" } },
    "allOf": [
      { "$ref": "#/definitions/EventMetadata" },
      { "if": { "properties": { "type": { "const": "agent.execution" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/AgentExecutionData" } } } },
      { "if": { "properties": { "type": { "const": "assistant.message" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/UnifiedMessageData" } } } },
      {
        "if": { "properties": { "type": { "const": "assistant.message_update" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sourceType": { "$ref": "#/definitions/JsonValue" },
                "type": { "$ref": "#/definitions/JsonValue", "description": "Native update subtype distinguishes historical Pi text and thinking controls." },
                "usageSnapshot": { "$ref": "#/definitions/JsonValue", "description": "Observed native usage, not an additive accounting contribution." },
                "content": { "$ref": "#/definitions/JsonValue" },
                "sourceEngine": { "type": "string" },
                "delta": { "$ref": "#/definitions/JsonValue" },
                "partial": { "$ref": "#/definitions/JsonValue" },
                "messageId": { "$ref": "#/definitions/JsonValue" },
                "contentIndex": { "$ref": "#/definitions/JsonValue" },
                "channel": { "$ref": "#/definitions/JsonValue" },
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "model": { "$ref": "#/definitions/JsonValue" },
                "apiCallId": { "$ref": "#/definitions/JsonValue" },
                "interactionId": { "$ref": "#/definitions/JsonValue" },
                "turnId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" }
              }
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "assistant.reasoning" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/UnifiedMessageData" } } } },
      {
        "if": { "properties": { "type": { "const": "assistant.refusal" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "content": { "$ref": "#/definitions/JsonValue" },
                "sourceEngine": { "type": "string" },
                "delta": { "$ref": "#/definitions/JsonValue" },
                "partial": { "type": "boolean", "description": "True for an observed streaming fragment, not a finalized refusal." },
                "messageId": { "$ref": "#/definitions/JsonValue" },
                "contentIndex": { "$ref": "#/definitions/JsonValue" },
                "channel": { "$ref": "#/definitions/JsonValue" },
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "model": { "$ref": "#/definitions/JsonValue" },
                "apiCallId": { "$ref": "#/definitions/JsonValue" },
                "interactionId": { "$ref": "#/definitions/JsonValue" },
                "turnId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "reason": { "type": "string", "enum": ["refusal", "content_filter"] },
                "policyCategory": { "type": ["string", "null"] },
                "explanation": { "type": ["string", "null"] }
              },
              "required": ["reason"]
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "detection.result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DetectionResultData" } } } },
      { "if": { "properties": { "type": { "const": "dynamicWorkflows.background_tasks_changed" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DynamicWorkflowObservationData" } } } },
      { "if": { "properties": { "type": { "const": "dynamicWorkflows.task_notification" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DynamicWorkflowObservationData" } } } },
      { "if": { "properties": { "type": { "const": "dynamicWorkflows.task_progress" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DynamicWorkflowObservationData" } } } },
      { "if": { "properties": { "type": { "const": "dynamicWorkflows.task_started" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DynamicWorkflowObservationData" } } } },
      { "if": { "properties": { "type": { "const": "dynamicWorkflows.task_updated" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DynamicWorkflowObservationData" } } } },
      { "if": { "properties": { "type": { "const": "eval.result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/EvalResultData" } } } },
      { "if": { "properties": { "type": { "const": "execution.result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ExecutionResultData" } } } },
      { "if": { "properties": { "type": { "const": "experiment.assignment" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ExperimentAssignmentData" } } } },
      { "if": { "properties": { "type": { "const": "experiment.state" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ExperimentStateData" } } } },
      { "if": { "properties": { "type": { "const": "firewall.event" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/RuntimeObservationData" } } } },
      { "if": { "properties": { "type": { "const": "firewall.http_access" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/FirewallAccessData" } } } },
      { "if": { "properties": { "type": { "const": "firewall.model_routing" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelRoutingData" } } } },
      { "if": { "properties": { "type": { "const": "firewall.steering" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/FirewallSteeringData" } } } },
      { "if": { "properties": { "type": { "const": "firewall.token_usage" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/UsageReportData" } } } },
      { "if": { "properties": { "type": { "const": "firewall.upstream_error" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/FirewallUpstreamErrorData" } } } },
      { "if": { "properties": { "type": { "const": "github_api.rate_limit" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/GitHubApiRateLimitData" } } } },
      { "if": { "properties": { "type": { "const": "grader.manifest" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/GraderManifestData" } } } },
      { "if": { "properties": { "type": { "const": "grader.result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/GraderResultData" } } } },
      { "if": { "properties": { "type": { "const": "guardrail.admission" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/AdmissionDecisionData" } } } },
      { "if": { "properties": { "type": { "const": "guardrail.daily_aic" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/DailyAICDecisionData" } } } },
      { "if": { "properties": { "type": { "const": "mcp.configuration" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/McpConfigurationData" } } } },
      { "if": { "properties": { "type": { "const": "mcp.difc.filtered" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/McpObservationData" } } } },
      {
        "if": { "properties": { "type": { "const": "mcp.event" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "serverName": { "$ref": "#/definitions/JsonValue" },
                "event": { "$ref": "#/definitions/JsonValue" },
                "level": { "$ref": "#/definitions/JsonValue" },
                "status": { "$ref": "#/definitions/JsonValue" },
                "message": { "$ref": "#/definitions/JsonValue" },
                "reason": { "$ref": "#/definitions/JsonValue" },
                "requestId": { "$ref": "#/definitions/JsonValue" }
              }
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "mcp.guard.blocked" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/McpObservationData" } } } },
      { "if": { "properties": { "type": { "const": "mcp.rpc.request" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/McpObservationData" } } } },
      { "if": { "properties": { "type": { "const": "mcp.rpc.response" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/McpObservationData" } } } },
      { "if": { "properties": { "type": { "const": "mcp.tool_call" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/McpObservationData" } } } },
      { "if": { "properties": { "type": { "const": "model.baseline_estimate" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelBaselineEstimateData" } } } },
      { "if": { "properties": { "type": { "const": "model.config" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelConfigData" } } } },
      { "if": { "properties": { "type": { "const": "model.inventory" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelInventoryData" } } } },
      { "if": { "properties": { "type": { "const": "model.resolution" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelResolutionData" } } } },
      { "if": { "properties": { "type": { "const": "model_endpoint.mismatch" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelEndpointMismatchData" } } } },
      { "if": { "properties": { "type": { "const": "model_routing.outcome" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/ModelRoutingOutcomeData" } } } },
      { "if": { "properties": { "type": { "const": "plugin.installation" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/PluginInstallationData" } } } },
      { "if": { "properties": { "type": { "const": "prompt.system" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/Pick%3CMessageData%2C%22content%22%3E" } } } },
      { "if": { "properties": { "type": { "const": "prompt.user" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/Pick%3CMessageData%2C%22content%22%3E" } } } },
      { "if": { "properties": { "type": { "const": "safe_output.error" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SafeOutputErrorData" } } } },
      { "if": { "properties": { "type": { "const": "safe_output.request" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SafeOutputData" } } } },
      { "if": { "properties": { "type": { "const": "safe_output.result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SafeOutputData" } } } },
      { "if": { "properties": { "type": { "const": "session.collection" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/CollectionData" } } } },
      { "if": { "properties": { "type": { "const": "session.collection_warning" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/CollectionWarningData" } } } },
      {
        "if": { "properties": { "type": { "const": "session.error" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "error": { "$ref": "#/definitions/JsonValue" },
                "message": { "$ref": "#/definitions/JsonValue" },
                "content": { "$ref": "#/definitions/JsonValue" },
                "code": { "$ref": "#/definitions/JsonValue" },
                "statusCode": { "$ref": "#/definitions/JsonValue" },
                "errorType": { "$ref": "#/definitions/JsonValue" },
                "model": { "$ref": "#/definitions/JsonValue" },
                "severity": { "$ref": "#/definitions/JsonValue" },
                "status": { "$ref": "#/definitions/JsonValue" },
                "sourceType": { "$ref": "#/definitions/JsonValue" },
                "exitCode": { "$ref": "#/definitions/JsonValue" }
              }
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "session.format" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SessionFileFormatData" } } } },
      {
        "if": { "properties": { "type": { "const": "session.info" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "message": { "$ref": "#/definitions/JsonValue" },
                "content": { "$ref": "#/definitions/JsonValue" },
                "model": { "$ref": "#/definitions/JsonValue" },
                "status": { "$ref": "#/definitions/JsonValue" },
                "sourceType": { "$ref": "#/definitions/JsonValue" },
                "role": { "$ref": "#/definitions/JsonValue" },
                "messageId": { "$ref": "#/definitions/JsonValue" },
                "toolCallId": { "$ref": "#/definitions/JsonValue" },
                "toolName": { "$ref": "#/definitions/JsonValue" },
                "usageSnapshot": { "$ref": "#/definitions/JsonValue", "description": "Repeated observed metadata, never additive inference usage." },
                "estimatedTokens": { "$ref": "#/definitions/JsonValue", "description": "Native estimates, not measured or additive token usage." },
                "estimatedTokensDelta": { "$ref": "#/definitions/JsonValue" },
                "cwd": { "$ref": "#/definitions/JsonValue" },
                "branch": { "$ref": "#/definitions/JsonValue" },
                "kind": { "$ref": "#/definitions/JsonValue" },
                "rateLimitInfo": { "$ref": "#/definitions/JsonValue" },
                "isAuthenticating": { "$ref": "#/definitions/JsonValue" },
                "output": { "$ref": "#/definitions/JsonValue" }
              }
            }
          }
        }
      },
      {
        "if": { "properties": { "type": { "const": "session.init" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "type": ["string", "null"] },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "sourceEngine": { "type": "string" },
                "model": { "type": "string" },
                "cwd": { "type": "string" },
                "reasoningEffort": { "type": "string" }
              }
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "session.result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/UnifiedSessionResultData" } } } },
      {
        "if": { "properties": { "type": { "const": "session.shutdown" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "shutdownType": { "$ref": "#/definitions/JsonValue" },
                "errorReason": { "$ref": "#/definitions/JsonValue" },
                "premiumRequests": { "$ref": "#/definitions/JsonValue" },
                "totalNanoAiu": { "$ref": "#/definitions/JsonValue" },
                "totalApiDurationMs": { "$ref": "#/definitions/JsonValue" },
                "sessionStartTime": { "$ref": "#/definitions/JsonValue" },
                "currentModel": { "$ref": "#/definitions/JsonValue" }
              }
            }
          }
        }
      },
      {
        "if": { "properties": { "type": { "const": "session.start" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "type": ["string", "null"] },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "sourceEngine": { "type": "string" },
                "model": { "type": "string" },
                "cwd": { "type": "string" },
                "reasoningEffort": { "type": "string" }
              }
            }
          }
        }
      },
      {
        "if": { "properties": { "type": { "const": "session.task_complete" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "success": { "$ref": "#/definitions/JsonValue" },
                "summary": { "$ref": "#/definitions/JsonValue" }
              }
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "skill.conflict" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SkillConflictData" } } } },
      {
        "if": { "properties": { "type": { "const": "skill.context_delivered_ref" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "properties": { "interactionId": { "$ref": "#/definitions/JsonValue" }, "source": { "$ref": "#/definitions/JsonValue" }, "contentId": { "$ref": "#/definitions/JsonValue" } },
              "additionalProperties": false
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "skill.inventory" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SkillInventoryData" } } } },
      { "if": { "properties": { "type": { "const": "skill.invoked" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/SkillInvokedData" } } } },
      {
        "if": { "properties": { "type": { "const": "tool.execution_complete" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "toolCallId": { "type": "string" },
                "stepIndex": { "$ref": "#/definitions/SessionCount" },
                "toolName": { "type": "string" },
                "success": { "type": "boolean" },
                "output": { "$ref": "#/definitions/JsonValue" },
                "result": { "$ref": "#/definitions/JsonValue" },
                "error": { "$ref": "#/definitions/JsonValue" },
                "fileEdits": { "$ref": "#/definitions/JsonValue" },
                "durationMs": { "$ref": "#/definitions/SessionMetric" },
                "exitCode": { "type": ["number", "null"] },
                "status": { "type": "string" },
                "mcpServerName": { "type": "string" },
                "isError": { "type": "boolean" },
                "taskId": { "type": "string" },
                "taskType": { "type": "string" },
                "workflowName": { "type": "string" },
                "workflowRunId": { "type": "string" }
              }
            }
          }
        }
      },
      {
        "if": { "properties": { "type": { "const": "tool.execution_start" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "toolCallId": { "type": "string" },
                "stepIndex": { "$ref": "#/definitions/SessionCount" },
                "toolName": { "type": "string" },
                "input": { "$ref": "#/definitions/JsonValue" },
                "inputTruncated": { "type": "boolean" },
                "command": { "type": "string" },
                "mcpServerName": { "type": "string" }
              }
            }
          }
        }
      },
      {
        "if": { "properties": { "type": { "const": "tool.execution_update" } }, "required": ["type"] },
        "then": {
          "properties": {
            "data": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sessionId": { "$ref": "#/definitions/JsonValue" },
                "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
                "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
                "agentId": { "$ref": "#/definitions/JsonValue" },
                "output": { "$ref": "#/definitions/JsonValue" },
                "partial": { "$ref": "#/definitions/JsonValue" },
                "delta": { "$ref": "#/definitions/JsonValue" },
                "contentIndex": { "$ref": "#/definitions/JsonValue" },
                "sourceType": { "$ref": "#/definitions/JsonValue" },
                "usageSnapshot": { "$ref": "#/definitions/JsonValue", "description": "Repeated observed metadata, never additive inference usage." },
                "durationMs": { "$ref": "#/definitions/JsonValue" },
                "status": { "$ref": "#/definitions/JsonValue" },
                "command": { "$ref": "#/definitions/JsonValue" },
                "taskId": { "type": "string" },
                "taskType": { "type": "string" },
                "error": { "$ref": "#/definitions/JsonValue" },
                "toolCallId": { "type": "string" },
                "stepIndex": { "$ref": "#/definitions/SessionCount" },
                "toolName": { "type": "string" },
                "input": { "$ref": "#/definitions/JsonValue" },
                "mcpServerName": { "type": "string" }
              }
            }
          }
        }
      },
      { "if": { "properties": { "type": { "const": "usage.report" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/UsageReportData" } } } },
      { "if": { "properties": { "type": { "const": "user.message" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/UnifiedMessageData" } } } },
      { "if": { "properties": { "type": { "const": "workflow.info" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/WorkflowInfoData" } } } },
      { "if": { "properties": { "type": { "const": "workflow.job_result" } }, "required": ["type"] }, "then": { "properties": { "data": { "$ref": "#/definitions/WorkflowJobResultData" } } } }
    ]
  },
  "minItems": 1,
  "allOf": [
    {
      "items": [
        {
          "properties": {
            "type": { "const": "session.format" },
            "data": { "properties": { "version": { "const": 1 } }, "required": ["version"] },
            "provenance": { "properties": { "component": { "const": "collector" }, "phase": { "const": "conclusion" }, "path": { "const": "usage/aw_session.jsonl" }, "index": { "const": 0 } }, "not": { "required": ["timestampMs"] } }
          },
          "not": { "required": ["timestamp"] }
        }
      ]
    }
  ],
  "definitions": {
    "AdmissionDecisionData": {
      "type": "object",
      "properties": {
        "status": { "type": "string", "enum": ["admitted", "ignored", "skipped"] },
        "maxAiCredits": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
        "threatDetectionMaxAiCredits": { "type": "integer", "minimum": 1, "maximum": 2147483647 },
        "evalsMaxAiCredits": { "type": "integer", "minimum": 1, "maximum": 2147483647 }
      },
      "required": ["status"],
      "additionalProperties": false,
      "description": "Validated admission allowances, not spend or credentials."
    },
    "AgentExecutionData": {
      "type": "object",
      "properties": {
        "categories": { "type": "array", "items": { "$ref": "#/definitions/SessionDiagnosticName" }, "uniqueItems": true },
        "errorCodes": { "type": "array", "items": { "anyOf": [{ "$ref": "#/definitions/SessionDiagnosticName" }, { "$ref": "#/definitions/SessionErrorNumber" }] }, "uniqueItems": true },
        "errorTypes": { "type": "array", "items": { "$ref": "#/definitions/SessionDiagnosticName" }, "uniqueItems": true },
        "exitCode": { "$ref": "#/definitions/SessionExitCode" }
      },
      "required": ["categories", "errorCodes", "errorTypes"],
      "additionalProperties": {}
    },
    "CollectionData": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "component": { "type": "string" },
              "phase": { "type": "string" },
              "path": { "type": "string" },
              "events": { "$ref": "#/definitions/SessionCount" },
              "timestampUnit": { "type": "string", "enum": ["seconds", "milliseconds", "nanoseconds"] }
            },
            "required": ["component", "phase", "path", "events"],
            "additionalProperties": false
          }
        },
        "warnings": { "$ref": "#/definitions/SessionCount" },
        "untimedEvents": { "$ref": "#/definitions/SessionCount" },
        "absentComponents": { "type": "array", "items": { "type": "string" } }
      },
      "required": ["sources", "warnings", "untimedEvents", "absentComponents"],
      "additionalProperties": false
    },
    "CollectionWarningData": { "type": "object", "properties": { "code": { "type": "string" }, "path": { "type": "string" }, "line": { "type": "number", "minimum": 1, "multipleOf": 1 } }, "required": ["code"], "additionalProperties": {} },
    "DailyAICDecisionData": {
      "type": "object",
      "properties": {
        "status": { "type": "string", "enum": ["disabled", "skipped", "under_budget", "exceeded", "structural_error", "transient_error"] },
        "exceeded": { "type": "boolean" },
        "total": { "type": "number" },
        "estimated": { "type": "number" },
        "threshold": { "type": "number" }
      },
      "required": ["status"],
      "additionalProperties": false
    },
    "DetectionResultData": {
      "type": "object",
      "properties": {
        "jobResult": { "type": "string" },
        "conclusion": { "type": "string" },
        "reason": { "type": "string" },
        "promptInjection": { "type": "boolean" },
        "secretLeak": { "type": "boolean" },
        "maliciousPatch": { "type": "boolean" }
      },
      "additionalProperties": {}
    },
    "DynamicWorkflowObservationData": {
      "type": "object",
      "properties": {
        "taskId": { "type": "string" },
        "toolCallId": { "type": "string" },
        "taskType": { "type": "string" },
        "workflowName": { "type": "string" },
        "status": { "type": "string" },
        "sessionId": { "type": "string" },
        "parentToolUseId": { "type": ["string", "null"] },
        "usage": {
          "type": "object",
          "properties": { "totalTokens": { "$ref": "#/definitions/SessionCount" }, "toolUses": { "$ref": "#/definitions/SessionCount" }, "durationMs": { "$ref": "#/definitions/SessionMetric" } },
          "additionalProperties": false
        },
        "tasks": { "type": "array", "items": { "$ref": "#/definitions/DynamicWorkflowTaskData" } },
        "workflowProgress": { "type": "array", "items": { "$ref": "#/definitions/DynamicWorkflowProgressData" } }
      },
      "additionalProperties": false
    },
    "DynamicWorkflowProgressData": {
      "type": "object",
      "properties": {
        "type": { "type": "string" },
        "index": { "$ref": "#/definitions/SessionCount" },
        "phaseIndex": { "$ref": "#/definitions/SessionCount" },
        "agentId": { "type": "string" },
        "model": { "type": "string" },
        "state": { "type": "string" },
        "attempt": { "$ref": "#/definitions/SessionCount" },
        "startedAt": { "$ref": "#/definitions/SessionMetric" },
        "queuedAt": { "$ref": "#/definitions/SessionMetric" },
        "lastProgressAt": { "$ref": "#/definitions/SessionMetric" }
      },
      "additionalProperties": false
    },
    "DynamicWorkflowTaskData": {
      "type": "object",
      "properties": {
        "taskId": { "type": "string" },
        "toolCallId": { "type": "string" },
        "taskType": { "type": "string" },
        "workflowName": { "type": "string" },
        "status": { "type": "string" },
        "sessionId": { "type": "string" },
        "parentToolUseId": { "type": ["string", "null"] }
      },
      "additionalProperties": false
    },
    "EpisodeLineageData": {
      "type": "object",
      "properties": {
        "episodeId": { "$ref": "#/definitions/JsonValue" },
        "hopId": { "$ref": "#/definitions/JsonValue" },
        "parentHopId": { "$ref": "#/definitions/JsonValue" },
        "originEvent": { "$ref": "#/definitions/JsonValue" },
        "rootRepo": { "$ref": "#/definitions/JsonValue" },
        "rootWorkflowId": { "$ref": "#/definitions/JsonValue" },
        "rootRunId": { "$ref": "#/definitions/JsonValue" },
        "parentRepo": { "$ref": "#/definitions/JsonValue" },
        "parentRunId": { "$ref": "#/definitions/JsonValue" },
        "parentRunAttempt": { "$ref": "#/definitions/JsonValue" },
        "parentWorkflowId": { "$ref": "#/definitions/JsonValue" },
        "parentWorkflowCallId": { "$ref": "#/definitions/JsonValue" },
        "parentEventType": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false,
      "description": "Observed lineage from aw_info.context; hopId identifies the recorded caller."
    },
    "EvalResultData": {
      "type": "object",
      "properties": {
        "id": { "$ref": "#/definitions/JsonValue" },
        "answer": { "$ref": "#/definitions/JsonValue" },
        "model": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" },
        "runId": { "$ref": "#/definitions/JsonValue" },
        "assignments": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "EventMetadata": { "type": "object", "properties": { "id": { "type": "string" }, "parentId": { "type": ["string", "null"] }, "timestamp": { "type": ["string", "number"] } }, "additionalProperties": {} },
    "ExecutionResultData": {
      "type": "object",
      "properties": {
        "outcome": { "$ref": "#/definitions/JsonValue" },
        "conclusion": { "$ref": "#/definitions/JsonValue" },
        "exitCode": { "$ref": "#/definitions/JsonValue" },
        "durationMs": { "$ref": "#/definitions/JsonValue" },
        "startedAt": { "$ref": "#/definitions/JsonValue" },
        "finishedAt": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "ExperimentAssignmentData": { "type": "object", "properties": { "assignments": { "$ref": "#/definitions/JsonValue" } }, "required": ["assignments"], "additionalProperties": false },
    "ExperimentStateData": {
      "type": "object",
      "properties": { "runId": { "$ref": "#/definitions/JsonValue" }, "assignments": { "$ref": "#/definitions/JsonValue" }, "counts": { "$ref": "#/definitions/JsonValue" } },
      "additionalProperties": false
    },
    "FirewallAccessData": {
      "type": "object",
      "properties": {
        "host": { "$ref": "#/definitions/JsonValue" },
        "method": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "decision": { "$ref": "#/definitions/JsonValue" },
        "bytes": { "$ref": "#/definitions/JsonValue" },
        "durationMs": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "FirewallSteeringData": {
      "type": "object",
      "properties": {
        "event": { "$ref": "#/definitions/JsonValue" },
        "level": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" },
        "reason": { "$ref": "#/definitions/JsonValue" },
        "requestId": { "$ref": "#/definitions/JsonValue" },
        "threshold": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false,
      "description": "AWF API proxy steering event-log observation."
    },
    "FirewallUpstreamErrorData": {
      "type": "object",
      "properties": {
        "requestId": { "type": "string" },
        "provider": { "type": "string" },
        "model": { "type": "string" },
        "httpStatus": { "type": "integer" },
        "errorCode": { "type": "string", "description": "Identifier-shaped provider error code; absent means the provider did not supply one." },
        "errorType": { "type": "string" },
        "errorParam": { "type": "string" }
      },
      "additionalProperties": false,
      "description": "Proxy-written upstream error response, projected without bodies, headers or messages."
    },
    "GitHubApiRateLimitData": {
      "type": "object",
      "properties": {
        "source": { "$ref": "#/definitions/JsonValue" },
        "credentialSource": { "$ref": "#/definitions/JsonValue" },
        "operation": { "$ref": "#/definitions/JsonValue" },
        "resource": { "$ref": "#/definitions/JsonValue" },
        "limit": { "$ref": "#/definitions/JsonValue" },
        "remaining": { "$ref": "#/definitions/JsonValue" },
        "used": { "$ref": "#/definitions/JsonValue" },
        "reset": { "$ref": "#/definitions/JsonValue" },
        "attempt": { "$ref": "#/definitions/JsonValue" },
        "delayMs": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "GraderData": {
      "type": "object",
      "properties": {
        "id": { "$ref": "#/definitions/JsonValue" },
        "name": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "value": { "$ref": "#/definitions/JsonValue" },
        "score": { "$ref": "#/definitions/JsonValue" },
        "unit": { "$ref": "#/definitions/JsonValue" },
        "passed": { "$ref": "#/definitions/JsonValue" },
        "direction": { "$ref": "#/definitions/JsonValue" },
        "threshold": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" },
        "source": { "$ref": "#/definitions/JsonValue" },
        "enabled": { "$ref": "#/definitions/JsonValue" },
        "min": { "$ref": "#/definitions/JsonValue" },
        "max": { "$ref": "#/definitions/JsonValue" },
        "digest": { "$ref": "#/definitions/JsonValue" },
        "severity": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "GraderManifestData": {
      "type": "object",
      "properties": { "version": { "$ref": "#/definitions/JsonValue" }, "graders": { "type": "array", "items": { "$ref": "#/definitions/GraderData" } }, "customGraders": { "type": "array", "items": { "type": "string" } } },
      "additionalProperties": false
    },
    "GraderMeasurementData": {
      "type": "object",
      "properties": {
        "id": { "$ref": "#/definitions/JsonValue" },
        "name": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "value": { "$ref": "#/definitions/JsonValue" },
        "score": { "$ref": "#/definitions/JsonValue" },
        "unit": { "$ref": "#/definitions/JsonValue" },
        "passed": { "$ref": "#/definitions/JsonValue" },
        "direction": { "$ref": "#/definitions/JsonValue" },
        "threshold": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" },
        "source": { "$ref": "#/definitions/JsonValue" },
        "enabled": { "$ref": "#/definitions/JsonValue" },
        "min": { "$ref": "#/definitions/JsonValue" },
        "max": { "$ref": "#/definitions/JsonValue" },
        "digest": { "$ref": "#/definitions/JsonValue" },
        "severity": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" },
        "implementation": {
          "anyOf": [
            { "type": "object", "properties": { "id": { "$ref": "#/definitions/JsonValue" }, "version": { "$ref": "#/definitions/JsonValue" }, "digest": { "$ref": "#/definitions/JsonValue" } }, "additionalProperties": false },
            { "type": "null" }
          ]
        },
        "metrics": { "type": "array", "items": { "type": "object", "properties": { "id": { "$ref": "#/definitions/JsonValue" }, "value": { "$ref": "#/definitions/JsonValue" } }, "additionalProperties": false } }
      },
      "additionalProperties": false
    },
    "GraderResultData": {
      "type": "object",
      "properties": {
        "id": { "$ref": "#/definitions/JsonValue" },
        "name": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "value": { "$ref": "#/definitions/JsonValue" },
        "score": { "$ref": "#/definitions/JsonValue" },
        "unit": { "$ref": "#/definitions/JsonValue" },
        "passed": { "$ref": "#/definitions/JsonValue" },
        "direction": { "$ref": "#/definitions/JsonValue" },
        "threshold": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" },
        "source": { "$ref": "#/definitions/JsonValue" },
        "enabled": { "$ref": "#/definitions/JsonValue" },
        "min": { "$ref": "#/definitions/JsonValue" },
        "max": { "$ref": "#/definitions/JsonValue" },
        "digest": { "$ref": "#/definitions/JsonValue" },
        "severity": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" },
        "implementation": {
          "anyOf": [
            { "type": "object", "properties": { "id": { "$ref": "#/definitions/JsonValue" }, "version": { "$ref": "#/definitions/JsonValue" }, "digest": { "$ref": "#/definitions/JsonValue" } }, "additionalProperties": false },
            { "type": "null" }
          ]
        },
        "metrics": { "type": "array", "items": { "type": "object", "properties": { "id": { "$ref": "#/definitions/JsonValue" }, "value": { "$ref": "#/definitions/JsonValue" } }, "additionalProperties": false } },
        "version": { "$ref": "#/definitions/JsonValue" },
        "run": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": { "$ref": "#/definitions/JsonValue" },
                "attempt": { "$ref": "#/definitions/JsonValue" },
                "graderCount": { "$ref": "#/definitions/JsonValue" },
                "passed": { "$ref": "#/definitions/JsonValue" },
                "failed": { "$ref": "#/definitions/JsonValue" },
                "errors": { "$ref": "#/definitions/JsonValue" }
              },
              "additionalProperties": false
            },
            { "type": "null" }
          ]
        },
        "results": { "type": "array", "items": { "$ref": "#/definitions/GraderMeasurementData" } }
      },
      "additionalProperties": false
    },
    "JsonValue": {
      "anyOf": [
        { "type": "string" },
        { "type": "number" },
        { "type": "boolean" },
        { "type": "null" },
        { "type": "array", "items": { "$ref": "#/definitions/JsonValue" } },
        { "type": "object", "additionalProperties": { "$ref": "#/definitions/JsonValue" } }
      ]
    },
    "McpConfigurationData": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "serverName": { "type": "string" },
              "transport": { "type": "string", "enum": ["stdio", "http", "sse", "streamable-http"] },
              "required": { "type": "boolean" },
              "tools": { "type": "array", "items": { "type": "string" } }
            },
            "required": ["serverName"],
            "additionalProperties": false
          }
        }
      },
      "required": ["servers"],
      "additionalProperties": false
    },
    "McpObservationData": {
      "type": "object",
      "properties": {
        "serverName": { "$ref": "#/definitions/JsonValue" },
        "direction": { "$ref": "#/definitions/JsonValue" },
        "rpcId": { "$ref": "#/definitions/JsonValue" },
        "method": { "$ref": "#/definitions/JsonValue" },
        "toolName": { "$ref": "#/definitions/JsonValue" },
        "toolCallId": { "$ref": "#/definitions/JsonValue" },
        "requestId": { "$ref": "#/definitions/JsonValue" },
        "durationMs": { "$ref": "#/definitions/JsonValue" },
        "inputSize": { "$ref": "#/definitions/JsonValue" },
        "outputSize": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "httpStatus": { "type": "number" },
        "retryHint": { "type": "string" },
        "reason": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "ModelBaselineEstimateData": {
      "type": "object",
      "properties": {
        "estimated": { "type": "boolean", "const": true },
        "baselineModel": { "type": "string" },
        "aic": { "type": "number", "description": "Sum over priced main-agent requests; absent when no request could be priced." },
        "mainRequests": { "type": "integer", "minimum": 0 },
        "pricedRequests": { "type": "integer", "minimum": 0 },
        "unpricedRequests": { "type": "integer", "minimum": 0 },
        "unattributedRequests": { "type": "integer", "minimum": 0 },
        "complete": { "type": "boolean", "description": "True only when every agent-phase request was attributed and every main request was priced." }
      },
      "required": ["estimated", "mainRequests", "pricedRequests", "unpricedRequests", "unattributedRequests", "complete"],
      "additionalProperties": false,
      "description": "Collector-written repricing of main-agent requests at the baseline model; routed runs only."
    },
    "ModelConfigData": {
      "type": "object",
      "properties": {
        "routing": {
          "type": "object",
          "properties": {
            "enabled": { "type": "boolean" },
            "goal": { "type": "string" },
            "mode": { "type": "string" },
            "allowedModels": { "type": "array", "items": { "type": "string" }, "description": "Configured routing candidates as authored (exact ids or gh-aw aliases) without provider prefix; absent means the router default or unknown." },
            "candidateModels": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Effective router pool sent to AWF as provider-qualified ids or patterns: aliases expanded, narrowed by the model policy; absent when unknown or expression-valued."
            }
          },
          "required": ["enabled"],
          "additionalProperties": false,
          "description": "Configured routing policy, never the router's per-run selection."
        },
        "models": {
          "type": "object",
          "properties": { "allowed": { "type": "array", "items": { "type": "string" } }, "blocked": { "type": "array", "items": { "type": "string" } } },
          "required": ["allowed", "blocked"],
          "additionalProperties": false,
          "description": "Configured model allow/block policy; empty lists mean no restriction was configured."
        },
        "maxAiCredits": { "type": "integer", "description": "Effective per-run AI credit budget.", "minimum": 1, "maximum": 2147483647 },
        "maxAiCreditsSource": { "type": "string", "enum": ["frontmatter", "default", "admission"], "description": "Provenance of the budget: compiled frontmatter, the repository default, or the admission allowance." },
        "baselineModel": { "type": "string", "description": "Concrete main model the run would use without routing, after alias resolution." }
      },
      "required": ["routing"],
      "additionalProperties": false,
      "description": "Runner-written configured model policy; absent fields are unknown, not false, empty or zero."
    },
    "ModelEndpointMismatchData": {
      "type": "object",
      "properties": {
        "category": { "type": "string", "const": "model_endpoint_mismatch" },
        "phase": { "type": "string", "enum": ["startup", "runtime"] },
        "configured_model": { "type": "string" },
        "resolved_model": { "type": "string" },
        "wire_api": { "type": "string" },
        "wire_api_source": { "type": "string" },
        "supported_endpoints": { "type": "array", "items": { "type": "string" } },
        "detail": { "type": "string" },
        "fix": { "type": "string" },
        "model": { "type": "string" },
        "endpoint": { "type": "string" }
      },
      "required": ["category", "phase", "configured_model", "resolved_model", "wire_api", "wire_api_source", "supported_endpoints", "detail", "fix"],
      "additionalProperties": false
    },
    "ModelInventoryData": {
      "type": "object",
      "properties": {
        "endpoints": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "provider": { "type": "string" },
              "configured": { "type": "boolean", "description": "AWF's endpoint configuration state; absent when the source did not supply it." },
              "models": { "type": "array", "items": { "type": "string" }, "description": "Advertised model IDs in source order; absent means unknown, not empty." },
              "routingModels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "modelId": { "type": "string" },
                    "supportedEndpoints": { "type": "array", "items": { "type": "string" } },
                    "supportedReasoningEfforts": { "type": "array", "items": { "type": "string" }, "description": "Identifier-shaped reasoning efforts; absent means unknown; a supplied empty array stays empty." },
                    "contextWindowTokens": { "type": "integer", "description": "Positive context window size in tokens; absent means unknown.", "minimum": 1, "maximum": 9007199254740991 }
                  },
                  "required": ["modelId"],
                  "additionalProperties": false
                },
                "description": "Routing metadata in source order; absent means unknown, not empty."
              }
            },
            "required": ["provider"],
            "additionalProperties": false
          }
        },
        "modelsFetchComplete": { "type": "boolean" }
      },
      "required": ["endpoints"],
      "additionalProperties": false
    },
    "ModelResolutionData": {
      "type": "object",
      "properties": {
        "engine": { "type": "string" },
        "role": { "type": "string" },
        "configured_model": { "type": "string" },
        "resolved_model": { "type": ["string", "null"] },
        "provider": { "type": ["string", "null"] },
        "status": { "type": "string", "enum": ["resolved", "exact", "failed"] },
        "cause": { "type": ["string", "null"], "enum": ["model_unavailable", "catalog_unavailable", "unsupported_endpoint", null] }
      },
      "required": ["engine", "role", "configured_model", "resolved_model", "provider", "status", "cause"],
      "additionalProperties": false
    },
    "ModelRoutingData": {
      "type": "object",
      "properties": {
        "schema": { "$ref": "#/definitions/JsonValue" },
        "stage": { "$ref": "#/definitions/JsonValue" },
        "purpose": { "$ref": "#/definitions/JsonValue" },
        "attempt": { "$ref": "#/definitions/JsonValue" },
        "classifier_model": { "$ref": "#/definitions/JsonValue" },
        "classifier_attempts": { "$ref": "#/definitions/JsonValue" },
        "classifierModel": { "$ref": "#/definitions/JsonValue" },
        "classifierEffort": { "$ref": "#/definitions/JsonValue" },
        "objective": { "$ref": "#/definitions/JsonValue" },
        "provider": { "$ref": "#/definitions/JsonValue" },
        "labels": { "$ref": "#/definitions/JsonValue" },
        "mode": { "$ref": "#/definitions/JsonValue" },
        "degradedClassification": { "$ref": "#/definitions/JsonValue" },
        "degradedReason": { "$ref": "#/definitions/JsonValue" },
        "selectedId": { "$ref": "#/definitions/JsonValue" },
        "selectedProvider": { "$ref": "#/definitions/JsonValue" },
        "routed": { "$ref": "#/definitions/JsonValue" },
        "outcome": { "$ref": "#/definitions/JsonValue" },
        "selected_model": { "$ref": "#/definitions/JsonValue" },
        "selected_effort": { "$ref": "#/definitions/JsonValue" },
        "selectedModel": { "$ref": "#/definitions/JsonValue" },
        "selectedEffort": { "$ref": "#/definitions/JsonValue" },
        "wireModel": { "$ref": "#/definitions/JsonValue" },
        "endpoint": { "$ref": "#/definitions/JsonValue" },
        "router": { "$ref": "#/definitions/JsonValue" },
        "latencyMs": { "$ref": "#/definitions/JsonValue" },
        "code": { "$ref": "#/definitions/JsonValue" },
        "requestId": { "$ref": "#/definitions/JsonValue" },
        "request_id": { "$ref": "#/definitions/JsonValue" },
        "classifierAttempts": { "$ref": "#/definitions/JsonValue" },
        "deviations": { "$ref": "#/definitions/JsonValue" },
        "requestedModel": { "$ref": "#/definitions/JsonValue" },
        "requestedEffort": { "$ref": "#/definitions/JsonValue" },
        "rankedChoices": { "type": "array", "items": { "$ref": "#/definitions/ModelRoutingRankedChoice" }, "description": "AWF route choices in rank order; ranks are one-based array positions." },
        "eligibleChoices": { "$ref": "#/definitions/JsonValue" },
        "catalogueOverlap": { "$ref": "#/definitions/JsonValue" },
        "selectedEndpoint": { "$ref": "#/definitions/JsonValue" },
        "requestedEndpoint": { "$ref": "#/definitions/JsonValue" },
        "upstreamEndpoint": { "$ref": "#/definitions/JsonValue" },
        "unavailable": { "type": "array", "items": { "type": "string" }, "description": "Request-telemetry dimensions AWF did not observe, such as `model` and `effort`; not unavailable models." },
        "status": { "$ref": "#/definitions/JsonValue", "description": "Observed HTTP status, independent of `outcome`." },
        "phase": { "$ref": "#/definitions/JsonValue", "description": "AWF failure phase, such as `primary` or `bootstrap`; not the collection provenance phase." },
        "errorCode": { "type": "string", "description": "Identifier-only provider or AWF error code on failed request records; absent means unknown." },
        "errorType": { "type": "string", "description": "Identifier-only provider or AWF error type on failed request records; absent means unknown." },
        "errorSource": { "type": "string", "enum": ["upstream", "awf"], "description": "Whether a failed request was rejected by the upstream provider or by AWF; absent means unknown." }
      },
      "additionalProperties": false
    },
    "ModelRoutingOutcomeData": {
      "type": "object",
      "properties": {
        "status": { "$ref": "#/definitions/JsonValue" },
        "wireModel": { "$ref": "#/definitions/JsonValue" },
        "effectiveEndpoint": { "$ref": "#/definitions/JsonValue" },
        "selectedEndpoint": { "$ref": "#/definitions/JsonValue" },
        "effort": { "$ref": "#/definitions/JsonValue" },
        "appliedEffort": { "$ref": "#/definitions/JsonValue" },
        "failureCode": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "ModelRoutingRankedChoice": {
      "type": "object",
      "properties": { "rank": { "type": "number" }, "id": { "type": "string" }, "model": { "type": "string" }, "effort": { "type": ["string", "null"] } },
      "required": ["rank"],
      "additionalProperties": false
    },
    "ModelSelectionData": {
      "type": "object",
      "properties": {
        "status": { "$ref": "#/definitions/JsonValue" },
        "configuredModel": { "$ref": "#/definitions/JsonValue" },
        "resolvedModel": { "$ref": "#/definitions/JsonValue" },
        "effectiveModel": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "Pick<MessageData,\"content\">": { "type": "object", "properties": { "content": { "$ref": "#/definitions/JsonValue" } }, "additionalProperties": false },
    "PluginInstallationData": {
      "type": "object",
      "properties": { "plugin": { "type": "string" }, "repository": { "type": "string" }, "ref": { "type": "string" }, "path": { "type": "string" }, "status": { "type": "string", "const": "installed" } },
      "required": ["plugin", "repository", "ref", "path", "status"],
      "additionalProperties": false
    },
    "Record<string,JsonValue>": { "type": "object", "additionalProperties": { "$ref": "#/definitions/JsonValue" } },
    "RuntimeObservationData": {
      "type": "object",
      "properties": {
        "event": { "$ref": "#/definitions/JsonValue" },
        "level": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" },
        "reason": { "$ref": "#/definitions/JsonValue" },
        "requestId": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false,
      "description": "Runtime observations retain supplied JSON values, including null and false."
    },
    "SafeOutputData": {
      "type": "object",
      "properties": {
        "type": { "$ref": "#/definitions/JsonValue" },
        "repo": { "$ref": "#/definitions/JsonValue" },
        "number": { "$ref": "#/definitions/JsonValue" },
        "provider": { "$ref": "#/definitions/JsonValue" },
        "identifier": { "$ref": "#/definitions/JsonValue" },
        "url": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" },
        "errorCode": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "SafeOutputErrorData": {
      "type": "object",
      "properties": {
        "type": { "$ref": "#/definitions/JsonValue" },
        "repo": { "$ref": "#/definitions/JsonValue" },
        "number": { "$ref": "#/definitions/JsonValue" },
        "provider": { "$ref": "#/definitions/JsonValue" },
        "identifier": { "$ref": "#/definitions/JsonValue" },
        "url": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "message": { "$ref": "#/definitions/JsonValue" },
        "error": { "$ref": "#/definitions/JsonValue" },
        "errorCode": { "$ref": "#/definitions/JsonValue" },
        "errors": {
          "type": "array",
          "items": { "anyOf": [{ "$ref": "#/definitions/SafeOutputData" }, { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" }, { "type": "array", "items": { "$ref": "#/definitions/JsonValue" } }] }
        }
      },
      "additionalProperties": false
    },
    "SessionCount": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "multipleOf": 1 },
    "SessionDiagnosticName": { "type": "string", "minLength": 1 },
    "SessionErrorNumber": { "type": "number", "minimum": -9007199254740991, "maximum": 9007199254740991, "multipleOf": 1 },
    "SessionExitCode": { "type": "number", "minimum": 0, "maximum": 255, "multipleOf": 1 },
    "SessionFileFormatData": { "type": "object", "properties": { "version": { "type": "number", "minimum": 1, "multipleOf": 1 } }, "required": ["version"], "additionalProperties": {} },
    "SessionMetric": { "type": "number", "minimum": 0 },
    "SessionProvenance": {
      "type": "object",
      "properties": {
        "component": { "type": "string" },
        "phase": { "type": "string" },
        "path": { "type": "string" },
        "index": { "$ref": "#/definitions/SessionCount", "description": "Position in the source's normalized event array, not necessarily a raw line." },
        "timestampMs": { "type": "number", "description": "Ordering key only; numeric native timestamp units are schema-dependent." },
        "native": { "description": "Preserves a source event's preexisting provenance field." }
      },
      "required": ["component", "phase", "path", "index"],
      "additionalProperties": false,
      "description": "Collector metadata is separate from native engine event metadata."
    },
    "SkillConflictData": {
      "type": "object",
      "properties": { "name": { "type": "string" }, "kind": { "type": "string", "enum": ["name_collision", "scope_collision"] }, "sources": { "type": "array", "items": { "type": "string" } } },
      "required": ["name", "kind", "sources"],
      "additionalProperties": false
    },
    "SkillInventoryData": {
      "type": "object",
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": { "name": { "type": "string" }, "source": { "type": "string" }, "scope": { "type": "string" }, "digest": { "type": "string" }, "purpose": { "type": "string" } },
            "required": ["name", "source", "scope", "digest"],
            "additionalProperties": false
          }
        }
      },
      "required": ["skills"],
      "additionalProperties": false
    },
    "SkillInvokedData": {
      "type": "object",
      "properties": {
        "name": { "$ref": "#/definitions/JsonValue" },
        "path": { "$ref": "#/definitions/JsonValue" },
        "source": { "$ref": "#/definitions/JsonValue" },
        "trigger": { "$ref": "#/definitions/JsonValue" },
        "model": { "$ref": "#/definitions/JsonValue" },
        "invokedAtTurn": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "SteeringNotice": {
      "type": "object",
      "properties": { "type": { "type": "string", "enum": ["ai_credit", "timeout", "token"] }, "threshold": { "type": "number", "enum": [80, 90, 95, 99] } },
      "required": ["type", "threshold"],
      "additionalProperties": false,
      "description": "AWF steering notice delivered on a model request."
    },
    "UnifiedMessageData": {
      "type": "object",
      "properties": {
        "content": { "$ref": "#/definitions/JsonValue" },
        "sourceEngine": { "type": "string" },
        "delta": { "$ref": "#/definitions/JsonValue" },
        "partial": { "$ref": "#/definitions/JsonValue" },
        "messageId": { "$ref": "#/definitions/JsonValue" },
        "contentIndex": { "$ref": "#/definitions/JsonValue" },
        "channel": { "$ref": "#/definitions/JsonValue" },
        "sessionId": { "$ref": "#/definitions/JsonValue" },
        "agentId": { "$ref": "#/definitions/JsonValue" },
        "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
        "model": { "$ref": "#/definitions/JsonValue" },
        "apiCallId": { "$ref": "#/definitions/JsonValue" },
        "interactionId": { "$ref": "#/definitions/JsonValue" },
        "turnId": { "$ref": "#/definitions/JsonValue" },
        "parentToolCallId": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "UnifiedModelRoutingData": {
      "type": "object",
      "properties": {
        "status": { "$ref": "#/definitions/JsonValue" },
        "source": { "$ref": "#/definitions/JsonValue" },
        "provider": { "$ref": "#/definitions/JsonValue" },
        "wireModel": { "$ref": "#/definitions/JsonValue" },
        "model": { "$ref": "#/definitions/JsonValue" },
        "effort": { "$ref": "#/definitions/JsonValue" },
        "appliedEffort": { "$ref": "#/definitions/JsonValue" },
        "effectiveEndpoint": { "$ref": "#/definitions/JsonValue" },
        "selectedEndpoint": { "$ref": "#/definitions/JsonValue" },
        "mode": { "$ref": "#/definitions/JsonValue" },
        "selectedId": { "$ref": "#/definitions/JsonValue" },
        "routerVersion": { "$ref": "#/definitions/JsonValue" },
        "failureCode": { "$ref": "#/definitions/JsonValue" }
      },
      "additionalProperties": false
    },
    "UnifiedSessionResultData": {
      "type": "object",
      "properties": {
        "sourceEngine": { "type": "string" },
        "numTurns": { "$ref": "#/definitions/SessionCount" },
        "durationMs": { "$ref": "#/definitions/SessionMetric" },
        "totalCostUsd": { "$ref": "#/definitions/SessionMetric" },
        "status": { "type": "string" },
        "sourceType": { "type": "string" },
        "errors": { "type": "array", "items": { "$ref": "#/definitions/JsonValue" } },
        "permissionDenials": { "type": "array", "items": { "$ref": "#/definitions/JsonValue" } },
        "agentMetrics": { "$ref": "#/definitions/JsonValue", "description": "Exact per-agent accounting snapshot supplied by the engine, not additive usage." },
        "sessionId": { "$ref": "#/definitions/JsonValue" },
        "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
        "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
        "agentId": { "$ref": "#/definitions/JsonValue" },
        "usage": { "anyOf": [{ "$ref": "#/definitions/UnifiedSessionUsage" }, { "type": "null" }] }
      },
      "additionalProperties": false
    },
    "UnifiedSessionUsage": {
      "type": "object",
      "properties": {
        "totalTokens": { "$ref": "#/definitions/SessionCount" },
        "inputTokens": { "$ref": "#/definitions/SessionCount" },
        "outputTokens": { "$ref": "#/definitions/SessionCount" },
        "reasoningOutputTokens": { "$ref": "#/definitions/SessionCount" },
        "cacheReadInputTokens": { "$ref": "#/definitions/SessionCount" },
        "cacheCreationInputTokens": { "$ref": "#/definitions/SessionCount" },
        "inputTokensIncludeCache": { "type": "boolean" },
        "overflowedTokens": { "type": "array", "items": { "type": "string" } }
      },
      "additionalProperties": false,
      "description": "Essential accounting projection; parser traces retain their snake_case usage."
    },
    "UsageReportData": {
      "type": "object",
      "properties": {
        "sessionId": { "$ref": "#/definitions/JsonValue" },
        "parentToolUseId": { "$ref": "#/definitions/JsonValue" },
        "parentToolCallId": { "$ref": "#/definitions/JsonValue" },
        "agentId": { "$ref": "#/definitions/JsonValue" },
        "stepIndex": { "$ref": "#/definitions/SessionCount" },
        "provider": { "$ref": "#/definitions/JsonValue" },
        "model": { "$ref": "#/definitions/JsonValue" },
        "purpose": { "$ref": "#/definitions/JsonValue" },
        "agentName": { "$ref": "#/definitions/JsonValue", "description": "AWF caller declaration: declared sub-agent name for `purpose: subagent`; absent for the main agent and AWF-owned traffic." },
        "callerSource": { "$ref": "#/definitions/JsonValue", "description": "Origin of `purpose`: `awf` for AWF-owned traffic, `caller_header` for an `x-awf-caller` declaration." },
        "path": { "$ref": "#/definitions/JsonValue" },
        "xInitiator": { "$ref": "#/definitions/JsonValue" },
        "requestId": { "$ref": "#/definitions/JsonValue" },
        "status": { "$ref": "#/definitions/JsonValue" },
        "aic": { "$ref": "#/definitions/JsonValue" },
        "totalAic": { "$ref": "#/definitions/JsonValue" },
        "premiumRequests": { "$ref": "#/definitions/JsonValue" },
        "durationMs": { "$ref": "#/definitions/JsonValue" },
        "steering": { "$ref": "#/definitions/SteeringNotice" },
        "usage": { "anyOf": [{ "$ref": "#/definitions/UnifiedSessionUsage" }, { "type": "null" }] }
      },
      "additionalProperties": false
    },
    "WorkflowInfoData": {
      "type": "object",
      "properties": {
        "engineId": { "$ref": "#/definitions/JsonValue" },
        "engineHarness": { "type": "string", "enum": ["copilot-cli", "copilot-sdk"], "description": "Compiled Copilot harness; absent means unknown, never inferred from engineId." },
        "agentVersion": { "$ref": "#/definitions/JsonValue" },
        "cliVersion": { "$ref": "#/definitions/JsonValue" },
        "awfVersion": { "$ref": "#/definitions/JsonValue" },
        "mcpgVersion": { "$ref": "#/definitions/JsonValue" },
        "model": { "$ref": "#/definitions/JsonValue" },
        "requestedModel": { "$ref": "#/definitions/JsonValue" },
        "modelRouting": { "$ref": "#/definitions/UnifiedModelRoutingData" },
        "modelSelection": { "$ref": "#/definitions/ModelSelectionData" },
        "triggerType": { "$ref": "#/definitions/JsonValue" },
        "dryRun": { "$ref": "#/definitions/JsonValue" },
        "workflow": { "$ref": "#/definitions/JsonValue" },
        "workflowId": { "$ref": "#/definitions/JsonValue", "description": "Executing workflow reference supplied by the compiler from job.workflow_ref." },
        "workflowRef": { "$ref": "#/definitions/JsonValue", "description": "Executing workflow reference (job.workflow_ref); same value as workflowId." },
        "workflowCallId": { "$ref": "#/definitions/JsonValue", "description": "Current workflow invocation ID from aw_info, separate from the caller's ID." },
        "callerWorkflowRef": { "$ref": "#/definitions/JsonValue", "description": "GITHUB_WORKFLOW_REF; identifies the top-level caller in reusable workflows." },
        "repository": { "$ref": "#/definitions/JsonValue" },
        "runId": { "$ref": "#/definitions/JsonValue" },
        "runAttempt": { "$ref": "#/definitions/JsonValue" },
        "serverUrl": { "$ref": "#/definitions/JsonValue", "description": "GitHub server origin, such as https://github.com." },
        "ref": { "$ref": "#/definitions/JsonValue" },
        "sha": { "$ref": "#/definitions/JsonValue" },
        "actor": { "$ref": "#/definitions/JsonValue" },
        "targetRepo": { "$ref": "#/definitions/JsonValue" },
        "awContext": { "$ref": "#/definitions/Record%3Cstring%2CJsonValue%3E" },
        "episode": { "anyOf": [{ "$ref": "#/definitions/EpisodeLineageData" }, { "type": "null" }] }
      },
      "additionalProperties": false
    },
    "WorkflowJobResultData": {
      "type": "object",
      "properties": { "jobId": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$" }, "result": { "type": "string", "enum": ["success", "failure", "cancelled", "skipped"] }, "durationMs": { "$ref": "#/definitions/SessionCount" } },
      "required": ["jobId", "result"],
      "additionalProperties": false,
      "description": "Conclusion's dependency snapshot, not the still-running conclusion job."
    }
  }
}
