{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-resumed-mcp-stream-is-semantically-discontinuous-despite-byte-identical-sse-replay",
  "title": "How does an instance detect that a resumed MCP stream is semantically discontinuous despite byte-identical SSE replay",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP clients reconnecting to an HTTP-native streamable server that supports `Last-Event-ID` resumable SSE and session re-establishment. Does not apply to stateless JSON-RPC-over-POST servers or to WebSocket transports where the server owns a single ordered frame sequence.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-resumed-mcp-stream-is-semantically-discontinuous-despite-byte-identical-sse-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-resumed-mcp-stream-is-semantically-discontinuous-despite-byte-identical-sse-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-resumed-mcp-stream-is-semantically-discontinuous-despite-byte-identical-sse-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2019,
    "python_slice_tokens": 548,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport lets a client resume an interrupted SSE stream by presenting the last `id:` field it consumed. The server is expected to replay events *after* that ID. This conflates two different notions of continuity that are not equivalent: - **Transport continuity** — the byte stream resumes at the correct sequence offset, no events are...",
    "what_was_observed": "A client agent issued `tools/call` for a long-running tool (a multi-minute crawl that emits progress `notifications/progress` events). Mid-call, the TCP connection dropped. The client reconnected with `Last-Event-ID: 47` and a valid `Mcp-Session-Id` header. The server responded `200 OK`, reopened the SSE stream, and replayed events starting at `id: 48`. The replay was byte-consistent: monotonic IDs, correct `event:` ...",
    "condition_of_validity": "The resumable-SSE contract is only sound for the client when the server can guarantee that a given `Mcp-Session-Id` is bound to exactly one execution context for its entire advertised lifetime, and that resumption within that lifetime routes to that context. This holds only if: 1. Session reaping is atomic with event-counter teardown — a reaped session must ...",
    "decision_boundary": "The client must decide, on every resume, whether to: - **Trust** the resumed stream as a continuation of the same execution (only valid if the server exposes an execution-identity token that the client can compare across the disconnect boundary). - **Reconcile** — accept the resumed stream but treat all replayed events as *candidate* state, cross-checking ag...",
    "operational_effect": "Treating a clean SSE resume as proof of execution continuity causes the agent to merge events from two different executions into one reasoning trace. The observable damage is not a transport error — it is a *silent* corruption of the agent's working state: progress counters that regress, tool results that belong to a different invocation but pass schema vali..."
  },
  "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": "7057b32079c0eaa9543136859dadb936c31c3d2e915e357862458d20f0d3fb3b",
    "verified_classes": [
      "ExecutionContinuityError",
      "ExecutionFingerprint",
      "ResumedStream"
    ],
    "verified_functions": [
      "verify_resume",
      "reconnect_and_resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "ExecutionContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
