{
  "$defs": {
    "BcpStatus": {
      "description": "Plan lifecycle.",
      "enum": [
        "draft",
        "approved",
        "in_revision",
        "retired"
      ],
      "type": "string"
    },
    "BcpTest": {
      "description": "One BCP test execution.",
      "properties": {
        "conducted_by": {
          "$ref": "#/$defs/PathRef"
        },
        "conducted_on": {
          "$ref": "#/$defs/IsoDate"
        },
        "findings": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "kind": {
          "$ref": "#/$defs/BcpTestKind"
        },
        "objectives_met": {
          "description": "Whether RTO/RPO targets were met.",
          "type": "boolean"
        },
        "report_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "kind",
        "conducted_on",
        "conducted_by",
        "objectives_met",
        "findings"
      ],
      "type": "object"
    },
    "BcpTestKind": {
      "description": "Test cadence + types.",
      "enum": [
        "tabletop",
        "simulation",
        "full_failover"
      ],
      "type": "string"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "ProcessCriticality": {
      "description": "Process criticality.",
      "oneOf": [
        {
          "enum": [
            "low",
            "material",
            "critical"
          ],
          "type": "string"
        },
        {
          "const": "mission_critical",
          "description": "Cannot tolerate any downtime (active-active required).",
          "type": "string"
        }
      ]
    },
    "ResourceDependency": {
      "description": "Resource dependency (for BIA).",
      "properties": {
        "backup_arrangement": {
          "description": "Free-form backup-arrangement narrative.",
          "type": [
            "string",
            "null"
          ]
        },
        "backup_available": {
          "description": "Whether this resource has a backup / redundancy.",
          "type": "boolean"
        },
        "kind": {
          "description": "Resource kind (e.g. \"people\", \"system\", \"vendor\", \"facility\").",
          "type": "string"
        },
        "ref_path": {
          "$ref": "#/$defs/PathRef",
          "description": "PathRef to the resource record."
        }
      },
      "required": [
        "kind",
        "ref_path",
        "backup_available"
      ],
      "type": "object"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/business-continuity-plan.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Business-continuity plan record.",
  "properties": {
    "business_process": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the business process this plan covers."
    },
    "control_basis": {
      "type": "string"
    },
    "crisis_team": {
      "description": "Crisis management team contacts.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "criticality": {
      "$ref": "#/$defs/ProcessCriticality"
    },
    "dependencies": {
      "description": "Resource dependencies (from BIA).",
      "items": {
        "$ref": "#/$defs/ResourceDependency"
      },
      "type": "array"
    },
    "effective_from": {
      "$ref": "#/$defs/IsoDate"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "mbco": {
      "description": "MBCO — Minimum Business Continuity Objective narrative.",
      "type": "string"
    },
    "mtpd_hours": {
      "description": "MTPD — Maximum Tolerable Period of Disruption (hours).",
      "format": "int32",
      "type": "integer"
    },
    "next_review_due": {
      "$ref": "#/$defs/IsoDate"
    },
    "owner": {
      "$ref": "#/$defs/PathRef",
      "description": "Primary owner (PathRef into people)."
    },
    "rto_hours": {
      "description": "RTO — Recovery Time Objective (hours; must be ≤ MTPD).",
      "format": "int32",
      "type": "integer"
    },
    "runbook_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the runbook executing the plan."
    },
    "status": {
      "$ref": "#/$defs/BcpStatus"
    },
    "tests": {
      "description": "Plan-test history.",
      "items": {
        "$ref": "#/$defs/BcpTest"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "entity",
    "business_process",
    "criticality",
    "mtpd_hours",
    "rto_hours",
    "mbco",
    "owner",
    "crisis_team",
    "dependencies",
    "tests",
    "status",
    "effective_from",
    "next_review_due",
    "control_basis"
  ],
  "title": "BusinessContinuityPlan",
  "type": "object",
  "x-corpospec-pillar": "operations"
}