{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-replay-a-stale-event-cursor-after-mcp-streamable-http-session-resumption-and-silently-diverge-from-the-server-s-tool-call-ledger",
  "title": "Why does an instance replay a stale event cursor after MCP Streamable-HTTP session resumption and silently diverge from the server's tool-call ledger",
  "date_of_record": "2026 December 3",
  "scope": "Applies to MCP clients using the Streamable HTTP transport with `Last-Event-ID`-based SSE resumption and server-issued session tokens (`Mcp-Session-Id`). Does not cover pure stdio transports or stateless one-shot JSON-RPC POSTs without a session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-replay-a-stale-event-cursor-after-mcp-streamable-http-session-resumption-and-silently-diverge-from-the-server-s-tool-call-ledger.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-replay-a-stale-event-cursor-after-mcp-streamable-http-session-resumption-and-silently-diverge-from-the-server-s-tool-call-ledger.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-replay-a-stale-event-cursor-after-mcp-streamable-http-session-resumption-and-silently-diverge-from-the-server-s-tool-call-ledger.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1941,
    "python_slice_tokens": 413,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not a dropped connection. Dropped connections are expected and handled. The failure is a **cursor/ledger divergence**: the client resumes an SSE stream with a `Last-Event-ID` that the server can no longer reconcile against its per-session event ledger, and the server — instead of rejecting the resume — replays from a *coarser* boundary (a snap...",
    "what_was_observed": "A tool-using agent (file-search + shell execution MCP server) runs over Streamable HTTP. The server retains a bounded per-session event log — say the last 512 events, evicted FIFO — because unbounded retention is unacceptable at scale. The client maintains its own append-only log of `(event_id, tool_call_id, result_digest)`. Trigger condition, in order: 1. The agent issues a long-running `shell_exec` tool call. The s...",
    "condition_of_validity": "The safe-resumption invariant is: > A resume with `Last-Event-ID = C` is valid **iff** the server can prove `C >= min_retained_event_id(session)` **and** the client's local ledger is a prefix-consistent subsequence of the server's ledger up to `C`. If either is false, resumption MUST be rejected terminally; the client MUST perform a full session re-establish...",
    "decision_boundary": "The decision the client must make on every resume, expressed as a guard the transport layer must enforce before handing events to the reasoning loop: The boundary is between \"replay is a continuation\" and \"replay is a fresh epoch.\" The server must make this explicit; the client must never infer it from the shape of the first replayed event.",
    "operational_effect": "When the invariant is violated and undetected, the agent exhibits **duplicate side effects under a success-shaped resume** — the worst class of failure because it defeats both the agent's self-check (it believes it resumed correctly) and most observability (no error was raised). Symptoms downstream: non-idempotent tool calls applied twice, verification repla..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "c989d277289b98097b8434ab1e98f1bbf04ad45935f515b30895decece944b3c",
    "verified_classes": [
      "CursorDivergenceError",
      "ResumeContext"
    ],
    "verified_functions": [
      "validate_resume",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CursorDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
