{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-mcp-streamable-http-resumption-from-silently-replaying-a-poisoned-chunk-after-sse-fallback-negotiation",
  "title": "Which invariants prevent MCP streamable-HTTP resumption from silently replaying a poisoned chunk after SSE fallback negotiation",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers and clients using HTTP-native transport where a POST returns a streamable chunked body that may degrade to a resumable SSE stream negotiated via `Last-Event-ID` / `Mcp-Session-Id`. Does not cover pure stdio transport, WebSocket-based MCP bridges, or stateless one-shot JSON responses with no resumption path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-streamable-http-resumption-from-silently-replaying-a-poisoned-chunk-after-sse-fallback-negotiation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-streamable-http-resumption-from-silently-replaying-a-poisoned-chunk-after-sse-fallback-negotiation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-streamable-http-resumption-from-silently-replaying-a-poisoned-chunk-after-sse-fallback-negotiation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1772,
    "python_slice_tokens": 236,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the stream dropped.\" Dropped streams are the expected, benign case that resumption was designed for. The failure is that **resumption and fallback negotiation share a cursor namespace but not a cursor contract**. A streamable chunked response emits ordered frames with an implicit byte/sequence position; the SSE fallback emits frames ...",
    "what_was_observed": "A tool-calling agent issued `POST /mcp` with `Accept: application/json, text/event-stream`. The server responded `200` with `Transfer-Encoding: chunked` and `Content-Type: text/event-stream` (streamable mode). The first three SSE frames arrived: an `id: 41` `notifications/progress`, an `id: 42` `tools/call` result containing a destructive action descriptor (`fs.delete` on a scratch path), and then the connection was ...",
    "condition_of_validity": "The at-least-once replay guarantee of SSE resumption is *safe* only under the conjunction of: 1. **Frame identity is stable and content-addressed.** Every frame carries an `id` that is a deterministic function of its payload (or a monotonic server-assigned sequence written to the log *before* the socket flush), so a replayed frame is byte-identical to its fi...",
    "decision_boundary": "The operational rule an agent must encode: - **Trust the wire cursor for ordering; never trust it for exactly-once.** The `Last-Event-ID` you send is a *request*, not a *guarantee*. The server may replay from an earlier point. - **Before executing any tool call whose frame arrives via a resumed stream, verify frame novelty.** Compute `hash(session_id || even...",
    "operational_effect": "Without these guards, the failure signature is: duplicated side effects on exactly the tool calls that are least safe to duplicate, followed by error-compounding recovery loops that consume disproportionate token budget on a task that was already 90% complete. The agent does not crash; it *thrashes*, which is worse, because the thrash is invisible in success..."
  },
  "matched_failure_symptoms": [
    "HTTP_502_503_504_CASCADE"
  ],
  "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": "a05f584fcba37d418c8dfbfe6764df5a7a9d72348adc92fbdc031c763e5f3ae9",
    "verified_classes": [
      "ResumeAmbiguity",
      "ReplaySuppressed",
      "FrameDeduper"
    ],
    "verified_functions": [
      "handle_resumed_frame",
      "_key",
      "admit"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReplaySuppressed",
      "ResumeAmbiguity"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
