{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mememtech.com/content/schemas/mememtech.packet.schema.json",
  "title": "Mememtech Packet v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "packetVersion",
    "packetId",
    "issuedAtUtc",
    "lane",
    "authority",
    "payload",
    "constraints",
    "lineage"
  ],
  "properties": {
    "packetVersion": {
      "const": "mememtech.packet.v1"
    },
    "packetId": {
      "type": "string",
      "minLength": 3
    },
    "issuedAtUtc": {
      "type": "string",
      "format": "date-time",
      "pattern": "Z$"
    },
    "lane": {
      "type": "string",
      "enum": [
        "short-term-handoff",
        "structural-governance",
        "machine-readable-exchange",
        "human-facing-education"
      ]
    },
    "authority": {
      "$ref": "authority-seal.schema.json"
    },
    "payload": {
      "type": "object",
      "minProperties": 1
    },
    "constraints": {
      "type": "object",
      "required": [
        "noSilentAuthorityInheritance",
        "noMergedClaimsWithoutProvenance",
        "runtimeExecution",
        "validUntilUtc"
      ],
      "properties": {
        "noSilentAuthorityInheritance": {
          "type": "boolean"
        },
        "noMergedClaimsWithoutProvenance": {
          "type": "boolean"
        },
        "runtimeExecution": {
          "type": "string"
        },
        "validUntilUtc": {
          "type": "string",
          "format": "date-time",
          "pattern": "Z$"
        }
      },
      "additionalProperties": true
    },
    "lineage": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "source",
          "capturedAtUtc",
          "transform"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "capturedAtUtc": {
            "type": "string",
            "format": "date-time",
            "pattern": "Z$"
          },
          "transform": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
