Skip to content
Book Open access

AnchorRepair: A Reference-Guided Dual-Agent Framework for Code Translation Repair

Oct 2026 · 0 citations · 49 references

TL;DR

AnchorRepair is proposed, a dual-agent framework that treats the Java source as first-class diagnostic evidence that generalizes across LLM backends without modification and achieves repair coverage comparable to a general-purpose coding agent at less than half the cost.

Abstract

Automated code translators can now produce repository-scale translations from Java to Python, yet a substantial fraction of translated functions remain semantically incorrect. Repairing such defects differs from traditional automated program repair (APR) because the correctness specification is based on the source language and no target-language test suite exists to guide fault localization. We observe that the original Java code is the most authoritative specification for repair and propose AnchorRepair, a dual-agent framework that treats the Java source as first-class diagnostic evidence. The Diagnosis Agent operates in a ReAct-style loop and autonomously invokes seven cross-lingual analysis tools, producing a structured root-cause diagnosis by contrasting the Java specification against the Python translation across control flow, data flow, and call graph dimensions. A Patch Agent then generates a corrected Python function conditioned on this diagnosis and the retrieved Java context. We evaluated AnchorRepair on 82 real translation defects from four Apache Commons projects. With DeepSeek-V3.2 as the backend, AnchorRepair repairs 40 defects (48.8%), a 12-point absolute improvement over the LLM-Only baseline (28/82) and substantially outperforming TransAgent (17/82) and D4C (21/82). The framework generalizes across LLM backends without modification and achieves repair coverage comparable to a general-purpose coding agent at less than half the cost. Our source code and all experimental results are publicly available at https://github.com/JJS-TJ/AnchorRepair.

Read PDF

Similar papers

#software testing Open access Aug 2026

Multi-Agent Strategies for Bridging Programming Language Gaps in Code Generation

This work introduces XL-CoGen, a three-stage multilingual code-generation pipeline that starts from a natural-language specification and a shared test list to generate correct implementations across multiple target languages and repairs the best candidate through diagnosis and minimal patching.

Micheline Bénédicte Moumoula, Serge Lionel Nikiema, Albérick Euraste Djiré et al. · 0 citations
Open access Aug 2026

StructFix: a structure-aware reasoning framework for automated program repair with code property graphs

StructFix is proposed, a structure-aware APR framework that grounds masked patch generation in Code Property Graphs (CPGs), and explicitly coupling structural dependencies with masked generation improves repair effectiveness and enables transfer across datasets.

Mengtian Cui, Yang-Fan Liu, Zhibo Lu et al. · 0 citations
Open access Oct 2026

MOCA: A Hierarchical Semantic-Enhanced Code Edit Framework for Multilingual Code Co-Evolution

Multilingual code co-evolution aims to propagate code edits across programming languages while preserving functional consistency, yet the task remains challenging in real-world repositories. Our motivating examples reveal two key challenges: (1) Existing models fail to infer the rationale behind source edits and may om...

Zhi-Hao Gong, Ze-Yu Sun, Xin Yin et al. · 0 citations
Open access 2026

From Context to Code: Codifying Cross-System Reasoning for LLM-Assisted Operations

Large language model (LLM)-assisted operations often rely on many independent tools, with the operator or agent stitching partial answers together client-side. This can produce correct answers, but the reasoning remains brittle, session-local, and difficult to reuse. We present Axiom, a production federated query engin...

Tanmay Chaudhry · 0 citations
#natural language process... Preprint Sep 2026

MTAC-IFBench: Benchmarking Instruction-Following in Multi-Turn Agentic Coding

Recently, the rapid development of large language models (LLMs) has reshaped software engineering by enabling autonomous code agents that plan, execute, and utilize external tools iteratively to tackle complex tasks. Beyond achieving functional correctness, these agents must faithfully follow process instructions and c...

Bo-Si Wen, Cun-Xiang Wang, Jia-Yi Gui et al. · 1 citation
Preprint Oct 2026

PolyCodeEval: Benchmarking Multilingual Code Generation from Functions to Repositories

As large language models increasingly move toward repository-level software engineering, existing code-generation benchmarks remain fragmented across language coverage, task granularity, and evaluation protocols, impeding systematic comparison. To address this gap, we present PolyCodeEval, a unified multilingual and mu...

Bo-Wen Yang, Jia-Jun Jiang, Lu-Xue Yu et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.