{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://twinethos.com/schemas/instrument-registry-v0.1.schema.json",
  "title": "TwinEthos Instrument Registry (v0.1)",
  "description": "Machine-readable instrument facts derived from the live rule, source, and pack corpus. MASTER-REGISTRY.md remains the long-form roadmap.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "registry_id",
    "as_of",
    "instruments"
  ],
  "properties": {
    "schema_version": {
      "const": "0.1"
    },
    "registry_id": {
      "const": "instrument-registry"
    },
    "as_of": {
      "type": "string",
      "format": "date"
    },
    "instruments": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "slug",
          "short_name",
          "type",
          "source_text_license",
          "source_artifact_ids",
          "rule_ids",
          "jurisdictions",
          "enforceability_tiers"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
          },
          "short_name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "law",
              "regulation",
              "standard",
              "framework",
              "ethics",
              "guidance",
              "treaty",
              "case_law",
              "recommended_guardrail"
            ]
          },
          "authority": {
            "type": "string"
          },
          "source_text_license": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "S"
            ]
          },
          "official_urls": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "source_artifact_ids": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "rule_ids": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "jurisdictions": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "enforceability_tiers": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "manifest_path": {
            "type": "string"
          }
        }
      }
    }
  }
}
