Repository navigation
fix(cache): retain unattributed same-file semantic edges - #5618
Open
sdivyanshu90 wants to merge 1 commit into
Open
sdivyanshu90 wants to merge 1 commit into
sdivyanshu90 wants to merge 1 commit into
Conversation
Fixes Graphify-Labs#5616 Co-authored-by: OpenAI <noreply@openai.com>
|
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. |
Contributor
Author
|
@safishamsi Could you please review this PR? |
There was a problem hiding this comment.
Graphify review 
No issues reported · High impact
Unattributed edges are assigned to a file when both endpoint IDs have the same unambiguous node provenance.
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.
- 2 of 2 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 4005 functions depend on this change
- 1 function became more coupled.
save_semantic_cache()(71 callers). - 659 of 659 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed d23c980
This branch has not been deployed
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.
Fixes #5616
Semantic graph assembly retains an edge without its own source path when both endpoints belong to one file. The cache writer currently drops that edge, so later cache replay loses a relationship present in the cold graph.
Infer ownership from both endpoint IDs only when they identify the same file unambiguously. The inferred source goes through the normal file allowlist and dangling-reference checks. The caller's edge dictionary is left unchanged.
Validation
python -m pytest tests/test_semantic_unattributed_edges.py tests/test_cache.py tests/test_semantic_cache_basename_recovery.py tests/test_semantic_cache_out_root.py -q --tb=shortreported 99 passed and one skipped. The regression failed on clean upstream.ruff check .passed.python -m pytest tests -q --tb=shortreported 12,414 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.