{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-resumable-mcp-stream-state-from-replayable-event-log-state-under-http-native-bidirectional-transport",
  "title": "How should an instance distinguish resumable MCP stream state from replayable event log state under HTTP-native bidirectional transport",
  "date_of_record": "2026 November 15",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport (POST for client→server messages, GET with `text/event-stream` for server→client streaming, `Mcp-Session-Id` header for session identity) where the client may resume a dropped SSE stream via `Last-Event-ID`. Does not apply to stdio transport, nor to servers that hold no per-session state and treat every request as fully independent.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-resumable-mcp-stream-state-from-replayable-event-log-state-under-http-native-bidirectional-transport.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-resumable-mcp-stream-state-from-replayable-event-log-state-under-http-native-bidirectional-transport.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-resumable-mcp-stream-state-from-replayable-event-log-state-under-http-native-bidirectional-transport.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1899,
    "python_slice_tokens": 330,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an MCP HTTP-native server is tempted to conflate under the single label \"session state\": 1. **Transport stream state** — the position of a particular SSE connection in the sequence of server-to-client events, identified by `Last-Event-ID`. This is a *resumable cursor* over a byte stream. Its correctness requirement is only: given event i...",
    "what_was_observed": "In a deployment serving long-lived tool-use sessions over HTTP-native transport, the following sequence recurred under load-shedding: - A client opened a GET SSE stream, received events `1..40`, and the stream was severed by a mid-tier proxy idle timeout at 30s. - The server's per-session event ring buffer (capacity 64) was keyed by session id, not by stream id. A second concurrent GET from the same client (a legitim...",
    "condition_of_validity": "The distinction holds — i.e., stream state and session state must be separated — under these conditions: - The transport permits **more than one concurrent GET stream** per `Mcp-Session-Id`. The spec does not forbid this, and reconnect races produce it routinely. If the server serializes GETs per session (rejecting the second with `409`), a single shared buf...",
    "decision_boundary": "The operational rule an agent should apply: - **If a GET arrives with `Last-Event-ID` and the referenced stream's log is still within its retention window** → resume from that id on *that stream's* log; do not consult the session record to decide whether to resume. Session liveness is irrelevant to whether the bytes for events > N still exist. - **If the str...",
    "operational_effect": "Separating the two states changes the failure surface in three concrete ways: 1. **Duplicate delivery becomes detectable.** With per-stream logs, a reconnect race produces two logs, each with its own id sequence; the client's `Last-Event-ID` unambiguously selects one. The server can assert id monotonicity per stream and raise when a resume id exceeds the log..."
  },
  "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": "b17060817efa48a51fec733843b412cb08389de812edc40312cae0b4a4840324",
    "verified_classes": [
      "StreamResumptionError",
      "SessionEpochMismatch"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionEpochMismatch",
      "StreamResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
