WriterKnowsBest: Evidence-Bound Writing for Faithful Repository-Level Documentation
The paper introduces WriterKnowsBest, an evidence-bound approach for generating repository documentation that enforces explicit claim attribution and coverage obligations, significantly improving both factual support and public API completeness compared to existing methods.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Software developers rely on documentation to understand how to use the complex systems they build. This documentation acts as a map, describing what a piece of code can do and how to interact with it. However, creating these maps is difficult because the code itself is the only source of truth. If a writer describes a feature that the code does not actually have, the documentation becomes misleading, leading developers to expect capabilities that do not exist. Conversely, if a writer is too cautious to avoid making mistakes, they might leave out important details, leaving users without a complete guide. The challenge lies in finding a way to be both detailed and strictly accurate at the same time.
A team of researchers has developed a new approach called WriterKnowsBest to solve this problem. Instead of simply asking a computer to write a description based on a prompt, this system treats the writing process like a legal proceeding where every statement must be backed by proof. The system works by first locking down a specific version of a software project, freezing it in time so the evidence cannot change. As the computer drafts the documentation, it must read the actual source files to gather information. Every time it reads a piece of code, the system issues a digital receipt, a record that proves that specific information was seen.
When the computer writes a sentence about how a function works, it must attach one of these receipts to that sentence. If it claims a method returns a specific value, it must point to the exact line of code that shows that return value. If the computer cannot find a receipt to support a claim, it is not allowed to write that claim as a fact; it must either leave it out or mark it as unsupported. This process prevents the system from inventing features or describing behaviors that are not present in the code. The system also keeps a checklist of every public interface the software offers, ensuring that the final document covers all the necessary parts without skipping any.
The researchers tested this method on four different Java software projects, ranging from well-known libraries to a banking system. They compared the output of their new system against a previous method that did not require this strict evidence tracking. The results showed a clear improvement in accuracy. The new system increased the number of facts that were fully supported by the code from about 84 percent to over 92 percent. At the same time, it managed to cover nearly all of the public interfaces, reaching 99 percent coverage, whereas the older method missed about 13 percent of the available tools.
The study also looked at the quality of the connections between the text and the evidence. The researchers audited hundreds of these links and found that nearly 89 percent of them had at least some support from the source code. This suggests that requiring explicit proof for every claim helps the system stay grounded in reality. While the system cannot yet determine the deeper design intent or the speed of the software, it successfully ensures that the basic structural facts and usage examples are correct. By forcing the writer to bind every claim to a recorded read, the approach creates documentation that is both comprehensive and faithful to the code it describes, offering a reliable guide for developers who need to trust what they read.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.