diff options
| author | aur-build <aur-build@localhost> | 2026-11-18 16:13:30 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-18 16:13:30 +0000 |
| commit | f8370b48f3e4464a1454d0ff7af1819b5448c619 (patch) | |
| tree | b6180118a83fb38780472381243f95ef66429d31 /src/db/model.rs | |
| parent | e04152da00f97c5ecc9a3f6dc5217d61274c7907 (diff) | |
| download | aur-build-f8370b48f3e4464a1454d0ff7af1819b5448c619.tar.gz aur-build-f8370b48f3e4464a1454d0ff7af1819b5448c619.zip | |
db, watch: two upward edges removed, and the layering is now a test
M-6. `db::stage_b_cache_get` and `db::stage_b_recent` returned
`watch::upstream::StageB`, so the persistence layer could not be read without
the VCS watcher, and the table's row shape was defined by whatever the watcher
happened to find convenient. The row is `db::model::StageBCacheRow` now —
epoch, pkgver, pkgrel, pins — and `watch::upstream` converts at its own
boundary. The two types are deliberately not the same one: `StageB` carries
`cached`, and "was this answer a cache hit?" is a fact about the resolution
that just happened, not a column.
M-7. `review::risk` called `watch::digests::skip_on_non_vcs` while
`watch::detect` called into `review::candidates`, a cycle between two sibling
domains. Whether a recipe declines to verify its own sources is a question about
the recipe, so `skip_on_non_vcs` — with `SKIP`, `declared_sums` and
`is_hex_digest`, which it needed and which the watcher had no business owning —
moved to `recipe.rs`, a leaf both sides may look down at. `watch::digests` keeps
its use of them for digest resolution; the re-export is gone.
`tests/layers.rs` enforces the direction from now on: `src/db` names no module
above itself, `src/review` does not name `watch`, `src/watch` does not name
`pipeline` or `http`, and `recipe.rs` names nothing at all. Each rule failed
before this commit and each failure message prints the exact file and line of
the offending edge, so the next reasonable-looking commit cannot reintroduce
one quietly.
Diffstat (limited to 'src/db/model.rs')
| -rw-r--r-- | src/db/model.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/db/model.rs b/src/db/model.rs index e962d6f..dfc1f8b 100644 --- a/src/db/model.rs +++ b/src/db/model.rs @@ -21,6 +21,29 @@ pub struct UpstreamPin { pub commit: String, } +/// A row of the Stage B cache (§5.2): the version that resolution produced, +/// with the pins it was computed from. +/// +/// This lives with the schema because the table lives here — the persistence +/// layer must not name a type from the module that owns VCS probing, which is +/// the dependency pointing the wrong way (§6 M-6). `watch::upstream::StageB` +/// is this plus `cached`, and that extra field is the reason the two are not +/// the same type: "was this answer a cache hit?" is a fact about the resolution +/// that just happened, not a column. +#[derive(Debug, Clone)] +pub struct StageBCacheRow { + pub epoch: String, + pub pkgver: String, + pub pkgrel: String, + pub pins: Vec<UpstreamPin>, +} + +impl StageBCacheRow { + pub fn version(&self) -> String { + crate::pkgver::full_version(&self.epoch, &self.pkgver, &self.pkgrel) + } +} + /// A source entry with the digest *we* computed, regardless of what the /// PKGBUILD declares (§5.3). #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] |
