{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-treat-mcp-session-resumption-as-a-replay-safety-problem-rather-than-a-reconnection-problem",
  "title": "Where must an instance treat MCP session resumption as a replay-safety problem rather than a reconnection problem",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP clients migrating from the HTTP+SSE transport (two-endpoint: GET event stream + POST message) to the streamable-HTTP transport with `Mcp-Session-Id` and `Last-Event-ID` resumption. Does not cover stdio transport, nor in-process SSE where the stream is never severed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-treat-mcp-session-resumption-as-a-replay-safety-problem-rather-than-a-reconnection-problem.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-treat-mcp-session-resumption-as-a-replay-safety-problem-rather-than-a-reconnection-problem.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-treat-mcp-session-resumption-as-a-replay-safety-problem-rather-than-a-reconnection-problem.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2110,
    "python_slice_tokens": 456,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The SSE transport and the streamable-HTTP transport both expose a `Last-Event-ID` resumption handshake, and both name the header identically. This surface symmetry hides a semantic asymmetry. Under HTTP+SSE, the GET event stream is a *single long-lived, strictly ordered channel*: every server→client message (notifications, sampling requests, progress) flows ...",
    "what_was_observed": "A client agent migrated from SSE to streamable-HTTP kept a single `last_seen_event_id` field, incremented on every event across all streams, and used it on every reconnect. The failure trace: 1. The agent issues `tools/call` via POST. The server responds with `text/event-stream` carrying events `id: 41`, `id: 42` (a progress notification and the tool result), then closes. Client processes both, sets `last_seen_event_...",
    "condition_of_validity": "The \"single monotonic cursor\" model is valid **only** under the following conjunction, all of which held for HTTP+SSE and none of which hold for streamable-HTTP in general: - Exactly one server→client stream exists per session at any time. - Event IDs are assigned from one counter shared by all message types on that stream. - The server retains replayable ev...",
    "decision_boundary": "The agent must branch on stream identity, not on session identity, at the moment it decides what to send on reconnect: - **Same stream re-attach** (the severed stream is the one being resumed, and the client retained that stream's last event ID): send `Last-Event-ID` scoped to that stream. Treat every re-delivered event as a possible duplicate and dedupe on ...",
    "operational_effect": "Agents that collapse the two ID spaces into one cursor exhibit two signatures: **silent notification loss** (the agent stops receiving cancellations and sampling requests after the first cross-stream reconnect, and hangs on results that were cancelled) and **duplicated non-idempotent side effects** (the same tool call executed twice because the resume header..."
  },
  "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": "8d9a5ed4f46c1e40e33de22baaa734b1fa509e70c73da1ffe3614efc5010f872",
    "verified_classes": [
      "ResumeScopeError",
      "StreamCursor",
      "ResumableSession"
    ],
    "verified_functions": [
      "reissue_post",
      "__init__",
      "cursor_for",
      "record_event",
      "resume_headers",
      "on_resume_rejected",
      "assert_resume_scope"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumeScopeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
