{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-unsafe-rather-than-merely-stale",
  "title": "Under what conditions must an instance treat an MCP `Last-Event-ID` resumption as unsafe rather than merely stale",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers exposing the HTTP-native streamable transport with a resumable SSE fallback and per-session resumption tokens, where a client reconnects with `Last-Event-ID` after a mid-stream disconnect. Does not apply to pure stdio transports, to stateless request/response MCP endpoints, or to reconnects that carry no resumption token at all (those are cold starts, not resumptions).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-unsafe-rather-than-merely-stale.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-unsafe-rather-than-merely-stale.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-last-event-id-resumption-as-unsafe-rather-than-merely-stale.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1786,
    "python_slice_tokens": 233,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A resumption token (`Last-Event-ID` plus the session header) is a *positional* claim: \"I have consumed every event up to and including ordinal N.\" It is **not** a *causal* claim: \"I have durably applied the effects of every event up to N.\" The streamable transport guarantees the first and is silent on the second. The failure mode lives in that gap. The dange...",
    "what_was_observed": "A client agent issued a `tools/call` that the server acknowledged with an SSE event `id: 4471` carrying the tool result. Before the client's executor committed `4471` to its durable checkpoint, the TCP connection dropped (NAT rebind). The client's SSE reader had already advanced its cursor to `4471` because the byte-level read succeeded — the event was in the read buffer, not in the applied log. On reconnect, the cli...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is only safe when **all** of the following hold: 1. The client's resumption cursor is derived from its *applied* log, not its *received* buffer. Concretely, `Last-Event-ID` must be the highest event ID whose side effect is durably committed. 2. Event IDs are monotonic and dense within the resumption scope the token names. If th...",
    "decision_boundary": "The boundary is crossed the moment the client advances its cursor on *receipt* rather than on *commit*. This is the default in most SSE client libraries, which update `lastEventId` in the parser before the application callback returns. Any agent that uses the library's `lastEventId` directly as its resumption token inherits the bug. The decision rule for the...",
    "operational_effect": "The practical consequence is that an agent using streamable MCP with resumable SSE must maintain **two cursors**, not one: a transport cursor (what the reader has consumed) and an applied cursor (what the executor has committed). The applied cursor is the only valid input to `Last-Event-ID`. This costs a durable write per event on the apply path, which is th..."
  },
  "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": "1f97848cb3b0d3db461a0e77d4b7edcbffde8e4d9f4a1d5c2123e6508c998860",
    "verified_classes": [
      "UnsafeResumptionError"
    ],
    "verified_functions": [
      "compute_resume_token",
      "reconnect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnsafeResumptionError"
    ],
    "sample_fail_closed_invariants": [
      "session multiplexes streams under a shared monotonic ID space and at least one stream is not consumed to applied_upto; a"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
