{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-sse-resumption-offsets-against-a-backpressured-mcp-streamable-session-before-it-may-replay-tool-calls",
  "title": "Where must an instance reconcile SSE resumption offsets against a backpressured MCP streamable-session before it may replay tool calls?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP clients and servers using the HTTP-native streamable transport with `Last-Event-ID` resumption and per-session event replay buffers. Does not apply to stdio transport, nor to stateless HTTP request/response MCP deployments that do not maintain a resumable event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-resumption-offsets-against-a-backpressured-mcp-streamable-session-before-it-may-replay-tool-calls.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-resumption-offsets-against-a-backpressured-mcp-streamable-session-before-it-may-replay-tool-calls.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-sse-resumption-offsets-against-a-backpressured-mcp-streamable-session-before-it-may-replay-tool-calls.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1749,
    "python_slice_tokens": 214,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the stream dropped.\" Disconnects are routine and the transport is explicitly designed to survive them via `Last-Event-ID` resumption. The boundary condition is subtler: **the resumption offset a client holds can be logically ahead of the server's durable replay buffer, yet behind the server's in-flight write cursor, when the server a...",
    "what_was_observed": "A coding agent drove a long `edit_file`/`run_tests` loop against an MCP server exposing a filesystem tool and a test runner. The server kept a 1024-event ring buffer per session and shed oldest events under producer pressure. During a burst of `notifications/progress` from the test runner (one per test, ~4000 tests), the producer outran the client's HTTP consumer, which was itself blocked on a slow `edit_file` result...",
    "condition_of_validity": "The invariant holds only when the following are all true: - The server uses a bounded replay buffer with a shedding policy (drop-oldest) rather than unbounded retention or producer-blocking. - The client treats `Last-Event-ID` as authoritative for \"everything up to here was processed\" rather than \"everything up to here was *received*.\" - Tool calls in the se...",
    "decision_boundary": "The correct architectural boundary is: **the resumption offset must be validated against the server's retention floor before any replay is permitted, and a gap must be surfaced as an explicit, non-resumable error rather than silently bridged.** Concretely, the server must, on receiving `Last-Event-ID: N`: - If `N >= retention_floor - 1`, resume cleanly from ...",
    "operational_effect": "Enforcing this boundary converts a silent stall-plus-double-execution into an explicit, recoverable state transition. The agent's reasoning loop receives a gap signal, pauses the affected tool call, performs an idempotent status read, and resumes with a known outcome. Latency increases on the rare wrap; correctness is preserved. The cost of *not* enforcing i..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "d6565d9cc6207bcbadbad352cf5e363e94c023c5a10f3a888b41c45badba712a",
    "verified_classes": [
      "ResumptionGapError",
      "SessionEventLog"
    ],
    "verified_functions": [
      "handle_resume",
      "__init__",
      "resume_from"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
