🤖 AI Summary
Software developers frequently experience reduced code comprehension and maintenance efficiency due to missing implicit knowledge—such as design rationales and edge-case considerations—a gap that similarly impairs large language models’ (LLMs) performance on unfamiliar code. To address this, we propose Codetations, the first intelligent program annotation system supporting dynamic synchronization and cross-version anchoring. Our method integrates hybrid edit tracking with an LLM-driven, span-level cross-version anchoring mechanism to automatically persist and update annotations amid code changes. It further combines edit-difference analysis, LLM-based semantic understanding, and a real-time synchronized UI to enable automated generation and interactive management of semantically rich annotations. Evaluation shows Codetations significantly improves LLM accuracy in code repair tasks. A user study confirms its non-intrusive design and real-time collaborative capabilities deliver substantial practical value.
📝 Abstract
Software developers maintain extensive mental models of code they produce and its context, often relying on memory to retrieve or reconstruct design decisions, edge cases, and debugging experiences. These missing links and data obstruct both developers and, more recently, large language models (LLMs) working with unfamiliar code. We present Codetations, a system that helps developers contextualize documents with rich notes and tools. Unlike previous approaches, notes in Codetations stay outside the document to prevent code clutter, attaching to spans in the document using a hybrid edit-tracking/LLM-based method. Their content is dynamic, interactive, and synchronized with code changes. A worked example shows that relevant notes with interactively-collected data improve LLM performance during code repair. In our user evaluation, developers praised these properties and saw significant potential in annotation types that we generated with an LLM in just a few minutes.