{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "replay",
  "type": "object",
  "required": ["published_at", "rebase", "dates", "components"],
  "additionalProperties": false,
  "properties": {
    "published_at": {"type": "string"},
    "rebase": {"type": "string"},
    "dates": {"type": "array",
              "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"}},
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["code", "label", "weight", "mode", "index", "bls_index",
                     "yoy", "bls_yoy"],
        "additionalProperties": false,
        "properties": {
          "code": {"type": "string"},
          "label": {"type": "string"},
          "weight": {"type": "number", "exclusiveMinimum": 0, "maximum": 1},
          "mode": {"enum": ["live", "bls_cf"]},
          "last_obs": {"type": ["string", "null"]},
          "gate_flags": {"type": "array", "items": {"type": "string"}},
          "index": {"type": "array", "items": {"type": "number"}},
          "bls_index": {"type": "array", "items": {"type": "number"}},
          "yoy": {"type": "array", "items": {"type": ["number", "null"]}},
          "bls_yoy": {"type": "array", "items": {"type": ["number", "null"]}},
          "weights_by_month": {
            "description": "Headline weight in force for each YoY base month (YYYY-MM): the weight the engine applied at every date d whose base month (d - 365 days) is that month. Absent in artifacts before 2026-09-28 (consumers fall back to `weight`).",
            "type": "object",
            "propertyNames": {"pattern": "^\\d{4}-\\d{2}$"},
            "additionalProperties": {"type": "number", "minimum": 0, "maximum": 1}
          }
        }
      }
    }
  }
}
