arXiv:2610.01372cs.SEOct 2026

Manuscript Offprint

arXiv:2610.01372

A Design Theory for AI-Assisted Software Development Derived from Christopher Alexander's Theory of Form

Chien-Tsun Chen, Yu Chin Cheng

Abstract

In AI-assisted software development, code generated by large language models (LLMs) cannot be assumed to meet specified requirements. Conventional correctness-assurance measures such as reviews, testing, design by contract, and static analysis remain applicable. Verification, however, must keep pace with an unreliable generator. The open question is which of these measures a sufficient harness needs and what role each plays. This paper proposes a design theory for AI-assisted software development, derived from Christopher Alexander's theory of form rather than from prompting or agentic-programming techniques. It also provides a methodology for applying the theory in practice.

The theory builds on Alexander’s view of design as achieving fit between a form, the software under development, and its context, the demands that software must satisfy. On this account, fit can be perceived only negatively, through the absence of identified misfits. We apply this view to AI coding by first making the development organization’s tradition explicit, then deriving the misfits from that tradition and from the problem’s classification. The harness then checks the generated software against those misfits.

The theory models the LLM as a non-native vernacular builder: a builder trained on many codebases but native to none, whose output tends to drift toward mainstream conventions rather than the local tradition. For such a builder, the theory recreates in explicit machinery what Alexander’s unselfconscious process supplied through tradition: adherence is enforced rather than left to the builder’s judgment. From Alexander’s analysis, we derive obligations that must be discharged for the absence of detected misfits to justify a stated claim of fit. We discharge these obligations by engineering four pieces of machinery that Alexander’s vernacular cultures did not need. First, the problem is made explicit through a representation based on Jackson’s problem frames, and the solution-side tradition is made explicit as a four-form pattern language. Second, a stack of deterministic detectors makes misfits manifest. Third, a fix loop drives repair until the gates pass or the problem is escalated to a human. Fourth, a human-gated legislative circuit governs changes to the representations and detectors themselves. We call the resulting methodology Misfit-Governed Development (MGD). The builder cannot change this machinery on its own authority. Building and maintaining such machinery is the emerging practice of harness engineering.

The resulting process separates an autonomous inner loop, where the LLM iterates against the gates, from a human outer loop, where specifications are judged against the world and revised along with the tradition when they no longer fit. We call this the dual-loop process. The inner loop checks three families of relations by machine: the program and the tests must each conform to the specification, and the program must pass the tests. The outer loop carries the one judgment the machinery cannot make on its own authority: whether the specification fits the world. Together they form the S=P=T=WS = P = T = W assurance model, where S stands for specification, P for program, T for tests, and W for world; the equals sign is a mnemonic for these relations rather than a claim of literal equality. We report empirical evidence from building and rebuilding a Scrum system whose local tradition draws on domain-driven design, event sourcing, Clean Architecture, and Command Query Responsibility Segregation. Its four event-sourced aggregates are built from 64 problem-frame specifications and verified by approximately 1,300 generated tests under two infrastructure profiles and by 28 blocking gates, one of which applies 188 machine-checkable rules. This experience addresses the generativity dimension of Alexander's 1996 OOPSLA challenge to the software community. The moral dimension cannot be discharged by a gate: whether the specification still fits the world requires human judgment, which the theory locates in the outer loop as an institutional obligation rather than a detection problem.

Keywords: AI-assisted software development, harness engineering, design theory, Christopher Alexander, pattern language, problem frames, specification-driven development, domain-driven design, LLM code generation

1. Introduction

Large language models (LLMs) can generate plausible code at a rate that makes exhaustive human review increasingly costly. Worse, generated code can make an entire class of failures unusually difficult to notice through conventional code review. A misunderstood requirement sometimes leaves visible traces: the code may read awkwardly, violate local conventions, or fail to compile. Generated code weakens the evidential value of those traces: it can express the same misunderstanding as fluent implementation. It may compile and pass superficial inspection while silently dropping a field, inverting a guard condition, or defaulting to mainstream conventions learned during training. The practice known as vibe coding [1], in which generated code is accepted on the strength of its apparent plausibility, leaves the correctness question unanswered.

The methodology described in this paper takes the opposite approach. It treats the generator as permanently unreliable. This is a trust policy, not a prediction about future model capability. Prompt engineering and more capable models may improve the odds of success, but improved odds do not by themselves turn an LLM into a trustworthy translator from intent to code. Better odds are a property of the generator. They do not establish that any particular generated system fits its context. Therefore, the methodology withdraws trust from the generator and places it in a human-governed verification stack that surrounds the generator. Recent work has begun to treat this surrounding machinery as an engineering object in its own right, cataloging the harness's runtime responsibilities [2] and evolving harnesses automatically against observed failures [3]. The design problem then becomes the following: what must the verification stack contain, and what theory can tell us when it is sufficient for a stated claim of fit?

Our answer returns to Christopher Alexander’s classical theory of form, set out in Notes on the Synthesis of Form [4], which preceded the pattern-language work later embraced by software engineering. There Alexander analyzed design as the achievement of fit between a form (the thing we shape) and its context (the part of the world that places demands on it). He observed that good fit can be perceived only negatively. Misfits, by contrast, can be identified individually, enumerated, and detected. This observation has a direct implication for AI coding. To the extent that the relevant misfits can be enumerated and mechanically detected, synthesizing the form ceases to be a design problem and becomes a technical one. Fit is operationalized, relative to the enumeration, as the absence of every enumerated misfit. Functional incorrectness is only one class of misfit: a system can meet its functional requirements and still misfit its context by violating architectural, contractual, or local-tradition demands. Synthesis then reduces to eliminating those misfits in turn. The strength of the resulting fit claim depends on how complete the enumeration is. In practice the enumeration is never finished, and not every recognized misfit yields a mechanical detector. The methodology therefore treats the enumeration itself as a governed, growing artifact: every escape either extends or corrects the enumeration or receives an explicit ruling (Sections 4.4 and 5).

Alexander further distinguished the unselfconscious process of vernacular building cultures from the self-conscious process of modern design. In the unselfconscious process, a builder without a global model of the problem achieves fit by following tradition and correcting misfits one at a time as reality makes them manifest. The self-conscious process cannot reliably achieve fit because the interacting misfits are too complex to treat as a whole, while the conceptual categories introduced to decompose them can distort the real misfit structure [4].

By the time Alexander addressed OOPSLA in 1996, software engineering had adopted his patterns as an engineering vocabulary. Alexander questioned whether their generative and moral substance had carried over [5]. He challenged the field to make software genuinely generative, to aim at coherent wholes, and to make life better.

This paper takes up that challenge by developing a design theory in the established sense of the term [6, 7]. The theory is prescriptive, grounded in kernel theories, and testable. This is not another prompting technique or agentic workflow. The paper makes five contributions:

  1. A design theory for AI coding, operationalized through Misfit-Governed Development. We reframe AI code generation as Alexander’s form–context problem. Misfit enumeration becomes the basis of verification. Machine-checked fit is the absence of every misfit in the mechanized enumeration. The central question is therefore how complete the enumeration is, rather than how capable the generator is (Sections 2, 3, 4.2, 4.5, and 6; Table 1; Appendix A.1).

  2. The non-native vernacular builder. We model the generator as a craftsman trained across many traditions and native to none, whose deviations pull persistently toward mainstream idiom. This model and software’s silent misfits yield enforced tradition, manufactured manifestation, and severed backflow (Sections 3.5, 4.1, 4.4, and 4.5).

  3. The four-form pattern language. The language’s reader is a machine rather than a judicious professional. Every pattern node must exist in four coupled forms (doctrine, template, prohibition, gate), and the language’s grammar is enforced rather than followed. It is paired with a problem representation whose frame catalog extends Jackson’s. Each problem-frame type’s workflow is an ordered traversal of the solution-side pattern network (Section 3).

  4. The dual-loop process and the S = P = T = W assurance model. Building the machinery that surrounds the generator is a practice that has developed faster than its theory. We derive a theory for its verification core. The separation of machine-paced and human-paced feedback follows from the asymmetry between machine-priced and human-priced detection rather than from a design preference; the two loops are its realization. The resulting dual-loop process is the engineered analogue of Alexander's self-correcting vernacular process, yielding the S = P = T = W assurance model. Here, S denotes specification, P program, T tests, and W world. The model comprises three families of machine-decidable relations enclosed by a fourth relation, S = W, that requires human judgment; the equals signs abbreviate these relations, and Appendix A gives their formal semantics (Sections 3.1, 3.5–3.7, and 4.2–4.3).

  5. A graded answer to Alexander’s OOPSLA challenge. The methodology operationalizes generativity for software pattern languages. The LLM can interpret a pattern language as written while being deterministically governed by it. Coherence is answered in the formal sense (the parts verifiably compose) and left open in the experiential sense (Alexander’s felt wholeness). The moral dimension, whether the built thing serves human life, enters the assurance model through the S = W relation, which no gate can discharge. It must therefore be answered by institutions rather than detectors (Section 6).

These contributions form a single chain rather than five independent claims. The builder model motivates the pattern language, the pattern language requires the harness that enforces it, and the asymmetry between machine-priced and human-priced detection separates that harness's feedback into the two loops of Contribution 4. Together they constitute the design theory introduced in Contribution 1 and ground its graded answer to Alexander's challenge (Contribution 5).

Section 2 reviews the theoretical background and states the derivation. Section 3 describes the methodology and its reference implementation. Section 4 develops the theoretical analysis. Section 5 reports the empirical evidence. Section 6 returns to Alexander's challenge. Sections 7–9 discuss related work, limitations, and conclusions.

References (56)