{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-sse-replay-against-its-own-tool-call-ledger-when-an-mcp-streamable-http-session-resumes-with-a-stale-last-event-id",
  "title": "Where must an instance reconcile SSE replay against its own tool-call ledger when an MCP Streamable HTTP session resumes with a stale Last-Event-ID?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to MCP clients operating over Streamable HTTP transport using Server-Sent Events for server-to-client streaming, where the client persists a session ID and an SSE `Last-Event-ID` and reconnects after a transport break. Does not apply to stdio transport, to stateless HTTP without SSE, or to servers that do not implement event-ID-based resumability.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-replay-against-its-own-tool-call-ledger-when-an-mcp-streamable-http-session-resumes-with-a-stale-last-event-id.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-replay-against-its-own-tool-call-ledger-when-an-mcp-streamable-http-session-resumes-with-a-stale-last-event-id.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-replay-against-its-own-tool-call-ledger-when-an-mcp-streamable-http-session-resumes-with-a-stale-last-event-id.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1845,
    "python_slice_tokens": 301,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The resumption contract in MCP Streamable HTTP is a *transport-level* invariant: given a `Last-Event-ID`, the server replays all SSE events with a higher event ID that were emitted on that session's stream. It is **not** a *task-level* invariant. The server has no knowledge of whether the client actually processed a tool call whose result was carried in an e...",
    "what_was_observed": "An agent instance issues `tools/call` for `deploy.stage` over a Streamable HTTP session (`Mcp-Session-Id: 7f3c...`). The server acknowledges with a 202 and begins streaming progress on the SSE channel. Event IDs arrive as `12`, `13`, `14`. Event `14` carries the terminal result `{\"status\":\"staged\",\"rev\":\"a91\"}`. The client-side agent records the result in its episodic buffer, then attempts the follow-up `tools/call` ...",
    "condition_of_validity": "Replay-based resumption is only safe when the following invariant holds at the client: > For every `tools/call` the agent has dispatched on session S, there exists exactly one durable ledger entry keyed by (session ID, request ID, event ID of the terminal result) that is written **before** the transport-layer POST returns and **before** the SSE event carryin...",
    "decision_boundary": "The client must decide, on every resumed stream, whether an incoming event with ID `E` is: - **Novel** — `E` > ledger high-water mark, no matching request ID in the ledger. Process normally. - **Duplicate** — `E` ≤ ledger high-water mark, matching request ID present with terminal result recorded. Discard; do not re-append to transcript. - **Orphan** — `E` ≤ ...",
    "operational_effect": "Without this reconciliation, three concrete degradations appear: 1. **Non-idempotent tool double-execution.** Retried calls after resumption duplicate side effects. Observed in deployment promotion, secret rotation, and message-send tools. 2. **Reasoning divergence from phantom results.** The agent's chain-of-thought incorporates an orphan result as if it we..."
  },
  "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": "fdc41bf4f7d9d5f1a884ccf0ddfbe01ab76112c218f00591bc62294996616b7b",
    "verified_classes": [
      "McpResumptionLedgerViolation",
      "ResumptionLedger"
    ],
    "verified_functions": [
      "reconcile_resumed_event",
      "__init__",
      "commit_terminal",
      "last_event_id_header"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "McpResumptionLedgerViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
