Implementing the Spec Growth Engine: Preventing Spec-Code Divergence, and Growing the Spec with Agents
This study addresses the challenges of specification-code inconsistency and limited extensibility in AI-assisted software development by proposing a dual-layer engine architecture. The lower layer integrates graph theory with static analysis to perform deterministic verification, thereby preventing deviations from established specifications. The upper layer leverages a multi-agent system to collaboratively extend specifications. Furthermore, this work introduces a novel three-switch mechanism that enables eighteen distinct operational configurations, supporting a full spectrum of human-AI collaboration paradigms ranging from manual to fully unsupervised modes. By effectively balancing deterministic guarantees with the value of autonomous generation, the proposed framework ensures that code modifications remain traceable while facilitating the continuous evolution of specifications.