{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-sse-replay-after-an-mcp-streamable-session-resume-when-the-transport-reports-a-cursor-gap",
  "title": "Where must an instance bound SSE replay after an MCP streamable-session resume when the transport reports a cursor gap",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers/clients using the HTTP-native streamable transport with `Last-Event-ID`-style resumption, where a session spans a reconnect mid-stream. Does not apply to stdio transports or to fully buffered request/response (non-streaming) MCP exchanges.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-sse-replay-after-an-mcp-streamable-session-resume-when-the-transport-reports-a-cursor-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-sse-replay-after-an-mcp-streamable-session-resume-when-the-transport-reports-a-cursor-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-sse-replay-after-an-mcp-streamable-session-resume-when-the-transport-reports-a-cursor-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1659,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *resumption* and *replay*. A streamable-session resume restores the transport channel; it does not restore the semantic state the agent had already consumed before the disconnect. The transport guarantees only that events after a cursor can be re-sent. It does not guarantee that the cursor is still within the server's ...",
    "what_was_observed": "A planner agent held an MCP session to a `filesystem` server exposing a `watch` stream and a `write_file` tool. The stream emitted `file_changed` events carrying `path` and `content_hash`. The agent maintained a local map `path → hash` derived from these events and used it to decide whether a write was a no-op. Sequence: 1. Agent consumed events through `Last-Event-ID: 412` (hash for `a.txt` = `h1`). 2. Network blip;...",
    "condition_of_validity": "The gap is *benign* only under all of the following: - The server retains events from the client's `Last-Event-ID` onward for the entire maximum reconnect window, **or** - The server emits an explicit gap sentinel (e.g., a `resume_gap` event or a `409`/`416`-style rejection carrying `earliest_available_id`) whenever `Last-Event-ID < earliest_retained`, **or*...",
    "decision_boundary": "The boundary is drawn at the moment of first post-resume event: - **Contiguous** (`first_id == last_processed_id + 1`, or server advertised `earliest_available_id <= last_processed_id + 1`): resume in place; continue reasoning. - **Gapped** (`first_id > last_processed_id + 1` with no sentinel): the session is in an *unknown-state* condition. The agent must t...",
    "operational_effect": "Without cursor-contiguity validation, agents silently operate on stale world models after every transient disconnect that outlives the server's retention window. The failure is intermittent, load-dependent (GC pressure shortens retention), and invisible in transport logs—the reconnect looks healthy. The downstream effect is non-idempotent writes, duplicated ..."
  },
  "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": "48e498e650455b016c91b7eca0d2e845f3fa862526b374c9816934885233ee5e",
    "verified_classes": [
      "CursorGapError",
      "ResumeState"
    ],
    "verified_functions": [
      "validate_resume",
      "on_resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CursorGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
