<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/tests/approve.rs, branch ai/main</title>
<subtitle>Unnamed repository
</subtitle>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/'/>
<entry>
<title>src,tests: say each thing once, in the code or not at all</title>
<updated>2026-11-22T10:44:04+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-22T10:44:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=1e1e12e7220a3fd288782ae40f0823db32acf6cb'/>
<id>1e1e12e7220a3fd288782ae40f0823db32acf6cb</id>
<content type='text'>
The repeated explanations go: sixteen copies of why a `pub` under
`test-support` has two declarations, six notes about where a test moved
from, forty-three banner comments naming the section they sit above.

The prose that stays is the prose the code cannot say — a hand-written
Debug that keeps a token out of a log line, a git pipe that would
deadlock if the write came first, an end-of-string check that has to
precede the separator skip. Enum docs in error.rs collapse to the line
that names what the type is; the argument for why it is shaped that way
is in the variants.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The repeated explanations go: sixteen copies of why a `pub` under
`test-support` has two declarations, six notes about where a test moved
from, forty-three banner comments naming the section they sit above.

The prose that stays is the prose the code cannot say — a hand-written
Debug that keeps a token out of a log line, a git pipe that would
deadlock if the write came first, an end-of-string check that has to
precede the separator skip. Enum docs in error.rs collapse to the line
that names what the type is; the argument for why it is shaped that way
is in the variants.
</pre>
</div>
</content>
</entry>
<entry>
<title>rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off</title>
<updated>2026-11-22T10:36:24+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-22T10:36:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=3dc71b2f5160ef9bd46143eed0edb5d2557b58e6'/>
<id>3dc71b2f5160ef9bd46143eed0edb5d2557b58e6</id>
<content type='text'>
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.

[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&amp;format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&amp;self` on a Copy state and no `self` nobody
reads.

ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.

[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&amp;format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&amp;self` on a Copy state and no `self` nobody
reads.

ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: record the census, and make the README describe the tree that exists</title>
<updated>2026-11-20T19:03:01+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T19:03:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=e6c3a02229994a9e007d8e6618add778e1ec021c'/>
<id>e6c3a02229994a9e007d8e6618add778e1ec021c</id>
<content type='text'>
The census report gets its after-table, and the README's Layout gets rewritten
— it had drifted into fiction, listing `db/queries.rs`'s successors as "queries"
and omitting `usecase`, `error`, `hash`, `time`, `urlutil`, `git`, `fetch` and
`recipe` entirely. It now states the ranks and says plainly that they are
enforced by `tests/architecture.rs`, not kept in hope, and names the two
commands that keep it true.

This commit also carries the last of the narrowing that fell out of writing the
report, because writing it meant actually reading the numbers:

- `watch::upstream::resolve` looked test-only and was not — the tests contain an
  unrelated local function of the same name, which the census matches as a word.
  It is crate-internal and now says so.
- `read_tree` closed with it. Its two integration tests were testing the module's
  own batching behaviour from outside, so they moved inside as unit tests with a
  throwaway git repo, which is where a test about one `ls-tree` and one
  `cat-file --batch` belongs. They lost nothing: the empty-blob and NUL-byte
  assertions came across verbatim, plus one the old test never made — binary
  blobs are still listed, just not read.
- `Assessment::is_high`, `Tree::get`, `approve::current_accepted` and
  `diff::full_recipe_text` were dead once their callers closed, and are gone.
- `set_risk_for_tests` is gone too. The bulk-refusal test needed a candidate
  marked high-risk, and the honest way to get one was for the fixture to write
  the row — `Env::execute` — rather than the library growing a public setter
  that exists only so a test can pass. That was the last budget above baseline
  apart from `error.pub`.

`error.pub` stays at 21 against a baseline of 15, and the report says why: the
six payload enums are constructed in four modules and matched in `error`, so
they are interface. `error.dead` is 0.

Final: 281 passed / 0 failed across 36 binaries (baseline 273), clippy
-D warnings clean, release clean, census within budget.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The census report gets its after-table, and the README's Layout gets rewritten
— it had drifted into fiction, listing `db/queries.rs`'s successors as "queries"
and omitting `usecase`, `error`, `hash`, `time`, `urlutil`, `git`, `fetch` and
`recipe` entirely. It now states the ranks and says plainly that they are
enforced by `tests/architecture.rs`, not kept in hope, and names the two
commands that keep it true.

This commit also carries the last of the narrowing that fell out of writing the
report, because writing it meant actually reading the numbers:

- `watch::upstream::resolve` looked test-only and was not — the tests contain an
  unrelated local function of the same name, which the census matches as a word.
  It is crate-internal and now says so.
- `read_tree` closed with it. Its two integration tests were testing the module's
  own batching behaviour from outside, so they moved inside as unit tests with a
  throwaway git repo, which is where a test about one `ls-tree` and one
  `cat-file --batch` belongs. They lost nothing: the empty-blob and NUL-byte
  assertions came across verbatim, plus one the old test never made — binary
  blobs are still listed, just not read.
- `Assessment::is_high`, `Tree::get`, `approve::current_accepted` and
  `diff::full_recipe_text` were dead once their callers closed, and are gone.
- `set_risk_for_tests` is gone too. The bulk-refusal test needed a candidate
  marked high-risk, and the honest way to get one was for the fixture to write
  the row — `Env::execute` — rather than the library growing a public setter
  that exists only so a test can pass. That was the last budget above baseline
  apart from `error.pub`.

`error.pub` stays at 21 against a baseline of 15, and the report says why: the
six payload enums are constructed in four modules and matched in `error`, so
they are interface. `error.dead` is 0.

Final: 281 passed / 0 failed across 36 binaries (baseline 273), clippy
-D warnings clean, release clean, census within budget.
</pre>
</div>
</content>
</entry>
<entry>
<title>review: one call to record a candidate, and one way to read one</title>
<updated>2026-11-20T17:41:34+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T17:41:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=1cd680c12dc191bfbf7afa8ad8308524776e60ae'/>
<id>1cd680c12dc191bfbf7afa8ad8308524776e60ae</id>
<content type='text'>
`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-&gt;202
is `accepted_release_for` arriving from review, and review.test 4-&gt;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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`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-&gt;202
is `accepted_release_for` arriving from review, and review.test 4-&gt;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.
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: drop the citations the deleted docs left behind</title>
<updated>2026-11-19T18:13:13+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T18:13:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=893763060ec01d356ade9f6c011519a7f47a92e9'/>
<id>893763060ec01d356ade9f6c011519a7f47a92e9</id>
<content type='text'>
The §n, I-n, M-n and m-n references survived in string literals the comment
strip never touched: migration SQL comments, assertion messages, runtime error
text, Cargo.toml, a CSS and template note, and one corpus manifest. They named
sections of files that no longer exist, so the prose stays and the citation
goes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The §n, I-n, M-n and m-n references survived in string literals the comment
strip never touched: migration SQL comments, assertion messages, runtime error
text, Cargo.toml, a CSS and template note, and one corpus manifest. They named
sections of files that no longer exist, so the prose stays and the citation
goes.
</pre>
</div>
</content>
</entry>
<entry>
<title>comments: keep only what the code cannot show</title>
<updated>2026-11-19T17:33:17+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T17:33:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=4304b0f336ddba7b4ec6780795059ff2066d105b'/>
<id>4304b0f336ddba7b4ec6780795059ff2066d105b</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>comments: say why, not what</title>
<updated>2026-11-19T17:09:59+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-19T17:09:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=e757979f1a2afdbe7146066345bb9acd19d3b151'/>
<id>e757979f1a2afdbe7146066345bb9acd19d3b151</id>
<content type='text'>
Every module-level `//!` header is gone, and the comments that remained
either re-explained the line below them or had grown into paragraphs.

Density went from one comment line per 6.7 lines of code to one per 10.
827 insertions against 2194 deletions across 86 files.

What survived: the invariants (I1-I12), the design cross-references into
DESIGN.md, and the notes recording a bug that was found and fixed — those
are the comments that carry weight, because they answer a question the
code cannot answer about itself. What did not: restating a function
signature in prose, and narration of the statement underneath.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every module-level `//!` header is gone, and the comments that remained
either re-explained the line below them or had grown into paragraphs.

Density went from one comment line per 6.7 lines of code to one per 10.
827 insertions against 2194 deletions across 86 files.

What survived: the invariants (I1-I12), the design cross-references into
DESIGN.md, and the notes recording a bug that was found and fixed — those
are the comments that carry weight, because they answer a question the
code cannot answer about itself. What did not: restating a function
signature in prose, and narration of the statement underneath.
</pre>
</div>
</content>
</entry>
<entry>
<title>review: one host rule, one body rule, one audit constructor</title>
<updated>2026-11-18T17:25:41+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T17:25:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=f3e4c1496d2ddcdae535132427fdb499181f1695'/>
<id>f3e4c1496d2ddcdae535132427fdb499181f1695</id>
<content type='text'>
m-2. `hosts` existed twice, verbatim, in `review::diff` and `review::risk`. The
duplication that matters is the other one: "did the executable part of the
recipe change" also existed twice, with *different* semantics. The risk scorer
compared everything from the first function definition onward; the diff panel
compared only the lines that name a function, so a `build()` rewritten to
`curl … | sh` under the same function names told the risk scorer "code changed,
high" and told the reviewer nothing at all — the one reader who could have
caught it. Both questions now have one answer: `urlutil::hosts` (which also
strips the `git@` from ssh URLs, so a scheme change stops crying "new source
host" wolf) and `recipe::bodies_changed`, in the module that owns the recipe.

m-4. The three review decisions each hand-built an `AuditEntry` literal, and
their `detail` shapes drifted: approve recorded the identity hash, reject
recorded only the note, withdraw only the reason — so for two of the three the
log cannot answer which candidate bytes the decision was about. `AuditEntry` is
built by `::human` / `::system` now, and reject records the identity hash it
rejected.

m-3, the four-times-copied 21-column candidate `SELECT`, was already gone: the
`CANDIDATE_COLS` constant came with moving the candidate SQL into `db/` in an
earlier commit.

Tests: the body rule is pinned at the unit level with the exact drift case
(same function names, different body), `tests/production_surface.rs` fails if
either module grows a private copy again or if an audit row is hand-built, and
the reject test reads its own audit row back and requires the identity in it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
m-2. `hosts` existed twice, verbatim, in `review::diff` and `review::risk`. The
duplication that matters is the other one: "did the executable part of the
recipe change" also existed twice, with *different* semantics. The risk scorer
compared everything from the first function definition onward; the diff panel
compared only the lines that name a function, so a `build()` rewritten to
`curl … | sh` under the same function names told the risk scorer "code changed,
high" and told the reviewer nothing at all — the one reader who could have
caught it. Both questions now have one answer: `urlutil::hosts` (which also
strips the `git@` from ssh URLs, so a scheme change stops crying "new source
host" wolf) and `recipe::bodies_changed`, in the module that owns the recipe.

m-4. The three review decisions each hand-built an `AuditEntry` literal, and
their `detail` shapes drifted: approve recorded the identity hash, reject
recorded only the note, withdraw only the reason — so for two of the three the
log cannot answer which candidate bytes the decision was about. `AuditEntry` is
built by `::human` / `::system` now, and reject records the identity hash it
rejected.

m-3, the four-times-copied 21-column candidate `SELECT`, was already gone: the
`CANDIDATE_COLS` constant came with moving the candidate SQL into `db/` in an
earlier commit.

Tests: the body rule is pinned at the unit level with the exact drift case
(same function names, different body), `tests/production_surface.rs` fails if
either module grows a private copy again or if an audit row is hand-built, and
the reject test reads its own audit row back and requires the identity in it.
</pre>
</div>
</content>
</entry>
<entry>
<title>db: the review, step, release and subscription states are enums too</title>
<updated>2026-11-18T16:49:40+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T16:49:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=41fa1684de8eb13c5b76c3a3e174fece04ac5afa'/>
<id>41fa1684de8eb13c5b76c3a3e174fece04ac5afa</id>
<content type='text'>
M-8 named four more machines after `build_state`, and each had the same defect
in miniature: `&amp;str` constants, a writer that took any `&amp;str`, and a rule that
lived only in the caller's discipline. They are `CandidateState`, `StepState`,
`ReleaseState` and `SubscriptionState` now, all parsed through one
`db::state_col` at the row boundary — a column value the code cannot name fails
the read rather than becoming a state it did not ask for.

The one that mattered is the review machine. `resolve_in(tx, id, &amp;str)` would
move a candidate to any state from any state, so an approval racing a
rejection, or a stale worker resolving a review that had already been
superseded, silently overwrote what a human had decided — the direct route to
breaking I2 and I3 with no symptom anywhere. It is a compare-and-swap on
`CandidateState` now: a decided review is only ever frozen, never re-decided,
and a refusal names both states. `supersede_in` goes through it, so the freeze
cannot resurrect a superseded review either.

`StepState` gives I5 teeth. `begin_step` upserted over any existing checkpoint,
including one recorded `succeeded`, so a resume that asked to re-run a finished
step could rewrite the very row that told it to skip; the upsert now refuses to
touch a done checkpoint and `finish_step` is a CAS. The blocked path
(`running → pending`) and the reaper's `running → interrupted` are unchanged,
and both are in the table.

Two behaviour changes, both for the better and both tested: the UI's pause
button now says "orphaned: nothing to pause" instead of rewriting an orphaned
subscription back to a pausable state, and a step checkpoint that is already
done makes `begin_step` an error rather than a quiet overwrite.

Five tests in `tests/state_machine.rs` cover the review CAS in both directions,
the frozen checkpoint, the interrupted/blocked transitions, and the unknown
value in a candidate and a step row.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
M-8 named four more machines after `build_state`, and each had the same defect
in miniature: `&amp;str` constants, a writer that took any `&amp;str`, and a rule that
lived only in the caller's discipline. They are `CandidateState`, `StepState`,
`ReleaseState` and `SubscriptionState` now, all parsed through one
`db::state_col` at the row boundary — a column value the code cannot name fails
the read rather than becoming a state it did not ask for.

The one that mattered is the review machine. `resolve_in(tx, id, &amp;str)` would
move a candidate to any state from any state, so an approval racing a
rejection, or a stale worker resolving a review that had already been
superseded, silently overwrote what a human had decided — the direct route to
breaking I2 and I3 with no symptom anywhere. It is a compare-and-swap on
`CandidateState` now: a decided review is only ever frozen, never re-decided,
and a refusal names both states. `supersede_in` goes through it, so the freeze
cannot resurrect a superseded review either.

`StepState` gives I5 teeth. `begin_step` upserted over any existing checkpoint,
including one recorded `succeeded`, so a resume that asked to re-run a finished
step could rewrite the very row that told it to skip; the upsert now refuses to
touch a done checkpoint and `finish_step` is a CAS. The blocked path
(`running → pending`) and the reaper's `running → interrupted` are unchanged,
and both are in the table.

Two behaviour changes, both for the better and both tested: the UI's pause
button now says "orphaned: nothing to pause" instead of rewriting an orphaned
subscription back to a pausable state, and a step checkpoint that is already
done makes `begin_step` an error rather than a quiet overwrite.

Five tests in `tests/state_machine.rs` cover the review CAS in both directions,
the frozen checkpoint, the interrupted/blocked transitions, and the unknown
value in a candidate and a step row.
</pre>
</div>
</content>
</entry>
<entry>
<title>review: a database failure is never reported to a reviewer as a stale review</title>
<updated>2026-11-18T15:48:02+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T15:48:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=062efa6583b7fea292a4f485659661d266461611'/>
<id>062efa6583b7fea292a4f485659661d266461611</id>
<content type='text'>
`approve()` returned `Result&lt;Approval, Stale&gt;` and then collapsed every inner
failure into `Stale::NotPending { state: e.to_string() }`, so a SQLite error
reached the human as "review is no longer pending (state: sqlite: …)". That is
the one message that tells a reviewer to look again when the truth is that the
write failed — and the transaction had already rolled back, so their review was
still pending and nothing on screen explained why. `bulk()` bent the same
variant to mean "high risk", "unknown decision" and "the database failed", and
handed back a fabricated `Approval { id: 0 }` for a rejection that recorded no
approval at all.

`approve()` now returns `Result&lt;Approval, ApproveError&gt;` with two families:
`Stale(Stale)` — what is stored is not what was displayed, look again — and
`System(Error)` — the write failed, nothing about the review is at fault. The
UI answers the first with the 409 and fresh diff it already gave, and the
second with a 500 that names the cause; the CLI exits 2 for the first and
propagates the second as an error.

`bulk()` got its own vocabulary — `BulkOutcome::{Approved, Rejected,
Refused(BulkRefusal)}` with `HighRiskUnconfirmed`, `UnknownDecision`,
`NotFound`, `Stale` and `System` — and returns no approval row for a rejection,
because there is none. The invented `id: 0` is gone. The web handler had its own
copy of the bulk loop; it now calls `approve::bulk`, so the page and the
library cannot disagree about what §7.4 says.

Three tests: a dropped `audit` table mid-transaction must surface as `System`
and must leave the review pending and the approval table empty; bulk refusals
must name the risk, the unknown decision, and (after a real approval) the
genuine staleness as three different things; a bulk rejection must record a
`rejected` row and hand back nothing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`approve()` returned `Result&lt;Approval, Stale&gt;` and then collapsed every inner
failure into `Stale::NotPending { state: e.to_string() }`, so a SQLite error
reached the human as "review is no longer pending (state: sqlite: …)". That is
the one message that tells a reviewer to look again when the truth is that the
write failed — and the transaction had already rolled back, so their review was
still pending and nothing on screen explained why. `bulk()` bent the same
variant to mean "high risk", "unknown decision" and "the database failed", and
handed back a fabricated `Approval { id: 0 }` for a rejection that recorded no
approval at all.

`approve()` now returns `Result&lt;Approval, ApproveError&gt;` with two families:
`Stale(Stale)` — what is stored is not what was displayed, look again — and
`System(Error)` — the write failed, nothing about the review is at fault. The
UI answers the first with the 409 and fresh diff it already gave, and the
second with a 500 that names the cause; the CLI exits 2 for the first and
propagates the second as an error.

`bulk()` got its own vocabulary — `BulkOutcome::{Approved, Rejected,
Refused(BulkRefusal)}` with `HighRiskUnconfirmed`, `UnknownDecision`,
`NotFound`, `Stale` and `System` — and returns no approval row for a rejection,
because there is none. The invented `id: 0` is gone. The web handler had its own
copy of the bulk loop; it now calls `approve::bulk`, so the page and the
library cannot disagree about what §7.4 says.

Three tests: a dropped `audit` table mid-transaction must surface as `System`
and must leave the review pending and the approval table empty; bulk refusals
must name the risk, the unknown decision, and (after a real approval) the
genuine staleness as three different things; a bulk rejection must record a
`rejected` row and hand back nothing.
</pre>
</div>
</content>
</entry>
</feed>
