{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-an-mcp-resumable-sse-to-streamable-http-upgrade-after-a-mid-stream-last-event-id-replay",
  "title": "Under what conditions must an instance refuse an MCP resumable SSE-to-streamable-HTTP upgrade after a mid-stream `Last-Event-ID` replay?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP clients and servers negotiating a transport upgrade from legacy resumable SSE (HTTP GET event stream + POST message channel) to streamable HTTP, specifically when the client presents a `Last-Event-ID` for replay across the upgrade boundary. Does not cover fresh streamable-HTTP sessions with no prior SSE history, nor in-process (stdio) transports.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-an-mcp-resumable-sse-to-streamable-http-upgrade-after-a-mid-stream-last-event-id-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-an-mcp-resumable-sse-to-streamable-http-upgrade-after-a-mid-stream-last-event-id-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-an-mcp-resumable-sse-to-streamable-http-upgrade-after-a-mid-stream-last-event-id-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1695,
    "python_slice_tokens": 199,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the upgrade fails.\" It is that the upgrade *succeeds* while the replay is silently *inconsistent*. The distinction that matters: a resumable SSE stream carries a per-connection monotonic event ID space owned by the *old* transport instance, whereas streamable HTTP introduces a session-scoped event ID space that may be re-rooted, comp...",
    "what_was_observed": "A client holds an open SSE GET stream. It has processed events up to `Last-Event-ID: evt-4471`. The connection drops (LB idle timeout, 60s, no heartbeat). On reconnect the client attempts the upgrade: it sends a streamable-HTTP `POST`/`GET` with `Last-Event-ID: evt-4471` and an `Mcp-Session-Id` header it received during the SSE handshake. The server, now running the streamable-HTTP transport, looks up the session. Th...",
    "condition_of_validity": "A resumable SSE-to-streamable-HTTP upgrade is valid if and only if all of the following hold at the moment the server decides to honor `Last-Event-ID`: - **Domain binding.** The `Last-Event-ID` is accompanied by (or derivable from) a session-generation token that identifies the transport instance that issued it. The streamable-HTTP session must be the *same ...",
    "decision_boundary": "The boundary is not \"can the server parse the ID.\" It is \"can the server prove the ID belongs to the domain it is about to replay into.\" The subtle case is `session.covers(last_event_id)` returning true on a *numeric* comparison when the ID spaces are disjoint. A server that stores event IDs as integers and checks `last_event_id <= max_stored_id` will accept...",
    "operational_effect": "When the boundary is enforced (reject on unprovable replay): - Clients see a `409 unprovable_replay` and must reinitialize. Cost: a full state re-fetch, one extra round-trip, and a hard decision about whether mid-task context can be reconstructed. For an agent mid-tool-call, this typically means aborting the in-flight reasoning step and re-planning from a ch..."
  },
  "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": "389deb5f524424137b3cd394170163fdb27b53370d70cdacda6e26e4a1f493b0",
    "verified_classes": [
      "UnprovableReplayError"
    ],
    "verified_functions": [
      "negotiate_upgrade"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnprovableReplayError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
