{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://usedeed.app/contracts/deed.design_universe_manifest.v1.schema.json",
  "title": "DEED design universe manifest v1",
  "description": "Complete current primitive universe reconciled against the canonical DEED design catalog.",
  "type": "object",
  "required": ["$schema", "adr", "status", "targetCount", "baselineCommit", "currentCatalogCount", "plannedCount", "reconciliation", "admissionPolicy", "entries"],
  "properties": {
    "$schema": { "const": "https://usedeed.app/contracts/deed.design_universe_manifest.v1.schema.json" },
    "adr": { "const": "ADR-186" },
    "status": { "type": "string", "minLength": 1 },
    "targetCount": { "type": "integer", "minimum": 1 },
    "baselineCommit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
    "currentCatalogCount": { "type": "integer", "minimum": 0 },
    "plannedCount": { "type": "integer", "minimum": 0 },
    "reconciliation": {
      "type": "object",
      "required": ["trackedGaps", "source", "completedAtVersion", "completedOn"],
      "properties": {
        "trackedGaps": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
        "source": { "type": "string", "minLength": 1 },
        "completedAtVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
        "completedOn": { "type": "string", "format": "date" }
      },
      "additionalProperties": false
    },
    "admissionPolicy": { "type": "string", "minLength": 1 },
    "entries": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["ordinal", "name", "cls", "category", "status", "catalogNum"],
        "properties": {
          "ordinal": { "type": "integer", "minimum": 1 },
          "name": { "type": "string", "minLength": 1 },
          "cls": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
          "category": { "type": "string", "minLength": 1 },
          "status": { "enum": ["catalogued", "planned"] },
          "source": { "type": "string", "minLength": 1 },
          "intent": { "type": "string", "minLength": 1 },
          "catalogNum": { "type": "string", "minLength": 1 }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
