From 73f5a66370b0fbc42fe983fdc84a58c2d5fdcafa Mon Sep 17 00:00:00 2001 From: ayushcodes10 Date: Mon, 14 Sep 2026 16:04:46 +0530 Subject: [PATCH] Recover malformed semantic cache paths by basename Fixes issue #2973. group_skipped and the save_semantic_cache write loop now call _recover_group_path instead of resolving fpath directly, so a group whose reported source_file never resolves to a real file gets one more chance: an unambiguous basename match against the already dispatched allowlist. An ambiguous or genuinely bogus basename still falls through to the previous skip behavior unchanged, and unscoped callers (no allowed_source_files) are byte identical to before since recovery only runs when an allowlist is available. This stops an incremental run from silently redoing already processed chunks every time the adaptive retry split path reports a source_file that a weak or local backend lost track of. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh --- graphify/cache.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/graphify/cache.py b/graphify/cache.py index 6b30d71a8..cc3a5a48b 100644 --- a/graphify/cache.py +++ b/graphify/cache.py @@ -1531,9 +1531,9 @@ def save_semantic_cache( def group_skipped(fpath: str) -> bool: """Mirror the write-loop skip condition for one source_file group.""" - p = resolved_source_path(fpath) + cache_path, p = _recover_group_path(fpath) return not p.is_file() or ( - allowed_paths is not None and source_path(fpath) not in allowed_paths + allowed_paths is not None and cache_path not in allowed_paths ) # Dangling-reference pruning (#1916). A node group is skipped by the write @@ -1590,8 +1590,7 @@ def save_semantic_cache( saved = 0 skipped_not_file = 0 for fpath, result in by_file.items(): - cache_path = source_path(fpath) - p = resolved_source_path(fpath) + cache_path, p = _recover_group_path(fpath) if p.is_file(): if allowed_paths is not None and cache_path not in allowed_paths: warnings.warn(