arXiv:2604.13108cs.SEcs.AI2026-04

用结构化架构描述降低代码搜索开销,提升AI编程代理效率。

Formal Architecture Descriptors as Navigation Primitives for AI Coding Agents

  • 用S-expression、JSON等格式的架构描述引导代理导航,减少33%-44%操作步骤。
  • 自动生成的描述可实现100%定位准确率,比盲目搜索高20个百分点。
  • 推荐使用S-expression格式,能全面检测结构错误,避免数据损坏。

AI编程代理在无目的的代码库探索中消耗了大量工具调用。本文通过三项互补研究验证:第一项受控实验(24个代码定位任务×4种条件,Claude Sonnet 4.6,temperature=0)表明,提供架构上下文可使导航步骤减少33%-44%(Wilcoxon p=0.009,Cohen's d=0.92),且S-expression、JSON、YAML、Markdown四种格式效果无显著差异;第二项“产物-过程”实验(15个任务×3种条件)显示,自动生成的描述实现100%准确率,优于盲搜的80%(p=0.002,d=1.04),证明其独立导航价值;第三项对7,012次Claude Code会话的观察研究发现,代理行为方差降低52%。写入端实验(96次生成运行,96次错误注入)揭示:JSON错误原子性失败,YAML在50%情况下静默破坏数据,而S-expression能检测所有结构性完整性错误。本文提出intent.lisp架构描述格式,并开源Forge工具包。

原文摘要 · Abstract (English)

AI coding agents spend a substantial fraction of their tool calls on undirected codebase exploration. We investigate whether providing agents with formal architecture descriptors can reduce this navigational overhead. We present three complementary studies. First, a controlled experiment (24 code localization tasks x 4 conditions, Claude Sonnet 4.6, temperature=0) demonstrates that architecture context reduces navigation steps by 33-44% (Wilcoxon p=0.009, Cohen's d=0.92), with no significant format difference detected across S-expression, JSON, YAML, and Markdown. Second, an artifact-vs-process experiment (15 tasks x 3 conditions) demonstrates that an automatically generated descriptor achieves 100% accuracy versus 80% blind (p=0.002, d=1.04), proving direct navigational value independent of developer self-clarification. Third, an observational field study across 7,012 Claude Code sessions shows 52% reduction in agent behavioral variance. A writer-side experiment (96 generation runs, 96 error injections) reveals critical failure mode differences: JSON fails atomically, YAML silently corrupts 50% of errors, S-expressions detect all structural completeness errors. We propose intent.lisp, an S-expression architecture descriptor, and open-source the Forge toolkit.

AI编程代码导航架构描述S表达式

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。