Feat/v2.1.0 agent native - #138
Conversation
…ion across all parsers Core correctness fixes for production accuracy: 1. **Name collision (JS/TS)**: Dropped all dotted method calls (obj.method()) from call references — requires type inference we don't have. Only unqualified calls (foo()) and this./super. method calls are recorded. Eliminates push (590), add (391), set (381), get (351), join (333), trim (329) as false top-centrality nodes in webpack analysis. 2. **Stack overflow**: Added stacker::maybe_grow to extract_from_node in ALL parsers (typescript, python, rust, go, java, c, cpp, csharp, dart). Converted all collect_calls implementations from recursive to iterative TreeCursor traversal, eliminating call stack usage entirely. TypeScript compiler (20k files, 54k-line checker.ts) no longer crashes. 3. **Import node pollution**: Import/import-from nodes are no longer added to the graph as vertices. They are processed for import map data but excluded from centrality ranking. Eliminates psycopg.types.range [Import] 330 callers false positive; Django #1 is now correctly reverse (833 callers). 4. **Import-aware edge resolution**: Builder now builds a per-file import map from Import node references. Cross-file edges where the caller's file has explicit imports but does NOT import the callee's name (and callee is in a different directory) are dropped — prevents cross-module false positives. 5. **Python import extraction**: from X import Y now stores Y as a reference on the Import node, enabling the import map to know exactly which names each file pulls in. All 58 arbor-core tests and 78 arbor-graph tests pass.
1. **Test-file-aware PageRank** (ranking.rs):
Callers from test/spec/fixture/mock files contribute 10% weight instead
of 100% in PageRank iterations. Prevents utility functions called heavily
by test suites from false-inflating their centrality scores vs. functions
on real production paths. Impact: better signal-to-noise in blast radius
for all repos with test directories.
2. **Entry point detection heuristics** (heuristics.rs):
New `is_likely_entry_point()` method on HeuristicsMatcher detects:
- main() functions (all languages)
- HTTP route handlers (view/handler/controller/endpoint suffix/prefix,
constrained to routes/views/api/handler files to reduce false positives)
- Webhook and event receivers (webhook/receive/subscribe/on_/handle*)
- Background jobs and workers (job/task/worker/cron, constrained to
job/task/worker/celery/sidekiq/background files)
- CLI command handlers (command/cmd/cli/invoke)
Drop RELEASE_NOTES v1.4.0–v1.7.0 (superseded by v1.8.0 and v2.0.1). Remove docs/releases/v1.8.0.1/ hotfix log — no longer load-bearing.
Arbor Graph Impact ReportBlast Radius: High-centrality nodes affected? �[2m2026-05-05T09:38:07.845214Z�[0m �[32m INFO�[0m Starting index of /home/runner/work/arbor/arbor Modified files: Impact: Powered by Arbor — semantic code graph engine. |
ed860b9 to
faafce3
Compare
Arbor Graph Impact ReportBlast Radius: High-centrality nodes affected? �[2m2026-05-05T09:40:53.207289Z�[0m �[32m INFO�[0m Starting index of /home/runner/work/arbor/arbor Modified files: Impact: Powered by Arbor — semantic code graph engine. |
There was a problem hiding this comment.
Pull request overview
This PR expands Arbor’s MCP surface with new “agent-native” query tools, adjusts graph/parser behavior to support those tools, and also rewrites some automation/docs around release and PR-bot workflows. It fits into the codebase as an extension of Arbor’s graph querying and agent integration layer.
Changes:
- Added 6 new MCP tools plus JSON envelope helpers and tests in
arbor-mcp. - Updated graph/parser internals for entry-point detection, file-graph queries, import-aware edge building, and deeper-parser stack handling.
- Reworked docs and GitHub automation, including the PR bot workflow and composite action.
Reviewed changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/ROADMAP.md | Updates roadmap text and marks v2.1.0 MCP work as shipped. |
| docs/releases/v1.8.0.1/HOTFIX.md | Removes old v1.8.0.1 hotfix instructions. |
| docs/releases/v1.8.0.1/COMPLETE.md | Removes old v1.8.0.1 completion note. |
| docs/RELEASE_NOTES_v1.7.0.md | Removes old v1.7.0 release notes. |
| docs/RELEASE_NOTES_v1.6.2.md | Removes old v1.6.2 release notes. |
| docs/RELEASE_NOTES_v1.6.1.1.md | Removes old v1.6.1.1 release notes. |
| docs/RELEASE_NOTES_v1.6.0.md | Removes old v1.6.0 release notes. |
| docs/RELEASE_NOTES_v1.4.0.md | Removes old v1.4.0 release notes. |
| crates/arbor-mcp/src/lib.rs | Adds new MCP tools, envelopes, and tests; changes analyze_impact schema/output behavior. |
| crates/arbor-graph/src/ranking.rs | Changes centrality scoring to down-weight test callers. |
| crates/arbor-graph/src/heuristics.rs | Adds entry-point detection heuristic. |
| crates/arbor-graph/src/graph.rs | Adds entry-point listing and per-file graph queries with tests. |
| crates/arbor-graph/src/builder.rs | Adds import-map handling and import-aware edge filtering. |
| crates/arbor-core/src/parser_v2.rs | Tightens parser error handling and simplifies query extraction paths. |
| crates/arbor-core/src/languages/typescript.rs | Adds stack growth guard, import metadata extraction, and iterative call collection. |
| crates/arbor-core/src/languages/rust.rs | Adds stack growth guard and iterative call collection. |
| crates/arbor-core/src/languages/python.rs | Adds stack growth guard, richer from ... import extraction, and iterative call collection. |
| crates/arbor-core/src/languages/java.rs | Adds stack growth guard and iterative call collection. |
| crates/arbor-core/src/languages/go.rs | Adds stack growth guard and iterative call collection. |
| crates/arbor-core/src/languages/dart.rs | Adds stack growth guard and narrows collected call references. |
| crates/arbor-core/src/languages/csharp.rs | Adds stack growth guard and narrows collected member-call references. |
| crates/arbor-core/src/languages/cpp.rs | Adds stack growth guard and iterative call collection. |
| crates/arbor-core/src/languages/c.rs | Adds stack growth guard and iterative call collection. |
| crates/arbor-core/Cargo.toml | Adds stacker dependency. |
| CLAUDE.md | Adds contributor/agent guidance and architecture notes. |
| Cargo.toml | Expands workspace exclude list. |
| Cargo.lock | Locks new stacker dependency tree. |
| action.yml | Simplifies composite action command behavior. |
| .gitignore | Replaces ignored Lattice DB path with .worktrees/. |
| .github/workflows/arbor-pr-bot.yml | Reworks PR bot to build/install locally and post captured diff output. |
| .github/copilot-instructions.md | Replaces prior concise release checklist with a large scaffold/customization checklist. |
| run: cargo install --path crates/arbor-cli --force | ||
|
|
||
| - name: Run Arbor diff and capture report | ||
| shell: bash |
| "node_id": { "type": "string", "description": "ID or name of the node to analyze" }, | ||
| "max_depth": { "type": "integer", "description": "Maximum hop distance (default: 5, 0 = unlimited)", "default": 5 }, | ||
| "format": { "type": "string", "description": "Output format: json (default) or markdown for PR comment table", "enum": ["json", "markdown"], "default": "json" } | ||
| "max_depth": { "type": "integer", "description": "Maximum hop distance (default: 5, 0 = unlimited)", "default": 5 } |
| // Test callers contribute 10% weight — they inflate utility functions | ||
| // but don't represent real production blast radius | ||
| let caller_node = graph.get(caller_idx)?; | ||
| let weight = if is_test_file(&caller_node.file) { 0.1 } else { 1.0 }; | ||
|
|
||
| Some(weight * caller_score / caller_out) |
| let next_symbol = entries.first() | ||
| .and_then(|e| e["name"].as_str()) | ||
| .unwrap_or("") | ||
| .to_string(); | ||
| let (next_tool, next_args) = if count > 0 { | ||
| ("analyze_impact", json!({ "node_id": next_symbol })) |
| Ok(Self::ok_envelope( | ||
| "get_callers", | ||
| json!({ "symbol": symbol, "callers": items }), | ||
| count, | ||
| if count > 0 { "analyze_impact" } else { "search_symbols" }, | ||
| if count > 0 { json!({ "node_id": symbol }) } else { json!({ "query": symbol }) }, |
…ested_next_tool - Add ok_envelope/err_envelope private helpers for consistent structured responses - Add list_entry_points tool: surfaces HTTP handlers, main(), webhooks, jobs, CLI - Add get_callers tool: one-hop upstream traversal with not-found error envelope - Add get_callees tool: one-hop downstream traversal with not-found error envelope - Add search_symbols tool: fuzzy symbol search with configurable limit - Add get_file_graph tool: per-file node+edge subgraph - Add get_node_detail tool: full node metadata including role, centrality, entry-point flag - All new tools emit suggested_next_tool/suggested_next_args for agent chaining - 7 new TDD tests covering envelope shape, error paths, and unknown tool rejection
…ve empty-result suggestion, add cross-file edge test
Arbor Graph Impact ReportBlast Radius: High-centrality nodes affected? 2026-05-05T09:50:34.808689Z INFO Starting index of /home/runner/work/arbor/arbor Modified files: Impact: Powered by Arbor — semantic code graph engine. |
- action.yml: remove mock hardcoded impact report in analyze-impact handler; the action now always runs the real arbor binary - arbor-pr-bot.yml: replace non-existent analyze-impact subcommand with real arbor diff invocation; fix hardcoded wrong repo URL (github.com/arbor/arbor -> dynamic context.repo owner/repo)
MCP routing hints now use node id (not display name) for deterministic agent chaining. get_callers/get_callees resolve canonical id before passing to suggested_next_args. PR bot: set ARBOR_DIFF_BASE/HEAD to PR SHAs and strip ANSI codes so the comment shows clean text rather than escape sequences with 0 callers.
ade5a66 to
acd4a33
Compare
Arbor Graph Impact ReportBlast Radius: High-centrality nodes affected? 2026-05-05T09:52:46.032945Z INFO Starting index of /home/runner/work/arbor/arbor Modified files: Impact: Powered by Arbor — semantic code graph engine. |
Description
Brief description of what this PR does. Link any related issues.
Fixes #(issue number)
Type of Change
Changes Made
Testing
Describe how you tested your changes:
cargo test --allcargo clippy --allflutter test(if applicable)Screenshots (if applicable)
For visualizer changes, include before/after screenshots.
Checklist