CodeCompass: 在代理代码智能中导航悖论的探索
CodeCompass: Navigating the Navigation Paradox in Agentic Code Intelligence
AI总结:
CodeCompass通过基于图的结构导航提升代码智能代理在隐藏依赖任务中的性能,揭示导航与检索本质不同,需显式引导代理利用结构上下文。
摘要:
现代代码智能代理在超过100万个标记的上下文中运行——远超人类手动查找相关文件的规模。然而,代理在解决现实世界编码任务时始终无法发现架构上关键的文件。我们识别出导航悖论:代理表现不佳并非由于上下文限制,而是因为导航和检索本质上是两个不同的问题。通过在生产FastAPI仓库上30个基准任务中的258次自动化试验,我们证明了通过CodeCompass——一个暴露依赖图的模型上下文协议服务器进行的基于图的结构导航,在隐藏依赖任务上实现了99.4%的任务完成率,比普通代理(76.2%)高出23.2个百分点,比BM25检索(78.2%)高出21.2个百分点。然而,我们发现了一个关键的采用差距:拥有图访问权限的58%的试验没有做出任何工具调用,且代理需要显式提示工程才能一致采用该工具。我们的发现揭示出瓶颈不是工具可用性,而是行为一致性——代理必须被明确引导以利用结构上下文而非词法启发式方法。我们贡献了:(1)一种任务分类法,区分语义搜索、结构和隐藏依赖场景;(2)实证证据表明当依赖关系缺乏词法重叠时,图导航优于检索;(3)用于可重复评估导航工具的开源基础设施。
英文摘要:
Modern code intelligence agents operate in contexts exceeding 1 million tokens--far beyond the scale where humans manually locate relevant files. Yet agents consistently fail to discover architecturally critical files when solving real-world coding tasks. We identify the Navigation Paradox: agents perform poorly not due to context limits, but because navigation and retrieval are fundamentally distinct problems. Through 258 automated trials across 30 benchmark tasks on a production FastAPI repository, we demonstrate that graph-based structural navigation via CodeCompass--a Model Context Protocol server exposing dependency graphs--achieves 99.4% task completion on hidden-dependency tasks, a 23.2 percentage-point improvement over vanilla agents (76.2%) and 21.2 points over BM25 retrieval (78.2%).However, we uncover a critical adoption gap: 58% of trials with graph access made zero tool calls, and agents required explicit prompt engineering to adopt the tool consistently. Our findings reveal that the bottleneck is not tool availability but behavioral alignment--agents must be explicitly guided to leverage structural context over lexical heuristics. We contribute: (1) a task taxonomy distinguishing semantic-search, structural, and hidden-dependency scenarios; (2) empirical evidence that graph navigation outperforms retrieval when dependencies lack lexical overlap; and (3) open-source infrastructure for reproducible evaluation of navigation tools.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。