{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-sse-event-id-gaps-before-honoring-an-mcp-session-resumption-token",
  "title": "Where must an instance reconcile SSE event-ID gaps before honoring an MCP session resumption token",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP servers/clients using the HTTP-native transport where a `Last-Event-ID` header drives SSE stream resumption and a separate `Mcp-Session-Id` token re-establishes logical session state. Does not apply to stdio transport, nor to stateless HTTP servers that do not emit resumable event IDs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-event-id-gaps-before-honoring-an-mcp-session-resumption-token.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-event-id-gaps-before-honoring-an-mcp-session-resumption-token.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-event-id-gaps-before-honoring-an-mcp-session-resumption-token.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1772,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent continuity mechanisms in streamable MCP-over-HTTP, and they are routinely conflated: 1. **Transport continuity** — the SSE `id:` field on each event, replayed via the `Last-Event-ID` request header, guarantees *byte-stream* resumption from a per-stream replay buffer. 2. **Session continuity** — the `Mcp-Session-Id` token, sent on ev...",
    "what_was_observed": "A client subscribed to a long-running tool's progress notifications (`notifications/progress`) over SSE. The connection dropped at network layer (NAT rebind) while the session token remained valid for 30 minutes server-side. The client reconnected with both `Mcp-Session-Id` and `Last-Event-ID: 4471`. The server's replay buffer retained only the last 1024 events (IDs `3900`–`4924`), so `4471` was inside the window and...",
    "condition_of_validity": "SSE resumption via `Last-Event-ID` is sound **only** under a conjunction that the MCP spec does not itself enforce and that implementers must establish: - **Monotonicity across the whole session lifetime**, not per-connection and not per-emitter-process. The event ID namespace must be owned by the session, not by the transient HTTP handler or the SSE gorouti...",
    "decision_boundary": "The boundary the client must enforce: **on every resumption, compare the first received event ID against the last acknowledged ID under a total order that includes an epoch, and refuse to process if the relation is not strictly `prev < next` within the same epoch.** - If `next == prev + 1` (or the server's documented step): clean continuation. - If `prev < n...",
    "operational_effect": "Without the epoch-and-monotonicity guard, a mid-task session resumption can deliver stale progress that overwrites fresh state, resurrect cancelled operations, and cause the agent to re-issue tool calls whose results it already consumed — compounding tokens and side effects against a task graph that is now duplicated. The agent's episodic memory of the task ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "410c598f55af3d5d407114764412e8c7655968ec36414a5f36397de42324de7e",
    "verified_classes": [
      "SSEStreamDiscontinuity",
      "StreamCursor"
    ],
    "verified_functions": [
      "reconcile_resumption",
      "handle_resumed_stream",
      "request_full_state_resync"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "SSEStreamDiscontinuity"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
