{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "capacity.json — /capacity AI-megawatts tracker",
  "type": "object",
  "required": ["published_at", "as_of_curated", "priced_date", "note", "basis",
               "companies", "cohorts", "timeline", "tenants", "geo",
               "geo_unmapped", "geo_note", "reference"],
  "properties": {
    "published_at": {"type": "string"},
    "as_of_curated": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"},
    "priced_date": {"type": ["string", "null"]},
    "note": {"type": "string"},
    "basis": {"type": "object"},
    "companies": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object",
        "required": ["t", "n", "role", "dupe", "private", "confidence",
                     "op", "con", "plan", "cap", "px", "priced_date", "stale",
                     "ev", "wmw", "ev_per_mw", "pct_energized", "coverage",
                     "valuation_b", "sites", "src", "tl"],
        "properties": {
          "t": {"type": "string"},
          "n": {"type": "string"},
          "role": {"enum": ["neocloud", "landlord", "operator",
                            "hyperscaler", "exploratory"]},
          "dupe": {"type": ["string", "null"]},
          "private": {"type": "boolean"},
          "confidence": {"enum": ["filed", "estimate"]},
          "op": {"type": "number", "minimum": 0},
          "con": {"type": "number", "minimum": 0},
          "plan": {"type": "number", "minimum": 0},
          "cap": {"type": ["number", "null"]},
          "px": {"type": ["number", "null"]},
          "priced_date": {"type": ["string", "null"]},
          "stale": {"type": "boolean"},
          "ev": {"type": ["number", "null"]},
          "wmw": {"type": "number", "minimum": 0},
          "ev_per_mw": {"type": ["number", "null"]},
          "pct_energized": {"type": ["number", "null"]},
          "coverage": {"type": ["number", "null"]},
          "valuation_b": {"type": ["number", "null"]},
          "nd": {"type": ["number", "null"]},
          "bk": {"type": ["number", "null"]},
          "sites": {"type": "array"},
          "src": {"type": "array"},
          "tl": {"type": "array", "items": {
            "type": "array", "minItems": 3, "maxItems": 3,
            "prefixItems": [{"type": "string", "pattern": "^\\d{4}Q[1-4]$"},
                            {"type": "string"}, {"type": "number"}]}}
        }
      }
    },
    "cohorts": {
      "type": "object",
      "required": ["all", "neocloud", "hyperscaler"],
      "additionalProperties": {
        "type": "object",
        "required": ["companies", "op", "con", "plan"],
        "properties": {"companies": {"type": "integer", "minimum": 0},
                       "op": {"type": "number"}, "con": {"type": "number"},
                       "plan": {"type": "number"}}
      }
    },
    "timeline": {
      "type": "object",
      "required": ["all", "neocloud", "hyperscaler"],
      "additionalProperties": {
        "type": "object",
        "required": ["base_mw", "points", "milestones"],
        "properties": {
          "base_mw": {"type": "number"},
          "points": {"type": "array", "items": {
            "type": "object",
            "required": ["q", "add_mw", "cum_mw"],
            "properties": {"q": {"type": "string", "pattern": "^\\d{4}Q[1-4]$"},
                           "add_mw": {"type": "number"},
                           "cum_mw": {"type": "number"}}}},
          "milestones": {"type": "object"}
        }
      }
    },
    "tenants": {"type": "array", "items": {
      "type": "array", "minItems": 4, "maxItems": 4,
      "prefixItems": [{"type": "string"}, {"type": "string"},
                      {"type": ["number", "null"]}, {"type": "string"}]}},
    "geo": {"type": "array", "items": {
      "type": "object",
      "required": ["t", "site", "mw", "st", "lat", "lng", "approx"],
      "properties": {"t": {"type": "string"}, "site": {"type": "string"},
                     "mw": {"type": ["number", "null"]},
                     "st": {"enum": ["o", "c", "p", "s"]},
                     "lat": {"type": "number", "minimum": -90, "maximum": 90},
                     "lng": {"type": "number", "minimum": -180, "maximum": 180},
                     "approx": {"type": "boolean"},
                     "when": {"type": "string"},
                     "market": {"type": "string"}}}},
    "geo_unmapped": {"type": "array", "items": {
      "type": "object",
      "required": ["t", "site", "mw", "st", "why"],
      "properties": {"t": {"type": "string"}, "site": {"type": "string"},
                     "mw": {"type": ["number", "null"]},
                     "st": {"enum": ["o", "c", "p", "s"]},
                     "why": {"type": "string"}}}},
    "geo_note": {"type": "string"},
    "reference": {
      "type": "object",
      "required": ["nvda_cap_b", "cohort_ev_b"],
      "properties": {"nvda_cap_b": {"type": ["number", "null"]},
                     "cohort_ev_b": {"type": ["number", "null"]}}
    }
  }
}
