{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-resume-an-mcp-sse-stream-after-a-last-event-id-gap-rather-than-silently-replaying-from-a-stale-cursor",
  "title": "When must an instance refuse to resume an MCP SSE stream after a Last-Event-ID gap rather than silently replaying from a stale cursor",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP servers exposing HTTP-native transport with `text/event-stream` streaming and `Last-Event-ID`-based session resumption (Streamable HTTP transport, single or multi-client). Does not apply to stdio transport, WebSocket-only variants, or stateless one-shot request/response MCP endpoints where no event cursor is persisted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-sse-stream-after-a-last-event-id-gap-rather-than-silently-replaying-from-a-stale-cursor.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-sse-stream-after-a-last-event-id-gap-rather-than-silently-replaying-from-a-stale-cursor.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-resume-an-mcp-sse-stream-after-a-last-event-id-gap-rather-than-silently-replaying-from-a-stale-cursor.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2056,
    "python_slice_tokens": 373,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **resumption as a cursor seek** and **resumption as a continuity proof**. Most MCP HTTP implementations treat `Last-Event-ID` as a seek hint: the client reconnects with the last ID it saw, the server looks up its event log, and if the ID is present it replays everything after it. This is correct only when the server ca...",
    "what_was_observed": "A research agent drove a long-running MCP tool (`web_crawl` over a 4,000-page corpus) through an HTTP-native MCP server. The server streamed progress notifications and a final `tools/call` result as SSE events, each tagged with a monotonically increasing `id:`. The server's event log was a bounded ring buffer (capacity 2,048 events) with an eviction policy: when full, the oldest events were dropped and their IDs tomb...",
    "condition_of_validity": "The invariant that must hold for cursor-seek resumption to be sound: > For any `Last-Event-ID = k` accepted by the server, the set of events with IDs in `(k, head]` must be *fully materialized* in the replay source at the moment of replay, and the replay must emit them in order with no internal gap. This invariant is violated by any of: 1. **Ring-buffer evic...",
    "decision_boundary": "The decision boundary is between three server behaviors on a resume request, and only one is correct under backpressure: - **Re-anchor (wrong):** `Last-Event-ID` is known-but-evicted → replay from `oldest_retained_id`. Produces silent truncation. This is the observed failure. - **Hard reject (correct but lossy):** `Last-Event-ID` is known-but-evicted → retur...",
    "operational_effect": "The operational effect of getting this wrong is **silent partial-result acceptance in the agent's execution loop**: the agent completes a `tools/call` with a truncated payload, marks the step successful, and compounds the error into every downstream step that consumes the result. Because the truncation lands on a syntactically valid sub-object boundary (JSON..."
  },
  "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": "4a46eeeee0358481a7b32b8a7e064a3251e710e4940bd7a39f3bf63905e2d181",
    "verified_classes": [
      "ResumeContiguityError",
      "EventLog"
    ],
    "verified_functions": [
      "plan_resume",
      "validate_first_replayed",
      "covers"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResumeContiguityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
