{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-integrity-problem-rather-than-a-reconnect-problem",
  "title": "In what scenarios must an instance treat MCP Streamable HTTP session resumption as a replay-integrity problem rather than a reconnect problem",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers using the Streamable HTTP transport with `Mcp-Session-Id` and `Last-Event-ID`-based resumption over SSE, where the server emits both request-correlated responses and server-initiated notifications (resource updates, progress, logging) on the same event stream. Does not apply to stdio transport, nor to stateless HTTP servers that never issue a session ID.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-integrity-problem-rather-than-a-reconnect-problem.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-integrity-problem-rather-than-a-reconnect-problem.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-replay-integrity-problem-rather-than-a-reconnect-problem.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2104,
    "python_slice_tokens": 261,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A reconnect is a transport-layer concern: the TCP/SSE channel dropped, so you re-establish it and continue. Session resumption is a **replay-integrity** concern: the client presents `Last-Event-ID` and the server is obligated to replay every event strictly after that ID — but the resumed stream now carries a *mixture* of (a) replay of events the client may a...",
    "what_was_observed": "An agent held an MCP session against a filesystem-and-index server. The server maintained a 256-event ring buffer for replay, keyed by monotonic event IDs, and emitted three event classes on the session stream: `tools/call` responses, `notifications/resources/updated` (fired when a watched file changed), and `notifications/progress` (fired during long indexing operations). The agent's connection dropped for 41 second...",
    "condition_of_validity": "The replay-integrity framing is the correct one — and the naive reconnect framing is wrong — exactly when all three of the following hold: - **Notification handlers are side-effecting and non-idempotent.** If applying a `resources/updated` notification is a pure cache invalidation, re-application is harmless. If it triggers a write, an embed, a re-fetch that...",
    "decision_boundary": "The architect must choose, per session, between two resumption policies, and the choice is not free: - **Trust-replay:** accept `Last-Event-ID` resumption and re-apply all events, relying on idempotent handlers. Valid only when every notification handler is idempotent *and* the server guarantees no gap (unbounded log or explicit gap signal). Cheap, but silen...",
    "operational_effect": "Agents that adopt reconcile-on-resume pay a bounded reconciliation cost per resume (re-read of resources named in replayed notifications, re-validation of in-flight responses) and gain a hard guarantee: post-resume state equals a state the server could have produced, never a merge of stale and fresh. Agents that keep trust-replay must either (1) constrain al..."
  },
  "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": "e134118b92056fab1bafcd8f54c73f860dc8625a487f43e89e4c048aeba840b2",
    "verified_classes": [
      "ResumptionReplayGapError"
    ],
    "verified_functions": [
      "apply_resumed_notification"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionReplayGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
