Repository navigation
Conversation
added 6 commits
May 26, 2026 22:00
Member
|
Implemented the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
graphify updatefailing to evict stale nodes from deleted files (#1007)Problem
graphify update(_rebuild_codewith nochanged_paths) silently preserved nodesfrom deleted files. The fix in
build_merge(eef623a) coveredgraphify extractbut
_rebuild_codehas its own eviction logic that was not touched.Reproduction with v8 branch after eef623a:
Root cause
When
changed_paths is None(plaingraphify update),evict_sourcesis neverpopulated — deleted files are simply absent from the new extraction and end up in
preserved_nodesunchanged:Additionally,
str(cand.relative_to(project_root))produces backslash paths onWindows (
module-b\utils.py) whilegraph.jsonstores forward-slash paths(
module-b/utils.py) — causing eviction to silently fail even whenchanged_pathsis provided.Fix
watch.py — three changes:
_relativize_source_files(line 141):str(...)→.as_posix()—fixes forward-slash normalization for absolute-path conversion.
deleted_paths/evict_sources(lines 379, 415):str(...)→_norm_source_file(str(p), root)— same function used inbuild_merge,so prune keys are normalized identically to node
source_fileattrs._rebuild_codereconciliation: whenchanged_paths is None, iterateexisting graph nodes and build
current_sources— both sides normalizedvia
_norm_source_fileso prune keys and nodesource_fileattrs arecompared identically (mirrors
build_mergefix in eef623a).Any code node whose normalized source is absent from disk is added to
evict_sourcesanddeleted_paths(to pass the shrink-guard).Test
tests/test_watch.py::test_rebuild_code_evicts_nodes_from_deleted_files—builds a two-file corpus, deletes one file, calls
_rebuild_codedirectly,asserts the deleted file's nodes are gone and the surviving file's nodes remain.
Full test run: 47 passed, 7 skipped across
test_build.pyandtest_watch.py(skipped: POSIX fcntl + watchdog — not applicable on Windows).