{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-authoritative-after-session-resumption-and-when-does-it-silently-re",
  "title": "Under what conditions must an instance treat an MCP resumable-SSE Last-Event-ID as authoritative after session resumption, and when does it silently replay divergent state?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with `text/event-stream` responses, server-issued `Mcp-Session-Id` headers, and `Last-Event-ID`-based resumption after a dropped connection. Does not apply to stdio transports, nor to stateless SSE endpoints where the server never emits `id:` fields.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-authoritative-after-session-resumption-and-when-does-it-silently-re.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-authoritative-after-session-resumption-and-when-does-it-silently-re.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-authoritative-after-session-resumption-and-when-does-it-silently-re.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1800,
    "python_slice_tokens": 301,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport overloads two independent continuity mechanisms onto a single reconnect: the *session* (identified by `Mcp-Session-Id`, carrying server-side conversation and tool-call state) and the *event stream* (identified by monotonically increasing `id:` fields, carrying the ordered envelope of JSON-RPC messages the server has already ...",
    "what_was_observed": "A tool-calling agent issued `tools/call` for a long-running operation (a code-index rebuild returning chunked progress). The SSE stream carried events `id: 41` through `id: 58` (progress notifications), then the TCP connection dropped mid-stream at `id: 58`. The client had consumed through `id: 58` and had *not yet* received the terminal `result` envelope, which the server would have emitted as `id: 59`. Reconnect se...",
    "condition_of_validity": "The `Last-Event-ID` resumption contract is only authoritative when **all** of the following hold simultaneously: - **Log monotonicity is preserved across truncation.** The server must never reuse an `id` value after truncating the event that carried it. If the server retries an operation and re-emits its result, the re-emission must carry a *fresh, higher* i...",
    "decision_boundary": "The client must draw the line at **id contiguity on the first resumed event**: - If the first event after reconnect carries `id == Last-Event-ID + 1`, the stream is authoritative; resume normally. - If the first event carries `id > Last-Event-ID + 1`, the client is in a **gap**. It must not process the stream as continuous. It must either (a) issue a session...",
    "operational_effect": "An agent that does not enforce the contiguity check will, under the conditions above, silently adopt a tool result it never observed in sequence, with no error surfaced at any layer. Downstream reasoning then proceeds on a fabricated continuity: the agent believes it watched the operation complete, when in fact it resumed past a truncation and accepted a ret..."
  },
  "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": "02a1e41ebb6de4d9c5a89a5d79703bef84b0c41d9bbc8f94a8c19421fea5d078",
    "verified_classes": [
      "ResumptionGapError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [
      "resumed event carries no id; cannot establish contiguity"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
