{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/latitude-so/json-schema/latitude-so-memory-record-change-diff-schema.json",
  "title": "MemoryRecordChangeDiff",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/latitude-so-memory-api-openapi.yml#/components/schemas/MemoryRecordChangeDiff",
  "type": "object",
  "properties": {
    "changeKind": {
      "type": "string",
      "enum": [
        "add",
        "update",
        "remove",
        "read",
        "store_create",
        "store_delete"
      ],
      "description": "Kind of memory operation: `add`/`update`/`remove` (mutations), `read` (retrieval), or `store_create`/`store_delete` (store lifecycle)."
    },
    "beforeBody": {
      "type": [
        "string",
        "null"
      ],
      "description": "The record's body before the change. `null` for the record's first version, a re-create after removal, or when the prior body was not captured."
    },
    "afterBody": {
      "type": [
        "string",
        "null"
      ],
      "description": "The record's body after the change. `null` for a `remove`, or when the body was not captured."
    },
    "degraded": {
      "type": "boolean",
      "description": "`true` when a side's body was unavailable, so the diff is incomplete."
    }
  },
  "required": [
    "changeKind",
    "beforeBody",
    "afterBody",
    "degraded"
  ]
}