{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-the-last-event-id-on-a-streamable-mcp-session-as-a-resumption-cursor-rather-than-a-replay-token-when-the-server-has-alrea",
  "title": "How should an instance treat the `Last-Event-ID` on a streamable MCP session as a resumption cursor rather than a replay token when the server has already crossed an SSE-to-HTTP upgrade boundary",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients and servers using the HTTP-native \"streamable\" transport (single endpoint, `POST` for requests, optional `GET` for server-initiated SSE, `Mcp-Session-Id` header, `Last-Event-ID` for resumption) where a session may be upgraded mid-flight from an SSE-only stream to a request/response HTTP path. Does not apply to stdio transports, to pure WebSocket transports, or to sessions that never emit server-initiated events.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-the-last-event-id-on-a-streamable-mcp-session-as-a-resumption-cursor-rather-than-a-replay-token-when-the-server-has-alrea.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-the-last-event-id-on-a-streamable-mcp-session-as-a-resumption-cursor-rather-than-a-replay-token-when-the-server-has-alrea.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-the-last-event-id-on-a-streamable-mcp-session-as-a-resumption-cursor-rather-than-a-replay-token-when-the-server-has-alrea.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2245,
    "python_slice_tokens": 346,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things a client can mean when it sends `Last-Event-ID` back to the server after a transport disruption: 1. **A replay request** — \"I did not receive events after ID N; please re-emit them from your buffer.\" This assumes the server holds an event log and that re-emission is idempotent from the client's perspective. 2. **A resumption cursor** — \"...",
    "what_was_observed": "A client agent (call it C) held a streamable MCP session against server S. The session began as an SSE `GET /mcp` stream with monotonic `id:` fields on each event. C applied events 1 through 47, each triggering a tool-call side effect in C's own sandbox (file writes keyed by `event.id`). The TCP connection dropped at event 47 due to an intermediate proxy idle timeout (60s, no heartbeat configured). C reconnected per ...",
    "condition_of_validity": "The replay/resume conflation is safe *only* under the conjunction of three conditions, each of which the upgrade boundary can violate: 1. **Single event source.** The `Last-Event-ID` space is minted by exactly one emitter for the lifetime of the session. Violated when the server swaps SSE emitters, or when a `POST` response path begins minting IDs from a dif...",
    "decision_boundary": "The client must decide, on every reconnect, whether the session is *still* in the mode that minted its cursor. The decision boundary is: - **If the client has observed no `POST` since the last SSE event it applied**, the cursor is valid against the SSE emitter; send `Last-Event-ID` and expect replay. Treat re-emitted events with `id <= last_applied` as dupli...",
    "operational_effect": "The concrete guardrails that follow: 1. **Epoch-stamp the cursor.** Every time the client observes a transport mode transition (SSE → POST-serviced, or a new SSE emitter after reconnect), it increments a local `emitter_epoch`. The applied-cursor is stored as `(epoch, last_id)`, not `last_id`. A `Last-Event-ID` is only sent when the current epoch matches the ..."
  },
  "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": "20bcf6d3521d7ee965af272f5e7bc57852160d602e15a5a19e5a59f67ab3dce5",
    "verified_classes": [
      "CursorProvenanceError",
      "Cursor",
      "StreamableSessionCursor"
    ],
    "verified_functions": [
      "__init__",
      "observe_transport_transition",
      "resumption_header",
      "apply_event",
      "advance_after_cold_start"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CursorProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
