diff --git a/graphify/extract.py b/graphify/extract.py index 8269c0be1..90a6ab026 100644 --- a/graphify/extract.py +++ b/graphify/extract.py @@ -80,6 +80,8 @@ from graphify.extractors.resolution import ( # noqa: E402,F401 _WORKSPACE_MANIFEST_NAMES, _apply_symbol_resolution_facts, _augment_symbol_resolution_edges, + _cached_realpath, + _cached_source_key, _collect_js_symbol_resolution_facts, _collect_python_symbol_resolution_facts, _contained_in_package, @@ -6398,6 +6400,12 @@ def extract( _PACKAGE_IMPORTS_CACHE.clear() _XAML_CSHARP_CLASS_CACHE.clear() _MD_LINK_INDEX_CACHE.clear() + # Path-resolution memoization (#3500) is keyed by (path, cwd) with no mtime + # component, so — like the alias caches above — a symlink repoint or a path + # that starts/stops existing between rebuilds in a long-lived `graphify + # watch` / MCP process would otherwise replay a stale result. Clear per run. + _cached_realpath.cache_clear() + _cached_source_key.cache_clear() # Infer a common root for cache keys (use first diverging segment, not sum of all matches) try: