{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://scenarios.ginc.org/data/schema/scenario.schema.json",
  "title": "GINC Scenario Library — scenario record",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "slug",
    "version",
    "status",
    "orientation",
    "family",
    "title",
    "short_title",
    "thematics",
    "likelihood_type",
    "scores",
    "scorecard",
    "summary",
    "narrative",
    "anchors",
    "parameters",
    "transmission",
    "loading",
    "stakeholders",
    "regions",
    "indicators",
    "compounds",
    "open_questions",
    "commentary",
    "overview",
    "history",
    "changelog",
    "citation"
  ],
  "definitions": {
    "band": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "confidence": {
      "enum": [
        "very low",
        "low",
        "medium",
        "high",
        "very high"
      ]
    },
    "load": {
      "enum": [
        "High",
        "Medium",
        "Low"
      ]
    },
    "scenarioId": {
      "type": "string",
      "pattern": "^S[0-9]{2}$"
    },
    "link": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "note"
      ],
      "properties": {
        "id": {
          "$ref": "#/definitions/scenarioId"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "presetValues": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "major",
        "severe",
        "extreme"
      ],
      "properties": {
        "major": {
          "type": [
            "string",
            "null"
          ]
        },
        "severe": {
          "type": "string"
        },
        "extreme": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "stakeholder": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "exposure",
        "actions",
        "watch",
        "relevance"
      ],
      "properties": {
        "exposure": {
          "type": [
            "string",
            "null"
          ]
        },
        "actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "watch": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "relevance": {
          "$ref": "#/definitions/band"
        }
      }
    }
  },
  "properties": {
    "id": {
      "$ref": "#/definitions/scenarioId"
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
    },
    "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "status": {
      "enum": [
        "active",
        "retired"
      ]
    },
    "orientation": {
      "enum": [
        "downside",
        "upside"
      ]
    },
    "distribution": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "gains",
        "loses"
      ],
      "properties": {
        "gains": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "maxWords": 20
          }
        },
        "loses": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "maxWords": 20
          }
        }
      }
    },
    "family": {
      "enum": [
        "A",
        "B",
        "C",
        "D",
        "E"
      ]
    },
    "title": {
      "type": "string",
      "maxLength": 60
    },
    "short_title": {
      "type": "string",
      "maxLength": 25
    },
    "thematics": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "likelihood_type": {
      "enum": [
        "systemic",
        "idiosyncratic"
      ]
    },
    "likelihood_note": {
      "type": [
        "string",
        "null"
      ]
    },
    "scores": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "likelihood_2y",
        "likelihood_10y",
        "impact_systemic",
        "impact_national",
        "confidence",
        "priority",
        "tier",
        "source"
      ],
      "properties": {
        "likelihood_2y": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "band",
            "rationale"
          ],
          "properties": {
            "band": {
              "$ref": "#/definitions/band"
            },
            "rationale": {
              "type": "string",
              "maxWords": 80
            }
          }
        },
        "likelihood_10y": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "band",
            "rationale"
          ],
          "properties": {
            "band": {
              "$ref": "#/definitions/band"
            },
            "rationale": {
              "type": "string",
              "maxWords": 80
            }
          }
        },
        "impact_systemic": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "level",
            "rationale"
          ],
          "properties": {
            "level": {
              "$ref": "#/definitions/band"
            },
            "rationale": {
              "type": "string",
              "maxWords": 80
            }
          }
        },
        "impact_national": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "level",
            "rationale"
          ],
          "properties": {
            "level": {
              "$ref": "#/definitions/band"
            },
            "rationale": {
              "type": "string",
              "maxWords": 80
            }
          }
        },
        "confidence": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "level",
            "reason"
          ],
          "properties": {
            "level": {
              "$ref": "#/definitions/confidence"
            },
            "reason": {
              "type": "string",
              "maxWords": 40
            }
          }
        },
        "priority": {
          "type": "integer",
          "minimum": 1,
          "maximum": 25
        },
        "tier": {
          "enum": [
            "I",
            "II",
            "III"
          ]
        },
        "source": {
          "enum": [
            "ginc-desk-v0.2",
            "ginc-desk-v0.3",
            "ginc-desk-v0.4",
            "panel-2027"
          ]
        }
      }
    },
    "scorecard": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "onset",
        "duration",
        "warning",
        "scope",
        "origin",
        "external_support",
        "policy_response",
        "recovery_horizon"
      ],
      "properties": {
        "onset": {
          "type": "string"
        },
        "duration": {
          "type": "string"
        },
        "warning": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "origin": {
          "type": "string"
        },
        "external_support": {
          "type": "string"
        },
        "policy_response": {
          "type": "string"
        },
        "recovery_horizon": {
          "type": "string"
        }
      }
    },
    "summary": {
      "type": "string",
      "minLength": 1,
      "maxWords": 120
    },
    "narrative": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dateline",
        "text"
      ],
      "properties": {
        "dateline": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxWords": 500
        }
      }
    },
    "anchors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "shock_id",
          "date",
          "event",
          "what_happened",
          "calibrates"
        ],
        "properties": {
          "shock_id": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "what_happened": {
            "type": "string"
          },
          "calibrates": {
            "type": "string"
          }
        }
      }
    },
    "parameters": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "common",
        "specific"
      ],
      "properties": {
        "common": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "severity",
            "duration",
            "onset",
            "warning",
            "scope",
            "origin",
            "external_support",
            "concurrency",
            "policy_response",
            "recovery_horizon"
          ],
          "properties": {
            "severity": {
              "$ref": "#/definitions/presetValues"
            },
            "duration": {
              "$ref": "#/definitions/presetValues"
            },
            "onset": {
              "$ref": "#/definitions/presetValues"
            },
            "warning": {
              "$ref": "#/definitions/presetValues"
            },
            "scope": {
              "$ref": "#/definitions/presetValues"
            },
            "origin": {
              "$ref": "#/definitions/presetValues"
            },
            "external_support": {
              "$ref": "#/definitions/presetValues"
            },
            "concurrency": {
              "$ref": "#/definitions/presetValues"
            },
            "policy_response": {
              "$ref": "#/definitions/presetValues"
            },
            "recovery_horizon": {
              "$ref": "#/definitions/presetValues"
            }
          }
        },
        "specific": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "default",
              "range",
              "unit",
              "note"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "default": {
                "type": "string"
              },
              "range": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "unit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "transmission": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "maxWords": 30
      }
    },
    "loading": {
      "type": "array",
      "minItems": 9,
      "maxItems": 9,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dimension",
          "domain",
          "load",
          "channel"
        ],
        "properties": {
          "dimension": {
            "enum": [
              "Hard",
              "Soft",
              "Economic"
            ]
          },
          "domain": {
            "type": "string"
          },
          "load": {
            "$ref": "#/definitions/load"
          },
          "channel": {
            "type": "string",
            "maxWords": 20
          }
        }
      }
    },
    "stakeholders": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "government",
        "technology",
        "investors",
        "public"
      ],
      "properties": {
        "government": {
          "$ref": "#/definitions/stakeholder"
        },
        "technology": {
          "$ref": "#/definitions/stakeholder"
        },
        "investors": {
          "$ref": "#/definitions/stakeholder"
        },
        "public": {
          "$ref": "#/definitions/stakeholder"
        }
      }
    },
    "regions": {
      "type": "array",
      "minItems": 9,
      "maxItems": 9,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "region",
          "exposure",
          "rationale"
        ],
        "properties": {
          "region": {
            "type": "string"
          },
          "exposure": {
            "$ref": "#/definitions/load"
          },
          "rationale": {
            "type": [
              "string",
              "null"
            ],
            "maxWords": 25
          }
        }
      }
    },
    "indicators": {
      "type": "array",
      "minItems": 5,
      "maxItems": 8,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "source",
          "threshold",
          "cadence"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "threshold": {
            "type": [
              "string",
              "null"
            ]
          },
          "cadence": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      }
    },
    "compounds": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "triggers",
        "triggered_by",
        "amplifying_trends"
      ],
      "properties": {
        "triggers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/link"
          }
        },
        "triggered_by": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/link"
          }
        },
        "amplified_by": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/link"
          }
        },
        "triggered_by_other": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "amplifying_trends": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "open_questions": {
      "type": "array",
      "items": {
        "type": "string",
        "maxWords": 40
      }
    },
    "commentary": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "author",
            "affiliation",
            "date",
            "text"
          ],
          "properties": {
            "author": {
              "type": "string"
            },
            "affiliation": {
              "type": "string"
            },
            "date": {
              "type": "string"
            },
            "text": {
              "type": "string",
              "maxWords": 300
            }
          }
        }
      ]
    },
    "overview": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source",
        "lenses",
        "regions"
      ],
      "properties": {
        "source": {
          "enum": [
            "ginc-desk-v0.2",
            "ginc-desk-v0.3",
            "ginc-desk-v0.4",
            "panel-2027"
          ]
        },
        "lenses": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "political",
            "economic",
            "social",
            "technological",
            "legal",
            "environmental"
          ],
          "properties": {
            "political": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "economic": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "social": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "technological": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "legal": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "environmental": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            }
          }
        },
        "regions": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "north-america",
            "europe",
            "china",
            "indo-pacific",
            "south-asia",
            "gulf-middle-east",
            "africa",
            "latin-america",
            "russia-eurasia"
          ],
          "properties": {
            "north-america": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "europe": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "china": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "indo-pacific": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "south-asia": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "gulf-middle-east": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "africa": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "latin-america": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            },
            "russia-eurasia": {
              "type": "string",
              "minLength": 1,
              "maxWords": 35
            }
          }
        }
      }
    },
    "history": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "edition",
          "rank",
          "L2y",
          "L10y",
          "impact_systemic",
          "impact_national",
          "confidence"
        ],
        "properties": {
          "edition": {
            "type": "integer"
          },
          "rank": {
            "type": [
              "integer",
              "null"
            ]
          },
          "L2y": {
            "$ref": "#/definitions/band"
          },
          "L10y": {
            "$ref": "#/definitions/band"
          },
          "impact_systemic": {
            "$ref": "#/definitions/band"
          },
          "impact_national": {
            "$ref": "#/definitions/band"
          },
          "confidence": {
            "$ref": "#/definitions/confidence"
          }
        }
      }
    },
    "changelog": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "date",
          "change"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
          },
          "change": {
            "type": "string"
          }
        }
      }
    },
    "citation": {
      "type": "string"
    }
  }
}