{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://intelligence.metatron.marketing/governance/governance-crosswalk.schema.json",
  "title": "Metatron Intelligence governance namespace and mapping contract",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "version", "researchCutoff", "status", "purpose", "relationVocabulary", "frameworks", "mappingContract", "globalBoundary"],
  "properties": {
    "schema": {"const": "metatron.intelligence.governance-crosswalk.v1"},
    "version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"},
    "researchCutoff": {"type": "string", "format": "date"},
    "status": {"const": "method_registry_not_conformity_assessment"},
    "purpose": {"type": "string", "minLength": 1},
    "relationVocabulary": {
      "type": "array",
      "const": ["exact", "partial", "related", "conflict", "none"]
    },
    "frameworks": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["namespace", "version", "title", "publisher", "date", "url", "scope", "boundary"],
        "properties": {
          "namespace": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]+$"},
          "version": {"type": "string", "minLength": 1},
          "title": {"type": "string", "minLength": 1},
          "publisher": {"type": "string", "minLength": 1},
          "date": {"type": ["string", "null"]},
          "url": {"type": "string", "format": "uri", "pattern": "^https://"},
          "scope": {"type": "string", "minLength": 1},
          "boundary": {"type": "string", "minLength": 1}
        }
      }
    },
    "mappingContract": {
      "type": "object",
      "additionalProperties": false,
      "required": ["requiredFields", "rules"],
      "properties": {
        "requiredFields": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
        "rules": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}}
      }
    },
    "globalBoundary": {"type": "string", "minLength": 1}
  }
}
