Repository navigation
Import graph: C# rule (C7) and Newtonsoft.Json corpus entry (Part of #3798) - #6417
Merged
Merged
Conversation
…ts-core) (Part of #3798) JavaScript n 63 -> 433, Shell n 28 -> 56; both gate at 100% precision. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…son corpus entry (WIP, Part of #3798) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…Part of #3798) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 24, 2026 08:17
squid-protocol
enabled auto-merge (squash)
October 24, 2026 08:25
Owner
Author
|
No description provided. |
This was referenced Oct 24, 2026
Merged
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.
Part of #3798 (slice 2: C# in the import-graph accuracy audit).
What changed
tests/tools/import_graph_accuracy.py: a C# resolution rule.using A.B;names a namespace, so by contract C7 it yields no file (no edge).using static A.B.Candusing X = A.B.Cresolve to the files that declare type C in A.B, found by declaration (tree-sitter walk, including#if/#regionbodies and file-scoped namespaces), never by path. A nested type falls back to its owner.tests/import_graph_corpus.json: pinnedJamesNK/Newtonsoft.Json@52fa3aef.tests/import_graph_accuracy_baseline.json: newcsharpblock (precision 9.5%, recall 61.1%, 105 FP, 7 FN, 18 resolvable imports).docs/self_scan/graph_comparison_ledger.json: 5 new shapes only (4 csharp import, 1 javascript import), unvalidated. Existing entries untouched (238 added lines, no deletions).docs/import_rule_contract.md: C7 note that the comparison scores C# by it.test_csharp_resolves_by_namespace_and_type_never_by_path.Plan change
The plan said a namespace using resolves to the files declaring the namespace. That gave recall 16% because the engine makes no edge for namespace usings; C7 is the contract and matches the engine. Corpus repo is Newtonsoft.Json.
Finding (needs an owner ruling)
The 105 FPs are all the engine linking
using ...Utilities.LinqBridge;(a namespace) toLinqBridge.cs, a file whose stem matches the namespace. FNs are type aliases to types declared in files not named after the type (e.g.BindingFlagsinReflectionUtils.cs), which the engine does not resolve. Ledger shapes are left unvalidated.Class / Sibling gaps
Other languages still without an import-graph rule: Swift, Groovy, Elixir, Erlang, OCaml, Julia, R, Nim, Fortran, Obj-C++, PowerShell, HCL. Go and Perl second repos remain blocked on engine defects found in #6403. No burned estate program needs any of these, so this is a sweep, not a blocker.
Cross-repo
None. Companion PRs: none. #6406 and #6415 touch the same ledger file; this PR only appends entries, so merge order is free, and the ledger needs no re-run after.
Gates
audit_check.pyall clear;import_graph_accuracy.py --ciOK (21 languages);pr_gates.py --fast7/7;test_import_graph_accuracy.py,test_source_reads.py,test_generated_branch.py44 passed.🤖 Generated with Claude Code