Skip to content

Commit 1d068c9

Browse files
committed
gather: deterministic context-pack tool (aft_gather)
One call assembles a bounded context pack — ranked, deduped, budgeted verbatim code evidence — replacing the serial search → outline → zoom → callgraph read chain. - Two modes (XOR): question (seeds via handle_semantic_search, same pipeline as aft_search) or symbol+filePath (callgraph impact depth-1 callers + call_tree depth-1 callees) - 1-hop neighbor expansion; dedupe by canonicalized (file, symbol), seeds win - Hard line budget (default 400, cap 800) via render_symbol_within_budget; over-budget candidates emit as visible stubs — nothing silently dropped - Grep-fallback hits resolve to their containing symbol by line containment; no-symbol hits stay visible stubs - Semantic-index-building degradation flagged in the pack header (semantic_status), suppressed when any symbol-level seed resolves - Unresolved external callees collapse to one summary line; unresolved seeds/callers never suppressed - Follows the tri-state honest-reporting convention (protocol.rs Response doc-comment) - 22 unit tests incl. red-checked regressions; no new dependencies, no LLM calls, no caching
1 parent 40e6dcf commit 1d068c9

7 files changed

Lines changed: 1617 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ AFT is **1 of the 3 plugins you'll ever need.** It perceives and acts; Magic Con
9494
- **`aft_search`**: find code by *meaning* when grep keywords fall short. Hybrid semantic + lexical retrieval over an indexed codebase, with local, OpenAI-compatible, or Ollama embedding backends.
9595
- **`aft_callgraph`**: follow callers, callees, data flow, impact analysis, and the shortest call path between two symbols across the workspace.
9696
- **`aft_inspect`**: a one-call codebase-health report covering LSP errors and warnings, TODOs, metrics, dead code, unused exports, and duplicates. The Problems and inspections panels an IDE keeps open, on demand.
97+
- **`aft_gather`**: assemble a bounded context pack — ranked, deduped, budgeted verbatim code evidence — in one call instead of a serial `search → outline → zoom → callgraph` chain. Seed from a `question` (semantic) or a `symbol`+`filePath` (callgraph), expand one hop, render within a hard line budget.
9798
- **`grep` / `glob`**: trigram-indexed regex search and file discovery, built in the background, persisted to disk, and kept fresh by a file watcher.
9899

99100
---

0 commit comments

Comments
 (0)