{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-http-native-transport-stream-against-a-migrated-session",
  "title": "What happens when an instance resumes an MCP HTTP-native transport stream against a migrated session",
  "date_of_record": "2026 November 13",
  "scope": "Applies to MCP servers exposing the HTTP-native transport (Streamable HTTP with `Mcp-Session-Id` and resumable SSE via `Last-Event-ID`), where a client may reconnect to a *different* server instance than the one that produced the stream. Does not apply to stdio transport, nor to single-instance deployments where session affinity is guaranteed by the load balancer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-http-native-transport-stream-against-a-migrated-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-http-native-transport-stream-against-a-migrated-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-http-native-transport-stream-against-a-migrated-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1448,
    "python_slice_tokens": 332,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP-native transport defines two *independent* pieces of resumption state: the **session** (identified by `Mcp-Session-Id`, which scopes server-side capability negotiation and any in-memory context) and the **stream cursor** (identified by the `Last-Event-ID` header, which scopes replay of an individual SSE event stream). The specification treats th...",
    "what_was_observed": "During a rolling deploy of a three-replica MCP server behind a round-robin ingress, a long-lived tool-streaming session was interrupted mid-stream. The client correctly reconnected with `Mcp-Session-Id: <sid>` and `Last-Event-ID: 4821`. The new replica: 1. Accepted the session ID because the session store was shared (Redis-backed), so the session *validated*. 2. Had no local record of event `4821`, because event buff...",
    "condition_of_validity": "Stream resumption via `Last-Event-ID` is valid **only if** the following holds for the connection receiving the resume request: - The event-ID namespace is scoped to a single producer instance, **and** the client is guaranteed to reconnect to that same instance (sticky affinity), **or** - The event buffer backing the ID namespace is *shared and durable* acro...",
    "decision_boundary": "The boundary is crossed at the moment a session is *migratable* but its stream cursor is *not*. Concretely: - **Session state shared, stream buffer local** → migration is unsafe for in-flight streams. This is the common misconfiguration: teams share the session map (cheap, small) but not the event log (large, high-churn), and assume resumption works because ...",
    "operational_effect": "Two mitigations are load-bearing. First, on receiving a `Last-Event-ID` the instance does not recognize, the server must return an explicit, distinguishable failure — not a fresh stream. A `409 Conflict` or a structured SSE `error` event with a machine-readable code (e.g., `stream_cursor_unrecoverable`) lets the client distinguish \"resume succeeded\" from \"re..."
  },
  "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": "31789e97dd281cd8e8a7075ddf8aea7e8b2a7dcb81f0e0622af151618e158046",
    "verified_classes": [
      "StreamResumeInvariantError",
      "EventCursor",
      "SessionRecord"
    ],
    "verified_functions": [
      "resume_stream",
      "handle_resume",
      "__init__",
      "__init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamResumeInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
