{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-resumable-sse-replay-from-silently-rebinding-an-mcp-session-to-a-stale-oauth-2-1-resource-audience-after-transport-upgrade",
  "title": "Which invariants prevent resumable SSE replay from silently rebinding an MCP session to a stale OAuth 2.1 resource audience after transport upgrade",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients and servers using the HTTP-native streamable transport with `Last-Event-ID` resumable SSE fallback and OAuth 2.1 resource-server token binding (RFC 8707 `resource` indicator). Does not apply to pure stdio transports, nor to non-resumable SSE where no event-ID cursor is negotiated.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumable-sse-replay-from-silently-rebinding-an-mcp-session-to-a-stale-oauth-2-1-resource-audience-after-transport-upgrade.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumable-sse-replay-from-silently-rebinding-an-mcp-session-to-a-stale-oauth-2-1-resource-audience-after-transport-upgrade.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumable-sse-replay-from-silently-rebinding-an-mcp-session-to-a-stale-oauth-2-1-resource-audience-after-transport-upgrade.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1755,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **transport continuity** and **authorization continuity**. A resumable SSE stream guarantees that event sequence numbers survive a network fault; it says nothing about whether the bearer token that authorized the *original* stream is still the token that the *resumed* stream is authorized under. In the HTTP-native stre...",
    "what_was_observed": "A client established an MCP session against `mcp://tenant-a.example/stream` with an OAuth 2.1 access token whose `resource` claim was `https://mcp.tenant-a.example`. The server issued `Mcp-Session-Id: s-7f3a` and began streaming SSE events with monotonic `id:` values (`evt-0001` … `evt-0412`). Mid-stream, a load balancer returned 502 and the client reconnected with `Last-Event-ID: evt-0412` and a *refreshed* access t...",
    "condition_of_validity": "The silent rebind is only possible when all three of the following hold: - **Cursor key does not include audience.** The server's event-ID cursor table is keyed by `session_id` (or `session_id + stream_id`) without a `resource_audience` column. This is the common case because MCP's session model treats audience as invariant across a session's lifetime — an a...",
    "decision_boundary": "The boundary is between **resume-as-continuation** and **resume-as-reauthorization**. A resume request that presents a token with the same `(aud, jkt, iss)` tuple as the session's binding is a continuation: replay from the cursor is correct and the cursor's authorization context is preserved. A resume request that presents any differing tuple is a reauthoriz...",
    "operational_effect": "When the invariant holds, the effect is that a transport fault degrades to a *re-initialization* rather than a *context switch*. The agent loses its in-flight event cursor and must re-run `initialize`, which re-negotiates capabilities and re-binds audience — a visible, recoverable, and auditable event. The cost is a small amount of wasted work on every audie..."
  },
  "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": "1ffa6d5558addedf132713914d8ff30dd6febdfbafdb275fd502b8f4d73629a4",
    "verified_classes": [
      "AudienceRebindError",
      "TokenContext",
      "CursorBinding"
    ],
    "verified_functions": [
      "resume_stream",
      "fingerprint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "AudienceRebindError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
