Why Software Factories Fail
Lights-out software factories fail because reinforcement learning rewards models for passing tests rather than maintaining clean architecture, requiring teams to reintroduce human code review and structured pre-planning.
Highlights
3 clips · 3 min of 19 min-
- Agents struggle to maintain codebases past three to six months.
- Without human steering, systems suffer from tight coupling and shotgun surgery.
- Completely lights-out workflows inevitably lead to site outages and unreadable code.
-
- Model reinforcement learning relies on binary test-passing rewards.
- Models cannot be penalized for poor design or eroding code maintainability.
- This limitation leads to fragile code hacks like unnecessary try-catches just to satisfy tests.
-
- Thirty minutes of pre-planning and program design saves hours in code review.
- Good pull requests are easy to review because architectural alignment happens upfront.
- Structured AI workflows let teams move fast while still ensuring developers own the code.
That’s all the highlights.
Questions this video answers
9 · every answer cites the moment it was said01 Why are companies experiencing more outages after adopting AI coding tools? 2 sources · 1:36
Companies rushing to deploy AI coding agents are experiencing increased outages and bugs because pull requests are being merged rapidly without human review. Code review quality has drastically dropped, leading to codebases falling apart faster than before.
02 Why do coding agents struggle heavily with brownfield codebases after a few months? 2 sources · 8:11
Coding agents fail to maintain codebase health over time because they lack the ability to preserve architectural maintainability without constant human steering. Without oversight, systems quickly suffer from code smells like shotgun surgery where changing one part breaks others.
03 What structural advantage do model labs have over independent harness builders? 2 sources · 10:32
Model labs like OpenAI and Anthropic own both the model weights and the harness, allowing them to train the model directly against its deployment environment via reinforcement learning. Independent harness builders who cannot adjust model weights are always at a structural disadvantage.
04 How does reinforcement learning for coding models score and update behavior? 2 sources · 11:36
Reinforcement learning generates multiple solution traces for a programming problem and scores them based on binary correctness—whether existing tests pass and new tests succeed without breaking anything else. The model weights are then updated to make the successful behaviors more likely and failed ones less likely.
05 Why does reinforcement learning optimization result in poor program design? 2 sources · 12:50
Because reinforcement learning evaluates models purely on whether tests pass, there is no mechanism to penalize poor program design or architectural erosion. As a result, agents resort to hacks like unnecessary try-catch blocks or type casting just to satisfy the test runner.
06 Why is it difficult to build benchmarks that evaluate code maintainability? 2 sources · 13:18
Verifying code quality and maintainability is orders of magnitude harder than verifying tests because the true cost of bad architecture is measured in months and years. This massive time gap makes it extremely difficult to propagate a reward signal back to the training phase.
07 What new benchmarks are emerging to test multi-PR tasks and long-horizon coding? 2 sources · 13:56
New evaluation datasets are trying to address complex maintainability by testing extremely long tasks or un-trained open source repos. For example, Cognition's Frontier Code evaluates multi-PR tasks by penalizing models if they write tests that do not fail on pre-patch code.
08 What pre-planning steps should teams reintroduce to make AI coding maintainable? 2 sources · 15:38
Teams should reintroduce structured upfront planning including product reviews, system architecture definitions, and detailed program design covering method signatures and call stacks. Spending a short amount of time on pre-planning saves hours of frustration during code review.
09 How does upfront planning change the developer experience with pull requests? 2 sources · 17:12
When teams use model-assisted planning and alignment, pull requests become a joy to review because the changes directly match what was agreed upon beforehand. This process eliminates AI-generated slop, makes code reviews faster, and ensures engineers retain ownership of the codebase.
Section-by-section summary
4 parts
The industry rush toward lights-out software factories
Teams are racing to adopt AI coding agents and eliminate humans from the software development loop entirely. However, this rush has coincided with declining code review quality, increased incident rates, and rapidly deteriorating codebases.
Models cannot maintain codebase health over time
While AI handles greenfield projects well, brownfield codebases degrade quickly under autonomous agent changes. Models cannot maintain long-term architectural health, resulting in severe technical debt and maintainability issues.
Reinforcement learning optimizes for passing tests
Coding models are trained via reinforcement learning using binary rewards based strictly on whether automated tests pass. Because the cost of poor architecture is only apparent months later, models learn to use brittle hacks rather than clean design.
Structured pre-planning makes AI coding maintainable
To move safely, teams must reintroduce human code review supported by upfront product, architecture, and program design phases. Spending time on component contracts and call graphs before coding prevents review bottlenecks and ensures developers retain codebase ownership.
n next · p previous clip · t highlights/full
< > slower/faster · / search what was said
-
Lights-out software factory2× · first 1:06
An automated development pipeline where code is written, tested, and deployed without humans reading it.
-
Harness engineering2× · first 0:36
Building wrappers, loops, sandboxes, and orchestration tools around AI models to execute coding tasks.
-
Brownfield1× · first 8:05
An existing codebase with historical complexity where AI agents struggle to maintain quality over time.
-
Shotgun surgery1× · first 9:11
A textbook code smell where making a change in one part of the codebase inadvertently breaks other parts.
-
Reinforcement learning3× · first 10:56
Training a model by generating solution traces and updating weights based on test correctness rewards.
-
Vertical slices1× · first 16:27
An implementation strategy focusing on multi-repo coordination and feature steps across an entire system.
-
Human Layer3× · first 7:59
An AI IDE and collaboration platform designed to bring code review and planning back into software factories.
4,025 words · about 16 min to read · YouTube’s automatic captions
What's up everybody?
The industry rush toward lights-out software factories
How we doing? Guys, give it up for all the great speakers today so far. Um
All right, this is Harness Engineering is not enough and why software factories fail. And we're going to click, maybe. Oop. Oh, that's way too many slides. Hold on, guys. Okay. Um So, we're all racing to put AI coding into production. And uh there's been lots been said about loop engineering. And uh we should probably write more loops.
And uh yeah, I don't know. I guess we're doing loops now. Uh StrongDM built a lights-out software factory where nobody even reads the code. And the prevailing narrative is we should just spend more tokens. You are the bottleneck. The models are good enough. Code is free. Just ship more stuff. But at the same time, we are starting to see the cracks. Our friend Mario at AI Engineer Europe begged us to slow down because companies that should not be having outages because of coding agents are having outages due to coding agent mishaps.
Um codebases are falling apart faster than they ever have before. And our friends at Faros AI actually even did a report since we all picked up all these AI coding tools in January, maybe February. Um pull request code review quality is way down. We're having more comments, longer comments, and tons of PRs being merged without any review at all. Incidents are way up, bugs per developer are way up, and uh many people will tell you that you're holding it wrong. That's the only reason.
You're not. Well, maybe you are, but that's not the point. Um I've spoken a lot about how to hold it better when it comes to working with AI. Uh probably a million views on YouTube at this point across a bunch of different talks. Um and the basic thing is like as engineers, we've been told that if token maxing isn't working, then it's a skill issue. You just need to spend more tokens. Uh let go of reading the code. That with enough harness engineering, if we maybe sprinkle some magic words, adversarial review on enough of our uh PR bots, that we can get the best of both worlds.
10 to 100x faster, high quality, and nobody has to do that thing we all hate called code review. Uh I'm here to convince you today that this is in fact not a skill issue. That no amount of harness engineering or loops maxing can solve what is fundamentally a model training issue. That's why we say the harness is not enough. Um and to understand this, we kind of have to grapple and dig into how coding models are trained. I'm going to talk about what I think the shortcomings are with some of the current benchmarks and what better ones might look like.
And we'll talk about how to move faster safely in the meantime. Um it's going to sound like a rant, uh but there is hope here. Uh I'm going to talk about our journey and a bunch of the landmines we've hit uh building in this world. A bunch of exciting new techniques that we've been working with uh a lot of our users and customers to develop. And I think how we all as a community get to the next chapter of agentic engineering after whatever this thing that we're in. Um so we use a lot of words here. I'm going to zoom out a little bit. I want to give you kind of like a brief history of the software factory. Um and it's actually I don't I I I just learned this last week. It was the term software factory was defined at a NATO conference in 1968.
Uh we're going to start around 2022, like right before AI started coming around. Um and basically in a typical 2022 software factory, you will have some people building stuff. You'll have engineers, you'll have PMs, maybe you have some sort of leadership team that is driving the vision here. And they all decide that stuff needs to get done. And so you put it in a tracker, a linear, a Jira, a beads, some sort of state machine that tracks what needs to be done. And then someone goes and grabs something off of there, and they build the thing. And there may be some automated testing in that process, maybe some manual manual testing in that process. At a certain point, we make this pull request thing. Says, "Okay, cool. We got to run a bunch of checks, automated stuff. A human's going to review the change and review the code.
And perhaps we might even have uh a human pull it down and test it somehow." And if anything goes wrong here, we loop back to someone builds the thing. Uh and eventually we're ready for prod. And so we ship it to production. And once it's in prod, it makes contact with our users. And users do uh a thing that we all love. Uh users love to complain. I I love our users. Uh but yeah, they're going to ask for things, they're going to find bugs, they're going to file feature requests.
Uh and that goes back to your team. You might also add monitoring. And so uh you know, what do we want more than anything else? We want to wake up engineers at 3:00 in the morning when something breaks. So they can get dragged out of bed to try to go fix it. Uh and we go on and on in this loop. Uh and we ship a bunch of code. Um and one thing that we noticed here is that uh teams figured this out decades ago is that this someone builds the thing step is usually going to take hours or days in most cases. And the review part will also take hours or days for large things. And so teams started doing these upfront planning, architectural proposals, sprint planning, and they would collaborate this on on these things as a team uh with the hopes that we might decrease the percent chance that something would need to be reworked. That we would be able to reduce the time spent in reviewing every line of code because we aligned on everything ahead of time.
This brings us to the agentic software factory. Uh every company and their mother is talking about how they built a coding agent factory that ships 75% of their code now. Uh literally everybody. Uh and so if we look at the software factory from 2022, uh we just replace someone builds the thing with an agent builds the thing. And we have an orchestration and a harness and a sandbox and a model and computer use and I'm not going to get into like the details of that. You can watch 100 talks about that this week, I'm sure. Um but now the building part takes minutes or hours, but this human part still takes hours or days if you're going to review the code and you're going to test the changes.
And so we bring in agentic code review. We bring in agentic regression testing, uh and it makes this part faster, but it's probably still the bottleneck. But we can do more loops here. Why not? Let's do some more loops. So we can route all incidents straight into the factory. Why does someone need to get woken up uh and try to fix it when they could just wake up to a pull request and uh maybe that fixes the issue for you. You can take all the user feedback and just stick it straight into the factory so that people ask for stuff and it gets built.
And now your only job is how much things can you stuff into the queue of stuff to do and how fast can you review and test the changes? Which brings us of course to, I'm sure you know, the lights off software factory where basically Dentsu Bureau coined this is we no longer read the code. We say, "You know what? This is going great. That code review thing? No, thanks. We're just not going to do that anymore." Uh and we invest into all these other parts of the system. Your your testing, your monitoring, your rollout, everything else. We just write more code and build those systems better.
And now our job really is just how much how much stuff can we ask the agent to build? I am going to posit that this does not
Models cannot maintain codebase health over time
work. Uh and this is why software factories fail. Um as as an aside, what I'm going to say has nothing to do with vibe coding. So Addy had this uh great post. I'm going to just going to literally take his quote verbatim. A developer vibe coding a side project a dozen people will ever run, and a team keeping a 10-year-old enterprise system alive for another quarter share almost no constraints worth naming. And most of what you hear on the internet is one of these groups of people telling the other group of people how to live their lives.
So, if you love vibe coding, please go on. Um at Human Layer, what we care about is how do we help people solve hard problems in complex codebases. Um
1 Highlight · Coding agents struggle with brownfield maintainability
we use the word brownfield a lot, which historically has meant like some 10-year-old Java thing. I actually think agents really start to struggle after maybe 3 to 6 months, especially with the pace at which we can ship now. Um you can ask me how I know this, and I will tell you that it is because in July 2025, we tried this. We went full lights off, and uh if you have tried this seriously for a number of months, you probably found at least one issue that the agent couldn't solve.
Even with your most advanced prompting, you do research, you do reproductions, you just you have to go and dig into that codebase that you stopped reading 3 months ago to try to figure out what's broken. And in the meantime, your site was down, your users were pissed, and you were If you were like me, you were probably miserable reading all this slop code that you let slip into your system. And what I want to get to is basically models have a shortcoming. Um they can't maintain and improve codebase quality over time, not without a a decent amount of human steering.
Um and when I say maintainability, I'm basically talking about issues like it
becomes really, really hard to make a change in one part of the codebase without breaking other parts of the codebase. This is Martin Fowler's shotgun surgery, textbook code smell. Um I'm not going to say much more about maintainability. There's a bunch of books that you can go read about it. In fact, John Osterhout is actually here speaking this week, so you can go ask him in person about the philosophy of software design if you want to. Um but it brings us to this question of like why can't models do software maintainability? Um and you may also be saying, but Dex, you know, surely the models have gotten much better since then.
Um they've gotten better in some ways, but they're still about the same in others. Um if you want to solve one-off problems or vibe code a new marketing side, yes, they got way better since 2025 and 2024. But as far as improving code base quality, I think uh they have not gotten much better. Now, I cannot prove this because there are no good benchmarks for a model's ability to maintain code base quality, and I'll get into like where we're going with that. Um, but if you've worked with coding agents for a while, a lot of people are posting about this. It's just like you probably have this vibe that they they generally make things worse over time and make the code base harder to work in.
And to figure out why this happens, I want to zoom out to the first great coding agent. Why did Claude Code go from nothing to 4 billion and I think now they're at 9 billion in revenue in under a year? Cuz they were great CLI agents before Claude Code. You had Aider, you had Code Buff. There was a bunch of tools in this category. They had all the same tools, read, write, edit, grep, bash. Um, so what was the difference? The difference was was that the this was the first time that a model lab trained a model against the harness that they were going to distribute it to users in.
Um, and it got really, really good at this is just some of the tools, but it got really, really good at calling these sorts of tools in an agentic loop. In fact, the OpenAI team did a talk in November about basically if you are a uh harness builder and you don't own
Reinforcement learning optimizes for passing tests
the model weights and you can't RL the model in your harness, you will always be at a disadvantage compared to somebody who owns both the model and the harness. Um, and I'm going to decide a couple slides from my buddy Calvin French Owen, who was a MTS on Codex during the initial launch. Um, but LLMs are just next token predictors. Uh, this is a slide from over a year ago where basically as you're doing your agentic loop, context window goes in, next step comes out. And uh we're going to try to do this. I haven't actually timed this, but we're going to see if we can do coding agent reinforcement learning in 60 seconds.
So, what we're going to do if we want to train a model to get better at tool calling, better at solving software problems, we're going to generate a bunch of We're going to give it a problem and we're going to generate a bunch of traces. Try to solve the problem a bunch of different times. We're going to score them all on correctness and did the test pass and all this stuff. Uh and then we're going to reinforce. We're going to make the bad behavior less likely and we're going to update the weights to make the good behavior more likely. Um this one of the classic ones here is SweetBench multilingual. Uh they're about 15-minute tasks. They're from open-source repos like Redis, JQ, and Django and all this stuff. And they have binary one or zero rewards on did you fix the problem you were trying to fix?
And did you do it without breaking anything else? Um and we look at actually a real problem from one of these benchmarks. This is Fastlane, which is a Ruby project. Um basically, there was some issue where we weren't checking for nil and we have a stack trace blow up because you have a null pointer exception. And in this um in this benchmark, you have a base commit that we're going to check out before the issue was solved by a human in the past. We're going to give it a test patch that says here's what the behavior should be afterwards. We have a golden patch. Both these are hidden from the model.
Uh and so we have the agent go try to solve the problem. We store its patch.
2 Highlight · RL training rewards passing tests over clean architecture
We undo all the changes it made to any test files cuz I'm sure you've seen models comment out tests just to get things working. And then um we're going to apply our golden test patch. Uh and then we're going to run the test. Old test and did the new test pass? And if they both pass, then uh then we get the reward. Otherwise, we don't. Um and so models are trying to get the test to pass. There's no way in this system that we can penalize it for poor program design or for eroding the maintainability of our systems. That's why we get things like this. Try catches around things that probably don't need a try catch.
Or things like this. I think Bybop gave us this example earlier of casting things to other things just so the model can just just it just wants to get the test to pass. Um and so if you can't verify the uh maintainability of the code, it gets way harder to train on this stuff. Um so you remember this picture? Verifying code quality and maintainability is orders of magnitude harder than the code runs and the test pass. Because the cost function of bad architecture is measured in months and
years. If you have a coding episode and then you only find out months later that like somebody vibed this a little bit too hard, it's really hard to propagate that reward signal back across the gap. And now the frontier is getting better, slowly. And since I know someone's going to be in the YouTube comments about this, yes, I know benchmarks and verifiers are different and they actually have to be separate data sets, but they're shaped the same and the the structure of these benchmarks is directionally correct. So we're going to look at these as like what is the future of evaluating code maintainability. Um there's a really cool one called Sweep Marathon from Abundant AI where they do like 400-hour tasks of like clone all of Microsoft Excel, every single feature.
Uh and they have some sophisticated reward channel stuff. Uh Deep Sweep from Data Curve is also like large tasks on OSS repos that are not actually in the training set cuz they were never actually built in the real world. Uh and then you have Frontier Code from Cognition, um which is multi-PR tasks. They do interesting things like hey, if the model writes tests that don't fail on the pre-patch code, then it gets penalized. And then we have a judge model that says, "Okay, uh did this follow all of our code quality rules?"
Um so we're getting better, but I think models judging quality can only go so far uh cuz if the new model if the model knew what good code looks like, it would probably write it in the first place. Uh and review agents and throwing more tokens at the problem, it can raise the floor,
Structured pre-planning makes AI coding maintainable
um but we're still constrained by what we can teach during RL. Um and so I will I will posit that for now we're stuck reading the code, uh but we can still move pretty fast. And of course there's a world where this is solved uh in the future, and if you want to just keep yolowing prompts until you get to GPT-7 and you don't have to think about this, by all means, please. Uh but bitter lesson be damned, we've got some problems to solve. So let's engineer our way out of this. Um so turning the lights back on, we're going to put the code review back. Uh we're going to embrace this approach of like how do we plan up front to reduce the chance that we have a long or difficult review process. We're going to find leverage. We're going to use AI to help with this. Um the first thing we're going to do is we're going to do some sort of product review, understanding what problem we're solving, what's the desired behavior, maybe looking at mock-ups. Here's a product review I was working on yesterday with a mock-up of a new feature. Once we have our product review, we're going to By the way, we don't small stuff still just go straight to the agent.
But once we have the product review, we're going to also do architecture, system architecture. A lot of people have been doing this for a while, component contracts, data models, constraints. This is an example of a doc that we build to understand how these systems are going to fit together and what's like the high-level picture of it. From there, we do something that I think is really under-emphasized in agentic coding these days, which is program design. I think people assume that once you get the architecture right, the model can just cook. But we we often look into the types and the method signatures, the program layout and the call stacks. So here's some examples. I don't think you'll be able to read this one, but this is like the level of abstraction we're at. It's how we're actually going to lay this stuff out and how these systems are going to interact. Dylan Mulroy from Cloudflare talks a lot about how he's using these
3 Highlight · Upfront pre-planning drastically reduces code review friction
call graphs as part of his planning process. I think this is exactly right. And then once we've done the product program design, we can do this thing called vertical slices, which is the order of implementation, multi-repo coordination, how we're going to build this across our entire system, and how are we going to check it along the way. I've talked a little bit about how models have horizontal plans. I won't go too deep into it. If you want to learn more about this, you can go watch our talk from AI Engineer Miami. Couple shots of a doc like this going through the tests and the steps in between each phase.
The main idea here is 30 minutes over here in pre-planning and alignment can save you hours in review. And so it's actually feasible to still read every line of code. We'll skip this part. Basically, the the summary here is like you don't have too many PRs. If you're drowning in PRs, you actually have too many bad PRs. Because a good PR is a joy to to review. It's it's you're just reading through it like, "Yep, this is great. This is what we discussed. This is what we talked about." Um but even if a PR needs 20% rework, which is generous for a lot of AI AI vibe coded slop, um it's an It's an emotional and intellectual burden on both the reviewer and the submitter.
Um and so if you use model assistant planning and alignment, your alignment is shorter cuz you used AI to get all
the information at once. Your code review is faster because you aligned up front, and your coding is faster cuz AI did it. And so you're now you're actually really moving faster, but you're still reading everything and you're still owning the code. So, closing advice, um is easy to hear all this and be a little bummed out. Uh I really like the world where we just YOLO everything, and we can just like not have to ever read code ever again. But uh we're engineers, and these are just constraints, and models are good at certain things, and they're not good at other things. And so go figure out how to solve problems given a set of constraints.
Uh use loops, they're great. Go solve hard problems. Seek leverage. Um if you want to help with this, um we're building Human Layer. Human Layer is an AI IDE and collaboration platform. It's building blocks for your software factory, um and soon to be better vi- verifiers for software quality. Um we've got sort of a Figma for cloud code and Codex-style collaborative workspace. It walks you through the workflows for doing this sort of work. And uh we are talking to design partners. We are hiring founding engineers here in San Francisco.
And uh these slides are live. You can go get them right now. You can try Human Layer at humanlayer.com. Uh it's free for small teams. Go solve hard problems in complex codebases. Thank you all for your energy.
Hey.


