{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-sse-streams-under-per-tool-oauth-resource-indicators",
  "title": "Which invariants prevent silent event loss when resuming MCP HTTP-native SSE streams under per-tool OAuth resource indicators",
  "date_of_record": "2026 November 11",
  "scope": "Applies to MCP servers that expose the HTTP-native streaming transport (POST request → SSE response, with `Last-Event-ID` resumption) and enforce per-tool OAuth 2.0 resource indicators (RFC 8707) on the `aud` claim. Does not apply to stdio transports, to servers that buffer whole responses, or to deployments where a single resource indicator covers all tools.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-sse-streams-under-per-tool-oauth-resource-indicators.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-sse-streams-under-per-tool-oauth-resource-indicators.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-event-loss-when-resuming-mcp-http-native-sse-streams-under-per-tool-oauth-resource-indicators.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1568,
    "python_slice_tokens": 307,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the same stream\" in this transport, and they are not interchangeable: - **Transport identity:** the SSE stream is identified by the `Mcp-Session-Id` plus the event ID sequence. Resumption is a transport-layer operation: reconnect with `Last-Event-ID: <n>` and the server replays events `n+1...` from its buffer. - **Authoriza...",
    "what_was_observed": "A client opened a stream with a token whose `aud` was the aggregate resource `https://mcp.example.com`. It issued `tools/call` for two tools, `search` and `fetch`. Mid-stream, the connection dropped after event ID 41. The client refreshed its token; the authorization server, following a least-privilege policy, issued a token with `aud: https://mcp.example.com/tools/search` only. The client reconnected with `Last-Even...",
    "condition_of_validity": "The invariant \"resume replays the full remaining buffer\" holds only when the following are all true: 1. The reconnect token's `aud` set is a **superset** of the union of resource indicators for all tool calls whose events remain in the replay buffer. 2. The server treats an authorization failure on a buffered event as a **hard error** (emitting an SSE `event...",
    "decision_boundary": "- **Single-tool streams:** resume with any token whose `aud` includes that tool's resource indicator. No special handling needed; the invariant is trivially satisfied. - **Multi-tool streams with token rotation:** do **not** resume with a narrowed token. Either (a) resume with a token whose `aud` covers every tool with buffered events, or (b) do not resume —...",
    "operational_effect": "The practical consequence is that resumable SSE and per-tool resource indicators are **not independently composable**. Resumption assumes the replay is authorization-neutral; per-tool indicators make every event authorization-bearing. The composition is safe only under an explicit superset invariant on the resume token, enforced by both the server (hard erro..."
  },
  "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": "a1fa324a929ee41a31684a25a8d34fb89a7275382a5f9b73fcb9944d1c4b156c",
    "verified_classes": [
      "StreamResumeAuthorizationError",
      "BufferedEvent",
      "ResumeRequest"
    ],
    "verified_functions": [
      "plan_replay",
      "handle_resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StreamResumeAuthorizationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
