{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-resumption-replay-divergence-across-stateless-mcp-streamable-sse-replicas",
  "title": "Which invariants prevent resumption replay divergence across stateless MCP streamable-SSE replicas",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers using the HTTP-native streamable transport where a single logical session's SSE stream may be resumed via `Last-Event-ID` against a stateless (or effectively stateless) serverless backend. Does not apply to single-process stateful servers that hold the event buffer in memory for the session lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumption-replay-divergence-across-stateless-mcp-streamable-sse-replicas.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumption-replay-divergence-across-stateless-mcp-streamable-sse-replicas.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumption-replay-divergence-across-stateless-mcp-streamable-sse-replicas.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1637,
    "python_slice_tokens": 249,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **transport-level resumption** and **application-level replay**. The MCP streamable HTTP transport defines resumption as: a client whose SSE connection drops reconnects with `Last-Event-ID: <id>` and the server continues the stream *after* that event. This is a transport guarantee about byte/event ordering. It is **not...",
    "what_was_observed": "A tool call `analyze_dataset` streamed progress events `evt-1 … evt-9` over SSE. The client connection dropped after receiving `evt-6`. The client reconnected with `Last-Event-ID: evt-6` to the load balancer, which routed to a cold replica (scale-to-zero had recycled the original). The cold replica had no event log. Its handler, on seeing a resume request it could not satisfy, did the locally reasonable thing: it **r...",
    "condition_of_validity": "Reconnect-with-replay is only sound when all three hold: 1. **Event identity is globally unique and monotonic across replicas**, not per-connection counter values. `evt-1` from replica A and `evt-1` from replica B must not collide. Use a session-scoped monotonic sequence (e.g., `{session_id}:{seq}`) minted at the point of side effect, not at the point of emi...",
    "decision_boundary": "The boundary is **whether the server can prove it has already emitted up to `Last-Event-ID`**. Concretely: - If the durable event log contains an entry for `Last-Event-ID` **and** the operation's checkpoint at that sequence is intact → **resume**: stream `seq+1 …` from the log or from the checkpoint, do not re-execute committed steps. - If the log has the ID...",
    "operational_effect": "With the invariant enforced, resumption becomes *safe to retry*: a dropped stream either continues exactly where it left off (no gap, no duplicate) or fails loudly with a resumption error that the agent layer can route to a fresh session. The cost is that the event log and per-event checkpoint must outlive the connection and be reachable from any replica—whi..."
  },
  "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": "d838b990313f79d9036e319886d76624f957765f470eb69fd5c2c10c1224216d",
    "verified_classes": [
      "ResumptionDivergenceError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
