{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-replayed-sse-event-ids-against-a-resumed-mcp-session-when-the-server-s-session-affinity-router-and-the-client-s-last",
  "title": "Where must an instance reconcile replayed SSE event IDs against a resumed MCP session when the server's session-affinity router and the client's Last-Event-ID cursor disagree on stream epoch",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with resumable SSE (Last-Event-ID replay) against a load-balanced MCP server fleet that pins sessions to a backend via affinity. Does not apply to stdio transports, to single-backend deployments without affinity, or to servers that emit globally monotonic event IDs across the whole fleet.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-replayed-sse-event-ids-against-a-resumed-mcp-session-when-the-server-s-session-affinity-router-and-the-client-s-last.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-replayed-sse-event-ids-against-a-resumed-mcp-session-when-the-server-s-session-affinity-router-and-the-client-s-last.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-replayed-sse-event-ids-against-a-resumed-mcp-session-when-the-server-s-session-affinity-router-and-the-client-s-last.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1807,
    "python_slice_tokens": 287,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **event-ID monotonicity within a stream epoch** and **event-ID monotonicity across session resumption**. The MCP streamable transport spec allows a client to reconnect with `Last-Event-ID` and receive replayed events from that point forward. This contract is only sound if the server that replays the events is the *same...",
    "what_was_observed": "An agent runtime executing a long tool-call sequence over MCP streamable HTTP lost three `tool_result` events during a rolling deploy. The trace: 1. Client opens `POST /mcp` with `Accept: text/event-stream`, receives `Mcp-Session-Id: s-7f3a`, and begins consuming events `id: 4800` … `id: 4821`. Each event carries a `tool_result` for a batched file-read operation. 2. Backend B1 is drained for deploy. The client's TCP ...",
    "condition_of_validity": "The `Last-Event-ID` replay contract is valid **only** when all of the following hold simultaneously: - **Producer identity is stable across resumption.** The backend that answers the resumed `GET` is the same logical producer that emitted the cursor. Under affinity this requires either a shared session store (so any backend can replay any session's event log...",
    "decision_boundary": "The client must decide, on every resumed stream, whether the incoming event IDs belong to the same epoch as its cursor. It cannot rely on the server to tell it. The boundary rule: - **If the first replayed event's ID is strictly greater than the cursor and the stream carries a session-epoch token that matches the pre-disconnect token**, treat as same-epoch r...",
    "operational_effect": "The practical consequence is that resumable SSE over an affinity-routed MCP fleet is **at-least-once with an unreliable dedup key**. Clients that implement naive cursor dedup will drop events on epoch change; clients that implement no dedup will double-apply tool results on same-epoch replay. The only safe posture is epoch-aware reconciliation: treat the str..."
  },
  "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": "35328286e35e227da78b2992412a08b51596f5679275270285f20f523ef3838f",
    "verified_classes": [
      "EpochContinuityViolation"
    ],
    "verified_functions": [
      "reconcile_resume"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "EpochContinuityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
