AI Learns To Commit Like A Real Developer
Based on research by Mo Li, L. H. Xu, Qitai Tan, Ting Cao, Yunxin Liu
When large language models produce code that functions perfectly yet gets rejected by maintainers, the issue is rarely bugs. The true culprit is a lack of organicity, where AI ignores years of project history and violates implicit architectural rules. A new approach called Learning to Commit changes the game by teaching agents to learn from a repository's actual evolution rather than just its current snapshot.
This method uses online repository memory to force AI to analyze every past commit in chronological order. The system blindly attempts to resolve historical issues, compares its solutions against the original accepted changes, and extracts reusable skills regarding coding style and internal APIs. By grounding new code generations in this accumulated experience of how the project actually grew, the AI stops relying on generic knowledge and starts mimicking the specific trajectory of the software it is working on. Tests on expert-maintained projects show that this technique significantly improves acceptance rates by aligning generated pull requests with the project's authentic change patterns and hidden constraints.