🤖 AI Summary
This work addresses two structural failure modes in AI coding agents—context explosion and silent specification-code drift—that undermine development efficiency and code reliability. To tackle these challenges, the paper proposes a lightweight framework that uniquely integrates classical software engineering principles, including information hiding, the C4 model, and Architecture Decision Records (ADRs), into a unified, machine-enforceable architecture. The framework employs a machine-readable specification graph, an ownership-path-based Spine context assembler, a vertical-slice growth protocol, and a drift-gating mechanism to jointly ensure consistency between specifications and generated code. By constraining context expansion and mandating drift detection and correction prior to code merge, the approach significantly enhances the reliability and maintainability of AI-generated code.
📝 Abstract
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.