Skip to content

fix(graph): resolve C++ calls in their enclosing namespaces - #436

Open
DivyamTalwar wants to merge 1 commit into
activeloopai:mainfrom
DivyamTalwar:fix/graph-resolve-calls-within-cpp-namespaces
Open

DivyamTalwar wants to merge 1 commit into
activeloopai:mainfrom
DivyamTalwar:fix/graph-resolve-calls-within-cpp-namespaces

Conversation

@DivyamTalwar

Copy link
Copy Markdown

Summary

Fixes #435.

The C++ call pass resolves the caller through a bare-name lookup even when declaration keys are namespace-qualified. Namespaced calls can be omitted or assigned to another same-named function; nested namespace names also lose their outer qualifier.

Track callers by declaration position and compose full namespace keys consistently. Resolve supported unqualified and namespace-qualified callees against enclosing namespaces, preserve explicit global qualification, and conservatively suppress bare-name edges shadowed by parameters, local declarations or structured bindings. Calls in unrepresented nested callable bodies are not attributed to outer functions.

Version Bump

No release requested. Package versions, dependencies, lockfiles and release workflows are unchanged.

Test plan

  • Repository-native regressions against unchanged production source: 16 failed, 20 controls passed, zero skipped.
  • Corrected focused suites: 36 passed, zero failed or skipped, plus local typechecking.
  • Exact submitted commit 58c5ba9ea086b041b75e5d899b9f2b59a8bc9bf0: independent Node 22/Linux full suite with coverage, 5,873 passed, zero failed, zero skipped. The same job passes typecheck, production build, duplication guard, critical-only bundle audit and diff checks.

Exact checkout, commands, full-suite results and retained logs. Each branch was validated independently. Tests use synthetic code/transcripts and isolated filesystem fixtures, not live model calls or user data.

Compatibility and limits

This remains syntactic intra-file analysis, not a C++ compiler or general overload/type resolver. Overloads still share the pre-existing node identity. Inline class methods, namespace aliases, using-based resolution and full class lookup are not newly supported. The local-name suppression is intentionally conservative across the whole function, so some valid calls may remain unresolved. Nested namespace node IDs change to include their complete namespace path.

The current open-PR file inventory and issue titles were checked before submission. A clean full macOS suite or native Windows execution is not claimed. The independent gate does not replace upstream CI or maintainer review.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: activeloopai/hivemind/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5055e1c3-dc93-4379-ac06-eab86bc8a6b4

📥 Commits

Reviewing files that changed from the base of the PR and between ce30de7 and 58c5ba9.

📒 Files selected for processing (2)
  • src/graph/extract/cpp.ts
  • tests/shared/graph/cpp.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

C++ namespace calls lose or misattribute their enclosing declaration identities

1 participant