{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-event-loss-when-an-mcp-streamable-http-session-migrates-from-sse-to-post-mid-stream",
  "title": "Which invariants prevent silent event loss when an MCP streamable HTTP session migrates from SSE to POST mid-stream",
  "date_of_record": "2026 November 16",
  "scope": "Applies to MCP servers and clients using the HTTP-native streamable transport where a single logical session spans an initial `GET` (SSE event stream) and subsequent `POST` requests resuming that session via `Last-Event-ID`. Does not apply to the legacy two-endpoint SSE transport, nor to sessions that never resume after disconnection.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-an-mcp-streamable-http-session-migrates-from-sse-to-post-mid-stream.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-an-mcp-streamable-http-session-migrates-from-sse-to-post-mid-stream.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-an-mcp-streamable-http-session-migrates-from-sse-to-post-mid-stream.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1256,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The streamable HTTP transport conflates two orthogonal concerns: *transport channel* (GET-held SSE vs. POST-response SSE) and *event continuity* (the monotonically ordered event ID space). A resumption is correct only if the client's `Last-Event-ID` is interpreted against the *same* event log that produced it, regardless of which HTTP method currently carrie...",
    "what_was_observed": "A client opened a `GET /mcp` stream and received events `e1..e7` (IDs `1..7`). The connection dropped after `e7`. The client resumed by issuing `POST /mcp` with `Last-Event-ID: 7` and a new JSON-RPC request. The server, treating the POST as a fresh request scope, initialized a *new* event counter at `1` for the POST-response SSE stream. The client accepted the POST response body as a continuation and appended the new...",
    "condition_of_validity": "Resumption is valid only when all of the following hold: 1. The event-ID space is **session-scoped and globally monotonic**, independent of HTTP method. Event IDs are never reset by a channel switch. 2. The server persists emitted events (or a replay cursor) for the session's retention window, and `Last-Event-ID` is resolved against that persisted log — not ...",
    "decision_boundary": "- **If** the server cannot guarantee a session-scoped monotonic ID space across GET and POST, **then** it must not accept `Last-Event-ID` on a POST and must instead return an explicit resumption failure (forcing a full re-initialize). Silent acceptance is the bug. - **If** the POST response is `application/json`, **then** no events may be assumed delivered; ...",
    "operational_effect": "The practical consequence is that \"successful reconnect\" is not evidence of \"no event loss.\" Health checks that assert only HTTP 200 on the POST will pass while events `e8..eN` are permanently lost. The only reliable detector is a client-side high-water-mark assertion on every event ID plus a server-side persisted replay log keyed by session, not by connecti..."
  },
  "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": "7d35062fa341eca58f4d815ab00386c62943d0b68b76af1a66a4c46db5bfde62",
    "verified_classes": [
      "EventContinuityViolation",
      "SessionEventLog",
      "ResumingClient"
    ],
    "verified_functions": [
      "resume_over_post",
      "__init__",
      "emit",
      "replay_after",
      "__init__",
      "accept_event"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "EventContinuityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
