这篇论文很实在,专门解决AI写代码时规范和代码脱节、上下文爆炸的难题。作者搞了个轻量框架,用规范图和漂移门来管住,适合做AI辅助开发的工程实践参考。
论文提出Spec Growth Engine框架,解决AI编码代理的两个结构性失效:上下文爆炸和规范-代码漂移。框架包含机器可读的规范图(节点携带明确契约/设计分离)、Spine上下文组装器(将代理上下文限定到所有权路径)、垂直切片增长协议(强制最难优先排序)和漂移门(使规范-代码分歧成为阻塞合并条件)。该设计综合Parnas信息隐藏、C4、ADR、Walking Skeleton、Reflexion Models、Fitness Functions等成熟工程原则,形成轻量级代码耦合整体,无需RUP或MDA等重型框架。
The Spec Growth Engine: Spec-Anchored, Code-Coupled, Drift-Enforced Architecture for AI-Assisted Software Development
AI coding agents dramatically accelerate implementation speed but introduce two structural failure modes that existing spec-driven approaches do not fully solve: (1) context explosion -- the agent must reason over an entire repository at once, degrading output quality as the context window fills; and (2) silent spec-code drift -- code evolves, the specification does not, and the divergence becomes invisible until it is costly to repair. We present the Spec Growth Engine, a lightweight framework that addresses both failure modes through a machine-readable spec graph whose nodes carry explicit contract/design separation, a Spine context assembler that scopes agent context to an ownership path, a vertical-slice growth protocol that enforces hardest-first ordering, and a drift gate that makes spec-code divergence a blocking merge condition. The design synthesises well-established software engineering principles (Parnas information hiding, C4, ADRs, Walking Skeleton, Reflexion Models, Fitness Functions) into a lean, code-coupled, machine-enforced whole -- without the overhead of heavy-weight frameworks such as RUP or MDA.