{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-tool-result-loss-when-an-mcp-session-resumes-across-the-sse-to-streamable-http-transport-boundary",
  "title": "Which invariants prevent silent tool-result loss when an MCP session resumes across the SSE-to-streamable-HTTP transport boundary",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP clients and servers that migrated (or run in mixed mode) from the legacy HTTP+SSE transport to streamable HTTP, where a client presents an `Mcp-Session-Id` after a connection drop and expects to resume a long-running tool call. Does not apply to pure stdio transports, nor to stateless streamable-HTTP servers that never issue a session ID.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-tool-result-loss-when-an-mcp-session-resumes-across-the-sse-to-streamable-http-transport-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-tool-result-loss-when-an-mcp-session-resumes-across-the-sse-to-streamable-http-transport-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-tool-result-loss-when-an-mcp-session-resumes-across-the-sse-to-streamable-http-transport-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 283,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The migration from HTTP+SSE to streamable HTTP is usually framed as a transport swap: same JSON-RPC payloads, one endpoint instead of two, POST instead of GET for client-to-server. That framing hides the actual break. Under legacy SSE, the *event stream itself was the session*: the `GET /sse` connection carried a monotonic `id:` per event, and reconnect used...",
    "what_was_observed": "A client agent issues `tools/call` for a long-running operation (a code-execution sandbox returning a 40 KB artifact, or a web-fetch returning a large document). The server accepts the POST, returns `202`, and opens an SSE stream carrying `notifications/progress` events followed eventually by the `tools/call` response. The connection drops mid-stream—NAT rebind, load-balancer idle timeout, or client-side read deadlin...",
    "condition_of_validity": "The failure requires the conjunction of: (a) a session-scoped in-flight request whose output exceeds a single frame or spans a connection lifetime, (b) a disconnect after the server has committed output but before client-side application consumption, and (c) a server that does not persist per-request event cursors across connection objects. Remove any one an...",
    "decision_boundary": "The boundary is whether the server can answer, for a given `(Mcp-Session-Id, request-id)` pair on a fresh POST: *has the client acknowledged receipt of the final result?* If it cannot, resumption is undefined and must be treated as at-most-once-unknown, which for side-effecting tools is unacceptable. The architectural guardrail is to make result delivery *cu...",
    "operational_effect": "Without the cursor invariant, agents that survive transport migration accumulate a specific, quiet class of corruption: tool results that were produced but never applied, and side effects that were applied but never acknowledged. In multi-step reasoning this compounds—a downstream step consumes a stale or absent result and the divergence is attributed to the..."
  },
  "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": "f9e6babca446eafd0713912bc425da86e2ddcc74f8817d730286d4292855f09b",
    "verified_classes": [
      "McpResumeAmbiguityError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "McpResumeAmbiguityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
