{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/lyse-labs/lyse/raw/main/schemas/v1/lyse-config.json",
  "title": "Lyse .lyse.yaml config",
  "description": "Mirrors LyseConfigSchema in src/config/schema.ts (the zod contract that actually validates .lyse.yaml). Kept in sync by tests/config/schema-json-parity.test.ts.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "designSystem": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "componentsModule": { "type": "string" },
        "elements": { "type": "object", "additionalProperties": { "type": "string" } },
        "excludePaths": { "type": "array", "items": { "type": "string" } }
      }
    },
    "rules": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          { "type": "string", "const": "off" },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "severity": { "type": "string", "enum": ["error", "warning", "info", "off"] },
              "tolerance": { "type": "number" },
              "disable": { "type": "array", "items": { "type": "string" } }
            }
          }
        ]
      }
    },
    "scoring": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "aiGovernanceGraceWindow": { "type": "integer", "minimum": 1 },
        "model": { "type": "string", "enum": ["v2", "v3"] },
        "minSampleSize": { "type": "integer", "minimum": 1 }
      }
    },
    "i18n": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "locales": { "type": "array", "items": { "type": "string" } },
        "vocabulary": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "aiNouns": { "type": "array", "items": { "type": "string" } },
            "disclaimerPhrases": { "type": "array", "items": { "type": "string" } },
            "controlLabels": { "type": "array", "items": { "type": "string" } },
            "gatePhrases": { "type": "array", "items": { "type": "string" } },
            "loadingPhrases": { "type": "array", "items": { "type": "string" } }
          }
        }
      }
    },
    "llm": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string",
          "enum": ["anthropic", "openai", "openai-compatible", "mcp", "none", "auto", "agent-cli"],
          "description": "LLM provider. 'none' is accepted but deprecated — loadConfig rewrites it to staticOnly: true."
        },
        "model": { "type": "string" },
        "endpoint": { "type": "string" },
        "connector": {
          "type": "string",
          "enum": ["auto", "mcp-host", "openrouter", "direct-api-key", "ollama", "agent-cli"]
        },
        "costCapUsd": { "type": "number", "exclusiveMinimum": 0 },
        "cacheMaxAgeDays": { "type": "number", "exclusiveMinimum": 0 },
        "staticOnly": { "type": "boolean" }
      }
    },
    "advisory": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "migrationScaleFileCount": { "type": "integer", "minimum": 2 }
      }
    },
    "handoff": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "review": { "type": "boolean" }
      }
    }
  }
}
