{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://miruntime.com/downloads/miruntime-evidence-event.schema.json",
  "title": "MiRuntime Conceptual Evidence Event",
  "description": "Editorial reference schema for a typed, attributable runtime evidence event. It is not a requirement to retain complete prompts or secrets.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "eventId", "runId", "sequence", "timestampUtc", "type", "actor", "status", "payload"],
  "properties": {
    "schemaVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "eventId": { "type": "string", "minLength": 1 },
    "runId": { "type": "string", "minLength": 1 },
    "sequence": { "type": "integer", "minimum": 0 },
    "timestampUtc": { "type": "string", "format": "date-time" },
    "type": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$" },
    "actor": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "id"],
      "properties": {
        "type": { "type": "string", "enum": ["user", "agent", "model", "runtime", "tool", "policy-engine", "service"] },
        "id": { "type": "string", "minLength": 1 },
        "tenantId": { "type": "string" }
      }
    },
    "status": { "type": "string", "enum": ["observed", "allowed", "denied", "pending", "started", "completed", "failed", "recovered", "terminated"] },
    "payload": { "type": "object" },
    "references": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["kind", "uri"],
        "properties": {
          "kind": { "type": "string", "enum": ["source", "artifact", "checkpoint", "policy", "approval", "tool-call", "trace"] },
          "uri": { "type": "string", "format": "uri-reference" },
          "hash": { "type": "string" }
        }
      }
    },
    "classification": { "type": "string" },
    "retentionPolicy": { "type": "string" },
    "integrity": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "algorithm": { "type": "string" },
        "digest": { "type": "string" },
        "previousEventDigest": { "type": "string" }
      }
    },
    "unresolvedUncertainty": { "type": "array", "items": { "type": "string" } }
  }
}
