{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dsolisp.github.io/gavel/schemas/gavel-config.schema.json",
  "title": "Gavel config",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "preset": {
      "type": "string",
      "enum": ["recommended", "strict", "legacy", "api-only"]
    },
    "failThreshold": {
      "type": "string",
      "enum": ["off", "info", "warning", "error", "blocker"],
      "default": "warning"
    },
    "reportOnlyExits": { "type": "boolean", "default": false },
    "allowlist": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["file", "tag"],
        "properties": {
          "file": { "type": "string" },
          "tag": { "type": "string" },
          "line": { "type": "integer", "minimum": 1 }
        }
      }
    },
    "testIdPrefix": { "type": "string" },
    "testIdPattern": { "type": "string" },
    "enforceConsecutiveTestIds": { "type": "boolean", "default": false },
    "fixturePaths": { "type": "array", "items": { "type": "string" } },
    "factoryPaths": { "type": "array", "items": { "type": "string" } },
    "excludePaths": {
      "type": "array",
      "items": { "type": "string" },
      "default": ["scripts/**", "fixtures/**", "tools/**", "utility_scripts/**"]
    },
    "paths": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["pattern", "weight", "label"],
        "properties": {
          "pattern": { "type": "string" },
          "weight": { "type": "number", "minimum": 0, "maximum": 2 },
          "label": { "type": "string" }
        }
      }
    },
    "selectorAllowlist": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "componentPrefixes": { "type": "array", "items": { "type": "string" } },
        "customElements": { "type": "boolean", "default": false }
      }
    },
    "criticalAreas": { "type": "array", "items": { "type": "string" } },
    "criticalTags": { "type": "array", "items": { "type": "string" } },
    "skipPrefixes": { "type": "array", "items": { "type": "string" } },
    "areaMap": {
      "type": "object",
      "additionalProperties": { "type": ["string", "object"] }
    }
  }
}
