{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cwwindex.today/data/industry_pulse_72h.schema.json",
  "title": "CWW Index 72-hour industry pulse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "schemaVersion",
    "generatedAt",
    "windowHours",
    "windowStart",
    "windowEnd",
    "coverage",
    "events",
    "policy"
  ],
  "properties": {
    "$schema": {"const": "https://cwwindex.today/data/industry_pulse_72h.schema.json"},
    "schemaVersion": {"const": 1},
    "generatedAt": {"type": "string", "format": "date-time"},
    "windowHours": {"const": 72},
    "windowStart": {"type": "string", "format": "date-time"},
    "windowEnd": {"type": "string", "format": "date-time"},
    "coverage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["monitoredThemes", "qualifyingEventCount", "primarySourceCount", "noteZh", "noteEn"],
      "properties": {
        "monitoredThemes": {"type": "array", "minItems": 4, "uniqueItems": true, "items": {"type": "string"}},
        "qualifyingEventCount": {"type": "integer", "minimum": 0},
        "primarySourceCount": {"type": "integer", "minimum": 0},
        "noteZh": {"type": "string", "minLength": 12},
        "noteEn": {"type": "string", "minLength": 24}
      }
    },
    "events": {
      "type": "array",
      "maxItems": 6,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "publishedDate", "sourceType", "sourceTitle", "sourceUrl", "titleZh", "titleEn", "summaryZh", "summaryEn", "impactZh", "impactEn", "tags", "companies", "evidenceStatus", "confidence"],
        "properties": {
          "id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
          "publishedDate": {"type": "string", "format": "date"},
          "sourceType": {"enum": ["COMPANY_PRIMARY", "REGULATOR_PRIMARY", "STANDARDS_PRIMARY", "EXCHANGE_PRIMARY"]},
          "sourceTitle": {"type": "string", "minLength": 4},
          "sourceUrl": {"type": "string", "format": "uri", "pattern": "^https://"},
          "titleZh": {"type": "string", "minLength": 8},
          "titleEn": {"type": "string", "minLength": 16},
          "summaryZh": {"type": "string", "minLength": 20},
          "summaryEn": {"type": "string", "minLength": 40},
          "impactZh": {"type": "string", "minLength": 16},
          "impactEn": {"type": "string", "minLength": 32},
          "tags": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string"}},
          "companies": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string"}},
          "evidenceStatus": {"const": "VERIFIED"},
          "confidence": {"enum": ["HIGH", "MEDIUM"]}
        }
      }
    },
    "policy": {
      "type": "object",
      "additionalProperties": false,
      "required": ["primarySourcesRequired", "licensedPriceDataRepublished", "rumorsAllowed", "marketImpactInferred", "emptyWindowBehavior"],
      "properties": {
        "primarySourcesRequired": {"const": true},
        "licensedPriceDataRepublished": {"const": false},
        "rumorsAllowed": {"const": false},
        "marketImpactInferred": {"const": false},
        "emptyWindowBehavior": {"const": "PUBLISH_VERIFIED_EMPTY_STATE"}
      }
    }
  }
}
