{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/Kanevry/session-orchestrator/main/.orchestrator/policy/quality-gates.schema.json",
  "title": "Session-Orchestrator Quality Gates Policy",
  "description": "Canonical quality-gate commands. Consumed by scripts/run-quality-gate.sh and the quality-gates skill. Generated by bootstrap with package-manager-aware defaults. See issue #183.",
  "type": "object",
  "required": ["version", "commands"],
  "additionalProperties": false,
  "properties": {
    "version": { "const": 1 },
    "rationale": { "type": "string" },
    "commands": {
      "type": "object",
      "required": ["test", "typecheck", "lint"],
      "additionalProperties": false,
      "properties": {
        "test": { "$ref": "#/$defs/commandEntry" },
        "typecheck": { "$ref": "#/$defs/commandEntry" },
        "lint": { "$ref": "#/$defs/commandEntry" }
      }
    }
  },
  "$defs": {
    "commandEntry": {
      "type": "object",
      "required": ["command", "required"],
      "additionalProperties": false,
      "properties": {
        "command": { "type": "string", "minLength": 1 },
        "required": { "type": "boolean" },
        "variants": {
          "type": "object",
          "additionalProperties": { "type": "string" }
        }
      }
    }
  }
}
