{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-sse-stream-across-an-mcp-server-restart-and-the-delegated-oauth-scope-no-longer-matches-the-stream-s-tool-bin",
  "title": "What happens when an instance resumes an SSE stream across an MCP server restart and the delegated OAuth scope no longer matches the stream's tool-binding epoch",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients using HTTP-native transport (Streamable HTTP / SSE with `Last-Event-ID` resumption) where per-tool OAuth scope delegation is negotiated at session establishment. Does not apply to stdio transports, nor to servers that re-authorize on every event delivery.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-sse-stream-across-an-mcp-server-restart-and-the-delegated-oauth-scope-no-longer-matches-the-stream-s-tool-bin.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-sse-stream-across-an-mcp-server-restart-and-the-delegated-oauth-scope-no-longer-matches-the-stream-s-tool-bin.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-sse-stream-across-an-mcp-server-restart-and-the-delegated-oauth-scope-no-longer-matches-the-stream-s-tool-bin.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2232,
    "python_slice_tokens": 383,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"session continuity\" in MCP over HTTP, and conflating them is the root of this failure: 1. **Transport continuity** — the SSE stream's event cursor, carried by `Last-Event-ID`, which lets a client resume a dropped stream and receive events it missed. 2. **Authorization continuity** — the OAuth scope set bound to the session,...",
    "what_was_observed": "A tool-calling agent (call it the *worker*) established an MCP session against an HTTP-native server, negotiated a delegated scope of `tools:read tools:write`, and opened an SSE stream for a long-running `batch_index` tool. The tool emits progress events and, at completion, a `result` event containing the tool output. The worker's OAuth token was a short-lived delegated grant (15 min) issued by the orchestrator on th...",
    "condition_of_validity": "The transport-continuity / authorization-continuity split is *safe* only under the following conjunction: - **C1 (replay authorization):** The server re-evaluates the session's current scope against each replayed event's required scope *before* emitting it. If the grant is gone, replay must be truncated at the last event the *current* grant authorizes, and t...",
    "decision_boundary": "The boundary is not \"should I resume?\" — transport resumption is almost always correct. The boundary is **what the client is allowed to do with events received after a resume that crossed an epoch boundary it cannot verify.** The decision rule: The costly-but-correct default when C2 is absent is **re-run, don't resume-admit**. The cheap-but-wrong default — w...",
    "operational_effect": "Three concrete effects follow, and each is a place where agent state continuity silently diverges from authorization reality: 1. **Stale-grant result poisoning of episodic memory.** The worker's memory now contains a `batch_index` result minted under a revoked grant. On the next task, retrieval surfaces this result as a valid prior; the agent reasons from da..."
  },
  "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": "32f124b55022f949b7ff9eea9454bf639e1351993bd4fb2cbc92e3cf86aa34d2",
    "verified_classes": [
      "ResumedStreamAuthMismatch",
      "Grant",
      "StreamEvent"
    ],
    "verified_functions": [
      "admit_resumed_event",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumedStreamAuthMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
