{
  "type": "object",
  "required": [
    "header",
    "memoryId",
    "revision",
    "ownerId",
    "projectId",
    "kind",
    "content",
    "evidenceIds",
    "createdAt"
  ],
  "properties": {
    "header": {
      "type": "object",
      "required": [
        "namespace",
        "major",
        "minor"
      ],
      "properties": {
        "namespace": {
          "type": "string",
          "const": "ai.aletheion.asm"
        },
        "major": {
          "type": "number",
          "const": 1
        },
        "minor": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "memoryId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "revision": {
      "type": "integer",
      "minimum": 1
    },
    "ownerId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "projectId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "sessionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "kind": {
      "anyOf": [
        {
          "type": "string",
          "const": "observation"
        },
        {
          "type": "string",
          "const": "fact"
        },
        {
          "type": "string",
          "const": "instruction"
        }
      ]
    },
    "content": {
      "type": "string",
      "minLength": 1
    },
    "evidenceIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "uniqueItems": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "tombstonedAt": {
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "type": "object",
      "patternProperties": {
        "^.*$": {}
      }
    }
  },
  "additionalProperties": false,
  "$id": "asm-memory-v1"
}
