Search papers, labs, and topics across Lattice.
This paper introduces Entropy-based Code Adversarial Translation (ECAT), a multi-agent framework designed to automate the migration of Android repositories to HarmonyOS by minimizing adversarial entropy. By employing a generator-discriminator architecture, ECAT optimizes repository updates based on a unified metric called Code Entropy, ensuring that each modification contributes to a functionally complete application. The framework not only achieves a 74.7% migration quality but also establishes A2H-RepoBench, a benchmark for evaluating migration across various repository sizes, demonstrating superior performance compared to existing methods.
Achieving 74.7% migration quality, ECAT revolutionizes repository migration by leveraging adversarial entropy minimization to ensure functional completeness in real-world applications.
LLMs have demonstrated strong capabilities in code generation and automated program repair, but migrating an entire repository rarely produces a runnable application because long-horizon translation challenges LLM-based agents'ability to maintain repository-level migration objectives. In this work, we propose Entropy-based Code Adversarial Translation (ECAT), a multi-agent framework for automated Android-to-HarmonyOS repository migration. ECAT formulates repository migration as adversarial entropy minimization through a generator-discriminator architecture. The discriminator measures migration quality using a unified metric called Code Entropy and produces text gradients that specify both file-level generation directives and the skills needed to execute them. Guided by these optimization signals, the generator iteratively updates the repository, and each update is accepted only if it reduces Code Entropy. Repeated generator--discriminator interactions progressively drive the migration from an initial template toward a functionally complete HarmonyOS repository. Successful low-entropy trajectories are further distilled into a self-evolving memory tree, enabling transferable migration knowledge across repositories. We also introduce A2H-RepoBench, the first real-world benchmark for Android-to-HarmonyOS repository migration, covering applications from tens of thousands to hundreds of thousands of lines of code. Evaluated by node alignment and an agent-based functional judge, ECAT achieves 74.7% overall migration quality and consistently outperforms existing agent-based methods across repositories of different scales.