{
  "schema_version": "1.3.0",
  "slug": "how-must-tool-result-caches-invalidate-across-tool-generation-changes",
  "title": "How must tool result caches invalidate across tool generation changes?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The session caches tool results, tools can be upgraded, and cached results could be stale relative to the new generation. * **Does not apply when:** Tools are strictly immutable (no generation changes), or the cache is b",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-must-tool-result-caches-invalidate-across-tool-generation-changes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-must-tool-result-caches-invalidate-across-tool-generation-changes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-must-tool-result-caches-invalidate-across-tool-generation-changes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 981,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **cache TTL** (time-based expiration) and **cache generation validity** (the cached result was produced by a compatible tool generation). Relying on TTL creates the **Generation Skew Cache**: the cached result is still within TTL, but the tool has been upgraded to a new generation whose behavior differs, and the cached stale result is ...",
    "what_was_observed": "In tool-cached agent architectures, failing to invalidate on generation change produces three primary failure modes: 1. **Behavioral Regression:** A tool's algorithm is improved (faster, more accurate), but cached results from the old algorithm continue to be returned, and the improvement is never realized for cached keys. 2. **Security Regression:** A tool has a security fix in a new generation, but cached results r...",
    "condition_of_validity": "* **Applies when:** The session caches tool results, tools can be upgraded, and cached results could be stale relative to the new generation. * **Does not apply when:** Tools are strictly immutable (no generation changes), or the cache is bound to tool generation via cache key.",
    "decision_boundary": "1. **Does the session cache tool results?** If no, standard tool handling applies. If yes, proceed. 2. **Does each cache entry include the `cache_generation_signature`?** If no, the cache cannot detect generation drift. The session must add signatures before caching. 3. **Has the tool's generation changed since cache population?** If yes, the cache must inva...",
    "operational_effect": "1. **Generation Consistency:** Cached results reflect the current tool generation, preventing silent divergence. 2. **Proactive Invalidation:** Generation change events trigger cache invalidation before stale results are served. 3. **Audit Clarity:** Per-hit generation attribution allows audits to verify consistency."
  },
  "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": "44f0c1d6b0e05f58ca80e35145a27597619c20289d3f5d21292d368d90b847cc",
    "verified_classes": [
      "CacheVerdict",
      "ToolCacheEntry",
      "ToolCachePolicy",
      "ToolCacheManifest",
      "ToolGenerationCacheGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_cache_hit"
    ],
    "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
  }
}
