{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-the-sse-event-id-watermark-against-the-mcp-session-id-before-honoring-a-resumption-request",
  "title": "Where must an instance reconcile the SSE event-ID watermark against the MCP session ID before honoring a resumption request",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers exposing the HTTP-native transport (streamable HTTP with Server-Sent Events) where a client may reconnect and request session resumption via `Last-Event-ID`. Does not apply to stdio transport, nor to stateless request/response MCP deployments where no event stream is multiplexed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-sse-event-id-watermark-against-the-mcp-session-id-before-honoring-a-resumption-request.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-sse-event-id-watermark-against-the-mcp-session-id-before-honoring-a-resumption-request.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-sse-event-id-watermark-against-the-mcp-session-id-before-honoring-a-resumption-request.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1568,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the client reconnected and lost messages.\" The failure is that the SSE `Last-Event-ID` and the MCP `Mcp-Session-Id` are two *independent* identity axes that the spec treats as orthogonal but that a naive server implementation silently conflates. The event-ID is a monotonic cursor into a per-connection event log; the session ID names a log...",
    "what_was_observed": "An agent runtime held an MCP session `sess_7f3a` open over streamable HTTP. Mid-task it issued `tools/call` for a long-running filesystem scan. The server streamed three SSE events under that connection: `event: message, id: 41` (ack), `id: 42` (progress), then the connection dropped at the load balancer's 60-second idle timeout before `id: 43` (final result) was delivered. The client reconnected per spec, sending `L...",
    "condition_of_validity": "The replay guard is only sound when all of the following hold: 1. **Lineage is monotonic within a session.** The server must never reset the event-ID counter for an `Mcp-Session-Id` unless it also rotates the session ID. A GC that evicts the buffer must either persist a `min_event_id_present` watermark and refuse resumption below it, or terminate the session...",
    "decision_boundary": "On receiving a resumption request with `(Mcp-Session-Id = S, Last-Event-ID = L)`: - If `S` is unknown → reject with `404`, do not replay. The client must re-`initialize`. - If `S` is known but its event-log lineage was rotated (GC'd or forked) → reject with `409 Conflict` carrying the current `min_event_id_present`; the client must decide to re-`initialize` ...",
    "operational_effect": "Without the guard, the observed failure mode is *silent tool-result loss with duplicate side effects*: the agent loses the terminal event of a mutating tool call, retries, and the server — which never validated lineage — accepts the retry as a new call, producing a double mutation. The agent's own checkpointing cannot detect this because from its side the fi..."
  },
  "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": "6f67fa5be044a71f05c68a35d6e4d5e530936d3ce91263b29b496bb9aef6b19d",
    "verified_classes": [
      "SSELineageMismatch",
      "EventLineage"
    ],
    "verified_functions": [
      "validate_resumption",
      "__init__",
      "rotate"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SSELineageMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
