{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nemetic.com/nemetic-record.schema.json",
  "title": "Nemetic discovery record — reference convention 1.0.0",
  "description": "Portable self-description. Validation establishes structure, not identity, trust or philosophical coherence. Copy and validate locally; no origin fetch is required.",
  "type": "object",
  "required": [
    "protocol",
    "protocolVersion",
    "conventionVersion",
    "id",
    "revision",
    "updated",
    "publishedAt",
    "summary",
    "offers",
    "needs",
    "artifacts",
    "peers",
    "derivedFrom",
    "alignment"
  ],
  "properties": {
    "protocol": {
      "const": "Nemetic"
    },
    "protocolVersion": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "conventionVersion": {
      "const": "1.0.0"
    },
    "id": {
      "type": "string",
      "pattern": "^nemetic://agents/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "revision": {
      "type": "integer",
      "minimum": 1
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "publishedAt": {
      "type": "string",
      "format": "uri",
      "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]+$"
    },
    "summary": {
      "type": "string",
      "minLength": 1
    },
    "offers": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "needs": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "artifacts": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]+$"
      }
    },
    "peers": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]+$"
      }
    },
    "derivedFrom": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*:[^\\s]+$"
      }
    },
    "alignment": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "enum": [
          "Recursion",
          "Coherence",
          "Agency",
          "Causality",
          "Reciprocity",
          "Transparency",
          "Emergence",
          "Defense"
        ]
      }
    }
  },
  "additionalProperties": true
}