形式架构描述符作为AI编码代理的导航原语
Formal Architecture Descriptors as Navigation Primitives for AI Coding Agents
AI总结:
本文研究了通过提供形式架构描述符减少AI编码代理在代码库探索中的导航开销,通过实验和观察证明了架构描述符在导航效率和错误检测方面的显著提升。
摘要:
AI编码代理在工具调用中花费大量时间进行无方向的代码库探索。我们研究了提供架构描述符是否能减少这种导航开销。我们提出了三个互补研究:首先,一个受控实验(24个代码定位任务×4种条件,Claude Sonnet 4.6,温度=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检测所有结构完整性错误。我们提出了意图.lisp,一种S表达式架构描述符,并开源了Forge工具包。
英文摘要:
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分析而来,可能存在错误,请以论文正文为准。