fix(registry): restrict same-module and unique-name suffix matches on receivers#1128
Open
sahil-mangla wants to merge 2 commits into
Open
fix(registry): restrict same-module and unique-name suffix matches on receivers#1128sahil-mangla wants to merge 2 commits into
sahil-mangla wants to merge 2 commits into
Conversation
4 tasks
Owner
|
Thanks for taking on the receiver false-positive problem. The exact head is security-clean and DCO passes, but it is not correct enough to merge:
The precision goal is valid, but the registry currently lacks enough receiver/language/type evidence for this global heuristic: it is simultaneously too strict for valid Java dispatch and too permissive for unrelated Method candidates. Please redesign the suppression around receiver-aware evidence, preserve the Java enum convergence test, and update the PR's “full suite clean” statement after the complete matrix is actually green. |
25457d2 to
7c78413
Compare
7c78413 to
0b22112
Compare
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.
Description
This PR tightens the call-resolution core in the registry to prevent false-positive
CALLSedge resolutions when dealing with qualified receivers, improving precision across all supported languages.Changes
resolve_same_moduleon receivers: Theresolve_same_modulestrategy now validates the receiver prefix. It will correctly resolve self-receivers (self.get), exact module prefixes (proj.pkg.service.get), and last-segment namespace matches (service.get). It actively rejects resolving to local functions when the receiver is clearly unrelated (e.g.,axios.getor_get_store().get), preventing spurious edges to same-named functions within the current module.resolve_name_lookupfor qualified callees: Added aqn_ends_with_qualifiedcheck. If a callee name is explicitly qualified (e.g., contains.or::), the resolution candidate's qualified name must properly terminate with that exact qualification (unless the candidate is explicitly labeled as a Method), preventing cross-namespace leakage on generic method names.Impact
get,add,update) when invoked on unrelated imported or delegated receiver objects.resolve_same_module_only_on_self_receiverand verified the full test suite runs cleanly.