Skip to content

Import graph: C# rule (C7) and Newtonsoft.Json corpus entry (Part of #3798) - #6417

Merged
squid-protocol merged 5 commits into
mainfrom
churn/3798-20261024T0723Z
Oct 24, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
churn/3798-20261024T0723Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

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.C and using X = A.B.C resolve to the files that declare type C in A.B, found by declaration (tree-sitter walk, including #if/#region bodies and file-scoped namespaces), never by path. A nested type falls back to its owner.
  • tests/import_graph_corpus.json: pinned JamesNK/Newtonsoft.Json @ 52fa3aef.
  • tests/import_graph_accuracy_baseline.json: new csharp block (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: 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) to LinqBridge.cs, a file whose stem matches the namespace. FNs are type aliases to types declared in files not named after the type (e.g. BindingFlags in ReflectionUtils.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.py all clear; import_graph_accuracy.py --ci OK (21 languages); pr_gates.py --fast 7/7; test_import_graph_accuracy.py, test_source_reads.py, test_generated_branch.py 44 passed.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 24, 2026 08:17
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 08:25
@squid-protocol
squid-protocol merged commit 52e9501 into main Oct 24, 2026
51 checks passed
@squid-protocol
squid-protocol deleted the churn/3798-20261024T0723Z branch October 24, 2026 08:50
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

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

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant