MCPcopy
hub / github.com/safishamsi/graphify / check_semantic_cache

Function check_semantic_cache

graphify/cache.py:65–86  ·  view source on GitHub ↗

Check semantic extraction cache for a list of absolute file paths. Returns (cached_nodes, cached_edges, uncached_files). Uncached files need Claude extraction; cached files are merged directly.

(
    files: list[str],
    root: Path = Path("."),
)

Source from the content-addressed store, hash-verified

63
64
65def check_semantic_cache(
66 files: list[str],
67 root: Path = Path("."),
68) -> tuple[list[dict], list[dict], list[str]]:
69 """Check semantic extraction cache for a list of absolute file paths.
70
71 Returns (cached_nodes, cached_edges, uncached_files).
72 Uncached files need Claude extraction; cached files are merged directly.
73 """
74 cached_nodes: list[dict] = []
75 cached_edges: list[dict] = []
76 uncached: list[str] = []
77
78 for fpath in files:
79 result = load_cached(Path(fpath), root)
80 if result is not None:
81 cached_nodes.extend(result.get("nodes", []))
82 cached_edges.extend(result.get("edges", []))
83 else:
84 uncached.append(fpath)
85
86 return cached_nodes, cached_edges, uncached
87
88
89def save_semantic_cache(

Callers

nothing calls this directly

Calls 2

load_cachedFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected