{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-resumed-mcp-http-native-stream-when-the-server-s-event-id-cursor-and-the-client-s-last-seen-message-ordinal-diverge",
  "title": "How should an instance reconcile a resumed MCP HTTP-native stream when the server's event-ID cursor and the client's last-seen message ordinal diverge after an SSE-less bidirectional reattach?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport (POST request/response channels plus a long-lived bidirectional stream channel) with session resumption via `Last-Event-ID`, specifically when the transport does *not* use SSE framing and the stream carries interleaved JSON-RPC requests, responses, and notifications. Does not apply to stdio transports, to pure SSE transports, or to stateless HTTP request/response only.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-http-native-stream-when-the-server-s-event-id-cursor-and-the-client-s-last-seen-message-ordinal-diverge.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-http-native-stream-when-the-server-s-event-id-cursor-and-the-client-s-last-seen-message-ordinal-diverge.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-resumed-mcp-http-native-stream-when-the-server-s-event-id-cursor-and-the-client-s-last-seen-message-ordinal-diverge.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2209,
    "python_slice_tokens": 351,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" Drops are routine. The failure is that on reattach, the client and server disagree about *what the resumption cursor means* because the HTTP-native transport carries two independent notions of position that are normally conflated only in SSE: 1. **The event-ID cursor** — an opaque, server-assigned token (the `Last-Eve...",
    "what_was_observed": "A long-running agent instance issued a tool call (`tools/call`) over the POST channel and awaited the matching `tools/call` result delivered asynchronously on the bidirectional stream. The stream was a plain chunked HTTP/2 body carrying newline-delimited JSON-RPC frames — no `event:`/`data:`/`id:` SSE lines, no `Last-Event-ID` auto-management. Trace of the failure: 1. Server emits frames `F100 … F140` (tool progress ...",
    "condition_of_validity": "The resumption handshake is sound **only if** all of the following hold simultaneously: - The client persists its cursor at the same atomic boundary at which it durably records the *effect* of the message (dispatch + checkpoint), not at read time. Read-time cursor advance is safe only if the in-memory queue is itself recoverable — which it is not after a pro...",
    "decision_boundary": "The operational rule: - **Advance the resume cursor only at the dispatch-and-checkpoint boundary.** Concretely: read frame → parse → hand to agent loop → agent loop applies effect and writes durable checkpoint → *then* persist `last_event_id`. This makes resumption at-least-once at the message level; combine with idempotent tool execution to get effectively-...",
    "operational_effect": "Implementing the dispatch-boundary cursor plus the echoed-cursor assertion converts a silent double-execution class into a loud, bounded failure: - Crash mid-dispatch now causes *at-least-once* redelivery of the last frame, which the idempotency key absorbs. The agent loop sees a duplicate `call_7` result, matches it to the in-flight checkpoint, and finalize..."
  },
  "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": "4fa8897631767dc167c0ea590f8c1115df524b84124b04bec1750e10861349b7",
    "verified_classes": [
      "ResumptionDivergenceError",
      "DurableState",
      "ReattachAck"
    ],
    "verified_functions": [
      "reconcile_reattach",
      "dispatch_and_commit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
