{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jayadityavetsa.github.io/PatchProof/patchproof.schema.json",
  "title": "PatchProof configuration",
  "type": "object",
  "additionalProperties": false,
  "required": ["version"],
  "properties": {
    "version": { "const": 1 },
    "base": { "type": "string", "minLength": 1 },
    "head": { "type": "string", "minLength": 1 },
    "adapter": { "enum": ["javascript", "python"] },
    "projectRoot": { "type": "string", "minLength": 1, "default": "." },
    "execution": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "approved": { "type": "boolean", "default": false },
        "setup": { "$ref": "#/$defs/command" },
        "targetedTest": { "$ref": "#/$defs/command" },
        "suite": { "$ref": "#/$defs/command" },
        "timeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 86400 },
        "suiteTimeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 86400 },
        "keepWorktrees": { "type": "boolean", "default": false }
      }
    },
    "tests": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "include": { "$ref": "#/$defs/strings" },
        "exclude": { "$ref": "#/$defs/strings" },
        "support": { "$ref": "#/$defs/strings" }
      }
    },
    "report": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "format": { "enum": ["text", "markdown", "json"] },
        "output": { "type": ["string", "null"] }
      }
    }
  },
  "$defs": {
    "strings": { "type": "array", "items": { "type": "string" } },
    "command": {
      "oneOf": [
        { "type": "string", "minLength": 1 },
        {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string" }
        }
      ]
    }
  }
}
