{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pulse.daowuu.work/schema/event-1-0-0.json",
  "title": "AI 行业事件",
  "version": "1-0-0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "event_date",
    "title",
    "summary",
    "category",
    "subcategory",
    "impact",
    "impact_reason",
    "orgs",
    "sources",
    "verified",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 150
    },
    "impact_reason": {
      "type": "string",
      "minLength": 1
    },
    "product": {
      "type": "string",
      "minLength": 1
    },
    "note": {
      "type": "string",
      "minLength": 1
    },
    "submitted_by": {
      "type": "string",
      "minLength": 1
    },
    "id": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "event_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?\\+08:00$",
          "format": "beijing-time"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?\\+08:00$",
      "format": "beijing-time"
    },
    "updated_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?\\+08:00$",
      "format": "beijing-time"
    },
    "orgs": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true,
      "minItems": 1
    },
    "models": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "related_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
      }
    },
    "metrics": {
      "type": "object"
    },
    "impact": {
      "enum": [
        "S",
        "A",
        "B",
        "C"
      ]
    },
    "verified": {
      "enum": [
        "official",
        "confirmed",
        "rumor"
      ]
    },
    "region": {
      "enum": [
        "US",
        "CN",
        "EU",
        "Global"
      ]
    },
    "status": {
      "enum": [
        "announced",
        "preview",
        "rolling_out",
        "ga",
        "completed",
        "withdrawn",
        "ongoing"
      ]
    },
    "date_basis": {
      "enum": [
        "official_bj",
        "official_local",
        "hn_bj",
        "media_bj"
      ]
    },
    "category": {
      "enum": [
        "模型",
        "算力硬件",
        "产品应用",
        "研究",
        "产业资本",
        "政策安全",
        "开源社区"
      ]
    },
    "subcategory": {
      "enum": [
        "旗舰与基础模型",
        "开源权重",
        "多模态",
        "推理与Agent能力",
        "评测与榜单",
        "芯片",
        "数据中心与云算力",
        "端侧设备",
        "供应链与出口管制",
        "消费级产品",
        "开发者工具与API",
        "企业应用",
        "Agent产品",
        "新方法与论文",
        "安全与对齐研究",
        "融资并购",
        "人事变动",
        "合作",
        "财报",
        "监管法规",
        "诉讼与版权",
        "安全事故",
        "爆火项目",
        "框架与基础设施"
      ]
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "publisher",
          "type"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://[^\\s/]+[^\\s]*$"
          },
          "publisher": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "enum": [
              "official",
              "media",
              "community"
            ]
          }
        }
      }
    },
    "impact_history": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "to",
          "at",
          "reason"
        ],
        "properties": {
          "from": {
            "enum": [
              "S",
              "A",
              "B",
              "C"
            ]
          },
          "to": {
            "enum": [
              "S",
              "A",
              "B",
              "C"
            ]
          },
          "at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?\\+08:00$",
            "format": "beijing-time"
          },
          "reason": {
            "type": "string",
            "minLength": 1
          },
          "ref": {
            "type": "string",
            "pattern": "^https?://\\S+$"
          },
          "by": {
            "enum": [
              "maintainer",
              "bot",
              "community"
            ]
          }
        }
      },
      "description": "按 at 严格升序，相邻记录上一条 to 等于下一条 from，末条 to 等于事件 impact；跨记录规则由校验脚本强制检查。"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "category": {
            "const": "模型"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "旗舰与基础模型",
              "开源权重",
              "多模态",
              "推理与Agent能力",
              "评测与榜单"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "const": "算力硬件"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "芯片",
              "数据中心与云算力",
              "端侧设备",
              "供应链与出口管制"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "const": "产品应用"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "消费级产品",
              "开发者工具与API",
              "企业应用",
              "Agent产品"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "const": "研究"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "新方法与论文",
              "安全与对齐研究"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "const": "产业资本"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "融资并购",
              "人事变动",
              "合作",
              "财报"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "const": "政策安全"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "监管法规",
              "诉讼与版权",
              "安全事故"
            ]
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "category": {
            "const": "开源社区"
          }
        }
      },
      "then": {
        "properties": {
          "subcategory": {
            "enum": [
              "爆火项目",
              "框架与基础设施"
            ]
          }
        }
      }
    }
  ]
}
