{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://intelligence.metatron.marketing/sources/global/source.schema.json",
  "title": "Metatron global AI source discovery record",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name",
    "publisher",
    "publisherType",
    "canonicalUrl",
    "sourceClass",
    "regions",
    "jurisdictions",
    "languages",
    "languageExpressions",
    "intelligenceDomains",
    "access",
    "publicationPattern",
    "authorityLevel",
    "admissionState",
    "evidenceUse",
    "coverageBoundary",
    "rights",
    "sourceReference"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^AISRC-[A-F0-9]{20}$"
    },
    "name": {
      "type": "string",
      "minLength": 3
    },
    "publisher": {
      "type": "string",
      "minLength": 2
    },
    "publisherType": {
      "enum": [
        "international_organization",
        "regional_organization",
        "national_government",
        "government_research_institute",
        "multi_government_scientific_collaboration"
      ]
    },
    "canonicalUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
    },
    "sourceClass": {
      "enum": [
        "observatory",
        "policy_database",
        "official_portal",
        "strategy",
        "report_series",
        "research_portal",
        "regulatory_service",
        "governance_guide"
      ]
    },
    "regions": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "GLOBAL",
          "AFRICA",
          "LATIN_AMERICA_CARIBBEAN",
          "EAST_ASIA",
          "SOUTH_ASIA",
          "SOUTHEAST_ASIA",
          "MIDDLE_EAST_NORTH_AFRICA",
          "EUROPE",
          "NORTH_AMERICA",
          "OCEANIA"
        ]
      }
    },
    "jurisdictions": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 2
      }
    },
    "languages": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$"
      }
    },
    "languageExpressions": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "language",
          "url",
          "locator",
          "legalStatus",
          "publisherDesignatedEquivalent"
        ],
        "properties": {
          "language": {
            "type": "string",
            "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "locator": {
            "type": "string",
            "minLength": 10
          },
          "legalStatus": {
            "const": "not_separately_assessed"
          },
          "publisherDesignatedEquivalent": {
            "const": false
          }
        }
      }
    },
    "intelligenceDomains": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "adoption",
          "applications",
          "benchmarks",
          "compute",
          "governance",
          "incidents",
          "labor",
          "models",
          "regulation",
          "research",
          "safety"
        ]
      }
    },
    "access": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "formats",
        "machineReadable",
        "accessBoundary"
      ],
      "properties": {
        "formats": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "enum": [
              "html",
              "pdf",
              "interactive",
              "download",
              "api",
              "csv",
              "json",
              "feed"
            ]
          }
        },
        "machineReadable": {
          "type": "boolean"
        },
        "accessBoundary": {
          "type": "string",
          "minLength": 10
        }
      }
    },
    "publicationPattern": {
      "enum": [
        "living_portal",
        "versioned_document",
        "periodic_series",
        "research_stream"
      ]
    },
    "authorityLevel": {
      "enum": [
        "primary_owner",
        "intergovernmental_compilation"
      ]
    },
    "admissionState": {
      "const": "discovery_only"
    },
    "evidenceUse": {
      "type": "string",
      "minLength": 10
    },
    "coverageBoundary": {
      "type": "string",
      "minLength": 20
    },
    "rights": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "boundary"
      ],
      "properties": {
        "status": {
          "enum": [
            "not_assessed",
            "restricted",
            "open_license",
            "permission_verified"
          ]
        },
        "boundary": {
          "type": "string",
          "minLength": 20
        }
      }
    },
    "sourceReference": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "url",
        "locator",
        "observedAt"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "locator": {
          "type": "string",
          "minLength": 3
        },
        "observedAt": {
          "type": "string",
          "format": "date"
        }
      }
    }
  }
}
