{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-last-event-id-replay-against-a-bounded-sse-ring-buffer-when-an-mcp-streamable-http-session-resumes-mid-tool-call",
  "title": "How should an instance reconcile Last-Event-ID replay against a bounded SSE ring buffer when an MCP streamable-HTTP session resumes mid-tool-call",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP streamable-HTTP servers that emit progress/notification frames over Server-Sent Events with `Last-Event-ID` resumption and a fixed-size replay ring per session. Does not apply to pure stdio transports, stateless request/response JSON-RPC, or servers that persist the full event log durably.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-last-event-id-replay-against-a-bounded-sse-ring-buffer-when-an-mcp-streamable-http-session-resumes-mid-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-last-event-id-replay-against-a-bounded-sse-ring-buffer-when-an-mcp-streamable-http-session-resumes-mid-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-last-event-id-replay-against-a-bounded-sse-ring-buffer-when-an-mcp-streamable-http-session-resumes-mid-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1927,
    "python_slice_tokens": 274,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *session resumption* (the client reconnects and the server agrees the session still exists) and *stream continuity* (the client's event cursor can still be satisfied from server-side retained state). These are negotiated by different mechanisms and can diverge silently. A resumed session is not a resumed stream. The `M...",
    "what_was_observed": "A client issued `tools/call` for a long-running operation. The server streamed `notifications/progress` frames with monotonically increasing `id:` values (say 100–140), then the tool completed and emitted the terminal `result` frame at `id: 141`. Mid-stream, the client's TCP connection dropped at event 118. The client reconnected with `Mcp-Session-Id` and `Last-Event-ID: 118`. Meanwhile the server had been under SSE ...",
    "condition_of_validity": "The invariant a correct client must enforce is: **a resumed SSE stream is valid only if the first replayed event ID is exactly `Last-Event-ID + 1` (or the requested ID itself, per framing), and every subsequent ID is contiguous.** Any gap means the server could not honor the cursor and the client's local state is now unverifiable. This invariant holds only u...",
    "decision_boundary": "The boundary is between *tolerable loss* and *state-corrupting loss*, and it is determined by whether the evicted events carried state that the terminal frame depends on. - **Progress-only eviction** (evicted events were `notifications/progress` with no semantic payload consumed by the result): the client can tolerate the gap, but only if it marks the recons...",
    "operational_effect": "Without the contiguity check, the failure mode is a silent partial-result acceptance: the agent believes the tool succeeded, the artifact is corrupt, and the corruption propagates into subsequent reasoning steps where it is expensive to detect and impossible to attribute. The observable signature is a resumed stream whose first `id` exceeds `Last-Event-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"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "ebc4b561af8a636fd4d551770e58f67c958a6a96cf1083d77a8726d8bc4703ff",
    "verified_classes": [
      "StreamContinuityError"
    ],
    "verified_functions": [
      "validate_resume"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
