arXiv:2610.11725cs.SEOct 2026

Manuscript Offprint

arXiv:2610.11725

Implementing the Spec Growth Engine: Preventing Spec-Code Divergence, and Growing the Spec with Agents

Hartwig Grabowski

Abstract

The Spec Growth Engine anchors AI-assisted software development in a graph of specifications that the code is coupled to [3]. This paper describes its implementation, which serves two tasks and keeps them apart as two layers. The first layer prevents spec-code divergence: a deterministic engine validates the spec graph, compares it with the code's import graph, earns a node's verified status from recorded test evidence, and classifies every change by what it can break – without calling a model. The second layer grows the spec with agents: an intent author, a planner and a coder, each played by its own model, extend the graph in rounds, and a deterministic rule decides after each round whether the run goes on. How much of the human's judgement is delegated is set by three independent switches – a draft gate, a delegation for breaking changes, and the run mode – which, with two ways of laying a project's floor, give eighteen ways to run a project. We describe each of them, the gates, requests and waivers through which agents and the human communicate, and the spectrum of operation from entirely manual work to an unsupervised run whose decisions the human reviews afterwards. Throughout, one claim holds the design together: an autonomous run is worth only as much as the deterministic instance that measures it.

1 Introduction

The companion paper [3] introduced the Spec Growth Engine as a method: software grows as a graph of SPEC.md files, one per node, each stating a contract; the code is coupled to that graph; and divergence between the two is a blocking condition rather than a slow erosion. It argued the design from its failure modes – context explosion and silent spec-code drift – and from established foundations [1, 2, 4, 7].

This paper describes the implementation: an engine, a command-line interface and a graphical cockpit, developed and tested in a series of agent runs on small, concrete tasks. Building it forced a distinction that the method had left implicit. The implementation serves two tasks of a different nature:

  1. Preventing spec-code divergence. Given a graph and a code base, say – deterministically, and on every commit – whether they agree: whether every import the code makes is a declared dependency, whether every file belongs to a node, whether a node claimed as done has the test evidence to be, and whether a change breaks a promise others rely on.

  2. Growing the spec with agents. Given a goal, let agents write the node intents, the specifications and the code – and decide, after each round of their work, whether the goal is met, whether they go on, or whether they are waiting for a human.

The first task needs no model and must not use one: its value is that it is reproducible, and that it blocks. The second task consists of judgement and cannot do without models. The implementation therefore keeps them apart as two layers (Section 2.1). Layer 1 is a complete use of the engine on its own – a person, a text editor and the gate. Layer 2 rests on layer 1 as its floor and its witness:

The claim the design rests on. An autonomous run is worth only as much as the deterministic instance that measures it afterwards. An agent that says done proves nothing; a gate that blocks, a test that is recorded, and a change set that says what moved are what make its claim checkable. Layer 1 does not need layer 2; layer 2 cannot exist without layer 1.