{
  "schema_version": "1.3.0",
  "slug": "what-invariants-prevent-tool-discovery-caches-from-returning-deprecated-tool-versions",
  "title": "What invariants prevent tool discovery caches from returning deprecated tool versions?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The session caches tool definitions, tools can be deprecated, and stale cache hits cause failures or security risk. * **Does not apply when:** The session fetches tool definitions from a strictly live source with no cach",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-invariants-prevent-tool-discovery-caches-from-returning-deprecated-tool-versions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-invariants-prevent-tool-discovery-caches-from-returning-deprecated-tool-versions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-invariants-prevent-tool-discovery-caches-from-returning-deprecated-tool-versions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 969,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **cache hit** (the tool definition was found in the cache) and **cache freshness** (the cached definition reflects a currently supported tool version). Relying on cache hit creates the **Discovery Cache Staleness**: the cached tool definition is returned, the agent invokes it, and the tool has been deprecated, moved, or replaced, causi...",
    "what_was_observed": "In tool-discovery caching architectures, failing to invalidate on deprecation produces three primary failure modes: 1. **Deprecated Endpoint Invocation:** The cache returns an endpoint that was retired weeks ago. The agent's calls fail with \"not found,\" and the agent blames a transient error rather than stale discovery. 2. **Schema Mismatch:** The cache returns an older schema, and the agent's payloads no longer matc...",
    "condition_of_validity": "* **Applies when:** The session caches tool definitions, tools can be deprecated, and stale cache hits cause failures or security risk. * **Does not apply when:** The session fetches tool definitions from a strictly live source with no caching, or tool deprecation is impossible (immutable tool definitions).",
    "decision_boundary": "1. **Was the tool definition served from cache?** If no, standard live lookup applies. If yes, proceed. 2. **Is the cached version still supported?** If yes, use it. If no, invalidate and re-fetch. 3. **Has the `deprecation_propagation_witness` confirmed the cache processed recent deprecations?** If no, the cache may be stale. Force a re-fetch. 4. **Converse...",
    "operational_effect": "1. **Deprecation Awareness:** Prevents the agent from invoking deprecated tools. 2. **Schema Consistency:** Ensures the cached schema matches the current version. 3. **Security Posture:** Prevents exposure to vulnerabilities patched in newer versions."
  },
  "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": "6a448574edcbfa469e8dcbf0d43f0da2c83e635f05085012fe3ed7f59fe2d956",
    "verified_classes": [
      "CacheVerdict",
      "ToolCacheEntry",
      "CachePolicy",
      "CacheManifest",
      "ToolDiscoveryCacheGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_cache_entry"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 0,
    "raised_exceptions": [],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
