Skip to content

Harden C# resolution and ASP.NET graph extraction - #244

Merged
forhappy merged 3 commits into
mainfrom
agent/csharp-aspnet-graph-hardening
Aug 14, 2026
Merged

Harden C# resolution and ASP.NET graph extraction#244
forhappy merged 3 commits into
mainfrom
agent/csharp-aspnet-graph-hardening

Conversation

@forhappy

@forhappy forhappy commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • recover malformed C# parser evidence into bounded partial facts instead of invalidating whole files
  • resolve C# base classes and interfaces with namespace/import/project context while rejecting cross-language collisions
  • type receiver calls through parameters, locals, fields, properties, generic constraints, interfaces, and inherited members
  • extend ASP.NET Minimal API extraction for nested MapGroup prefixes, standard verbs, literal MapMethods, multiline lambdas, and named handlers
  • canonicalize natural-language recall, bound persistent-store accelerator hydration, and rank exact predicate callables before generic subject types
  • enforce the reviewed Kestrel request-processing and IIS middleware anchors on JSON and persistent-store backends
  • reset pre-compatibility extraction, cache, publication, snapshot/store-index, query-index/ranker, overview, qualification, and semantic-diff identities to v1
  • merge current main, preserving the new standalone source-navigation behavior and resolving the PR conflict

Why

The universal C# cutover exposed concrete gaps on the real dotnet/aspnetcore repository: zero-width recovery nodes caused 116 whole-file validation failures, hierarchy matching was not namespace-aware, typed receiver dispatch covered too few C# binding forms, Minimal API argument parsing was comma-sensitive, and generic role names could outrank reviewed ASP.NET implementation anchors. The first persistent-store discovery profile also hydrated up to 12,801 speculative accelerator candidates and exceeded the 30-second query deadline.

Compass does not yet promise compatibility for these internal pre-release identities, so carrying provisional version numbers forward only created unnecessary legacy surface. Existing pre-release artifacts must be discarded or rebuilt; disposable query indexes rebuild automatically.

Impact

C# graphs retain valid partial evidence from malformed or unsupported syntax, resolve hierarchy/member relationships with stronger language-safe evidence, and represent more modern ASP.NET endpoint registrations. Natural search removes question noise and canonicalizes inflections while preserving literal symbol-shaped typo resolution. Discovery caps speculative accelerator reads, recalls exact predicate names as one bounded ranked channel, and reports equal callable-name alternatives as ambiguity. Existing unresolved cases remain explicit. The change is native and deterministic and adds no Graphify runtime dependency.

Real-repository qualification

The real dotnet/aspnetcore qualification was produced with the same extraction logic before the identity-only reset to v1:

  • 14,393 files extracted
  • 239,676 nodes and 344,731 edges
  • 0 error diagnostics and 0 invalid-range diagnostics, down from 116 whole-file validation failures
  • 541.9 seconds total for the uncached JSON qualification run
  • 3.93 GB maximum RSS
  • published graph remains partial by contract: 1,896 nodes and 1,066 edges omitted by validation, with 9 identity collisions quarantined

The persistent-store build comparison used 3.69 GB peak RSS versus 4.93 GB for the original Compass JSON run, a 25.2% reduction. On its 239,376-node, 344,359-edge ASP.NET Core snapshot, the final persistent-store discovery runs complete within the 30-second contract:

  • how are HTTP requests processed: 14.3 seconds, about 181 MB RSS; rank 1 is Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol::ProcessRequests at HttpProtocol.cs:646
  • how is middleware invoked: 19.4 seconds, about 182 MB RSS; rank 1 is Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware::Invoke at IISMiddleware.cs:101, with ambiguity retained

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --lib --bins --locked -- -D warnings
  • cargo test --workspace --lib --bins --locked
  • cargo test -p compass-query --locked
  • cargo clippy -p compass-query --all-targets --all-features --locked -- -D warnings
  • python3 -m unittest discover -s benchmarks/performance/tests -p test_*.py (205 tests)
  • cargo test -p compass-languages --test csharp_universal_conformance --locked
  • focused ASP.NET route and C# universal-resolution integration tests
  • npm run typecheck:js
  • npm run test:js (315 unit tests passed; one timing-sensitive canvas browser case passed on isolated rerun)
  • node scripts/check_viewer_assets.mjs
  • ./scripts/qualify_code_graph_v1.sh --fixtures-only
  • sh scripts/check_product_boundary.sh

Fixture qualification passed all semantic, deterministic-byte, scale, and framework assertions.

@forhappy
forhappy marked this pull request as ready for review August 14, 2026 14:07
@forhappy
forhappy merged commit 0d9c2cf into main Aug 14, 2026
14 checks passed
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.

1 participant