{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://relgap.sasskovacs.dev/schemas/config-v1.json",
  "properties": {
    "schema_version": {
      "type": "integer",
      "enum": [
        1
      ],
      "description": "Config file format version."
    },
    "github": {
      "properties": {
        "host": {
          "type": "string",
          "minLength": 1,
          "description": "Reserved for GitHub Enterprise Server. relgap doesn't read it yet and always calls github.com."
        },
        "concurrency": {
          "type": "integer",
          "maximum": 64,
          "minimum": 1,
          "description": "Maximum concurrent requests per tool."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "cache": {
      "properties": {
        "dir": {
          "type": "string",
          "description": "Cache directory. Empty means $XDG_CACHE_HOME/relgap."
        },
        "ttl_override": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "description": "Per-source TTL overrides as Go durations, e.g. {endoflife: 24h}."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "scan": {
      "properties": {
        "roots": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Directories scanned by drift and pins when no roots are given."
        },
        "exclude": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Glob patterns excluded from scanning."
        },
        "detectors": {
          "properties": {
            "ci_actions": {
              "type": "boolean",
              "description": "Also report the uses: pins of GitHub Actions in workflow files. Tool versions in CI files are read either way."
            },
            "generic": {
              "type": "boolean",
              "description": "Detect NAME_VERSION=x.y.z assignments in extra_files."
            }
          },
          "additionalProperties": false,
          "type": "object"
        },
        "extra_files": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Extra glob patterns read by the renovate-comment detector, and by the generic detector when it is on."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "tools": {
      "additionalProperties": {
        "properties": {
          "repo": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)+$",
            "description": "owner/repo on GitHub, workspace/repo on Bitbucket Cloud, or the project path on GitLab."
          },
          "host": {
            "type": "string",
            "pattern": "^[A-Za-z0-9.-]+$",
            "description": "Host of repo: github.com (the default), bitbucket.org, gitlab.com or a host in gitlab.hosts."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "repo"
        ]
      },
      "type": "object",
      "description": "Local tool overrides and additions, keyed by tool name."
    },
    "aliases": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "description": "Maps a raw pin name (e.g. TG_VERSION) to a tool name."
    },
    "ignore": {
      "items": {
        "anyOf": [
          {
            "required": [
              "tool"
            ],
            "title": "tool"
          },
          {
            "required": [
              "name"
            ],
            "title": "name"
          },
          {
            "required": [
              "path"
            ],
            "title": "path"
          }
        ],
        "properties": {
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool name, as pins and digests show it, to leave out of reports."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Glob on the pin's raw name, as relgap pins shows it; * matches any characters. Matches unresolved pins too."
          },
          "path": {
            "type": "string",
            "description": "Glob on the file path; with tool or name, the rule applies only under matching paths."
          }
        },
        "additionalProperties": false,
        "type": "object"
      },
      "type": "array",
      "description": "Pins that are never reported: by tool, by raw name or by path, alone or together."
    },
    "policy": {
      "properties": {
        "fail_on": {
          "items": {
            "type": "string",
            "enum": [
              "breaking",
              "deprecation",
              "eol",
              "vuln",
              "drift",
              "outdated",
              "unchecked",
              "kev"
            ]
          },
          "type": "array",
          "description": "--fail-on values each command uses when the flag is not given; a command ignores the values it doesn't check. audit always gates vuln, and its values here add to it. kev needs vulns.kev."
        },
        "max_behind": {
          "type": "string",
          "pattern": "^((major|minor|patch|releases|days):[0-9]+)?$",
          "description": "e.g. minor:2, releases:10, days:90."
        },
        "min_confidence": {
          "type": "number",
          "maximum": 1,
          "minimum": 0,
          "description": "Entries below this confidence are hidden."
        },
        "vuln_severity": {
          "type": "string",
          "enum": [
            "",
            "low",
            "medium",
            "high",
            "critical"
          ],
          "description": "Lowest OSV rating --fail-on vuln counts; an advisory without a rating always counts, and empty counts every advisory."
        },
        "vuln_fixable": {
          "type": "boolean",
          "description": "--fail-on vuln counts only advisories with a fixed version above the pinned one. Advisories without one still show in the report."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "vulns": {
      "properties": {
        "ignore": {
          "items": {
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "Advisory ID or any of its aliases, such as GHSA-cxww-7g56-2vh6, GO-2024-3080 or CVE-2024-42471."
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "description": "Why the advisory is accepted. Reports show it next to the advisory."
              },
              "until": {
                "type": "string",
                "format": "date",
                "description": "Last day (YYYY-MM-DD, UTC) the entry applies. After it the entry suppresses nothing and relgap warns."
              },
              "tools": {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "description": "Tool names as pins show them, where * matches any characters: kubectl, npm:*, action:actions/*. Empty means every tool."
              }
            },
            "additionalProperties": false,
            "type": "object",
            "required": [
              "id",
              "reason"
            ]
          },
          "type": "array",
          "description": "Advisories to suppress, by ID or any alias. A suppressed advisory stays in the report with its reason and doesn't count for --fail-on."
        },
        "vex": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "OpenVEX v0.2.0 documents whose not_affected and fixed statements suppress advisories, like --vex. A relative path resolves against the directory of the config file that lists it."
        },
        "kev": {
          "type": "boolean",
          "description": "Mark advisories in the CISA Known Exploited Vulnerabilities catalog, like --kev. relgap then fetches the catalog from www.cisa.gov once a day."
        },
        "epss": {
          "type": "boolean",
          "description": "Add the FIRST EPSS score of each advisory's CVE, like --epss. relgap then sends the CVE IDs to api.first.org."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "llm": {
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "",
            "openai-compatible",
            "anthropic",
            "bedrock",
            "bedrock-mantle"
          ],
          "description": "Empty disables the summarizer."
        },
        "model": {
          "type": "string",
          "description": "Model ID the provider runs. Required when provider is set."
        },
        "base_url": {
          "type": "string",
          "description": "API base URL. Required for openai-compatible; anthropic and bedrock-mantle have a default."
        },
        "api_key_env": {
          "type": "string",
          "description": "Name of the env var holding the API key. Keys are never read from files."
        },
        "api": {
          "type": "string",
          "enum": [
            "",
            "messages",
            "chat-completions"
          ],
          "description": "bedrock-mantle only. Empty means messages for anthropic.* model IDs and chat-completions otherwise."
        },
        "aws_profile": {
          "type": "string",
          "description": "AWS profile for bedrock and bedrock-mantle. Empty means the default credentials."
        },
        "max_input_tokens": {
          "type": "integer",
          "minimum": 1,
          "description": "Largest prompt, in estimated tokens. Lower-confidence entries are dropped first to fit."
        },
        "timeout": {
          "type": "string",
          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
          "description": "Hard limit on the model call, as a Go duration. A timeout is a warning."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "gitlab": {
      "properties": {
        "hosts": {
          "items": {
            "properties": {
              "host": {
                "type": "string",
                "pattern": "^[A-Za-z0-9.-]+(:[0-9]+)?$",
                "description": "Host name, such as gitlab.example.com."
              },
              "token_env": {
                "type": "string",
                "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
                "description": "Env var with this host's token, sent in PRIVATE-TOKEN to this host only. Empty means GITLAB_TOKEN when GITLAB_HOST names this host."
              }
            },
            "additionalProperties": false,
            "type": "object",
            "required": [
              "host"
            ]
          },
          "type": "array",
          "description": "Self-managed GitLab hosts. A git source on a host that isn't listed stays unresolved."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "images": {
      "properties": {
        "registries": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Registries to read images and oci:// charts from besides Docker Hub, ghcr.io, registry.k8s.io, quay.io, public.ecr.aws and mcr.microsoft.com. relgap asks every registry for anonymous tokens only."
        }
      },
      "additionalProperties": false,
      "type": "object"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "title": "relgap configuration",
  "description": "Schema for $XDG_CONFIG_HOME/relgap/config.yaml and .relgap.yaml. Generated from internal/config by `mise run test:golden -- -update`; do not edit."
}
