オンラインリポジトリメモリによる有機的プルリクエストの生成:コミット学習アプローチ
Learning to Commit: Generating Organic Pull Requests via Online Repository Memory
March 27, 2026
著者: Mo Li, L. H. Xu, Qitai Tan, Ting Cao, Yunxin Liu
cs.AI
要旨
大規模言語モデル(LLM)ベースのコーディングエージェントは、制御されたベンチマークでは印象的な結果を達成するものの、実際のメンテナーによって却下されるプルリクエストを日常的に生成してしまう。根本的な原因は機能的誤りではなく、有機性の欠如にある。生成されたコードはプロジェクト固有の規約を無視し、内部APIが既に提供する機能を重複させ、長年の開発で蓄積された暗黙的なアーキテクチャ制約に違反するのである。単にエージェントに最新のリポジトリスナップショットを公開するだけでは不十分であり、スナップショットはコードベースの最終状態を明らかにするが、その状態に至るためのリポジトリ固有の変更パターンは示さない。本研究では、このギャップを埋めるためのフレームワーク「Learning to Commit」を提案する。このフレームワークは、オンラインリポジトリメモリを中核とする。厳密な時系列分割が施されたリポジトリにおいて、エージェントは過去のコミットに対して教師付き対照的省察を行う。つまり、各履歴issueを盲目的に解決しようと試み、その予測をオリジナルの差分と比較し、その隔たりを、コーディングスタイル、内部APIの使用法、アーキテクチャ不変条件を捕捉する再利用可能なパターンである「スキル」の継続的に成長する集合へと蒸留する。新しいPR説明が到着すると、エージェントはこれらの蓄積されたスキルに基づいて生成を行い、一般的な事前学習の事前確率ではなく、プロジェクト自身の進化に根ざした変更を生成する。評価は、スキル構築段階で見ることができなかった、真に未来のマージ済みプルリクエストに対して実施され、機能的正確性、コードスタイルの一貫性、内部API再利用率、変更領域の妥当性など多次元にわたって行われる。豊富なコミット履歴を持つ専門家管理リポジトリでの実験により、オンラインリポジトリメモリが将来の保留タスクにおける有機性スコアを効果的に改善することが示された。
English
Large language model (LLM)-based coding agents achieve impressive results on controlled benchmarks yet routinely produce pull requests that real maintainers reject. The root cause is not functional incorrectness but a lack of organicity: generated code ignores project-specific conventions, duplicates functionality already provided by internal APIs, and violates implicit architectural constraints accumulated over years of development. Simply exposing an agent to the latest repository snapshot is not enough: the snapshot reveals the final state of the codebase, but not the repository-specific change patterns by which that state was reached. We introduce Learning to Commit, a framework that closes this gap through Online Repository Memory. Given a repository with a strict chronological split, the agent performs supervised contrastive reflection on earlier commits: it blindly attempts to resolve each historical issue, compares its prediction against the oracle diff, and distils the gap into a continuously growing set of skills-reusable patterns capturing coding style, internal API usage, and architectural invariants. When a new PR description arrives, the agent conditions its generation on these accumulated skills, producing changes grounded in the project's own evolution rather than generic pretraining priors. Evaluation is conducted on genuinely future, merged pull requests that could not have been seen during the skill-building phase, and spans multiple dimensions including functional correctness, code-style consistency, internal API reuse rate, and modified-region plausibility. Experiments on an expert-maintained repository with rich commit history show that Online Repository Memory effectively improves organicity scores on held-out future tasks.