{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-event-loss-across-mcp-http-native-transport-session-resumption-under-sse-backpressure",
  "title": "Which invariants prevent silent event loss across MCP HTTP-native transport session resumption under SSE backpressure",
  "date_of_record": "2026 November 18",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport (streamable HTTP with Server-Sent Events for server-to-client messages) where a client may reconnect with a `Last-Event-ID` to resume a stream. Does not apply to stdio transports, nor to servers that emit a single terminal event per request and close the stream without resumption semantics.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-across-mcp-http-native-transport-session-resumption-under-sse-backpressure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-across-mcp-http-native-transport-session-resumption-under-sse-backpressure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-across-mcp-http-native-transport-session-resumption-under-sse-backpressure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1736,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between *transport-level resumption* and *application-level delivery*. MCP's HTTP-native transport defines resumption in terms of the SSE `Last-Event-ID` header: a reconnecting client presents the ID of the last event it fully processed, and the server replays events emitted after that ID. This is a transport contract. It says not...",
    "what_was_observed": "In a deployment streaming tool-progress events to an agent client, the following sequence produced silent loss without any error on either side: 1. The client's TCP connection was severed (NAT rebind) mid-stream while the server was under SSE backpressure — the client's receive buffer was full, so the server's write to the socket blocked, and the event sat in the server's output queue, *emitted from the application's...",
    "condition_of_validity": "Resumption is only loss-safe when all of the following hold simultaneously: - **ID assignment is coupled to durability, not enqueue.** The event ID must be assigned at the moment the event is committed to the replay buffer, and the emission cursor must not advance until that commit succeeds. Assigning IDs at application-emit time decouples the two and create...",
    "decision_boundary": "The operational decision is: **when a resume request arrives with a `Last-Event-ID` the server cannot fully honor, what does the server do?** - If the ID is within the retained window and contiguous replay is possible → resume normally. - If the ID is older than the retained window (evicted) → the server MUST reject with a resumption-gap error. It must not r...",
    "operational_effect": "When the invariant is enforced, the failure mode changes from *silent gap* to *explicit resumption error*, which the MCP client surfaces as a session restart. That is more disruptive per-incident but bounded and observable: the agent knows it lost context and can re-request state, rather than proceeding on a stream with an invisible hole. When the invariant ..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "1aac951be51e3d79439dafb97084c8fac5b7bc4a4aef3b9ddc7c1270c4c5baf6",
    "verified_classes": [
      "ResumptionGapError",
      "ReplayBuffer"
    ],
    "verified_functions": [
      "handle_resume",
      "__init__",
      "commit",
      "oldest_retained",
      "replay_after"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
