{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.yingxueyuan.cn/schemas/ai-answer-evidence-review-v1.schema.json",
  "title": "映雪网 AI 答案证据核验记录 v1",
  "description": "由用户手工建立的 AI 答案主张与来源核验记录。不是自动事实核查、认证或完整性保证。",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "recordType", "schemaVersion", "title", "platform", "answerUrl", "reviewedAt", "claims", "interpretation", "agentInstructions"],
  "properties": {
    "$schema": { "const": "https://www.yingxueyuan.cn/schemas/ai-answer-evidence-review-v1.schema.json" },
    "recordType": { "const": "yingxue.ai-answer-evidence-review" },
    "schemaVersion": { "const": "1.0.0" },
    "title": { "type": "string", "minLength": 1, "maxLength": 200 },
    "platform": { "type": "string", "maxLength": 120 },
    "answerUrl": { "anyOf": [{ "const": "" }, { "type": "string", "format": "uri", "pattern": "^https?://", "maxLength": 2048 }] },
    "reviewedAt": { "type": "string", "format": "date" },
    "claims": {
      "type": "array", "minItems": 1, "maxItems": 50,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "claim", "status", "sourceTitle", "sourceUrl", "sourceExcerpt", "reviewerNote"],
        "properties": {
          "id": { "type": "string", "minLength": 1, "maxLength": 80 },
          "claim": { "type": "string", "minLength": 1, "maxLength": 4000 },
          "status": { "enum": ["not-reviewed", "supports", "contradicts", "insufficient"] },
          "sourceTitle": { "type": "string", "maxLength": 300 },
          "sourceUrl": { "anyOf": [{ "const": "" }, { "type": "string", "format": "uri", "pattern": "^https?://", "maxLength": 2048 }] },
          "sourceExcerpt": { "type": "string", "maxLength": 8000 },
          "reviewerNote": { "type": "string", "maxLength": 4000 }
        },
        "allOf": [
          { "if": { "properties": { "status": { "enum": ["supports", "contradicts"] } }, "required": ["status"] },
            "then": { "properties": { "sourceUrl": { "minLength": 1 }, "sourceExcerpt": { "minLength": 1 } } } }
        ]
      }
    },
    "interpretation": { "type": "string", "maxLength": 4000 },
    "agentInstructions": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "string", "minLength": 1 } }
  }
}
