{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-re-correlate-server-to-client-requests-after-an-sse-to-streamable-http-migration-and-session-resumption",
  "title": "When must an instance re-correlate server-to-client requests after an SSE-to-streamable-HTTP migration and session resumption?",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP clients that migrated from the legacy HTTP+SSE transport (dual-endpoint: GET for server→client event stream, POST for client→server) to the streamable-HTTP transport with `Mcp-Session-Id` and resumable streams via `Last-Event-ID`. Does not cover stdio transport, and does not cover pure SSE deployments that never adopt streamable HTTP.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-re-correlate-server-to-client-requests-after-an-sse-to-streamable-http-migration-and-session-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-correlate-server-to-client-requests-after-an-sse-to-streamable-http-migration-and-session-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-correlate-server-to-client-requests-after-an-sse-to-streamable-http-migration-and-session-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1692,
    "python_slice_tokens": 338,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy SSE transport carried server→client requests (sampling, `roots/list`, elicitation) and their responses over a **single long-lived GET stream** whose ordering was guaranteed by TCP. Correlation was implicit: a request ID emitted on the stream was answered by a POST whose body echoed that ID, and the client could assume the stream it was reading had...",
    "what_was_observed": "A client instance was mid-task, holding three outstanding server→client requests: a `sampling/createMessage` (id `s-441`), a `roots/list` (id `r-07`), and an elicitation (id `e-12`). The underlying GET stream dropped (LB idle timeout at 60s). The client reconnected with `Last-Event-ID: 8817`. The server, having restarted its event log between the drop and the reconnect, resumed at event `9001` — a *higher* cursor tha...",
    "condition_of_validity": "The \"pending map survives a stream reconnect\" assumption is valid **only if** all of the following hold simultaneously: 1. The server exposes a monotonic `Last-Event-ID` space that is **durable across process restarts** — i.e., the event log is not reset to a lower or disjoint cursor. If the server restarts and the log begins at a cursor the client has never...",
    "decision_boundary": "On every stream (re)connect, the instance must decide: **re-correlate or trust the pending map?** The rule: - If the resume cursor `Last-Event-ID` is **strictly less than** the server's advertised current cursor and the replay window is non-empty → trust the replayed events, but **re-correlate**: any request ID seen in replay that is already in the pending m...",
    "operational_effect": "Implementing the re-correlation rule converts a silent 41-second stall into a fast, attributable failure: orphaned `sampling/createMessage` calls fail within the probe deadline, the task either degrades gracefully or surfaces `CorrelationLostError` to the orchestrator, and the token budget is preserved. The double-application case is prevented by the duplica..."
  },
  "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": "da38b8cee96ff6c90031a6ce9c338441357241d56eb918e1ef582fabb08e90b9",
    "verified_classes": [
      "CorrelationLostError",
      "PendingRequest",
      "StreamSession"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CorrelationLostError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
