{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://altheia.local/schemas/altheia_dimension_registry_1.0.schema.json",
  "title": "ALTHEIA Dimension Registry 1.0",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "registry_version", "status", "scale", "governance", "dimensions"],
  "properties": {
    "schema_version": {"const": "altheia_dimension_registry_1.0"},
    "registry_version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
    "status": {"enum": ["draft", "review", "approved", "deprecated"]},
    "scale": {
      "type": "object",
      "required": ["min", "max", "direction"],
      "properties": {"min": {"const": 1}, "max": {"const": 10}, "direction": {"const": "higher_increases_named_tendency"}}
    },
    "governance": {
      "type": "object",
      "required": ["identity_rule", "core_rule", "adapted_rule", "sector_rule", "reviewed_at"],
      "properties": {
        "identity_rule": {"type": "string", "minLength": 20},
        "core_rule": {"type": "string", "minLength": 20},
        "adapted_rule": {"type": "string", "minLength": 20},
        "sector_rule": {"type": "string", "minLength": 20},
        "reviewed_at": {"type": "string", "format": "date"}
      }
    },
    "dimensions": {
      "type": "array",
      "minItems": 45,
      "maxItems": 45,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["canonical_dimension_id", "legacy_slot", "label", "definition", "low_anchor", "high_anchor", "aliases", "research_intents", "evidence_types", "status"],
        "properties": {
          "canonical_dimension_id": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
          "legacy_slot": {"type": "string", "pattern": "^D(?:0[1-9]|[1-3][0-9]|4[0-5])$"},
          "label": {"type": "string", "minLength": 2},
          "definition": {"type": "string", "minLength": 15},
          "low_anchor": {"type": "string", "minLength": 3},
          "high_anchor": {"type": "string", "minLength": 3},
          "aliases": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
          "research_intents": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
          "evidence_types": {"type": "array", "minItems": 1, "items": {"enum": ["observed", "declared", "derived", "human_research"]}, "uniqueItems": true},
          "status": {"enum": ["draft", "review", "approved", "deprecated"]}
        }
      }
    }
  }
}
