{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vantar.xyz/eve/spec/eve-session-v0.schema.json",
  "title": "Eve Session Preface v0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "eve_session",
    "conversation",
    "conversation_identity",
    "plan_identity",
    "role",
    "wire"
  ],
  "properties": {
    "eve_session": {
      "const": "0.1.0"
    },
    "conversation": {
      "$ref": "#/$defs/id"
    },
    "conversation_identity": {
      "$ref": "#/$defs/sha256"
    },
    "plan_identity": {
      "$ref": "#/$defs/sha256"
    },
    "role": {
      "$ref": "#/$defs/id"
    },
    "wire": {
      "enum": ["reference", "compact"]
    },
    "endpoint_identity": {
      "type": "string",
      "minLength": 1,
      "description": "Authenticated transport identity claimed by the sender when the transport exposes one."
    },
    "channel_binding": {
      "type": "string",
      "pattern": "^tls-exporter:[0-9a-f]{64}$",
      "description": "Per-connection TLS exporter binding that prevents preface replay on a different channel."
    }
  },
  "$defs": {
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.-]*$"
    },
    "sha256": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    }
  }
}
