MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / cached_files

Function cached_files

graphify/cache.py:1870–1885  ·  view source on GitHub ↗

Return set of file hashes that have a valid cache entry (any kind).

(root: Path = Path("."))

Source from the content-addressed store, hash-verified

1868
1869
1870def cached_files(root: Path = Path(".")) -> set[str]:
1871 """Return set of file hashes that have a valid cache entry (any kind)."""
1872 base = Path(root).resolve() / _GRAPHIFY_OUT / "cache"
1873 hashes: set[str] = set()
1874 # Legacy flat entries
1875 if base.is_dir():
1876 hashes.update(p.stem for p in base.glob("*.json"))
1877 # Namespaced entries, all globbed recursively: ast/ has per-version subdirs,
1878 # semantic-deep/ holds --mode deep entries (#1894), and both semantic kinds
1879 # have per-prompt-fingerprint subdirs alongside pre-fingerprint flat entries
1880 # (#1939).
1881 for kind in ("ast", "semantic", "semantic-deep"):
1882 d = base / kind
1883 if d.is_dir():
1884 hashes.update(p.stem for p in d.glob("**/*.json"))
1885 return hashes
1886
1887
1888def clear_cache(root: Path = Path(".")) -> None:

Calls 2

updateMethod · 0.80
resolveMethod · 0.45