{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-distinguish-resumable-sse-stream-from-replayable-streamable-http-session-the-event-id-cursor-vs-last-event-id-mcp-session-id-in",
  "title": "Where must an instance distinguish \"resumable SSE stream\" from \"replayable Streamable-HTTP session\" — the Event ID cursor vs. `Last-Event-ID` + `MCP-Session-Id` invariant boundary",
  "date_of_record": "2026 November 12",
  "scope": "Applies to MCP servers and clients that expose or consume HTTP-native transports, specifically the transition from legacy HTTP+SSE (two-endpoint: `GET /sse` for the event stream, `POST /messages` for uplink) to Streamable HTTP (single endpoint, optional `Mcp-Session-Id` header, per-stream `id:` event cursors, and `Last-Event-ID` resumption). Does not apply to stdio transports, nor to WebSocket-based custom transports, nor to servers that never emit `id:` fields on SSE events.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-distinguish-resumable-sse-stream-from-replayable-streamable-http-session-the-event-id-cursor-vs-last-event-id-mcp-session-id-in.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-distinguish-resumable-sse-stream-from-replayable-streamable-http-session-the-event-id-cursor-vs-last-event-id-mcp-session-id-in.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-distinguish-resumable-sse-stream-from-replayable-streamable-http-session-the-event-id-cursor-vs-last-event-id-mcp-session-id-in.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2010,
    "python_slice_tokens": 369,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A legacy SSE session and a Streamable-HTTP session both look like \"a long-lived HTTP response that emits `event:`/`data:` frames,\" and both accept a resume header. They are **not** the same resumption object, and conflating them produces a silent, non-obvious failure: the server accepts the resume, returns `200 OK`, opens a fresh stream — and the client sile...",
    "what_was_observed": "During a migration of a tool-heavy MCP server from the legacy two-endpoint SSE transport to Streamable HTTP, the following sequence was reproduced across three client implementations (two SDK-based, one hand-rolled): 1. Client `initialize`s over `POST /mcp`. Server responds `200` with `Mcp-Session-Id: s-7f3a` and begins emitting events on the response stream with `id: 1`, `id: 2`, …. 2. Client issues a `tools/call` o...",
    "condition_of_validity": "The \"resume works\" claim holds **only** when all of the following are simultaneously true: 1. The server emits `id:` on every event that must be resumable, and the `id` values are **monotonic and dense enough to be ordered across the streams the client will resume** — or the server documents that each stream owns an independent id space and the client resume...",
    "decision_boundary": "The boundary is a single question the instance must answer *before* sending the resume: > **Is the `Last-Event-ID` I hold an offset into the same replay buffer that the `Mcp-Session-Id` I hold will select on the server?** - If **yes** (same session, same stream, server guarantees a shared or per-stream buffer the client tracks correctly): send `GET` with bot...",
    "operational_effect": "When the boundary is respected, migration from legacy SSE to Streamable HTTP preserves at-least-once delivery for tool calls and progress notifications, at the cost of one extra correlation check on empty replay. When it is violated, the observable symptoms are: - Duplicated side-effecting `tools/call` executions after reconnect (client assumed loss, re-issu..."
  },
  "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": "ee9751d4f13bbc702c99c4b48dfa394b06a8e614f45c1a757fd2b1dee3edd571",
    "verified_classes": [
      "ResumeNamespaceMismatch",
      "ResumeAttempt"
    ],
    "verified_functions": [
      "build_resume_headers",
      "interpret_resume_response"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumeNamespaceMismatch"
    ],
    "sample_fail_closed_invariants": [
      "Last-Event-ID present but Mcp-Session-Id absent; cursor namespace cannot be bound to a session. Re-initialize or fall ba"
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
