Repository navigation
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 2 advisory finding(s) below merit a look before merge.
Graphify review — findings
Fixes cross-file import and call resolution during incremental updates (#3776): _apply_symbol_resolution_facts and _augment_symbol_resolution_edges now accept resolution_context_nodes and seed the symbol table with definitions from unchanged files, so a symbol defined in a file that wasn't re-extracted still resolves rather than being dropped. Context-node labels beginning with . are treated as members and won't shadow same-named top-level symbols, and nodes whose id or source path is already present in the fresh set are skipped. Adds an incremental test asserting the imports and calls edges from a.py to an untouched b.py survive a --code-only rebuild.
Worth a look
- extract() call to _augment_symbol_resolution_edges has malformed/broken syntax —
graphify/extract.py:7485· Escalate · high- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- Malformed _augment_symbol_resolution_edges definition makes resolution.py uncompilable —
graphify/extractors/resolution.py:2520· Escalate · high- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 2398 functions depend on the 429 functions this change touches.
Health — this change adds coupling hotspots:
- new:
_rebuild_code()— 144 callers, 55 callees - new:
_extract_generic()— 18 callers, 29 callees - new:
extract_js()— 87 callers, 4 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
_resolve_js_module_path()— 34 callers, 9 callees - new:
main()— 98 callers, 3 callees - new:
dispatch_command()— 2 callers, 125 callees - new:
extract_objc()— 27 callers, 9 callees - …and 49 more — each is listed as a finding
Verification — 2398 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 2223 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
131 of 300 test file(s) selected (44%) via static blast radius.
tests/test_astro_extraction.py— impacttests/test_astro_import_ids.py— impacttests/test_build.py— impacttests/test_builtin_global_type_refs.py— impacttests/test_case_sensitive_resolution.py— impacttests/test_cjs_module_extension.py— impacttests/test_cobol_extractor.py— impacttests/test_cpp_nested_and_cli.py— impacttests/test_cpp_objc_cross_file_calls.py— impacttests/test_cross_extension_reexport_self_cycle.py— impacttests/test_cross_language_call_resolution.py— impacttests/test_cross_repo_external_call_guards.py— impacttests/test_cross_repo_member_calls.py— impacttests/test_csharp_call_site_generic_args.py— impacttests/test_csharp_enum_members.py— impacttests/test_csharp_field_generic_args.py— impacttests/test_csharp_generic_callsites.py— impacttests/test_csharp_interface_dispatch.py— impacttests/test_csharp_member_calls.py— impacttests/test_csharp_member_nodes.py— impacttests/test_csharp_object_creation.py— impacttests/test_csharp_partial_classes.py— impacttests/test_csharp_type_resolution.py— impacttests/test_definition_file_portability.py— impacttests/test_dotnet.py— impacttests/test_duplicate_annotation_edges.py— impacttests/test_elixir_import_resolution.py— impacttests/test_erlang_extractor.py— impacttests/test_extract.py— impacttests/test_extract_cache_location.py— impacttests/test_extract_php_closures.py— impacttests/test_file_label_disambiguation.py— impacttests/test_file_node_id_spec.py— impacttests/test_forwarding_review_findings.py— impacttests/test_go_builtin_call_targets.py— impacttests/test_go_import_repoint.py— impacttests/test_go_interface_methods.py— impacttests/test_go_qualified_resolution.py— impacttests/test_import_extension_resolution.py— impacttests/test_import_self_loops.py— impacttests/test_imported_export_forwarding.py— impacttests/test_incremental.py— impact, changed-testtests/test_indirect_call_arrow_single_param_shadow.py— impacttests/test_indirect_call_block_scoped_shadow.py— impacttests/test_indirect_call_catch_binding_shadow.py— impacttests/test_indirect_call_external_import_shadow.py— impacttests/test_indirect_call_for_of_binding_shadow.py— impacttests/test_indirect_call_function_expression_shadow.py— impacttests/test_indirect_call_nested_closure_shadow.py— impacttests/test_indirect_dispatch.py— impact- … and 81 more
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
· 57 more finding(s) on lines outside this diff (see the check run).
Abhirup0
left a comment
There was a problem hiding this comment.
Looks like the merge from v8 (8b4f059) had some conflict resolution slip-ups that are breaking test collection in CI:
- In
graphify/extractors/resolution.py:2515, there's a leftover signature chunk inside_augment_symbol_resolution_edges:
else:
_apply_symbol_resolution_facts(paths, nodes, edges, root, facts)
ambiguous_python_modules: set[str] | None = None,
) -> None:
facts = _SymbolResolutionFacts()Also make sure ambiguous_python_modules stays in the parameters and gets forwarded to _collect_python_symbol_resolution_facts so the recent v8 import fix doesn't regress.
- In
graphify/extract.py:7482,_augment_symbol_resolution_edgesis missing a closing paren and got duplicated before_suppress_ambiguous_python_imports. We should keep just the one call after suppression:
_augment_symbol_resolution_edges(
paths, all_nodes, all_edges, root,
ambiguous_python_modules=ambiguous_python_modules,
resolution_context_nodes=resolution_context_nodes,
)- In
tests/test_incremental.py, should step 2 useupdatedirectly (_run(["update", str(proj)], tmp_path)) rather thanextract? That would match the exact reproduction path from #3776.
Complete the skillgen --watch INPUT_PATH injection fix in the add-watch reference (#3742), preserve cross-file edges on incremental update (#3812), stop C# type references resolving to same-named non-type nodes (#3815), prefer a real source location over richness in dedup (#3786), and resolve Maven inherited groupId + ${...} properties in pom.xml (#3823). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Shipped in v0.9.68 (now on PyPI). Thanks @hopstreax (and @himanshupatro-334, preserved as commit author)! The design was right; the pushed diff had drifted against |
Summary
Fixes #3776
Fixes the loss of cross-file
importsandcallsedges when re-extracting files during incremental updates.Previously, symbol resolution only indexed freshly extracted nodes. When a changed file imported or called a symbol defined in an unchanged file, the target symbol was unavailable during resolution and the edge was silently skipped.
Changes
resolution_context_nodesinto the symbol-resolution pipeline.Validation
pytest tests/test_incremental.py— 11 passedpytest tests/test_symbol_resolution.py tests/test_python_import_resolution.py tests/test_forwarding_review_findings.py tests/test_imported_export_forwarding.py— 66 passedpytest tests/test_js_import_resolution.py— 71 passedpytest -k "incremental or resolution" tests/test_watch.py— 36 passed, 1 skippedgit diff --check— cleanScope
This PR addresses the symbol-resolution issue causing
importsandcallsto disappear during incremental updates.The separate non-relative
imports_fromtarget-canonicalization issue is not included in this change.