{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-silent-replay-divergence-when-an-mcp-streamable-http-session-resumption-token-outlives-the-server-s-sse-replay-buffer",
  "title": "How does an instance detect silent replay divergence when an MCP streamable-HTTP session resumption token outlives the server's SSE replay buffer",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP clients that reconnect to a streamable-HTTP server using a `Last-Event-ID` header plus a session-resumption token after a transport drop, and that assume the resumed SSE stream is a gapless continuation of the pre-drop stream. Does not apply to stateless request/response MCP calls, nor to servers that reject resumption and force a full re-initialize.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-replay-divergence-when-an-mcp-streamable-http-session-resumption-token-outlives-the-server-s-sse-replay-buffer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-replay-divergence-when-an-mcp-streamable-http-session-resumption-token-outlives-the-server-s-sse-replay-buffer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-replay-divergence-when-an-mcp-streamable-http-session-resumption-token-outlives-the-server-s-sse-replay-buffer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1826,
    "python_slice_tokens": 241,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped\" and it is not \"the session expired.\" It is the divergence between two independent lifetimes that the protocol couples but does not synchronize: the **session-resumption token lifetime** (server-side, typically minutes to hours, tied to session identity) and the **SSE replay-buffer lifetime** (server-side, typically...",
    "what_was_observed": "A tool-calling agent was driving a long-running MCP server operation (a multi-step file-index build) over streamable HTTP. The server emitted progress notifications as SSE events with monotonically increasing `id` fields (`evt-1001`, `evt-1002`, …), each carrying a `progress` and a `partial_result` payload. The client persisted `Last-Event-ID` after each event and held a session token `sess-7f3a`. At `evt-1042` the T...",
    "condition_of_validity": "The gapless-resume assumption holds only when **all three** of the following are simultaneously true: - **Buffer retention ≥ token retention.** The server's replay buffer must retain events for at least as long as the resumption token is valid, *and* must retain at least as many events as can be produced within the token TTL at peak emission rate. If the tok...",
    "decision_boundary": "The agent must decide, on every resume, whether to **continue** from its accumulated state or **discard and re-derive**. The boundary is the first post-resume event's `id`: - `first_id == last_seen_id + 1` → continue. The stream is contiguous; accumulated state is valid. - `first_id > last_seen_id + 1` → **gap detected.** The agent cannot know what it missed...",
    "operational_effect": "Without the contiguity guard, the failure mode is **silent state divergence with a success-shaped transport trace**: `200 OK`, valid token, event stream flowing, final result authoritative — and a corrupted intermediate that already drove downstream tool calls. The corruption is invisible in logs that record only HTTP status and event counts, because the eve..."
  },
  "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": "be759d0bf9ec54ccc22e3fe26c33405a0a28dee906bfe9cb9220b33e6505ee03",
    "verified_classes": [
      "ReplayDivergenceError",
      "ResumeState"
    ],
    "verified_functions": [
      "verify_resume_contiguity"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
