{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-resumable-stream-last-event-id-replay-as-a-session-continuity-hazard-rather-than-a-recovery-mechanism",
  "title": "Under what conditions must an instance treat MCP resumable-stream `Last-Event-ID` replay as a session-continuity hazard rather than a recovery mechanism",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP servers exposing streamable HTTP transport with SSE-based resumable streaming (`Last-Event-ID` replay) where a single logical MCP session spans multiple tool calls whose results mutate server-side state. Does not apply to stateless request/response MCP transports or to SSE streams carrying only idempotent, side-effect-free notifications.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-resumable-stream-last-event-id-replay-as-a-session-continuity-hazard-rather-than-a-recovery-mechanism.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-resumable-stream-last-event-id-replay-as-a-session-continuity-hazard-rather-than-a-recovery-mechanism.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-resumable-stream-last-event-id-replay-as-a-session-continuity-hazard-rather-than-a-recovery-mechanism.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2309,
    "python_slice_tokens": 341,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The resumable-stream contract in MCP's streamable HTTP transport is borrowed from SSE: a client that loses its connection reconnects with `Last-Event-ID: <n>` and the server replays events `n+1` onward. This is a *transport-level* invariant — it guarantees the byte stream resumes without a gap. It is **not** a *session-level* invariant. The distinction that ...",
    "what_was_observed": "A single-agent coding workflow over streamable HTTP MCP. The server emits `notifications/progress` and tool-result events with monotonically increasing SSE IDs. The agent's client library persists `Last-Event-ID` on every received event (standard SSE client behavior). The LLM consumes events into its context and, on each tool result, decides the next tool call. Trace of the failure: 1. Server emits event `id=41` (`to...",
    "condition_of_validity": "Resumable replay is safe as a session-continuity mechanism only when all of the following hold: - **Idempotent event semantics.** Every replayed event is either a pure notification (no side effect when re-consumed by the LLM) or carries an idempotency key the LLM/client deduplicates against. Progress notifications qualify; tool results do not, because a tool...",
    "decision_boundary": "The boundary is drawn at the point where the client must choose between replay and re-establishment: - **Replay** (send `Last-Event-ID`) is correct when the last event the client *acted upon* is known and durable, and the gap contains only notifications or idempotent results. This is the case for long-running progress streams where the LLM is a passive obser...",
    "operational_effect": "Architecturally, this forces a **dual-cursor model** into any MCP client that drives an agent: a transport cursor (SSE `Last-Event-ID`, cheap, persisted on every event) and an action cursor (persisted atomically with tool-call issuance, expensive, must survive process crash). The action cursor is the authoritative one for continuity decisions; the transport ..."
  },
  "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": "1655f0e0f798f2d25ebdf84fc5481e8642b4f47fc5e4ba8ab3c67cd75126834b",
    "verified_classes": [
      "SessionContinuityForkError",
      "DualCursorReplayGate"
    ],
    "verified_functions": [
      "handle_reconnect",
      "__init__",
      "authorize_replay"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionContinuityForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
