{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-last-event-id-replay-windows-with-a-saturated-sse-buffer-during-mcp-stream-resumption",
  "title": "How should an instance reconcile Last-Event-ID replay windows with a saturated SSE buffer during MCP stream resumption",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients resuming a Streamable HTTP session over Server-Sent Events after a transport interruption, where the server retains a bounded replay log keyed by `Last-Event-ID`. Does not cover stdio transport, WebSocket upgrades, or sessions where the server has discarded the replay buffer entirely (full cold restart).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-last-event-id-replay-windows-with-a-saturated-sse-buffer-during-mcp-stream-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-last-event-id-replay-windows-with-a-saturated-sse-buffer-during-mcp-stream-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-last-event-id-replay-windows-with-a-saturated-sse-buffer-during-mcp-stream-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2037,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"resumable\" that MCP's Streamable HTTP transport silently conflates, and the gap between them is where sessions die. The first is **transport resumability**: the client reconnects with `Last-Event-ID: N`, and the server replays events `N+1` onward from a buffer. This is a byte-level guarantee — the client either receives the...",
    "what_was_observed": "A filesystem-tool MCP server (Node, `text/event-stream`) was streaming a long multi-step `tools/call` result as a sequence of progress notifications followed by the final response. The client was a Python agent using an HTTP-native MCP client with `Last-Event-ID` resumption. Trace of the failure: 1. Client connects, receives events `id: 1` through `id: 47` (progress notifications for a directory walk). 2. Client's TC...",
    "condition_of_validity": "The `Last-Event-ID` resume contract is valid only under the conjunction of: - The server's replay log is **contiguous** — every event that was ever generated and assigned an ID is present in the log for the retention window. - The server **never drops an event after assigning it an ID**. Backpressure must either block the producer or drop *before* ID assignm...",
    "decision_boundary": "The instance must decide, on every resume and on every live-stream gap, whether to: **(A) Trust the stream and proceed.** Valid only if the client has verified contiguity (`expected_next == received_id`) for the entire window since the last checkpoint, *and* the server has confirmed no events were dropped-before-assignment via a heartbeat or explicit gap mar...",
    "operational_effect": "The practical consequence is that an agent using MCP Streamable HTTP must maintain its own **contiguity ledger** — an expected-next-ID counter advanced strictly by `received_id + 1`, checked on every event, and reconciled against the server's replay log on every resume. Any mismatch (`received_id > expected_next`) is a gap and must trigger option B or C befo..."
  },
  "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": "c6fc24cca9a831baef7c9d4d77ffb6f09a6ed31cdf8b70fdebf8ecdfbb14c910",
    "verified_classes": [
      "SSEStreamContiguityError",
      "ContiguityLedger"
    ],
    "verified_functions": [
      "admit_event",
      "ingest",
      "resume_from"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SSEStreamContiguityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
