{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://github.com/hegemonart/get-design-done/reference/schemas/registry.schema.json",
  "title": "Reference Registry",
  "description": "Typed index of every reference/*.md (and reference/*.json default) in the plugin. Enables agents to query by type instead of grep-hunting import strings. Round-trip enforced: every reference/*.md must appear in entries[], every entry must resolve to an existing file.",
  "type": "object",
  "required": [
    "version",
    "generated_at",
    "entries"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "version": {
      "const": 1
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "path",
          "type"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9-._]*$"
          },
          "path": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "easing",
              "taxonomy",
              "preamble",
              "output-contract",
              "heuristic",
              "schema",
              "defaults",
              "surfaces",
              "motion",
              "influences",
              "meta-rules",
              "data",
              "authority-feed",
              "principles",
              "emotional-design",
              "experience",
              "palette",
              "style-vocabulary",
              "typography",
              "layout",
              "performance",
              "component-spec",
              "domain-index",
              "stack-addendum"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "system",
              "framework",
              "motion"
            ],
            "description": "Phase 54 stack-addendum category. Drives mapper-spawn.cjs composition (1 system + 1 framework + 1 motion cap). Present only on type:stack-addendum entries; classifyEntry also infers it from the path dir, so it is an explicit reinforcement, not strictly required."
          },
          "composes_into": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Phase 54 stack-addendum composition targets — the explore mapper names (e.g. token-mapper, component-taxonomy-mapper, motion-mapper) this addendum is appended into pre-spawn. Read by scripts/lib/mapper-spawn.cjs composeAddendums(). Present only on type:stack-addendum entries."
          },
          "tier": {
            "enum": [
              "L0",
              "L1",
              "L2"
            ]
          },
          "phase": {
            "type": "number",
            "description": "Phase that introduced this entry. Numbers are allowed (e.g., 19.6, 27.5, 27.6, 27.7, 28.5) — decimal phases are valid per the long-standing precedent established by Phases 19.6 / 27.5 / 27.6 / 27.7 / 28.5."
          },
          "description": {
            "type": "string"
          },
          "registered_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
