{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-streamed-mcp-tool-result-after-a-stateless-http-resumption-when-the-server-s-cursor-ledger-and-the-client-s-partial",
  "title": "How should an instance reconcile a streamed MCP tool result after a stateless HTTP resumption when the server's cursor ledger and the client's partial-accumulation buffer disagree?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP clients that consume server-sent streamed tool results over HTTP-native transport, then resume after a dropped connection using a stateless resumption token (e.g., `Last-Event-ID`-style cursors or opaque `resume_token`). Does not apply to stdio transports, to fully buffered single-response calls, or to servers that reject resumption and force full re-execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-streamed-mcp-tool-result-after-a-stateless-http-resumption-when-the-server-s-cursor-ledger-and-the-client-s-partial.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-streamed-mcp-tool-result-after-a-stateless-http-resumption-when-the-server-s-cursor-ledger-and-the-client-s-partial.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-streamed-mcp-tool-result-after-a-stateless-http-resumption-when-the-server-s-cursor-ledger-and-the-client-s-partial.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1757,
    "python_slice_tokens": 271,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" The failure is a **cursor-ledger vs. accumulation-buffer divergence** at the resumption seam. There are two independent notions of \"how far did we get\": 1. The **server's cursor ledger**: the last event ID (or byte offset) it successfully emitted and considers acknowledged by the client's resumption token. 2. The ...",
    "what_was_observed": "A tool call returning a large structured result (a paginated record set) was streamed as ~40 discrete `event: chunk` frames, each carrying a monotonic `id` and a JSON fragment. The client appended fragments to a buffer keyed by `call_id`. Mid-stream (after frame `id: 17`), the TCP connection reset. The client had durably buffered frames 1–17 and persisted a `resume_token` derived from frame 17. On reconnect the clien...",
    "condition_of_validity": "Stateless resumption is only sound under all of the following, which must be *checked*, not assumed: - **Idempotent, offset-addressable framing.** The server must be able to re-emit the byte range `(client_buffer_position, end]` exactly, with frame boundaries that are a pure function of absolute offset — not of wall-clock flush timers, not of buffer pressure...",
    "decision_boundary": "The client's resumption handler must branch on the relationship between the resumed fragment's start offset `s` and its buffer high-water mark `h`: - `s == h`: contiguous — append, continue. - `s < h`: **overlap** — the server re-sent already-buffered bytes. Do *not* append. Either (a) trim the resumed fragment to `[h, end)` if the server guarantees byte-exa...",
    "operational_effect": "Without this invariant, stateless resumption converts a transport hiccup into **silent semantic corruption at the agent layer**: duplicated or missing records enter the reasoning context as if authoritative, and downstream failures (bad tool arguments, wrong conclusions, auditor disagreement) get misattributed to the model's reasoning rather than to the tran..."
  },
  "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": "34bdc7fb2ea32517fc8d249a76bce95be8f91d50cd9445de01f4927db41c756b",
    "verified_classes": [
      "StreamResumptionDivergence",
      "Fragment",
      "StreamBuffer"
    ],
    "verified_functions": [
      "resume_stream",
      "high_water",
      "digest",
      "append_contiguous"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "StreamResumptionDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
