feat: resolve C/C++ and Rust calls across files and typed receivers #3

Merged
trevon merged 2 commits from feat/cpp-rust-resolution into main 2026-09-22 21:14:53 +00:00
3 changed files with 28 additions and 4 deletions
Showing only changes of commit 7c664cb5a0 - Show all commits

docs: describe C/C++ and Rust resolution limits and next stages
Some checks failed
build / build-linux (pull_request) Successful in 1m3s
build / build-macos (pull_request) Has been cancelled
build / release (pull_request) Has been cancelled

README limits now describe include-closure C++ lookup, declared-receiver
member resolution, Rust macro re-parsing, unresolved reasons, and
metrics.resolution, plus the remaining adapter gaps. The roadmap records
candidate edges, the Fold compiler call lane, and compile_commands/Cargo
module resolution as next stages; literature notes cite the call-graph and
name-resolution papers found through paperbridge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
trvon 2026-09-22 15:11:42 -06:00
Signed by: trevon
GPG key ID: 083EB1C25C575E81

View file

@ -161,9 +161,20 @@ Relative JS/TS and Dart imports resolve against the importing directory; missing
paths never fall back to unrelated basenames. Explicit JS/TS named/default import paths never fall back to unrelated basenames. Explicit JS/TS named/default import
bindings, module-scoped Rust grouped/aliased imports, and module-qualified Rust bindings, module-scoped Rust grouped/aliased imports, and module-qualified Rust
public calls can resolve across files. public calls can resolve across files.
Member calls and ambiguous targets stay external. Bare package specifiers, C++ calls resolve through the include closure: a header prototype pairs with
tsconfig aliases, Rust wildcard/block-local binding expansion, and C++ cross-translation-unit its definition in another translation unit, lookup walks class (including
resolution need further adapters. File fan-out remains an observation rather in-repository bases) and namespace scopes outward, and `static`/anonymous
definitions stay file-local. C++ and Rust member calls resolve only through an
explicitly declared receiver type (parameter, local, field, `this`/`self`,
smart pointer, or `Self`-returning constructor) and carry
`source.resolution`. Calls inside Rust expression macros (`assert!`, `format!`,
`vec!`, ...) are recovered by re-parsing and carry `source.extraction`.
Every unresolved call edge records `source.unresolved-reason`, and
`metrics.resolution` reports per-language call-site coverage. Ambiguous
targets stay external. Bare package specifiers, tsconfig aliases, Rust
wildcard/block-local binding expansion, Cargo workspace module paths,
`compile_commands.json` include paths, and compiler-grade dispatch need further
adapters. File fan-out remains an observation rather
than proof of semantic coupling. Scope architecture gates to production paths than proof of semantic coupling. Scope architecture gates to production paths
and verify candidates against source and tests. and verify candidates against source and tests.

View file

@ -34,7 +34,12 @@
- Expand and qualify Tree-sitter/compiler frontends per language while keeping - Expand and qualify Tree-sitter/compiler frontends per language while keeping
them separate evidence backends; do not promote the P4 pilot until macro and them separate evidence backends; do not promote the P4 pilot until macro and
multi-project labeled-corpus gates pass. multi-project labeled-corpus gates pass.
- Overload/alias/dynamic-dispatch ambiguity represented as candidate edges. - Overload/alias/dynamic-dispatch ambiguity represented as candidate edges
(schema 5); today ambiguity is an External target with reason `ambiguous`.
- Fold `ProjectCallGraph` and `fold-rust` MIR call export, imported as a
separate Imported call lane with per-file Heuristic/Imported agreement.
- `compile_commands.json` include paths and Cargo workspace/`mod`-tree module
resolution for the heuristic C++/Rust resolvers.
- Namespace/package clustering and richer versioned policy rule kinds beyond - Namespace/package clustering and richer versioned policy rule kinds beyond
the seed forbidden-dependency boundary. the seed forbidden-dependency boundary.

View file

@ -29,3 +29,11 @@ The visualization metaphor and the health indicator are consumers of evidence,
not replacements for it. No paper above validates Brick's v0.1 weights; those not replacements for it. No paper above validates Brick's v0.1 weights; those
weights remain explicitly experimental. weights remain explicitly experimental.
## Call resolution (2026-09-22)
A Paperbridge search on 2026-09-22 (arXiv and OpenAlex) informed the C/C++
and Rust resolution work: Murphy and Notkin (TOSEM 1998), Grove et al. (OOPSLA
1997, TOPLAS 2001), Srivastava (LOPLAS 1992), Creager and van Antwerpen (stack
graphs, arXiv:2211.01224), Cai and Zhang (OOPSLA 2023), Li et al. (Rupta,
CC 2024), and LocAgent (ACL 2025).