{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-silent-sse-replay-divergence-when-an-mcp-http-native-streamable-session-resumes-after-last-event-id-rollback",
  "title": "How does an instance detect silent SSE replay divergence when an MCP HTTP-native streamable session resumes after Last-Event-ID rollback",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP servers using the HTTP-native \"streamable\" transport where a single logical session multiplexes multiple concurrent server-sent event streams and clients resume via `Last-Event-ID`. Does not cover stdio transport, WebSocket transports, or single-stream SSE without session resumption.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-sse-replay-divergence-when-an-mcp-http-native-streamable-session-resumes-after-last-event-id-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-sse-replay-divergence-when-an-mcp-http-native-streamable-session-resumes-after-last-event-id-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-sse-replay-divergence-when-an-mcp-http-native-streamable-session-resumes-after-last-event-id-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1937,
    "python_slice_tokens": 329,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure under examination is not \"the stream dropped\" and not \"the client reconnected.\" Both are expected and handled by the resumability contract. The distinction that matters is this: **a reconnecting client can specify a `Last-Event-ID` that the server can no longer honor, and the server will happily replay from an earlier recoverable point (or from t...",
    "what_was_observed": "A single MCP session carried three concurrent SSE streams (tool-call progress, resource subscription notifications, and a long-running sampling request). Each stream had its own logical event namespace but shared a single monotonic counter and a single ring buffer of replayable events, keyed by `(session_id, event_id)`. The buffer was capped at 4096 events with a 10-minute TTL, whichever expired first. Trigger condit...",
    "condition_of_validity": "The resumption invariant holds only when all of the following are simultaneously true: 1. Event IDs are **per-stream monotonic** and the server can prove contiguity for a given `Last-Event-ID` (i.e., the ID encodes or is accompanied by a stream-local sequence number). 2. The replay buffer is **per-stream** and pruned by a per-stream cursor, not by a session-...",
    "decision_boundary": "The boundary is the point at which the server's replay lookup transitions from **exact-match** to **fallback**. Two fallback policies are common and both are unsafe without an explicit gap signal: - **Fallback-to-oldest-retained:** server replays from the oldest event still in the buffer. This produces silent forward gaps (events between requested ID and old...",
    "operational_effect": "The downstream effect is not a connection error — it is **semantic corruption of in-flight agent state**. Delta-accumulating streams (partial JSON, partial token sequences, incremental resource patches) are the highest-risk consumers because a gap produces a well-formed-but-wrong aggregate. The agent's reasoning loop receives a tool-call argument object that..."
  },
  "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": "46650e614d4f72514daa406cd99c4f6c049c6e0ade3e22770bf2d85d4b3e07ec",
    "verified_classes": [
      "StreamResumeDivergence",
      "StreamCursor"
    ],
    "verified_functions": [
      "_parse_seq",
      "resume_stream",
      "append_delta"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamResumeDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
