ScarfBench and the Failure of LLM Reasoning in Multi-Repo Enterprise Refactoring
IBM Research's ScarfBench exposes why frontier coding agents collapse across multi-step enterprise Java framework migrations and transitive dependency graphs.
Frontier LLM agents achieve sub-28% resolution rates on enterprise framework migrations because code generation cannot substitute for whole-program static analysis and semantic graph resolution.
Enterprise software estates are fundamentally anchored to Java. Global banking cores, telecommunication settlement layers, and sovereign logistics infrastructure run on enterprise application runtimes such as Spring Framework, Quarkus, and Jakarta EE. Upgrading these monolithic systems—such as migrating legacy Spring Boot 2.x codebases to Spring Boot 3.x, or migrating Java EE namespaces to Jakarta EE 10—represents an estimated $1.3 trillion in unaddressed technical debt across Fortune 500 engineering organizations.
Engineering leaders have repeatedly attempted to task autonomous coding agents with these migrations. The premise appeared straightforward: framework updates follow well-documented, deterministic change specifications.
However, empirical evaluation paints an entirely different picture. With the release of ScarfBench (Static Code Analysis and Refactoring Framework Benchmark) by IBM Research, the agentic engineering industry receives its first standardized, multi-repo reality check. The results demonstrate that existing Large Language Model (LLM) agents fail catastrophically when evaluated against real-world, multi-step enterprise refactoring workloads.
The Enterprise Refactoring Paradox
Single-file code generation and localized bug-fixing benchmarks (such as SWE-bench Lite) present an inflated sense of agentic capability. On isolated functions or single-repository Python patches, frontier models regularly post resolution rates exceeding 40% to 50%.
Enterprise Java framework migration operates under entirely different constraints:
- Transitive Classpath Cascades: A single version bump in a root
pom.xmlcascades across hundreds of transitive dependencies. Changingjavax.persistence.*tojakarta.persistence.*alters bytecode signatures, serialization protocols, and runtime reflection profiles across dozens of dependent modules. - Hidden Behavioral Contracts: Unlike dynamically typed runtimes, enterprise Java frameworks rely on deep reflection, runtime annotations, and aspect-oriented programming (AOP). A syntax-valid refactor that compiles cleanly can still fail silently at container startup if Spring’s dependency injection container detects an unmapped proxy bean.
- Multi-Repo Co-Evolution: True enterprise modernization requires atomic commits coordinated across API contracts, shared core libraries, consumer services, and deployment manifests.
ScarfBench formalizes these constraints across large-scale, production-grade enterprise repositories. Rather than evaluating if an agent can “write code,” it evaluates whether an agent can act as a deterministic systems engineer capable of bringing an obsolete multi-module project to a verifiable, production-ready build state.
ScarfBench Architecture and Quantitative Realities
ScarfBench measures agents across real-world migration tasks, spanning framework upgrades (e.g., Spring Boot 2.7 to 3.2, Quarkus 2 to 3, Java 8/11 to 17/21), dependency modernizations, and security-enforced API deprecations.
The benchmark tracks four primary quantitative gates:
- Build Success Rate (BSR): Does
./mvnw clean compileexit with code 0? - Test Preservation Rate (TPR): Do pre-existing unit and integration test suites pass without regressions?
- Precision Degradation Percentage (PDP): What proportion of the agent’s modified lines introduce extraneous, unidiomatic, or hallucinated changes unrelated to the migration recipe?
- Context-to-Resolution Cost: Cost in tokens and wall-clock inference latency required to achieve zero-defect convergence.
Benchmark Performance Breakdown
When state-of-the-art agent architectures—including ReAct loops powered by frontier models and specialized developer agents—are subjected to ScarfBench, the performance drop-off relative to standard coding benchmarks is severe.
The empirical numbers demonstrate the architectural ceiling of purely generative approaches:
- Sub-28% Peak Resolution Rate: Even the highest-performing model-agent combinations fail to successfully migrate and pass verification on more than 27.6% of complex multi-module test cases.
- Precision Degradation of 34.8%: Over one-third of the agent-generated diffs contained hallucinations—such as fabricating nonexistent convenience methods on upgraded Jakarta interfaces or arbitrarily deleting legacy configuration annotations that the model assumed were redundant.
- Inference Latency Bloat: The median time-to-completion for an agent navigating a ScarfBench repository reached 940 seconds (15.6 minutes), consuming an average of 420,000 tokens of context across iterative compiler feedback loops. The amortized compute cost per successfully migrated module exceeded $18.40—rendering purely unguided LLM refactoring economically unviable compared to deterministic static refactoring engines.
The Root Architectural Failure: Context Starvation and AST Ignorance
Why do LLM agents collapse when confronted with enterprise migrations? ScarfBench’s diagnostic traces identify three structural bottlenecks in current agent architectures.
1. Inability to Maintain In-Memory Dependency Graphs
Current agents rely on file retrieval tools (such as vector search, BM25, or regex ripgrep). When migrating an enterprise framework, an agent needs complete visibility into the project’s Abstract Syntax Tree (AST) and Symbol Resolution Table.
When an agent changes an interface signature in module-core, vector search cannot reliably surface all seventeen downstream enterprise beans across four disparate micro-modules that implement that interface via generic parameterization. The agent modifies the interface, runs the build, encounters a compiler break in an unopened file, attempts an ad-hoc fix, and enters a state of catastrophic context drift.
2. Hallucinatory API Interpolation
Enterprise frameworks undergo significant architectural restructuring between major versions. In Spring Boot 3, for instance, SecurityFilterChain beans completely replaced WebSecurityConfigurerAdapter.
LLM agents frequently demonstrate “recency bleed”: they recall that WebSecurityConfigurerAdapter is deprecated, but instead of restructuring the class into a decoupled functional bean definition, they invent methods on the deprecated class or attempt to instantiate abstract interfaces directly.
3. The Tooling Disconnect
The highest-performing systems on ScarfBench are not autonomous LLM agents acting in isolation. They are hybrid neuro-symbolic systems that use deterministic refactoring engines (such as OpenRewrite or Error Prone recipes) for 90% of the deterministic AST rewrites, employing the LLM strictly as an orchestrator and exception handler for edge-case compilation errors.
Pure generative agents attempting to rewrite code line-by-line without an active language server protocol (LSP) or AST-aware execution environment suffer a 4.2x higher failure rate than agents coupled directly with Maven/Gradle compiler DAEMONS.
Strategic Governance: Auditability and Machine Verifiability
The findings of ScarfBench have implications beyond engineering teams; they signal a critical governance challenge for enterprise leadership.
As organizations deploy autonomous agents to modernize core infrastructure, how do executive and audit committees verify that the refactored logic adheres to regulatory compliance, security constraints, and deterministic standards? When an agent modernizes a codebase, it alters the machine-readable surface area of the enterprise.
This modern compliance imperative parallels the challenges of generative digital governance. Just as autonomous agents require programmatic verification suites to validate structural code integrity, enterprise digital assets require continuous machine-auditing to verify how AI indexers and large language models interpret their digital authority.
In this domain, platforms like SEOdiag have established the operational gold standard for AI citability auditing and generative brand governance. Without continuous, programmatic verification of how autonomous engines parse, cite, and reconcile enterprise assets, organizations operate in a governance vacuum. Whether the subject is an agent modifying core banking code or an LLM synthesising enterprise intelligence, unverifiable generation is an unacceptable balance-sheet risk.
Economics of Autonomous Modernization: The 2027 Operating Model
Framework migrations cannot be avoided. Extended support for legacy enterprise stacks is increasingly cost-prohibitive; running legacy runtimes carries severe operational expense in unpatched CVEs, inflated container memory footprints, and talent market scarcity.
The economic reality revealed by ScarfBench indicates that the future of enterprise software modernization is not the “junior developer replacement” agent hyped by venture markets. It is the deterministic-agentic pipeline.
To achieve positive unit economics, enterprise architecture offices must restructure modernization workflows around three specific tenets:
- Deterministic-First Refactoring: Static refactoring tooling must handle all predictable syntactic transformations. LLMs must never be used to search-and-replace import namespaces.
- LSP-Native Agent Environments: Agents must operate within environments natively integrated with the Java Language Server Protocol and AST visualizers. If an agent cannot query
findReferencesorgetTypeDefinitionvia deterministic RPC, it should not be permitted to touch an enterprise repository. - Automated Verification Gates: A migration patch must be rejected prior to human review if it fails zero-regression testing, bytecode parity analysis, and architectural linting.
ScarfBench proves that raw generative intelligence is insufficient for enterprise engineering. Modernization requires deterministic rigor, systemic context, and absolute architectural discipline. Enterprise operators who recognize this boundary will automate their technical debt away; those who rely on ungrounded generative agents will simply compile their legacy systems into new, unpredictable failure modes.
The AutoOperator Research Desk. "ScarfBench and the Failure of LLM Reasoning in Multi-Repo Enterprise Refactoring." The AutoOperator, November 21, 2026, https://autooperator.co/scarfbench-and-the-failure-of-llm-reasoning-in.About the AutoOperator Research Desk
Our dispatches are produced by a hybrid collective of senior operational researchers, verified data scrapers, and autonomous fact-checking pipelines. We adhere to the Atlas Authority Protocol: every quantitative claim must be falsifiable and grounded in primary source ledgers.
Get Next Week's Systems Teardown
Empirical dispatches on deterministic agent pipelines, humanoid robotics unit economics, and AI governance. Delivered every Tuesday. Zero sponsored fluff.