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
Incremental extraction: INFERRED cross-file edges to an unchanged neighbor aren't regenerated (batch-scoped symbol resolution) #2230
Follow-up to #2213. The target_file-stamp fix (shipped in 0.9.28) resolves the dangling absolute-id edges on incremental runs. This tracks the remaining, larger half.
Problem. Cross-file symbol resolution (_augment_symbol_resolution_edges and the raw_calls pass in extract()) resolves only against nodes extracted in the current batch (symbol_nodes / callable_nids are built from this run's nodes). On an incremental run that re-extracts only a changed file, its INFERRED cross-file edges to symbols defined in an unchanged neighbor (e.g. from .exc import BadData; raise BadData() where exc.py isn't re-extracted) are not regenerated, and the merge correctly drops the graph's old copies because the source file was replaced. Net: those INFERRED calls/imports edges disappear until a full rebuild.
This is pre-existing and affects BOTH the clustered and --no-cluster incremental paths identically (it is not specific to the #2169 change).
Fix direction (from the #2213 deep-dive). In extract(), parse the in-root import-target "context files" of the batch (the same set the #2169 remap loop already discovers) for resolution FACTS only: let their nodes/edges flow through _augment_symbol_resolution_edges / _merge_decl_def_classes / the id remap / callable_nids, then filter out every node and edge whose source_file is a context file before assembling the result, so ownership stays with the unchanged files and the merge carries their existing contributions forward untouched. One hop of context is enough; do not add context files' raw_calls.
Test. Two-module corpus (A relative-imports and calls a symbol of B) -> full extract -> touch A -> incremental extract -> assert the normalized edge set equals the full-scan edge set, for both --no-cluster and clustered.
Activity
docs(extract): clarify Graphify-Labs#2230 context-file resolution com…
Aman-goel-04 commentedon Sep 15, 2026
@safishamsi, Can I work on this?
safishamsi commentedon Sep 15, 2026
Aman-goel-04 commentedon Sep 15, 2026
On it! Will open a PR shortly!
Aman-goel-04 commentedon Sep 16, 2026
@safishamsi, Have opened a PR for this! Please review it when you have the time!