{
  "$defs": {
    "GateAppliesTo": {
      "additionalProperties": false,
      "properties": {
        "kinds": {
          "description": "Artifact kinds; '*' for every kind.",
          "items": {
            "type": "string"
          },
          "title": "Kinds",
          "type": "array"
        },
        "operations": {
          "description": "Non-transition hooks: combine, export, ...",
          "items": {
            "type": "string"
          },
          "title": "Operations",
          "type": "array"
        },
        "transitions": {
          "description": "Target states that trigger the gate ('checks_running', ...); '*' all.",
          "items": {
            "type": "string"
          },
          "title": "Transitions",
          "type": "array"
        }
      },
      "title": "GateAppliesTo",
      "type": "object"
    },
    "ProposedThreshold": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Note"
        },
        "proposed": {
          "default": true,
          "title": "Proposed",
          "type": "boolean"
        },
        "value": {
          "title": "Value"
        }
      },
      "required": [
        "name",
        "value"
      ],
      "title": "ProposedThreshold",
      "type": "object"
    }
  },
  "$id": "https://schemas.ump.dev/v1/gate-definition.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "applies_to": {
      "$ref": "#/$defs/GateAppliesTo"
    },
    "area": {
      "title": "Area",
      "type": "string"
    },
    "extra_note_codes": {
      "items": {
        "type": "string"
      },
      "title": "Extra Note Codes",
      "type": "array"
    },
    "fallback_handler": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Fallback Handler"
    },
    "id": {
      "title": "Id",
      "type": "string"
    },
    "implemented_in_poc": {
      "default": true,
      "title": "Implemented In Poc",
      "type": "boolean"
    },
    "instead": {
      "default": "",
      "description": "What happens instead, from the spec table.",
      "title": "Instead",
      "type": "string"
    },
    "note_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Note Code"
    },
    "on_fail": {
      "enum": [
        "hard_stop",
        "exclude_and_continue",
        "fallback",
        "route",
        "warn",
        "info",
        "computed"
      ],
      "title": "On Fail",
      "type": "string"
    },
    "policy_version": {
      "default": "gates/0.1.0",
      "title": "Policy Version",
      "type": "string"
    },
    "route_to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Route To"
    },
    "rule": {
      "description": "Plain-words rule from the spec.",
      "title": "Rule",
      "type": "string"
    },
    "spec_ref": {
      "default": "",
      "title": "Spec Ref",
      "type": "string"
    },
    "status": {
      "default": "active",
      "description": "Registry status (spec \u00a721): gates the reference implementation uses but the spec does not define are 'provisional' and MUST NOT be presented as normative.",
      "enum": [
        "provisional",
        "active",
        "deprecated"
      ],
      "title": "Status",
      "type": "string"
    },
    "strict_override": {
      "default": false,
      "description": "Can strict mode turn the fallback into a stop?",
      "title": "Strict Override",
      "type": "boolean"
    },
    "strict_status": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Strict Status"
    },
    "thresholds": {
      "items": {
        "$ref": "#/$defs/ProposedThreshold"
      },
      "title": "Thresholds",
      "type": "array"
    },
    "title": {
      "title": "Title",
      "type": "string"
    }
  },
  "required": [
    "id",
    "area",
    "title",
    "rule",
    "on_fail"
  ],
  "title": "GateDefinition",
  "type": "object"
}
