feat: add brick_callers and brick_uncalled caller-status queries #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/caller-status"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Agents asking "is this function used?" only had a bare zero in-degree, which conflates "nothing calls it" with "Brick could not resolve its callers" — and Brick resolves a minority of call sites on large C++ repositories.
Solution
Two read-only MCP queries over validated schema-4 models (
src/callers.rs,src/mcp.rs):brick_callers— per function:resolved(a resolved caller edge exists),unknown(no resolved caller, but the model records why one may exist: same-name unresolved call sites, name references, virtual/trait-impl/external-base members, framework attributes, implicit invocation, entry points, test code, incomplete parses, and — unlessassume_closed_world— exported or external-linkage functions), orunreferenced(a review candidate with an explicitheuristic/compilerbasis, never a dead-code proof). Returns complete nodes/edges plusmetrics.resolutioncoverage and a fixed caveat.brick_uncalled— per-language status counts and orderedunreferenced(optionallyunknown) reports, with a limit.Plus
docs/research/cpp-rust-resolution.md(audit, literature rationale, experiment contract, labelled-corpus results, cross-tool coverage and dead-code spot checks, remaining limits) and the contract indocs/architecture/mcp.md.Tests
tests/callers.rs(new) and the MCP CLI / benchmark runner updates.main(after #5): clean merge,cargo test117 passed, 0 failed.Merge order
Merge this before #6 (README split): #6 will then be updated to link
docs/research/cpp-rust-resolution.mdand to count six MCP tools instead of four.The commits were written with Claude (see their Co-Authored-By trailers); this PR was opened by Claude at the maintainer's direction.