{
  "$defs": {
    "Confidentiality": {
      "description": "Cross-cutting confidentiality classification used across privacy,\nsecurity, knowledge, IR pillars. Default rendering rule: `corpospec-report`\nexcludes `Restricted | BoardOnly | InvestorOnly` records from public output\nunless an explicit audience parameter overrides. See BDR 0076 §1.",
      "oneOf": [
        {
          "const": "public",
          "description": "Safe to publish anywhere.",
          "type": "string"
        },
        {
          "const": "customer",
          "description": "Visible to customers under standard ToS.",
          "type": "string"
        },
        {
          "const": "internal",
          "description": "Employees and contractors only.",
          "type": "string"
        },
        {
          "const": "restricted",
          "description": "Need-to-know subset of internal.",
          "type": "string"
        },
        {
          "const": "board_only",
          "description": "Board members and direct staff.",
          "type": "string"
        },
        {
          "const": "investor_only",
          "description": "Existing investors + prospective with NDA.",
          "type": "string"
        }
      ]
    },
    "DriverAssumption": {
      "description": "One driver assumption.",
      "properties": {
        "description": {
          "type": "string"
        },
        "key": {
          "description": "Key (e.g. \"monthly_new_logos\", \"logo_churn_pct\", \"fx_eur_usd\").",
          "type": "string"
        },
        "time_series": {
          "description": "Optional period-indexed series; index 0 = first forecast\nperiod.",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "unit": {
          "description": "Unit (e.g. \"logos/month\", \"pct\", \"rate\").",
          "type": "string"
        },
        "value": {
          "description": "Value over the forecast horizon (single number for constant,\nor trailing/leading time series in `time_series`).",
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "key",
        "description",
        "value",
        "unit"
      ],
      "type": "object"
    },
    "ForecastLine": {
      "description": "One forecast period line.",
      "properties": {
        "key": {
          "description": "Line label (e.g. \"MRR\", \"Total OPEX\", \"Net cash burn\").",
          "type": "string"
        },
        "values": {
          "description": "Per-period values; index 0 = first forecast period.",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        }
      },
      "required": [
        "key",
        "values"
      ],
      "type": "object"
    },
    "IsoCurrency": {
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$",
      "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"
    },
    "ScenarioKind": {
      "description": "Scenario kind.",
      "oneOf": [
        {
          "const": "base",
          "description": "Most-likely / baseline plan.",
          "type": "string"
        },
        {
          "const": "upside",
          "description": "Bull / upside / best-case.",
          "type": "string"
        },
        {
          "const": "downside",
          "description": "Bear / downside / worst-case.",
          "type": "string"
        },
        {
          "const": "stress",
          "description": "Stress test (regulatory or self-imposed).",
          "type": "string"
        },
        {
          "const": "reverse_stress",
          "description": "Reverse stress test — what failure-mode is needed to wipe out\nequity / runway.",
          "type": "string"
        },
        {
          "const": "no_growth",
          "description": "No-growth (steady-state at current MRR).",
          "type": "string"
        },
        {
          "const": "hyper_growth",
          "description": "Hyper-growth.",
          "type": "string"
        },
        {
          "const": "pivot",
          "description": "Pivot scenario (different business model).",
          "type": "string"
        }
      ]
    },
    "ScenarioStatus": {
      "description": "Lifecycle.",
      "oneOf": [
        {
          "enum": [
            "draft",
            "under_review",
            "approved",
            "superseded"
          ],
          "type": "string"
        },
        {
          "const": "locked",
          "description": "Locked — used for the board-approved plan.",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/scenario.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Financial scenario.",
  "properties": {
    "confidentiality": {
      "$ref": "#/$defs/Confidentiality"
    },
    "created_at": {
      "$ref": "#/$defs/IsoDate"
    },
    "currency": {
      "$ref": "#/$defs/IsoCurrency"
    },
    "description": {
      "type": "string"
    },
    "drivers": {
      "items": {
        "$ref": "#/$defs/DriverAssumption"
      },
      "type": "array"
    },
    "ending_cash": {
      "description": "Ending cash position.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "kind": {
      "$ref": "#/$defs/ScenarioKind"
    },
    "lines": {
      "items": {
        "$ref": "#/$defs/ForecastLine"
      },
      "type": "array"
    },
    "model_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the supporting model artefact (spreadsheet, Causal\nlink, etc.)."
    },
    "name": {
      "type": "string"
    },
    "owner": {
      "$ref": "#/$defs/PathRef"
    },
    "period_cadence": {
      "description": "Period cadence (e.g. \"monthly\", \"quarterly\", \"annual\").",
      "type": "string"
    },
    "period_count": {
      "description": "Number of forecast periods.",
      "format": "int32",
      "type": "integer"
    },
    "period_start": {
      "$ref": "#/$defs/IsoDate"
    },
    "probability": {
      "description": "Probability (subjective) — sum across all scenarios should = 1.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "runway_months_at_end": {
      "description": "Runway in months at scenario end.",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/ScenarioStatus"
    }
  },
  "required": [
    "id",
    "entity",
    "kind",
    "status",
    "name",
    "description",
    "currency",
    "period_start",
    "period_cadence",
    "period_count",
    "drivers",
    "lines",
    "owner",
    "created_at",
    "confidentiality"
  ],
  "title": "Scenario",
  "type": "object",
  "x-corpospec-pillar": "financials"
}