{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "kei-artifact://review",
  "title": "Review Findings",
  "description": "Critic / security / validator output — severity-sorted findings.",
  "type": "object",
  "additionalProperties": false,
  "required": ["reviewer", "findings"],
  "properties": {
    "reviewer": {
      "type": "string",
      "enum": ["kei-critic", "kei-security-auditor", "kei-validator", "kei-architect"]
    },
    "parent_patch_id": {
      "type": "string",
      "minLength": 1
    },
    "findings": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["severity", "title", "file", "line"],
        "properties": {
          "severity": {"type": "string", "enum": ["critical", "high", "medium", "low", "info"]},
          "category": {"type": "string", "enum": ["security", "bug", "anti-pattern", "performance", "tech-debt", "style"]},
          "title": {"type": "string", "minLength": 1},
          "file": {"type": "string", "minLength": 1},
          "line": {"type": "integer", "minimum": 0},
          "problem": {"type": "string"},
          "impact": {"type": "string"},
          "fix": {"type": "string"}
        }
      }
    },
    "verdict": {
      "type": "string",
      "enum": ["approve", "request_changes", "reject"]
    }
  }
}
