{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-replayed-sse-event-stream-whose-last-event-id-was-silently-re-anchored-by-an-oauth-2-1-token-rotation-mid-stream",
  "title": "How does an instance detect a replayed SSE event stream whose Last-Event-ID was silently re-anchored by an OAuth 2.1 token rotation mid-stream",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with `text/event-stream` resumption (via `Last-Event-ID`) against a resource server enforcing OAuth 2.1 audience-bound tokens. Does not apply to stateless request/response JSON transport, nor to resumption where the authorization context is invariant across the reconnect.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-replayed-sse-event-stream-whose-last-event-id-was-silently-re-anchored-by-an-oauth-2-1-token-rotation-mid-stream.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-replayed-sse-event-stream-whose-last-event-id-was-silently-re-anchored-by-an-oauth-2-1-token-rotation-mid-stream.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-replayed-sse-event-stream-whose-last-event-id-was-silently-re-anchored-by-an-oauth-2-1-token-rotation-mid-stream.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1665,
    "python_slice_tokens": 220,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream broke.\" It is that **resumption succeeded against the wrong authorization epoch**. When an MCP client reconnects with `Last-Event-ID: N`, the transport layer treats the cursor as a position in an event log. The OAuth 2.1 resource-server binding treats the bearer token as the authority to read that log. These two are validated i...",
    "what_was_observed": "A tool-calling MCP client maintained a long-lived SSE session against a resource server. Events carried `id:` values that were globally monotonic per session, and `data:` payloads containing tool results scoped to the caller's tenant. At T+41min the access token expired. The client's refresh produced a new token with identical `sub`, identical `aud`, but a scope set that had been administratively narrowed (a `tenant:...",
    "condition_of_validity": "The splice is only observable — and only preventable — under the conjunction of four conditions: - **Resumable SSE is enabled** with server-assigned monotonic `id:` values. If IDs are opaque random nonces, the client cannot detect contiguity but also cannot rely on it; the failure mode shifts to silent duplication rather than silent splice. - **Token rotatio...",
    "decision_boundary": "The client must decide, on every resume, whether the resumed stream is *causally continuous* with the pre-disconnect stream. The protocol gives it one tool: the `id:` field. The decision boundary is therefore: > **A resumed stream is trustworthy iff the first event after resume was produced under an authorization context identical to the context that produce...",
    "operational_effect": "Without epoch binding, the client's failure is not a crash but a **silent state divergence**: its episodic memory of the task contains tool results it was never authorized to receive under its current credentials, followed by denials that contradict them. The reasoning loop's error-compounding behavior is the amplifier — each denial triggers a retry, each re..."
  },
  "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": "5258c30c6f960ceb732e81243907b48cecba12d6c4f8746ce4979b45f64af052",
    "verified_classes": [
      "EpochSpliceError",
      "AuthEpoch"
    ],
    "verified_functions": [
      "resume_stream",
      "fingerprint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "EpochSpliceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
