feat(group): add cross-repo call trace with pluggable SymbolResolver#1583
feat(group): add cross-repo call trace with pluggable SymbolResolver#1583hongtewu-dotcom wants to merge 4 commits into
Conversation
|
Someone is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
bcdc475 to
f7f93e0
Compare
|
Can you please benchmark the performance of the graph queries? 🙏 |
9b2df3b to
bcdc475
Compare
|
Thanks for the request! I've added scripts/bench-group-trace.ts — a Tested against a real indexed group of 83 repos.
┌─────────────────────────────────────────────────────┬──────────┐ The warm stddev (±611 ms) reflects occasional LRU eviction in the lbug
┌───────────────┬──────────┬────────────────────┐ The jump from depth 1 (517 ms, 159 hops) to depth 2 (8 s, 1925 hops) is The default cap (maxCrossDepth=5) is intentionally conservative; MCP callers
┌────────────────────────┬─────────┬─────────┬─────────┬────────────┐ Performance scales with cross-hops visited, not group size — a shallow entry Run it yourself: |
|
Claude finished @magyargergo's task in 6m 29s —— View job Production-Readiness Review: PR #1583
|
| Lane | Status | Blocks Merge |
|---|---|---|
| A — Trace engine | Broken (missing Meituan resolver, unlimited default depth) | Yes |
| B — CLI contract | Issues (NaN/negative depth, stats inconsistency) | Yes |
| C — MCP/service schema | Issues (params as any, doc mismatch, no contract test) |
Maybe |
| D — MyBatis ingestion | Wrong PR (unrelated domain, regex gaps) | Yes |
| E — CI/validation | Not run (fork PR, 0 checks) | Yes |
| F — Hygiene | Mixed (no bidi Unicode ✓, merge commit present, dual domain) | Yes |
Final Verdict
not production-ready
The PR has three independent blockers, any one of which would prevent merge:
-
trace-resolver-meituan.tsdoes not exist. Both the MCPgroup_tracetool and the CLIgroup tracecommand route throughrunGroupTrace()which dynamically imports this missing module. Every production call will throwMODULE_NOT_FOUND. The feature is entirely non-functional as shipped, and the unit tests that appear to validate it are also broken for the same reason. -
CI has not run. A PR touching the ingestion pipeline, MCP tool layer, group service, and CLI output contract must pass TypeScript typecheck, unit tests, and integration tests on the current head SHA before merge. GitHub currently shows zero checks.
-
MyBatis ORM ingestion is a separate production domain with no demonstrated causal connection to group_trace. It should be split into its own PR where it can be reviewed on its own risk profile, tested independently, and reverted independently if necessary.
Beyond these blockers, the default maxDepth=0 (unlimited intra-repo BFS) and unvalidated CLI numeric inputs for maxCrossDepth create resource-exhaustion risks for real multi-repo codebases that must be addressed before this ships to production MCP users.
✨ PR AutofixFound fixable formatting / unused-import issues across 1258 changed lines. Comment |
| // Strip CDATA wrapper | ||
| const clean = sql.replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); | ||
| // Strip XML comments | ||
| const noComments = clean.replace(/<!--[\s\S]*?-->/g, ''); |
| .join('\n'); | ||
|
|
||
| fs.writeFileSync( | ||
| path.join(groupDir, 'group.yaml'), |
| contracts: any[] = [], | ||
| ): void { | ||
| fs.writeFileSync( | ||
| path.join(groupDir, 'contracts.json'), |
| try { | ||
| writeContractsJson(groupDir); // empty crossLinks | ||
|
|
||
| const { executeParameterized, executeQuery } = await import( |
| }, | ||
| ]); | ||
|
|
||
| const { executeParameterized, executeQuery } = await import( |
| try { | ||
| writeContractsJson(groupDir); | ||
|
|
||
| const { executeParameterized, executeQuery } = await import( |
6d96056 to
f5d7857
Compare
4d106d6 to
ed3c89e
Compare
- trace.ts: BFS engine across repos via CALLS edges + contracts.json crossLinks. Pluggable SymbolResolver interface; DefaultSymbolResolver as reference implementation. runGroupTrace uses DefaultSymbolResolver; runGroupTraceWithResolver accepts any resolver. - trace-resolver.ts: SymbolResolver interface + DefaultSymbolResolver (generic, no framework-specific logic). Subclass to add custom symbol resolution. - service.ts: groupTrace() with typed TraceParams construction, NaN guards, depth clamping (maxCrossDepth cap 50). Slim MCP response by default; verbose flag for full data. - cli/group.ts: group trace subcommand with NaN-safe parseInt, negative-value guards. - tools.ts: group_trace MCP tool with complete schema (relationTypes, maxCrossDepth max 50). - local-backend.ts: route group_trace to GroupService.
- Use fs.mkdtempSync for secure temp directory creation (CWE-377) - Remove unused executeQuery destructuring (3 instances)
ed3c89e to
4e239e1
Compare
|
Hi @magyargergo , the CodeQL findings have been addressed:
The branch has also been rebased onto main to remove the merge commit. Could you approve the workflow run so CI can verify the fixes? Thanks! |
Adds group_trace as a first-class MCP tool and introduces the SymbolResolver interface to keep the BFS engine framework-agnostic.
What's included
Core: cross-repo BFS trace engine (src/core/group/trace.ts)
MCP tool (src/mcp/tools.ts, src/mcp/local/local-backend.ts)
Tests (test/unit/group/trace.test.ts)
Summary
Motivation / context
Areas touched
gitnexus/(CLI / core / MCP server)gitnexus-web/(Vite / React UI).github/(workflows, actions)eval/or other toolingAGENTS.md,CLAUDE.md,.cursor/,llms.txt, etc.)Scope & constraints
In scope
Explicitly out of scope / not done here
Implementation notes
Testing & verification
cd gitnexus && npm testcd gitnexus && npm run test:integration(if core/indexing/MCP paths changed)cd gitnexus && npx tsc --noEmitcd gitnexus-web && npm test(if web changed)cd gitnexus-web && npx tsc -b --noEmit(if web changed)gitnexus-web/e2e/)Risk & rollout
Checklist
AGENTS.md/ overlays changed: headers, scope block, and changelog updated per project conventions