{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.checkfu.com/harness-oneshot-v1-author-kit.schema.json",
  "title": "Checkfu oneshot-v1 author-kit golden vectors",
  "description": "Closed schema for the versioned authoring and process-exchange vectors consumed by the reference one-shot wrapper.",
  "type": "object",
  "properties": {
    "schema_id": {
      "type": "string",
      "enum": [
        "https://docs.checkfu.com/harness-oneshot-v1-author-kit.schema.json"
      ]
    },
    "revision": {
      "type": "string",
      "enum": [
        "checkfu:oneshot-v1-author-kit-vectors@1"
      ]
    },
    "protocol": {
      "type": "string",
      "enum": [
        "oneshot-v1"
      ]
    },
    "driver_version": {
      "type": "string",
      "enum": [
        "checkfu:oneshot-v1@1"
      ]
    },
    "vectors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OneShotAuthorKitVectorContract"
      }
    }
  },
  "required": [
    "schema_id",
    "revision",
    "protocol",
    "driver_version",
    "vectors"
  ],
  "additionalProperties": false,
  "$defs": {
    "OciImageReference": {
      "type": "string"
    },
    "HarnessConfigurationSchemaObject": {
      "type": "object",
      "additionalProperties": {
        "description": "A value in the JSON data model: null, boolean, finite number, string, array, or object.",
        "allOf": [
          {
            "x-checkfu-json-budget": {
              "maximumBytes": 65536,
              "maximumDepth": 32,
              "maximumNodes": 4000,
              "maximumInspectionWork": 4000
            }
          }
        ]
      },
      "allOf": [
        {
          "x-checkfu-json-budget": {
            "maximumBytes": 65536,
            "maximumDepth": 32,
            "maximumNodes": 4000,
            "maximumInspectionWork": 4000
          }
        },
        {
          "maxProperties": 4000,
          "description": "harness configuration schema of at most 64 KiB, depth 32, and 4,000 nodes"
        }
      ]
    },
    "HarnessProcessArgumentUtf8Bytes": {
      "type": "string",
      "allOf": [
        {
          "maxLength": 65536
        },
        {
          "pattern": "^[^\\u0000]*$",
          "description": "Exact process argument text, preserving whitespace; U+0000 is forbidden and UTF-8 encoding is limited to 65536 bytes"
        }
      ]
    },
    "OneShotArgvPlaceholders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HarnessProcessArgumentUtf8Bytes"
      },
      "allOf": [
        {
          "maxItems": 256,
          "description": "At most 256 exact process arguments and 131072 aggregate UTF-8 bytes including one terminator per argument"
        }
      ]
    },
    "CreateOneShotHarnessReleaseContract": {
      "type": "object",
      "properties": {
        "image": {
          "$ref": "#/$defs/OciImageReference"
        },
        "entrypoint": {
          "type": "string",
          "allOf": [
            {
              "maxLength": 4096
            },
            {
              "pattern": "^\\/(?!\\.{1,2}(?:\\/|$))[A-Za-z0-9._-]+(?:\\/(?!\\.{1,2}(?:\\/|$))[A-Za-z0-9._-]+)*$"
            }
          ]
        },
        "working_directory": {
          "anyOf": [
            {
              "type": "string",
              "allOf": [
                {
                  "maxLength": 4096
                },
                {
                  "pattern": "^\\/(?!\\.{1,2}(?:\\/|$))[A-Za-z0-9._-]+(?:\\/(?!\\.{1,2}(?:\\/|$))[A-Za-z0-9._-]+)*$"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "platform": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "os": {
                  "type": "string",
                  "enum": [
                    "linux"
                  ]
                },
                "architecture": {
                  "type": "string",
                  "enum": [
                    "amd64",
                    "arm64"
                  ]
                }
              },
              "required": [
                "os",
                "architecture"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "configuration_schema": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "$ref": "#/$defs/HarnessConfigurationSchemaObject"
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "model_wire_dialects": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "anthropic_messages",
                  "openai_chat",
                  "openai_responses",
                  "fal_queue"
                ]
              },
              "allOf": [
                {
                  "minItems": 1
                },
                {
                  "maxItems": 4
                },
                {
                  "uniqueItems": true
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "protocol": {
          "type": "string",
          "enum": [
            "oneshot-v1"
          ]
        },
        "arguments": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "null"
            }
          ]
        },
        "mcp_delivery": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "null"
            }
          ]
        },
        "argv": {
          "$ref": "#/$defs/OneShotArgvPlaceholders"
        },
        "prompt_transport": {
          "type": "string",
          "enum": [
            "stdin",
            "argv_path"
          ]
        },
        "output_mode": {
          "type": "string",
          "enum": [
            "stream_json",
            "text"
          ]
        },
        "resume_flag": {
          "anyOf": [
            {
              "type": "string",
              "allOf": [
                {
                  "maxLength": 65536
                },
                {
                  "pattern": "^[^\\u0000]*$",
                  "description": "Exact process argument text, preserving whitespace; U+0000 is forbidden and UTF-8 encoding is limited to 65536 bytes"
                },
                {
                  "minLength": 1
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "output_schema_flag": {
          "anyOf": [
            {
              "type": "string",
              "allOf": [
                {
                  "maxLength": 65536
                },
                {
                  "pattern": "^[^\\u0000]*$",
                  "description": "Exact process argument text, preserving whitespace; U+0000 is forbidden and UTF-8 encoding is limited to 65536 bytes"
                },
                {
                  "minLength": 1
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "output_schema_transport": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "argv_json",
                "argv_path"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "image",
        "entrypoint",
        "protocol",
        "argv",
        "prompt_transport",
        "output_mode"
      ],
      "additionalProperties": false
    },
    "HarnessProcessArgumentVectorUtf8Bytes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HarnessProcessArgumentUtf8Bytes"
      },
      "allOf": [
        {
          "maxItems": 256,
          "description": "At most 256 exact process arguments and 131072 aggregate UTF-8 bytes including one terminator per argument"
        }
      ]
    },
    "Objects_": {
      "type": "object",
      "properties": {
        "schema_version": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "turn": {
          "type": "integer",
          "allOf": [
            {
              "exclusiveMinimum": 0
            }
          ]
        },
        "last_response": {
          "type": "string"
        }
      },
      "required": [
        "schema_version",
        "turn",
        "last_response"
      ],
      "additionalProperties": false
    },
    "SandboxLifecycleHookOutput": {
      "type": "string",
      "allOf": [
        {
          "maxLength": 8192
        }
      ]
    },
    "RunnerObservationContent": {
      "type": "string",
      "allOf": [
        {
          "maxLength": 262144
        }
      ]
    },
    "EventId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^evt_[0-9a-f]{32}$"
        }
      ]
    },
    "SubagentId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^subg_[0-9a-f]{32}$"
        }
      ]
    },
    "Union_": {
      "anyOf": [
        {
          "$ref": "#/$defs/SubagentId"
        },
        {
          "type": "null"
        }
      ]
    },
    "JsonValue": {
      "description": "A value in the JSON data model: null, boolean, finite number, string, array, or object."
    },
    "ProviderToolName": {
      "type": "string",
      "allOf": [
        {
          "minLength": 1
        },
        {
          "maxLength": 256
        }
      ]
    },
    "RunnerObservationError": {
      "type": "string",
      "allOf": [
        {
          "maxLength": 4096
        }
      ]
    },
    "Objects_1": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "validation.malformed",
            "validation.prompt_integrity_review_required",
            "validation.not_found",
            "validation.conflict",
            "validation.idempotency_conflict",
            "validation.idempotency_in_progress",
            "validation.payload_too_large",
            "validation.range_too_large",
            "auth.invalid_key",
            "auth.disabled_tenancy",
            "policy.denied",
            "budget.exceeded",
            "model.no_eligible_model",
            "model.credential_rejected",
            "model.platform_supply_unavailable",
            "model.platform_capacity_reached",
            "billing.entitlement_unavailable",
            "billing.usage_limit_reached",
            "billing.payment_required",
            "billing.seat_activation_unavailable",
            "memory.not_found",
            "memory.conflict",
            "memory.read_only",
            "memory.invalid_path",
            "memory.backend_unavailable",
            "memory.curation_failed",
            "runtime.invalid_transition",
            "runtime.primary_thread",
            "runtime.checkpoint_expired",
            "runtime.session_history_unavailable",
            "runtime.harness_unavailable",
            "runtime.harness_failed",
            "runtime.runner_unavailable",
            "runtime.lease_lost",
            "runtime.start_timeout",
            "runtime.provisioning_suspended",
            "runtime.turn_deadline_exceeded",
            "runtime.observation_gap",
            "runtime.observation_conflict",
            "runtime.attestation_invalid",
            "runtime.harness_incompatible",
            "runtime.internal"
          ]
        },
        "message": {
          "$ref": "#/$defs/RunnerObservationError"
        }
      },
      "required": [
        "type",
        "message"
      ],
      "additionalProperties": false
    },
    "ObservationToolResultPayload": {
      "type": "object",
      "properties": {
        "tool_use_id": {
          "type": "string",
          "allOf": [
            {
              "minLength": 1
            },
            {
              "maxLength": 256
            }
          ]
        },
        "result": {
          "anyOf": [
            {
              "$ref": "#/$defs/JsonValue"
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "$ref": "#/$defs/Objects_1"
        },
        "subagent": {
          "$ref": "#/$defs/Union_"
        }
      },
      "required": [
        "tool_use_id"
      ],
      "additionalProperties": false
    },
    "RunnerFileChangePath": {
      "type": "string",
      "allOf": [
        {
          "minLength": 1
        },
        {
          "maxLength": 4096
        }
      ]
    },
    "RunnerSubagentDescription": {
      "type": "string",
      "allOf": [
        {
          "maxLength": 4096
        }
      ]
    },
    "NonBrowserActionApprovalId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^approval_[0-9a-f]{32}$"
        }
      ]
    },
    "WorkspaceId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^wrkspc_[0-9a-f]{32}$"
        }
      ]
    },
    "SessionId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^sess_[0-9a-f]{32}$"
        }
      ]
    },
    "RunId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^run_[0-9a-f]{32}$"
        }
      ]
    },
    "AgentId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^agent_[0-9a-f]{32}$"
        }
      ]
    },
    "AgentInstallationId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^aini_[0-9a-f]{32}$"
        }
      ]
    },
    "SurfaceScopeId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^surf_[0-9a-f]{32}$"
        }
      ]
    },
    "PrincipalId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^prin_[0-9a-f]{32}$"
        }
      ]
    },
    "AutomationId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^auto_[0-9a-f]{32}$"
        }
      ]
    },
    "GatewayCallId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^call_[0-9a-f]{32}$"
        }
      ]
    },
    "ConnectionId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^conn_[0-9a-f]{32}$"
        }
      ]
    },
    "ToolSourceId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^ts_[0-9a-f]{32}$"
        }
      ]
    },
    "PublicHostname": {
      "type": "string",
      "allOf": [
        {
          "minLength": 1
        },
        {
          "maxLength": 253
        },
        {
          "pattern": "^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$"
        }
      ]
    },
    "HttpMethod": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "HEAD",
        "OPTIONS"
      ]
    },
    "HttpPath": {
      "type": "string",
      "allOf": [
        {
          "minLength": 1
        },
        {
          "maxLength": 8192
        }
      ]
    },
    "BoundedQuery": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "allOf": [
          {
            "maxLength": 8192
          }
        ]
      },
      "allOf": [
        {
          "propertyNames": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 512
              }
            ]
          }
        }
      ]
    },
    "BoundedHeaders": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "allOf": [
          {
            "maxLength": 8192
          },
          {
            "pattern": "^[^\\r\\n]*$"
          }
        ]
      },
      "allOf": [
        {
          "propertyNames": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 128
              },
              {
                "pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"
              }
            ]
          }
        }
      ]
    },
    "RunnerGatewayActionApprovalRequiredAction": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "action_approval"
          ]
        },
        "approval": {
          "$ref": "#/$defs/NonBrowserActionApprovalId"
        },
        "tool_use_id": {
          "type": "string",
          "allOf": [
            {
              "minLength": 1
            },
            {
              "maxLength": 256
            }
          ]
        },
        "frozen_context": {
          "type": "object",
          "properties": {
            "workspace_id": {
              "$ref": "#/$defs/WorkspaceId"
            },
            "session_id": {
              "$ref": "#/$defs/SessionId"
            },
            "run_id": {
              "$ref": "#/$defs/RunId"
            },
            "agent_definition_id": {
              "$ref": "#/$defs/AgentId"
            },
            "agent_version": {
              "type": "integer",
              "allOf": [
                {
                  "exclusiveMinimum": 0
                }
              ]
            },
            "agent_installation_id": {
              "$ref": "#/$defs/AgentInstallationId"
            },
            "surface_scope_id": {
              "$ref": "#/$defs/SurfaceScopeId"
            },
            "surface_scope_kind": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "root",
                    "team",
                    "channel",
                    "personal"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "requested_by": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "principal"
                      ]
                    },
                    "principal": {
                      "$ref": "#/$defs/PrincipalId"
                    }
                  },
                  "required": [
                    "kind",
                    "principal"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "automation"
                      ]
                    },
                    "automation": {
                      "$ref": "#/$defs/AutomationId"
                    }
                  },
                  "required": [
                    "kind",
                    "automation"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "system"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 512
                        }
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "name"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "acted_as": {
              "$ref": "#/$defs/PrincipalId"
            },
            "call_id": {
              "$ref": "#/$defs/GatewayCallId"
            },
            "connection_id": {
              "$ref": "#/$defs/ConnectionId"
            },
            "connection_version": {
              "type": "integer",
              "allOf": [
                {
                  "exclusiveMinimum": 0
                }
              ]
            },
            "tool_source_id": {
              "$ref": "#/$defs/ToolSourceId"
            },
            "tool_name": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^[a-z0-9](?:[a-z0-9._-]{0,93})$"
                }
              ]
            },
            "tool_version": {
              "type": "integer",
              "allOf": [
                {
                  "exclusiveMinimum": 0
                }
              ]
            },
            "tool_schema_hash": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^sha256:[0-9a-f]{64}$"
                }
              ]
            },
            "engine": {
              "type": "string",
              "enum": [
                "builtin",
                "executor",
                "connector"
              ]
            },
            "arguments_hash": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^sha256:[0-9a-f]{64}$"
                }
              ]
            },
            "request": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "scheme": {
                      "type": "string",
                      "enum": [
                        "https"
                      ]
                    },
                    "host": {
                      "$ref": "#/$defs/PublicHostname"
                    },
                    "port": {
                      "type": "integer",
                      "allOf": [
                        {
                          "minimum": 1,
                          "maximum": 65535
                        }
                      ]
                    },
                    "method": {
                      "$ref": "#/$defs/HttpMethod"
                    },
                    "path": {
                      "$ref": "#/$defs/HttpPath"
                    },
                    "query": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/BoundedQuery"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "headers": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/BoundedHeaders"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "body": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/JsonValue"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "scheme",
                    "host",
                    "port",
                    "method",
                    "path"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "workspace_id",
            "session_id",
            "run_id",
            "agent_definition_id",
            "agent_version",
            "agent_installation_id",
            "surface_scope_id",
            "requested_by",
            "acted_as",
            "call_id",
            "connection_id",
            "connection_version",
            "tool_source_id",
            "tool_name",
            "tool_version",
            "tool_schema_hash",
            "engine",
            "arguments_hash",
            "request"
          ],
          "additionalProperties": false
        },
        "on_approve": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "custom_tool"
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "kind",
        "approval",
        "tool_use_id",
        "frozen_context"
      ],
      "additionalProperties": false
    },
    "QuestionId": {
      "type": "string",
      "allOf": [
        {
          "pattern": "^qst_[0-9a-f]{32}$"
        }
      ]
    },
    "ManagedQuestionItems": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 64
              },
              {
                "pattern": "^[A-Za-z0-9_-]+$"
              }
            ]
          },
          "prompt": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 4096
              }
            ]
          },
          "header": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 4096
              }
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "allOf": [
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 4096
                    }
                  ]
                },
                "description": {
                  "type": "string",
                  "allOf": [
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 4096
                    }
                  ]
                }
              },
              "required": [
                "label"
              ],
              "additionalProperties": false
            },
            "allOf": [
              {
                "maxItems": 32
              }
            ]
          },
          "allow_multiple": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "prompt",
          "options",
          "allow_multiple"
        ],
        "additionalProperties": false
      },
      "allOf": [
        {
          "minItems": 1
        },
        {
          "maxItems": 4
        }
      ]
    },
    "OneShotAuthorKitVectorContract": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "stdin-text",
            "argv-path-stream-json-resume-schema"
          ]
        },
        "authoring": {
          "$ref": "#/$defs/CreateOneShotHarnessReleaseContract"
        },
        "exchange": {
          "type": "object",
          "properties": {
            "prompt": {
              "type": "string"
            },
            "argv": {
              "$ref": "#/$defs/HarnessProcessArgumentVectorUtf8Bytes"
            },
            "stdin": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "staged_files": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "content"
                ],
                "additionalProperties": false
              }
            },
            "output_schema": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "object"
                      ]
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "answer": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "answer"
                      ],
                      "additionalProperties": false
                    },
                    "required": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "answer"
                        ]
                      }
                    },
                    "additionalProperties": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "properties",
                    "required",
                    "additionalProperties"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "prior_state": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Objects_"
                },
                {
                  "type": "null"
                }
              ]
            },
            "resulting_state": {
              "$ref": "#/$defs/Objects_"
            },
            "stdout": {
              "type": "string"
            }
          },
          "required": [
            "prompt",
            "argv",
            "stdin",
            "staged_files",
            "output_schema",
            "prior_state",
            "resulting_state",
            "stdout"
          ],
          "additionalProperties": false
        },
        "normalized_observations": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.ready"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "capability_set": {
                        "type": "object",
                        "properties": {
                          "event_fidelity": {
                            "type": "string",
                            "enum": [
                              "native",
                              "structured",
                              "text_only",
                              "minimal"
                            ]
                          },
                          "continuation": {
                            "type": "string",
                            "enum": [
                              "in_flight",
                              "next_turn",
                              "rebuild_only"
                            ]
                          },
                          "checkpoint": {
                            "type": "string",
                            "enum": [
                              "process_and_disk",
                              "disk_only",
                              "conversation_only",
                              "none"
                            ]
                          },
                          "approval_delivery": {
                            "type": "string",
                            "enum": [
                              "park",
                              "snapshot_release",
                              "end_reinject",
                              "unsupported"
                            ]
                          },
                          "interrupt": {
                            "type": "string",
                            "enum": [
                              "cooperative",
                              "kill_only"
                            ]
                          },
                          "mid_run_input": {
                            "type": "string",
                            "enum": [
                              "native",
                              "turn_boundary_only",
                              "unsupported"
                            ]
                          },
                          "model_control": {
                            "type": "string",
                            "enum": [
                              "platform_enforced",
                              "compatible",
                              "opaque",
                              "harness_owned"
                            ]
                          },
                          "usage_authority": {
                            "type": "string",
                            "enum": [
                              "platform_observed",
                              "harness_reported",
                              "unknown"
                            ]
                          },
                          "multiagent_shared_environment": {
                            "type": "boolean"
                          },
                          "subagents": {
                            "type": "string",
                            "enum": [
                              "observed",
                              "flatten"
                            ]
                          }
                        },
                        "required": [
                          "event_fidelity",
                          "continuation",
                          "checkpoint",
                          "approval_delivery",
                          "interrupt",
                          "mid_run_input",
                          "model_control",
                          "usage_authority",
                          "multiagent_shared_environment"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "capability_set"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.lifecycle_hook"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "phase": {
                        "type": "string",
                        "enum": [
                          "post_materialize",
                          "pre_writeback"
                        ]
                      },
                      "ordinal": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          },
                          {
                            "exclusiveMaximum": 16
                          }
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "passed",
                          "failed",
                          "timed_out",
                          "slot_unavailable",
                          "skipped"
                        ]
                      },
                      "on_failure": {
                        "type": "string",
                        "enum": [
                          "abort",
                          "continue"
                        ]
                      },
                      "exit_code": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "allOf": [
                              {
                                "minimum": 0,
                                "maximum": 255
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "duration_ms": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          },
                          {
                            "maximum": 3600000
                          }
                        ]
                      },
                      "output": {
                        "$ref": "#/$defs/SandboxLifecycleHookOutput"
                      },
                      "output_truncated": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "phase",
                      "ordinal",
                      "outcome",
                      "on_failure",
                      "exit_code",
                      "duration_ms",
                      "output",
                      "output_truncated"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.agent_message"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "content": {
                        "$ref": "#/$defs/RunnerObservationContent"
                      },
                      "event_id": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/EventId"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "subagent": {
                        "$ref": "#/$defs/Union_"
                      }
                    },
                    "required": [
                      "content"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.agent_thinking"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "content": {
                        "$ref": "#/$defs/RunnerObservationContent"
                      },
                      "event_id": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/EventId"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "subagent": {
                        "$ref": "#/$defs/Union_"
                      }
                    },
                    "required": [
                      "content"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.tool_use"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "tool_use_id": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          },
                          {
                            "maxLength": 256
                          }
                        ]
                      },
                      "tool": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^conn_[0-9a-f]{32}:\\S+$"
                              }
                            ]
                          },
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^harness:\\S+$"
                              }
                            ]
                          }
                        ]
                      },
                      "args": {
                        "$ref": "#/$defs/JsonValue"
                      },
                      "provider_tool_name": {
                        "$ref": "#/$defs/ProviderToolName"
                      },
                      "subagent": {
                        "$ref": "#/$defs/Union_"
                      }
                    },
                    "required": [
                      "tool_use_id",
                      "tool",
                      "args"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.tool_result"
                    ]
                  },
                  "payload": {
                    "$ref": "#/$defs/ObservationToolResultPayload"
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.file_changed"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "event": {
                        "type": "string",
                        "enum": [
                          "create",
                          "delete",
                          "modify"
                        ]
                      },
                      "path": {
                        "$ref": "#/$defs/RunnerFileChangePath"
                      }
                    },
                    "required": [
                      "event",
                      "path"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.context_compacted"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "strategy": {
                        "type": "string",
                        "enum": [
                          "native"
                        ]
                      },
                      "tokens_before": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      },
                      "tokens_after": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      },
                      "compacted_messages": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      }
                    },
                    "required": [
                      "strategy",
                      "tokens_before",
                      "tokens_after"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.subagent_started"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "subagent": {
                        "$ref": "#/$defs/SubagentId"
                      },
                      "name": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          },
                          {
                            "maxLength": 256
                          }
                        ]
                      },
                      "description": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/RunnerSubagentDescription"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "subagent",
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.subagent_completed"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "subagent": {
                        "$ref": "#/$defs/SubagentId"
                      },
                      "disposition": {
                        "type": "string",
                        "enum": [
                          "completed",
                          "failed",
                          "canceled"
                        ]
                      }
                    },
                    "required": [
                      "subagent",
                      "disposition"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.steering"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "event_id": {
                        "$ref": "#/$defs/EventId"
                      },
                      "disposition": {
                        "type": "string",
                        "enum": [
                          "delivered",
                          "queued",
                          "refused"
                        ]
                      }
                    },
                    "required": [
                      "event_id",
                      "disposition"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.requires_action"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "action": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "custom_tool"
                                ]
                              },
                              "tool_use_id": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "minLength": 1
                                  },
                                  {
                                    "maxLength": 256
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "tool_use_id"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "$ref": "#/$defs/RunnerGatewayActionApprovalRequiredAction"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "question"
                                ]
                              },
                              "question": {
                                "$ref": "#/$defs/QuestionId"
                              },
                              "items": {
                                "$ref": "#/$defs/ManagedQuestionItems"
                              }
                            },
                            "required": [
                              "kind",
                              "question",
                              "items"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "action"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.finished"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "stop_reason": {
                        "type": "string",
                        "enum": [
                          "end_turn",
                          "interrupted",
                          "max_tokens",
                          "max_turn_requests",
                          "refusal"
                        ]
                      },
                      "vendor_reported_cost_microusd": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "allOf": [
                              {
                                "minimum": 0
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "turn": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "execution": {
                                "type": "string",
                                "enum": [
                                  "shell",
                                  "model_only"
                                ]
                              },
                              "shell_commands": {
                                "type": "integer",
                                "allOf": [
                                  {
                                    "minimum": 0
                                  },
                                  {
                                    "maximum": 1000000
                                  }
                                ]
                              },
                              "filesystem_commands": {
                                "type": "integer",
                                "allOf": [
                                  {
                                    "minimum": 0
                                  },
                                  {
                                    "maximum": 1000000
                                  }
                                ]
                              },
                              "mcp_calls": {
                                "type": "integer",
                                "allOf": [
                                  {
                                    "minimum": 0
                                  },
                                  {
                                    "maximum": 1000000
                                  }
                                ]
                              },
                              "model_calls": {
                                "type": "integer",
                                "allOf": [
                                  {
                                    "minimum": 0
                                  },
                                  {
                                    "maximum": 1000000
                                  }
                                ]
                              },
                              "wall_time_ms": {
                                "type": "integer",
                                "allOf": [
                                  {
                                    "minimum": 0
                                  },
                                  {
                                    "maximum": 604800000
                                  }
                                ]
                              },
                              "model_transient_retries": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "allOf": [
                                      {
                                        "minimum": 0
                                      },
                                      {
                                        "maximum": 1000000
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "model_overflow_recoveries": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "allOf": [
                                      {
                                        "minimum": 0
                                      },
                                      {
                                        "maximum": 1000000
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "execution",
                              "shell_commands",
                              "filesystem_commands",
                              "mcp_calls",
                              "model_calls",
                              "wall_time_ms"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "stop_reason"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.retryable_failure"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "error": {
                        "$ref": "#/$defs/Objects_1"
                      }
                    },
                    "required": [
                      "error"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "observation.failed"
                    ]
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "error": {
                        "$ref": "#/$defs/Objects_1"
                      }
                    },
                    "required": [
                      "error"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "payload"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "name",
        "authoring",
        "exchange",
        "normalized_observations"
      ],
      "additionalProperties": false
    }
  }
}
