# Transcript: Maintaining Large AI Coding Projects Hi, I'm Dmitry. In this session, I will show how I work on maintaining large AI coding projects. Coding agents made code cheap. They made entropy even cheaper. In the Marvel movie, Thanos watched his home planet Titan collapse under its own growth. So when the universe got crowded, he raised half of everything. This talk is about the one time I did the same in one project.
Our code was growing the way Titan did. When I found what my agents had done, I deleted tests and boilerplate code nobody used. I had to rewrite the whole project and I lost some useful pieces. And that's the dilemma. Drown in chaos or break what people use. And here we'll build the third option. For that project, the rewrite didn't hold. The agents kept writing and the mess grew back. So I drew a line. Above it, there is more change than anyone can check. The third option is to stay under it with small sweeps every week and feedback loops built into the system. Each chapter of this talk is one thing I had to learn to get there.
The first one is time. How do we stay under the line? **Chapter 1.** To stay under the line, I first had to know what right means here. I used to think the tests decide that. So what does right actually depend on? Let's keep one task in mind. Someone wants to change the amount on an order we already approved. We run this in 110 countries with about 10,000 scenarios of prose instructions. Every task lands in a slice. One process in one country. There's a second stone, space. It asks where a change is allowed to go. By default, it stays inside its slice. Most of this system is prose. About three quarters by my estimate. So prose needs engineering too.
At start, we borrowed mutation testing. You break one sentence on purpose and you watch for red test. Here, almost none turned red. And if your wrapper is all code, your agent instructions and your tests are your prose. With agents, a rewrite is easy. The hard part is knowing what has to survive it. For code, tests can tell you. For prose, only people can.
Agents can't build a complex system on their own. They fix what is easy to see and break consistency on the way. And people also get tired. So we spend their judgment only where it's needed. When business asks check with the team, it hides a real question. Is this a human step or can we automate it? Experts can't answer that. They don't see how the systems connect inside. So developers dig through the traces and logs with their coding agents and they decide which it is.
In our task, the team leads the decision stays human. The limit was data we could connect. Business experts see the rules. Developers see what's under the water. And that's where most bugs live. They have their coding agents write those links down so the runtime can check them. Our guide for experts says it simply. Business tells us what. We work out how. One document to readers. Agents read the blocks. So their blocks have to be exact. Experts read the text around them and they sign it. We keep one copy. The second one we drift. And it works both ways. Our code needs a plain description for experts too.
Experts can only fix what they can see. Each of them reviews a task exactly the way the agent saw it. They know it becomes the next change, made by a coding agent and tested on that same task. So write depends on people. No single person knows it. A group of experts decides. And that's why we bring them in from the start.
You'll see the soul stone here a lot. We take it in chapter 4. **Chapter 2.** Experts correct one task at a time. While agents run the same prose all day. We track every outcome. Accepted or rejected. The accuracy shows us where people still need to look. I used to think the goal was to move everything into code. So where do we still need judgment? Here's our task again. The prose says the limit is 1500. The code says 1000. The same order is fine in one place and too high in the other. And nothing throws an error. Even a line saying do not call X teaches the model that X exists. That's the third stone reality. Is it true or does it only look true for the model?
Prose has no compiler. So we build one. Then the author links every changed file into ledger. Just like code. Lint can't stop copies drifting apart. So we watched the walks. A walk is the path one agent takes through the prose. When agents keep walking the same path, we turn it into one workflow tool and we delete the prose that walked it. Our first workflow tools made things worse. The prose still named the steps inside them. So agents run those steps again. It worked once the prose kept only the decisions. Now a walk becomes code only when it repeats. The prose and agrees across countries. Otherwise it stays prose.
What still varies stays in prose inside the frame. Code prepares the facts and carries out the decision. Experts own the decision table. And the model only picks a row. If no row fits, a person takes over. We haven't built the next step yet. The model will take the small decisions and workflows will connect them. This boundary moves both ways. We moved hundreds of lines of expressions out of code and into prose. Because experts couldn't read them. A regex is still fine for spotting a critical signal. When there are many, they move into config. Judgment stays wherever the answer varies. In a place an expert can read.
**Chapter 3.** Now the model decides and its decision becomes an action. I used to think control meant permissions on the agent. So what does it mean to stay in control? Control starts with what the model sees. That's what the fourth stone mined. What does the model know? When we let it choose what to load, it loaded everything. Then it invented a pricing check just because prices were visible. Whatever sits in its context becomes a reason to act.
The runtime decides what the model sees. For our task, there's three facts from the order. The full record stays with the runtime and the model makes fewer wrong moves. Here's how we minimize context bloat. For a big set, the model passes a handle, a short name for data that the runtime already holds. The runtime checks it before any write. It keeps the context small and still enough for the decision. At the same time, it validates context for consistency.
A model with the right facts can still do damage. That's the fifth stone. Power. What may change? We control a change twice. During development and again at the write at runtime. Only code opens a write path so we can change prose many times a day. The open rings are the parts that still depend on people. Let's zoom in and run write. Five walls stand in front of it. And the sixth checks that it landed. If a write looks like it failed, an agent retries and the journal makes sure it runs only once. Control means much more than permissions on the agent.
**Chapter 4.** Most days I glide over the system. From up here everything looks fine. So I don't go down into every change my agents made. Then the surface gets rough. How do we know we're losing control? All those controls protect the system. Nothing protected my attention. At the start I read every change and that's how the system picked up my habits. Then the volume grew past what one person can read. I was burning out and I stopped reading every change. That was the price of the last stone. So who judges and what does it cost?
With it the gauntlet is complete. Every tech lead I know has been here. The one person every change waits on. Agents just get you there in weeks instead of years. I needed a way of working that doesn't run through one head. And the first gauge was me. When I'm tired and I can't explain what changed, that's the signal. The dashboard can be green while that gauge is firing. So I stop and fix the process first. I don't wait for a number.
I couldn't read every div anymore. So I built instruments that watch how things change and their derivatives. One of them is blast radius. Before we built one new check we replayed its rule over several thousand past sessions. It would have fired on less than one percent. Where the numbers jump I go down and read. When something looks wrong we wait. One signal waits until it comes back, even when it comes from an expert. A cluster across slices is different. Then we fix the concept behind it once. Left alone an agent keeps adding conditions until today's tasks pass. The eval score drops when you take them out and you get an honest list of gaps.
One red slice is rarely alone. The experts node becomes an eval and an agent searches for the siblings for the same failure. Siblings differ on purpose by market and by local law. So we sweep them and the fix goes only where the failure is confirmed. At any time 10 to 20 of these loops are open. At one point I had become the message bus between users and my agents. At this scale every user has to be an evaluator with a screen to give feedback without me. My job as the architect is to build those loops into the system. Each loop writes to a ledger so nothing waits on my memory and nothing waits on me.
Agents forget everything when a session ends so the memory has to leave in the files. We keep two kinds. What happened and what is true now. The next session starts from what is true now. Every issue has to connect to its root cause. Without that the agent decides on wrong facts and the check has nothing to count. So we don't act without evidence. Reality comes back. In chapter 2 it asks if the prose is true. Now it asks if the change is.
I used to trust green. So what would make us change our mind? Green was tempting because checking is where the time goes. My agent spent almost 9 tenths of that time on a change just checking it. And checking took a bigger share of my own week too. Verification speed is the limit. We rank evidence by what it proves. A replay on real tasks sits at the top. Before the data arrives we write down what would prove us wrong. And every new check has to fail once on purpose before we trust it.
AI refactors fail quietly. Every condition and every decision table row is a branch. And after a refactor each one has to land exactly once. Here the branch for amounts over the limit got lost. Our order would have gone through without the team lead. Real tasks decide what we test. We freeze them as a set and replay the old version against the new one. If no real task takes a branch we call that no evidence. You can't trust one agent to judge its own work. A second agent checks it with a checklist and without the author's reasoning. It can't be talked into agreeing. Over 6 months it grew to most of my checking.
Coding agents finish most of a batch and quietly skip the rest. Especially when their context is full. The ledger shows what was skipped. In one backlog most items look covered but only about a quarter could really be closed. So evidence we can count is what changes our mind. This is the third option from the start of the talk. I used to think there were two choices. Keep everything or snap. So what is worth carrying forward? This one process over a year. Some branches merged back. Some still drift. And some are dead but still look alive. Which ones deserve to survive?
A fix is only a moment. These forces keep pushing right after it. You've met most of them already. This chapter deals with regrowth and branching. The first gauge was me back in chapter 4. These are the gauges for the code. Time gets its answers here. The breach line comes back as a number. A ratchet means the count can only go down. Two gauges run today and six more are next.
The first test. Every week real use decides what stays. Anything no real task reaches gets a name and its evidence before it goes. That's the evidence I didn't have when I snapped. Tests kept dead variants alive. Agents kept every option at tests still mentioned. Now a retired variant takes its test with it. Here's the whole method as one week. This is the third option as a process. Together that's the full gauntlet. Thanos used his for one snap. We use ours every week in small doses with evidence. I haven't had to snap again.
Sol had a second price and I only saw it later. After we delivered it to production, I found my own engineering principles built into the system's design. Its skills and its memory carry my habits and my biases. Conway said the system copies the org chart. Ours copies whoever corrects it. Here are 18 questions. Three for each stone. I'm using them when working on my projects. Pause here and pick one your own repository can't answer yet. That's where to start. I learned to use this process when I was already burning out. If you're the one your team's changes wait on today, this is for you. Use your stones while you can still read every change.
In the end, Thanos retires to a garden. Maybe he should start using them daily. Thank you. out of code and into pros. Because experts couldn't read them. A regex is still fine for spotting a critical signal. When there are many, they move into config. Judgment stays wherever the answer varies. In a place an expert can read. Chapter 3. Now the model decides and its decision becomes an action. I used to think control meant permissions on the agent. So what does it mean to stay in control? Control starts with what the model sees. That's what the fourth stone mined. What does the model know? When we let it choose what to load,
it loaded everything. Then it invented a pricing check just because prices were visible. Whatever sits in its context becomes a reason to act. The runtime decides what the model sees. For our task, there's three facts from the order. The full record stays with the runtime and the model makes fewer wrong moves.
Here are how we minimize context bloat. For a big set, the model passes a handle, a short name for date that the runtime already holds. The runtime checks it before any write. It keeps the context small and still enough for the decision. At the same time, it validates context for consistency. A model with the right facts can still do damage. That's the fifth stone. Power. What may change? We control a change twice. During development and again at the right at runtime. Only code opens a right path so we can change pros many times a day. The open rings are the parts that
still depend on people. Let's zoom in and run right. Five walls stand in front of it. And the sixth checks that it landed. If a right looks like it failed, an agent retries and the journal makes sure it runs only once. Control means much more than permissions on the agent.
Chapter four. Most days I glide over the system. From up here everything looks fine. So I don't go down into every change my agents made. Then the surface gets rough. How do we know we're losing control? All those controls protect the system. Nothing protected my attention. At the start I read every change and that's how the system picked up my habits. Then the volume grew past what one person can read. I was burning out and I stopped reading every change. That was the price of the last stone. So who judges and what does it cost? With it the gauntlet is complete. Every tech lead I know has been here. The one person every change waits on.
Agents just get you there in weeks instead of years. I needed a way of working that doesn't run through one head. And the first gauge was me. When I'm tired and I can't explain what changed, that's the signal. The dashboard can be green while that gauge is firing. So I stop and fix the process first. I don't wait for a number. I couldn't read every div anymore. So I built instruments that watch how things change and their derivatives. One of them is blast radius. Before we built one new check we replayed its rule over several thousand past sessions. It would have fired on less than one percent. Where the numbers jump I go down
and read. When something looks wrong we wait. One signal waits until it comes back, even when it comes from an expert. A cluster across slices is different. Then we fix the concept behind it once. Left alone an agent keeps adding conditions until today's tasks pass. The eval score drops when you take them out and you get an honest list of gaps. One red slice is rarely alone. The experts node becomes an eval and an agent search for the siblings for the same failure. Siblings differ on purpose by market and by local law. So we sweep them and the fix goes only where the failure is confirmed.
At any time 10 to 20 of these loops are open. At one point I had become the message bus between users and my agents. At this scale every user has to be an evaluator with a screen to give feedback without me. My job as the architect is to build those loops into the system. Each loop writes to a ledger so nothing waits on my memory and nothing waits on me. Agents forget everything when a session ends so the memory has to leave in the files. We keep two kinds. What happened and what is true now. The next session starts from what is true now.
Every issue has to connect to its root cause. Without that the agent decides on wrong facts and the check has nothing to count. So we don't act without evidence. Reality comes back. In chapter 2 it asks the pros is true. Now it asks if the change is. I used to trust green. So what would make us change our mind? Green was tempting because checking is where the times goes. My agent spent almost 9 tenths of that time on a change just checking it. And checking took a bigger share of my own week too. Verification speed is the limit.
We rank evidence by what it proves. A replay on real tasks sits at the top. Before the data arrives we write down what would prove us wrong. And every new check has to fail once on purpose before we trust it.
AI refactors fail quietly. Every condition and every decision table row is a branch. And after a refactor each one has to land exactly once. Here the branch for amounts over the limit got lost. Our order would have gone through without the team lead. Real tasks decide what we test. We freeze them as a set and replay the old version against the new one. If no real task takes a branch we call that no evidence. You can't trust one agent to judge its own work. A second agent checks it with a checklist and without the author's reasoning. It can't be talked into agreeing. Over 6 months it grew to most of my checking.
Coding agents finish most of a batch and quietly skip the rest. Especially when their context is full. The ledger shows what was skipped. In one backlog most items looks covered but only about a quarter could really be closed. So now evidence we can count is what changes our mind. This is the third option from the start of the talk. I used to think there were two choices. Keep everything or snap. So what is worth carrying forward? This one process over a year. Some branches merged back. Some still drift. And some are dead but still look alive. Which ones deserve to survive?
A fix is only a moment. These forces keep pushing right after it. You've met most of them already. This chapter deals with regrowth and branching. The first gauge was me back in chapter 4. These are the gauges for the code. Time gets its answers here. The breach line comes back as a number. A ratchet means the count can only go down. Two gauges run today and six more are next. The first test. Every week real use decides what stays. Anything no real task reaches gets a name and its evidence before it goes. That's the evidence I didn't have when I snapped. Tests kept dead variants alive. Agents kept every option at tests still mentioned.
Now a retired variant takes its test with it. Here's the whole method as one week. This is the third option as a process.
Together that's the full gauntlet. Thanos used his for one snap. We use ours every week in small doses with evidence. I haven't had to snap again.
Sol had a second price and I only saw it later. After we delivered it to production, I found my own engineering principles built into the system's design. Its skills and its memory carry my habits and my biases. Conway said the system copies the org chart. Our's copies whoever corrects it. Here are 18 questions. Three for each stone. I'm using them when working on my projects. Pause here and pick one your own repository can't answer yet. That's where to start.
I learned to use this process when I was already burning out. If you're the one your team's changes wait on today. This is for you. Use your stones while you can still read every change. In the end, Thanos retires to a garden. Maybe he should start using them daily. Thank you.