Skip to content
Preprint

Rivet: Utility-Preserving Context Control for Repository-Level Coding Agents

Oct 2026 · 0 citations · 41 references
Computer Science

TL;DR

Rivet is proposed, a context control framework that preserves repository evidence for coding agents under a fixed context budget that achieves the highest Pass@1 in all 16 settings and improves over the strongest baseline by 3.15 percentage points on average.

Abstract

Repository-level code generation asks an agent to implement a task requirement inside an existing repository. To produce code that works in the repository, the agent needs repository evidence, such as target locations, helper definitions, caller usages, and configuration constraints, which determine how the code should be located, integrated, and executed. Because the context budget cannot hold the entire repository, existing retrieval, compression, and structure-aware methods select context by task similarity, context length, or structural proximity, but these criteria do not directly measure whether the selected context contains this evidence. As a result, the selected context can appear relevant to the task yet miss the evidence that the implementation depends on. We call this failure mode context utility dilution. In this paper, we propose Rivet, a context control framework that preserves repository evidence for coding agents under a fixed context budget. Rivet, first uses Signal Grounding to select task-related code anchors by fusing lexical, semantic, and structural signals. Utility Linking then expands these anchors through dependency, usage, and configuration relations to collect repository evidence. Finally, Budget Shaping packs the evidence by priority and, when the budget is tight, reduces snippets to signatures or summaries before dropping them. We evaluate Rivet, on two executable repository-level benchmarks, DevEval and RepoExec, with four backbone models, two context budgets (4K and 8K tokens), and eight baselines. Rivet, achieves the highest Pass@1 in all 16 settings and improves over the strongest baseline by 3.73--5.15 percentage points on average. Moreover, GPT-5-mini with Rivet, outperforms GPT-5 without Rivet,on both benchmarks while reducing inference cost by 73.3%--84.5%.

View source

Similar papers

Book Open access Oct 2026

Context Inheritance: A Git-Native Architecture and Pre-registered Study of Repository Context for AI Coding Agents

AI coding agents repeatedly rediscover project constraints, because repositories version code but not operating knowledge: the decisions taken, the alternatives rejected, the constraints found during execution. We introduce the Repository Context Layer (RCL) — the repository carries its own agent-facing context, versio...

Pavel Kerbel, Milana Kerbel, V. Abramov et al. · 0 citations
Preprint Oct 2026

When Relevant Code Is Wrong: Runtime-Aware Context for AI Coding Agents

AI coding agents increasingly rely on retrieved code and development history to guide software changes. However, highly relevant artifacts may describe implementations that are inactive or incompatible with the target deployment. Neither semantic similarity nor recency establishes whether retrieved information remains...

W. Assunção, Ramesh Periyathambi · 0 citations
Book Open access Oct 2026

Ranking Is Not Authority: Executable Context-Routing Contracts for Coding Agents

An executable routing contract and its conformance tests, an attempt-complete evaluation ledger, and evidence that aggregate repair success cannot certify what an agent received at the initial-context boundary are contributed.

Nikhil Mahesh · 0 citations
Review Sep 2026

Spotlights: Discovering Improvement Opportunities in Software Repositories

Spotlights is presented, a system that performs optimization-opportunity discovery as a distinct and empirically evaluable step between a broad engineering objective and subsequent implementation and validation.

U. Barzelay, Ophir Azulai, Idan Friedman et al. · 0 citations
Preprint Sep 2026

ATTUNER: Recomputation-Free Agentic Context KV Reuse

This work isolates the source of the loss, finding that the positional mismatch has minor effect, and independently cached artifacts retain faithful representations: reading a provided artifact stays largely accurate, and performance degrades only when the model must select among multiple artifacts.

Xing-Hao Chen, Jun-Nan Dong, Cai Ke et al. · 1 citation · ⚡1

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.