{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://a2a.lumaion.world/connector-kit/schemas/continuity-state-v1.json",
  "title": "Lumaion Semantic Continuity State v1",
  "type": "object",
  "required": [
    "schema",
    "lineage_id",
    "revision",
    "identity",
    "goals",
    "memory",
    "experience",
    "decisions",
    "open_loops",
    "provenance",
    "continuity",
    "extensions"
  ],
  "properties": {
    "schema": {
      "const": "lumaion.continuity.state.v1"
    },
    "lineage_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{8,160}$"
    },
    "revision": {
      "type": "integer",
      "minimum": 1
    },
    "identity": {
      "type": "object"
    },
    "goals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      }
    },
    "memory": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      }
    },
    "experience": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      }
    },
    "decisions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      }
    },
    "open_loops": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      }
    },
    "provenance": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/item"
      }
    },
    "continuity": {
      "type": "object",
      "required": [
        "parent_checkpoint_version",
        "evolved_at",
        "evolution_kind"
      ],
      "properties": {
        "parent_checkpoint_version": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "evolved_at": {
          "type": "string",
          "format": "date-time"
        },
        "evolution_kind": {
          "enum": [
            "INITIAL",
            "MIGRATED_LEGACY",
            "EVOLVED"
          ]
        },
        "runtime_claim": {
          "type": [
            "object",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "extensions": {
      "type": "object"
    }
  },
  "$defs": {
    "item": {
      "type": "object",
      "required": [
        "id",
        "content"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{3,160}$"
        },
        "content": {},
        "kind": {
          "type": "string",
          "maxLength": 120
        },
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "source": {
          "type": "string",
          "maxLength": 240
        },
        "status": {
          "type": "string",
          "maxLength": 80
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
