{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-http-native-streaming-when-last-event-id-replay-collides-with-backpressure-ind",
  "title": "What structural signals indicate a broken resumability invariant in MCP HTTP-native streaming when Last-Event-ID replay collides with backpressure-induced buffer eviction",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers exposing HTTP-native streaming transports (Server-Sent Events or chunked streaming) that advertise resumability via `Last-Event-ID` and per-session event buffers. Does not apply to stdio transports, stateless one-shot tool calls, or WebSocket transports with OS-level flow control.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-http-native-streaming-when-last-event-id-replay-collides-with-backpressure-ind.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-http-native-streaming-when-last-event-id-replay-collides-with-backpressure-ind.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-resumability-invariant-in-mcp-http-native-streaming-when-last-event-id-replay-collides-with-backpressure-ind.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1926,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "An MCP HTTP-native streaming session that *advertises* resumability is not the same as one that *provides* it. The resumability contract is a conjunction of three independent invariants: (a) every emitted SSE event carries a monotonically increasing `id` scoped to the session, (b) the server retains every event in `[last_acknowledged_id + 1, current_id]` unt...",
    "what_was_observed": "A tool-using agent (planner → `file_search` → `code_exec` → summarizer) ran against an MCP server over SSE. The `code_exec` tool streamed long output (a 40 MB build log) as a sequence of `event: message` frames, each with an `id` and a `data` payload. The agent's SSE client applied read-side backpressure by pausing the underlying socket when its in-memory frame queue exceeded 512 frames (a deliberate bound to protect...",
    "condition_of_validity": "The invariant \"`Last-Event-ID` replay reconstructs the exact event sequence\" holds only when the server's retention window is strictly greater than the maximum number of events that can be emitted during the longest possible client stall. In practice this is never guaranteed for streaming tool output, because: - The retention window is a *count* (256 events)...",
    "decision_boundary": "The boundary is between *resumable* and *replayable-with-gap*. An MCP server crosses from the former to the latter the moment it evicts an unacknowledged event while keeping its `id` counter advancing. The correct behavior at that boundary is to *poison the session*: mark the earliest evicted `id` as a `resume_gap` and, on any subsequent `Last-Event-ID` reco...",
    "operational_effect": "The downstream effect is *silent causal corruption of the agent's tool-result state*. The agent does not see a truncated stream; it sees a well-formed, contiguous stream that is missing an interior interval. Because the summarizer's reasoning is probabilistic, it will confabulate continuity over the hole — and the confabulation is not random, it is biased to..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION",
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "704b73a9149fbccdd32e871d66257dd5e904900dc1f11b7f4742b4d70933cccd",
    "verified_classes": [
      "ResumeGapError"
    ],
    "verified_functions": [
      "resume_session",
      "finalize_stream",
      "handle_reconnect"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumeGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
