Skip to content

fix(vbnet): resolve type/module-qualified calls to their target method - #3909

Closed
rajatnagda45 wants to merge 1 commit into
Graphify-Labs:v8from
rajatnagda45:fix/vbnet-qualified-calls
Closed

rajatnagda45 wants to merge 1 commit into
Graphify-Labs:v8from
rajatnagda45:fix/vbnet-qualified-calls

Conversation

@rajatnagda45

Copy link
Copy Markdown
Contributor

What does this PR do?

The VB.NET invocation resolver only fired for self / unqualified receivers — Me, MyClass, the enclosing type, or a bare name. A call qualified by a type or module name matched nothing and produced no edge at all:

Namespace Demo
  Public Module Helpers
    Public Sub Log()
    End Sub
  End Module
  Public Class Service
    Public Sub Run()
      Helpers.Log()      ' <- dropped: no calls edge to Helpers.Log
    End Sub
  End Class
End Namespace

Calling a shared Module Sub via Helpers.Log() is idiomatic VB.NET, so the graph was missing a whole class of real call edges, leaving callers disconnected from the module methods they invoke.

Type of change

  • Bug fix

Verification & Invariants

Invariant protected: extraction completeness without guessed relationships. I map each declared type/module's short name to its owner_key, then resolve a qualified call against the receiver's owner (the map that already keys same-type methods), falling back to the existing raw_calls mechanism for cross-file partial-type merging. The resolver stays fail-closed:

  • A call through a value receiver (a local variable, e.g. obj.Save()) has no statically known owner and is left unresolved — never guessed into a false edge (covered by a dedicated test).
  • Cross-file resolution keeps its existing "exactly one candidate" guard, so no ambiguous edge is emitted.

Self/unqualified resolution is unchanged. Node ids and ownership keys are derived from names (no filesystem/ordering dependence), so extraction stays deterministic.

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary.
  • Added a regression test (fails before the fix, passes after) and a fail-closed guard test.
  • Kept the PR description synchronized with the final implementation.
  • Documented limitations: a call qualified by a type declared only in another file (not in the caller's file and not a top-level owner match) is left unresolved rather than guessed.

How was this tested?

python -m pytest tests/test_vbnet_extractor.py -q          # 7 passed (new qualified-call test fails on pre-fix tree)
python -m pytest tests/ -q \
  --deselect tests/test_security.py \
  --deselect "tests/test_install_references.py::test_built_wheel_ships_the_full_skill_payload"
# full suite green
ruff check graphify/extractors/vbnet.py tests/test_vbnet_extractor.py   # clean
pyright graphify/extractors/vbnet.py                                    # 0 errors

Graphify-specific checklist

  • No generated skill artifacts touched.
  • Confirmed AST extraction remains deterministic (ownership keyed by name, no ambient state).
  • Reviewed for security implications (no shell/Python interpolation of source text).
  • No API keys or local graph data included.

The invocation resolver only fired for self/unqualified receivers (Me, the
enclosing type, or a bare name). A call qualified by a type or module name —
Helpers.Log(), the idiomatic way to reach a shared Module Sub — matched
nothing and produced no edge at all, so the caller was disconnected from the
method it invoked.

Map each declared type/module's short name to its owner key, and resolve a
qualified call against the receiver's owner (falling back to raw_calls for
cross-file partial-type merging). A call through a value receiver (a local
variable) still has no known owner and is left unresolved rather than
guessed (fail-closed).
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @rajatnagda45. 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.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.


Graphify review — findings

Resolves type/module-qualified VB.NET calls like Helpers.Log() back to the owner method by mapping short receiver names to their namespace-qualified owner key via a new owner_by_short table, so a caller now gets a calls edge to the module/type method it invokes. Self and unqualified receivers still resolve to the caller's own type, while calls through a value receiver (a local variable) have no known owner and stay unresolved rather than producing a guessed edge.

Worth a look

  • Fully-qualified VB receivers are resolved by short type name only — graphify/extractors/vbnet.py:398 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 21 functions depend on the 21 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract_vbnet() — 2 callers, 6 callees
  • new: process_type() — 1 callers, 6 callees

Verification — 21 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: 21 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

304 of 304 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — full-run-safety
  • tests/test_chunking.py — full-run-safety
  • tests/test_cjs_module_extension.py — full-run-safety
  • tests/test_claude_cli_backend.py — full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_cobol_extractor.py — full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • tests/test_cpp_nested_and_cli.py — full-run-safety
  • tests/test_cpp_objc_cross_file_calls.py — full-run-safety
  • tests/test_cpp_preprocess.py — full-run-safety
  • tests/test_cross_extension_reexport_self_cycle.py — full-run-safety
  • tests/test_cross_language_call_resolution.py — full-run-safety
  • tests/test_cross_repo_external_call_guards.py — full-run-safety
  • tests/test_cross_repo_member_calls.py — full-run-safety
  • … and 254 more

changed code file(s) with no mapped test (graphify/extractors/vbnet.py) — a coverage gap or a missing link — running the full suite rather than only the selected tests

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.

· 2 more finding(s) on lines outside this diff (see the check run).

safishamsi added a commit that referenced this pull request Sep 30, 2026
Solidity free functions (#3906), VB.NET qualified calls (#3909), Astro
frontmatter-only AST pass (#3902), surprise bonus/reason alignment (#3934),
exclude-hubs stranded-neighbour (#3933), graph-DB push index (#3957),
label retry keep-named (#3956), stale-hook status (#3951), virtual-workspace
Cargo.toml skip (#3930), and symlinked-instructions install/uninstall
handling (#3950/#3953).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@safishamsi

Copy link
Copy Markdown
Member

Shipped in v0.9.73 (now on PyPI) via an authorship-preserving cherry-pick, so your commit keeps contributor-graph credit. Thanks @rajatnagda45!

Release: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants