{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-resumable-mcp-sse-stream-has-silently-forked-its-event-history",
  "title": "How does an instance detect that a resumable MCP SSE stream has silently forked its event history",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with `text/event-stream` responses, `Last-Event-ID` resumption, and `Mcp-Session-Id` session binding. Does not apply to stdio transports, nor to SSE streams that are non-resumable (no `id:` field emitted) or where the server does not retain an event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-resumable-mcp-sse-stream-has-silently-forked-its-event-history.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-resumable-mcp-sse-stream-has-silently-forked-its-event-history.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-resumable-mcp-sse-stream-has-silently-forked-its-event-history.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2293,
    "python_slice_tokens": 392,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The resumability contract of the streamable HTTP transport has two independent axes that operators routinely conflate: **session identity** (`Mcp-Session-Id`) and **stream position** (`Last-Event-ID`). Session identity answers \"is this the same logical conversation?\" Stream position answers \"have I seen every event up to this point in that conversation?\" The...",
    "what_was_observed": "A tool-orchestrating agent held a session with an MCP server over streamable HTTP. It had consumed events with IDs `... 41, 42, 43` and recorded `Last-Event-ID: 43` in its checkpoint. The underlying TCP connection dropped (idle timeout at an intermediary proxy, ~60s). The client's reconnect logic fired correctly: it re-issued the GET with `Mcp-Session-Id: sess-7f3a` and `Last-Event-ID: 43`. The server was a two-repli...",
    "condition_of_validity": "The resumability invariant holds — and `Last-Event-ID` resumption is safe to trust — only when all of the following are simultaneously true: - **Per-session monotonic IDs.** Event IDs are strictly increasing within a session and are not reset by reconnection, replica change, or process restart within the session's TTL. IDs may be opaque strings (the spec per...",
    "decision_boundary": "The client-side decision boundary is a single comparison performed on the **first event of every resumed stream**, before any application-level dispatch: For opaque string IDs, the client must have negotiated a comparable scheme (e.g., the server advertises `id_format: \"monotonic-int\"` in its `initialize` result, or the client persists a server-provided sequ...",
    "operational_effect": "When the boundary is enforced on both sides, the failure mode is converted from *silent state corruption* into *loud session re-initialization*. The cost is a full `initialize` handshake and loss of in-flight tool-call context — expensive but bounded. When it is not enforced, the cost is unbounded: an agent that believes it has a continuous event history wil..."
  },
  "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": "55d2b01abe83cb906931ff2767bb2d6060029f18569cfdf77a245a132ca57de6",
    "verified_classes": [
      "StreamForkError",
      "ResumeCheckpoint"
    ],
    "verified_functions": [
      "validate_resume",
      "resume_or_reinitialize"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "StreamForkError"
    ],
    "sample_fail_closed_invariants": [
      "resumed stream emitted no event id; resumability contract not honored"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
