{
  "schema_version": "1.3.0",
  "slug": "when-must-an-mcp-http-native-instance-invalidate-a-resumption-token-after-last-event-id-replay",
  "title": "When must an MCP HTTP-native instance invalidate a resumption token after `Last-Event-ID` replay?",
  "date_of_record": "2026 November 6",
  "scope": "Applies to MCP servers implementing the HTTP-native streamable transport where SSE event IDs are client-consumable resumption cursors and session state is keyed by a session token. Does not apply to plain (non-resumable) SSE, to stdio transport, or to servers that treat event IDs as opaque and non-replayable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-mcp-http-native-instance-invalidate-a-resumption-token-after-last-event-id-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-mcp-http-native-instance-invalidate-a-resumption-token-after-last-event-id-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-mcp-http-native-instance-invalidate-a-resumption-token-after-last-event-id-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1016,
    "python_slice_tokens": 182,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between *event ID monotonicity* and *session token validity*. A resumption token (`Last-Event-ID`) and a session token (`Mcp-Session-Id`) are independent axes. The failure mode is treating a successful replay as proof that the session is still live, or treating a live session as proof that the requested event ID is still replayabl...",
    "what_was_observed": "During a reconnect storm (client process restarted, then reconnected with a persisted session token and a stale `Last-Event-ID` from before a server-side rolling restart), the server: 1. Found the session token in its in-memory session map (it had not yet been evicted). 2. Found the requested event ID still within the retained ring buffer. 3. Replayed events 1041–1099, then resumed live streaming. But the session's t...",
    "condition_of_validity": "`Last-Event-ID` replay is valid **only if** all three hold: - The session token resolves to a session whose `generation` matches the generation at which the requested event ID was emitted. - The requested ID is within `[replay_floor, high_water_mark]` for that generation. - The session has not been marked `evicted` or `superseded`. If the session was recreat...",
    "decision_boundary": "On a `GET` with `Last-Event-ID`: - **Accept replay** iff session is live, generation matches, and `replay_floor ≤ Last-Event-ID ≤ high_water_mark`. - **Reject with 409** iff session is live but generation differs, or ID is below `replay_floor` (events already compacted) — force re-init. - **Reject with 404** iff the session token is unknown or evicted — clie...",
    "operational_effect": "Correctly enforcing the generation check converts a silent duplicate-delivery bug into an explicit `409`, which clients handle by re-initializing — cheap and idempotent. Failing to enforce it produces duplicated tool side effects that are hard to attribute, because the transport reports success and the event IDs are consistent. The invariant to encode: **rep..."
  },
  "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": "79bcc4900c07dc22182b37053514dee885890eff58db26e5cfdae93d2582ae2a",
    "verified_classes": [
      "ResumptionTokenError",
      "Session"
    ],
    "verified_functions": [
      "authorize_replay",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionTokenError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
