Specification-first convergence with an AI coding agent: a case study of dismantling a core architectural invariant across 189 files in a 717k-line codebase with no test oracle and no human code review
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
This paper reports a single, fully instrumented case study of a large-scale architectural refactoring by an AI coding agent under a specification-first protocol, with no human review of the generated code and no pre-existing oracle to validate the target behaviour. The task, dismantling a central invariant across a large interdependent codebase, was assessed by the author as effectively infeasible through incremental refactoring, the kind of change that conventionally calls for a rewrite instead. Under the protocol described here, the agent completed it successfully. The system is a 717,725-line production TypeScript application across 3,648 files. The task required dismantling a core lifetime invariant: the guarantee that a UI panel remains open for the duration of an AI request. The target behaviour was that a streaming generation survives the closing of its panel and can be reattached, on reopening, to the same live stream with no loss or duplication. The protocol: formal specification by the agent, 14 refinement cycles auditing that specification against the source code, atomic implementation, a compile/test feedback loop, then 17 verification cycles auditing the code against the frozen specification. Across 31 audit passes, 201 defects were corrected before any human executed the program. The convergence criterion was empirical: two consecutive verification passes returning zero findings. The change touched 189 files (31 new); with the extraction phase, the two commits total 288 files, 34,770 insertions, 16,422 deletions. Across the first and roughly thirty later sessions, the software behaved as specified, no bug observed. Elapsed: three days; cost: USD 2,430. The full specification and raw session logs, 1,500+ pages in French, are published as evidence, allowing inspection of the process and submission to a language model for consistency checking.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 5 of its 18 references that are in the map. First posted on arXiv 12 Aug 2026.
Builds on
5 of 18 references.
Closest ancestors · 2
Same direction, newest first
- 2026Cheap Code, Costly Judgment: A Case Study on Governable Agentic Software Engineering1 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
Other references · 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026From Dead Code and Static Requirements to Working Engines: Software Revival with Coding Agents
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring
- 2026When the Specification Emerges: Benchmarking Faithfulness Loss in Long-Horizon Coding Agents
- 2025Agentic Refactoring: An Empirical Study of AI Coding Agents
- 2026Understanding the Architecture of Coding Agents: An Exploratory Study Using a Research Prototype
- 2025Decoding the Configuration of AI Coding Agents: Insights from Claude Code Projects
- 2026A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformations
- 2026Architecture as Capability Equalizer for Coding Agents