Manuscript Offprint

arXiv:2611.05094

A Gated Spec-Driven Workflow: An Audit-Trail Study of Coding-Agent Work

Rodrigo Figueiredo Abdo, Pedro Carvalho Brom

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Spec-driven development (SDD) asks a coding agent to work from specifications, plans, and task lists rather than from the chat transcript. We study one such workflow for Claude Code, in which almost every control is an instruction carried out by the same model that it constrains. The user must approve each stage before the next begins. A reviewer subagent checks each artefact against a fixed, stage-specific defect list, and an executor subagent may only touch the files listed in its task. After each block of tasks, the orchestrator runs a file-inventory check to detect undeclared changes. We analyse the logs and transcripts of nine features in seven projects, all run by the authors, ranging from a Fortran solver and Python programs to books and this paper. Of these, five finished with every planned task done, including the Fortran solver feature, and 288 of the 581 planned tasks were completed block by block. The executor kept to its declared files: it left only one undeclared change in the deliverable folder, and the check caught it, although its reports record other departures from the protocol. The weak point was the orchestrator, which runs and judges its own checks. It recorded undeclared changes in 11 of 247 block checks, mostly from the authors' in-round requests and the environment, and stopped work in only four.

Keywords spec-driven development · coding agents · agent scope · automated review · audit trail · case study

1 Introduction

A coding agent that edits files and runs commands can complete its task and still change things that nobody asked it to change. A study by Qu et al. [1] measured this behaviour on benign tasks. In a pilot of 76 paired scenarios, Claude Code running GLM-4.6 acted outside the request in 0.0% of runs when the prompt ended with a block stating what was authorised and what was out of scope. Removing only that block raised the rate to 17.1%. Qu et al. therefore warn that a benchmark which states the scope in the prompt measures whether the agent matches that text, not whether it can work out the boundary itself. Agents also overstate what they have completed [2], so an agent's report of what it changed is a claim rather than evidence.

Spec-driven development (SDD) has become the practitioners' answer to this problem. In SDD, developers and agents write a specification, a plan and tasks before any code is written [3, 4]. Practitioners report that agents behave more reliably, but also that planning and review cost more [5]. Most of the evidence on SDD comes from tool vendors [5].

This paper studies one SDD workflow whose controls are almost all instructions, carried out by the same model that they are meant to constrain. The present workflow was designed to organise complex tasks and to make the agent do what was asked and nothing else. Work passes through the stages PDR (product decision record), SPEC, PLAN, TASKS,

A PREPRINT

EXECUTE, and ARCHIVE, in that order, and the user approves each artefact at a gate before the next stage starts. A reviewer subagent checks each artefact against a closed, stage-specific defect list. In EXECUTE, an orchestrator dispatches each task to an executor subagent that receives only that task and an explicit list of files it is allowed to change. After each block of tasks, the orchestrator compares an inventory of the deliverable folder with the one taken at the start of the round. Under the workflow's protocol, if this block check finds a change that the tasks executed so far did not declare, the round should stop. We call this protocol requirement the stop rule. A review episode groups the reviewer calls on one artefact until the authors send a message or a long pause occurs. Every call after the first in an episode is a re-review (section 4).

The controls leave written traces. The gates appear in the Status fields, the reviewer calls in the transcripts and logs, and the block checks in the logs, which the orchestrator writes as it decides whether to stop. We use these traces to ask where the controls held and where they did not.

RQ1 What do the block checks record about undeclared changes, where do those changes come from, and is the stop rule applied?

RQ2 What does the reviewer find, at which stage, how is it invoked, and what does it cost?

RQ3 How does the workflow behave across interruptions, across features, and when the deliverable is not software?

The closest prior report, by Abenhaim [6], covers one project and one refactoring carried out under a spec-first protocol, with no human review of the generated code. Compared with it, the workflow studied here adds a gate at every stage, a block check and a reviewer that works from a closed list of defects. The study also covers deliverables that are not software. We study nine features in seven projects, which ran with all of these controls, and five of these features delivered books, a research dossier or a research paper rather than software.

The unit of analysis is the stage mechanism rather than the completed feature, because only four of the nine features reached the ARCHIVE stage.

After reviewing related work (section 2), the paper describes the workflow (section 3) and the study design (section 4), reports the results (section 5), discusses their implications (section 6) and then turns to the threats to validity (section 7). The main claims are listed in table 1 with their status, their evidence and the section that reports each.

References (30)