From f586d11f6a1711145ba4804787217a1bab58751d Mon Sep 17 00:00:00 2001 From: aur-build Date: Tue, 17 Nov 2026 21:19:35 +0000 Subject: feat: AUR mirror watcher, recipe parsing, candidate creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The detection path (§5.1, §5.1a, §5.3, §7.1): * git helpers, all subprocess git in one auditable place. Mirrors are cloned with --mirror and polled with git ls-remote, fetching only when the tip actually moved; --no-prune keeps history we may need forever. * .SRCINFO parsing (authoritative) with a PKGBUILD fallback, and source=() parsing that keeps VCS kind, #commit/#tag/#branch refs and the filename:: form. * recipe_hash over the whole snapshot tree, so a shipped patch is part of the recipe and cannot change silently. * source digest resolution: declared checksums are trusted-as-declared (makepkg enforces them, no bandwidth), local files are hashed from the mirror, and SKIP sources are downloaded and stream-hashed into the content-addressed source cache. Detection always re-fetches SKIP sources — answering from our own cache would defeat drift detection. * candidate creation with base = current_accepted_release, collapse in place while unviewed, supersede only once a human has looked, and a previously rejected identity is not re-raised. * non-publishable change handling (I11): unchanged version string means no review, but never silence — recipe drift and pin drift become notices, and a changed digest on a remote source with an unchanged version becomes a high-severity integrity_alert. Also vercmp + dep-string parsing with the ALPM test vectors, and the approval record with optimistic concurrency (§7.1a) that the CLI and web layers will both call. 16 detection tests against real file:// git fixtures, incl. I2 across three unattended detections and I11 for all three drift kinds. Part of P0 (DESIGN.md §17). --- src/db/mod.rs | 6 +++--- src/db/model.rs | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/db') diff --git a/src/db/mod.rs b/src/db/mod.rs index c11bf5a..a841fec 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -8,9 +8,9 @@ //! design entirely. Readers are thread-local, read-only connections; WAL lets //! them proceed concurrently with the writer. -mod migrations; -mod model; -mod queries; +pub mod migrations; +pub mod model; +pub mod queries; pub use migrations::MIGRATIONS; pub use model::*; diff --git a/src/db/model.rs b/src/db/model.rs index 599fc21..66674ab 100644 --- a/src/db/model.rs +++ b/src/db/model.rs @@ -197,6 +197,9 @@ pub struct Recipe { pub srcinfo: Option, /// True if `--skippgpcheck` appears in the PKGBUILD. pub skipgpcheck: bool, + /// Parsed `source=()` entries. Derived from `source`, so not serialized. + #[serde(skip, default)] + pub source_entries: Vec, } impl Recipe { -- cgit v1.2.3