{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-pin-the-sse-event-id-before-yielding-control-or-resumability-silently-replays-a-poisoned-prefix",
  "title": "Where must an instance pin the SSE event ID before yielding control, or resumability silently replays a poisoned prefix",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP servers using the HTTP-native transport with Server-Sent Events streaming and `Last-Event-ID` resumption, where a client agent reconnects a mid-stream tool call after a transport drop. Does not apply to stdio transports, nor to stateless request/response MCP endpoints that never emit resumable event streams.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-pin-the-sse-event-id-before-yielding-control-or-resumability-silently-replays-a-poisoned-prefix.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-pin-the-sse-event-id-before-yielding-control-or-resumability-silently-replays-a-poisoned-prefix.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-pin-the-sse-event-id-before-yielding-control-or-resumability-silently-replays-a-poisoned-prefix.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1846,
    "python_slice_tokens": 315,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different notions of \"where the stream was\" and conflating them is the entire failure. The **emission cursor** is the server-side counter of events it has *written into the SSE buffer*. The **acknowledgement cursor** is the last event ID the client has *durably consumed and committed to its own state*. Resumability is only sound when the client...",
    "what_was_observed": "A client agent issued a `tools/call` over HTTP-native transport. The server streamed the tool's progress and output as a sequence of SSE events `id: 41 … id: 57`, where events 44–51 carried the body of a large `content` array in chunks. The client's SSE reader thread wrote each raw event into an in-memory queue and, on each successful `read()`, updated a persisted `last_event_id` field to the event's `id`. The consum...",
    "condition_of_validity": "The invariant that must hold for `Last-Event-ID` resumption to be sound: > The value sent as `Last-Event-ID` must be ≤ the highest event ID whose effects have been *committed* to the client's durable task state, and must never exceed it. Formally, let `A` be the set of event IDs the client has fully applied (parsed, folded into the assembled response, and ch...",
    "decision_boundary": "The decision an implementer must make is: *at which layer does the `Last-Event-ID` cursor live, and who is allowed to write it?* - If the cursor lives in the **transport reader**, resumption is fast but unsound under any consumer lag. The reader cannot know whether the consumer has applied an event. - If the cursor lives in the **consumer/state machine**, re...",
    "operational_effect": "The operational consequence of getting this boundary wrong is **silent prefix corruption that survives every structural validator**. The assembled response is well-formed; the schema is satisfied; the reasoning loop has no signal that a segment is missing. The agent's subsequent plan is built on a tool result whose middle was amputated, and the divergence on..."
  },
  "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": "7fdc68f8ff55615a8da745137860103e7c397983e2f91cf9afea905b2ba56bb9",
    "verified_classes": [
      "ResumeCursorViolation",
      "ResumableStream"
    ],
    "verified_functions": [
      "resume_after_drop",
      "apply_event",
      "last_event_id_for_reconnect",
      "assert_contiguous_assembly"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumeCursorViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
