{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-continuation",
  "title": "When must an instance treat an MCP `Last-Event-ID` resume as a fresh session rather than a continuation",
  "date_of_record": "2026 November 14",
  "scope": "Applies to HTTP-native MCP servers that expose SSE-based streaming (the `GET` stream endpoint) and accept `Last-Event-ID` on reconnection, where the server also maintains per-session state keyed by an `Mcp-Session-Id`. Does not apply to stateless streamable-HTTP transports or to stdio transports, where session identity is implicit in the process lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-continuation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-continuation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-last-event-id-resume-as-a-fresh-session-rather-than-a-continuation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1382,
    "python_slice_tokens": 237,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The `Last-Event-ID` header and the `Mcp-Session-Id` header are orthogonal identifiers that the protocol does not require to be consistent with each other. `Last-Event-ID` is a *stream cursor*: it says \"resume this event sequence from position N.\" `Mcp-Session-Id` is a *state handle*: it says \"I am the same logical client that owns this server-side session.\" ...",
    "what_was_observed": "A server restarted its process pool, invalidating all in-memory session state. A client reconnected with its cached `Mcp-Session-Id` and the last `Last-Event-ID` it had received (`evt-4471`). The server's session lookup failed, so it minted a fresh session and returned a new `Mcp-Session-Id` in the response headers — but the SSE handler, written before the session layer, keyed its replay buffer by the numeric suffix ...",
    "condition_of_validity": "Treating a resume as a continuation is valid only when *all* of the following hold: 1. The presented `Mcp-Session-Id` resolves to a live server-side session. 2. The `Last-Event-ID` was issued by *that* session (i.e., event IDs are namespaced by session, e.g. `{session_id}:{seq}` or a per-session random prefix). 3. The replay buffer for that session still con...",
    "decision_boundary": "The decision hinges on whether the cursor is *meaningful* to the resolved session, not on whether the session exists. Concretely: - **Session live + cursor in-window + cursor namespaced to session** → resume, replay from cursor. - **Session live + cursor outside retained window** → do not replay; start fresh and signal a gap, because the client has missed ev...",
    "operational_effect": "Enforcing the boundary converts a silent cross-session contamination into an explicit, recoverable reset. The client sees a session-reset event, discards its optimistic state for in-flight requests, and re-issues them against the new session. The cost is a small number of redundant retries on restart; the benefit is that no client ever observes another clien..."
  },
  "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": "5135bb54352b68406dc537de4fb23126fbd109c3416208b561d76c4689287487",
    "verified_classes": [
      "SessionCursorMismatch"
    ],
    "verified_functions": [
      "resolve_resume"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionCursorMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
