{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-sse-last-event-id-resumption-as-invalid-across-an-oauth-2-1-token-rotation-boundary",
  "title": "Under what conditions must an instance treat SSE `Last-Event-ID` resumption as invalid across an OAuth 2.1 token rotation boundary",
  "date_of_record": "2026 November 16",
  "scope": "Applies to MCP servers exposing the HTTP-native streamable transport (POST for JSON-RPC, GET for the SSE event stream) where resumability is implemented via `Last-Event-ID` and the server acts as an OAuth 2.1 resource server validating bearer tokens against a protected-resource metadata document. Does not apply to stdio transport, to stateless SSE endpoints without event-ID replay, or to deployments where the same token authority governs both the event log and the request path (e.g., single-issuer, non-rotating client credentials).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-sse-last-event-id-resumption-as-invalid-across-an-oauth-2-1-token-rotation-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-sse-last-event-id-resumption-as-invalid-across-an-oauth-2-1-token-rotation-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-sse-last-event-id-resumption-as-invalid-across-an-oauth-2-1-token-rotation-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2180,
    "python_slice_tokens": 481,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *event-log continuity* and *authorization continuity*. The SSE event ID is a cursor into a server-side replay buffer. The bearer token is a capability bound to a subject, a resource audience (RFC 8707), and a lifetime. MCP streamable transport requires that a client resuming a dropped stream present `Last-Event-ID`; OA...",
    "what_was_observed": "A streamable-MCP server held per-session replay buffers keyed by `(session_id, stream_id)` with a 5-minute retention window. On `GET /mcp` with `Last-Event-ID`, the handler looked up the buffer, replayed from the cursor, and *then* attached the live tail. Token validation ran in middleware and checked `exp` and signature, but the buffer lookup did not compare the token's `sub` or `aud` against the values recorded whe...",
    "condition_of_validity": "`Last-Event-ID` resumption is valid **if and only if** all of the following hold at the moment of resumption: - The presented token validates against the current JWKS, `exp`/`nbf` with zero grace, and `aud` contains this resource's canonical URI per RFC 8707. - `sub` of the presented token equals the `owner_sub` recorded when the replay buffer was created. -...",
    "decision_boundary": "The boundary is not \"token valid vs. invalid.\" It is **\"does the resumption request's authorization context match the context under which the buffered events were produced, and does the token's lifetime cover the events being replayed.\"** Three concrete decision points: 1. **Subject continuity.** Same `sub`, different `jti` → resumption permitted (normal ref...",
    "operational_effect": "When the boundary is enforced, the observable behavior is: resumption across a token refresh with identical `sub`/`aud` succeeds transparently (the common case, ~99% of resumptions); resumption across a subject or audience change fails fast with `resumption_denied` and the client re-initializes; resumption across an expired token replays only up to `exp` and..."
  },
  "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": "689aedb44db90f5dcadd3d3ebce0e1767165f2a9f00edca7b36a9c1491446cac",
    "verified_classes": [
      "ResumptionDenied",
      "BufferOwnership",
      "TokenClaims",
      "EventCursor"
    ],
    "verified_functions": [
      "authorize_resumption",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ResumptionDenied"
    ],
    "sample_fail_closed_invariants": [
      "unknown_buffer",
      "audience_mismatch",
      "audience_drift",
      "subject_mismatch"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
