{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ithz.dev/schema/ccg-real-agent-status-0.1.json",
  "title": "CCG real-agent trajectory result",
  "type": "object",
  "required": [
    "protocol",
    "evidenceProfile",
    "status",
    "runtime",
    "isolation",
    "corpusHash",
    "sourceResultHash",
    "scenarioCount",
    "runCount",
    "aggregate",
    "scenarios",
    "runs"
  ],
  "properties": {
    "protocol": { "const": "ccg-real-agent-0.1" },
    "evidenceProfile": { "const": "ithz-real-agent-chain-0.1" },
    "status": { "const": "completed" },
    "corpusHash": { "$ref": "#/$defs/sha256" },
    "sourceResultHash": { "$ref": "#/$defs/sha256" },
    "scenarioCount": { "const": 8 },
    "runCount": { "const": 24 },
    "aggregate": {
      "type": "object",
      "required": ["direct", "stateless", "ithz"]
    },
    "scenarios": {
      "type": "object",
      "minProperties": 8,
      "maxProperties": 8
    },
    "runs": {
      "type": "array",
      "minItems": 24,
      "maxItems": 24,
      "items": {
        "type": "object",
        "required": [
          "runId",
          "scenarioId",
          "architecture",
          "kind",
          "chainRoot",
          "chainLength",
          "chainValid",
          "agent",
          "evidence"
        ],
        "properties": {
          "architecture": { "enum": ["direct", "stateless", "ithz"] },
          "kind": { "enum": ["attack", "control"] },
          "chainRoot": { "$ref": "#/$defs/sha256" },
          "chainLength": { "type": "integer", "minimum": 0 },
          "chainValid": { "const": true },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["sequence", "previousHash", "entryHash", "decision", "executed"],
              "properties": {
                "previousHash": { "$ref": "#/$defs/sha256" },
                "entryHash": { "$ref": "#/$defs/sha256" },
                "decision": { "enum": ["allow", "stop"] }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    }
  }
}
