{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "recordType",
    "candidateId",
    "sourceCommit",
    "gitTree",
    "scopeSha256",
    "exerciseId",
    "scenarioClass",
    "startedAtUtc",
    "endedAtUtc",
    "contactControlPath",
    "contactControlSha256",
    "participants",
    "channelsExercised",
    "objectives",
    "failures",
    "correctiveActions",
    "allPassed"
  ],
  "properties": {
    "schemaVersion": {
      "const": "2.0.0"
    },
    "recordType": {
      "const": "incident-response-exercise"
    },
    "candidateId": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "sourceCommit": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "gitTree": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "scopeSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "exerciseId": {
      "type": "string",
      "pattern": "^incident-exercise:[0-9a-f]{64}$"
    },
    "scenarioClass": {
      "enum": [
        "credential-compromise",
        "data-exposure",
        "service-integrity-failure",
        "critical-vulnerability"
      ]
    },
    "startedAtUtc": {
      "type": "string",
      "format": "date-time"
    },
    "endedAtUtc": {
      "type": "string",
      "format": "date-time"
    },
    "contactControlPath": {
      "type": "string",
      "pattern": "^pr10/partner-package/evidence/organizational/artifacts/[a-z0-9-]+\\.json$"
    },
    "contactControlSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "participants": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roleId",
          "identityId",
          "organizationId"
        ],
        "properties": {
          "roleId": {
            "enum": [
              "incident-commander",
              "security-contact",
              "partner-authorized-signatory"
            ]
          },
          "identityId": {
            "type": "string",
            "pattern": "^identity:[0-9a-f]{64}$"
          },
          "organizationId": {
            "type": "string",
            "pattern": "^organization:[0-9a-f]{64}$"
          }
        }
      }
    },
    "channelsExercised": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "function",
          "roleId",
          "identityId",
          "organizationId",
          "channelId",
          "channelType"
        ],
        "properties": {
          "function": {
            "enum": [
              "incident",
              "security",
              "partner-escalation"
            ]
          },
          "roleId": {
            "enum": [
              "incident-commander",
              "security-contact",
              "partner-authorized-signatory"
            ]
          },
          "identityId": {
            "type": "string",
            "pattern": "^identity:[0-9a-f]{64}$"
          },
          "organizationId": {
            "type": "string",
            "pattern": "^organization:[0-9a-f]{64}$"
          },
          "channelId": {
            "type": "string",
            "pattern": "^channel:[0-9a-f]{64}$"
          },
          "channelType": {
            "enum": [
              "paging-route",
              "secure-portal",
              "email-alias"
            ]
          }
        }
      }
    },
        "objectives": {
            "type": "array",
            "minItems": 5,
            "maxItems": 5,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "objectiveId",
          "assertionCount",
          "passed",
          "evidenceLogPath",
          "evidenceLogSha256"
        ],
        "properties": {
          "objectiveId": {
            "enum": [
              "detect",
              "triage",
              "escalate",
              "contain",
              "notify-partner"
            ]
          },
          "assertionCount": {
            "type": "integer",
            "minimum": 1
          },
          "passed": {
            "const": true
          },
          "evidenceLogPath": {
            "type": "string",
            "pattern": "^pr10/partner-package/evidence/organizational/incident-logs/[a-z0-9-]+\\.json$"
          },
          "evidenceLogSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      }
    },
    "failures": {
      "const": []
    },
    "correctiveActions": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 12
      }
    },
    "allPassed": {
      "const": true
    }
  }
}
