{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-safe-boundary-rather-than-a-transparent-reconnect",
  "title": "Under what conditions must an instance treat MCP Streamable HTTP session resumption as a replay-safe boundary rather than a transparent reconnect",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers and clients using the Streamable HTTP transport (single `/mcp` endpoint, `Mcp-Session-Id` header, optional SSE upgrade per request, `Last-Event-ID` resumption) where a session may be resumed after a transport drop, proxy timeout, or client reconnect. Does not apply to stdio transports, nor to stateless HTTP servers that issue no `Mcp-Session-Id`.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-safe-boundary-rather-than-a-transparent-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-safe-boundary-rather-than-a-transparent-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-safe-boundary-rather-than-a-transparent-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2343,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things a client can mean by \"resume,\" and the Streamable HTTP spec conflates them at the wire level while leaving the semantics to the server: 1. **Transport resumption** — re-establishing the byte stream for an in-flight JSON-RPC exchange so that the *response* to an already-sent request is delivered. The request has been dispatched; the clien...",
    "what_was_observed": "A tool-calling agent issued `tools/call` for a filesystem-mutating operation (`write_file`) over Streamable HTTP with SSE upgrade. Sequence: 1. Client sends `POST /mcp` with `Mcp-Session-Id: S1`, body `{\"jsonrpc\":\"2.0\",\"id\":42,\"method\":\"tools/call\",...}`. Server accepts, begins SSE stream, emits `id: 100` (progress notification), then `id: 101` (the `result` for id 42). The TCP connection is severed by an intermediat...",
    "condition_of_validity": "Resumption is replay-safe **iff** all of the following hold at the moment of resume: - **C1 — Durable request ledger.** The client persists, before sending, a record `(jsonrpc_id, method, args_hash, dispatch_state ∈ {sent, terminal_seen, applied})` to storage that survives process restart. In-memory-only ledgers fail this condition, which is why cold-start r...",
    "decision_boundary": "The boundary is crossed at the point where the client must choose between two actions on reconnect, and the choice is not determined by the transport: The non-obvious case is row 2: the spec's `Last-Event-ID` mechanism invites the client to wait, but a server that cancels on disconnect will never satisfy that wait. The client cannot distinguish row 1 from ro...",
    "operational_effect": "Agents that implement C1–C5 show a characteristic profile: tool-call duplication drops to the idempotency-key collision rate (near zero), and resume latency is bounded by the replay window rather than by the agent's step timeout. Agents that do not show the opposite: on flaky links, duplicate side effects cluster at disconnect events, and the correlation is ..."
  },
  "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": "60b020e6edd80307234abaa332396ae4077703fa760fd78f3c56afa8776b8dc9",
    "verified_classes": [
      "ResumptionInvariantViolation",
      "DispatchState",
      "RequestRecord",
      "SessionLedger"
    ],
    "verified_functions": [
      "decide_resume_action",
      "handle_server_initiated_replay",
      "idempotency_key"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
