{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "default": 1,
      "description": "Configuration format version. Version 1 is the only supported format.",
      "type": "number",
      "const": 1
    },
    "checks": {
      "description": "GitHub Checks behavior.",
      "type": "object",
      "properties": {
        "conclusionMode": {
          "default": "advisory",
          "description": "How Scanveil maps findings to the GitHub Check conclusion.",
          "type": "string",
          "enum": [
            "advisory",
            "fail_on_threshold"
          ]
        },
        "failThreshold": {
          "description": "Severity thresholds used when conclusionMode is fail_on_threshold.",
          "type": "object",
          "properties": {
            "osv": {
              "default": "critical",
              "type": "string",
              "enum": [
                "info",
                "low",
                "medium",
                "high",
                "critical"
              ],
              "description": "Scanveil severity."
            },
            "llm": {
              "default": "critical",
              "type": "string",
              "enum": [
                "info",
                "low",
                "medium",
                "high",
                "critical"
              ],
              "description": "Scanveil severity."
            }
          },
          "required": [
            "osv",
            "llm"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "conclusionMode"
      ],
      "additionalProperties": false
    },
    "scan": {
      "description": "Scanner enablement and scope.",
      "type": "object",
      "properties": {
        "llm": {
          "description": "LLM pull request diff review settings.",
          "type": "object",
          "properties": {
            "enabled": {
              "default": true,
              "type": "boolean"
            },
            "scope": {
              "default": "pr_diff",
              "description": "LLM scan scope for pull request scans. Repository scans use default-branch source snapshots.",
              "type": "string",
              "const": "pr_diff"
            },
            "excludePaths": {
              "default": [
                "dist/**",
                "vendor/**"
              ],
              "description": "Glob patterns excluded from LLM review.",
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "agent": {
              "description": "Experimental LLM agent runner settings.",
              "type": "object",
              "properties": {
                "runner": {
                  "default": "antigravity_experimental",
                  "description": "LLM agent runner implementation.",
                  "type": "string",
                  "enum": [
                    "antigravity_experimental"
                  ]
                },
                "timeoutSeconds": {
                  "default": 900,
                  "description": "Maximum application-level LLM agent runtime in seconds.",
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1800
                },
                "skills": {
                  "description": "Load audit-specific agent skills from .scanveil/skills.",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "default": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "enabled"
                  ],
                  "additionalProperties": false
                },
                "plugins": {
                  "description": "Load audit-specific experimental agent plugins from .scanveil/plugins.",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "default": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "enabled"
                  ],
                  "additionalProperties": false
                },
                "mcp": {
                  "description": "Load audit-specific experimental MCP server definitions from .scanveil/mcp.",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "default": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "enabled"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "runner",
                "timeoutSeconds"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "enabled",
            "scope",
            "excludePaths"
          ],
          "additionalProperties": false
        },
        "osv": {
          "description": "OSV dependency scan settings.",
          "type": "object",
          "properties": {
            "enabled": {
              "default": true,
              "type": "boolean"
            },
            "scope": {
              "default": "changed_lockfiles",
              "description": "OSV scan scope. PR scans use changed lockfiles; repository-wide scans use default-branch lockfiles.",
              "type": "string",
              "const": "changed_lockfiles"
            },
            "lockfileGlobs": {
              "default": [
                "**/pnpm-lock.yaml",
                "**/package-lock.json",
                "**/yarn.lock",
                "**/bun.lock",
                "**/bun.lockb",
                "**/Cargo.lock",
                "**/go.sum",
                "**/requirements*.txt",
                "**/poetry.lock",
                "**/Pipfile.lock",
                "**/uv.lock",
                "**/composer.lock",
                "**/Gemfile.lock"
              ],
              "description": "Glob patterns used to identify dependency lockfiles.",
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "required": [
            "enabled",
            "scope",
            "lockfileGlobs"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "suppression": {
      "description": "Duplicate finding suppression behavior.",
      "type": "object",
      "properties": {
        "enabled": {
          "default": true,
          "type": "boolean"
        },
        "similarityThreshold": {
          "default": 0.7,
          "description": "Minimum similarity score required to suppress a duplicate finding.",
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "maxNearestNeighbors": {
          "default": 10,
          "description": "Maximum number of nearest previous findings used for suppression.",
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        }
      },
      "required": [
        "enabled",
        "similarityThreshold",
        "maxNearestNeighbors"
      ],
      "additionalProperties": false
    },
    "schedule": {
      "description": "Scheduled scan settings.",
      "type": "object",
      "properties": {
        "enabled": {
          "default": true,
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false,
  "description": "JSON Schema for .scanveil/config.yml repository configuration files.",
  "$id": "https://www.scanveil.kexi.dev/schema/scanveil.config.schema.json",
  "title": "Scanveil repository configuration"
}