brick/tests/fixtures/cpp_xtu/cpp/labels.json
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

223 lines
3.9 KiB
JSON

{
"language_prefixes": {
"headers": "include/",
"sources": "src/",
"tools": "tools/"
},
"symbols": [
[
"include/geo/shape.h::scope=geo::Shape",
"class"
],
[
"src/shape.cpp::scope=geo::Shape::Shape",
"function"
],
[
"src/shape.cpp::scope=geo::Shape::area",
"function"
],
[
"src/shape.cpp::scope=geo::Shape::scale",
"function"
],
[
"src/shape.cpp::scope=geo::Shape::unit",
"function"
],
[
"src/shape.cpp::scope=geo::Shape::counter",
"function"
],
[
"src/shape.cpp::scope=geo::total",
"function"
],
[
"src/util.cpp::twice",
"function"
],
[
"src/util.cpp::helper",
"function"
],
[
"src/main.cpp::main",
"function"
],
[
"src/other.cpp::twice",
"function"
],
[
"src/other.cpp::orphan",
"function"
],
[
"src/other.cpp::undeclared_caller",
"function"
],
[
"src/overload.cpp::log_value",
"function"
],
[
"src/overload.cpp::log_value",
"function"
],
[
"src/overload.cpp::use_log",
"function"
],
[
"src/legacy.c::add",
"function"
],
[
"src/legacy.c::legacy_sum",
"function"
],
[
"tools/dup.cpp::helper",
"function"
],
[
"include/geo/shape.h::scope=geo::Circle",
"class"
],
[
"src/shape.cpp::scope=geo::Circle::radius",
"function"
],
[
"src/buffer.h::Buffer",
"class"
],
[
"src/buffer.h::Buffer::size",
"function"
]
],
"relationships": [
[
"src/shape.cpp",
"imports",
"include/geo/shape.h"
],
[
"src/util.cpp",
"imports",
"src/util.h"
],
[
"src/main.cpp",
"imports",
"include/geo/shape.h"
],
[
"src/main.cpp",
"imports",
"src/util.h"
],
[
"src/shape.cpp::scope=geo::Shape::area",
"calls",
"src/shape.cpp::scope=geo::Shape::scale"
],
[
"src/shape.cpp::scope=geo::Shape::unit",
"calls",
"src/shape.cpp::scope=geo::Shape::Shape"
],
[
"src/util.cpp::helper",
"calls",
"src/util.cpp::twice"
],
[
"src/main.cpp::main",
"calls",
"src/shape.cpp::scope=geo::Shape::unit"
],
[
"src/main.cpp::main",
"calls",
"src/util.cpp::helper"
],
[
"src/main.cpp::main",
"calls",
"src/shape.cpp::scope=geo::total"
],
[
"src/main.cpp::main",
"calls",
"external:cpp:LOG_TWICE"
],
[
"src/other.cpp::orphan",
"calls",
"src/other.cpp::twice"
],
[
"src/other.cpp::undeclared_caller",
"calls",
"external:cpp:helper"
],
[
"src/overload.cpp::use_log",
"calls",
"external:cpp:log_value"
],
[
"src/legacy.c::legacy_sum",
"calls",
"src/legacy.c::add"
],
[
"src/main.cpp",
"imports",
"src/buffer.h"
],
[
"src/main.cpp",
"imports",
"external:cpp:string"
],
[
"include/geo/shape.h::scope=geo::Circle",
"inherits",
"include/geo/shape.h::scope=geo::Shape"
],
[
"src/shape.cpp::scope=geo::Circle::radius",
"calls",
"src/shape.cpp::scope=geo::Shape::area"
],
[
"src/shape.cpp::scope=geo::total",
"calls",
"src/shape.cpp::scope=geo::Shape::area"
],
[
"src/main.cpp::main",
"calls",
"src/shape.cpp::scope=geo::Shape::counter"
],
[
"src/main.cpp::main",
"calls",
"external:cpp:size"
],
[
"src/main.cpp::main",
"calls",
"external:cpp:size"
],
[
"src/main.cpp::main",
"calls",
"external:cpp:make_buffer"
]
]
}