{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "number",
      "const": 1
    },
    "headSha": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{40}$"
    },
    "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "pattern": "\\S"
    },
    "reviewer": {
      "type": "object",
      "properties": {
        "tool": {
          "type": "string",
          "maxLength": 60
        },
        "model": {
          "type": "string",
          "maxLength": 100
        }
      },
      "additionalProperties": false
    },
    "filesReviewed": {
      "minItems": 1,
      "maxItems": 3000,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024,
        "pattern": "^(?!\\/)(?!(?:.*\\/)?\\.\\.?(?:\\/|$))[^\\r\\n\\u0000]+$"
      }
    },
    "findings": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "pattern": "^(?!\\/)(?!(?:.*\\/)?\\.\\.?(?:\\/|$))[^\\r\\n\\u0000]+$"
          },
          "line": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "startLine": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "side": {
            "type": "string",
            "enum": [
              "RIGHT",
              "LEFT"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "major",
              "minor",
              "nit"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "\\S"
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "\\S"
          },
          "suggestion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "path",
          "severity",
          "title",
          "body"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "version",
    "headSha",
    "summary",
    "filesReviewed",
    "findings"
  ],
  "additionalProperties": false
}
