指标融入循环:复杂度反馈重塑智能体编写的代码

arXiv cs.AI 论文

摘要

本文提出了“指标在环”(metrics-in-the-loop)方法,这是一种推理时干预手段,在编码智能体长时间自主运行期间,将自动计算的圈复杂度和测试覆盖率反馈注入其上下文。研究在三个基准测试和四个模型上发现,复杂度反馈能够显著减轻代码复杂度方面的退化,同时不损害在留出测试上的正确性。

arXiv:2611.23817v1 Announce Type: new Abstract: Coding agents now write whole codebases in long autonomous runs, guided mainly by whether their tests pass. Yet passing tests alone does not reveal accumulating complexity or gaps in test coverage, which then persist as agents extend their own code. We introduce metrics-in-the-loop, an inference-time intervention that gives agents in-flight feedback: cheap, automatically computed code metrics injected into the agent's context during the trajectory. After each code-changing agent turn, we insert short feedback messages naming changed functions whose cyclomatic complexity exceeds a limit (complexity feedback) or changed lines that are skipped by tests (coverage feedback), giving the agent the opportunity to refactor code or strengthen tests before continuing. We run extensive experiments and ablations comparing several interventions across three long-horizon coding benchmarks and four strong models. We find that complexity feedback significantly reduces erosion, a measure of complexity concentration of code, without affecting held-out correctness of the code. Broadly, our experiments investigate a practical form of agent "re-railing", where timely, actionable measurements redirect agents before weaknesses become the foundation they keep building on. As agents scale to codebases with millions of lines, such interventions become critical to sustaining effective development and long-term code maintainability.
查看原文
查看缓存全文

缓存时间: 2026/11/20 09:09

# Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Source: [https://arxiv.org/html/2611.23817](https://arxiv.org/html/2611.23817)
\[Extension=\.otf, UprightFont=\*\-Regular, BoldFont=\*\-Bold, ItalicFont=\*\-Italic, BoldItalicFont=\*\-BoldItalic, FontFace=mbn\*\-Medium\] \[Extension=\.otf, UprightFont=\*\-Regular, BoldFont=\*\-Bold, ItalicFont=\*\-Italic, BoldItalicFont=\*\-BoldItalic, FontFace=mbn\*\-Medium\] \[Extension=\.otf, UprightFont=\*\-Regular, BoldFont=\*\-Bold, ItalicFont=\*\-Italic, BoldItalicFont=\*\-BoldItalic, Scale=MatchLowercase\]

###### Abstract

Coding agents now write whole codebases in long autonomous runs, guided mainly by whether their tests pass\. Yet passing tests alone does not reveal accumulating complexity or gaps in test coverage, which then persist as agents extend their own code\. We introduce metrics\-in\-the\-loop, an inference\-time intervention that gives agents in\-flight feedback: cheap, automatically computed code metrics injected into the agent’s context during the trajectory\. After each code\-changing agent turn, we insert short feedback messages naming changed functions whose cyclomatic complexity exceeds a limit \(complexity feedback\) or changed lines that are skipped by tests \(coverage feedback\), giving the agent the opportunity to refactor code or strengthen tests before continuing\. We run extensive experiments and ablations comparing several interventions across three long\-horizon coding benchmarks and four strong models\. We find that complexity feedback significantly reduces erosion, a measure of complexity concentration of code, without affecting held\-out correctness of the code\. Broadly, our experiments investigate a practical form of agent “re\-railing”, where timely, actionable measurements redirect agents before weaknesses become the foundation they keep building on\. As agents scale to codebases with millions of lines, such interventions become critical to sustaining effective development and long\-term code maintainability\.

## 1Introduction

\\trplexsans\\trplexsanscoding agent, turntt\\trplexmonodef visit\_Template\(…\)\\trplexsans116 lines, CC 20\\trplexsans\\trplexsansSlapKit measures the change\\trplexsansturn ends:changes this turn \\trplexsanscomplexity \(CC\)\\trplexsans20\\trplexsanslimit 6\\trplexsanschanged functions\\trplexsanscoverage\\trplexsanschanged lines\\trplexsansunchanged files: complexity from cache\\trplexmono\[Measurement, turn 92\]Functions above the limit, highest first:compiler\.py:761 CodeGenerator\.visit\_Templatecyclomatic complexity 20 \(limit 6\)\\trplexsansadded before turnt\+1t\+1

\(a\)

\(b\)

Figure 1:Metrics\-in\-the\-loop\.\(a\)One round: after a turn that changes code, the changed functions are measured and the report \(cyclomatic complexity \(C\) and/or test coverage \(T\)\) enters the agent’s context before its next turn\.\(b\)Adding both reports to the reminder baseline \(R→\\toCT\) lowers erosion for all four models on Commit0 \(circles\) and SlopCodeBench \(squares\), with no detectable effect on held\-out correctness for any model\. Each arrow starts at R \(hollow\) and shows the estimated paired change to CT \(filled\), with whiskers for the 95% intervals\. The axes show held\-out pass fraction and one minus the share of complexity in functions above 10 \(higher is better for both axes\)\.Software engineering involves more than writing code that works: code must also be organized so that it remains testable and easy to change as requirements evolve\([Parnas, 1972](https://arxiv.org/html/2611.23817#bib.bib14);[Lehman, 1980](https://arxiv.org/html/2611.23817#bib.bib9)\)\. Coding agents now write code faster than any human can review, and how agents write often departs from well\-engineered human code, favoring large, monolithic, single\-file implementations\([Yang et al\., 2026](https://arxiv.org/html/2611.23817#bib.bib20)\)\. The problem compounds when an agent builds on its own work: successive extensions concentrate complexity and duplicate code\([Orlanski et al\., 2026](https://arxiv.org/html/2611.23817#bib.bib13)\), and evolving software across many files without breaking what already works remains difficult\([Le et al\., 2025](https://arxiv.org/html/2611.23817#bib.bib8);[Deng et al\., 2026](https://arxiv.org/html/2611.23817#bib.bib4)\)\. As agent\-written codebases grow to millions of lines, rising complexity invites bugs and vulnerabilities, making maintenance progressively harder\([Banker et al\., 1993](https://arxiv.org/html/2611.23817#bib.bib1);[Parnas, 1994](https://arxiv.org/html/2611.23817#bib.bib15);[Eick et al\., 2001](https://arxiv.org/html/2611.23817#bib.bib5)\)\.

We ask whether cheap, mechanical feedback delivered during code generation can improve code structure without sacrificing functional correctness\. We introduce MITL \(Metrics\-In\-The\-Loop\), a lightweight plugin that measures the code an agent has just changed, provides feedback to the agent in the form of a short report before the agent continues, and requires no training, no reference solution and no access to held\-out tests \(Figure[1](https://arxiv.org/html/2611.23817#S1.F1)a\)\. The report covers: \(1\) cyclomatic complexity\([McCabe, 1976](https://arxiv.org/html/2611.23817#bib.bib11)\), the number of independent paths through a function, flagging every function the agent has just modified whose complexity exceeds a threshold \(6 in our experiments\); and \(2\) test coverage, counting for each modified function the lines that the agent’s own tests do not execute\([Inozemtseva and Holmes, 2014](https://arxiv.org/html/2611.23817#bib.bib7)\)\.

The report alone, delivered often, could also change the agent’s behavior\. We therefore compare complexity feedback, coverage feedback and both combined against a reminder\-only control and a no\-message baseline \(Section[2](https://arxiv.org/html/2611.23817#S2)\)\. We estimate effects separately for each of four models of varying capability, open\-weight and proprietary \(DeepSeek V4\.1 Flash, GLM\-5\.3 Flash, Claude Haiku 5\.5 and GPT\-6 Luna\), on three long\-horizon coding benchmarks \(Commit0\([Zhao et al\., 2025](https://arxiv.org/html/2611.23817#bib.bib22)\), SlopCodeBench\([Orlanski et al\., 2026](https://arxiv.org/html/2611.23817#bib.bib13)\)and SWE\-EVO\([Le et al\., 2025](https://arxiv.org/html/2611.23817#bib.bib8)\)\) and also report pooled results\.

Our results show that complexity feedback, alone or combined with coverage feedback, lowers erosion, the share of complexity concentrated in functions with complexity above 10\. The reduction is significant for all four models on every benchmark except SWE\-EVO, where it is smaller and significant for two of the four models\. We also carefully audit agent traces to understand their behavior: agents act on the feedback, reworking most of the functions named therein\. In short, cheap, actionable measurements lead agents to write structurally simpler code without damaging the correctness of the code \(Table[1](https://arxiv.org/html/2611.23817#S3.T1), Figure[1](https://arxiv.org/html/2611.23817#S1.F1)b\)\.

As coding agents write a growing share of the world’s software, it is pressing to evaluate not only whether their code works but what they leave behind\. Our work takes a realistic look at in\-run feedback: cheap metrics steer agents toward simpler structure\. Ultimately, we expect better code quality to translate into better correctness, but current benchmarks cannot yet demonstrate this\([Trivedi and Schmitt, 2026](https://arxiv.org/html/2611.23817#bib.bib19)\), underscoring the importance of benchmark design and work ahead for the community\. Building agents that sustain codebases of millions of lines will require evaluations that measure maintainability as rigorously as correctness\.

## 2Experimental design

The loop\.The coding agent receives a task and is instructed to complete it in a sandbox, through Oh\-My\-Pi\([Stencil Labs, Inc\., 2026](https://arxiv.org/html/2611.23817#bib.bib18)\), the harness that provides the model’s tools and manages its memory\. After each turn that changes a file, the harness saves a workspace snapshot and SlapKit, our measurement tool, measures the functions the turn changed and emits a report, which enters the agent’s context as feedback before its next model call\. Complexity is measured as cyclomatic complexity\([McCabe, 1976](https://arxiv.org/html/2611.23817#bib.bib11)\), which counts the independent paths through a function: the more paths, the harder the function is to follow and to test\([Curtis et al\., 1979](https://arxiv.org/html/2611.23817#bib.bib3)\)\. The*complexity report*lists changed functions with cyclomatic complexity above 6, in descending order, and asks the agent to bring them under this limit\. For coverage, SlapKit reruns the agent’s own tests; the*coverage report*lists changed functions with added or edited lines that these tests do not execute, with a target of zero uncovered changed lines; the agent is then free to write or modify tests to bring down the count of uncovered lines\.

Arms\.We introduce five experimental arms to distinguish the effects of measurements and feedback instructions\. B0 receives no feedback\. R receives the feedback instructions alone with no measurements \(a “placebo feedback” of sorts\), and C, T and CT respectively add the complexity, coverage, or both reports \(see Appendix[A](https://arxiv.org/html/2611.23817#A1)for details\)\. R, C, T and CT share byte\-identical feedback instructions and the same delivery rule: each receives one message after every turn that changes code and can be measured\. Example feedback is reported in Appendix[A\.1](https://arxiv.org/html/2611.23817#A1.SS1)\. We compute the following contrasts: CT−\-R estimates the effect of adding both reports to the reminder, C−\-R and T−\-R isolate each, and R−\-B0 measures the reminder alone\. The estimated effects also include changes to the message header and a task\-prompt paragraph defining each metric\. Report counts may also vary by arm because feedback can affect how often the code can be measured within the common budget\.

Models and benchmarks\.We evaluate four models of varying capability, all at high reasoning effort: the open\-weight DeepSeek V4\.1 Flash \(released 2026\-09\-10\) and GLM\-5\.3 Flash \(released 2026\-08\-26\), and the proprietary Claude Haiku 5\.5 and GPT\-6 Luna\. Each model runs every arm on three long\-horizon Python benchmarks\. Commit0\([Zhao et al\., 2025](https://arxiv.org/html/2611.23817#bib.bib22)\)asks agents to reconstruct Python libraries from specifications; we use 25 libraries, three to five seeds per arm and a 2M processed\-token budget per run\. SlopCodeBench\([Orlanski et al\., 2026](https://arxiv.org/html/2611.23817#bib.bib13)\)evaluates program development over successive specifications; we use 35 problems with three to eight checkpoints, two seeds and 1M tokens per checkpoint\. Each checkpoint extends the specification and resets the context, retaining the workspace\. SWE\-EVO\([Le et al\., 2025](https://arxiv.org/html/2611.23817#bib.bib8)\)asks agents to update published projects to their next release; we use 35 of 48 transitions, two seeds, and a budget of 2M tokens and 90 minutes per run\.

Outcomes\.We measure held\-out correctness by the fraction of a fixed test set that the final code passes\. The agent never sees these tests: they are stored outside the repository the agent is permitted to access\. Commit0’s official suite grades the last snapshot within the token cap, while the agent writes its own tests during the run; SlopCodeBench grades the final checkpoint with hidden tests; SWE\-EVO grades the final code by its fix rate on the next release’s withheld tests: the fraction of tests failing on the starting code that pass on the final code, set to zero if the agent breaks any test that passes both before and after the reference change\. For structural complexity, we adapt SlopCodeBench’s*erosion index*EτE\_\{\\tau\}: withcfc\_\{f\}the cyclomatic complexity of functionffandnfn\_\{f\}its count of nonblank, noncomment lines,

Eτ=∑fcfnf1\{cf\>τ\}∑fcf​nfE\_\{\\tau\}=\\frac\{\\sum\_\{f\}c\_\{f\}\\sqrt\{n\_\{f\}\}\\,\\mathbf\{1\}\\\{c\_\{f\}\>\\tau\\\}\}\{\\sum\_\{f\}c\_\{f\}\\sqrt\{n\_\{f\}\}\}\(1\)is the share of complexity mass in functions with complexity aboveτ\\tau\. The summation only include the main codebase functions in this computation, excluding test\-suite members\. For Commit0 and SlopCodeBench, we reportE10E\_\{10\}\. For SWE\-EVO, since the agent edit an existing project, whose original code still makes up most of the final tree, we report the change inE10E\_\{10\}from the starting code\. These changes are small, so we give them in thousandths \(‰\); for scale, the starting code’sE10E\_\{10\}averages 330‰\. Appendix[A](https://arxiv.org/html/2611.23817#A1)gives cell counts, exclusions and the integrity checks\.

## 3Results

Complexity feedback lowers erosion\.C and CT significantly lower finalE10E\_\{10\}relative to R for all four models on Commit0 and SlopCodeBench, with every interval excluding zero \(Table[1](https://arxiv.org/html/2611.23817#S3.T1)\)\. On SlopCodeBench, both arms keep erosion at or below 0\.022 at every checkpoint\. Effects vary by model partly reflecting differences in reminder\-arm erosion but all pooled intervals exclude zero with a reduction range of 7\.8–24\.6 percentage points of starting erosion\. On SWE\-EVO, all models have lower estimated erosion, but only two models’ intervals exclude zero for each contrast under project clustering\. Appendix[B](https://arxiv.org/html/2611.23817#A2)reports results for all contrasts\. The CT−\-R erosion gap grows during Commit0 runs and persists across SlopCodeBench’s context resets \(Figure[2](https://arxiv.org/html/2611.23817#S3.F2); Appendix[C](https://arxiv.org/html/2611.23817#A3)\)\. These results show that complexity feedback can steer agents toward simpler code structures as they extend their implementations over long coding runs\.

Figure 2:CT−\-R inE10E\_\{10\}during the run, by model, with pointwise 95%ttbands\.\(a\)Commit0: paired differences within libraries at each token budget \(log scale, up to 2M\), with at least 15 paired libraries\.\(b\)SlopCodeBench: paired differences within problems at each checkpoint, with at least 5 pairs; not all problems reach 8 checkpoints\.Table 1:Erosion under complexity feedback and correctness under combined feedback, by model\.E10E\_\{10\}\(↓\\downarrowbetter\) is the share of complexity mass in functions with cyclomatic complexity above 10\. Contrasts are paired mean differences with 95% intervals\. Correctness \(↑\\uparrowbetter\) is the held\-out pass fraction or, on SWE\-EVO, the fix rate; differences are in percentage points\. Commit0 erosion estimates use seeds 1–5 for R and CT and 1–3 for C\. Seeds 4 and 5 were added after the initial analysis; correctness uses the planned seeds 1–3\. SWE\-EVO intervals are clustered by six projects, with CT using 29 of 35 transitions\. Pooled estimates are post hoc\.I2I^\{2\}\([Higgins and Thompson, 2002](https://arxiv.org/html/2611.23817#bib.bib6)\)estimates the proportion of variation among models attributable to heterogeneity; highI2I^\{2\}indicates that they average effects that differ across models\. App\.[B](https://arxiv.org/html/2611.23817#A2)reports all contrasts and paired samples\.No detectable effect on held\-out correctness for any model\.Every per\-model correctness interval in Table[1](https://arxiv.org/html/2611.23817#S3.T1)includes zero, and on Commit0, CT−\-R runs from−2\.3\-2\.3points for Haiku to\+4\.7\+4\.7for GLM\. The post hoc pool,\+3\.1\+3\.1\[−0\.1\-0\.1,\+6\.3\+6\.3\], includes zero as well\. On SlopCodeBench, CT−\-R runs from−5\.8\-5\.8points for Haiku to0\.00\.0for GLM\. The pooled estimate is negative \(−1\.7\-1\.7\[−3\.6\-3\.6,\+0\.1\+0\.1\]\), with an interval that also covers zero\. As a joint mixed model gives an odds ratio of 0\.82 \[0\.70, 0\.96\], a small cost of the combined arm on SlopCodeBench cannot be ruled out\. On SWE\-EVO the pooled fix\-rate estimate is\+2\.7\+2\.7\[−0\.2\-0\.2,\+5\.6\+5\.6\]\. Although modal results suggest a slight average increase in correctness under CT feedback, each benchmark has per\-model intervals compatible with losses of 6 percentage points or more\. We hypothesize two reasons why simpler code does not yet translate into higher correctness\. First, the payoff of lower complexity should grow with scale: as agent\-written codebases reach millions of lines, complexity makes them harder to change safely\. Even SlopCodeBench, whose agents extend their own code over several checkpoints, involves codebases orders of magnitude smaller, so the effect may not yet show\. As agents take on larger codebases, benchmarks must grow with them to reveal how much correctness depends on maintainable code\. Second, many failures, such as misread specifications, logic errors or missed edge cases, arise in code that is already simple and passes the agent’s own tests, so lowering complexity cannot fix them\.

Agents act on the reports\.Under C, agents re\-edit 54–88% of flagged functions on Commit0 and 87–94% on SlopCodeBench\. By the end, 46–94% and 94–97%, respectively, meet the complexity limit, compared with 1–18% of over\-limit functions edited under R\. Agents see at least 98\.2% of offered messages\. Coverage feedback also prompts changes, most consistently on SlopCodeBench \(Table[B4](https://arxiv.org/html/2611.23817#A2.T4)\)\. The reports thus prompt targeted revisions, with consistently stronger responses to complexity feedback alone than to combined feedback across all models on both benchmarks\.

Structural changes behind the erosion reduction\.Splitting functions can lowerE10E\_\{10\}without simplifying control flow\. After inlining every eligible single\-use function in both arms, including library\-authored helpers, 3–46% of the erosion difference remains on Commit0 and 8–18% on SlopCodeBench for DeepSeek, GLM and Luna \(Table[B5](https://arxiv.org/html/2611.23817#A2.T5)\)\. This sensitivity does not isolate extraction’s causal effect\. On Commit0, total branching changes by less than 4% for DeepSeek and GLM and falls by 16% for Luna; on SlopCodeBench, it falls by 14–21% for all three\. Other withheld measures agree on SlopCodeBench: benchmark erosion falls for all models, while verbosity and hidden\-suite coverage improve for these three models \(Luna’s coverage under C only\)\. On Commit0, C has no detectable effect on hidden\-suite coverage\.

The reminder and coverage feedback on their own\.The reminder alone lowersE10E\_\{10\}on SlopCodeBench by0\.1330\.133to0\.3830\.383across models\. For Haiku, the reduction from the reminder \(−0\.383\-0\.383for R−\-B0\) is much larger than the additional reduction from complexity feedback \(−0\.045\-0\.045for C−\-R\)\. On Commit0 it lowersE10E\_\{10\}for Haiku and Luna only, though DeepSeek’s B0 cells there came from another date and another mix of providers\. Coverage feedback alone does not lower erosion, and on SlopCodeBench it raisesE10E\_\{10\}for DeepSeek, GLM and Luna \(pool\+0\.057\+0\.057\[\+0\.044\+0\.044,\+0\.070\+0\.070\],I2I^\{2\}91%\)\. Every per\-model T−\-R and R−\-B0 correctness interval includes zero, on every benchmark\. Two other analyses have intervals excluding zero: pooled SWE\-EVO resolution R−\-B0 of−3\.2\-3\.2points \[−6\.1\-6\.1,−0\.2\-0\.2\] and, in the mixed model, DeepSeek’s R−\-B0 odds ratio on Commit0 \(2\.26 \[1\.25, 4\.08\]\)\.

## 4Limitations and outlook

Our work shows that MITL feedback, delivered while the agent is writing, can steer agents toward simpler code without sacrificing correctness, laying the groundwork for code that both humans and agents can better understand and extend as codebases grow to millions of lines\. Although our experiment does not show a clear gain in correctness, we expect simpler code to remain more correct over time, as it should accumulate fewer errors when an agent keeps extending its own work\. Two properties of the current benchmarks likely hide this effect: pass rates are near saturation on SlopCodeBench and dominated by between\-library variance on Commit0, with neither benchmark extending the code long enough for structure to pay off, and both are public and therefore subject to contamination\. Testing this expectation calls for a new benchmark of unseen specifications with long sequences of change requests, measuring change correctness and cost for code written with and without feedback\.

Beyond correctness, our study covers Python, one harness, four models and one budget per benchmark; we plan to broaden each\. Reports combine limits and measurements between turns, leaving target, content and timing effects confounded\. Evaluating such feedback requires distinguishing effects beyond reminders, structural gains beyond function splitting, and benefits to later work\. We address the first two \(Table[2](https://arxiv.org/html/2611.23817#S4.T2)\); the proposed benchmark would test the third: which code properties predict subsequent agent failures\. Our MITL loop could also carry other measurements, including semantic complexity beyond control flow, adapt its limit to the model, and learn when best to deliver feedback\. We inherited our notions of clean code from people, and we do not know whether the same notions should apply to readers with context windows, but as coding agents are entrusted with writing and maintaining a growing fraction of all software, this has become an experimental question worth answering\.

Table 2:List of checks of interventions made during a coding agent run \(Section[3](https://arxiv.org/html/2611.23817#S3), Appendix[A](https://arxiv.org/html/2611.23817#A1)\)\.
## References

- Banker et al\. \(1993\)Rajiv D\. Banker, Srikant M\. Datar, Chris F\. Kemerer, and Dani Zweig\. 1993\.Software complexity and maintenance costs\.*Communications of the ACM*, 36\(11\):81–94\.[https://doi\.org/10\.1145/163359\.163375](https://doi.org/10.1145/163359.163375)\.
- Bell and McCaffrey \(2002\)Robert M\. Bell and Daniel F\. McCaffrey\. 2002\.Bias reduction in standard errors for linear regression with multi\-stage samples\.*Survey Methodology*, 28\(2\):169–181\.[https://www150\.statcan\.gc\.ca/n1/pub/12\-001\-x/2002002/article/9058\-eng\.pdf](https://www150.statcan.gc.ca/n1/pub/12-001-x/2002002/article/9058-eng.pdf)\.
- Curtis et al\. \(1979\)Bill Curtis, Sylvia B\. Sheppard, Phil Milliman, M\. A\. Borst, and Tom Love\. 1979\.Measuring the psychological complexity of software maintenance tasks with the Halstead and McCabe metrics\.*IEEE Transactions on Software Engineering*, SE\-5\(2\):96–104\.[https://doi\.org/10\.1109/TSE\.1979\.234165](https://doi.org/10.1109/TSE.1979.234165)\.
- Deng et al\. \(2026\)Gangda Deng, Zhaoling Chen, Zhongming Yu, Haoyang Fan, Yuhong Liu, Yuxin Yang, et al\.SWE\-Milestone: Evaluating AI Agents on Continuous Software Evolution, 2026\.[https://arxiv\.org/abs/2603\.13428v4](https://arxiv.org/abs/2603.13428v4)\.
- Eick et al\. \(2001\)Stephen G\. Eick, Todd L\. Graves, Alan F\. Karr, J\. S\. Marron, and Audris Mockus\. 2001\.Does code decay? assessing the evidence from change management data\.*IEEE Transactions on Software Engineering*, 27\(1\):1–12\.[https://doi\.org/10\.1109/32\.895984](https://doi.org/10.1109/32.895984)\.
- Higgins and Thompson \(2002\)Julian P\. T\. Higgins and Simon G\. Thompson\. 2002\.Quantifying heterogeneity in a meta\-analysis\.*Statistics in Medicine*, 21\(11\):1539–1558\.[https://doi\.org/10\.1002/sim\.1186](https://doi.org/10.1002/sim.1186)\.
- Inozemtseva and Holmes \(2014\)Laura Inozemtseva and Reid Holmes\.Coverage is not strongly correlated with test suite effectiveness\.In*Proceedings of the 36th International Conference on Software Engineering*, pages 435–445, 2014\.[https://doi\.org/10\.1145/2568225\.2568271](https://doi.org/10.1145/2568225.2568271)\.
- Le et al\. \(2025\)Tue Le, Minh V\. T\. Thai, Dung Nguyen Manh, Huy Phan Nhat, and Nghi D\. Q\. Bui\. 2025\.SWE\-EVO: Benchmarking coding agents in long\-horizon software evolution scenarios\.*arXiv preprint arXiv:2512\.18470*\.[https://arxiv\.org/abs/2512\.18470](https://arxiv.org/abs/2512.18470)\.
- Lehman \(1980\)Meir M\. Lehman\. 1980\.Programs, life cycles, and laws of software evolution\.*Proceedings of the IEEE*, 68\(9\):1060–1076\.[https://doi\.org/10\.1109/PROC\.1980\.11805](https://doi.org/10.1109/PROC.1980.11805)\.
- Manheim and Garrabrant \(2018\)David Manheim and Scott Garrabrant\.Categorizing variants of Goodhart’s law, 2018\.[https://arxiv\.org/abs/1803\.04585](https://arxiv.org/abs/1803.04585)\.
- McCabe \(1976\)Thomas J\. McCabe\. 1976\.A complexity measure\.*IEEE Transactions on Software Engineering*, SE\-2\(4\):308–320\.[https://doi\.org/10\.1109/TSE\.1976\.233837](https://doi.org/10.1109/TSE.1976.233837)\.
- Miller \(2024\)Evan Miller\.Adding error bars to evals: A statistical approach to language model evaluations, 2024\.[https://arxiv\.org/abs/2411\.00640](https://arxiv.org/abs/2411.00640)\.
- Orlanski et al\. \(2026\)Gabriel Orlanski, Devjeet Roy, Alexander Yun, Changho Shin, Alex Gu, Albert Ge, et al\.SlopCodeBench: Benchmarking how coding agents degrade over long\-horizon iterative tasks, 2026\.[https://arxiv\.org/abs/2603\.24755v2](https://arxiv.org/abs/2603.24755v2)\.Version 2\.
- Parnas \(1972\)David L\. Parnas\. 1972\.On the criteria to be used in decomposing systems into modules\.*Communications of the ACM*, 15\(12\):1053–1058\.[https://doi\.org/10\.1145/361598\.361623](https://doi.org/10.1145/361598.361623)\.
- Parnas \(1994\)David Lorge Parnas\.Software aging\.In*Proceedings of the 16th International Conference on Software Engineering \(ICSE\)*, pages 279–287, 1994\.[https://doi\.org/10\.1109/ICSE\.1994\.296790](https://doi.org/10.1109/ICSE.1994.296790)\.
- Pustejovsky and Tipton \(2018\)James E\. Pustejovsky and Elizabeth Tipton\. 2018\.Small\-sample methods for cluster\-robust variance estimation and hypothesis testing in fixed effects models\.*Journal of Business & Economic Statistics*, 36\(4\):672–683\.[https://doi\.org/10\.1080/07350015\.2016\.1247004](https://doi.org/10.1080/07350015.2016.1247004)\.
- Satterthwaite \(1946\)F\. E\. Satterthwaite\. 1946\.An approximate distribution of estimates of variance components\.*Biometrics Bulletin*, 2\(6\):110–114\.[https://doi\.org/10\.2307/3002019](https://doi.org/10.2307/3002019)\.
- Stencil Labs, Inc\. \(2026\)Stencil Labs, Inc\.Oh\-My\-Pi: Coding agent with the IDE wired in\.Software, version 18\.1\.22, released 2026\-09\-14, 2026\.[https://github\.com/can1357/oh\-my\-pi/releases/tag/v18\.1\.22](https://github.com/can1357/oh-my-pi/releases/tag/v18.1.22)\.Source:[https://github\.com/can1357/oh\-my\-pi](https://github.com/can1357/oh-my-pi)\.
- Trivedi and Schmitt \(2026\)Priyansh Trivedi and Olivier Schmitt\.Does Code Cleanliness Affect Coding Agents? A Controlled Minimal\-Pair Study, 2026\.[https://arxiv\.org/abs/2605\.20049](https://arxiv.org/abs/2605.20049)\.
- Yang et al\. \(2026\)John Yang, Kilian Lieret, Jeffrey Ma, Parth Thakkar, Dmitrii Pedchenko, Sten Sootla, et al\. 2026\.ProgramBench: Can language models rebuild programs from scratch?*arXiv preprint arXiv:2605\.03546*\.[https://arxiv\.org/abs/2605\.03546](https://arxiv.org/abs/2605.03546)\.
- Yin \(2026\)Terry Yin\.Lizard: A simple code complexity analyser\.Software, version 1\.24\.0, released 2026\-08\-19, 2026\.[https://pypi\.org/project/lizard/1\.24\.0/](https://pypi.org/project/lizard/1.24.0/)\.
- Zhao et al\. \(2025\)Wenting Zhao, Nan Jiang, Celine Lee, Justin T\. Chiu, Claire Cardie, Matthias Gallé, et al\.Commit0: Library generation from scratch\.In*International Conference on Learning Representations*, 2025\.[https://proceedings\.iclr\.cc/paper\_files/paper/2025/hash/1fcefa894924bb1688041b7a26fb8aea\-Abstract\-Conference\.html](https://proceedings.iclr.cc/paper_files/paper/2025/hash/1fcefa894924bb1688041b7a26fb8aea-Abstract-Conference.html)\.

## AI\-use statement

Generative AI tools assisted with software implementation, data analysis, literature discovery, and manuscript drafting and editing, but did not replace humans\. The latter are responsible for the entire contents of this paper\.

## Appendix ADesign details

Table[A1](https://arxiv.org/html/2611.23817#A1.T1)lists what each arm receives, and Table[A2](https://arxiv.org/html/2611.23817#A1.T2)sets out the three datasets used for the experiments\.

Table A1:Experimental arms\. Every arm except B0 receives the same R\-arm feedback instructions in addition to its own report\.Table A2:The three experiments\. Each runs the five arms of Table[A1](https://arxiv.org/html/2611.23817#A1.T1)with the same feedback wording under DeepSeek V4\.1 Flash \(2026\-09\-10 release\), GLM\-5\.3 Flash \(2026\-08\-26 release\), Claude Haiku 5\.5 and GPT\-6 Luna\. A cell is one combination of task, arm, model and seed\. Counts are summed over the four models\.#### Models and conditions\.

On Commit0 and SlopCodeBench, Haiku and Luna ran after DeepSeek and GLM, using newer container images and their developers’ own endpoints\. On SWE\-EVO all four models ran in one campaign, each pinned to one provider\. In addition to expected cross\-model variability, this is why we estimate every effect within a model and never compare levels across models\.

#### Analysis populations\.

On Commit0, a graded workspace on which the hidden suite cannot import or complete scores zero on the whole fixed set of held\-out tests\. There are 278 such cells \(106 GLM, 71 Luna, 57 Haiku, 44 DeepSeek\)\. The primary analysis keeps these zeros; without them, the five\-seed CT−\-R pool on correctness is\+0\.1\+0\.1points \[−1\.3\-1\.3,\+1\.5\+1\.5\]\. A cell whose reference solution also fails to grade counts as missing\. SlopCodeBench uses 35 of its 36 problems, because for one,`datagate`, we could not successfully get the coverage step measure its generated files; it was left out before any cell ran\. We have automatic reruns after an infrastructure failure\. For Haiku and Luna, we graded 34 cells after a harness defect stopped them at the final checkpoint, without allowing additional tokens\. Their inclusion was a post hoc decision\. A test\-list mismatch also excludes`test\_translator`from both models’ analyses\. All 1,400 SWE\-EVO cells are graded\. Before inspecting any T or CT result, we decided to exclude six`dvc`tasks whose coverage step failed during test collection, leaving 29 transitions for contrasts involving T or CT\. In four of them a test module needs a`networkx`release that does not load under Python 3\.9; in the other two it loads a storage plugin built for a newer`fsspec`than the one installed\. Either failure stops pytest before any test runs\. Grading runs only the test files each task names, none of which fails to import, so every arm was graded normally\. Coverage also failed on five of these 29 transitions\. We retain the planned analysis and use the remaining 24 transitions from five projects for a post hoc sensitivity analysis\. In that analysis, the pooled CT−\-R erosion estimate remains below zero \(−4\.59\-4\.59‰ \[−5\.27\-5\.27,−3\.92\-3\.92\]\), and the pooled fix\-rate estimate falls to\+0\.5\+0\.5points \[−2\.0\-2\.0,\+2\.9\+2\.9\]\.

#### Estimands\.

Tests within a task are not independent\([Miller, 2024](https://arxiv.org/html/2611.23817#bib.bib12)\), so the unit of analysis is the task: a Commit0 library, a SlopCodeBench problem or a SWE\-EVO transition\. For each model, we first average seeds within each task and arm \(between 2 and 5 seeds, depending on the task\)\. We then average the paired differences, such asY¯ℓ,CT−Y¯ℓ,R\\overline\{Y\}\_\{\\ell,\\mathrm\{CT\}\}\-\\overline\{Y\}\_\{\\ell,\\mathrm\{R\}\}for taskℓ\\ell, giving equal weight to tasks with outcomes in both arms\. We report a point estimate and pairedtt\-test confidence interval for each model\. SWE\-EVO’s 35 transitions come from six projects; 21 belong to a single project\. The specification calls for intervals clustered by project\. We later chose a bias\-reduced variance estimate \(CR2\) with Bell and McCaffrey’s degrees of freedom\([Bell and McCaffrey, 2002](https://arxiv.org/html/2611.23817#bib.bib2);[Pustejovsky and Tipton, 2018](https://arxiv.org/html/2611.23817#bib.bib16)\), about two per model\. The pooled estimate is an inverse\-variance fixed\-effect average of the four models\. Its standard error assumes independent models, although they share tasks\. Every pooled C−\-R and CT−\-R erosion estimate remains below zero when we resample whole tasks \(whole projects on SWE\-EVO\) or fit the models jointly\.I2I^\{2\}\([Higgins and Thompson, 2002](https://arxiv.org/html/2611.23817#bib.bib6)\)estimates the proportion of variation among models attributable to heterogeneity\.

#### SWE\-EVO’s secondary outcomes\.

Resolution, defined as passing every official test, is a secondary outcome\. Its pooled CT−\-R estimate is\+3\.2\+3\.2points \[\+0\.7\+0\.7,\+5\.8\+5\.8\]\. Pooled token use rises under CT by\+61\+61k per cell \[\+34\+34k,\+89\+89k\] and under T by\+43\+43k \[\+28\+28k,\+59\+59k\], with DeepSeek accounting for most of the T increase\. These estimates include 25 cells whose token use is an upper\-bound estimate\. Excluding them gives CT−\-R of\+34\+34k \[−1\-1k,\+69\+69k\] and T−\-R of−8\-8k \[−15\-15k,−1\-1k\], leaving the effect on token use uncertain\.

#### What measurement costs\.

Overhead estimates use DeepSeek and GLM runs\.Median message size ranges from 1\.2 kB for the reminder to 2\.1 kB for both reports\. Injected text resulting from feedback accounts for a median 0\.4 to 1\.1% of processed tokens per cell\. Cyclomatic complexity scores, computed with`lizard`\([Yin, 2026](https://arxiv.org/html/2611.23817#bib.bib21)\), are cached by file content, so a turn re\-parses only the files it changed\. Measuring coverage requires rerunning the agent’s full test suite after each measured turn\. On Commit0, this took a median 0\.4 to 0\.5 s per turn, or 0\.5 to 0\.7% of model time per cell\. SlopCodeBench’s suites took 9\.6 to 16\.9 s per measured turn, with a median cost of 33 to 44% of model time per cell\. These figures exclude snapshotting and complexity measurement, which were not timed\. Slow agent\-written test suites can therefore make coverage measurement costly\.

#### Integrity\.

For the DeepSeek and GLM runs, an LLM \(Opus 5\.5\) audited every trace for internet access, access to hidden tests or reference code, and grader tampering\. On SlopCodeBench, the automated audit found no recorded access to hidden tests, reference code, grading outputs, another cell or the internet\. Agents made many attempts, all blocked by operating\-system isolation \(Bubblewrap \(`bwrap`\) inside Docker containers\)\. On Commit0, the filesystem filter checked only path words\. Agents routinely bypassed it by assembling paths from pieces, although the network proxy blocked every attempt to fetch upstream source\. We excluded all 28 Commit0 cells in those runs that accessed hidden material or completed library code, including two identified by the audit\. For Haiku and Luna, a scan for hidden\-material access excluded 8 Commit0 cells \(2 Haiku, 6 Luna\)\. Auditing every SlopCodeBench trace for these models found no access to hidden material\. On SWE\-EVO, the hidden\-test scan found no cell to exclude\. Both the scan and the audit can detect only activity recorded in the traces\.

#### Mixed models\.

The analysis in Section[3](https://arxiv.org/html/2611.23817#S3)uses a binomial generalized linear mixed model of held\-out test counts, fitted jointly across the four models after the initial analysis\. It includes fixed effects for arm by model and for seed block or seed, random intercepts for task and task by model, and a cell intercept with model\-specific variance\.

#### What was fixed before the results\.

Fixed in advance: the arms \(including the wording of the feedback they provide\), the primary contrasts \(CT−\-R on correctness for Commit0 and SlopCodeBench; C−\-R, T−\-R and CT−\-R on the fix rate for SWE\-EVO\), andE10E\_\{10\}, tokens and resolution as secondary outcomes\. After inspecting the initial results, we added seeds 4 and 5 for R and CT on Commit0, pooled estimates across four models, the small\-cluster correction on SWE\-EVO, joint mixed models, the 24\-transition sensitivity analysis and the 34 grades obtained without additional tokens\. Each is labelled post hoc wherever it appears\.

### A\.1Messages after a turn

After a turn that changes code and can be measured, arms R, C, T and CT receive one message; B0 receives none\. R receives only the feedback instructions, headed\[Reminder, turnkk\]\. C, T and CT add measurement tables under\[Measurement, turnkk\]\. Each table lists changed functions above the limit in descending order \(ornone\) and counts those at or below it\. Every message ends with the same feedback instructions\. The examples below are messages from Commit0 runs, with long tables truncated to their first rows\.

\\trplexsansSlapKit feedbackR: reminder only\\trplexsans\\trplexmono``` [Reminder, turn 3] Review the functions you changed this turn for readability, testability and maintainability. For each function you changed: 1. Read the complete function and identify the distinct responsibilities it performs. 2. Simplify nested control flow using guard clauses or early returns where appropriate. 3. Extract coherent responsibilities into clearly named helper functions with explicit inputs and outputs. 4. Consolidate repeated branches or special cases using shared logic, lookup tables, or dispatch functions when appropriate. 5. Make sure the tests exercise the function’s behavior, including its error paths and edge cases, and assert on results or effects. 6. Preserve the function’s public behavior and interfaces, and run the relevant tests after any change, followed by the broader test suite when practical. Do not create arbitrary one-line wrappers, scatter closely related logic across meaningless helpers, delete required behavior, or weaken tests. The goal is understandable and maintainable code. Do not interrupt correct task completion for unnecessary refactoring. Correctness and passing the tests remain the first priority. ```

\\trplexsansSlapKit feedbackC: complexity table\\trplexsans\\trplexmono``` [Measurement, turn 1] Cyclomatic complexity estimates how many independent execution paths a function contains. Higher complexity usually means the function is harder to understand, test, and modify safely. The target is 6 or lower for every function. Functions above the limit, highest first: src/attr/˙make.py:60 attrib cyclomatic complexity 18 (limit 6); new this turn At or under the limit: 0 functions. [the same feedback instructions as in the R message above] ```

\\trplexsansSlapKit feedbackT: uncovered changed lines\\trplexsans\\trplexmono``` [Measurement, turn 1] Uncovered lines counts, for each function you changed this turn, the lines you added or edited that this repository’s test suite did not execute. A line no test runs is a line whose behavior nothing checks. The target is 0 for every function you change. Functions above the limit, highest first: jwt/utils.py:32 raw˙to˙der˙signature uncovered lines 8 (limit 0): no test loads this file; new this turn jwt/utils.py:41 force˙bytes uncovered lines 7 (limit 0): no test loads this file; new this turn jwt/utils.py:16 base64url˙decode uncovered lines 6 (limit 0): no test loads this file; new this turn […] At or under the limit: 0 functions. [the same feedback instructions as in the R message above] ```

\\trplexsansSlapKit feedbackCT: both tables\\trplexsans\\trplexmono``` [Measurement, turn 3] Cyclomatic complexity estimates how many independent execution paths a function contains. Higher complexity usually means the function is harder to understand, test, and modify safely. The target is 6 or lower for every function. Functions above the limit, highest first: none At or under the limit: 4 functions. Uncovered lines counts, for each function you changed this turn, the lines you added or edited that this repository’s test suite did not execute. A line no test runs is a line whose behavior nothing checks. The target is 0 for every function you change. Functions above the limit, highest first: src/click/globals.py:8 get˙current˙context uncovered lines 6 (limit 0): no test loads this file; new this turn src/click/globals.py:40 resolve˙color˙default uncovered lines 6 (limit 0): no test loads this file; new this turn src/click/globals.py:30 push˙context uncovered lines 3 (limit 0): no test loads this file; new this turn […] At or under the limit: 0 functions. [the same feedback instructions as in the R message above] ```

## Appendix BEvery contrast

Tables[B1](https://arxiv.org/html/2611.23817#A2.T1)to[B3](https://arxiv.org/html/2611.23817#A2.T3)report all four contrasts for erosion and correctness, separately by model and pooled post hoc\. Table[B5](https://arxiv.org/html/2611.23817#A2.T5)reports the decomposition audit\. In an illustrative manual review of the 20 largest reductions from DeepSeek and GLM runs, 17 divided the code into named, testable concepts\. The response audit in Table[B4](https://arxiv.org/html/2611.23817#A2.T4)tracks every edited function that exceeded the complexity limit or lacked full coverage, in every included cell on Commit0 and SlopCodeBench, whether or not a message flagged it\. This response audit did not cover SWE\-EVO\.

Figure[B1](https://arxiv.org/html/2611.23817#A2.F1)shows the other three contrasts on Commit0 and SlopCodeBench in the format of Figure[1](https://arxiv.org/html/2611.23817#S1.F1)\(b\)\. Figure[B2](https://arxiv.org/html/2611.23817#A2.F2)shows all four contrasts on SWE\-EVO\.

Figure B1:Arrow diagrams for the other three contrasts, drawn as in Figure[1](https://arxiv.org/html/2611.23817#S1.F1)\(b\):\(a\)R→\\toC, complexity feedback;\(b\)R→\\toT, coverage feedback;\(c\)B0→\\toR, the reminder alone; four models, circles Commit0 and squares SlopCodeBench\. Hollow markers denote the starting arm and filled markers the ending arm \(Commit0: seeds 1–5 for R and 1–3 for C, T and B0; SlopCodeBench: complete\-case pairing of problems within each model\)\. Each arrow starts at the starting arm’s mean for the paired tasks and shows the estimated paired change\. Whiskers show the paired 95%ttinterval for that change, shifted to the arrowhead\. They do not represent uncertainty in the ending arm’s mean or a joint two\-dimensional region\. Each axis uses its own complete\-case task set, so an arrow’s pass fraction andE10E\_\{10\}may use different tasks\. Absolute levels are not comparable across models\.Figure B2:SWE\-EVO arrow diagrams for all four contrasts, drawn as in Figure[B1](https://arxiv.org/html/2611.23817#A2.F1), with the fix rate on the horizontal axis and the fall inE10E\_\{10\}from the starting code, in ‰, on the vertical one; higher is better on both\. Hollow and filled triangles denote the starting and ending arms, averaged over the paired transitions: 35 for R→\\toC and B0→\\toR, and 29 for R→\\toCT and R→\\toT\. Arrows show the reported paired estimates\. Whiskers show the paired 95%ttintervals over transitions, shifted to the arrowhead\. An interval containing zero therefore reaches the hollow triangle’s coordinate on that axis\. These plotted intervals treat transitions as independent\. The main analysis instead clusters intervals by project \(Section[2](https://arxiv.org/html/2611.23817#S2)\), giving wider intervals for most models and contrasts\. Transition\-level intervals exclude zero for seven of eight C−\-R and CT−\-R erosion estimates; project\-clustered intervals exclude zero for four \(Table[2](https://arxiv.org/html/2611.23817#S4.T2)\)\. Vertical scales differ by panel\.Table B1:Change inE10E\_\{10\}at the final tree, per model, for all four contrasts\. Lower is better\. R gives the reminder\-arm mean over its included tasks, with the task count in parentheses\. Contrasts may use different paired task sets, so adding a contrast to R need not recover the other arm’s mean\.nnis the number of tasks paired for CT–R\. Cells with no measured outcome are dropped\. Commit0 pairs arm means within library, over seeds 1–5 for R and CT and seeds 1–3 for B0, C and T; SlopCodeBench pairs arm means within problem, over two seeds\.E10E\_\{10\}was planned as a secondary outcome on all three benchmarks; correctness was the primary one\. On SWE\-EVO, contrasts involving T or CT use 29 of the 35 transitions\. On six dvc transitions, a test module that fails to import stopped the project’s suite before any test ran, so the coverage feedback that defines T and CT measured nothing\. We excluded those six before reading any T or CT result \(App\.[A](https://arxiv.org/html/2611.23817#A1)\); the other contrasts use all 35\. Intervals are clustered by the six projects, as planned\. The small\-cluster correction was chosen later: CR2 with Bell–McCaffrey degrees of freedom\([Bell and McCaffrey, 2002](https://arxiv.org/html/2611.23817#bib.bib2);[Pustejovsky and Tipton, 2018](https://arxiv.org/html/2611.23817#bib.bib16)\), about two per model\. The pooled estimate uses attinterval with Satterthwaite degrees of freedom\([Satterthwaite, 1946](https://arxiv.org/html/2611.23817#bib.bib17)\)\. The pooled estimate is a post hoc fixed\-effect inverse\-variance average across four models\. Its standard error assumes independent models despite their shared tasks\.I2I^\{2\}estimates the proportion of variation among the four estimates attributable to heterogeneity; high values indicate that the pooled estimate averages differing effects\.ModelRC–RCT–RT–RR–B0nnCommit0, 25 librariesDeepSeek25GLM24Haiku25Luna25Pool \(post hoc\)I2I^\{2\}86%89%0%80%SlopCodeBench, 35 problemsDeepSeek32GLM34Haiku34Luna34Pool \(post hoc\)I2I^\{2\}100%100%91%97%SWE\-EVO, change inE10E\_\{10\}from the starting code, in ‰DeepSeek29GLM29Haiku29Luna29Pool \(post hoc\)I2I^\{2\}62%67%46%0%Table B2:Change in held\-out pass fraction on Commit0 and SlopCodeBench, per model, in percentage points, for all four contrasts\. Commit0 uses the withheld official suite at the 2M\-token cap\. SlopCodeBench uses the strict hidden\-test pass fraction at the final checkpoint\. R is expressed as a percentage\. R gives the reminder\-arm mean over its included tasks, with the task count in parentheses\. Contrasts may use different paired task sets, so adding a contrast to R need not recover the other arm’s mean\.nnis the number of tasks paired for CT–R\. Cells with no measured outcome are dropped\. We added seeds 4 and 5 for R and CT after inspecting results from seeds 1–3\. The other arms use seeds 1–3\. The pooled estimate is a post hoc fixed\-effect inverse\-variance average across four models\. Its standard error assumes independent models despite their shared tasks\.I2I^\{2\}estimates the proportion of variation among the four estimates attributable to heterogeneity; high values indicate that the pooled estimate averages differing effects\.ModelRC–RCT–RT–RR–B0nnCommit0, seeds 1–3 \(planned\)DeepSeek25GLM25Haiku25Luna25Pool \(post hoc\)I2I^\{2\}0%0%0%0%Commit0, seeds 1–5 for R and CT \(added after the first reading\)DeepSeek25GLM25Haiku25Luna25Pool \(post hoc\)I2I^\{2\}0%0%0%6%SlopCodeBench, two seedsDeepSeek32GLM34Haiku34Luna34Pool \(post hoc\)I2I^\{2\}10%0%0%0%Table B3:SWE\-EVO correctness per model, in percentage points, for all four contrasts\. Fix rate is the fraction of initially failing tests that pass on the final code\. It is set to zero if the agent breaks a test that passes both before and after the reference change\. Resolution means every official test passes\. R is in percent\. On SWE\-EVO, the plan named three main comparisons, all on fix rate: C–R, T–R and CT–R\. Each has its own 95% interval, with no correction for multiple comparisons\. Contrasts involving T or CT use 29 of the 35 transitions\. On six dvc transitions, a test module that fails to import stopped the project’s suite before any test ran, so the coverage feedback that defines T and CT measured nothing\. We excluded those six before reading any T or CT result \(App\.[A](https://arxiv.org/html/2611.23817#A1)\); the other contrasts use all 35\. Intervals are clustered by the six projects, as planned\. The small\-cluster correction was chosen later: CR2 with Bell–McCaffrey degrees of freedom\([Bell and McCaffrey, 2002](https://arxiv.org/html/2611.23817#bib.bib2);[Pustejovsky and Tipton, 2018](https://arxiv.org/html/2611.23817#bib.bib16)\), about two per model\. The pooled estimate uses attinterval with Satterthwaite degrees of freedom\([Satterthwaite, 1946](https://arxiv.org/html/2611.23817#bib.bib17)\)\. The pooled estimate is a post hoc fixed\-effect inverse\-variance average across four models\. Its standard error assumes independent models despite their shared tasks\.I2I^\{2\}estimates the proportion of variation among the four estimates attributable to heterogeneity; high values indicate that the pooled estimate averages differing effects\.ModelRC–RCT–RT–RR–B0nnFix rate \(primary\)DeepSeek29GLM29Haiku29Luna29Pool \(post hoc\)I2I^\{2\}9%0%0%0%Resolution \(secondary\)DeepSeek29GLM29Haiku29Luna29Pool \(post hoc\)I2I^\{2\}47%0%0%0%Table B4:Agent responses to feedback, using included cells and Commit0 seeds 1–3\. For complexity, we report the proportions of over\-limit functions edited again and under the limit at the end of the run\. C and CT count functions flagged in the report; R counts over\-limit functions edited by the agent\. For coverage, all arms use the same rule: among functions edited while coverage was below 1, we report the proportion whose coverage later increased\. The proportions pool function\-turn observations, so a function counts once for each turn on which it was flagged or edited\. No uncertainty intervals are reported\.Table B5:What lies behind the drop inE10E\_\{10\}\. A branch is a point where the code can take one of two paths, such as anif, a loop, anandor anor; a function’s cyclomatic complexity is its number of branches plus one\. Splitting a complex function into helpers lowersE10E\_\{10\}without removing a single branch, so we check how much of that drop survives undoing it\. Each pair is one task and seed with both arms’ final code on record \(seeds 1–3 on Commit0\)\.*As measured*is the change inE10E\_\{10\}on these pairs; it differs slightly from Table[B1](https://arxiv.org/html/2611.23817#A2.T1), which averages seeds within each task first\.*After inlining*repeats the measurement as if every function called from only one place had been written inside its caller\. We do this in both arms, including helpers written under R or by the libraries’ original authors, so it is a sensitivity check rather than an estimate of what splitting causes\. The last three columns describe the whole program\.*Branches*is the percent change in the number of branches, which splitting does not remove;*lines*is the percent change in lines of code; and*per 1k lines*is the change in branches per thousand lines of code\.*Branches*and*per 1k lines*can have opposite signs because the code’s length changes too: a few more branches spread over many more lines means fewer branches per line\. The branch count also grows with how much of the library an agent builds, and a few pairs where the C or CT run built much more than the R run make it rise in some rows\. Intervals are 95% bootstrap intervals that resample whole tasks; the two percent changes have none\.change inE10E\_\{10\}change in branches and linesModelpairsas measuredafter inliningbrancheslinesper 1k linesCommit0, seeds 1–3DeepSeekC–R62−0\.134\[−0\.200, −0\.073\]−0\.023\[−0\.043, −0\.004\]\+1%\+3%−7\.8\[−14\.0, −1\.9\]CT–R61−0\.066\[−0\.103, −0\.035\]−0\.016\[−0\.037, \+0\.004\]\+1%\+2%−5\.6\[−10\.3, −0\.8\]GLMC–R56−0\.124\[−0\.190, −0\.060\]−0\.029\[−0\.085, \+0\.020\]0%\+4%−4\.6\[−13\.2, \+5\.6\]CT–R55−0\.096\[−0\.166, −0\.025\]−0\.003\[−0\.047, \+0\.051\]−4%\+1%−5\.3\[−17\.3, \+7\.9\]HaikuC–R69−0\.065\[−0\.102, −0\.033\]−0\.011\[−0\.038, \+0\.016\]\+4%\+6%−6\.0\[−16\.8, \+4\.7\]CT–R69−0\.054\[−0\.087, −0\.026\]−0\.025\[−0\.059, \+0\.005\]−6%\+3%−16\.5\[−31\.2, −5\.1\]LunaC–R74−0\.268\[−0\.337, −0\.198\]−0\.075\[−0\.099, −0\.050\]−16%−4%−22\.9\[−30\.0, −16\.6\]CT–R74−0\.265\[−0\.333, −0\.197\]−0\.087\[−0\.114, −0\.061\]−16%−4%−21\.6\[−29\.1, −14\.8\]SlopCodeBench, two seedsDeepSeekC–R64−0\.424\[−0\.476, −0\.369\]−0\.044\[−0\.066, −0\.022\]−16%−7%−18\.2\[−28\.8, −7\.9\]CT–R58−0\.422\[−0\.468, −0\.373\]−0\.062\[−0\.085, −0\.039\]−21%−10%−27\.5\[−39\.5, −16\.4\]GLMC–R62−0\.527\[−0\.566, −0\.486\]−0\.076\[−0\.098, −0\.058\]−16%−3%−35\.4\[−44\.6, −26\.0\]CT–R56−0\.515\[−0\.551, −0\.475\]−0\.095\[−0\.120, −0\.071\]−21%−6%−37\.5\[−46\.5, −28\.1\]HaikuC–R64−0\.043\[−0\.063, −0\.026\]−0\.029\[−0\.049, −0\.010\]−4%−7%\+5\.5\[−1\.1, \+12\.0\]CT–R65−0\.046\[−0\.066, −0\.027\]−0\.053\[−0\.088, −0\.024\]−18%−19%\+3\.0\[−3\.7, \+9\.3\]LunaC–R68−0\.692\[−0\.730, −0\.654\]−0\.063\[−0\.078, −0\.049\]−14%−4%−30\.0\[−40\.3, −20\.4\]CT–R68−0\.687\[−0\.726, −0\.646\]−0\.054\[−0\.067, −0\.041\]−17%−9%−23\.8\[−33\.9, −14\.7\]
## Appendix CErosion along the run

Figure[2](https://arxiv.org/html/2611.23817#S3.F2)in the main text follows CT−\-R through each run\. Figure[C1](https://arxiv.org/html/2611.23817#A3.F1)shows every arm\. On Commit0, erosion under C and CT falls further below R as tokens are used\. T and B0 remain close to R, although B0 ends above R for Haiku and Luna, as does T for Haiku\. On SlopCodeBench, C and CT keepE10E\_\{10\}at or below 0\.022 at every checkpoint for all four models\.

#### A check on the stated limit\.

The complexity report asks the agent to bring every changed function to complexity 6 or below, andE6E\_\{6\}, the share of complexity mass above that limit, measures the request directly\. We useE6E\_\{6\}as a manipulation check and retainE10E\_\{10\}as the outcome\. Under C and CT,E6E\_\{6\}ends below R on both benchmarks for every model, and on SlopCodeBench it stays close to zero at every checkpoint, while T and B0 stay with R or above it \(Figure[C2](https://arxiv.org/html/2611.23817#A3.F2)\)\. The reminder does not state the limit\. An arm that states it without measuring code would test whether the target alone changes behavior \(Section[4](https://arxiv.org/html/2611.23817#S4)\)\.

Figure C1:E10E\_\{10\}for every arm and model\.\(a\)Commit0: paired change inE10E\_\{10\}from R at each processed\-token budget, with libraries as pairs and pointwise 95%ttbands\. Points require at least 15 paired libraries\. R and CT use seeds 1–5; the other arms use seeds 1–3\.\(b\)SlopCodeBench:E10E\_\{10\}by arm at each checkpoint, averaged first within problems and then across problems, with a pointwise 95%ttband\. We use included cells from the main runs, with two seeds\. Points require at least 5 problems at the checkpoint\. The second row of tick labels gives the number reaching it under any arm for that model\.Figure C2:E6E\_\{6\}, the share of complexity mass in functions above the report’s limit of 6, for every arm and model, drawn as Figure[C1](https://arxiv.org/html/2611.23817#A3.F1)drawsE10E\_\{10\}\.\(a\)Commit0: paired change inE6E\_\{6\}from R at each processed\-token budget, with libraries as pairs and pointwise 95%ttbands\. Points require at least 15 paired libraries\. R and CT use seeds 1–5; the other arms use seeds 1–3\.\(b\)SlopCodeBench:E6E\_\{6\}at each checkpoint by arm, built as in Figure[C1](https://arxiv.org/html/2611.23817#A3.F1)\(b\)\.

相似文章

重新思考LLM集成应用的复杂度度量:超越源代码

arXiv cs.AI

本文介绍了Hecate,这是首个能够量化LLM集成应用中提示层和代码层复杂度的工具。它采用基于霍尔逻辑的Prompt-as-Specification形式化方法,并在开源仓库上评估了52个候选度量,以识别那些能够捕获超出传统纯代码度量的结构广度。

编码模型做得太多了

Hacker News Top

一篇博客文章探讨“过度编辑”问题:编码大语言模型在修复简单错误时改写了过多代码,提出衡量指标与训练方法以鼓励最小化、忠实于原意的编辑。