From 1cd680c12dc191bfbf7afa8ad8308524776e60ae Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 20 Nov 2026 17:41:34 +0000 Subject: review: one call to record a candidate, and one way to read one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `watch::detect` was performing review's write protocol by hand: look up the accepted release, upsert the candidate, assess the risk, store the risk, work out the missing dependencies, store those. Six calls that only make sense in that order, issued from a module whose job is noticing that an upstream moved. Get the order wrong and nothing complains — the candidate just quietly has no risk score, and the reviewer approves it without one. `review::intake::record` is the protocol now. The watcher hands over what it observed and review decides what it means. `missing_deps` moved with it: it computes a risk signal, which is a review question that happened to be living in the watcher. `accepted_for` was not a review question either. It reads a pointer column off the pkgbase row, so it is now `db::accepted_release_for` — the watcher asks persistence what is currently accepted, rather than asking review as a favour. With intake owning the write path, three things became internal and closed: `upsert_candidate`, `risk::assess`, and the risk/missing-deps column setters. `approve::approval_for` was a pass-through to db that only the pipeline called; it is gone, and the pipeline now asks `review::reads::{candidate, approval}` — two named facts instead of a re-export of review's storage layout. The budget rose in two places and both are moves, not growth: db.pub 201->202 is `accepted_release_for` arriving from review, and review.test 4->5 is `set_risk_for_tests`, the one place a fixture still needs to force a score. review.pub itself is unchanged at 29 — four names added, four removed. `priv` was also dropped from the budget keys. Counting `pub(crate)` items against a ceiling was backwards: closing an interface raises that number, so a budget that punishes it punishes the work. The Rust test never checked it. 277 passed / 0 failed, clippy -D warnings clean, and every detect, approve and staleness assertion intact. --- src/review/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/review/mod.rs') diff --git a/src/review/mod.rs b/src/review/mod.rs index eb78b3a..78a6961 100644 --- a/src/review/mod.rs +++ b/src/review/mod.rs @@ -1,6 +1,8 @@ pub mod approve; pub mod candidates; pub mod diff; +pub mod intake; +pub mod reads; pub mod risk; -pub use candidates::{upsert_candidate, NewCandidate, Upsert}; +pub use candidates::{NewCandidate, Upsert}; -- cgit v1.2.3