Repository navigation
fix(extract): preserve co-indexed symlink source identities - #5617
sdivyanshu90 wants to merge 1 commit into
Conversation
Fixes Graphify-Labs#5615 Co-authored-by: OpenAI <[email protected]>
|
Thanks for the pull request, @sdivyanshu90. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
|
@safishamsi Could you please review this PR? |
There was a problem hiding this comment.
Graphify review 
4 possible issues to check · High impact
The extraction remap now distinguishes walked path spellings from resolved symlink targets when assigning file and symbol IDs.
4 possible issues we couldn't confirm
- Files reached through a symlinked directory are treated as canonical, so both paths to one file can be indexed and the surviving symbol iden ·
graphify/extractors/resolution.py:1375 - Resolving a node's parent directory is unguarded, so one unresolvable source path can abort the whole extraction ·
graphify/extractors/resolution.py:1449 - The check that alias edges never point at link nodes passes even when no edge carries a source_file field ·
tests/test_extract_symlink_identity.py:31 - +1 more in Graphify
They don't change the score.
What this review covered
- We didn't review 1 file that isn't source code, such as docs, config, images, or generated or third-party code.
- 3 of 3 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 5783 functions depend on this change
- 2 functions became more coupled.
extract()(1427 callers),_sf_entry()(1 callers). - 659 of 659 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 1ad1aec
…der schema 60 The 59->60 bump (landed with the apex/swift extractor fixes this release) already invalidates stale caches; this records the other extraction-output changes riding that bump: bash caller-var bases (#5563), GitHub Actions run: step extraction (#5565), Python package re-export scoping (#5647), and co-indexed symlink identities (#5617). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Extractor accuracy (Swift #5641, Apex #5627, Python #5647, TypeScript #5604/#5614/#5612, Bash caller-var #5602), GitHub Actions run-step extraction (#5603), incremental correctness (#5634/#5638/#5636), symlink and semantic-cache fixes (#5617/#5618), export/report hardening and perf (#5643/#5644/#5645/#5646/#5619/#5620/#5621), and CLI/docs/skill/install work (#5629/#5628/#5626/#5624/#5623/#5625/#5642/#5583). AST cache schema 59 to 60; Swift/Apex/Python/Bash/GHA inputs re-extract on first build. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in v0.9.124 (just released to PyPI), cherry-picked with your authorship preserved so it shows under your name in the history. Thanks @sdivyanshu90 for keeping co-indexed symlink aliases as distinct source identities — verified green in the full suite and, where applicable, smoke-tested against the published package. 🙏 |
Fixes #5615
Full extraction can overwrite a real file's identity with its co-indexed symlink alias. The two paths share a resolved target, but both own separate nodes in the corpus. Prefer the real input for resolved IDs and symbol hints while remapping walked source paths separately.
The regression covers both input orders, relative and absolute path inputs, cold and warm caches, and imports and calls to the real file. The same-tree full and incremental update probe now produces the same nodes and edges. Switching an existing warm cache between relative and absolute path inputs can still expose a separate file-ID inconsistency.
Validation
python -m pytest tests/test_extract_symlink_identity.py tests/test_extract.py tests/test_cache_stale_import_target.py -q --tb=shortreported 395 passed and one xfailed. All four new cases failed on clean upstream.ruff check .passed.python -m pytest tests -q --tb=shortreported 12,417 passed, 146 skipped, two xfailed and the same 17 failures as clean upstream (12,413 passed).python -m pyright graphify/cache.py graphify/extract.py graphify/extractors/resolution.py --pythonpath /home/somu/.venvs/gvenv/bin/python --outputjsonmatched upstream's 208 existing diagnostics across those modules.python -m graphify update .completed locally.