# Accepted but Wrong: Silent Failures of LLM Code Repairs after API Migrations

arXiv: https://arxiv.org/abs/2611.08269 · HTML: https://mlsanity.com/paper/2611.08269/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 24 of its 45 references that are in the map.
- Submitted 5 Nov 2026.

## Builds on (most cited first, 24 of 24)

- [Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena](https://mlsanity.com/paper/2306.05685/) (2023)
- [Teaching Large Language Models to Self-Debug](https://mlsanity.com/paper/2304.05128/) (2023)
- [CodeT: Code Generation with Generated Tests](https://mlsanity.com/paper/2207.10397/) (2022)
- [Are "Solved Issues" in SWE-bench Really Solved Correctly? An Empirical Study](https://mlsanity.com/paper/2503.15223/) (2025)
- [UTBoost: Rigorous Evaluation of Coding Agents on SWE-Bench](https://mlsanity.com/paper/2506.09289/) (2025)
- [Effective Test Generation Using Pre-trained Large Language Models and Mutation Testing](https://mlsanity.com/paper/2308.16557/) (2023)
- [Can Large Language Models Write Good Property-Based Tests?](https://mlsanity.com/paper/2307.04346/) (2023)
- [LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-based Code Completion](https://mlsanity.com/paper/2406.09834/) (2024)
- [CodeUpdateArena: Benchmarking Knowledge Editing on API Updates](https://mlsanity.com/paper/2407.06249/) (2024)
- [Learning Evolving Tools for Large Language Models](https://mlsanity.com/paper/2410.06617/) (2024)
- [Identifying Patch Correctness in Test-Based Program Repair](https://mlsanity.com/paper/1706.09120/) (2017)
- [MigrationBench: Repository-Level Code Migration Benchmark from Java 8](https://mlsanity.com/paper/2505.09569/) (2025)
- [LibEvolutionEval: A Benchmark and Study for Version-Specific Code Generation](https://mlsanity.com/paper/2412.04478/) (2024)
- [FreshBrew: A Benchmark for Evaluating AI Agents on Java Code Migration](https://mlsanity.com/paper/2510.04852/) (2025)
- [PAFT: Preservation Aware Fine-Tuning for Minimal-Edit Program Repair](https://mlsanity.com/paper/2604.03113/) (2026)
- [Retry, Switch, or Abstain? Learning Strategy-Aware Tool-Use Policies via Controlled Error Injection](https://mlsanity.com/paper/2608.11977/) (2026)
- [Beyond Task Completion: A Verification-vs.-Conformance Gap in Tool-Evolving Agents](https://mlsanity.com/paper/2604.00392/) (2026)
- [To Diff or Not to Diff? Structure-Aware and Adaptive Output Formats for Efficient LLM-based Code Editing](https://mlsanity.com/paper/2604.27296/) (2026)
- [Has My Release Disobeyed Semantic Versioning? Static Detection Based on Semantic Differencing](https://mlsanity.com/paper/2209.00393/) (2022)
- [Client--Library Compatibility Testing with API Interaction Snapshots](https://mlsanity.com/paper/2507.20814/) (2025)
- [DepRepair: LLM-Based Source-Code Repair for Dependency Breaking Changes](https://mlsanity.com/paper/2607.17957/) (2026)
- [DynamicMCPBench: A Trace-Grounded, Effect-Scored Benchmark for LLM Agents over Live MCP Servers](https://mlsanity.com/paper/2607.20531/) (2026)
- [BreakGuard: Towards Detecting Dependency Breaking Changes with LLM-Generated Tests](https://mlsanity.com/paper/2608.20167/) (2026)
- [ContractRL: Shielded Group-Relative Policy Optimization for Auditable Tool-Call Repair](https://mlsanity.com/paper/2610.00328/) (2026)

## Abstract (arXiv)

After an API migration, an LLM-repaired procedure can run cleanly yet return wrong results, and a typical-input release check ships it. We report a preregistered study of 73 tasks on 60 documented changes in CPython, Node.js and SQLite. In the main stages, repairs are choices among documented code fragments, run on the real runtimes against withheld contracts. Over the complete repair space, the all-assertions gate on typical inputs released 0.410 of wrong repairs. One edge input written from the release note cut this to 0.065, and to 0.061 on 15 unseen clusters; three inputs from a blind low-cost commercial writer (GPT-5.6-luna) reached 0.070. Two more frozen stages enlarged the menu to 1491 fragments and added 233 hard distractors that match legacy output on typical inputs. The edge input (0.058) and the GPT-5.6-luna writer (0.058) passed preregistered tests (two local-model writers did not), yet 0.168 and 0.153 of hard wrong programs still passed (task means; post hoc: pooled 0.104 and 0.081; models rarely chose them). In all three open-weight families and menus, the edge input cut wrong releases per attempt without materially lowering correct completion; self-tests helped less. A blind AI audit flagged 34 of 73 contracts (20 as too strict). Three post-hoc blind human reviewers of strictness (the first author and two non-author software practitioners) upheld none of its 11 such flags in 40 sampled contracts; a majority judged one contract (py-random-seed-tuple) stricter than its requirement. Dropping disputed checks changed 0 verdicts; class-label disputes are open. In a preregistered free-form addendum, models wrote whole programs, run only in a sandbox; for clean-running wrong programs, the edge input cut releases from 0.517 to 0.114 for gpt-oss-20b (Holm p 0.001) and from 0.653 to 0.113 for qwen3.6, but only from 0.713 to 0.481 for GPT-5.6-luna (descriptive).
