<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhishek Jayaraman on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Jayaraman on Medium]]></description>
        <link>https://medium.com/@abhishekjayaraman96?source=rss-d15f7d15b88d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zUHNAmv8uKDI-7dMWGgVUw.jpeg</url>
            <title>Stories by Abhishek Jayaraman on Medium</title>
            <link>https://medium.com/@abhishekjayaraman96?source=rss-d15f7d15b88d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:35:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishekjayaraman96/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Series: Building a Production-Grade AI Migration System [Part 3 of 5]]]></title>
            <link>https://medium.com/@abhishekjayaraman96/series-building-a-production-grade-ai-migration-system-part-3-of-5-f72f36f4fb56?source=rss-d15f7d15b88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f72f36f4fb56</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[openai-codex]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Abhishek Jayaraman]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 07:03:04 GMT</pubDate>
            <atom:updated>2026-04-27T07:03:53.499Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why We Stopped Letting the Agent Drive</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qDtESfx8Qrt1f-oW.jpeg" /></figure><p>This article is a continuation of a series of articles starting with <a href="https://medium.com/@abhishekjayaraman96/the-hard-part-of-using-codex-for-large-scale-migrations-wasnt-codex-7ef6ff8b32df"><strong>Series: Building a Production-Grade AI Migration System [Part 1 of 5]</strong></a></p><p>The smartest version of this tool was the one we trusted least.</p><p>It could take a repo, run the migration, read the failures, patch the code, rerun the tests, and keep going.</p><p>On a clean repo, that looked impressive.</p><p>On a messy repo, the problem showed up fast.</p><p>One branch would bounce from a failing smoke test to a context-bootstrap failure to a dependency wiring issue, collecting edits without really converging.</p><p>Another repo would keep consuming retries even though the baseline was already dirty and the right answer was to stop, not repair harder.</p><p>That version did produce wins.</p><p>It also made the line very clear: a helpful editing agent is not the same thing as a reliable control plane.</p><h3>The Temptation</h3><p>The temptation was obvious.</p><p>If the model can read code, test output, and logs, why not let it own more of the workflow? Why not let it decide what to fix next, when to rerun, and how long to keep going?</p><p>That idea sounds perfect &amp; efficient.</p><p>It is also how you end up giving the model the wrong job.</p><p>A migration workflow is not just a sequence of edits.</p><p>It is sequencing, policy, repeatability, and stop conditions. It is deciding what should happen next and, just as importantly, when nothing else should happen.</p><p>Those are orchestration decisions.</p><p>They are not editing decisions.</p><blockquote><strong>Capability is not the same thing as control.</strong></blockquote><h3>What Broke First</h3><p>The first thing that broke was <strong>trust</strong>.</p><p>A repo would fail, get edited, rerun, fail differently, get edited again, and very quickly the harder question was no longer “can the agent fix this?” It was “do we still understand what is happening in this run?”</p><p>That is a bad place to be in a migration wave.</p><p>We also kept seeing the same structural problem: the model did not naturally distinguish between “this is worth another scoped fix” and “this repo should stop here.” It would keep pushing forward when what we actually needed was a gate.</p><p>If the baseline is already dirty, pushing forward is not resilience. It is confusion.</p><p>If a shared common module is blocking a whole cohort, letting the model improvise around it is not intelligence. It is drift.</p><p>If the same failure keeps showing up across repos, asking the agent to rediscover the fix over and over is not flexibility. It is waste.</p><p>The model was good at reacting.</p><p>It was not good at governing.</p><h3>The Alternative Wasn’t “No AI”</h3><p>We did not swing all the way to the other extreme.</p><p>A purely deterministic migration factory sounds clean on paper, but major framework upgrades always produce edge cases. Some repos have odd test shapes. Some have wiring assumptions that only show up under the new stack. Some need targeted cleanup that is too specific to deserve another hard-coded rule immediately.</p><blockquote><strong>So the real choice was never “agent everywhere” versus “agent nowhere.”</strong></blockquote><p>It was this:</p><blockquote><strong>Should the agent be the workflow, or should it be a bounded participant inside the workflow?</strong></blockquote><p>That is the architectural decision that mattered.</p><p>We chose the second one.</p><h3>What We Let the Agent Do</h3><p>Once we got serious about boundaries, the agent still had useful work to do.</p><p>It could help harden tests before migration when the suite was obviously carrying bad assumptions.</p><p>It could help modernize tests after the framework move, especially when old conventions had to be rewritten into cleaner, more current patterns.</p><p>And it could operate inside a bounded fix loop, after deterministic remediations had already had their chance.</p><p>Those were good uses of the model because they were scoped and legible. The agent had a narrow job. The pipeline knew which phase it was in. The run could stop cleanly. The outputs were inspectable.</p><p>That is enough.</p><p>An agent does not need to solve everything to be useful.</p><p>It needs to solve the right kind of problem inside a system that already knows how to behave.</p><h3>What We Refused to Let It Do</h3><p>This is where the system got better.</p><p>We stopped letting the agent decide sequencing.</p><p>It did not choose whether to continue after a failed baseline. It did not decide whether a repo should keep retrying. It did not own branch policy. It did not publish merge requests. It did not quietly turn itself into the runtime governor of the whole migration.</p><p>Those decisions stayed in deterministic orchestration.</p><p>That was not because the model was bad. It was because those decisions need consistency more than they need creativity.</p><p>A model can be helpful when asked to clean up a failing test.</p><p>It is the wrong thing to ask whether a repo with an already-failed baseline, a blocked shared dependency, and a prior failed attempt should keep moving through the wave.</p><p>That belongs in the pipeline.</p><blockquote><strong>A good editor is still a bad foreman.</strong></blockquote><h3>The Bounded Fix Loop Was the Turning Point</h3><p>The biggest improvement came when we stopped treating every failure as an invitation for open-ended agent work.</p><p>Instead, we built a <strong>bounded correction loop</strong>.</p><p>The pipeline would run post-migration validation, extract structured root causes from the test reports, apply deterministic fixes first, and only then allow an agent-assisted step if the repo was still in a recoverable state. The retry count was capped. The phase was explicit. The outputs were recorded.</p><p>That changed the character of the whole system.</p><p>The agent stopped being the first instinct.</p><p>It became the last scoped intervention before the run either recovered or stopped cleanly.</p><p>That is a much better place for AI in an engineering system.</p><h3>Why Deterministic Control Won</h3><p>The more repos we touched, the clearer this became.</p><p>Every time we removed ambiguity from the control path, the system got better.</p><p>Every time we left an important workflow decision to the model, the system got harder to trust.</p><p>That showed up everywhere.</p><p>If the same failure kept recurring, the answer was not <strong>“give the agent more room.”</strong> The answer was usually “<strong>promote that fix into deterministic logic.”</strong></p><p>If a repo belonged in a blocked cohort, the answer was not <strong>“let the model see if it can brute-force it.”</strong> The answer was <strong>“respect the gate.”</strong></p><p>The agent did not need more freedom. The system just needed better boundaries.</p><p>That is why I do not think of this as limiting the model.</p><p><strong>I think of it as finally putting it in the right place.</strong></p><h3>What I’d Do Differently</h3><p>I would define the boundaries earlier.</p><p>A lot of early wasted effort came from letting the model operate in zones that should have been deterministic from the start. Stop conditions, retry limits, phase ownership, publish behaviour, branch discipline, and policy-gated repo handling should have been locked down earlier.</p><p>I would also move faster from repeated agent fixes to system rules. If the model solves the same problem often enough, the workflow should absorb that learning instead of paying for the same reasoning every run.</p><p>And I would make the difference between repair work and workflow control even more explicit in the language of the system itself. People blur those together very easily once AI is involved. The architecture should not.</p><h3>What This Changed for Me</h3><p>The practical lesson was simple.</p><blockquote><strong><em>A model is good at local judgment. It is bad at being the thing that runs the system.</em></strong></blockquote><p>That distinction matters much more than most AI tooling conversations admit.</p><p>The important question is not whether the model is capable. But whether it is being asked to carry responsibilities it should never have been given.</p><p>In our case, the right answer was not to remove the agent.</p><p>It was to demote it.</p><p>The workflow needed something stricter than intelligence. It needed memory, policy, sequencing, and the ability to stop cleanly.</p><p>That is why we stopped letting the agent drive.</p><p>The mistake is not “using an agent”. The mistake is letting the agent run the system.</p><p>What actually matters is building a system that decides where the agent is allowed to act.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f72f36f4fb56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Series: Building a Production-Grade AI Migration System [Part 2 of 5]]]></title>
            <link>https://medium.com/@abhishekjayaraman96/series-building-a-production-grade-ai-migration-system-part-2-of-5-795e244894c0?source=rss-d15f7d15b88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/795e244894c0</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[codex-cli]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Abhishek Jayaraman]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 05:38:35 GMT</pubDate>
            <atom:updated>2026-04-15T05:38:35.313Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Rewrite Was Easy. The Tests Were the Real Migration.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3aTsTxJlbGZPnwFG.jpeg" /></figure><p>This article is a continuation of a series of articles starting with <a href="https://medium.com/@abhishekjayaraman96/the-hard-part-of-using-codex-for-large-scale-migrations-wasnt-codex-7ef6ff8b32df"><strong>Series: Building a Production-Grade AI Migration System [Part 1 of 5]</strong></a></p><p>The first few repos gave us the wrong idea.</p><p>The rewrite recipes ran, the code moved, and a couple of services needed only light cleanup.</p><p>For a brief moment, the migration looked mostly mechanical.</p><p>Then the tests started failing.</p><p>Not in one dramatic, exotic way. In the same stubborn ways, repo after repo.</p><p>A smoke test that was supposed to prove “context loads” was actually depending on old bootstrap behaviour. A topology-style test was dragging in far more Spring context than it had any business loading. A data-focused test was quietly coupled to messaging or config wiring it never should have seen.</p><p>That was the real migration.</p><blockquote><strong>The rewrite moved the code. The tests exposed the architecture.</strong></blockquote><h3>What We Thought We Were Doing</h3><p>The original model was simple.</p><p>Apply the rewrite recipes. Let deterministic fixes or Codex handle the rough edges. Run mvn test. Clean up what breaks.</p><p>That model works just well enough to waste time.</p><p>It assumes test failures are mostly local cleanup. In a migration like this, they usually are not. The framework upgrade does not create the mess in the test suite. It stops tolerating it.</p><p>We were not just upgrading code. We were forcing the tests to explain themselves.</p><h3>The First Assumption That Broke</h3><p>Early on, we were too willing to read every post-migration failure as evidence that the migration had broken something.</p><p>That is not how it works.</p><p>Some repos were already unhealthy before the migration started. Others were technically green, but only because the old stack tolerated patterns the newer one would not. A smoke test would pass while quietly relying on implicit config import behaviour. A repository-focused test would pass while loading half the runtime. A stream-processing test would pass while booting a full framework context it did not actually need.</p><p>Once we saw that clearly, baseline validation stopped being optional.</p><p>If the baseline is already dirty, post-migration red tells you very little.</p><p>It is not evidence. It is ambiguity.</p><p>That changed the whole pipeline. We stopped treating every failing post-migration test as an upgrade regression. Sometimes the migration had broken something real. Just as often, it had exposed a bad test boundary that had been sitting there for years.</p><h3>The Rewrite Did Its Job. The Tests Told the Truth.</h3><p>The rewrite recipes handled the broad mechanical churn reasonably well. Imports moved. APIs shifted. Deprecated code paths were rewritten. Most of that was predictable.</p><p>The instability showed up somewhere else.</p><p>Application smoke tests were one recurring example. A test that should have been proving one thing, that the application starts, was actually carrying assumptions about configuration loading or framework bootstrap behaviour far outside that scope.</p><p>Topology-style tests had a different failure mode. Many were written like narrow logic tests, but they were loading far too much Spring context. That made them slower, noisier, and harder to migrate. It also made failures harder to interpret, because we spent more time debugging the test harness than the stream logic.</p><p>Data-focused tests had their own version of the same problem. What should have been a narrow test around repository behaviour or data mapping would drag in unrelated runtime wiring, messaging, startup configuration, or broader application context.</p><p>That is why “the tests failed” is a useless summary.</p><p>What matters is what kind of test failed, what it was trying to prove, and how much unnecessary system it dragged in around that goal.</p><p>Broad context tests are not extra safety.</p><p>At migration time, they are noise multipliers.</p><h3>We Had to Start Classifying Tests, Not Just Running Them</h3><p>At first, the pipeline mostly cared whether mvn test passed or failed.</p><p>That is too blunt.</p><p>A failing unit test usually gives a clean signal. A failing broad context test gives you a pile of secondary damage that you have to peel back before you know what failed first. Treating those as one category wastes time.</p><p>We got better once we stopped looking at “tests” as one bucket.</p><p>Pure unit tests were usually honest. If they failed, the signal was local and worth trusting.</p><p>Slice-style tests were manageable when they stayed within their slice. Once a so-called slice test needed unrelated runtime machinery, the test shape itself became suspect.</p><p>Topology tests were where the naming and the behaviour often diverged. Quite a few tests that looked lightweight were really small integration tests dragging in far too much framework state.</p><p>Full-context tests were the most expensive category in every sense. Some were justified. Many were broad because the old stack let them get away with it.</p><p>A full-context test failure is not automatically high-value signal.</p><p>Sometimes it is just the loudest possible way to learn the test has no boundary discipline.</p><h3>The Hard Part Was Fixing the Tests Without Lying to Ourselves</h3><p>This is where migration work can get dishonest very quickly.</p><p>It is easy to make tests go green by making them weaker. Remove assertions. Stub too much. Narrow the test until it no longer proves anything important. Replace a difficult integration test with something smaller and call it modernization.</p><p>That is not modernization.</p><blockquote><strong>That is just moving failure into the future.</strong></blockquote><p>We had to keep one rule in place the entire time: reduce accidental complexity, not behavioural confidence.</p><p>Some tests needed narrower scope. Some needed explicit properties instead of leaning on old defaults. Some needed updated annotations. Some needed to stop loading framework machinery they were never meant to validate in the first place.</p><p>All of that was valid.</p><p>What was not valid was making the suite easier by proving less.</p><p>Making tests green by weakening them is not migration progress.</p><p>It is deferred breakage with better aesthetics.</p><h3>Where the Real Effort Went</h3><p>Production changes were usually easier to reason about than the tests.</p><p>The code would move, compile, and mostly say what it meant. The tests were where we kept finding hidden scope, accidental framework coupling, and old shortcuts that had never been forced to justify themselves.</p><p>Smoke tests had to become honest about their purpose. If a test exists only to prove that the application context starts, it should not be entangled with unrelated config behaviour.</p><p>Slice tests needed tighter boundaries. If a repository-focused test depends on messaging or broader startup wiring, that is not a migration inconvenience. That is a design bug in the test.</p><p>And the broad context tests needed the harshest scrutiny. Some deserved to exist. A lot of them were simply carrying too much. The framework upgrade did not create that problem. It exposed it aggressively.</p><p>That is why this work stopped feeling like cleanup and started feeling like architecture.</p><h3>What Didn’t Work at First</h3><p>Our early response was too local.</p><p>We would fix one failing smoke test, rerun, and hit the same configuration problem in the next repo. We would narrow one overloaded context test, rerun, and find two more with the same shape. We were treating patterns as isolated incidents.</p><p>That was the mistake.</p><p>We also spent too much time assuming every failure was migration-specific. Quite a few were old test design debts being surfaced by a less forgiving stack.</p><p>And we were not opinionated enough about scope soon enough. If a topology-style test is dragging in a large chunk of Spring context, that is not an unfortunate implementation detail. That is the bug.</p><p>Once we got sharper about that, the fixes improved and the suite became easier to reason about.</p><h3>The Trade-Off We Accepted</h3><p>We made a deliberate decision to spend migration effort on test architecture, not just upgrade mechanics.</p><p>That slows things down in the short term.</p><p>If the only goal is throughput, the temptation is obvious: patch around the tests, keep the repo moving, call it done. If the goal is to produce MRs that engineers can trust, that approach optimizes throughput at the expense of trust.</p><p>A migration that passes because the suite was softened is not a successful migration.</p><p>So we took the slower path.</p><p>We hardened some tests before migration. We modernized others after migration. We turned recurring test-shape issues into deterministic fixes where it made sense. And we kept the baseline gate in place so we did not confuse pre-existing instability with upgrade regressions.</p><p>That was the right trade.</p><h3>What I’d Do Differently</h3><p>I would classify test shapes earlier.</p><p>Not as cleanup. As migration planning.</p><p>If a repo is dominated by broad context tests, that should change the estimate immediately. If its topology tests are really integration tests in disguise, that should change the strategy immediately. If its smoke tests rely on framework behaviour they never explicitly declared, that should be discovered before the migration starts, not halfway through it.</p><p>I would also separate test triage from test modernization sooner. They overlap, but they are not the same job. One is about preserving trustworthy signals during migration. The other is about improving the suite for the long term.</p><p>And I would be even less patient with tests that load far more than they need. Those tests are expensive when the system is stable. During a framework upgrade, they become actively destructive.</p><h3>What This Changed for Me</h3><p>The biggest lesson was not about rewrite tooling.</p><p>It was about test suites.</p><blockquote><strong>Tests are not passive safety rails sitting outside the system. They are part of the System Design.</strong></blockquote><p>If they are clean, migration feels mechanical. If they are carrying years of accidental architecture, the migration turns into archaeology.</p><p>That is what happened here.</p><p>The rewrite moved the code. The tests told us where the boundaries were fake, where the wiring was dishonest, and where we had been relying on framework tolerance instead of clarity.</p><p>Major upgrades do not just test your code.</p><p>They test whether your tests are honest.</p><p>And when they aren’t, that becomes the real migration.</p><p>The mistake is thinking tests validate the system.</p><p>What actually matters is whether the tests themselves are worth trusting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=795e244894c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Series: Building a Production-Grade AI Migration System [Part 1 of 5]]]></title>
            <link>https://medium.com/@abhishekjayaraman96/the-hard-part-of-using-codex-for-large-scale-migrations-wasnt-codex-7ef6ff8b32df?source=rss-d15f7d15b88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ef6ff8b32df</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[codex-cli]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Abhishek Jayaraman]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 05:23:26 GMT</pubDate>
            <atom:updated>2026-04-10T07:12:14.158Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Hard Part of Using Codex for Large-Scale Migrations Wasn’t Codex</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HmjPdpUtrpEFmJp3ejYu7Q.jpeg" /></figure><p>The first few successful migrations were a trap.</p><p>We pointed Codex at a repo, let the rewrite recipes do the broad changes, cleaned up the fallout, and a couple of services went through. That is exactly the kind of early result that convinces you the hard part is over.</p><p>It wasn’t.</p><p>The moment we ran it against a real migration wave, the pattern showed up. Not one exotic failure. The same few failures, over and over: application smoke tests breaking on framework config assumptions, topology-style tests pulling in far more Spring context than they should, dependency overrides drifting in inconsistent ways, and whole repo cohorts blocked by a shared common module that had to move first.</p><p>At that point, the problem stopped being “can the model generate a fix?” and became what it really was: a systems problem.</p><h3>What We Were Actually Building</h3><p>We were not trying to migrate one repository.</p><p>We were trying to move a fleet of Java services through a major Java upgrade and a Spring Boot upgrade, produce one reviewable merge request per service, and do it in a way that engineers could trust even after the third rerun, not just admire in a demo.</p><p>That distinction matters.</p><p>When you are migrating one service, you can get away with manual judgment and some tolerated mess. When you are migrating dozens, “just rerun it” stops being a convenience and starts being a design bug. You need the system to remember what already happened. Which services already produced an MR. Which ones failed without producing one. Which ones are blocked by a shared dependency. Which ones are safe to retry. Which ones are not.</p><p>Once you get to that point, model output is only part of the story. Run memory matters. Evidence matters. Safe reruns matter. Reviewability matters.</p><p>That is why the tool became local-first and evidence-heavy. It cloned repositories into a controlled workspace, wrote reports for each phase, committed changes in deterministic steps, and aimed for exactly one MR per repo attempt. The automation was useful. The memory was what made it operational.</p><h3>The First Approach, and Why It Broke</h3><p>The naive version was simple:</p><ul><li>Run the rewrite recipes.</li><li>Ask Codex to fix what broke.</li><li>Run mvn test.</li><li>Repeat until green.</li></ul><p>That is a very natural first design. It is also not enough.</p><p>The problem is that migration failures are rarely unique. They are repetitive. Once we moved beyond a handful of repos, we were not seeing clever new failures each time. We were seeing the same categories of breakage wearing different clothes.</p><p>A smoke test would fail because configuration import expectations had changed. A context-heavy test would collapse because it was loading far more framework wiring than the test actually needed. A shared library dependency would pin an entire cohort of services to the ground. A dependency override that should have been enforced centrally would get rediscovered repo by repo.</p><p>That is the moment the first approach falls apart. If the same issue keeps appearing, asking the model to rediscover the same fix is not intelligence. It is waste.</p><p>The other problem was trust.</p><p>Agentic repair sounds good right up until a run fails halfway through and you cannot answer basic questions. What changed? Which phase failed? Did it publish anything? Is there already an MR open from an earlier attempt? If I rerun this, am I recovering state or creating more drift?</p><p>That was the turning point.</p><p>We stopped treating Codex as the migration engine and started treating it as one bounded capability inside a governed pipeline.</p><h3>The Decisions That Actually Mattered</h3><p>The most important decision was that the agent does not own orchestration.</p><p>That is the line that changed the system.</p><p>Discovery, branching, baseline validation, rewrite phases, fix loops, commits, and publish all stayed in deterministic scripts. AI was allowed to help in narrow places, but it was no longer allowed to decide whether the pipeline should continue, retry, or stop.</p><p>That trade-off was worth it immediately. Every time we removed ambiguity from the control path, the system got better. Every time we left a critical decision to the agent, it got harder to trust.</p><p>The second decision was keeping execution local-first.</p><p>We wanted state on disk, not buried in model context and not scattered across transient logs. That meant local clones, local reports, explicit per-phase artifacts, and durable output that could be inspected after the fact. If a previous attempt failed without creating an MR, the system needed to know that. If a service had already been migrated, the system needed to skip it cleanly. If a rerun collided with an already-open MR, that needed to be recoverable, not surprising.</p><p>The third decision was promoting repeated fixes out of prompts and into code.</p><p>This was probably the most practical improvement we made. Once a class of failure repeated often enough, it stopped being something the model should “figure out” and became something the system should handle deterministically. Test annotation drift after the framework move. Configuration normalization. Common post-rewrite cleanup. Dependency remediations. Vulnerability version enforcement. Those did not belong in prompt space forever.</p><p>The fourth decision was adding policy.</p><p>Not every repository was equally migratable at the same time. Some had to be skipped. Some had to be deferred. Some were blocked by shared common modules. Some had already produced an MR. Some had prior failed attempts and should not be retried blindly.</p><p>Without policy, reruns become noise. With policy, the system starts acting like it has a memory.</p><h3>The Happy Path Was Never the Interesting Part</h3><p>The basic flow was not complicated.</p><p>Discover repositories. Clone the target. Create a migration branch. Validate the baseline. Apply rewrite phases. Run deterministic fixes. Validate again. Commit by phase. Publish one MR.</p><p>The happy path was boring.</p><p>The interesting part was what happened after the first failed post-migration test.</p><p>That is where the system had to grow up. We added a bounded fix loop, but even there the model did not get first shot. The system extracted structured root causes from test reports, classified failure patterns, applied deterministic fixes first, and only then allowed an external AI-assisted correction step. Retries were capped. Every round left evidence. Nothing important depended on “the model probably remembers what happened.”</p><p>That ordering matters more than it sounds.</p><p>If the model is your first instinct, the system keeps improvising. If the pipeline can already explain the failure, classify it, and apply known corrections, then the model becomes useful for the remaining edge cases instead of carrying the entire process on its back.</p><p>We treated the agent hooks the same way. Pre-migration and post-migration AI stages were explicit, optional, scoped, and time-bounded. They were not allowed to quietly become the control plane.</p><p>Publishing taught the same lesson from a different angle. Human-friendly push flows are often a bad fit for unattended execution. Reruns surfaced branch collisions and already-open MR conflicts quickly. Publish had to become idempotent enough to recover existing state instead of pretending every run was starting from scratch.</p><p>That pattern kept repeating: whenever we removed ambiguity, the system improved.</p><h3>What Broke in Real Life</h3><p>A few assumptions did not survive contact with the repo fleet.</p><p>The first was baseline health. Some services were already failing before migration. That changes how you read every later result. If the baseline is unhealthy, a post-migration failure is not automatically a migration failure. Once we accepted that, baseline validation stopped being a courtesy and became a gate.</p><p>The second was assuming the rewrite recipes would do most of the hard work. They handled the broad mechanical changes reasonably well. The pain lived in the edges: tests, framework conventions, shared modules, dependency management, and repo-specific assumptions that had been quietly accumulating for years.</p><p>The third was assuming the repositories were independent enough to move in a clean sweep. They weren’t. Shared modules created real migration coupling. One common dependency could block an entire cohort. That is not elegant, but it is normal in large systems, and the migration tooling had to reflect that reality instead of pretending every repo was self-contained.</p><p>The fourth was assuming one retry mechanism would cover most failures. It didn’t. Some failures were straightforward compilation breaks. Some were full application context collapses. Some came from tests that were carrying infrastructure assumptions they never should have had. Some were vague enough that early versions of the system could only classify them as “other.” We had to get much better at structured failure reporting before we got materially better at automated correction.</p><h3>What I’d Do Differently</h3><p>I would classify service shapes earlier.</p><p>A lot of the later stability came from admitting that the repositories were not interchangeable. Some were messaging-heavy. Some were dominated by context-heavy tests. Some were tightly coupled to shared libraries. Some were already partially migrated. We learned that through failure. Next time I would model it much earlier.</p><p>I would also move faster from repeated agent fixes to deterministic rules. The first few times the model solves a migration issue, that is useful. After that, it should start losing the privilege of being clever. If a problem is recurring, the system should absorb it.</p><p>And I would invest in structured failure reporting from day one. Once we stopped arguing from raw logs and started working from repeatable root-cause patterns, improvement got much less anecdotal.</p><h3>What This Changed for Me</h3><p>The main lesson was not that Codex is limited.</p><p>The lesson was that in this kind of system, the model should not decide whether a run keeps going. That decision belongs to the pipeline.</p><p>If orchestration is loose, the model ends up owning decisions it should never own. If retries are open-ended, failure turns into drift. If there is no durable run memory, every rerun behaves like a first attempt. If repeated breakages stay in prompt space, the system never really improves.</p><p>What worked was much less magical than the first version.</p><p>Keep orchestration deterministic. Keep evidence on disk. Bound retries. Track prior outcomes. Promote recurring fixes into code. Use the model where judgment helps, not where control is required.</p><p>We thought the hard part was getting Codex to fix migrations.</p><p>It wasn’t.</p><p>The hard part was building a system that knew when not to trust it.</p><p>The mistake is thinking AI replaces engineering.</p><p>What actually works is engineering that knows exactly where AI belongs and where it doesn’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ef6ff8b32df" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>