Repository navigation
fix: keep PowerShell member calls tied to their receiver - #4163
oleksii-tumanov wants to merge 2 commits into
Conversation
AI-Assistance: OpenAI Codex
AI-Assistance: OpenAI Codex
|
Thanks for the pull request, @oleksii-tumanov. 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.10 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Formal verification. PR-changed functions: 1/1 verified (0 proven, 1 may-equivalent, 0 distinguished) · 0 not verified.
Graphify review — findings
Fixes PowerShell member-call resolution so $this.M() and [Type]::M() bind to the method on the receiver's own class instead of any same-named method in the file. A call resolves only when the receiver is $this inside a uniquely named class, or a complete, error-free [Type] literal naming exactly one local class (case-insensitive), and the member is a plain name. Every other receiver (typed or local variables, chained, cast, dynamic, nested or assembly-qualified types, and duplicate class names) now stays in raw_calls as an unresolved member call rather than guessing a target.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 656 functions depend on the 656 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract_powershell()— 26 callers, 6 callees - new:
extract_powershell_manifest()— 10 callers, 3 callees - new:
walk()— 1 callers, 6 callees
Verification — 656 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: 656 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
1 of 334 test file(s) selected (0%) via static blast radius.
tests/test_languages.py— impact, changed-test
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.
Docs that may be stale (advisory)
CHANGELOG.md§ 0.9.6 (2026-07-04) (lines 950-975): references changed symbolswalk_calls
Formal verification
No difference found (not proven): No behavior difference found in extract\_powershell (not a proof).
The verifier ran both versions of extract\_powershell on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
· 3 more finding(s) on lines outside this diff (see the check run).
Replaces the name-only member-call resolver with receiver-proven binding: $this.M() binds to the enclosing class only when its name is unique, and [Type]::M() only to a single unambiguous local class; value/cast/dynamic/ duplicate/external receivers fall through to raw_calls. Fixes the same-name- method caveat from the 0.9.77 member-call work (#3992). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in v0.9.78 via an authorship-preserving cherry-pick, so your commit is on |
What does this PR do?
PowerShell methods with the same name in different classes can create a call edge to the wrong class. Resolve PowerShell member calls only when a direct lexical self or complete unique local type proves the receiver owner; preserve uncertain calls as raw.
Fixes #4158.
Type of change
Verification & Invariants
A definite member-call edge must have a proven local receiver owner. Tests cover both class orders, case-insensitive names, duplicate declarations, qualified or partially parsed type literals, properties, nested calls and unresolved member calls through corpus extraction.
How was this tested?
47 PowerShell tests, 565 adjacent language/multilang tests, and 6,634 full tests passed (15 skipped).
Ruff, skill-generation guards and offline graph update passed. Pyright diagnostics match the exact base: 597 on each, no new diagnostics.
No live PowerShell runtime execution; parser/extractor and corpus paths were tested. Reusing an editable same-version cache requires a forced extraction; normal package-version cache invalidation remains unchanged. This does not add type/dataflow, inheritance or cross-file member inference.
Graphify-specific checklist
AI assistance is disclosed separately in
AI-Assistancecommit metadata.