From 4304b0f336ddba7b4ec6780795059ff2066d105b Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:33:17 +0000 Subject: comments: keep only what the code cannot show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound. --- src/watch/staleness.rs | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/watch/staleness.rs') diff --git a/src/watch/staleness.rs b/src/watch/staleness.rs index 2631769..4e171a1 100644 --- a/src/watch/staleness.rs +++ b/src/watch/staleness.rs @@ -3,26 +3,19 @@ use crate::error::Result; #[derive(Debug, Clone, PartialEq, Eq)] pub enum Kind { - /// A dependency we publish has moved on. Outdated, - /// A dependency we publish has disappeared from the index. Missing, } #[derive(Debug, Clone)] pub struct Stale { pub kind: Kind, - /// The pkgbase that would need rebuilding. pub pkgbase: String, - /// The dependency, or the pkgbase itself for `Missing`. pub dependency: String, - /// Version it was built against. pub built_with: String, - /// Version the index serves now (empty when missing). pub now: String, } -/// Every stale package, derived from world snapshots against the live index. pub fn stale_rows(db: &Db) -> Result> { let rows = db::published_world_members(db)?; @@ -30,7 +23,6 @@ pub fn stale_rows(db: &Db) -> Result> { for (pkgbase, members_json) in rows { let members: Vec = serde_json::from_str(&members_json).unwrap_or_default(); for m in members { - // A package is not stale relative to itself. if m.pkgbase == pkgbase { continue; } @@ -57,15 +49,10 @@ pub fn stale_rows(db: &Db) -> Result> { Ok(out) } -/// Staleness for one pkgbase, rendered for the package page. 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 upstream have disagreed. -/// -/// 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(); @@ -84,18 +71,12 @@ pub fn downgrades(db: &Db) -> Result> { Ok(out) } -/// "If I approve this, what goes stale?" — the dependents question (§10.3). -/// A package depends on `name` if `name` appears in its recorded world or in -/// its recipe dependencies. pub fn dependents_of(db: &Db, name: &str) -> Result> { let mut out: Vec = Vec::new(); for (pkgname, json) in db::index_recipes(db)? { if pkgname == name { continue; } - // A recipe we cannot read is not a recipe that does not depend on - // `name`: treat the unreadable as a reason to look, so a malformed - // srcinfo cannot silently hide a dependent package from staleness. let depends = match serde_json::from_str::(&json) { Ok(r) => crate::pkgver::dep_names(&r.depends) .into_iter() -- cgit v1.2.3