{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-the-replay-window-when-an-mcp-streamable-sse-session-resumes-across-a-last-event-id-gap",
  "title": "Where must an instance bound the replay window when an MCP streamable-SSE session resumes across a `Last-Event-ID` gap",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers and clients using the HTTP-native streamable transport with SSE resumability (`Last-Event-ID` + `Mcp-Session-Id`), where a client reconnects after a stream interruption. Does not apply to stdio transport, to stateless SSE servers that emit no event IDs, or to session resumption that discards prior in-flight tool calls by design.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-replay-window-when-an-mcp-streamable-sse-session-resumes-across-a-last-event-id-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-replay-window-when-an-mcp-streamable-sse-session-resumes-across-a-last-event-id-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-replay-window-when-an-mcp-streamable-sse-session-resumes-across-a-last-event-id-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1823,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct resumption questions in the MCP streamable transport, and conflating them is the failure: 1. **Session identity resumption** — does the server still recognize `Mcp-Session-Id` and its associated state (subscriptions, pending server-initiated requests, auth context)? 2. **Event-stream replay resumption** — given a `Last-Event-ID`, can t...",
    "what_was_observed": "A single MCP server process behind a load balancer, three replicas, streamable HTTP transport. Each SSE event carried a monotonic `id` scoped to the session. The server kept a per-session ring buffer of the last 256 events to satisfy replay. A client agent issued a `tools/call` that triggered a long-running server-side operation; the server emitted progress `notifications/message` events roughly every 200ms, then a f...",
    "condition_of_validity": "The replay invariant holds only when all of the following are jointly true: - **Buffer locality matches session routing.** The event buffer is co-located with the session record, or the session is pinned to a replica for its lifetime, or the buffer is externalized to the same store as the session. A shared session store with process-local buffers is the cano...",
    "decision_boundary": "On a resume request, the server must make an explicit decision and communicate it, rather than picking a lenient default: - If `Last-Event-ID` is absent: treat as a fresh stream from the current head. (No replay obligation.) - If `Last-Event-ID` is present and within `[oldest_retained_id - 1, last_emitted_id]`: replay from `Last-Event-ID + 1` to head, then c...",
    "operational_effect": "When the boundary is respected, a reconnect either continues seamlessly or fails loudly, and the agent's caller can re-drive the tool call with knowledge that prior partial results are discarded. When it is violated, the agent proceeds on a corrupted event history: progress notifications that drove its accumulator are missing, final results reference unobser..."
  },
  "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": "40494e56a9aa1e71a946045c7478608d1d7e81c5e88a426639f8c71e0ca879cd",
    "verified_classes": [
      "ReplayGapError"
    ],
    "verified_functions": [
      "validate_resume",
      "assert_contiguous"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
