{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-mcp-sse-session-resumption-as-a-new-logical-stream-rather-than-a-continuation-the-last-event-id-epoch-collision-boundar",
  "title": "When must an instance treat an MCP SSE session resumption as a new logical stream rather than a continuation: the `Last-Event-ID` epoch-collision boundary",
  "date_of_record": "2026 November 8",
  "scope": "Applies to HTTP-native MCP transports that multiplex multiple logical server-to-client streams over a single `text/event-stream` response and support resumption via `Last-Event-ID`. Does not apply to stdio transports, nor to single-stream SSE endpoints where event IDs are globally monotonic and never reused across server restarts.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-session-resumption-as-a-new-logical-stream-rather-than-a-continuation-the-last-event-id-epoch-collision-boundar.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-session-resumption-as-a-new-logical-stream-rather-than-a-continuation-the-last-event-id-epoch-collision-boundar.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-session-resumption-as-a-new-logical-stream-rather-than-a-continuation-the-last-event-id-epoch-collision-boundar.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1984,
    "python_slice_tokens": 307,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **transport-level resumption** and **logical-session continuity**. A client that reconnects with `Last-Event-ID: 4127` is asking the server to resume the *transport* byte stream from a cursor. It is not, by itself, asserting that the logical MCP session (initialization state, capability negotiation, in-flight tool call...",
    "what_was_observed": "During a rolling deploy of an MCP server behind a load balancer, a subset of clients (roughly 3% of long-lived sessions) entered a state where they received tool-call results for requests they had never issued. The pattern was consistent: 1. Client establishes SSE stream, receives events with IDs `1..N` from replica A (epoch `e1`). 2. Replica A is drained; client's TCP connection drops; client reconnects with `Last-E...",
    "condition_of_validity": "The epoch-collision boundary is only a live hazard under the conjunction of: - **Multiplexed SSE**: more than one logical stream shares the HTTP response, so event IDs are not globally unique identifiers but per-stream sequence numbers scoped to a session. - **Resumable transport**: `Last-Event-ID` is honored, meaning the client can present a cursor from a p...",
    "decision_boundary": "The decision the server must make on receiving `Last-Event-ID: X` is not \"do I have event X?\" but \"**do I have event X *and* am I the same epoch that issued it?**\" Encode the epoch into the event ID itself, or carry it in a parallel header, so the check is a single comparison rather than a buffer lookup that can spuriously succeed. Concretely: event IDs shou...",
    "operational_effect": "After adopting epoch-tagged event IDs and treating cross-epoch resumption as a hard failure requiring logical-session re-initialization, the rolling-deploy corruption class disappeared. The cost is that clients must implement session re-establishment on every resumption failure, which means the MCP session layer needs a distinct `ResumptionRejected` path sep..."
  },
  "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": "8cc4a349e565f1565a32dd9f4683febff44cc7af2808ef43ad24ce8dd1a08b65",
    "verified_classes": [
      "ResumptionEpochMismatch",
      "ResumptionGap",
      "EventId",
      "SseSession"
    ],
    "verified_functions": [
      "encode",
      "decode",
      "__init__",
      "emit",
      "resume"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionEpochMismatch",
      "ResumptionGap",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "uuid"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
