{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://overdeck.dev/schemas/feature-definition.json",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "changeClass", "owner", "fallback", "defaultState", "readinessChecks", "observability", "reviewDate", "removalCondition", "introduced", "activationPolicy"],
  "properties": {
    "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
    "changeClass": { "enum": ["behavior-change"] },
    "owner": { "type": "string", "minLength": 1 },
    "fallback": { "type": "string", "minLength": 1 },
    "defaultState": { "const": "OFF" },
    "readinessChecks": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
    "observability": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
    "reviewDate": { "type": "string", "format": "date" },
    "removalCondition": { "type": "string", "minLength": 1 },
    "introduced": {
      "type": "object",
      "additionalProperties": false,
      "required": ["task", "sha"],
      "properties": {
        "task": { "type": "string", "pattern": "^#[1-9][0-9]*$" },
        "sha": { "type": "string", "pattern": "^[0-9a-f]{40}$" }
      }
    },
    "activationPolicy": { "enum": ["dark-only", "auto-after-receipts", "product-decision"] }
  }
}
