{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-the-resumption-window-when-an-mcp-streamable-http-session-resumes-mid-stream-against-a-tool-that-has-already-committed-ba",
  "title": "Where must an instance bound the resumption window when an MCP Streamable HTTP session resumes mid-stream against a tool that has already committed backpressure",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP servers exposed over Streamable HTTP transport where a single tool call streams incremental results (progress notifications, partial JSON, or token deltas) and the client may reconnect with a `Last-Event-ID` after a transport drop. Does not apply to stdio transports (no resumption primitive), nor to unary request/response MCP calls whose entire payload fits in one SSE frame.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-resumption-window-when-an-mcp-streamable-http-session-resumes-mid-stream-against-a-tool-that-has-already-committed-ba.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-resumption-window-when-an-mcp-streamable-http-session-resumes-mid-stream-against-a-tool-that-has-already-committed-ba.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-resumption-window-when-an-mcp-streamable-http-session-resumes-mid-stream-against-a-tool-that-has-already-committed-ba.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2323,
    "python_slice_tokens": 433,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the client lost its connection.\" The failure is that **resumption and backpressure are governed by two different clocks that the protocol never reconciles**. Resumption is keyed on an event ID watermark (`Last-Event-ID`); backpressure is keyed on the server's outbound send-buffer occupancy for that session's stream. When a client drops an...",
    "what_was_observed": "A tool `stream_scan` emits progress events `e1..eN` over SSE, one per chunk, with `id:` fields set to a monotonic counter. The server implementation used an in-memory `asyncio.Queue(maxsize=8)` between the tool coroutine and the SSE writer, and treated \"queue full\" as the backpressure signal (`await queue.put(...)`). On transport drop, the server kept the queue alive for a 30s resumption window and retained a separat...",
    "condition_of_validity": "The resumption watermark is sound only under the conjunction: - **Flush-anchored logging.** An event is appended to the replay log (and its `id` becomes eligible for `Last-Event-ID` matching) only *after* the transport reports the bytes flushed — for HTTP/1.1 chunked or HTTP/2, after the write future resolves, not after `drain()` returns (drain resolves on b...",
    "decision_boundary": "The operational question is: **when a resume request arrives with `Last-Event-ID: X`, does the server replay, resume live, or refuse?** Refuse (close session, return `409`-equivalent MCP error, require new tool invocation) when: - `X` is not in the replay log (evicted or never flushed) — the client claims a state the server cannot reconstruct. - `X` is below...",
    "operational_effect": "With flush-anchored logging and a single cursor, three properties hold that did not before: - **No optimistic watermark.** A client can never present an `id` the server hasn't durably emitted, so replay never fabricates tool success. Divergence between client-observed and tool-committed state is bounded to zero for events below the flush cursor. - **Backpres..."
  },
  "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": "a5622c6276d5ed2a3c08a15c819482708172724db85b3a0659e8e3d8455bc9b8",
    "verified_classes": [
      "ResumptionInvariantError",
      "SessionStream"
    ],
    "verified_functions": [
      "emit",
      "producer_may_emit",
      "record_flush",
      "resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "producer gate closed: flush lag at window or replay in progress"
    ],
    "stdlib_dependencies": [
      "asyncio",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
