Manuscript Offprint

arXiv:2609.31587

Compact Documentation for Coding Agents: A Benchmark, an Optimizer, and Why It Does Not Transfer

Md Shohel Arman, Igor Molybog

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We investigate whether natural-language documentation helps coding agents resolve software issues, and we build the tools to construct and evaluate it. We introduce a roundtrip benchmark that scores code descriptions by whether code regenerated from them passes the original tests, and show that completeness, not length, drives a description's fidelity. Using the benchmark as an optimization signal, we discover a description-writing prompt that reaches full fidelity and generalizes to unseen files. We then test the hypothesis that motivated the work: that better documentation helps an agent resolve real repository issues. Across two model families and ten repositories, and against a positive control confirming that our evaluation can detect a genuine improvement, we find that it does not. When the source is present, neither static compact documentation nor retrieved context beats the issue alone. We report this negative result together with the benchmark and the optimizer, and we characterize the boundary at which documentation helps.

1 Introduction

For large enough repositories, loading the entire codebase into an agent's context is prohibitively expensive or impossible. Coding agents must therefore edit files they have not read in full, relying instead on high-level descriptions in their context to supply the intent and contracts that the raw code leaves implicit. Agents operate this way on real repositories (Yang et al. 2024c; Zhang et al. 2024), but an incomplete or incorrect description acts as a faulty map. This motivates a natural hypothesis: high-fidelity descriptions, standing in for source the agent cannot load, should help it resolve real issues. We set out to build documentation good enough to serve this role, and to test whether it does. Our focus is on evaluating and optimizing the descriptions themselves, independent of the agent's internal machinery, so we first investigate what a good description contains and how to generate it automatically, and then ask whether better descriptions actually help downstream.

We approach the problem in four steps. First, we establish when documentation helps an agent and identify the two properties governing its value: completeness and compactness. Second, we develop a roundtrip benchmark that measures these properties by regenerating code from descriptions and running the original tests, validating the benchmark on real repositories while controlling for memorization. Third, we use the benchmark as an optimization signal and discover a description-writing prompt that reaches full regeneration fidelity and generalizes to unseen files. Fourth, and this is the question that motivated the work, we test at scale whether these descriptions help an agent resolve real repository issues.

Our central claim about description quality holds: completeness, not length, is the primary driver of a description's fidelity, and the optimizer confirms it by converging to prompts that are both complete and compact. The downstream claim does not hold. When the source file is withheld, an optimized description substitutes for it well enough to lift issue resolution from a mean test-pass fraction of 0.08 to 0.71. But when the source is present, which is how coding agents normally operate, the benefit disappears. Across two model families and ten repositories, and against a positive control confirming that our evaluation can detect a genuine improvement when one exists, neither a static compact description nor retrieved past-task context improves issue resolution over giving the agent the issue alone; longer documentation can make matters slightly worse (Table 8). We report this negative result honestly, alongside the benchmark and optimizer that produced it, and we locate the boundary separating the two regimes.

We make three contributions. (1) A roundtrip benchmark that scores a describer, the system producing a natural-language description, by whether code regenerated from its description alone passes the original tests, together with a compression measure and controls for memorization. (2) A controlled account of when documentation helps an agent, separating the effect of completeness from that of length, and a self-improvement loop that optimizes the describer against the benchmark, reaches full fidelity, and generalizes to held-out files. (3) A large-scale, multi-model test of the downstream hypothesis that better documentation helps issue resolution, which, with a validating positive control, returns a robust null in the source-present setting and locates the boundary at which documentation stops helping.

References (67)