Constant CACHE_EPOCH
pub const CACHE_EPOCH: &str = "schema_v18";Expand description
Cache-invalidation epoch — a manual cache-buster folded into the cache
key. Bump on any correctness fix that should orphan existing cache files,
whether or not the DuckDB schema shape changed. This is deliberately
independent of facts::schema::CURRENT_SCHEMA_VERSION (the on-disk schema
version): a non-schema correctness fix bumps this without touching the
schema version, and the historical schema_v prefix on the value is
retained so older cache files stay invalidated.
The current epoch (schema_v18) orphans any cache file that persisted an
empty fact store. A shallow / merge-tip checkout ingests zero commits under
the default merge filter, and the HEAD-scoped cache key does not fold shallow
state — so a run that cached that empty store poisoned the key a later
repaired (unshallowed) clone recomputes, turning the ingest-witness failure
into a sticky one no re-fetch could clear. Bumping the epoch discards those
poisoned entries so the repaired clone rebuilds from full history.
Public so other cache-like artifacts (e.g. codelore diff’s
--base-cache) can fold this epoch into their own freshness keys instead
of duplicating the literal — see codelore-cli/src/diff.rs::base_cache_opts_digest.