{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:awoooi:security-mirror-quarantine-v1",
  "title": "資安供應鏈鏡像隔離契約 v1",
  "description": "定義 AwoooP mirror-only 資安資料驗收失敗時的隔離、修復回報與重試 gate。此契約不授權 runtime execution。",
  "type": "object",
  "required": [
    "schema_version",
    "status",
    "date",
    "mode",
    "runtime_execution_authorized",
    "source_indexes",
    "summary",
    "quarantine_lanes",
    "retry_policy",
    "forbidden_actions"
  ],
  "properties": {
    "schema_version": {
      "const": "security_mirror_quarantine_v1"
    },
    "status": {
      "type": "string",
      "enum": ["draft"]
    },
    "date": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": ["mirror_only"]
    },
    "runtime_execution_authorized": {
      "type": "boolean",
      "const": false
    },
    "source_indexes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "summary": {
      "type": "object",
      "required": [
        "total_contracts",
        "quarantine_lane_count",
        "auto_retry_allowed",
        "runtime_blocking_allowed"
      ],
      "properties": {
        "total_contracts": {
          "type": "integer",
          "minimum": 0
        },
        "quarantine_lane_count": {
          "type": "integer",
          "minimum": 0
        },
        "auto_retry_allowed": {
          "type": "boolean",
          "const": false
        },
        "runtime_blocking_allowed": {
          "type": "boolean",
          "const": false
        }
      },
      "additionalProperties": false
    },
    "quarantine_lanes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "lane_id",
          "trigger_check_id",
          "owner",
          "severity",
          "allowed_processing",
          "blocked_processing",
          "recovery_request",
          "retry_gate"
        ],
        "properties": {
          "lane_id": {
            "type": "string"
          },
          "trigger_check_id": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"]
          },
          "allowed_processing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "blocked_processing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "recovery_request": {
            "type": "string"
          },
          "retry_gate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "retry_policy": {
      "type": "object",
      "required": [
        "auto_retry_allowed",
        "manual_refresh_required",
        "max_retry_without_new_snapshot"
      ],
      "properties": {
        "auto_retry_allowed": {
          "type": "boolean",
          "const": false
        },
        "manual_refresh_required": {
          "type": "boolean",
          "const": true
        },
        "max_retry_without_new_snapshot": {
          "type": "integer",
          "const": 0
        }
      },
      "additionalProperties": false
    },
    "forbidden_actions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    }
  },
  "additionalProperties": false
}
