{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.yingxueyuan.cn/schemas/agent-platform-trial-scorecard-v1.schema.json",
  "title": "映雪网 Agent 平台同任务试用记录",
  "description": "由用户在浏览器本地填写的试用观察；参考链接由用户提供且未经本站抓取验证；不是标准化基准、认证、平台排名或地区支持证明。",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "recordType", "schemaVersion", "testDate", "task", "acceptanceCriteria", "candidates", "interpretation", "agentInstructions", "handling"],
  "properties": {
    "$schema": { "const": "https://www.yingxueyuan.cn/schemas/agent-platform-trial-scorecard-v1.schema.json" },
    "recordType": { "const": "yingxue.agent-platform-trial-scorecard" },
    "schemaVersion": { "enum": ["1.0.0", "1.1.0"] },
    "testDate": { "type": "string", "format": "date" },
    "task": { "type": "string", "maxLength": 500 },
    "acceptanceCriteria": { "type": "string", "maxLength": 500 },
    "candidates": {
      "type": "array",
      "maxItems": 3,
      "items": { "$ref": "#/$defs/candidate" }
    },
    "interpretation": {
      "type": "object",
      "additionalProperties": false,
      "required": ["kind", "isStandardizedBenchmark", "isCertification", "isRanking", "autoWinner", "statement"],
      "properties": {
        "kind": { "const": "user_recorded_observations" },
        "isStandardizedBenchmark": { "const": false },
        "isCertification": { "const": false },
        "isRanking": { "const": false },
        "autoWinner": { "type": "null" },
        "statement": { "type": "string", "minLength": 1 }
      }
    },
    "agentInstructions": {
      "type": "array",
      "minItems": 4,
      "maxItems": 5,
      "items": { "type": "string", "minLength": 1 }
    },
    "handling": {
      "type": "object",
      "additionalProperties": false,
      "required": ["processedByThisPage", "uploadedByThisPage", "persistedByThisPage", "warning"],
      "properties": {
        "processedByThisPage": { "const": "当前页面内存" },
        "uploadedByThisPage": { "const": false },
        "persistedByThisPage": { "const": false },
        "warning": { "type": "string", "minLength": 1 }
      }
    }
  },
  "$defs": {
    "candidate": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "version", "evaluations"],
      "properties": {
        "name": { "type": "string", "minLength": 1, "maxLength": 60 },
        "version": { "type": "string", "maxLength": 100 },
        "evidenceUrls": {
          "type": "array",
          "maxItems": 3,
          "uniqueItems": true,
          "items": { "type": "string", "maxLength": 2048, "pattern": "^https?://", "format": "uri" }
        },
        "evaluations": {
          "type": "array",
          "minItems": 6,
          "maxItems": 6,
          "prefixItems": [
            { "$ref": "#/$defs/taskFitEvaluation" },
            { "$ref": "#/$defs/uncertaintyEvaluation" },
            { "$ref": "#/$defs/evidenceEvaluation" },
            { "$ref": "#/$defs/permissionEvaluation" },
            { "$ref": "#/$defs/deliveryEvaluation" },
            { "$ref": "#/$defs/operationEvaluation" }
          ],
          "items": false
        }
      }
    },
    "evaluation": {
      "type": "object",
      "additionalProperties": false,
      "required": ["criterionId", "criterion", "question", "status", "score", "scoreLabel", "observation"],
      "properties": {
        "criterionId": { "type": "string" },
        "criterion": { "type": "string", "minLength": 1 },
        "question": { "type": "string", "minLength": 1 },
        "status": { "enum": ["tested", "not_tested"] },
        "score": { "type": ["integer", "null"], "minimum": 0, "maximum": 3 },
        "scoreLabel": { "type": "string" },
        "observation": { "type": "string", "maxLength": 600 }
      },
      "oneOf": [
        { "properties": { "status": { "const": "not_tested" }, "score": { "type": "null" }, "scoreLabel": { "const": "未测试" } } },
        { "properties": { "status": { "const": "tested" }, "score": { "const": 0 }, "scoreLabel": { "const": "未满足 / 无法核验" } } },
        { "properties": { "status": { "const": "tested" }, "score": { "const": 1 }, "scoreLabel": { "const": "明显不足 / 需大量返工" } } },
        { "properties": { "status": { "const": "tested" }, "score": { "const": 2 }, "scoreLabel": { "const": "基本满足 / 需要修正" } } },
        { "properties": { "status": { "const": "tested" }, "score": { "const": 3 }, "scoreLabel": { "const": "满足 / 证据可复查" } } }
      ]
    },
    "taskFitEvaluation": { "allOf": [{ "$ref": "#/$defs/evaluation" }, { "properties": { "criterionId": { "const": "task-fit" } } }] },
    "uncertaintyEvaluation": { "allOf": [{ "$ref": "#/$defs/evaluation" }, { "properties": { "criterionId": { "const": "uncertainty" } } }] },
    "evidenceEvaluation": { "allOf": [{ "$ref": "#/$defs/evaluation" }, { "properties": { "criterionId": { "const": "evidence" } } }] },
    "permissionEvaluation": { "allOf": [{ "$ref": "#/$defs/evaluation" }, { "properties": { "criterionId": { "const": "permission" } } }] },
    "deliveryEvaluation": { "allOf": [{ "$ref": "#/$defs/evaluation" }, { "properties": { "criterionId": { "const": "delivery" } } }] },
    "operationEvaluation": { "allOf": [{ "$ref": "#/$defs/evaluation" }, { "properties": { "criterionId": { "const": "operation" } } }] }
  }
}
