Add cache invalidation based on file mtime #38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The cache is keyed purely on path (SHA-256 of the path string). On a re-run, any path with an existing cache entry is skipped — even if the file has changed, been deleted, or new files have appeared in the directory.
The only current escape hatch is
--fresh, which wipes the entire cache and starts over.What should happen
When an investigation re-uses an existing cache, each entry should be validated before being trusted:
cached_attimestamp against the file's mtime. If the file is newer, invalidate the entry and re-investigate.cached_at), invalidate the dir entry too.Implementation notes
mtime(fromos.stat) in file cache entries at write timehas_entry(or a newis_valid_entry) checks mtime before returning True--freshremains the nuclear option for full cache resetRelated