fix(extract): regenerate cross-file edges via one-hop context files (#2230) - #2382
fix(extract): regenerate cross-file edges via one-hop context files (#2230)#2382HaoChiBao wants to merge 2 commits into
Graphify — looks good
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Details
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR addresses an incremental-extraction issue (#2230) where running extract() on only the changed files caused cross-file edges (e.g. A imports/calls B.helper) to be dropped when the neighbor file B was unchanged. The change adds a step in extract() that discovers one hop of in-root neighbor files via target_file, loads them to provide symbol-resolution facts, then strips those neighbor-owned nodes/edges (by source_file) before returning so ownership stays with the unchanged file for the merge to preserve. It also adds tests in tests/test_incremental.py covering both the direct extract() API (asserting incremental A-edges match a full extract and that B's nodes/edges aren't returned) and the CLI flow across clustered and --no-cluster modes. Surface area is concentrated in graphify/extract.py (the new context-file collection/loading and post-processing filter) and the two new incremental tests.
No blocking issues surfaced. 7 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1262 functions depend on the 216 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
extract()— 360 callers, 30 callees - worse:
_extract_single_file()— 1 callers, 6 callees
Verification — 1262 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: 1134 function(s) in the blast radius were not formally verified this run