Skip to content

Feat/v2.1.0 agent native - #138

Merged
Anandb71 merged 14 commits into
mainfrom
feat/v2.1.0-agent-native
May 5, 2026
Merged

Feat/v2.1.0 agent native#138
Anandb71 merged 14 commits into
mainfrom
feat/v2.1.0-agent-native

Conversation

@Anandb71

@Anandb71 Anandb71 commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Brief description of what this PR does. Link any related issues.

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Code refactoring

Changes Made

  • List the key changes made in this PR
  • Be specific about files/modules affected

Testing

Describe how you tested your changes:

  • Ran cargo test --all
  • Ran cargo clippy --all
  • Ran flutter test (if applicable)
  • Tested manually with a real codebase

Screenshots (if applicable)

For visualizer changes, include before/after screenshots.

Checklist

  • My code follows the project's style guidelines
  • I have added tests for my changes
  • I have updated the documentation where necessary
  • All new and existing tests pass
  • I have added appropriate comments where the code isn't self-explanatory

…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.
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Arbor Graph Impact Report

Blast Radius: High-centrality nodes affected?

�[2m2026-05-05T09:38:07.845214Z�[0m �[32m INFO�[0m Starting index of /home/runner/work/arbor/arbor
�[2m2026-05-05T09:38:08.023160Z�[0m �[32m INFO�[0m Indexed 103 files, 0 cache hits (1577 nodes) in 177.952344ms
Change Impact Preview

Modified files:
• arbor-impact.md

Impact:
• 0 direct callers
• 0 indirect callers
• 0 API entrypoints affected
• 0 files likely require updates
• 0 impacted nodes total
• 0 changed symbols resolved

Powered by Arbor — semantic code graph engine.

@Anandb71
Anandb71 force-pushed the feat/v2.1.0-agent-native branch from ed860b9 to faafce3 Compare May 5, 2026 09:39
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Arbor Graph Impact Report

Blast Radius: High-centrality nodes affected?

�[2m2026-05-05T09:40:53.207289Z�[0m �[32m INFO�[0m Starting index of /home/runner/work/arbor/arbor
�[2m2026-05-05T09:40:53.385327Z�[0m �[32m INFO�[0m Indexed 103 files, 0 cache hits (1577 nodes) in 178.044832ms
Change Impact Preview

Modified files:
• arbor-impact.md

Impact:
• 0 direct callers
• 0 indirect callers
• 0 API entrypoints affected
• 0 files likely require updates
• 0 impacted nodes total
• 0 changed symbols resolved

Powered by Arbor — semantic code graph engine.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }
Comment on lines +101 to +106
// 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)
Comment thread crates/arbor-mcp/src/lib.rs Outdated
Comment on lines +519 to +524
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 }))
Comment thread crates/arbor-mcp/src/lib.rs Outdated
Comment on lines +553 to +558
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 }) },
Anandb71 added 4 commits May 5, 2026 15:20
…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
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Arbor Graph Impact Report

Blast Radius: High-centrality nodes affected?

2026-05-05T09:50:34.808689Z INFO Starting index of /home/runner/work/arbor/arbor
2026-05-05T09:50:34.810148Z WARN Failed to parse /home/runner/work/arbor/arbor/arbor-impact.md: file is empty: '/home/runner/work/arbor/arbor/arbor-impact.md'
2026-05-05T09:50:34.980789Z INFO Indexed 102 files, 0 cache hits (1577 nodes) in 172.104987ms
Change Impact Preview

Modified files:
• .github/copilot-instructions.md
• .github/workflows/arbor-pr-bot.yml
• .gitignore
• CLAUDE.md
• Cargo.lock
• Cargo.toml
• action.yml
• crates/arbor-core/Cargo.toml
• crates/arbor-core/src/languages/c.rs
• crates/arbor-core/src/languages/cpp.rs
• crates/arbor-core/src/languages/csharp.rs
• crates/arbor-core/src/languages/dart.rs
• crates/arbor-core/src/languages/go.rs
• crates/arbor-core/src/languages/java.rs
• crates/arbor-core/src/languages/python.rs
• crates/arbor-core/src/languages/rust.rs
• crates/arbor-core/src/languages/typescript.rs
• crates/arbor-core/src/parser_v2.rs
• crates/arbor-graph/src/builder.rs
• crates/arbor-graph/src/graph.rs
• crates/arbor-graph/src/heuristics.rs
• crates/arbor-graph/src/ranking.rs
• crates/arbor-mcp/src/lib.rs
• docs/ROADMAP.md

Impact:
• 138 direct callers
• 32 indirect callers
• 86 API entrypoints affected
• 3 files likely require updates
• 151 impacted nodes total
• 391 changed symbols resolved

Powered by Arbor — semantic code graph engine.

Anandb71 added 4 commits May 5, 2026 15:20
- 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.
@Anandb71
Anandb71 force-pushed the feat/v2.1.0-agent-native branch from ade5a66 to acd4a33 Compare May 5, 2026 09:50
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Arbor Graph Impact Report

Blast Radius: High-centrality nodes affected?

2026-05-05T09:52:46.032945Z INFO Starting index of /home/runner/work/arbor/arbor
2026-05-05T09:52:46.034464Z WARN Failed to parse /home/runner/work/arbor/arbor/arbor-impact.md: file is empty: '/home/runner/work/arbor/arbor/arbor-impact.md'
2026-05-05T09:52:46.205043Z INFO Indexed 104 files, 0 cache hits (1596 nodes) in 172.104609ms
Change Impact Preview

Modified files:
• .github/copilot-instructions.md
• .github/workflows/arbor-pr-bot.yml
• .gitignore
• CLAUDE.md
• Cargo.lock
• Cargo.toml
• action.yml
• crates/arbor-core/Cargo.toml
• crates/arbor-core/src/languages/c.rs
• crates/arbor-core/src/languages/cpp.rs
• crates/arbor-core/src/languages/csharp.rs
• crates/arbor-core/src/languages/dart.rs
• crates/arbor-core/src/languages/go.rs
• crates/arbor-core/src/languages/java.rs
• crates/arbor-core/src/languages/python.rs
• crates/arbor-core/src/languages/rust.rs
• crates/arbor-core/src/languages/typescript.rs
• crates/arbor-core/src/parser_v2.rs
• crates/arbor-graph/src/builder.rs
• crates/arbor-graph/src/graph.rs
• crates/arbor-graph/src/heuristics.rs
• crates/arbor-graph/src/ranking.rs
• crates/arbor-mcp/src/lib.rs
• docs/ROADMAP.md
• docs/superpowers/plans/2026-05-05-v2.1.0-agent-native.md
• docs/superpowers/specs/2026-05-05-v2.1.0-agent-native-design.md

Impact:
• 138 direct callers
• 32 indirect callers
• 86 API entrypoints affected
• 3 files likely require updates
• 151 impacted nodes total
• 410 changed symbols resolved

Powered by Arbor — semantic code graph engine.

@Anandb71
Anandb71 merged commit 1c9ae7b into main May 5, 2026
6 checks passed
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.

2 participants