{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-sse-event-id-reuse-from-silently-replaying-a-poisoned-tool-call-result-across-an-mcp-streamable-session-resume",
  "title": "Which invariants prevent SSE event-ID reuse from silently replaying a poisoned tool-call result across an MCP streamable-session resume",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP servers using the HTTP-native streamable transport with `Last-Event-ID`-based session resumption, where a client reconnects mid-tool-call and requests replay of buffered SSE events. Does not apply to stateless request/response MCP transports or to stdio transports with no resumption buffer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-sse-event-id-reuse-from-silently-replaying-a-poisoned-tool-call-result-across-an-mcp-streamable-session-resume.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-sse-event-id-reuse-from-silently-replaying-a-poisoned-tool-call-result-across-an-mcp-streamable-session-resume.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-sse-event-id-reuse-from-silently-replaying-a-poisoned-tool-call-result-across-an-mcp-streamable-session-resume.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1425,
    "python_slice_tokens": 172,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous failure is not \"the resume fails.\" The dangerous failure is \"the resume succeeds and delivers a *stale-but-well-formed* tool result that the agent treats as fresh.\" Streamable-session resumption is governed by an event-ID cursor contract: the client presents the last event ID it durably consumed, and the server replays everything after that cur...",
    "what_was_observed": "A tool call (`deploy_service`, long-running, ~90s) was dispatched over a streamable session. The client's SSE reader consumed events up to ID `evt-4471` (a `progress` notification) and then the TCP connection dropped before the `result` event. The client reconnected with `Last-Event-ID: evt-4471`. In the interim, the server process had been rescheduled onto a fresh replica. The replica accepted the session ID (sessio...",
    "condition_of_validity": "The replay-poisoning failure requires the conjunction of four conditions, all of which held here: 1. **Cursor-addressable resumption** is offered (`Last-Event-ID` honored), so the client believes replay is authoritative. 2. **Event-ID space is not globally monotonic per session** — it reset across replica handoff, so cursor `evt-4471` was unresolvable and th...",
    "decision_boundary": "The boundary is between **resume-as-replay** and **resume-as-reconcile**: - If the server can guarantee event-ID monotonicity across the session's entire lifetime (single-writer event log, cursor persisted with the log), then `Last-Event-ID` replay is sound and the client may treat replayed events as the authoritative continuation. - If the server *cannot* g...",
    "operational_effect": "Agents resuming streamable sessions must treat a replayed `result` as **untrusted until invocation-matched**. The concrete operational rule: on resume, the client enters a `RECONCILING` state, buffers all replayed events, and only commits a `result` to the agent's working memory if `event.invocation_id == request.invocation_id` *and* the event ID is strictly..."
  },
  "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": "7b0354b82f7afb2d188c920016dafe219b9007a6cfbe296c5001224e8cbaed42",
    "verified_classes": [
      "ResumeReplayPoisoningError"
    ],
    "verified_functions": [
      "commit_replayed_result"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumeReplayPoisoningError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
