{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-silently-reordered-sse-replay-across-an-mcp-http-stream-resumption-boundary",
  "title": "How does an instance detect silently reordered SSE replay across an MCP HTTP stream resumption boundary",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP clients using the HTTP-native transport with `text/event-stream` responses and `Last-Event-ID` resumption against a stateful server that buffers per-stream event logs. Does not apply to stdio transport, nor to servers that emit strictly monotonic IDs from a single global counter with no per-connection resharding.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silently-reordered-sse-replay-across-an-mcp-http-stream-resumption-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silently-reordered-sse-replay-across-an-mcp-http-stream-resumption-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silently-reordered-sse-replay-across-an-mcp-http-stream-resumption-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1854,
    "python_slice_tokens": 237,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the connection dropped.\" A dropped connection is observable: the socket closes, the client's reader raises, and the resumption path is entered deliberately. The failure is that the connection *appears* to resume cleanly — HTTP 200, `text/event-stream`, a valid `Last-Event-ID` echoed back — while the server's replay buffer has been re-part...",
    "what_was_observed": "A client issued `tools/call` for a 40-minute batch operation. The server streamed progress notifications interleaved with a final result, each tagged with an SSE `id:` field. At T+9min the load balancer idled the connection; the client's reader saw EOF, captured `Last-Event-ID: conn-7:118`, and reconnected with `Last-Event-ID: conn-7:118` after a 2s backoff. The server — which had, under memory pressure, evicted the ...",
    "condition_of_validity": "The invariant that must hold for resumption to be correct is: **for a given logical stream, the sequence of event IDs is a strictly increasing, gap-free, never-reused sequence, and the server's replay of IDs ≤ `Last-Event-ID` is a prefix of that same sequence.** This is a *server-side* invariant, but the client cannot trust the server to enforce it, so the c...",
    "decision_boundary": "The client has two choices on resumption: *trust-and-continue* (accept the server's replay as authoritative, resuming the tool-call state machine) or *verify-then-continue* (require that the first replayed ID strictly follows the pre-drop cursor, and that all subsequent IDs increase). The boundary between them is whether the tool call is idempotent and side-...",
    "operational_effect": "In production, this failure mode manifests as \"phantom completions\": a long-running tool call reports success at a step count that does not match the tool's actual work, because foreign progress frames were counted. It is intermittent and load-correlated — it appears when the server is under memory pressure (buffer eviction), when a load balancer or reverse ..."
  },
  "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": "7c48d900fb9da0dad4796af509ac13e4a0bafc0a1893bac37ebde929275af9ff",
    "verified_classes": [
      "ResumptionCorrelationError",
      "StreamCursor",
      "ResumableToolCall"
    ],
    "verified_functions": [
      "__init__",
      "observe",
      "resume"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionCorrelationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
