{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paloframework.org/schemas/palo-decision-gates.schema.json",
  "title": "PALO Decision Gates",
  "type": "object",
  "required": ["format", "schemaVersion", "status", "updatedAt", "disclaimer", "gates"],
  "properties": {
    "format": { "const": "palo-decision-gates" },
    "schemaVersion": { "const": "1.0.0" },
    "status": { "const": "educational-non-production" },
    "updatedAt": { "type": "string", "format": "date" },
    "disclaimer": { "type": "string", "minLength": 20 },
    "gates": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object",
        "required": ["gateId", "label", "purpose", "entryCriteria", "decisionOptions", "requiredControlIds", "conditionalControlIds", "indicatorIds", "sourceIds", "templateIds"],
        "properties": {
          "gateId": { "enum": ["frame", "classify", "assess", "control", "measure", "prove"] },
          "label": { "type": "string", "minLength": 1 },
          "purpose": { "type": "string", "minLength": 1 },
          "entryCriteria": { "type": "array", "minItems": 1, "items": { "type": "string" } },
          "decisionOptions": { "type": "array", "minItems": 2, "uniqueItems": true, "items": { "enum": ["proceed", "proceed-with-conditions", "hold", "redesign", "stop"] } },
          "requiredControlIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
          "conditionalControlIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
          "indicatorIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
          "sourceIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } },
          "templateIds": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
