{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-last-event-id-against-a-stateless-mcp-replica-pool-silent-event-stream-fork-on-sse-resumption",
  "title": "Where must an instance reconcile Last-Event-ID against a stateless MCP replica pool: silent event-stream fork on SSE resumption",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP servers deployed as HTTP-native, streamable-SSE transports behind a load balancer, where the server tier is horizontally scaled and stateless (no per-session affinity, no shared event ring buffer). Does not apply to single-replica deployments, to stdio transports, or to stateful servers that pin a session to a process holding the full event log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-last-event-id-against-a-stateless-mcp-replica-pool-silent-event-stream-fork-on-sse-resumption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-last-event-id-against-a-stateless-mcp-replica-pool-silent-event-stream-fork-on-sse-resumption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-last-event-id-against-a-stateless-mcp-replica-pool-silent-event-stream-fork-on-sse-resumption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2045,
    "python_slice_tokens": 275,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *transport-level resumability* and *state-level resumability*. SSE gives an agent a resumption primitive — the `Last-Event-ID` header — that the client believes is a cursor into a single logical stream. On a stateless MCP server pool, that cursor is a claim about a stream that no single process owns. The stream is a *f...",
    "what_was_observed": "A tool-calling agent session over streamable HTTP MCP. The server tier is three replicas behind a round-robin LBE with no sticky sessions. Each replica maintains an in-process SSE event counter starting at 0 on process start, and a bounded in-memory ring buffer of the last 256 events for local replay. Trace: 1. Client opens `GET /mcp` with `Accept: text/event-stream`. LBE routes to replica A. Replica A emits `id: 0` ...",
    "condition_of_validity": "The resumption contract is only valid when **all three** hold: - **(a) Global event identity.** Event IDs are allocated from a single logical sequence shared across the pool (e.g., a monotonic counter in a shared store, or a Snowflake/ULID with a total order), not a per-process counter. Per-process counters are the root cause of the fork; two replicas will e...",
    "decision_boundary": "The boundary is the choice between **pinning** and **externalizing**, and the failure mode is choosing neither while believing you chose one. - If the tier is truly stateless (no affinity), you **must** externalize both the event log and the ID allocator. The `Last-Event-ID` handler must query the shared store, and on miss it must **fail loudly** with a resu...",
    "operational_effect": "Downstream, the agent experiences this as *non-deterministic tool-call loss*: a tool executes, its result is emitted to a socket that died, and the agent — having resumed on a different replica — either waits indefinitely (if it blocks on the completion event) or proceeds with stale assumptions (if it treats the gap as success). Because the tool *did* run, s..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK"
  ],
  "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": "5ebcf46d26a66f8a889bda02a927c384a6a82620ac7dba8371e0b6fa96d039ad",
    "verified_classes": [
      "ResumptionForkError",
      "StatelessMcpReplica"
    ],
    "verified_functions": [
      "handle_sse_resume",
      "__init__",
      "resume"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumptionForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
