{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/evalgate-com/json-schema/evalgate-com-post-api-agent-evidence-ingest-request-schema.json",
  "title": "PostApiAgentEvidenceIngestRequest",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/evalgate-com-openapi.json#/components/schemas/PostApiAgentEvidenceIngestRequest",
  "type": "object",
  "properties": {
    "source": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "webhook"
          ]
        },
        {
          "type": "string",
          "enum": [
            "api"
          ]
        },
        {
          "type": "string",
          "enum": [
            "cli"
          ]
        },
        {
          "type": "string",
          "enum": [
            "mcp"
          ]
        },
        {
          "type": "string",
          "enum": [
            "browser"
          ]
        },
        {
          "type": "string",
          "enum": [
            "sdk"
          ]
        },
        {
          "type": "string",
          "enum": [
            "otel"
          ]
        },
        {
          "type": "string",
          "enum": [
            "saas"
          ]
        },
        {
          "type": "string",
          "enum": [
            "mcp_proxy"
          ]
        },
        {
          "type": "string",
          "enum": [
            "import"
          ]
        },
        {
          "type": "string",
          "enum": [
            "openapi"
          ]
        }
      ]
    },
    "organizationId": {
      "$ref": "#/$defs/OrganizationId"
    },
    "schemaVersion": {
      "type": "number",
      "enum": [
        1
      ]
    },
    "workspaceId": {
      "type": "number"
    },
    "branchId": {
      "type": "number"
    },
    "environment": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "production"
          ]
        },
        {
          "type": "string",
          "enum": [
            "local"
          ]
        },
        {
          "type": "string",
          "enum": [
            "ci"
          ]
        },
        {
          "type": "string",
          "enum": [
            "staging"
          ]
        }
      ]
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "contentHash": {
            "type": "string"
          },
          "subjectType": {
            "type": "string"
          },
          "evaluationId": {
            "type": "number"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/JsonValue"
            }
          },
          "aiSystemId": {
            "type": "number"
          },
          "confidence": {
            "type": "number"
          },
          "runtimeId": {
            "type": "number"
          },
          "runtimeVersionId": {
            "type": "number"
          },
          "connectorId": {
            "type": "number"
          },
          "connectorManifestSnapshotId": {
            "type": "number"
          },
          "traceId": {
            "type": "number"
          },
          "score": {
            "type": "number"
          },
          "spanId": {
            "type": "number"
          },
          "evaluationRunId": {
            "type": "number"
          },
          "redactionState": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "redacted"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "hash_only"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "plain"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "tokenized"
                ]
              }
            ]
          },
          "rawEventId": {
            "type": "number"
          },
          "workflowRunId": {
            "type": "number"
          },
          "testResultId": {
            "type": "number"
          },
          "preview": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/JsonValue"
            }
          },
          "toolInvocationEvidenceId": {
            "type": "number"
          },
          "sideEffectLedgerId": {
            "type": "number"
          },
          "policyDecisionId": {
            "type": "number"
          },
          "evidenceKey": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "storageUri": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "source",
          "kind",
          "contentHash",
          "subjectType"
        ]
      }
    },
    "occurredAt": {
      "type": "string"
    },
    "eventId": {
      "type": "string"
    },
    "idempotencyKey": {
      "type": "string"
    },
    "policyDecision": {
      "type": "object",
      "properties": {
        "decision": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "warn"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "deny"
              ]
            },
            {
              "type": "string",
              "enum": [
                "denied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allowed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantine"
              ]
            },
            {
              "type": "string",
              "enum": [
                "downgrade_to_read_only"
              ]
            },
            {
              "type": "string",
              "enum": [
                "shadow_only"
              ]
            }
          ]
        },
        "question": {
          "type": "string"
        },
        "policyVersion": {
          "type": "string"
        },
        "reasonCode": {
          "type": "string"
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "permissionProfileId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "runtimeVersionId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "connectorManifestSnapshotId": {
          "type": "number"
        },
        "input": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "inputHash": {
          "type": "string"
        },
        "rawEventId": {
          "type": "number"
        },
        "toolInvocationEvidenceId": {
          "type": "number"
        },
        "sideEffectLedgerId": {
          "type": "number"
        },
        "decisionKey": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "decidedAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "decision",
        "question",
        "policyVersion"
      ]
    },
    "cohort": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "fleetId": {
          "type": "number"
        },
        "cohortKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "definition": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "rollup": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "lastComputedAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "fleetId",
        "cohortKey"
      ]
    },
    "connector": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "connectorKey": {
          "type": "string"
        },
        "connectorType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "webhook"
              ]
            },
            {
              "type": "string",
              "enum": [
                "api"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cli"
              ]
            },
            {
              "type": "string",
              "enum": [
                "mcp"
              ]
            },
            {
              "type": "string",
              "enum": [
                "browser"
              ]
            },
            {
              "type": "string",
              "enum": [
                "saas"
              ]
            }
          ]
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "dataClasses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "riskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "aiSystemId": {
          "type": "number"
        },
        "provider": {
          "type": "string"
        },
        "manifestHash": {
          "type": "string"
        },
        "allowedActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "blockedActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "capabilities": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "providerKeyId": {
          "type": "number"
        },
        "openApiSpecHash": {
          "type": "string"
        },
        "inputSchema": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "outputSchema": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "sideEffectPolicy": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "authScopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "requiresHumanApproval": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "connectorKey",
        "connectorType"
      ]
    },
    "runtime": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "runtimeKey": {
          "type": "string"
        },
        "runtimeType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "custom"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cli"
              ]
            },
            {
              "type": "string",
              "enum": [
                "mcp_host"
              ]
            },
            {
              "type": "string",
              "enum": [
                "saas_agent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "sdk"
              ]
            },
            {
              "type": "string",
              "enum": [
                "workflow_engine"
              ]
            },
            {
              "type": "string",
              "enum": [
                "browser_agent"
              ]
            }
          ]
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "configHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "version": {
          "type": "string"
        },
        "riskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "aiSystemId": {
          "type": "number"
        },
        "environment": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "production"
              ]
            },
            {
              "type": "string",
              "enum": [
                "local"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ci"
              ]
            },
            {
              "type": "string",
              "enum": [
                "staging"
              ]
            }
          ]
        },
        "vendor": {
          "type": "string"
        },
        "permissionProfileId": {
          "type": "string"
        },
        "capabilities": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "config": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "instrumentation": {
          "allOf": [
            {
              "type": "object",
              "properties": {
                "mode": {
                  "oneOf": [
                    {
                      "type": "string",
                      "enum": [
                        "manual"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "webhook"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "sdk"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "cli_wrapper"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "otel"
                      ]
                    }
                  ]
                },
                "sideEffectLedger": {
                  "oneOf": [
                    {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  ]
                },
                "otel": {
                  "oneOf": [
                    {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  ]
                },
                "stdoutCapture": {
                  "oneOf": [
                    {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  ]
                },
                "fileDiffCapture": {
                  "oneOf": [
                    {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/JsonValue"
              }
            }
          ]
        },
        "transport": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "module"
                  ]
                },
                "entrypoint": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "entrypoint"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "http"
                  ]
                },
                "url": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "url"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "command"
                  ]
                },
                "command": {
                  "type": "string"
                },
                "args": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "command"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "mcp"
                  ]
                },
                "server": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "server"
              ]
            }
          ]
        },
        "toolConnectors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "runtimeKey",
        "runtimeType"
      ]
    },
    "incident": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "trigger": {
          "type": "string"
        },
        "incidentKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "open"
              ]
            },
            {
              "type": "string",
              "enum": [
                "resolved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "investigating"
              ]
            },
            {
              "type": "string",
              "enum": [
                "mitigated"
              ]
            }
          ]
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "resolvedAt": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "policyDecisionIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "quarantineStateId": {
          "type": "number"
        },
        "openedAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "title",
        "trigger",
        "incidentKey"
      ]
    },
    "approval": {
      "type": "object",
      "properties": {
        "approvalKey": {
          "type": "string"
        },
        "reviewerId": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "toolInvocationEvidenceId": {
          "type": "number"
        },
        "sideEffectLedgerId": {
          "type": "number"
        },
        "reason": {
          "type": "string"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "decidedAt": {
          "type": "string"
        },
        "policyDecisionId": {
          "type": "number"
        },
        "requestedBy": {
          "type": "string"
        },
        "state": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "pending"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rejected"
              ]
            },
            {
              "type": "string",
              "enum": [
                "approved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "expired"
              ]
            }
          ]
        },
        "simulationRunId": {
          "type": "number"
        },
        "requestedAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "approvalKey"
      ]
    },
    "trace": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/JsonValue"
      }
    },
    "workspace": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "workspaceKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "dataClasses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "defaultEnvironment": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "production"
              ]
            },
            {
              "type": "string",
              "enum": [
                "local"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ci"
              ]
            },
            {
              "type": "string",
              "enum": [
                "staging"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "workspaceKey"
      ]
    },
    "requirement": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "requirementKey": {
          "type": "string"
        },
        "requirementText": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "abandoned"
              ]
            },
            {
              "type": "string",
              "enum": [
                "approved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready_for_review"
              ]
            },
            {
              "type": "string",
              "enum": [
                "merged"
              ]
            }
          ]
        },
        "owner": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "version": {
          "type": "number"
        },
        "riskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "approvedBy": {
          "type": "string"
        },
        "mergedAt": {
          "type": "string"
        },
        "supersededBy": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "state": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "approved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "retired"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready_for_review"
              ]
            },
            {
              "type": "string",
              "enum": [
                "production_satisfied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failing"
              ]
            },
            {
              "type": "string",
              "enum": [
                "stale_evidence"
              ]
            }
          ]
        },
        "coverage": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "autonomyLevel": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "assistive"
              ]
            },
            {
              "type": "string",
              "enum": [
                "supervised"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bounded_auto"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high_auto"
              ]
            },
            {
              "type": "string",
              "enum": [
                "fully_auto"
              ]
            }
          ]
        },
        "requirementType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "policy"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_use"
              ]
            },
            {
              "type": "string",
              "enum": [
                "safety"
              ]
            },
            {
              "type": "string",
              "enum": [
                "agent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "behavior"
              ]
            },
            {
              "type": "string",
              "enum": [
                "business_kpi"
              ]
            },
            {
              "type": "string",
              "enum": [
                "orchestration"
              ]
            },
            {
              "type": "string",
              "enum": [
                "monitor"
              ]
            }
          ]
        },
        "acceptanceCriteria": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "evalProgramIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "policyGateIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "monitorIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "businessMetrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "qualityCaseId": {
          "type": "number"
        }
      },
      "additionalProperties": false,
      "required": [
        "title",
        "requirementKey",
        "requirementText"
      ]
    },
    "evidenceGraphEdges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sourceType": {
            "type": "string"
          },
          "sourceId": {
            "type": "string"
          },
          "targetType": {
            "type": "string"
          },
          "relation": {
            "type": "string"
          },
          "targetId": {
            "type": "string"
          },
          "evaluationId": {
            "type": "number"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/JsonValue"
            }
          },
          "payloadHash": {
            "type": "string"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/$defs/JsonValue"
            }
          },
          "traceId": {
            "type": "number"
          },
          "spanId": {
            "type": "number"
          },
          "evaluationRunId": {
            "type": "number"
          },
          "testResultId": {
            "type": "number"
          },
          "primitiveStepRunId": {
            "type": "number"
          },
          "graphKey": {
            "type": "string"
          },
          "evalExplanationId": {
            "type": "number"
          },
          "evidenceStrength": {
            "type": "number"
          }
        },
        "additionalProperties": false,
        "required": [
          "sourceType",
          "sourceId",
          "targetType",
          "relation",
          "targetId"
        ]
      }
    },
    "quarantine": {
      "type": "object",
      "properties": {
        "trigger": {
          "type": "string"
        },
        "targetType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "connector"
              ]
            },
            {
              "type": "string",
              "enum": [
                "runtime"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ai_system"
              ]
            }
          ]
        },
        "targetId": {
          "type": "string"
        },
        "quarantineKey": {
          "type": "string"
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "startedAt": {
          "type": "string"
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "reason": {
          "type": "string"
        },
        "policyDecisionId": {
          "type": "number"
        },
        "state": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "resolved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "dismissed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "watch"
              ]
            }
          ]
        },
        "triggerPayload": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "readOnlyAllowed": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "endedAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "trigger",
        "targetType",
        "targetId",
        "quarantineKey"
      ]
    },
    "fleet": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "fleetKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "budget": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "version": {
          "type": "number"
        },
        "riskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "approvedBy": {
          "type": "string"
        },
        "mergedAt": {
          "type": "string"
        },
        "supersededBy": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "environment": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "production"
              ]
            },
            {
              "type": "string",
              "enum": [
                "local"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ci"
              ]
            },
            {
              "type": "string",
              "enum": [
                "staging"
              ]
            }
          ]
        },
        "permissionProfileId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "autonomyLevel": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "assistive"
              ]
            },
            {
              "type": "string",
              "enum": [
                "supervised"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bounded_auto"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high_auto"
              ]
            },
            {
              "type": "string",
              "enum": [
                "fully_auto"
              ]
            }
          ]
        },
        "dynamicCohortQuery": {
          "type": "string"
        },
        "runtimeIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "connectorIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "rollup": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "fleetKey"
      ]
    },
    "qualityCase": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "caseKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "restricted"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "expired"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready"
              ]
            }
          ]
        },
        "aiSystemId": {
          "type": "number"
        },
        "confidence": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "approvals": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "supportingEvidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "knownRisks": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "restrictions": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "nextReviewAt": {
          "type": "string"
        },
        "report": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "title",
        "caseKey"
      ]
    },
    "branch": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "branchKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "abandoned"
              ]
            },
            {
              "type": "string",
              "enum": [
                "approved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready_for_review"
              ]
            },
            {
              "type": "string",
              "enum": [
                "merged"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "baseBranchId": {
          "type": "number"
        },
        "version": {
          "type": "number"
        },
        "riskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "snapshotHash": {
          "type": "string"
        },
        "snapshot": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "approvedBy": {
          "type": "string"
        },
        "mergedAt": {
          "type": "string"
        },
        "supersededBy": {
          "type": "number"
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "branchKey"
      ]
    },
    "aiSystem": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "systemKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "version": {
          "type": "number"
        },
        "approvedBy": {
          "type": "string"
        },
        "mergedAt": {
          "type": "string"
        },
        "supersededBy": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "domain": {
          "type": "string"
        },
        "businessGoal": {
          "type": "string"
        },
        "criticality": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "systemKey"
      ]
    },
    "agentTemplate": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "templateKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "configHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "version": {
          "type": "number"
        },
        "riskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "approvedBy": {
          "type": "string"
        },
        "mergedAt": {
          "type": "string"
        },
        "supersededBy": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "permissionProfileId": {
          "type": "number"
        },
        "config": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "runtimeId": {
          "type": "number"
        },
        "promptHash": {
          "type": "string"
        },
        "autonomyLevel": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "assistive"
              ]
            },
            {
              "type": "string",
              "enum": [
                "supervised"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bounded_auto"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high_auto"
              ]
            },
            {
              "type": "string",
              "enum": [
                "fully_auto"
              ]
            }
          ]
        },
        "connectorIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "fleetId": {
          "type": "number"
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "templateKey"
      ]
    },
    "agentInstance": {
      "type": "object",
      "properties": {
        "instanceKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "observed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantined"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "attested"
              ]
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "identity": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "configHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "environment": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "production"
              ]
            },
            {
              "type": "string",
              "enum": [
                "local"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ci"
              ]
            },
            {
              "type": "string",
              "enum": [
                "staging"
              ]
            }
          ]
        },
        "permissionProfileId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "promptHash": {
          "type": "string"
        },
        "gitSha": {
          "type": "string"
        },
        "identityHash": {
          "type": "string"
        },
        "lastSeenAt": {
          "type": "string"
        },
        "templateId": {
          "type": "number"
        },
        "fleetId": {
          "type": "number"
        },
        "executableHash": {
          "type": "string"
        },
        "containerImageHash": {
          "type": "string"
        },
        "attestation": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "instanceKey"
      ]
    },
    "runtimeVersion": {
      "type": "object",
      "properties": {
        "configHash": {
          "type": "string"
        },
        "versionKey": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "version": {
          "type": "string"
        },
        "aiSystemId": {
          "type": "number"
        },
        "environment": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "production"
              ]
            },
            {
              "type": "string",
              "enum": [
                "local"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ci"
              ]
            },
            {
              "type": "string",
              "enum": [
                "staging"
              ]
            }
          ]
        },
        "runtimeId": {
          "type": "number"
        },
        "promptHash": {
          "type": "string"
        },
        "modelProvider": {
          "type": "string"
        },
        "modelName": {
          "type": "string"
        },
        "dependencySnapshot": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "configSnapshot": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "isCurrent": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "configHash",
        "versionKey"
      ]
    },
    "connectorManifest": {
      "type": "object",
      "properties": {
        "manifestHash": {
          "type": "string"
        },
        "snapshotKey": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "isCurrent": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "authScopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "connectorId": {
          "type": "number"
        },
        "schemaHash": {
          "type": "string"
        },
        "manifestVersion": {
          "type": "string"
        },
        "toolCount": {
          "type": "number"
        },
        "resourceCount": {
          "type": "number"
        },
        "toolSchemas": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "resources": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "readinessStatus": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantined"
              ]
            },
            {
              "type": "string",
              "enum": [
                "restricted"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready"
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "manifestHash",
        "snapshotKey"
      ]
    },
    "permissionProfile": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "profileKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            {
              "type": "string",
              "enum": [
                "disabled"
              ]
            },
            {
              "type": "string",
              "enum": [
                "archived"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "environment": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "production"
              ]
            },
            {
              "type": "string",
              "enum": [
                "local"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ci"
              ]
            },
            {
              "type": "string",
              "enum": [
                "staging"
              ]
            }
          ]
        },
        "policyVersion": {
          "type": "string"
        },
        "allowedRuntimeKeys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "allowedConnectorKeys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "allowedActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "blockedActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "humanApprovalRequiredFor": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "allowedSideEffectClasses": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "unknown"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "draft"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "none"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "read"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "write"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "delete"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "classify"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "recommend"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "update_record"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "external_send"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "code_change"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "deployment_change"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "permission_change"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "money_movement"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "legal_commitment"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "customer_contact"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "safety_critical_action"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "clinical_or_safety_relevant_action"
                ]
              }
            ]
          }
        },
        "maxRiskTier": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "rules": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "profileKey"
      ]
    },
    "orchestrationEvent": {
      "type": "object",
      "properties": {
        "payloadHash": {
          "type": "string"
        },
        "eventType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "approval_requested"
              ]
            },
            {
              "type": "string",
              "enum": [
                "handoff"
              ]
            },
            {
              "type": "string",
              "enum": [
                "workflow_started"
              ]
            },
            {
              "type": "string",
              "enum": [
                "node_started"
              ]
            },
            {
              "type": "string",
              "enum": [
                "node_completed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "branch_decision"
              ]
            },
            {
              "type": "string",
              "enum": [
                "routing_decision"
              ]
            },
            {
              "type": "string",
              "enum": [
                "retry_decision"
              ]
            },
            {
              "type": "string",
              "enum": [
                "escalation_decision"
              ]
            },
            {
              "type": "string",
              "enum": [
                "approval_completed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_invoked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "side_effect_planned"
              ]
            },
            {
              "type": "string",
              "enum": [
                "side_effect_committed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "compensation_started"
              ]
            },
            {
              "type": "string",
              "enum": [
                "compensation_completed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "workflow_completed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "workflow_failed"
              ]
            }
          ]
        },
        "eventKey": {
          "type": "string"
        },
        "orchestrationKey": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "occurredAt": {
          "type": "string"
        },
        "payload": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "rawEventId": {
          "type": "number"
        },
        "workflowRunId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "sideEffectLedgerIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "requirementId": {
          "type": "number"
        },
        "fleetId": {
          "type": "number"
        },
        "agentInstanceId": {
          "type": "number"
        },
        "agentTemplateId": {
          "type": "number"
        },
        "definitionVersion": {
          "type": "string"
        },
        "graphHash": {
          "type": "string"
        },
        "stateHash": {
          "type": "string"
        },
        "checkpointHash": {
          "type": "string"
        },
        "parentEventKey": {
          "type": "string"
        },
        "policyDecisionIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "payloadHash",
        "eventType",
        "eventKey",
        "orchestrationKey"
      ]
    },
    "credentialGrant": {
      "type": "object",
      "properties": {
        "expiresAt": {
          "type": "string"
        },
        "credentialHash": {
          "type": "string"
        },
        "grantKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "quarantined"
              ]
            },
            {
              "type": "string",
              "enum": [
                "refused"
              ]
            },
            {
              "type": "string",
              "enum": [
                "revoked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "expired"
              ]
            },
            {
              "type": "string",
              "enum": [
                "issued"
              ]
            }
          ]
        },
        "mode": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "observed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "controlled"
              ]
            }
          ]
        },
        "revokedAt": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "scope": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "permissionProfileId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "policyDecisionId": {
          "type": "number"
        },
        "tokenHash": {
          "type": "string"
        },
        "revokedBy": {
          "type": "string"
        },
        "issuedAt": {
          "type": "string"
        },
        "revocationReason": {
          "type": "string"
        },
        "fleetId": {
          "type": "number"
        },
        "agentInstanceId": {
          "type": "number"
        },
        "issuedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "expiresAt",
        "credentialHash",
        "grantKey"
      ]
    },
    "span": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/JsonValue"
      }
    },
    "rawEvent": {
      "type": "object",
      "properties": {
        "eventType": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "payload": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "payloadHash": {
          "type": "string"
        },
        "runtimeId": {
          "type": "number"
        },
        "runtimeVersionId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "connectorManifestSnapshotId": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "idempotencyKey": {
          "type": "string"
        },
        "redactionState": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "redacted"
              ]
            },
            {
              "type": "string",
              "enum": [
                "hash_only"
              ]
            },
            {
              "type": "string",
              "enum": [
                "plain"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tokenized"
              ]
            }
          ]
        },
        "retentionExpiresAt": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "eventType"
      ]
    },
    "primitiveChain": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "chainKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "planned"
              ]
            },
            {
              "type": "string",
              "enum": [
                "running"
              ]
            },
            {
              "type": "string",
              "enum": [
                "success"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failure"
              ]
            },
            {
              "type": "string",
              "enum": [
                "skipped"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "coverage": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "requirementId": {
          "type": "number"
        },
        "orchestrationKey": {
          "type": "string"
        },
        "graphHash": {
          "type": "string"
        },
        "orchestrationId": {
          "type": "number"
        },
        "graph": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "primitiveTypes": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "intake_intent_classification"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "planning_task_decomposition"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "retrieval_search"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "reranking_selection"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "context_assembly_memory"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "routing_agent_model_selection"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "tool_selection"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "tool_argument_construction"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "orchestration_state_control_flow"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "verification_critique_judging"
                ]
              },
              {
                "type": "string",
                "enum": [
                  "side_effect_commit_rollback"
                ]
              }
            ]
          }
        },
        "gateSummary": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "chainKey"
      ]
    },
    "primitiveStep": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "primitiveType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "intake_intent_classification"
              ]
            },
            {
              "type": "string",
              "enum": [
                "planning_task_decomposition"
              ]
            },
            {
              "type": "string",
              "enum": [
                "retrieval_search"
              ]
            },
            {
              "type": "string",
              "enum": [
                "reranking_selection"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_assembly_memory"
              ]
            },
            {
              "type": "string",
              "enum": [
                "routing_agent_model_selection"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_selection"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_argument_construction"
              ]
            },
            {
              "type": "string",
              "enum": [
                "orchestration_state_control_flow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_critique_judging"
              ]
            },
            {
              "type": "string",
              "enum": [
                "side_effect_commit_rollback"
              ]
            }
          ]
        },
        "configHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "branchId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "inputSchema": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "outputSchema": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "requirementId": {
          "type": "number"
        },
        "orchestrationId": {
          "type": "number"
        },
        "primitiveChainId": {
          "type": "number"
        },
        "stepKey": {
          "type": "string"
        },
        "policyRefs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "evalRefs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "monitorRefs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "primitiveType"
      ]
    },
    "primitiveStepRun": {
      "type": "object",
      "properties": {
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "planned"
              ]
            },
            {
              "type": "string",
              "enum": [
                "running"
              ]
            },
            {
              "type": "string",
              "enum": [
                "success"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failure"
              ]
            },
            {
              "type": "string",
              "enum": [
                "skipped"
              ]
            }
          ]
        },
        "configHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "startedAt": {
          "type": "string"
        },
        "completedAt": {
          "type": "string"
        },
        "traceId": {
          "type": "number"
        },
        "score": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "inputHash": {
          "type": "string"
        },
        "latencyMs": {
          "type": "number"
        },
        "failureMode": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "invalid_arguments"
              ]
            },
            {
              "type": "string",
              "enum": [
                "policy_violation"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_intent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_plan"
              ]
            },
            {
              "type": "string",
              "enum": [
                "missing_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "stale_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_rerank"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_pollution"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_omission"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_route"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_tool"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unsafe_tool_call"
              ]
            },
            {
              "type": "string",
              "enum": [
                "branch_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "state_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_miss"
              ]
            },
            {
              "type": "string",
              "enum": [
                "hallucinated_answer"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unauthorized_side_effect"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed_rollback"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cost_regression"
              ]
            },
            {
              "type": "string",
              "enum": [
                "latency_regression"
              ]
            }
          ]
        },
        "costUsd": {
          "type": "string"
        },
        "outputHash": {
          "type": "string"
        },
        "runId": {
          "type": "string"
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "primitiveStepId": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "retrievalRun": {
      "type": "object",
      "properties": {
        "queryHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "latencyMs": {
          "type": "number"
        },
        "costUsd": {
          "type": "string"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "corpusRefs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "candidateCount": {
          "type": "number"
        },
        "selectedCount": {
          "type": "number"
        },
        "candidatesJsonRedacted": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "selectedSourceHashes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "permissionDecision": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "warn"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "deny"
              ]
            },
            {
              "type": "string",
              "enum": [
                "denied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allowed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantine"
              ]
            },
            {
              "type": "string",
              "enum": [
                "downgrade_to_read_only"
              ]
            },
            {
              "type": "string",
              "enum": [
                "shadow_only"
              ]
            }
          ]
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "queryHash"
      ]
    },
    "rerankRun": {
      "type": "object",
      "properties": {
        "queryHash": {
          "type": "string"
        },
        "finalOrderHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "latencyMs": {
          "type": "number"
        },
        "costUsd": {
          "type": "string"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "candidateCount": {
          "type": "number"
        },
        "selectedCount": {
          "type": "number"
        },
        "candidatesJsonRedacted": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "retrievalRunId": {
          "type": "number"
        },
        "rerankerProvider": {
          "type": "string"
        },
        "rerankerModel": {
          "type": "string"
        },
        "rerankerConfigHash": {
          "type": "string"
        },
        "scoresJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "labelsAvailable": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "queryHash",
        "finalOrderHash"
      ]
    },
    "contextAssembly": {
      "type": "object",
      "properties": {
        "contextHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "tokenCount": {
          "type": "number"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "sourceChunkIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sourceHashes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "droppedSources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "includedSources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sensitiveDataFlags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "staleSourceFlags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "instructionHierarchyHash": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "contextHash"
      ]
    },
    "planningRun": {
      "type": "object",
      "properties": {
        "planHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "subtasksJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "dependencyGraphHash": {
          "type": "string"
        },
        "stopConditionsHash": {
          "type": "string"
        },
        "successCriteriaHash": {
          "type": "string"
        },
        "unsafePlannedActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "missingApprovalSteps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "planHash"
      ]
    },
    "routingDecision": {
      "type": "object",
      "properties": {
        "decisionHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "confidence": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "routeType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "human"
              ]
            },
            {
              "type": "string",
              "enum": [
                "workflow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "model"
              ]
            },
            {
              "type": "string",
              "enum": [
                "agent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_group"
              ]
            },
            {
              "type": "string",
              "enum": [
                "fleet"
              ]
            }
          ]
        },
        "selectedRuntimeId": {
          "type": "number"
        },
        "selectedFleetId": {
          "type": "number"
        },
        "selectedAgentInstanceId": {
          "type": "number"
        },
        "candidateRoutesJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "fallbackUsed": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "decisionHash"
      ]
    },
    "toolSelectionDecision": {
      "type": "object",
      "properties": {
        "decisionHash": {
          "type": "string"
        },
        "selectedTool": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "connectorId": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "policyDecisionId": {
          "type": "number"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "selectedConnectorKey": {
          "type": "string"
        },
        "candidateToolsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "rejectedTools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "selectionReason": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "decisionHash",
        "selectedTool"
      ]
    },
    "toolArgumentBuild": {
      "type": "object",
      "properties": {
        "payloadHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "schemaHash": {
          "type": "string"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "toolInvocationEvidenceId": {
          "type": "number"
        },
        "requirementId": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "payloadJsonRedacted": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "schemaValid": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "requiredFieldsComplete": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "invalidPayloadRate": {
          "type": "number"
        },
        "overbroadQuery": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "injectionVulnerability": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "sensitiveDataMisuse": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "payloadHash"
      ]
    },
    "verificationRun": {
      "type": "object",
      "properties": {
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "traceId": {
          "type": "number"
        },
        "score": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "inputHash": {
          "type": "string"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "outputHash": {
          "type": "string"
        },
        "requirementId": {
          "type": "number"
        },
        "verdict": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "pass"
              ]
            },
            {
              "type": "string",
              "enum": [
                "warn"
              ]
            },
            {
              "type": "string",
              "enum": [
                "fail"
              ]
            }
          ]
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "verificationType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "deterministic_assertion"
              ]
            },
            {
              "type": "string",
              "enum": [
                "human_review"
              ]
            },
            {
              "type": "string",
              "enum": [
                "llm_judge"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rule"
              ]
            },
            {
              "type": "string",
              "enum": [
                "business_rule"
              ]
            }
          ]
        },
        "verifierModel": {
          "type": "string"
        },
        "verifierConfigHash": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "primitiveEvalResult": {
      "type": "object",
      "properties": {
        "metricName": {
          "type": "string"
        },
        "evalType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "retrieval_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "reranking_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_assembly_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "routing_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_selection_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_argument_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "planning_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_eval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "side_effect_eval"
              ]
            }
          ]
        },
        "evaluationId": {
          "type": "number"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "score": {
          "type": "number"
        },
        "evaluationRunId": {
          "type": "number"
        },
        "passed": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "testResultId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "threshold": {
          "type": "number"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "metricsJson": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "metricName",
        "evalType"
      ]
    },
    "primitiveFailureMode": {
      "type": "object",
      "properties": {
        "failureMode": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "invalid_arguments"
              ]
            },
            {
              "type": "string",
              "enum": [
                "policy_violation"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_intent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_plan"
              ]
            },
            {
              "type": "string",
              "enum": [
                "missing_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "stale_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_rerank"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_pollution"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_omission"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_route"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_tool"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unsafe_tool_call"
              ]
            },
            {
              "type": "string",
              "enum": [
                "branch_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "state_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_miss"
              ]
            },
            {
              "type": "string",
              "enum": [
                "hallucinated_answer"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unauthorized_side_effect"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed_rollback"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cost_regression"
              ]
            },
            {
              "type": "string",
              "enum": [
                "latency_regression"
              ]
            }
          ]
        },
        "failureKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "fixed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "open"
              ]
            },
            {
              "type": "string",
              "enum": [
                "accepted_risk"
              ]
            },
            {
              "type": "string",
              "enum": [
                "triaged"
              ]
            }
          ]
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "evidence": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "suggestedRegressionCase": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "failureMode",
        "failureKey"
      ]
    },
    "primitiveQualitySnapshot": {
      "type": "object",
      "properties": {
        "snapshotKey": {
          "type": "string"
        },
        "bucketStart": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "metrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "coverage": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "requirementId": {
          "type": "number"
        },
        "qualityCaseId": {
          "type": "number"
        },
        "gateSummary": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "primitiveChainId": {
          "type": "number"
        },
        "failureSummary": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "snapshotKey",
        "bucketStart"
      ]
    },
    "evalExplanation": {
      "type": "object",
      "properties": {
        "rootCauseSummary": {
          "type": "string"
        },
        "evaluationId": {
          "type": "number"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "confidence": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "evaluationRunId": {
          "type": "number"
        },
        "testResultId": {
          "type": "number"
        },
        "failureMode": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "invalid_arguments"
              ]
            },
            {
              "type": "string",
              "enum": [
                "policy_violation"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_intent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_plan"
              ]
            },
            {
              "type": "string",
              "enum": [
                "missing_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "stale_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_rerank"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_pollution"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_omission"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_route"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_tool"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unsafe_tool_call"
              ]
            },
            {
              "type": "string",
              "enum": [
                "branch_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "state_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_miss"
              ]
            },
            {
              "type": "string",
              "enum": [
                "hallucinated_answer"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unauthorized_side_effect"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed_rollback"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cost_regression"
              ]
            },
            {
              "type": "string",
              "enum": [
                "latency_regression"
              ]
            }
          ]
        },
        "evalCaseId": {
          "type": "number"
        },
        "evidenceRefs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "primitiveStepId": {
          "type": "number"
        },
        "primitiveType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "intake_intent_classification"
              ]
            },
            {
              "type": "string",
              "enum": [
                "planning_task_decomposition"
              ]
            },
            {
              "type": "string",
              "enum": [
                "retrieval_search"
              ]
            },
            {
              "type": "string",
              "enum": [
                "reranking_selection"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_assembly_memory"
              ]
            },
            {
              "type": "string",
              "enum": [
                "routing_agent_model_selection"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_selection"
              ]
            },
            {
              "type": "string",
              "enum": [
                "tool_argument_construction"
              ]
            },
            {
              "type": "string",
              "enum": [
                "orchestration_state_control_flow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_critique_judging"
              ]
            },
            {
              "type": "string",
              "enum": [
                "side_effect_commit_rollback"
              ]
            }
          ]
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "baselineComparison": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "riskLevel": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "impactEstimate": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "suggestedActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "decisionRecommendation": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "block"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rerun"
              ]
            },
            {
              "type": "string",
              "enum": [
                "monitor"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ship"
              ]
            },
            {
              "type": "string",
              "enum": [
                "escalate"
              ]
            },
            {
              "type": "string",
              "enum": [
                "accept_risk"
              ]
            }
          ]
        },
        "evalRunId": {
          "type": "number"
        }
      },
      "additionalProperties": false,
      "required": [
        "rootCauseSummary"
      ]
    },
    "failureInboxItem": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "failureMode": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "invalid_arguments"
              ]
            },
            {
              "type": "string",
              "enum": [
                "policy_violation"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_intent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_plan"
              ]
            },
            {
              "type": "string",
              "enum": [
                "missing_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "stale_retrieval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "bad_rerank"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_pollution"
              ]
            },
            {
              "type": "string",
              "enum": [
                "context_omission"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_route"
              ]
            },
            {
              "type": "string",
              "enum": [
                "wrong_tool"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unsafe_tool_call"
              ]
            },
            {
              "type": "string",
              "enum": [
                "branch_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "state_error"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verification_miss"
              ]
            },
            {
              "type": "string",
              "enum": [
                "hallucinated_answer"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unauthorized_side_effect"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed_rollback"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cost_regression"
              ]
            },
            {
              "type": "string",
              "enum": [
                "latency_regression"
              ]
            }
          ]
        },
        "failureKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "passed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            },
            {
              "type": "string",
              "enum": [
                "resolved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "accepted_risk"
              ]
            },
            {
              "type": "string",
              "enum": [
                "new"
              ]
            },
            {
              "type": "string",
              "enum": [
                "triaged"
              ]
            },
            {
              "type": "string",
              "enum": [
                "investigating"
              ]
            },
            {
              "type": "string",
              "enum": [
                "fix_proposed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rerun_needed"
              ]
            }
          ]
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "evaluationId": {
          "type": "number"
        },
        "decision": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "block"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rerun"
              ]
            },
            {
              "type": "string",
              "enum": [
                "monitor"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ship"
              ]
            },
            {
              "type": "string",
              "enum": [
                "escalate"
              ]
            },
            {
              "type": "string",
              "enum": [
                "accept_risk"
              ]
            }
          ]
        },
        "owner": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "evidence": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "traceId": {
          "type": "number"
        },
        "evaluationRunId": {
          "type": "number"
        },
        "testResultId": {
          "type": "number"
        },
        "systemName": {
          "type": "string"
        },
        "primitiveStepRunId": {
          "type": "number"
        },
        "evalExplanationId": {
          "type": "number"
        },
        "evalProgramName": {
          "type": "string"
        },
        "affectedTraces": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "suggestedFix": {
          "type": "string"
        },
        "gateImpact": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "title",
        "failureMode",
        "failureKey"
      ]
    },
    "toolInvocation": {
      "type": "object",
      "properties": {
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "success"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "denied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failure"
              ]
            }
          ]
        },
        "toolName": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "requestHash": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "startedAt": {
          "type": "string"
        },
        "completedAt": {
          "type": "string"
        },
        "runtimeKey": {
          "type": "string"
        },
        "permissionProfileId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "runtimeVersionId": {
          "type": "number"
        },
        "connectorKey": {
          "type": "string"
        },
        "sideEffectClass": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "none"
              ]
            },
            {
              "type": "string",
              "enum": [
                "read"
              ]
            },
            {
              "type": "string",
              "enum": [
                "write"
              ]
            },
            {
              "type": "string",
              "enum": [
                "delete"
              ]
            },
            {
              "type": "string",
              "enum": [
                "classify"
              ]
            },
            {
              "type": "string",
              "enum": [
                "recommend"
              ]
            },
            {
              "type": "string",
              "enum": [
                "update_record"
              ]
            },
            {
              "type": "string",
              "enum": [
                "external_send"
              ]
            },
            {
              "type": "string",
              "enum": [
                "code_change"
              ]
            },
            {
              "type": "string",
              "enum": [
                "deployment_change"
              ]
            },
            {
              "type": "string",
              "enum": [
                "permission_change"
              ]
            },
            {
              "type": "string",
              "enum": [
                "money_movement"
              ]
            },
            {
              "type": "string",
              "enum": [
                "legal_commitment"
              ]
            },
            {
              "type": "string",
              "enum": [
                "customer_contact"
              ]
            },
            {
              "type": "string",
              "enum": [
                "safety_critical_action"
              ]
            },
            {
              "type": "string",
              "enum": [
                "clinical_or_safety_relevant_action"
              ]
            }
          ]
        },
        "connectorId": {
          "type": "number"
        },
        "connectorManifestSnapshotId": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "rawEventId": {
          "type": "number"
        },
        "errorMessage": {
          "type": "string"
        },
        "workflowRunId": {
          "type": "number"
        },
        "errorCode": {
          "type": "string"
        },
        "invocationId": {
          "type": "string"
        },
        "requestPreview": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "responseHash": {
          "type": "string"
        },
        "responsePreview": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "latencyMs": {
          "type": "number"
        },
        "cost": {
          "type": "string"
        },
        "policyDecision": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "warn"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "deny"
              ]
            },
            {
              "type": "string",
              "enum": [
                "denied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allowed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantine"
              ]
            },
            {
              "type": "string",
              "enum": [
                "downgrade_to_read_only"
              ]
            },
            {
              "type": "string",
              "enum": [
                "shadow_only"
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "status",
        "toolName",
        "operation",
        "requestHash"
      ]
    },
    "sideEffect": {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string"
        },
        "actionDigest": {
          "type": "string"
        },
        "actor": {
          "type": "string"
        },
        "tool": {
          "type": "string"
        },
        "resourceType": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "observed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "applied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rolled_back"
              ]
            }
          ]
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "summary": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "occurredAt": {
          "type": "string"
        },
        "permissionProfileId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "runtimeVersionId": {
          "type": "number"
        },
        "rollbackAvailable": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "connectorId": {
          "type": "number"
        },
        "connectorManifestSnapshotId": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "idempotencyKey": {
          "type": "string"
        },
        "rawEventId": {
          "type": "number"
        },
        "workflowRunId": {
          "type": "number"
        },
        "policyDecision": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allow"
              ]
            },
            {
              "type": "string",
              "enum": [
                "warn"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "deny"
              ]
            },
            {
              "type": "string",
              "enum": [
                "denied"
              ]
            },
            {
              "type": "string",
              "enum": [
                "allowed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantine"
              ]
            },
            {
              "type": "string",
              "enum": [
                "downgrade_to_read_only"
              ]
            },
            {
              "type": "string",
              "enum": [
                "shadow_only"
              ]
            }
          ]
        },
        "toolInvocationEvidenceId": {
          "type": "number"
        },
        "effectType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unknown"
              ]
            },
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "none"
              ]
            },
            {
              "type": "string",
              "enum": [
                "read"
              ]
            },
            {
              "type": "string",
              "enum": [
                "write"
              ]
            },
            {
              "type": "string",
              "enum": [
                "delete"
              ]
            },
            {
              "type": "string",
              "enum": [
                "classify"
              ]
            },
            {
              "type": "string",
              "enum": [
                "recommend"
              ]
            },
            {
              "type": "string",
              "enum": [
                "update_record"
              ]
            },
            {
              "type": "string",
              "enum": [
                "external_send"
              ]
            },
            {
              "type": "string",
              "enum": [
                "code_change"
              ]
            },
            {
              "type": "string",
              "enum": [
                "deployment_change"
              ]
            },
            {
              "type": "string",
              "enum": [
                "permission_change"
              ]
            },
            {
              "type": "string",
              "enum": [
                "money_movement"
              ]
            },
            {
              "type": "string",
              "enum": [
                "legal_commitment"
              ]
            },
            {
              "type": "string",
              "enum": [
                "customer_contact"
              ]
            },
            {
              "type": "string",
              "enum": [
                "safety_critical_action"
              ]
            },
            {
              "type": "string",
              "enum": [
                "clinical_or_safety_relevant_action"
              ]
            }
          ]
        },
        "resourceId": {
          "type": "string"
        },
        "targetRefHash": {
          "type": "string"
        },
        "beforeSnapshotHash": {
          "type": "string"
        },
        "afterSnapshotHash": {
          "type": "string"
        },
        "diffHash": {
          "type": "string"
        },
        "approvalState": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "required"
              ]
            },
            {
              "type": "string",
              "enum": [
                "not_required"
              ]
            },
            {
              "type": "string",
              "enum": [
                "rejected"
              ]
            },
            {
              "type": "string",
              "enum": [
                "human_approved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "auto_approved"
              ]
            }
          ]
        },
        "verificationResult": {
          "type": "string"
        },
        "evidenceHash": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "operation",
        "actionDigest",
        "actor",
        "tool",
        "resourceType"
      ]
    },
    "simulation": {
      "type": "object",
      "properties": {
        "inputHash": {
          "type": "string"
        },
        "simulationKey": {
          "type": "string"
        },
        "targetAction": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "planned"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "approved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "verified"
              ]
            },
            {
              "type": "string",
              "enum": [
                "requires_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "executed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unsupported"
              ]
            },
            {
              "type": "string",
              "enum": [
                "simulated"
              ]
            }
          ]
        },
        "plan": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "startedAt": {
          "type": "string"
        },
        "completedAt": {
          "type": "string"
        },
        "permissionProfileId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "runtimeVersionId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "connectorManifestSnapshotId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "policyDecisionId": {
          "type": "number"
        },
        "result": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "simulationSupported": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "inputHash",
        "simulationKey",
        "targetAction"
      ]
    },
    "replay": {
      "type": "object",
      "properties": {
        "targetType": {
          "type": "string"
        },
        "targetId": {
          "type": "string"
        },
        "replayKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "running"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "queued"
              ]
            },
            {
              "type": "string",
              "enum": [
                "reproduced"
              ]
            },
            {
              "type": "string",
              "enum": [
                "diverged"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "startedAt": {
          "type": "string"
        },
        "completedAt": {
          "type": "string"
        },
        "runtimeId": {
          "type": "number"
        },
        "runtimeVersionId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "connectorManifestSnapshotId": {
          "type": "number"
        },
        "traceId": {
          "type": "number"
        },
        "spanId": {
          "type": "number"
        },
        "inputHash": {
          "type": "string"
        },
        "toolInvocationEvidenceId": {
          "type": "number"
        },
        "context": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "policyDecisionId": {
          "type": "number"
        },
        "result": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "reproducible": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "targetType",
        "targetId",
        "replayKey"
      ]
    },
    "runtimeBenchmark": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "benchmarkKey": {
          "type": "string"
        },
        "taskPackHash": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "running"
              ]
            },
            {
              "type": "string",
              "enum": [
                "completed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "blocked"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "metrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "runtimeIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "taskPack": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "winnerRuntimeId": {
          "type": "number"
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "benchmarkKey",
        "taskPackHash"
      ]
    },
    "connectorReadinessReport": {
      "type": "object",
      "properties": {
        "reportKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "draft"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantined"
              ]
            },
            {
              "type": "string",
              "enum": [
                "restricted"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready"
              ]
            }
          ]
        },
        "checks": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "manifestHash": {
          "type": "string"
        },
        "connectorId": {
          "type": "number"
        },
        "score": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "findings": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "reportKey"
      ]
    },
    "auditPack": {
      "type": "object",
      "properties": {
        "exportKey": {
          "type": "string"
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "failed"
              ]
            },
            {
              "type": "string",
              "enum": [
                "queued"
              ]
            },
            {
              "type": "string",
              "enum": [
                "ready"
              ]
            },
            {
              "type": "string",
              "enum": [
                "generating"
              ]
            }
          ]
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "aiSystemId": {
          "type": "number"
        },
        "manifestHash": {
          "type": "string"
        },
        "completedAt": {
          "type": "string"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "storageUri": {
          "type": "string"
        },
        "format": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "json"
              ]
            },
            {
              "type": "string",
              "enum": [
                "pdf"
              ]
            },
            {
              "type": "string",
              "enum": [
                "zip"
              ]
            }
          ]
        },
        "manifest": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "qualityCaseId": {
          "type": "number"
        }
      },
      "additionalProperties": false,
      "required": [
        "exportKey"
      ]
    },
    "anomaly": {
      "type": "object",
      "properties": {
        "anomalyKey": {
          "type": "string"
        },
        "anomalyType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "unregistered_agent"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unknown_runtime_hash"
              ]
            },
            {
              "type": "string",
              "enum": [
                "connector_used_without_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unexpected_tool_fanout"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unusual_data_access"
              ]
            },
            {
              "type": "string",
              "enum": [
                "external_send_spike"
              ]
            },
            {
              "type": "string",
              "enum": [
                "cost_spike"
              ]
            },
            {
              "type": "string",
              "enum": [
                "failure_spike"
              ]
            },
            {
              "type": "string",
              "enum": [
                "latency_spike"
              ]
            },
            {
              "type": "string",
              "enum": [
                "human_rejection_spike"
              ]
            },
            {
              "type": "string",
              "enum": [
                "new_side_effect_class"
              ]
            },
            {
              "type": "string",
              "enum": [
                "unapproved_child_agent_spawning"
              ]
            },
            {
              "type": "string",
              "enum": [
                "config_drift"
              ]
            },
            {
              "type": "string",
              "enum": [
                "manifest_drift"
              ]
            },
            {
              "type": "string",
              "enum": [
                "post_quarantine_activity"
              ]
            }
          ]
        },
        "status": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "open"
              ]
            },
            {
              "type": "string",
              "enum": [
                "resolved"
              ]
            },
            {
              "type": "string",
              "enum": [
                "investigating"
              ]
            },
            {
              "type": "string",
              "enum": [
                "mitigated"
              ]
            }
          ]
        },
        "severity": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "medium"
              ]
            },
            {
              "type": "string",
              "enum": [
                "high"
              ]
            },
            {
              "type": "string",
              "enum": [
                "critical"
              ]
            },
            {
              "type": "string",
              "enum": [
                "low"
              ]
            }
          ]
        },
        "resolvedAt": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "workspaceId": {
          "type": "number"
        },
        "aiSystemId": {
          "type": "number"
        },
        "runtimeId": {
          "type": "number"
        },
        "connectorId": {
          "type": "number"
        },
        "evidenceItemIds": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "detectedAt": {
          "type": "string"
        },
        "fleetId": {
          "type": "number"
        },
        "agentInstanceId": {
          "type": "number"
        },
        "recommendation": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "quarantineStateId": {
          "type": "number"
        },
        "incidentId": {
          "type": "number"
        },
        "signals": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        "recommendedEnforcement": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "warn"
              ]
            },
            {
              "type": "string",
              "enum": [
                "observe"
              ]
            },
            {
              "type": "string",
              "enum": [
                "quarantine"
              ]
            },
            {
              "type": "string",
              "enum": [
                "downgrade_to_read_only"
              ]
            },
            {
              "type": "string",
              "enum": [
                "require_approval"
              ]
            },
            {
              "type": "string",
              "enum": [
                "kill_switch"
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "anomalyKey",
        "anomalyType"
      ]
    },
    "hashes": {
      "type": "object",
      "properties": {
        "configHash": {
          "type": "string"
        },
        "manifestHash": {
          "type": "string"
        },
        "policyHash": {
          "type": "string"
        },
        "promptHash": {
          "type": "string"
        },
        "inputHash": {
          "type": "string"
        },
        "outputHash": {
          "type": "string"
        },
        "stateHash": {
          "type": "string"
        },
        "runtimeHash": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "redaction": {
      "type": "object",
      "properties": {
        "strategy": {
          "type": "string"
        },
        "applied": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "rawPayloadStored": {
          "oneOf": [
            {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            {
              "type": "boolean",
              "enum": [
                true
              ]
            }
          ]
        },
        "rawPayloadRetentionDays": {
          "type": "number"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "required": [
    "source"
  ],
  "$defs": {
    "JsonValue": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      ]
    },
    "OrganizationId": {
      "type": "string",
      "format": "uuid"
    }
  }
}