Expand description
Cache invalidation per CACHE-021 and AUX-022..AUX-027.
Two entry points:
Cache::clearis the unconditional reset behindhaz cache clear: it removes the entire cache root in a single recursive call. Subsequent lookups against the same workspace are misses until new entries are stored.Cache::cleanis the composable selective reclamation behindhaz cache clean. It accepts aCleanOptionsmode set and applies the modes in spec-mandated priority order:soft(CACHE-022): reclaim every objectively stale artefact, entry directories with a missing, unparseable, or schema-mismatched manifest plus.tmp-<key>-<random>store-time directories and.restore-<key>-<random>restore-time staging directories.max_age(AUX-023step 4): evict every remaining well-formed entry whosecreated_atis strictly older thannow_unix - max_age.max_size(AUX-023step 5): if the well-formed survivors’ footprint exceedsmax_size, evict oldest-created_at-first until the residual footprint is at or belowmax_size.dry_run(AUX-024): compute the eviction set but make no on-disk changes.
Per AUX-024, when more than one mode would name the same
entry, the entry counts in the highest-priority mode
(soft > max_age > max_size). CleanReport::evicted_entries
carries one EvictedEntry per evicted entry, labelled with
its priority mode.
Both methods are idempotent on an absent cache root: calling
them when <workspace>/.haz/cache does not exist is a no-op,
not an error.
Structs§
- Clean
Options - Composable mode flags for
Cache::cleanperAUX-022. - Clean
Report - Outcome of
Cache::cleanperAUX-024. - Evicted
Entry - Per-entry eviction detail surfaced for
AUX-024dry-run rendering.
Enums§
- Clean
Error - Failure modes shared by
Cache::clearandCache::clean. - Eviction
Mode - Mode that accounted for evicting a given entry per
AUX-024.