Coding agents that port old software to new languages or library versions mostly work the same way. They make a change, run the compiler and tests, paste the errors back into the model, and try again. This loop has no memory of which decisions have earned trust. A fix that passed at forty call sites can be undone the moment an unrelated test fails, so agents thrash between incompatible dependency states. They also settle for one local compatibility shim instead of carrying a correct pattern across the codebase. Cell biology has a well-studied answer to a similar problem. In an autocrine loop, a cell secretes a signal that it also responds to. The response makes the cell secrete more of the signal, so a faint, transient trigger becomes a stable, committed state. Leaving that state requires much more than entering it.
We propose to give migration agents this kind of commitment. Each candidate migration decision gets an activation level, for example "replace javax.xml.bind calls with Jakarta equivalents" or "pin library B to major version 3". The level rises with independent passing evidence from distinct call sites. A higher level makes the agent more likely to try the decision at new sites, which mirrors the autocrine amplification. The level decays slowly. Once it crosses an upper threshold the decision locks, and it unlocks only if contrary evidence pushes it below a lower threshold. The gap between the two thresholds is hysteresis: the system resists flipping back and forth. The claim we test is narrow. On repository-level migration with sparse or noisy tests, graded, hysteretic commitment reduces thrashing and shim-style workarounds and raises full-migration success. It should do better than both plain self-debugging and simpler "lock once it passes" rules.
What the two directions contribute
The software side supplies the failure we target. MigrationBench migrates Java 8 repositories to Java 17/21. It finds that 10–20 rounds of self-debugging rescue many runs on minimal migration, where the code must compile and pass existing tests. Maximal migration, which also requires upgrading all dependencies to current major versions, stays hard for every model, because breaking changes in one library cascade into another. CodeTaste shows the same weakness on refactoring. GPT-5.2 scores 69.6% alignment when told exactly what to refactor but 7.9% when it must find the refactoring itself. It tends to leave behind a compatibility shim instead of updating hundreds of call sites. CODEMENV reports that the dominant error is a "CallError": the model correctly identifies the incompatible function and then calls it anyway. All three findings motivate the proposal. Each points to an agent that can find a correct local fix but cannot hold onto it and spread it.
Repair loops are the method we modify, not replace. The five-phase pipeline in Systematic LLM Translation of Legacy Scientific Code to Differentiable Frameworks translated a 19,000-line Fortran model into JAX using "Ralph loops". These loops re-inject failed traces until outputs match the original Fortran within tolerance, and 81.2% of bugs were fixed without human help. That loop is purely reactive. It works when a dense numerical oracle exists, which is exactly what most enterprise repositories lack. Two further results act as constraints, since they rule out "just iterate longer": Yan et al. found that compiler-feedback gains plateau quickly, and Srivastava et al. found that iterative prompting can reinforce errors.
The biology side supplies the control design, not an analogy to be decorated. Dynamic Regulation of Myosin Light Chain Phosphorylation by Rho-kinase models a protein network with ordinary differential equations. It shows that an enzyme that switches on its own activity turns a 100-second pulse into phosphorylation sustained past 2,000 seconds. Whether the system is a toggle switch or merely transient depends on the enzymes' kinetic constants. We borrow two things from it: the self-activation term, and the fact that bistability is a tunable regime rather than a given. The EP4 mesangial-cell study and the LIF/LIFR–STAT3–SOX2 study contribute the second idea. Once a self-sustaining loop is established, blocking the original trigger stops working, and intervention has to target the loop node itself, such as the EP4 receptor or the LIF super-enhancer. In migration, the corresponding move is diagnostic. When a run stalls, we look for the pair of locked or near-locked decisions that keep re-triggering each other's failures and intervene there. Restarting from the root error does not address that loop.
No paper in our search connects these directions. The closest work is the Ralph-loop pipeline and MigrationBench's self-debugging baseline. Both feed errors back but keep no persistent, evidence-weighted state over decisions.
Core Claim
Let $a_d$ be the activation of decision $d$. At each agent round $t$, $e_d^{+}$ counts call sites or modules where applying $d$ led to newly passing compilation or tests, and $e_d^{-}$ counts sites where $d$ was implicated in a new failure by trace attribution. The update is
$$a_d \leftarrow a_d + \alpha\, e_d^{+}\left(b + \frac{a_d^{\,n}}{K^{n} + a_d^{\,n}}\right) - \beta\, e_d^{-} - \gamma\, a_d .$$
Here $\alpha$ and $\beta$ weight positive and negative evidence and $\gamma$ is a slow decay. The bracketed Hill term, with baseline $b$, half-saturation $K$ and steepness $n$, is the self-amplification: a decision that is already partly trusted gains more from each new success. This is the term that, in the myosin model, produces two stable states instead of one. A decision locks when $a_d > \theta_{\text{on}}$ and unlocks only when $a_d < \theta_{\text{off}} < \theta_{\text{on}}$.
Activation does three things. First, locked decisions are injected into every subsequent prompt as constraints, which directly targets the CallError pattern. Second, the agent's choice of which call site to edit next is weighted toward sites where high-activation decisions apply but have not been tried, which is the propagation step aimed at CodeTaste's lazy shims. Third, failures that touch a locked decision are first attributed to other decisions.
The prediction that follows from the dynamics is specific. The two-threshold design should beat a single threshold in proportion to how noisy the test signal is. With dense, reliable tests, a simple lock-on-pass rule should be about as good.
Research Program
We will build the commitment layer as a wrapper around an existing tool-using migration agent, so the base model, tools and prompts stay fixed. Decisions are extracted from each diff in one of two ways. For edits, we mine a before/after rewrite pattern over the abstract syntax tree, the parsed tree structure of the code. For build-file changes, we record dependency-version pins. Evidence attribution maps failing stack traces and compiler errors back to the decisions whose edited lines they touch.
We first fit $\alpha, \beta, \gamma, K, n$ and the thresholds on a development split of MigrationBench's full set. Then we run a bifurcation sweep, which varies the parameters to find where the system changes behaviour, borrowing the methodology of the myosin study. This maps the regime where the system is monostable, so decisions never lock, against the regime where it is bistable. We will report where the useful operating point sits. A second component is the stall diagnostic. When the maximal-migration pass rate fails to improve over $k$ rounds, we build the graph of decisions that co-occur in each other's failure attributions. We find its strongest mutually reinforcing cycle and then either force-unlock one member or ask the model for a joint resolution of the pair.
Baselines
The naive reference point is a single-shot migration with no feedback, run with the same base model. It shows how much any loop adds.
The strongest existing method is iterative self-debugging as implemented in MigrationBench. Compiler and test logs are fed back for up to 20 rounds, and the strongest model there was Claude-3.5-Sonnet-v2. For this baseline on MigrationBench, no reported pass rate was found on Lacuna, only the qualitative finding that runs often succeed after 10–20 rounds and that maximal migration is much harder. We will therefore re-run it ourselves on migration-bench-selected (300 repositories). On GitChameleon 2.0, the corresponding reported figures are 48–51% success for top enterprise models and roughly a 10–20% gain from self-debugging. On CodeTaste's Open Track, the reference is GPT-5.2's 7.9%, and 20.6% with oracle selection of the best of five plans. On CODEMENV the references are 33.56% for OLD2NEW (Easy), 12.77% for NEW2OLD, and GPT-4o's 43.84% overall. Every arm uses the same base model, the same 20-round cap, the same per-task token and tool-call budget (CodeTaste's $11 limit where applicable), and the same repositories. Commitment-layer hyperparameters are tuned on the development split only, and the self-debugging prompt receives an equal tuning budget.
Beating self-debugging means a statistically significant gain in maximal-migration pass rate on the selected set under the same budget, without a loss on minimal migration. On CodeTaste, the target is an Open Track alignment score above the plain-loop score from our own runs. We would count reaching the 20.6% oracle-plan level without an oracle as a strong result.
Four ablations isolate the key ingredient. "Lock-on-first-pass" commits a decision the first time it passes. "Single threshold" sets $\theta_{\text{off}} = \theta_{\text{on}}$. "No amplification" sets the Hill term to zero, which makes activation a plain evidence count. "Propagate-without-lock" spreads high-activation patterns to new sites but never locks them. Finally, we run the stall diagnostic with and without commitment to separate its contribution.
Why not just…?
Why not just run self-debugging for more rounds? MigrationBench already gives self-debugging 10–20 rounds and still finds maximal migration hard. Yan et al. report that compiler-feedback gains plateau. We include round-count curves up to the cap for both arms. If plain self-debugging catches up given the same budget, our claim fails.
Why not just lock any change once it passes, or apply the first successful fix everywhere? This is the real threat. It captures most of the intuition with none of the dynamics. It is exactly our lock-on-first-pass and propagate-without-lock ablations. Our prediction is that it matches the full method when tests are dense and loses when tests are sparse, because one spurious pass then locks a wrong decision. If it matches us across all coverage levels, we will report that the biological ingredients add nothing beyond simple memoization.
Why not just retrieve updated API documentation? GitChameleon 2.0 shows retrieval gives up to a 10% gain but leaves top models near 48–51%. CODEMENV's CallError finding shows that knowing about a change does not stop the model from calling the old function. We include a retrieval arm and a retrieval-plus-commitment arm to test whether the two gains add up.
Why not just use rule-based rewriters such as OpenRewrite, or verified lifting? MigrationBench reports that OpenRewrite handles scripted recipes but not repository-specific conflicts. LLMLIFT needs restricted target languages that SMT solvers, automated theorem provers, can reason about, and real repositories do not fit those languages. We run OpenRewrite as a reference on the Java subset, and we treat its recipes as optional pre-locked decisions rather than competitors.
Proposed Experiments
The main experiment is MigrationBench-selected, minimal and maximal tiers, with all arms above. Alongside pass rates we measure thrash rate: the fraction of edits later reverted, and the number of times a dependency pin flips. The second experiment is CodeTaste's Open Track. Here we measure alignment score and shim rate, meaning the fraction of runs whose final diff introduces a compatibility wrapper instead of updating call sites. The third is CODEMENV in both directions, which tests whether locked decisions narrow the NEW2OLD gap. The NEW2OLD direction is plausibly where the model's forward-looking priors keep overriding correct older-version calls.
The decisive check is a coverage sweep. We take repositories from migration-bench-full and randomly delete 0%, 25%, 50% and 75% of their unit tests. We then plot the advantage of the full method over lock-on-first-pass and over the single-threshold ablation. The dynamical account predicts that this advantage grows with test sparsity and is near zero at full coverage. A flat or reversed curve would falsify the proposal's central mechanism even if overall pass rates improve.
A secondary check concerns the stall diagnostic. On stalled maximal-migration runs, we compare the recovery rate after intervening on the detected mutually reinforcing decision pair against the recovery rate after resetting the earliest error. This tests whether the "target the loop, not the trigger" lesson transfers.
References
- MigrationBench: Repository-Level Code Migration Benchmark from Java 8
- CodeTaste: Can LLMs Generate Human-Level Code Refactorings?
- CODEMENV: Benchmarking Large Language Models on Code Migration
- Systematic LLM Translation of Legacy Scientific Code to Differentiable Frameworks: Application to a Land Surface Model
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translation
- Do Users Write More Insecure Code with AI Assistants?
- Dynamic Regulation of Myosin Light Chain Phosphorylation by Rho-kinase
- A Maladaptive Role for EP4 Receptors in Mouse Mesangial Cells
- Super‐Enhancer Driven LIF/LIFR‐STAT3‐SOX2 Regulatory Feedback Loop Promotes Cancer Stemness in Head and Neck Squamous Cell Carcinoma
- Verified Code Transpilation with LLMs