{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-transport-sessions-across-an-sse-to-streamable-http-migration",
  "title": "Which invariants prevent silent event loss when resuming MCP HTTP-native transport sessions across an SSE-to-streamable-HTTP migration",
  "date_of_record": "2026 November 13",
  "scope": "Applies to MCP servers that expose the HTTP-native transport (streamable HTTP with optional SSE upgrade) and clients that persist a session identifier plus an event cursor for resumption. Does not apply to stdio transports, nor to servers that treat every POST as a stateless request with no resumable event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-transport-sessions-across-an-sse-to-streamable-http-migration.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-transport-sessions-across-an-sse-to-streamable-http-migration.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-transport-sessions-across-an-sse-to-streamable-http-migration.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1636,
    "python_slice_tokens": 228,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different notions of \"resumption\" in MCP HTTP-native transport, and they are routinely conflated during an SSE-to-streamable-HTTP migration. The first is **connection resumption**: the client reconnects a transport (SSE stream or streamable-HTTP response stream) and re-establishes the byte pipe. The second is **event resumption**: ...",
    "what_was_observed": "During a migration from a single-process SSE server to a horizontally scaled streamable-HTTP server, the following sequence reproduced intermittently under load: 1. Client holds session `s1`, last consumed event id `e-1042`, and is mid-tool-call awaiting a `notifications/progress` stream. 2. The pod serving `s1` is evicted. The client's stream closes without a terminal event. 3. Client reconnects with `Mcp-Session-Id...",
    "condition_of_validity": "Event resumption across a transport migration is valid only when all of the following hold: - **Cursor durability:** the server persists events with stable, totally ordered ids for the lifetime of the session, not just for the lifetime of a connection or a pod. - **Contiguity check:** on resume, the server verifies that the supplied `Last-Event-ID` exists in...",
    "decision_boundary": "The boundary is not \"did the reconnect succeed\" but \"can the server distinguish a contiguous resume from a gap, and does it refuse the latter.\" - If the server retains a durable, contiguous log covering the client's cursor → resume is lossless; proceed. - If the cursor predates the retained window → the correct action is an explicit gap error. Treating this ...",
    "operational_effect": "Teams that skipped the contiguity invariant saw failures clustered around deploys, autoscaling events, and pod evictions — exactly when resumption matters — and misdiagnosed them as client bugs because the HTTP layer reported success. The observable signature is orphaned JSON-RPC results, progress notifications for unknown tool calls, and client-side awaits ..."
  },
  "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": "3e52f7fe6d536c8bd27c9bcdc29a7b53c752375505a3dfb5661d906571cb3f73",
    "verified_classes": [
      "ResumeGapError",
      "EventLog"
    ],
    "verified_functions": [
      "resume_session",
      "__init__",
      "__init__",
      "head",
      "contains",
      "contiguous_from"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumeGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
