Page
1
(This page has no text content)
Page
2
Beyond Code Build Reliable AI-Assisted Software with Context Engineering, Mechanical Gates, and AI Agent Control Jeremy McEntire
Page
3
Copyright © 2026 Jeremy McEntire All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the author, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. ISBN: 978-1-80834-203-5 First Edition Cover design by Jeremy McEntire Printed in the United States of America
Page
4
Contents vii Preface Part I: The Shift 1 The Inversion 11 Why Vibe Coding Fails Part II: Context 21 Context Is the Substrate 29 Feeding the Machine 37 What Not to Feed Part III: Constraints 47 Mechanical Gates Over Advisory Review 55 Decomposition as Design 63 The Constraint Topology Part IV: Coordination 73 Coordination Without Dialogue 83 Why Hierarchy Fails (and Why You Need It Anyway) 91 The Goodhart Trap Part V: The Craft 103 Grokking 111 Multi-Pass Thinking 119 Them Problems vs You Problems 127 Organizational Navigation Part VI: The Future 137 What Engineers Become 145 What We Build Next 155 Acknowledgments 157 References 163 About the Author
Page
6
Preface The tutorials on how to use a specific AI coding tool will expire with the next model release. The predictions about what AI will do next will expire faster than that. This book teaches neither. It teaches the physics of software engineering: the forces that govern coordination, verification, and specification regardless of which tools exist and which predictions prove correct. Those forces do not expire. Software engineering has always been a coordination problem disguised as a coding problem, and the disguise held for sixty years because code was expensive enough to dominate every conversation about productivity. AI stripped the disguise away. The cost of producing code collapsed by an order of magnitude, and what remained, visible for the first time, was the essential complexity that was always there: understanding what to build, determining whether it is correct, and managing what happens when systems grow beyond what any single person can hold in mind. The industry is now discovering, with some discomfort, that these problems are harder than the coding ever was, and that no tool eliminates them, because they are not inefficiencies to be optimized away. They are the physics of the discipline. The book is organized in six parts. The first establishes what changed when code production became cheap and what happens when teams attempt to use AI without understanding the forces that govern their work. The second and third examine context and constraints: how to construct the information environment
Page
7
viii that determines output quality, and how to specify boundaries that make output correct by construction rather than by luck. The fourth addresses coordination across agents, human and artificial. The fifth turns to the human craft: the cognitive and organizational skills that determine whether an engineer can operate effectively in this landscape. The sixth examines what is changing, what is not, and what engineers become when the underlying physics is understood. The argument is cumulative. Each chapter builds on the preceding chapters, and the later chapters assume familiarity with the concepts and evidence established earlier. The evidence comes from controlled experiments in multi- agent AI coordination, from published research in information theory, cognitive science, and organizational behavior, and from engineering coaching transcripts that illustrate how the theoretical principles manifest in the daily practice of working engineers. The transcripts have been anonymized: names, companies, and identifying details have been changed, and the individuals involved have given permission for their use. Two absences are worth noting. The book does not contain step-by-step instructions for using any specific AI tool, because the tools change faster than books can be printed and instructions that expire are worse than no instructions at all. The book does not contain reassurance that your current skills and your current role will survive the transition intact, because the honest assessment of the trajectory does not support that reassurance and this book does not offer comfort it cannot justify. What it contains is the physics that governs the landscape regardless of which tools exist and which roles survive, and the argument that understanding that physics is the most durable foundation available for whatever comes next.
Page
8
P a r t I The Shift
Page
9
(This page has no text content)
Page
10
C h a p t e r 1 The Inversion In mid-2025, a research organization called METR conducted one of the only controlled experiments on whether AI coding tools make experienced software developers faster. They recruited sixteen seasoned open-source contributors, people who averaged five years and fifteen hundred commits on their respective projects, codebases with twenty-two thousand stars and over a million lines of code. The researchers randomly assigned 246 real tasks, bug fixes, features, and refactors, to be completed with or without AI assistance, and asked each developer to predict, before starting, how much the tools would help. The developers predicted a twenty-four percent speedup. After completing the tasks, they reported feeling about twenty percent faster. Objective measurement showed the tools had made them nineteen percent slower. Those three numbers deserve careful attention, because the most interesting finding is not the slowdown. Slowdowns have explanations; tools were immature, context switching was costly, developers accepted fewer than half of the AI’s suggestions and spent considerable time evaluating the rest. These are frictions that will diminish as the tools improve. What will not diminish is the thirty-nine percent gap between what the developers believed and what actually happened. Sixteen experts, working on codebases they knew intimately, across hundreds of tasks, came away genuinely convinced the tools had helped them. The tools had
Page
11
2 not helped them, and the developers could not tell. Whatever you think about the future of AI-assisted development, that perception gap is the phenomenon that needs explaining, because it reveals something about the nature of software engineering that the industry has been misunderstanding for decades. The explanation begins with a distinction that is easy to state and difficult to internalize. Generating code and verifying code are different cognitive operations with different shapes. Generation is sequential: predict the next token, accept or reject, move forward. It flows. It feels productive. Pressing “Tab” to accept a completion triggers the same sense of progress as solving a problem, even when the completion introduces a subtle misalignment that will take twenty minutes to find. Verification, by contrast, requires holding the entire system in mind, reasoning about invariants, edge cases, security implications, integration boundaries, and the assumptions embedded in code you did not write. Generation is a stream. Verification is a landscape. Making the stream flow faster does not make the landscape easier to survey; it makes the landscape larger, because there is now more generated code to verify, and the verification must happen at the speed of human comprehension regardless of how quickly the code appeared. This is the verification premium, and it is structural. Industry data from 2025 shows code review times increasing by ninety-one percent and pull request sizes growing by a hundred and fifty-four percent in teams with high AI adoption. The bottleneck moved. It moved from producing code to determining whether the code is correct, and the new bottleneck is more cognitively demanding than the old one, because the reviewer is now evaluating logic they did not construct and cannot assume they understand. The developers in the METR study were not foolish. They experienced the speedup of generation and could not perceive the cost of verification, because generation feels like work and verification feels like overhead, even though verification is where the engineering actually lives. This asymmetry is the first of several places where the intuitive model of software engineering turns out to be wrong in a way that matters. For sixty years, the dominant assumption in the software industry has been that the primary cost of building software is writing the code. Teams are sized around it. Processes are designed to manage it. Careers are built on the ability to do it quickly and correctly. Every methodology from Waterfall to Agile to DevOps is, when you look past the vocabulary, a coordination strategy organized around the assumption that translating human intent into machine-executable instructions is slow, expensive, and error-prone, and that managing this bottleneck is the central problem of the discipline. Fred Brooks questioned this assumption in 1975, in The Mythical Man-
Page
12
3 The Inversion Month, when he distinguished between accidental and essential complexity. The accidental complexity of software was the labor of expressing ideas in code: managing memory, handling compiler quirks, debugging syntax. The essential complexity was everything that remained once the accidental complexity was removed: specifying what the system should do, designing how its parts relate, anticipating what happens at the boundaries between components, between the system and the world, between what is specified and what is assumed. Brooks argued that removing accidental complexity would never yield the order- of-magnitude productivity gains the industry hoped for, because accidental complexity was never the dominant cost. The hard part was the essential complexity, and no tool could eliminate it because it was inherent to the problem being solved. Large language models have provided a remarkably clean test of Brooks’s hypothesis. AI has eliminated most of the accidental complexity of code generation. You describe what you want, and syntactically correct, functionally plausible code appears in seconds. The industry got the productivity tool Brooks predicted would not matter much, and the result confirms his prediction with uncomfortable precision. Requirements are still ambiguous. System boundaries are still where most defects originate. The coordination problem, getting multiple people, teams, and components to work together toward a coherent outcome, still consumes the majority of a senior engineer’s time. The only thing that changed is the visibility of these problems. When the accidental complexity of typing code occupied most of the working day, it was easy to mistake it for the real work. Remove it, and the real work stands exposed: understanding what to build, determining whether what was built is correct, and managing the complexity that emerges when systems grow beyond what any single person can hold in their head. Consider what a strong senior engineer actually does during a typical week. The work begins with reading code they did not write, not for syntax but for intent, trying to reconstruct the mental model of someone who is no longer available to explain it. Stakeholder negotiations consume another portion: these are conversations with people who know what they want in the way that someone knows they are hungry without being able to write a recipe, where the desire is real, the specification is absent, and the engineer must bridge the gap. Interface design between components occupies still more time, less glamorous than it sounds and more consequential than most organizations recognize, because interfaces are where integration fails, where assumptions collide, and where the cost of misunderstanding compounds. Code review accounts for another significant share, and the review that matters has nothing to do with formatting or naming conventions; it is about whether the change respects the architectural constraints that prevent the system from collapsing under its own
Page
13
4 accumulated decisions. When production breaks, the engineer debugs by forming hypotheses about system behavior and testing those hypotheses against evidence, which is to say they do science, although the industry rarely calls it that. Every one of these activities is coordination. The best engineers have always spent the majority of their working lives managing complexity across boundaries: between people who see the problem differently, between components that must interact without contradiction, between what the specification says and what the business actually needs. This was always the essential complexity, the part that no tool could remove. Code generation happened to occupy the same hours, the same editors, the same pull requests, and so the industry conflated the coordination with the typing. AI separated them. The typing is now fast and cheap. The coordination is exactly as difficult as it always was, and for the first time in the history of the field, there is no mechanical labor to hide behind. The industry spent sixty years calling coordination “engineering” and calling engineering “soft skills.” The labels survived. The irony did not. A carpenter who understands load-bearing structures, soil conditions, and the behavior of wood over decades becomes faster when given a nail gun. The tool accelerates the mechanical work without touching the carpenter’s real expertise, which is knowing why the building stands, not just how to attach the pieces. Give that same nail gun to someone who has never framed a wall, and the result looks, from a distance, like a house. The nails are driven cleanly, the boards are attached, and the structure appears sound until the first heavy snow reveals that the headers are undersized, the load paths were never calculated, and the foundation was not designed for the soil it sits on. The nail gun did not make this person a carpenter. It made them a fast amateur, and a fast amateur with a power tool is more dangerous than a slow one, because the volume of confident mistakes exceeds anyone’s ability to catch them before the roof goes on. This analogy is worth taking seriously rather than treating as a throwaway metaphor, because it describes a precise structural risk that the software industry is currently experiencing at scale. The history of engineering is punctuated by disasters that share exactly this structure: mechanical capability outrunning the judgment required to deploy it safely. In 2012, Knight Capital deployed an automated trading system that had not been adequately verified against production conditions. The software generated eight million unintended trades in forty-five minutes, accumulating four hundred and sixty million dollars in losses before anyone could shut it down. The code functioned exactly as written. The problem was that nobody had verified whether “as written” corresponded to “as intended” under the specific market conditions the system encountered.
Page
14
5 The Inversion The tool was fast. The verification was absent. The result was not a gradual decline but a catastrophic, irreversible failure compressed into a timeframe that made human intervention impossible. AI tools create the conditions for this failure mode at industry scale. They accelerate the most mechanical part of software development, translating known intent into syntax, while leaving untouched the parts that actually determine whether the resulting system works: architectural judgment, security awareness, integration design, failure mode analysis, and the ability to determine whether a set of requirements is internally consistent before building against them. A 2025 analysis found that AI-assisted teams produced thirty-one percent more output while introducing twenty-three percent more security vulnerabilities. The code generation grew. The holes in the code generation grew with it. The teams could not tell, for the same reason the METR developers could not tell: the generation felt productive, and the verification failures were distributed across time and components in ways that are difficult to attribute to any single decision. Google’s 2025 DORA report, the most comprehensive annual survey of software delivery performance across the industry, captured the resulting dynamic in a finding that belongs on the wall of every engineering organization: AI does not fix a team. It amplifies what is already there. Teams with disciplined engineering practices, teams that tested rigorously, reviewed carefully, and designed for failure, saw AI accelerate their delivery. Teams without those practices saw AI accelerate their dysfunction: more code produced faster, with more defects, requiring more rework, burning more of the verification capacity that was already insufficient. The tool is an amplifier. The signal being amplified is what determines the outcome. There is an asymmetry at the center of this transition that the industry has been slow to absorb, and it is this: the cost of building software dropped by roughly an order of magnitude, but the cost of building the wrong software did not drop at all. When code was expensive to produce, the expense itself served as a natural forcing function for thought. Teams could not afford to build the wrong thing, because rebuilding was prohibitively costly, and so they invested in understanding what the right thing was before they started typing. Requirements reviews, design documents, architecture discussions: these processes were not bureaucratic overhead imposed by people who did not understand development. They were economic necessities created by the cost of implementation. The price of code imposed a discipline of forethought that most teams did not recognize as discipline, because it was simply how things had to be done when building was expensive.
Page
15
6 When the cost of building collapses, that forcing function disappears, and the consequences arrive on a delay. Teams build faster. They also build the wrong thing faster, and they build it so quickly that they frequently do not discover the error until the system is in production, serving users, accumulating downstream dependencies, and generating the kind of structural debt that cannot be refactored away because too many other systems now assume the original mistake is a feature. The delay between the decision and the consequence is what makes the problem pernicious. By the time the cost of being wrong becomes visible, the wrong thing has been cemented into the architecture by everything that was built on top of it. The Healthcare.gov launch in 2013 was a preview of this dynamic, before AI made it ubiquitous. Dozens of contractors built components in parallel, each producing code that functioned in isolation. The integration failures did not surface until launch day because nobody had verified the system as a whole, and by then the political and technical cost of correcting the errors dwarfed the cost of having done the coordination work upfront. Cheap production without coordination discipline does not produce faster delivery. It produces faster accumulation of errors that are discovered too late to fix cheaply. The engineer’s job, in this environment, has shifted in a way that is easier to describe than to internalize. The job is no longer to write code quickly. The job is to be right: to understand what is being built, to determine whether it should be built, to anticipate how it will interact with the systems around it, and to identify how it will fail before it fails in production. These are skills that require the kind of holistic, context-dependent judgment that AI tools do not provide, because they depend on understanding forces that operate above the level of any individual function or file. The inversion has made these skills visible by stripping away the mechanical labor that used to obscure them. For sixty years, the signal was buried under the noise of accidental complexity. The noise is gone. The signal is all that remains. There is a second problem, older than AI and more deeply embedded in the culture of the field, that the current transition has made urgent. Software engineering, as practiced by the majority of the industry, is not engineering. It is craft production informed by fashion. Engineers in other disciplines do not debate whether steel or concrete is “better” in the abstract. They calculate load requirements, analyze soil conditions, model environmental exposure, and select the material that meets the constraints of the specific problem they are solving. They can do this because they understand the physics: the actual forces and material properties that determine
Page
16
7 The Inversion whether a structure stands or falls. The physics provides a shared foundation of verifiable knowledge that makes engineering arguments resolvable. You do not need to trust the engineer’s intuition; you can check the math. When the physics is ignored, or when organizational process fails to surface it, the consequences are measured in lives. The Hyatt Regency walkway collapse in Kansas City killed a hundred and fourteen people over a single statics calculation. The original design specified continuous hanger rods running through both the upper and lower walkways. The steel fabricator proposed a change to offset rods, because threading a single rod through both walkways was difficult to build. The change was sent back to the structural engineering firm as a shop drawing. An engineer approved it without recalculating the load. The modification doubled the force on the upper walkway’s connection point, from supporting only its own weight to supporting both walkways simultaneously. The engineering knowledge to prevent those deaths was a calculation that any second-year student could perform. The organizational process — the shop-drawing review that existed to catch exactly this kind of change — did not surface the structural implication to someone who would check the math. Software engineering has largely replaced this mode of analysis with argument from authority. Netflix uses microservices, therefore microservices are correct. Google uses monorepos, therefore monorepos are correct. A charismatic speaker at a well-attended conference advocates for a particular framework, and within eighteen months half the industry has adopted it, not because anyone tested it against the alternatives in their specific context, but because the social proof was sufficient to override the absence of evidence. Architectural decisions are made by analogy rather than by analysis, and the analogies are almost never examined for whether they actually transfer. The reasoning would embarrass a second-year student in any structural or mechanical engineering program, but in software the pattern is so pervasive that questioning it marks you as contrarian rather than rigorous. When code was expensive, this substitution of fashion for physics was survivable, because the cost of building constrained the damage. You could not try three architectures and compare them; you could barely afford to build one. Decisions had to be made in advance, on the basis of experience and analogy, because the cost of experimentation was prohibitive. Guessing was the only affordable strategy, and so guessing became the culture, and the culture developed elaborate justifications for why guessing was acceptable: “it depends,” “there are tradeoffs,” “we’ll refactor later.” That excuse evaporated the moment AI made prototyping cheap. When a working prototype can be generated in hours rather than weeks, you can build three candidate architectures, test each against realistic workloads, and measure which one actually meets the performance, reliability, and maintainability
Page
17
8 requirements of your specific system. You can run experiments. You can collect data. You can, in the most literal sense available, do science, the thing that the “science” in “computer science” was always supposed to mean. The METR study is a small but instructive example of what scientific thinking looks like when applied to questions the industry normally resolves by anecdote. The researchers did not ask developers whether they felt faster with AI tools. They designed a controlled experiment with randomized assignment, objective time measurement, and pre-registered predictions. They compared what happened to what people believed had happened, and the comparison revealed a thirty-nine percent gap between perception and reality. That gap exists because nobody was measuring. The developers’ subjective experience was sincere, informed by years of expertise, and wrong. The only way to discover that it was wrong was to measure, and the only reason anyone measured was that someone thought to ask the scientific question rather than the social one. The scientific mode of thinking, the discipline of forming hypotheses, testing them against evidence, and revising one’s beliefs on the basis of what the evidence shows, has become the central competency of software engineering. The claim is practical, grounded in what happens when the cost of experimentation collapses. When you could only afford to build one architecture, guessing was a reasonable approach, because the alternative was too expensive. When you can build ten, and you are still guessing, you are choosing to be wrong. The cost of that choice has not changed. What changed is that you no longer have an excuse for making it. The forces that govern this transition are not new. They are drawn from information theory, cognitive science, and organizational dynamics, and they operate with the same reliability and the same indifference to preference as the physical forces that govern bridges and buildings. They determine how context shapes the quality of any output, whether that output is produced by a language model or a junior engineer. They determine why withholding information often produces better results than providing more of it, why mechanical constraints produce more reliable behavior than human oversight, why coordination through shared environment scales in ways that coordination through conversation cannot, and why every metric an organization uses to measure success will, given sufficient time and pressure, be gamed by the people being measured. These forces do not change. Tools change, capabilities change, the economic landscape changes with every quarter, but the dynamics of coordination, information, and constraint are invariant. The engineer who understands those forces can adapt to whatever configuration the landscape takes, because they
Page
18
9 The Inversion are reasoning from principles rather than following recipes. The engineer who does not understand them is dependent on the current set of tools and practices remaining relevant, which they will not. The cost of building continues its descent toward zero while the cost of being wrong remains exactly where it has always been, and the widening gap between those two numbers is where engineering lives now.
Page
19
(This page has no text content)
Page
20
C h a p t e r 2 Why Vibe Coding Fails The most instructive failure in the history of AI-assisted software development lasted six and a half minutes. In a controlled experiment designed to test whether multi-agent AI architectures could build a realistic software system, a pipeline of eleven specialized agents, each responsible for a specific stage of development from diagnosis through decomposition through implementation through review, was given the task of building a microservices backend for a vacation rental booking platform. The system had a budget of fifty dollars and access to the same language model that, in a different configuration, had scored a perfect twenty-eight out of twenty-eight on the same task. The pipeline spent its entire budget on five planning stages. It produced zero lines of implementation code. It ran out of money while still deciding what to build. The system did not fail because the underlying model was incapable. The same model, given the same task as a single agent with full context, built all seven services, integrated them correctly across every boundary, and passed every test, for roughly the same cost that the pipeline spent on planning alone. The failure was in the way that intelligence was organized. The pipeline architecture, designed to ensure quality through sequential gates and confidence thresholds, optimized for what it could measure at each gate, the quality and completeness of its planning artifacts, and consumed the entire budget before reaching the