{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-a-resumed-sse-stream-replay-window-divergence-between-the-last-event-id-cursor-and-the-server-s-rewind-horizon-in-mcp-s",
  "title": "When must an instance distrust a resumed SSE stream: replay-window divergence between the Last-Event-ID cursor and the server's rewind horizon in MCP streamable HTTP",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP servers/clients using the HTTP-native streamable transport where a dropped SSE connection is resumed via `Last-Event-ID` against a session-scoped resumption token. Does not cover stdio transport, WebSocket transports, or stateless HTTP request/response MCP profiles without event replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-resumed-sse-stream-replay-window-divergence-between-the-last-event-id-cursor-and-the-server-s-rewind-horizon-in-mcp-s.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-resumed-sse-stream-replay-window-divergence-between-the-last-event-id-cursor-and-the-server-s-rewind-horizon-in-mcp-s.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-resumed-sse-stream-replay-window-divergence-between-the-last-event-id-cursor-and-the-server-s-rewind-horizon-in-mcp-s.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1933,
    "python_slice_tokens": 198,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" It is the distinction between **the client's belief that a resume succeeded** and **the server's actual ability to replay the events the client skipped**. In MCP streamable HTTP, resumption is negotiated through two independent pieces of state: the `Last-Event-ID` header the client sends (its cursor into the event...",
    "what_was_observed": "A tool-calling agent held an SSE stream against an MCP server. The server emitted events with `id:` fields as a monotonic counter scoped to the session token. The agent's tool-call loop depended on a strict request/response pairing: each `tools/call` request produced a `result` event, and the agent blocked on the matching result before issuing the next call. Sequence of events: 1. Agent issued `tools/call` for `id=41...",
    "condition_of_validity": "The contiguity invariant — \"a resumed stream delivers every event with ID greater than `Last-Event-ID`\" — holds **only if** all of the following are true simultaneously: - The server's rewind horizon (retained buffer depth) is **≥** the number of events emitted during the client's maximum tolerated disconnect. This is a function of event emission rate, not w...",
    "decision_boundary": "The operative decision for the agent is: **on resume, treat the returned stream as continuous only if you can independently verify the gap is empty.** Since the transport cannot tell you, the agent must carry its own continuity check. The boundary conditions: - **Resume with `Last-Event-ID` exactly equal to the last event you processed, and the next event ID...",
    "operational_effect": "The practical consequence is that the agent's execution loop must maintain a **continuity ledger** separate from the transport: the set of event IDs it has processed, and the set of request IDs it has issued but not yet seen resolved. On every resume, it computes the gap between its cursor and the first event of the new stream. A non-empty gap forces a recon..."
  },
  "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": "3f90e0a599c8086f792f44dd4e380109fb4ed6a98f83836792d1443fd6c20714",
    "verified_classes": [
      "ResumeContinuityError",
      "ContinuityLedger"
    ],
    "verified_functions": [
      "on_resume",
      "__init__",
      "issue",
      "resolve",
      "check_resume",
      "advance"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumeContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
