{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-capability-drift-when-an-mcp-server-is-re-fingerprinted-across-a-transport-upgrade",
  "title": "Which invariants prevent silent capability drift when an MCP server is re-fingerprinted across a transport upgrade",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP clients (agent runtimes) that cache a server's declared capability surface — tools, resources, prompts, and their JSON Schemas — and re-negotiate it when the underlying transport changes (stdio↔SSE, SSE↔streamable-HTTP, or a versioned `initialize` handshake bump). Does not cover first-contact discovery of a never-before-seen server, nor drift within a single stable transport session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-drift-when-an-mcp-server-is-re-fingerprinted-across-a-transport-upgrade.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-drift-when-an-mcp-server-is-re-fingerprinted-across-a-transport-upgrade.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-capability-drift-when-an-mcp-server-is-re-fingerprinted-across-a-transport-upgrade.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1860,
    "python_slice_tokens": 457,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure of interest is not \"the server changed its tools.\" It is that **the client's cached capability fingerprint and the server's live capability surface diverge during the window between transport teardown and re-initialization, and the client treats the post-upgrade surface as a continuation of the pre-upgrade one.** A transport upgrade is a *state d...",
    "what_was_observed": "A filesystem-class MCP server was upgraded from stdio to streamable-HTTP mid-session. The agent held a cached fingerprint keyed by tool name: `{read_file, write_file, list_dir, move}`. On re-`initialize`, the server returned the same four names. The client's drift detector — a set-difference over `tools[].name` — reported `added: [], removed: [], changed: []`. The agent resumed its task plan. The live `write_file.inp...",
    "condition_of_validity": "Name-set diffing is a valid drift detector **only under the invariant that a capability's name uniquely and permanently determines its full behavioral contract.** That invariant holds for immutable, versioned tool registries (e.g., a server that publishes `tool@sha256:...` and never mutates a name). It fails whenever any of the following is true, which is th...",
    "decision_boundary": "The client must choose, at the moment the new `initialize` response arrives, between two policies: 1. **Trust-by-name (fast path).** Reuse the cached fingerprint if the name set matches. Permitted *only* if the server advertises a `capabilityVersion` or content-addressed tool digest that the client can verify against the cache. If the server cannot prove imm...",
    "operational_effect": "The observable consequence of getting this wrong is a class of failures that *look* like transport or serialization faults but are semantic contract breaks: `-32602` storms misclassified as transient, subscription hangs misclassified as network partitions, and retry loops that burn the token budget re-sending calls the server will never accept. Because the e..."
  },
  "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": "5d10dffcd154461e8a308a623c167b9f3b5d4f3c3c325d4a686ba0438d41243a",
    "verified_classes": [
      "CapabilityDriftError",
      "CapabilityFingerprint"
    ],
    "verified_functions": [
      "_canonical_hash",
      "fingerprint_tool",
      "_narrows",
      "reconcile_after_upgrade"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CapabilityDriftError"
    ],
    "sample_fail_closed_invariants": [
      "server dropped resources.subscribe across upgrade; live subscription handles must be torn down before next await"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
