Plan a cache prune: given the filenames present in enquire's cache directory
and the 12-hex legacy routing key to KEEP, return the canonically spelled
reserved-name subset under OTHER routing keys. Pure and side-effect-free,
so the destructive prune CLI can preview before touching disk and the
safety invariant (never selects outside the reserved namespace or the kept
routing key) is unit-testable. A visible watcher-activation guard for any
selected stem vetoes the whole plan; pruning around an in-progress derived
generation would make the plan's commit truth unknowable. It does not prove
who created a matching entry or distinguish roots that collide on the
truncated key.
Parameters
entries: readonlystring[]
Filenames (basenames) present in the cache directory.
keepHash: string
The 12-hex legacy routing key to preserve (from defaultIndexFile).
Returns string[]
Recognized reserved basenames eligible for removal, never keepHash.
Throws
If keepHash is not exactly 12 lowercase hexadecimal characters.
Throws
If a selected stem has a visible watcher-activation guard.
Plan a cache prune: given the filenames present in enquire's cache directory and the 12-hex legacy routing key to KEEP, return the canonically spelled reserved-name subset under OTHER routing keys. Pure and side-effect-free, so the destructive
pruneCLI can preview before touching disk and the safety invariant (never selects outside the reserved namespace or the kept routing key) is unit-testable. A visible watcher-activation guard for any selected stem vetoes the whole plan; pruning around an in-progress derived generation would make the plan's commit truth unknowable. It does not prove who created a matching entry or distinguish roots that collide on the truncated key.