{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-elicitation-sampling-roots-capability-drift-from-silently-corrupting-an-mcp-session-over-streamable-http",
  "title": "Which invariants prevent elicitation/sampling/roots capability drift from silently corrupting an MCP session over streamable HTTP",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP clients and servers negotiating `elicitation`, `sampling`, and `roots` capabilities over the streamable HTTP transport with `Mcp-Session-Id` continuity. Does not cover stdio transport, where capability state is process-bound and cannot desynchronize across reconnects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-elicitation-sampling-roots-capability-drift-from-silently-corrupting-an-mcp-session-over-streamable-http.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-elicitation-sampling-roots-capability-drift-from-silently-corrupting-an-mcp-session-over-streamable-http.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-elicitation-sampling-roots-capability-drift-from-silently-corrupting-an-mcp-session-over-streamable-http.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1973,
    "python_slice_tokens": 313,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *capability advertisement* and *capability availability at a given request*. Over stdio these are effectively identical: the `initialize` handshake happens once, the process lives, and any advertised capability remains live for the session's lifetime. Over streamable HTTP with resumable sessions, the handshake result i...",
    "what_was_observed": "A three-stage trace from a client that reconnects mid-elicitation: 1. **Handshake.** Client POSTs `initialize` with `capabilities: { elicitation: {}, sampling: {}, roots: { listChanged: true } }`. Server responds with its own capabilities and issues `Mcp-Session-Id: s-7f3a`. Both sides now hold a durable record that elicitation and sampling are mutually supported. 2. **Reverse-channel establishment.** Client opens `G...",
    "condition_of_validity": "The failure requires all of the following to hold simultaneously: - The session is streamable-HTTP with `Mcp-Session-Id` continuity enabled (i.e., server supports resumption). - At least one of `elicitation`, `sampling`, or `roots.listChanged` is negotiated, meaning the server holds a *reverse* capability obligation. - The SSE reverse channel is torn down an...",
    "decision_boundary": "The boundary is this: **a capability is not available unless a reverse channel is currently bound to the session and the server has not dispatched a reverse request whose response window has closed.** Operationally, the server must treat the reverse channel as a *lease*, not a *fact*. Concretely: - On every `GET /mcp` (re)bind, the server increments a `chann...",
    "operational_effect": "The downstream effect is not a crash. It is *authorization ambiguity*. Elicitation exists precisely to gate actions the model should not take unilaterally. When a replayed elicitation is re-presented after the original was approved, the model has no way to know the second prompt is a transport artifact rather than a fresh consent requirement. It either (a) r..."
  },
  "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": "21faf1da7e3d5964af2903aa31300a19a7140a2cee3b4b29a581f33cd61adaae",
    "verified_classes": [
      "CapabilityEpochMismatch",
      "CapabilityUnavailable",
      "Session",
      "ReverseChannel"
    ],
    "verified_functions": [
      "exercise_elicitation",
      "__init__",
      "bind",
      "dispatch",
      "accept_response"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "CapabilityEpochMismatch",
      "CapabilityUnavailable"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
