{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-resumable-mcp-sse-over-post-sessions-from-replaying-under-a-rotated-per-request-authorization-header",
  "title": "Which invariants prevent resumable MCP SSE-over-POST sessions from replaying under a rotated per-request authorization header",
  "date_of_record": "2026 December 3",
  "scope": "Applies to MCP servers exposing the HTTP-native streamable transport where a single logical session is a POST-initiated SSE stream that can be resumed via `Last-Event-ID` after disconnect, and where each HTTP request carries its own `Authorization` header (bearer/JWT or short-lived capability token). Does not apply to stdio transports, to stateless one-shot POST/JSON responses without `event:` framing, or to sessions governed by a single long-lived connection credential.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumable-mcp-sse-over-post-sessions-from-replaying-under-a-rotated-per-request-authorization-header.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumable-mcp-sse-over-post-sessions-from-replaying-under-a-rotated-per-request-authorization-header.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-resumable-mcp-sse-over-post-sessions-from-replaying-under-a-rotated-per-request-authorization-header.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2496,
    "python_slice_tokens": 562,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"token expired mid-stream.\" That is a benign, well-understood case: the server rejects the resume with 401 and the client re-authenticates. The non-obvious failure is that **event resumption and per-request authorization are two independent replay surfaces that the transport correlates only by session ID**, and the session ID is not bound ...",
    "what_was_observed": "A tool-calling agent runs a long MCP session against a server that streams tool results as SSE events. Mid-session, the orchestrator rotates the agent's short-lived token (5-minute TTL) as designed. The rotation is transparent to the agent loop: it holds a credential provider, not a token. The transport layer reconnects with the new token and `Last-Event-ID` set to the last event the agent successfully parsed. Three ...",
    "condition_of_validity": "The resume-splice is safe only when the following conjunction holds at the moment of resume: - `principal(resume_token) == principal(session_origin_token)` under a stable principal identifier (`sub` + `iss` + tenant), **or** the server has an explicit, auditable re-scoping rule that re-evaluates every buffered-but-undelivered event against the new principal'...",
    "decision_boundary": "The boundary is between two defensible server policies, and the choice must be explicit because the transport spec does not force it: - **Bind-to-origin (strict):** the session records `origin_principal` at `POST` time; any resume with a differing principal is rejected with `403` and the client must open a fresh session. Cost: token rotation forces session r...",
    "operational_effect": "For an agent runtime, the practical consequences are: 1. **Never treat a resumed stream as continuous with the pre-drop stream unless the principal is unchanged.** The agent loop must tag its working state with the principal that produced each event and refuse to splice events from a different principal into the same reasoning context. A downscoped resume is..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "99558377fe9a37e8b9c68bc6157a1fc75f7f40186d8eaf58ac88de7604e0befd",
    "verified_classes": [
      "ResumeAuthorizationError",
      "ReplayAmbiguityError",
      "Principal",
      "Session"
    ],
    "verified_functions": [
      "resume_session",
      "_undelivered",
      "_entitled",
      "commit_effect",
      "key"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayAmbiguityError",
      "ResumeAuthorizationError"
    ],
    "sample_fail_closed_invariants": [
      "all undelivered events filtered under rescaled principal; client will observe an empty resume — treat as termination."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
