Skip to content

fix: add BCL method blocklist to cross-file inference#440

Open
V0v1kkk wants to merge 1 commit intosafishamsi:v4from
V0v1kkk:fix/bcl-method-blocklist
Open

fix: add BCL method blocklist to cross-file inference#440
V0v1kkk wants to merge 1 commit intosafishamsi:v4from
V0v1kkk:fix/bcl-method-blocklist

Conversation

@V0v1kkk
Copy link
Copy Markdown

@V0v1kkk V0v1kkk commented Apr 18, 2026

Fixes #437

Summary

Adds a blocklist of ~120 common .NET BCL/framework method names (Contains, Equals, ToString, Where, Select, Add, Remove, AddDbContext, AddSingleton, LogInformation, etc.) that are skipped during cross-file call resolution.

Without this, the cross-file inference creates hundreds of false INFERRED edges because common method names match unintended nodes — e.g. string.Contains() matches an F# union case EdgeRelation.Contains.

Impact

Tested on a mixed F#/C#/Blazor project (141 code files):

  • False INFERRED edges: 538 → 362
  • Top hub: Contains (false positive) → BookService (correct)

The blocklist follows the same pattern as the existing _SKIP_LABELS set but targets method names. It's conservative — only blocks names that are extremely common across .NET codebases and almost never represent meaningful cross-file relationships.

Test Plan

  • Verified on a 141-file F#/C#/Blazor project
  • No legitimate edges lost (manually audited top 20 affected nodes)
  • Existing tests pass

When resolving unresolved calls across files, common .NET BCL method
names (Contains, Equals, ToString, Where, Select, ListAsync, etc.)
would incorrectly match graph nodes with the same name, creating
false INFERRED edges. For example, string.Contains() would create
a spurious edge to an F# union case named "Contains".

Add a blocklist of ~120 common BCL/framework method names that are
skipped during cross-file call resolution.

Made-with: Cursor
V0v1kkk added a commit to V0v1kkk/graphify that referenced this pull request Apr 18, 2026
Add upstream contribution status: 3 graphify PRs (safishamsi#440-safishamsi#442), 1
tree-sitter-razor PR (safishamsi#19), 1 tree-sitter-fsharp issue (safishamsi#176).
Document fork locations, blocked PRs, and final test metrics.
Fix document structure (reorder commit 7, remove duplicated sections).

Made-with: Cursor
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.

Cross-file inference creates false edges via common .NET method names

1 participant