Skip to content

ast-bro v3.0.0

Latest

Choose a tag to compare

@aeroxy aeroxy released this 13 Jun 15:28

1. High-Level Summary (TL;DR)

  • Impact: High - Introduces major new features (context and impact tools), enhances graph traversal filtering, and refactors prompt handling across all agent installers.
  • Key Changes:
    • Impact Analysis: Added the impact command/tool to view a symbol's blast radius in a single shot (combining callers, callees, reverse-deps, and tests).
    • Context Builder: Added the context command/tool to fetch token-budgeted relevant code for an LLM agent, utilizing a greedy knapsack algorithm.
    • 🔍 Advanced Filtering: Added --tests and --exclude-tests for dependency and call graph filtering.
    • 🔄 Default Behavior Flip: External and ambiguous calls are now shown by default; introduced --hide-external and --hide-ambiguous flags to opt-out.
    • 🛠️ Prompt Refactoring: Centralized prompt configuration in skills/ast-bro/SKILL.md and updated all installers to load it dynamically.

2. Visual Overview (Code & Logic Map)

Impact and Context Analysis-2026-06-13-152726

3. Detailed Change Analysis

✨ New Core Modules (context.rs, impact.rs)

  • Context Module: Collects the target body, direct callees, direct callers, and reverse deps, stopping when the --budget token limit is hit. This allows an LLM to gather everything needed for a task in a single API call without breaking context windows.
  • Impact Module: Executes four modes (deps, dependents, tests, all) to show exactly what a change to a symbol will break, revealing the full transitive impact.

⚙️ CLI and API Interface Changes

The CLI and MCP interfaces have been expanded, and their flag defaults have been adjusted to favor maximum visibility out-of-the-box.

Scope Old Flag New Flag Reason
deps, graph, callees --include-external / --external --hide-external Unresolved external calls/imports are now shown by default. The new flag drops them.
callers --include-ambiguous --hide-ambiguous Ambiguous matches are now shown by default. The new flag hides them.
callers, reverse-deps, impact N/A --tests, --exclude-tests Added path-heuristic filtering to isolate or exclude test files.

🛠️ Code Structure & Traversal Enhancements

  • Traversal BFS: Upgraded bfs() in both src/calls/traverse.rs and src/deps/traverse.rs to accept a generic predicate closure. This powers the new --tests and --exclude-tests runtime filtering.
  • Root Resolution: The find_root_for method was extracted from the deps CLI module into a global helper in src/project_root.rs.
  • Graph Extensions: Added the Implement variant to CallKindCompat (Source: src/calls/graph.rs).

📝 Prompt Management

  • What Changed: Replaced the static AGENT_PROMPT constant string with a dynamically loaded function agent_prompt().
  • Source of Truth: Prompt configuration is now read from skills/ast-bro/SKILL.md at compile time via include_str!, and strips the YAML frontmatter at runtime (Source: src/prompt.rs).
  • Installers Updated: All integrations (aider.rs, claude_code.rs, cursor.rs, etc.) use the new function.
Refactoring Original New
Root Resolution src/deps/cli.rs:find_root_for src/project_root.rs:find_root_for
Prompt Loading src/prompt.rs:AGENT_PROMPT src/prompt.rs:agent_prompt()

4. Impact & Risk Assessment

  • ⚠️ Breaking Changes:
    • The visibility defaults have flipped. Scripts or API integrations expecting ambiguous/external calls to be hidden by default must now explicitly pass --hide-external and --hide-ambiguous.
    • The removal of the public AGENT_PROMPT constant will break any external Rust crate referencing it.