summaryrefslogtreecommitdiffstats
path: root/src/watch/sources.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-22 10:51:45 +0000
committeraur-build <aur-build@localhost>2026-11-22 10:51:45 +0000
commit053dfbca8a4955a616e9b2c0f5a5d664c0db7aef (patch)
tree969777fa32845f49723c52b1889c4870c98134cf /src/watch/sources.rs
parent1e1e12e7220a3fd288782ae40f0823db32acf6cb (diff)
downloadaur-build-053dfbca8a4955a616e9b2c0f5a5d664c0db7aef.tar.gz
aur-build-053dfbca8a4955a616e9b2c0f5a5d664c0db7aef.zip
src,tests: retire the census commentary from the source
A gated item used to carry its own defence: why it is `pub` only under `test-support`, which census once mistook a filename for a caller, why a wrapper is compiled out rather than deleted. The budget file already holds those claims and the ratchet already checks them, so the source keeps the one line that says what the item is. The module headers stop narrating the refactor that produced them. What survives is the wire protocol, the git pipe, the poisoned lock that must be recovered rather than unwedged.
Diffstat (limited to 'src/watch/sources.rs')
-rw-r--r--src/watch/sources.rs21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/watch/sources.rs b/src/watch/sources.rs
index 9767cef..a437a2b 100644
--- a/src/watch/sources.rs
+++ b/src/watch/sources.rs
@@ -1,15 +1,5 @@
-//! The source interface the build pipeline asks watch for.
-//!
-//! The step machine used to reach into two of watch's internals and reassemble
-//! the rules itself: `mirror::read_tree` plus `Tree::recipe_hash` to re-derive
-//! the hash a reviewer approved, and `digests::cached_path` plus
-//! `digests::download_and_cache` plus its own comparison to check a payload.
-//! That put the fail-closed test — the one thing that must never be skipped —
-//! in whichever step happened to want a file, and left the pipeline knowing how
-//! watch caches.
-//!
-//! Two calls cover what it actually needs: what a tree hashes to, and a
-//! guarantee that a cached source is the bytes its name claims.
+//! The source interface the build pipeline asks watch for: what a tree hashes
+//! to, and a guarantee that a cached source is the bytes its name claims.
use std::path::Path;
@@ -25,11 +15,8 @@ pub fn recipe_hash(mirror: &Path, commit: &str) -> Result<String> {
Ok(read_tree(mirror, commit)?.recipe_hash())
}
-/// Ensure `url` is cached and that what is cached hashes to `digest`.
-///
-/// Fails closed on a mismatch rather than handing back bytes that are not what
-/// was approved: a source that quietly changed is exactly the case the whole
-/// approval chain exists to catch.
+/// Ensure `url` is cached and that what is cached hashes to `digest`, failing
+/// closed on a mismatch.
pub fn verify_cached(cfg: &Config, db: &Db, url: &str, digest: &str) -> Result<()> {
let found = match cached_path(db, url, digest) {
Some(p) => crate::hash::digest_file(&p)?.0,