You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: canonicalize UNC and extended-length paths in semantic cache lookup #629
On Windows, check_semantic_cache() should canonicalize equivalent drive/UNC/extended-length paths before cache lookup. Right now it passes each incoming string straight to Path(fpath), so semantically equivalent paths can hash to different cache keys if one caller supplies a normal drive path and another supplies a UNC or extended-length form.
Current behavior
check_semantic_cache() does no normalization itself:
If the same physical file arrives as different Windows spellings, the fallback absolute-path branch can produce distinct strings and therefore distinct hashes. Examples of forms that can refer to the same file:
The practical symptom is a false semantic-cache miss: the semantic cache entry exists, but check_semantic_cache() reports the file as uncached and queues it for extraction again.
Why this matters
The cache is intended to be stable across graphify entry points. On Windows, tools commonly disagree about whether they hand back drive-letter paths, extended-length paths, UNC paths, or slash-normalized variants. A cache key that depends on the spelling rather than the canonical file identity causes avoidable re-extraction and can make --update look nondeterministic.
Suggested fix
Introduce a single path canonicalization helper used by file_hash(), check_semantic_cache(), and save_semantic_cache() before hashing or grouping by source_file.
Possible behavior on Windows:
strip the \\?\ extended-length prefix for local drive paths before hashing;
normalize slashes;
apply os.path.normcase();
resolve relative to the same normalized root;
keep POSIX behavior unchanged except for existing .resolve() semantics.
Add a regression test that writes one semantic cache entry, then checks it using an equivalent alternate Windows path form and expects a cache hit.
Fixed in e73b606: added _normalize_path() in cache.py that strips the \\?\\ extended-length prefix and applies os.path.normcase() on Windows before hashing. POSIX behavior is unchanged.
Activity
fix #590 #628 #629 #630 #619 #617: directed graph, negation patterns,…
safishamsi commentedon May 1, 2026
Fixed in e73b606: added
_normalize_path()in cache.py that strips the\\?\\extended-length prefix and appliesos.path.normcase()on Windows before hashing. POSIX behavior is unchanged.fix Graphify-Labs#590 Graphify-Labs#628 Graphify-Labs#629 Graphify-La…