Summary
Once the trace MCP tool is proven in production, reuse its engine to add a java-codebase-rag trace CLI command and deprecate the legacy find_callers/find_callees methods in kuzu_queries.py.
Background
find_callers and find_callees in kuzu_queries.py already implement multi-hop BFS with depth, confidence filtering, and module/microservice scoping. They serve the CLI (java-codebase-rag commands), not the MCP surface. The new trace engine (from PR #234) is strictly more capable: it adds role-based pruning, fan-out throttling, trivial chain collapsing, cross-service seamless traversal, and structured path output.
Plan
Phase 1: Add trace CLI command
Add a java-codebase-rag trace subcommand that reuses the mcp_trace.py engine:
java-codebase-rag trace --from <fqn-or-id> --direction out --edge-types CALLS --max-depth 3
Output: text/JSON rendering of TraceOutput (same structure as MCP tool result).
This gives CLI users the same pruning and path-structuring benefits that MCP users get.
Phase 2: Deprecate find_callers/find_callees
- Mark
KuzuGraph.find_callers and KuzuGraph.find_callees as deprecated with a warnings.warn(DeprecationWarning).
- Update any CLI subcommands that use them to use the new
trace engine instead.
- Update
docs/JAVA-CODEBASE-RAG-CLI.md to recommend trace over the legacy commands.
Phase 3: Remove legacy methods
- Remove
find_callers and find_callees from kuzu_queries.py.
- Remove the
CallEdge dataclass if no longer needed.
- Clean up any tests that test only the legacy path.
Acceptance criteria
Dependencies
Summary
Once the
traceMCP tool is proven in production, reuse its engine to add ajava-codebase-rag traceCLI command and deprecate the legacyfind_callers/find_calleesmethods inkuzu_queries.py.Background
find_callersandfind_calleesinkuzu_queries.pyalready implement multi-hop BFS with depth, confidence filtering, and module/microservice scoping. They serve the CLI (java-codebase-ragcommands), not the MCP surface. The newtraceengine (from PR #234) is strictly more capable: it adds role-based pruning, fan-out throttling, trivial chain collapsing, cross-service seamless traversal, and structured path output.Plan
Phase 1: Add
traceCLI commandAdd a
java-codebase-rag tracesubcommand that reuses themcp_trace.pyengine:Output: text/JSON rendering of
TraceOutput(same structure as MCP tool result).This gives CLI users the same pruning and path-structuring benefits that MCP users get.
Phase 2: Deprecate
find_callers/find_calleesKuzuGraph.find_callersandKuzuGraph.find_calleesas deprecated with awarnings.warn(DeprecationWarning).traceengine instead.docs/JAVA-CODEBASE-RAG-CLI.mdto recommendtraceover the legacy commands.Phase 3: Remove legacy methods
find_callersandfind_calleesfromkuzu_queries.py.CallEdgedataclass if no longer needed.Acceptance criteria
java-codebase-rag tracecommand works with all pruning parametersfind_callers/find_calleesis preserved via the trace enginefind_callers/find_calleesemitDeprecationWarningbefore removalDependencies
traceMCP tool v1 to be shipped (PR propose: trace tool — multi-hop navigation shortcut #234)mcp_trace.pyto have a clean public API reusable by CLI