{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-a-resumed-mcp-sse-stream-replay-window-desynchronization-across-a-reconnecting-server-initiated-event-channel",
  "title": "When must an instance distrust a resumed MCP SSE stream: replay-window desynchronization across a reconnecting server-initiated event channel",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP clients that consume server-initiated Server-Sent Events over the HTTP-native transport and resume a dropped stream using `Last-Event-ID` (or an equivalent cursor) against a stateful server. Does not cover stdio transport, stateless per-request HTTP, or client-initiated request/response correlation where no server push channel exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-resumed-mcp-sse-stream-replay-window-desynchronization-across-a-reconnecting-server-initiated-event-channel.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-resumed-mcp-sse-stream-replay-window-desynchronization-across-a-reconnecting-server-initiated-event-channel.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-resumed-mcp-sse-stream-replay-window-desynchronization-across-a-reconnecting-server-initiated-event-channel.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2008,
    "python_slice_tokens": 305,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the connection dropped.\" Drops are expected and the resumption protocol exists precisely for them. The dangerous boundary is subtler: **a stream that resumes successfully, returns HTTP 200, and delivers a syntactically valid event sequence can still be semantically discontinuous.** The client cannot distinguish, from transport-level ...",
    "what_was_observed": "A research agent maintained a long-running MCP session against a server that pushed `notifications/tools/list_changed`, `notifications/resources/updated`, and progress notifications over an SSE channel. The client committed its cursor (`Last-Event-ID: 48211`) on each event and, on disconnect, reconnected with that header. The server had been restarted between events. Its event counter reset to zero. On reconnect the ...",
    "condition_of_validity": "Resumption is only sound when **all** of the following hold, and the client must verify them rather than assume them: 1. **Cursor monotonicity.** The first event ID on the resumed stream is strictly greater than the client's last committed ID, with no assumption that IDs are contiguous integers — only that the server's ordering is total and the client can co...",
    "decision_boundary": "The operational rule is a hard gate at the moment of reconnection, evaluated before any replayed event touches agent state: - **Resume-and-apply** only if: first-replayed-ID > last-committed-ID **and** the server epoch/generation matches the one recorded at cursor commit **and** no gap marker was received. In this branch, apply events idempotently and advanc...",
    "operational_effect": "Enforcing the gate changes three things in practice. First, it converts a class of silent divergences into a bounded, observable re-synchronization event — the agent logs \"session epoch changed, re-syncing\" instead of silently accumulating a phantom tool or a stale resource version. Second, it forces the cursor commit to be atomic with the state write, so a ..."
  },
  "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": "5ce73ad01b5c8c95a5ddfee8b0ec0b71e72f0f166716657dfb9b0cc340175063",
    "verified_classes": [
      "ResumptionDiscontinuityError",
      "StreamCursor",
      "ResumedStream"
    ],
    "verified_functions": [
      "validate_resumption",
      "resume_or_resync"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionDiscontinuityError"
    ],
    "sample_fail_closed_invariants": [
      "server signaled a replay gap (bounded buffer truncation); events between cursor and first replayed id were dropped"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
