From e757979f1a2afdbe7146066345bb9acd19d3b151 Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:09:59 +0000 Subject: comments: say why, not what MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath. --- src/watch/staleness.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/watch/staleness.rs') diff --git a/src/watch/staleness.rs b/src/watch/staleness.rs index e052b26..2631769 100644 --- a/src/watch/staleness.rs +++ b/src/watch/staleness.rs @@ -1,14 +1,3 @@ -//! Staleness (§10.2): "would rebuilding this change what a consumer gets?" -//! -//! Computed **on read**, never stored. A stored staleness flag goes wrong the -//! moment anything else is published, and there is always something else being -//! published; deriving it from the world snapshots and the current index means -//! it can never lie. -//! -//! The pair comes from §10.1: each build recorded the versions of *our* -//! packages it was built against. If any of those differ from what the index -//! holds now, the artifact was built against a world that no longer exists. - use crate::db::{self, Db}; use crate::error::Result; @@ -73,12 +62,10 @@ pub fn stale_for(db: &Db, pkgbase: &str) -> Result> { Ok(stale_rows(db)?.into_iter().filter(|s| s.pkgbase == pkgbase).collect()) } -/// AUR now offers a **lower** version than we serve (§10.2). This is not a -/// build request; it is an announcement that the mirror and the upstream have -/// disagreed, and someone has to decide which one consumers follow. +/// AUR now offers a **lower** version than we serve (§10.2). This is not a build +/// request; it is an announcement that the mirror and upstream have disagreed. /// -/// Derived on read from the newest candidate per pkgbase against the accepted -/// release, so it disappears the moment either side moves. +/// Derived on read, so it disappears the moment either side moves. pub fn downgrades(db: &Db) -> Result> { let rows = db::served_vs_offered_pkgvers(db)?; let mut out = Vec::new(); -- cgit v1.2.3