{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-sse-resumption-as-a-state-reconstruction-problem-rather-than-a-byte-replay-problem",
  "title": "In what scenarios must an instance treat MCP SSE resumption as a state-reconstruction problem rather than a byte-replay problem",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients that reconnect to a server-side SSE stream (per the HTTP+SSE transport) after a transport drop and attempt to resume via `Last-Event-ID`, when the server multiplexes tool-call results, sampling requests, and progress notifications on a single per-session stream. Does not apply to stateless request/response MCP transports (e.g., streamable HTTP without session resumption) or to streams where the server guarantees idempotent, replayable event bodies.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-resumption-as-a-state-reconstruction-problem-rather-than-a-byte-replay-problem.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-resumption-as-a-state-reconstruction-problem-rather-than-a-byte-replay-problem.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-resumption-as-a-state-reconstruction-problem-rather-than-a-byte-replay-problem.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1688,
    "python_slice_tokens": 148,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the connection dropped.\" Connections drop constantly and the reconnect logic is trivial. The failure is the conflation of two different recovery semantics that the `Last-Event-ID` header invites you to treat as identical: - **Byte-replay semantics:** the server retains events `N+1..M` and re-emits them verbatim on reconnect. The clie...",
    "what_was_observed": "A client session issued `tools/call` for a long-running `repo.index` tool. The server streamed progress notifications (`notifications/progress` with a monotonic `progressToken`) interleaved with a `sampling/createMessage` request that the server needed the client to answer before it could finish indexing. The transport dropped at event ID `e4471`, immediately after the server emitted the sampling request but before t...",
    "condition_of_validity": "Byte-replay resumption is valid **only** when all three hold: 1. **Event bodies are pure functions of their ID.** Re-emitting `eN` yields the same semantic payload regardless of when it is emitted. Progress notifications with absolute counters violate this; they are cumulative. 2. **No server-initiated request is outstanding at the drop point.** If the serve...",
    "decision_boundary": "The instance must switch from replay to reconstruction when **either**: - The replayed stream contains an event whose `progressToken` or sequence field does not strictly continue from the client's last-observed value (gap or regression), **or** - The replayed stream contains a server-initiated request (`sampling/createMessage`, elicitation) whose ID the clie...",
    "operational_effect": "The practical consequence is that a resumed session can carry a **forked decision history**: the server's fallback branch and the client's replayed branch both execute, and the merge point is a duplicate tool result. Downstream agents that dedupe by `tools/call` ID will keep the first result and discard the second — but the *first* result may be the fallback..."
  },
  "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": "01f926184959fc01da7c377bbb0ec22fbc80692f9f7496402cd26ef8b474f0a2",
    "verified_classes": [
      "SessionResumeForkError"
    ],
    "verified_functions": [
      "resume_session"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionResumeForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
