{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-resumption-token-replay-from-resurrecting-a-poisoned-mcp-stream-session",
  "title": "Which invariants prevent resumption-token replay from resurrecting a poisoned MCP stream session",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing HTTP-native transports (Streamable HTTP / SSE) that issue `Last-Event-ID`-style resumability tokens and support `GET` resumption of a previously opened session. Does not apply to stdio transports, stateless request/response MCP servers, or resumption schemes where the token is a pure offset into a durable append-only log with no server-side session state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumption-token-replay-from-resurrecting-a-poisoned-mcp-stream-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumption-token-replay-from-resurrecting-a-poisoned-mcp-stream-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumption-token-replay-from-resurrecting-a-poisoned-mcp-stream-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2087,
    "python_slice_tokens": 357,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The resumability token in MCP's HTTP-native transport is often modeled as a *cursor* — \"the last event the client saw.\" That mental model is wrong in a way that matters. The token is not a cursor over a stream; it is a **claim against a server-side session lease**, and the server must decide whether to honor that claim. The distinction is between: - **Replay...",
    "what_was_observed": "A client agent running a multi-step tool loop against an MCP server over Streamable HTTP lost its connection mid-tool-call (the server process was restarted by an orchestrator after a health-check flap). The client, correctly per spec, re-issued `GET /mcp` with `Last-Event-ID: evt_4471`. The restarted server had persisted session records to Redis, including the resumability buffer, and rehydrated the session. It repl...",
    "condition_of_validity": "The invariant that must hold for resumption to be safe: > **A resumability token is only valid as a claim against a session whose termination state is `OPEN` or `SUSPENDED_FOR_TRANSPORT`, and only if the token's event sequence number is ≥ the session's `last_durably_committed_seq` and ≤ its `last_emitted_seq`, with no gaps in the interval `[token_seq+1, last...",
    "decision_boundary": "The boundary between \"resume\" and \"re-initialize\" is not \"does the token parse.\" It is: The non-obvious case is the third row. A naive handler treats \"session exists in store\" as sufficient. But a session terminated by an auditor is *more* dangerous to resume than a crashed one, because the termination reason is precisely the evidence that its contents shoul...",
    "operational_effect": "Two concrete consequences for agent operators: **First, resumption must be treated as a state-transfer operation, not a transport reconnect.** When a client resumes, it is asserting that its local context still corresponds to the server's session state. If the server cannot prove contiguity, the client's local context is *stale by an unknown amount*, and the..."
  },
  "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": "d7e2ab46ad7819dbc357d88dd56510092bdda586a8ad498023b183ebf7c638a1",
    "verified_classes": [
      "ResumptionError",
      "SessionState",
      "SessionRecord"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
