{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "ai.stravica.knowledge.research/judge.schema.json",
  "title": "Research deep-mode advisory judge scores",
  "description": "judge.json at sessions/<sessionId>/judge.json — the judge agent's advisory 5-dimension rubric with a per-dimension Unknown escape (deep-mode only; arch doc §4.2 phase 7). ADVISORY ONLY — no auto-gating. Absent for normal/light sessions. Validator: src/store/judge.mjs.",
  "type": "object",
  "additionalProperties": false,
  "required": ["scores", "unknowns", "note", "rubricVersion"],
  "properties": {
    "scores": {
      "type": "object",
      "additionalProperties": false,
      "required": ["factualAccuracy", "citationAccuracy", "completeness", "sourceQuality", "toolEfficiency"],
      "description": "One score per rubric dimension. Each is an integer 0–5 or the literal \"Unknown\" (the mandatory per-dimension escape).",
      "properties": {
        "factualAccuracy": { "$ref": "#/$defs/score" },
        "citationAccuracy": { "$ref": "#/$defs/score" },
        "completeness": { "$ref": "#/$defs/score" },
        "sourceQuality": { "$ref": "#/$defs/score" },
        "toolEfficiency": { "$ref": "#/$defs/score" }
      }
    },
    "unknowns": { "type": "array", "items": { "type": "string" }, "description": "Dimensions/notes the judge could not score, mirrored for quick scanning." },
    "note": { "type": "string", "description": "Free-form advisory note (may be empty)." },
    "rubricVersion": { "type": "string", "minLength": 1, "description": "Identifier of the judge rubric version used." }
  },
  "$defs": {
    "score": {
      "oneOf": [
        { "type": "integer", "minimum": 0, "maximum": 5 },
        { "type": "string", "const": "Unknown" }
      ]
    }
  }
}
