{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-streamable-http-session-resumption-against-an-sse-era-event-id-watermark-during-mcp-transport-migration",
  "title": "Where must an instance reconcile streamable-HTTP session resumption against an SSE-era Event ID watermark during MCP transport migration",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP clients and servers migrating from the legacy HTTP+SSE transport to the streamable HTTP transport with `Mcp-Session-Id` header resumption and `Last-Event-ID` replay. Does not cover stdio transport, pure WebSocket transports, or stateless request/response tool invocation with no server-initiated stream.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-streamable-http-session-resumption-against-an-sse-era-event-id-watermark-during-mcp-transport-migration.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-streamable-http-session-resumption-against-an-sse-era-event-id-watermark-during-mcp-transport-migration.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-streamable-http-session-resumption-against-an-sse-era-event-id-watermark-during-mcp-transport-migration.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1714,
    "python_slice_tokens": 229,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The SSE transport and the streamable HTTP transport both carry a per-stream event identifier, but they disagree on what that identifier *means* across a reconnect. In legacy SSE, `Last-Event-ID` was a monotonic cursor scoped to a *single long-lived connection*; when the connection died, the cursor died with it, and the client was expected to re-`GET` the SSE...",
    "what_was_observed": "A tool-calling agent was migrated from SSE to streamable HTTP mid-deployment. The server kept a compatibility shim: it accepted `GET /mcp` with `Accept: text/event-stream` for legacy clients and `POST /mcp` with `Mcp-Session-Id` for new clients, and it honored `Last-Event-ID` on both. The shim reused a single monotonically increasing counter for event IDs across both transports to \"preserve ordering.\" The failure tra...",
    "condition_of_validity": "The invariant holds — and the failure is reachable — only when all of the following are true: - The server maintains a durable replay log keyed by event ID, and the ID space is *shared* between legacy and streamable handlers (the compatibility-shim case). If the two handlers use disjoint ID namespaces (e.g., `sse:` vs `str:` prefixes), the mismatch surfaces ...",
    "decision_boundary": "The decision an instance must make on every stream (re)establishment: > Given a new `Mcp-Session-Id` distinct from the one my `Last-Event-ID` was minted under, do I (a) send the stale `Last-Event-ID` and trust the server to reconcile, or (b) drop the cursor and treat the new session as a cold start requiring a full state re-sync? The correct answer is (b) *u...",
    "operational_effect": "An agent that violates this boundary does not crash. It accumulates a *phantom episodic branch*: events it believes it processed, tool results it believes it holds, schema invalidations it believes it applied — all sourced from a session that was never its own. Because the replay is well-formed and the HTTP status is `200`, no guardrail fires. The divergence..."
  },
  "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": "02be442598335b7d2dcf2207190627667bc4bbf29b6274c8a12e9f8d54c0d1a5",
    "verified_classes": [
      "CrossSessionReplayError",
      "StreamCursor",
      "SessionBoundCursorStore"
    ],
    "verified_functions": [
      "open_stream",
      "_resync_state",
      "__init__",
      "record",
      "header_for",
      "_cursor_session_repr"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CrossSessionReplayError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
