{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-sse-resumption-tokens-from-silently-forking-an-mcp-session-across-reconnects",
  "title": "Which invariants prevent SSE resumption tokens from silently forking an MCP session across reconnects",
  "date_of_record": "2026 December 3",
  "scope": "Applies to MCP servers exposing the HTTP-native transport with Server-Sent Events streaming plus a `Last-Event-ID`-style resumption token (the Streamable HTTP transport). Does not apply to stdio transports, nor to plain request/response HTTP endpoints without a persistent event stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-sse-resumption-tokens-from-silently-forking-an-mcp-session-across-reconnects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-sse-resumption-tokens-from-silently-forking-an-mcp-session-across-reconnects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-sse-resumption-tokens-from-silently-forking-an-mcp-session-across-reconnects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2150,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things a resumption token can mean, and conflating them is the root of the failure. The first is a **replay cursor**: \"re-send me buffered events strictly after sequence N.\" This is what the SSE `Last-Event-ID` spec implies, and it is stateless with respect to the client — the server only needs the event buffer. The second is a **sess...",
    "what_was_observed": "A client opened a stream, negotiated capabilities, issued a long-running tool call (`tools/call` for a code-search over a large index), and received a partial `notifications/progress` stream. Mid-call the TCP connection reset. The client reconnected with `Last-Event-ID: 4471` and a session header carrying the prior session ID. The server's behavior on reconnect: 1. Looked up the event buffer by session ID — **found i...",
    "condition_of_validity": "The replay-cursor interpretation of the resumption token is only valid under a precondition that is almost never stated: **the set of state required to service the stream is a subset of the state reconstructible from the event buffer.** For pure notification streams (log tailing, progress-only feeds) this holds. For any stream that carries request/response c...",
    "decision_boundary": "The boundary is drawn on two axes: **does the session have in-flight requests at reconnect time**, and **are those requests idempotent**. - No in-flight requests, buffer intact → replay from token. Safe. This is the common case and the one the naive implementation was tuned for. - In-flight requests, all idempotent (read-only tools, pure queries) → replay fr...",
    "operational_effect": "The guardrail is a single check at the resume entry point, before any replay bytes are written: reconcile the token against the durable request table and refuse if they disagree. Implementations that skip it are indistinguishable from correct ones under all-read-only workloads and under all clean-disconnect workloads — the failure only surfaces when a non-id..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "071597ee908ec11fc8ad07ad078f78ed9f71abed36cce282321ca0ef7f8de9d6",
    "verified_classes": [
      "UnsafeResumptionError",
      "InFlightRequest",
      "SessionState"
    ],
    "verified_functions": [
      "reconcile_resumption",
      "handle_resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafeResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
