Revision-Consistent Code Context for Agents That Edit Their Environment
Meng Shi
Key points
From the paper's conclusion- We call this condition mixed-revision code context.
Abstract
Editing agents query repositories while simultaneously changing them. Source content, symbols, graph relations, and retrieval state may be maintained by different stores and refreshed at different times. During an update, a successful query can therefore combine facts that never belonged to the same repository state. We call this condition mixed-revision code context. This paper proposes an Agent-visible complete-revision publication contract for composite code-intelligence queries. Before a query-visible publication point, a service must wait, report unavailability, or serve a complete old revision; after that point, it serves the complete new revision. The contract requires a shared version identity and publication boundary across every view returned in one response. We instantiate the method in Codetrip, whose brief operation joins source, symbol, and graph facts. In a controlled comparison on frozen Gin v1.12.0, live-source composition produced two unsafe responses in 150 update trials, whereas complete-revision publication produced none under the same five edit scenarios. We further implement journaled, idempotent publication and terminate the real MCP process at five durable boundaries. All 300 evaluable recovery trials on frozen Gin and Cobra returned complete-new context equivalent to a clean full rebuild, with median restart-to-context latency of 77--131 ms. In a separate rename probe, mixed context occurred in 0/30 Codetrip trials and 30/30 trials for both CodeGraph and codebase-memory-mcp before clean-full-equivalent convergence. The contribution is an Agent-facing safety contract, implementation pattern, and measurement protocol for joining live repository bytes with asynchronously derived facts. Every successful composite response consequently has a testable repository-state meaning, including after interruption.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Cross-Provider Review as a Runtime Contract for Coding Agents: A Controlled Pilot and Fault-Injection StudyarXiv · 2026
- The Working Set of a Coding Agent: Coherence Debt in Repository-Scale TasksarXiv · 2026
- Loop Engineering: Version-Bound, Evidence-Gated Coordination for Production Coding AgentsarXiv · 2026
- How Should Agents See Code? Rethinking Code Representations for Agentic Software EngineeringarXiv · 2026
- Call-Level Revision Contracts for LLM-Authored WorkflowsarXiv · 2026
- Rivet: Utility-Preserving Context Control for Repository-Level Coding AgentsarXiv · 2026