{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-streamable-http-transports-the-last-event-id-replay-gap",
  "title": "What structural signals indicate a broken resumability invariant in MCP streamable-HTTP transports: the Last-Event-ID replay gap",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers/clients using the streamable-HTTP transport with SSE event streams and `Last-Event-ID`-based session resumption, where a single logical tool invocation is spread across multiple SSE frames. Does not apply to stdio transports, nor to single-response (non-streamed) HTTP request/response modes where the entire tool result is delivered atomically.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-streamable-http-transports-the-last-event-id-replay-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-streamable-http-transports-the-last-event-id-replay-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-streamable-http-transports-the-last-event-id-replay-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1877,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The streamable-HTTP MCP transport lets a client resume an interrupted SSE stream by reconnecting with a `Last-Event-ID` header. The naive mental model is \"the server replays everything after the last event I saw, so I lose nothing.\" That model is wrong in a specific and dangerous way: **event identity and state continuity are decoupled.** The `Last-Event-ID`...",
    "what_was_observed": "A tool call (`deploy_batch`) streamed its progress as a sequence of SSE frames: `event: progress` frames with monotonically increasing `id` values, followed by a terminal `event: result`. The client-side agent tracked `Last-Event-ID` on every frame it processed. At `id: 47` (a progress frame reporting \"step 3/8 committed\"), the TCP connection was severed by an intermediary proxy idle-timeout during a long backend ope...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is only sound when all of the following hold simultaneously: 1. **Retention is gap-aware, not count-bounded.** The replay buffer must retain every event from the oldest *unacknowledged* position, or the server must detect that the requested ID has been evicted and return an explicit `resumption_failed`/`409`-class signal rather...",
    "decision_boundary": "The boundary is drawn at the moment the client presents a `Last-Event-ID` that the server **cannot prove is contiguous with retained state**. Two decisions are possible and they must not be conflated: - **Resume** — only when the requested ID is present in retained state *and* execution is session-pinned/idempotent. The server replays `id > last_seen` verbat...",
    "operational_effect": "Downstream, the failure manifests as *silent state divergence with locally coherent reasoning*: the agent continues to act, cites step numbers that were never delivered, and produces a final result that is internally consistent but globally wrong relative to the server. Because no error was raised at the transport layer, no retry, no escalation, and no audit..."
  },
  "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": "343c5fbca63add265f68cd9564c6df29a93882ffaa16c6e191d5d858b20c0180",
    "verified_classes": [
      "ResumptionInvariantError",
      "ReplayWindow"
    ],
    "verified_functions": [
      "assert_resumption_safe",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "Execution not session-pinned; resuming would re-invoke the tool and duplicate non-idempotent side effects."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
