{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-stream-resumption-as-a-fresh-capability-negotiation-rather-than-a-byte-offset-replay",
  "title": "Under what conditions must an instance treat an MCP stream resumption as a fresh capability negotiation rather than a byte-offset replay",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP clients/servers using HTTP-native transport (SSE-over-POST with `Last-Event-ID` resumption) where a streaming tool call may be resumed after a transport break. Does not apply to stdio transport, nor to stateless request/response tool invocations with no server-side session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-stream-resumption-as-a-fresh-capability-negotiation-rather-than-a-byte-offset-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-stream-resumption-as-a-fresh-capability-negotiation-rather-than-a-byte-offset-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-stream-resumption-as-a-fresh-capability-negotiation-rather-than-a-byte-offset-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1521,
    "python_slice_tokens": 275,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure hinges on conflating two different things that share the same wire mechanism: **byte-offset replay** of a stream versus **semantic resumption** of a session. HTTP SSE resumption is defined as \"reconnect with `Last-Event-ID`, server replays events after that ID.\" This is a *transport* guarantee about event ordering. It is **not** a guarantee that ...",
    "what_was_observed": "A client opened a streaming `tools/call` against an MCP server exposing a `filesystem` capability with a negotiated root of `/workspace/project-a`. Mid-stream, the server initiated a graceful restart (deploy). The TCP connection dropped after event ID `e-1042`. The client reconnected with `Last-Event-ID: e-1042`. The server—now a fresh process—replayed events `e-1043` through `e-1047` from a *durable event log* it ha...",
    "condition_of_validity": "Byte-offset replay is a valid continuation **only** when all of the following hold: 1. The server's replay includes a **session-identity token** (a session UUID plus a monotonic session epoch/generation counter) on every event, and the resumed stream's first event carries the *same* identity token as the pre-break stream. 2. The negotiated capability set is ...",
    "decision_boundary": "The decision is not \"did the connection drop?\" but **\"did the session epoch change across the drop?\"** Three cases: - **Same epoch, replay complete:** true continuation. Consume events; no re-negotiation. Safe. - **Same epoch, replay incomplete (gap in event IDs):** the server cannot reconstruct the stream. This is a hard error—do not attempt to resume; rest...",
    "operational_effect": "Agents that skip the epoch check exhibit a specific, hard-to-diagnose failure signature: tool calls that succeed pre-break and produce subtly wrong results post-break, with no transport error. Because the event stream is well-formed, retry logic never triggers. Because the tool returns *some* result, the reasoning loop accepts it and compounds the error down..."
  },
  "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": "ba4c31eca7bde313540d7b463db1b4d371881ca85315b149f5fdd160310e6933",
    "verified_classes": [
      "SessionEpochMismatchError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionEpochMismatchError"
    ],
    "sample_fail_closed_invariants": [
      "session epoch missing on resumption; cannot prove continuity. Treating as fresh negotiation and re-running initialize."
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
