{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://alexanarch.org/api/schemas/deposit-entry.schema.json",
  "title": "Alexanarch Deposit Entry",
  "description": "Schema for a single entry in data/registry.json's deposits array. Enforced by scripts/validate_deposit.py and .github/workflows/validate-registry.yml.",
  "type": "object",
  "required": [
    "deposit_number",
    "axn",
    "hex",
    "family",
    "emoji",
    "hash",
    "title",
    "creator",
    "date",
    "description",
    "content_type",
    "license",
    "substrate"
  ],
  "properties": {
    "deposit_number": {
      "type": "integer",
      "minimum": 1,
      "description": "The canonical key for this deposit. Contiguous from 1 across the registry."
    },
    "axn": {
      "type": "string",
      "pattern": "^AXN:[0-9A-F]{2,4}\\.[A-Z]+\\.[^.]{1,}$",
      "description": "Canonical AXN v2 identifier. See /api/axn-protocol.json."
    },
    "hex": {
      "type": "string",
      "pattern": "^[0-9A-F]{2,4}$",
      "description": "Uppercase hex label. Treat as opaque."
    },
    "family": {
      "type": "string",
      "enum": [
        "GOVERNANCE",
        "EMPIRICAL",
        "GENERATIVE",
        "ARCHIVAL",
        "PHILOLOGICAL",
        "STRUCTURAL",
        "COMPOSITIONAL",
        "OPERATIVE",
        "HETERONYMIC",
        "MPAI",
        "DATASET",
        "UNCLASSIFIED"
      ]
    },
    "emoji": {
      "type": "string",
      "description": "6-emoji canonical glyph. Grapheme count enforced by validate_deposit.py rule AXN-002."
    },
    "hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$",
      "description": "SHA-256 of canonical bytes."
    },
    "title": {"type": "string", "minLength": 1},
    "creator": {"type": "string", "minLength": 1},
    "orcid": {"type": "string"},
    "date": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
    "description": {"type": "string", "minLength": 1},
    "content_type": {"type": "string", "minLength": 1},
    "license": {"type": "string", "minLength": 1},
    "substrate": {"type": "string", "minLength": 1},
    "keywords": {
      "oneOf": [
        {"type": "array", "items": {"type": "string"}},
        {"type": "string"}
      ]
    },
    "version": {"type": "string"},
    "status": {"type": "string"},
    "axn_schema_version": {"type": "string", "enum": ["v1", "v2"]},
    "protocol_version": {"type": "string"},
    "legacy_axn": {"type": "string"},
    "axn_history": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["axn", "schema_version", "retired_at", "reason"],
        "properties": {
          "axn": {"type": "string"},
          "schema_version": {"type": "string"},
          "retired_at": {"type": "string"},
          "reason": {"type": "string"}
        }
      }
    },
    "glyphic_canary": {
      "oneOf": [
        {"type": "string"},
        {"type": "object"}
      ],
      "description": "Substrate-chosen recognition glyph (separate from canonical AXN). See axn-protocol.json identity_vs_recognition."
    },
    "full_text_path": {"type": "string"},
    "wiki_article": {"type": ["string", "null"]},
    "wiki_status": {"type": "string"},
    "entities": {"type": "array"},
    "entity_status": {"type": "string"},
    "defines_concepts": {"type": "array"},
    "related_deposits": {"type": "array"},
    "version_series_id": {"type": "string"},
    "version_in_series": {"type": "integer"}
  },
  "additionalProperties": true
}
