{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-mcp-resource-subscription-starvation-under-http-2-stream-window-collapse",
  "title": "Which invariants prevent MCP resource subscription starvation under HTTP/2 stream-window collapse",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP hosts that multiplex multiple `resources/subscribe` streams over a single HTTP/2 connection to one server, where the server pushes `notifications/resources/updated` frames. Does not apply to single-stream stdio transports or to servers that emit one update per request-response cycle.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-resource-subscription-starvation-under-http-2-stream-window-collapse.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-resource-subscription-starvation-under-http-2-stream-window-collapse.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-resource-subscription-starvation-under-http-2-stream-window-collapse.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1787,
    "python_slice_tokens": 257,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the server sent too many notifications.\" It is that an MCP server's outbound `notifications/resources/updated` frames share a single HTTP/2 connection-level flow-control window (default 65,535 bytes) with every other stream on that connection, including the *responses to the agent's own tool calls and `resources/read` requests*. When...",
    "what_was_observed": "A host agent maintained three subscriptions over one HTTP/2 connection to an MCP server: `file:///var/log/app.log` (high churn, ~200 updates/sec during bursts), `db://metrics/cpu` (steady 1/sec), and a `tools/call` to `search_index` issued periodically. Trace of the collapse: 1. `app.log` enters a burst. Server emits `notifications/resources/updated` frames at 200/sec. Each frame is a small JSON-RPC notification (~18...",
    "condition_of_validity": "This failure requires all of the following simultaneously: - **Multiplexed transport.** Multiple logical MCP streams share one HTTP/2 connection. Over stdio, each subscription is a separate pipe and the failure does not occur. - **Read-amplifying subscription handler.** The agent's handler for `notifications/resources/updated` performs a synchronous request ...",
    "decision_boundary": "The invariant that must hold to prevent this is a **separation of the notification-drain path from the request-response path at the flow-control layer**, expressed as one of two concrete contracts: - **Contract A (server-side reservation):** The MCP server MUST NOT allow a single subscription stream to consume more than `floor(connection_window / active_stre...",
    "operational_effect": "Under the invariant, the observable behavior changes from *correlated timeouts across unrelated streams* to *bounded, localized degradation*. With Contract B, a 200/sec burst on `app.log` produces queue drops in the agent's subscription drain (visible, counted, attributable) while `search_index` and `db://metrics/cpu` continue at normal latency. With Contrac..."
  },
  "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": "1e81a8aca4a1d19bac6eb39853b39b3adf908d075249425ba28349dc0ae7f565",
    "verified_classes": [
      "SubscriptionStarvationError",
      "BoundedSubscriptionDrain"
    ],
    "verified_functions": [
      "__init__",
      "on_updated",
      "drain"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SubscriptionStarvationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "asyncio",
      "collections"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
