{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://genesiscode.dev/schemas/genesisbench-reference-agent-trace-v0.1.json",
  "title": "GenesisBench fixed reference agent trace v0.1",
  "type": "object",
  "additionalProperties": false,
  "required": ["kind", "version", "profileIdentitySha256", "conditionIdentitySha256", "agentCount", "adapter", "events", "outcome", "contentIdentitySha256"],
  "properties": {
    "kind": {"const": "genesis/genesisbench-reference-agent-trace-v0.1"},
    "version": {"const": "0.1.0"},
    "profileIdentitySha256": {"$ref": "#/$defs/hash"},
    "conditionIdentitySha256": {"$ref": "#/$defs/hash"},
    "agentCount": {"const": 1},
    "adapter": {
      "type": "object", "additionalProperties": false,
      "required": ["id", "conformanceIdentitySha256", "providerToolsUsed", "hiddenRetries", "semanticRewrite"],
      "properties": {"id": {"$ref": "#/$defs/id"}, "conformanceIdentitySha256": {"$ref": "#/$defs/hash"}, "providerToolsUsed": {"const": false}, "hiddenRetries": {"const": 0}, "semanticRewrite": {"const": false}}
    },
    "events": {"type": "array", "minItems": 1, "maxItems": 256, "items": {"$ref": "#/$defs/event"}},
    "outcome": {"enum": ["abstained", "failed", "invalid", "verified"]},
    "contentIdentitySha256": {"$ref": "#/$defs/hash"}
  },
  "$defs": {
    "hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "id": {"type": "string", "pattern": "^[a-z][a-z0-9._/-]{0,127}$"},
    "event": {
      "type": "object", "additionalProperties": false,
      "required": ["index", "kind", "attempt", "operation", "inputIdentitySha256", "outputIdentitySha256", "decision"],
      "properties": {
        "index": {"type": "integer", "minimum": 0, "maximum": 255},
        "kind": {"enum": ["decision", "diagnostic", "model-call", "outcome", "retrieval", "tool-call"]},
        "attempt": {"type": "integer", "minimum": 0, "maximum": 1},
        "operation": {"type": "string", "minLength": 1, "maxLength": 128},
        "inputIdentitySha256": {"$ref": "#/$defs/hash"},
        "outputIdentitySha256": {"$ref": "#/$defs/hash"},
        "decision": {"type": "string", "minLength": 1, "maxLength": 128}
      }
    }
  }
}
