WriterKnowsBest: Evidence-Bound Writing for Faithful Repository-Level Documentation
Repository documentation must describe implemented behavior and cover the public application programming interfaces (APIs) developers need. Detailed descriptions may go beyond the available evidence, while cautious ones may omit useful content. We present WriterKnowsBest, an evidence-bound approach that requires explicit claim attribution and coverage during generation. The system records repository reads, and the writer binds checkable claims to these records during drafting. Separate coverage obligations identify the content to address, and typed checks validate structural facts and usage examples before delivery. Claim–evidence associations are available for inspection throughout generation. We evaluate the approach on four Java repositories comprising 31 matched components, 62 documents, and 3,808 atomic facts. Compared with RepoDoc, weighted atomic support increases from 0.844 to 0.924 and public-API coverage from 87.3% to 99.0%. When the same generator is required to cover repository facts and link its claims to evidence, the atomic support rate rises from 0.871 to 0.904. Of 223 audited bindings, 88.8% have full or partial evidentiary support. These results suggest that explicit evidence and coverage constraints can improve factual support and completeness together within the studied setting.
Authors
- Jiayu Zhang (ORCID: https://orcid.org/0000-0002-7089-317X)
- Danfeng Zhang
- Tongtong Wang
- Yaokai Zu
Institutions
- University of Electronic Science and Technology of China (CN)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-27
- DOI
- https://doi.org/10.21203/rs.3.rs-11565916/v1
- Primary Topic
- Software Engineering Research
- Type
- preprint