{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.driftframe.org/site-reading-governance/v2.0/decision.schema.json",
  "title": "Comparative Site Reading Decision",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "decision_id",
    "as_of",
    "question",
    "selected_option",
    "alternatives",
    "assumption_ids",
    "predicted_effects",
    "probability_of",
    "probability",
    "probability_horizon",
    "probability_basis",
    "probability_conditions",
    "recalibration_triggers",
    "falsifiers",
    "decision_authority",
    "status",
    "metadata"
  ],
  "properties": {
    "decision_id": {
      "$ref": "common.schema.json#/$defs/identifier"
    },
    "as_of": {
      "type": "string",
      "format": "date"
    },
    "question": {
      "type": "string",
      "minLength": 10,
      "maxLength": 500
    },
    "selected_option": {
      "type": "string",
      "minLength": 5,
      "maxLength": 600
    },
    "alternatives": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 400
      }
    },
    "assumption_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "common.schema.json#/$defs/identifier"
      }
    },
    "predicted_effects": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "measure",
          "prediction",
          "window"
        ],
        "properties": {
          "measure": {
            "type": "string",
            "minLength": 3,
            "maxLength": 120
          },
          "prediction": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "window": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          }
        }
      }
    },
    "probability": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "probability_of": {
      "type": "string",
      "minLength": 20,
      "maxLength": 900
    },
    "probability_horizon": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "begins_on",
        "ends_on",
        "evaluation_event"
      ],
      "properties": {
        "begins_on": {
          "type": "string",
          "format": "date"
        },
        "ends_on": {
          "type": "string",
          "format": "date"
        },
        "evaluation_event": {
          "type": "string",
          "minLength": 10,
          "maxLength": 500
        }
      }
    },
    "probability_basis": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 10,
        "maxLength": 700
      }
    },
    "probability_conditions": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 10,
        "maxLength": 700
      }
    },
    "recalibration_triggers": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 10,
        "maxLength": 700
      }
    },
    "falsifiers": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 10,
        "maxLength": 500
      }
    },
    "decision_authority": {
      "type": "string",
      "enum": [
        "advisory",
        "program",
        "organizational"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "proposed",
        "selected",
        "superseded",
        "withdrawn"
      ]
    },
    "superseded_by": {
      "$ref": "common.schema.json#/$defs/identifier"
    },
    "metadata": {
      "$ref": "common.schema.json#/$defs/recordMetadata"
    }
  }
}
