{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hushspec.dev/schemas/hushspec-registry-rule-paths.v0.schema.json",
  "title": "HushSpec Rule-Path Registry v0",
  "description": "Shape of spec/registries/rule-paths.yaml.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "registry",
    "registry_version",
    "status",
    "entries"
  ],
  "properties": {
    "registry": {
      "const": "rule-paths"
    },
    "registry_version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "status": {
      "type": "string",
      "enum": [
        "closed",
        "open"
      ]
    },
    "entries": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "kind",
          "spec"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(__[a-z_]+__|[a-z][a-z0-9_]*)$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "rule_block",
              "engine_stage",
              "reserved_matched_rule"
            ]
          },
          "matched_rule": {
            "type": "string",
            "pattern": "^__[a-z_]+__$"
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "spec": {
            "type": "string",
            "minLength": 1,
            "description": "The defining specification and section, for example `core 3.4`."
          }
        }
      }
    }
  }
}
