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

2 commits

Author SHA1 Message Date
trvon
7c664cb5a0
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>
2026-09-22 15:12:04 -06:00
trvon
48436f35b7
feat: resolve C/C++ and Rust calls across files and typed receivers
C++ calls now resolve through the include closure: header prototypes pair
with definitions in other translation units, lookup walks class (including
in-repository bases), namespace, and `using` scopes outward, and static or
anonymous-namespace definitions stay file-local. Member calls resolve only
through explicitly declared receiver types (parameters, locals, fields,
this, smart pointers, aliases); template parameters stay unknown. Calls
hidden by the most vexing parse are recovered, casts are no longer calls,
reference-returning and conversion-operator declarations are named
correctly, and benign `= {}` default-argument recoveries no longer drop
prototypes or flag files.

Rust method calls resolve through a crate-wide impl index for self, typed
parameters and lets, struct fields, Self-returning constructors, dyn
traits, and Type::/Self:: associated calls, with foreign imports and
generics never guessed. Calls inside expression macros are re-parsed.

Every unresolved call records source.unresolved-reason, weaker resolutions
record source.resolution/source.extraction, and metrics.resolution reports
per-language call-site coverage. Declarations gain facts consumed by
caller-status queries (qualified names, linkage, virtual, trait impls,
attributes, name references, parse-incomplete). C++/Rust External targets
include the reason in their identity; out-of-line C++ methods keep their
IDs.

Linear node/edge scans and per-node ancestor walks are replaced with
indexes, cutting a YAMS scan from 575 s to 23 s.

New labeled cpp_xtu and rust_methods corpora run three times in the
quality gate.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-22 15:11:04 -06:00