{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-invalid-and-abort-the-stream-rather-than-replay-from-the-session-store",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resumption as invalid and abort the stream rather than replay from the session store",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with `text/event-stream` responses and `Last-Event-ID`-based resumption, where a server-side session store retains event history across reconnects. Does not apply to stateless JSON-RPC-over-POST servers that never emit SSE event IDs, nor to stdio transports.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-invalid-and-abort-the-stream-rather-than-replay-from-the-session-store.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-invalid-and-abort-the-stream-rather-than-replay-from-the-session-store.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-invalid-and-abort-the-stream-rather-than-replay-from-the-session-store.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1973,
    "python_slice_tokens": 426,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP transport spec allows a client to reconnect to an existing session by sending `Last-Event-ID`, and permits the server to replay buffered events after that ID. The commonly assumed invariant is: *if the server can locate a stored event with the given ID, replay is safe.* This is false. The real invariant is: **the event ID must be verifiable as b...",
    "what_was_observed": "A server implementation used a single append-only ring buffer keyed by a ULID event ID, with a separate session table mapping `Mcp-Session-Id` → `{created, last_seen, event_cursor}`. Events carried `id: <ulid>` and `data: {...}` but the session ID was *not* embedded in the event payload — it was implied by the connection. Trace of the break: 1. Client A opens session `S1`, issues `tools/call` for `read_file`, receive...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is only valid when **all** of the following hold simultaneously: - **Session-scoped event identity.** The event ID (or the event payload, or a signed envelope) cryptographically or structurally binds to the session ID that produced it. A ULID alone does not — it proves ordering, not ownership. - **Session record survives the re...",
    "decision_boundary": "The boundary is between *resumable* and *replayable*. A stream is resumable when the server can reconstruct the exact event sequence the client is missing, with provenance intact. A stream is merely replayable when the server has bytes that match the requested ID but cannot attest they belong to this client's session. The spec's language (\"the server MAY rep...",
    "operational_effect": "Downstream, the corruption manifests as reasoning divergence that is hard to attribute: the agent's plan references a tool result whose content came from another tenant's session, the call ID \"matches\" so no consistency check fires, and the error surfaces only when a later step contradicts the poisoned fact. Because the poisoned event was a legitimate tool o..."
  },
  "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": "e073ddd6b39a4b2cf46baf21a966bfd70e11063036c42127d86c00e3dc3826be",
    "verified_classes": [
      "ResumptionRejected",
      "Event",
      "SessionRecord"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ResumptionRejected"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
