<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/src/watch/staleness.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: retire the census commentary from the source</title>
<updated>2026-11-22T10:51:45+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-22T10:51:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=053dfbca8a4955a616e9b2c0f5a5d664c0db7aef'/>
<id>053dfbca8a4955a616e9b2c0f5a5d664c0db7aef</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</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>src: close the items the stricter detector surfaced</title>
<updated>2026-11-21T09:38:21+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T09:38:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=ae492c87ff66b9f2c8fec25a5ca917c438bf5858'/>
<id>ae492c87ff66b9f2c8fec25a5ca917c438bf5858</id>
<content type='text'>
The auditor's two counterexamples were real, and fixing the detector exposed
seventeen more items it had never listed. Each was checked individually rather
than dispositioned in bulk, and the check changed what the right answer was:

- `review::approve::withdraw` — gated. The CLI and the web UI both go through
  `usecase::withdraw_package`; nothing invokes this. tests/pipeline.rs pins its
  invariants, so it is gated rather than deleted: the test is the cover for an
  operation production has not grown yet.
- `pipeline::dispatch::Pool::shutdown` — gated. Production runs the pool until
  the process exits; a test needs the join to assert on effects after the
  threads stop. Its two fields now carry a matching `cfg_attr(allow(dead_code))`
  because in a release build they are stored and never read.
- `shims::{mkarchroot,makechrootpkg,makepkg,gpg,pacman,record}` — plain
  `pub(crate)`. `run` dispatches to them by tool name; no module outside `shims`
  names them and no test calls them. The tool names appear in test *strings*,
  which is not a caller.
- `db::Writer::start`, `fetch::open`, `http::Req::form`, `http::Page::new`,
  `http::Panel::new`, `http::render::BuildRow` — plain `pub(crate)`, same
  reason: used only from inside their own module.
- `db::AuditEntry::system` — deleted. `audit_system` builds the row through the
  free `audit()`; nothing ever called the constructor, production or otherwise.
- `pkgver::Version::display` — deleted, a wrapper around `to_string` with no
  callers.
- `http::Server`, `watch::Stale`, `pkgver::Version` — private inner module with a
  gated alias. `Server` is what `spawn` hands back and `main` holds without
  naming; `Stale` is what `stale_rows` returns to `http` and `ops`; `Version` is
  what `parse` returns. All three must stay nameable to those callers in shape
  but not in name, which is exactly what the inner-module alias gives.

Measured on the release build's public surface: 466 reachable public names at the
start of this goal, 402 now, newly-public set empty.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The auditor's two counterexamples were real, and fixing the detector exposed
seventeen more items it had never listed. Each was checked individually rather
than dispositioned in bulk, and the check changed what the right answer was:

- `review::approve::withdraw` — gated. The CLI and the web UI both go through
  `usecase::withdraw_package`; nothing invokes this. tests/pipeline.rs pins its
  invariants, so it is gated rather than deleted: the test is the cover for an
  operation production has not grown yet.
- `pipeline::dispatch::Pool::shutdown` — gated. Production runs the pool until
  the process exits; a test needs the join to assert on effects after the
  threads stop. Its two fields now carry a matching `cfg_attr(allow(dead_code))`
  because in a release build they are stored and never read.
- `shims::{mkarchroot,makechrootpkg,makepkg,gpg,pacman,record}` — plain
  `pub(crate)`. `run` dispatches to them by tool name; no module outside `shims`
  names them and no test calls them. The tool names appear in test *strings*,
  which is not a caller.
- `db::Writer::start`, `fetch::open`, `http::Req::form`, `http::Page::new`,
  `http::Panel::new`, `http::render::BuildRow` — plain `pub(crate)`, same
  reason: used only from inside their own module.
- `db::AuditEntry::system` — deleted. `audit_system` builds the row through the
  free `audit()`; nothing ever called the constructor, production or otherwise.
- `pkgver::Version::display` — deleted, a wrapper around `to_string` with no
  callers.
- `http::Server`, `watch::Stale`, `pkgver::Version` — private inner module with a
  gated alias. `Server` is what `spawn` hands back and `main` holds without
  naming; `Stale` is what `stale_rows` returns to `http` and `ops`; `Version` is
  what `parse` returns. All three must stay nameable to those callers in shape
  but not in name, which is exactly what the inner-module alias gives.

Measured on the release build's public surface: 466 reachable public names at the
start of this goal, 402 now, newly-public set empty.
</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>db, watch: two N+1s and a version rule with one owner</title>
<updated>2026-11-18T18:28:16+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T18:28:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=fdd004c50de6131be193044ae40424d691425a81'/>
<id>fdd004c50de6131be193044ae40424d691425a81</id>
<content type='text'>
m-17. `watch::staleness::dependents_of` walked the index and asked for each
package's recipe by name — one query per package, on the path that runs after
every publish, with N equal to the size of the index. `db::index_recipes` returns
the whole table in one query now. While there: a recipe that fails to parse is no
longer treated as "does not depend on this package". An unreadable srcinfo used
to hide a dependent from staleness by returning `None` into an `unwrap_or(false)`;
now it is a reason to look.

`db::builds::requeue_blocked` asked "is this name in the index?" once per
dependency of every blocked build, inside the dispatcher's hot loop. The set of
in-index names is read once per pass and tested in memory. Same answer, one
query.

m-18. `approved_but_unbuilt` assembled the version a human reads with two
`CASE WHEN epoch='0'` expressions in SQL — a second, independent copy of the
`epoch:pkgver-pkgrel` rule that `pkgver::full_version` owns. Two copies of a
formatting rule is how the Attention page ends up describing versions
differently from every other page. The query returns the parts; Rust formats
them. A guard test fails if version-string concatenation reappears in SQL.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
m-17. `watch::staleness::dependents_of` walked the index and asked for each
package's recipe by name — one query per package, on the path that runs after
every publish, with N equal to the size of the index. `db::index_recipes` returns
the whole table in one query now. While there: a recipe that fails to parse is no
longer treated as "does not depend on this package". An unreadable srcinfo used
to hide a dependent from staleness by returning `None` into an `unwrap_or(false)`;
now it is a reason to look.

`db::builds::requeue_blocked` asked "is this name in the index?" once per
dependency of every blocked build, inside the dispatcher's hot loop. The set of
in-index names is read once per pass and tested in memory. Same answer, one
query.

m-18. `approved_but_unbuilt` assembled the version a human reads with two
`CASE WHEN epoch='0'` expressions in SQL — a second, independent copy of the
`epoch:pkgver-pkgrel` rule that `pkgver::full_version` owns. Two copies of a
formatting rule is how the Attention page ends up describing versions
differently from every other page. The query returns the parts; Rust formats
them. A guard test fails if version-string concatenation reappears in SQL.
</pre>
</div>
</content>
</entry>
<entry>
<title>db: the schema gets an owner — every statement moves into db/, and the writer stops handing out connections</title>
<updated>2026-11-18T15:20:13+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T15:20:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=933c637de34095f1ea1ab88b02626bbf22eec7f4'/>
<id>933c637de34095f1ea1ab88b02626bbf22eec7f4</id>
<content type='text'>
Twelve modules outside `db/` contained hand-rolled SQL — 22 statements in
`ops.rs`, 17 in `approve.rs`, 15 in `candidates.rs`, 11 in `publish.rs`, and a
dozen more scattered through `watch`, `pipeline`, `http` — which meant the
blast radius of a schema change was "any module", and `db/` was a directory
rather than a boundary. The audit trail alone was defined in four places with
three different detail payloads.

Every statement now lives in `db/`. New modules `db::candidates` and
`db::approvals` own their tables (including the 21-column candidate select,
spelled once as `CANDIDATE_COLS` instead of four times); `db::queries` gains
the metrics reads, the retention reads and writes, the publish writes
(`insert_release_in`, `cas_accepted_release_in`, `remove_index_packages_in`),
the staleness reads and the source-cache lookups; `db::builds` gains
`set_release_in`. Where a mutation is a *decision* — the collapse rules, the
approval gate, the publish compare-and-swap — the decision stays where it was
and the statements are called through the transaction handle, so the atomicity
is unchanged and only the SQL moved.

`audit_in` is the in-transaction audit append, and `audit` is now a wrapper
over it: a decision and its audit row commit together or not at all, which is
what I10 actually claims.

Enforcement is two-layered, because one layer is a lie. `Writer::call`, `tx`
and `send` are `pub(crate)`, which keeps the crate's *users* out — the
integration tests and the shim binaries — but `pub(crate)` is crate-wide, so
on its own it would not stop `approve.rs` from writing SQL tomorrow. The layer
that does is `tests/schema_ownership.rs`: it walks `src/` and fails the build
if a statement literal or a rusqlite statement call appears outside `src/db/`.
It was checked against a deliberate violation. The test harness still needs to
construct states no typed API reaches, so the raw door exists but only under
the `test-support` feature, which nothing but this crate's own dev-dependency
enables; a production binary cannot see it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Twelve modules outside `db/` contained hand-rolled SQL — 22 statements in
`ops.rs`, 17 in `approve.rs`, 15 in `candidates.rs`, 11 in `publish.rs`, and a
dozen more scattered through `watch`, `pipeline`, `http` — which meant the
blast radius of a schema change was "any module", and `db/` was a directory
rather than a boundary. The audit trail alone was defined in four places with
three different detail payloads.

Every statement now lives in `db/`. New modules `db::candidates` and
`db::approvals` own their tables (including the 21-column candidate select,
spelled once as `CANDIDATE_COLS` instead of four times); `db::queries` gains
the metrics reads, the retention reads and writes, the publish writes
(`insert_release_in`, `cas_accepted_release_in`, `remove_index_packages_in`),
the staleness reads and the source-cache lookups; `db::builds` gains
`set_release_in`. Where a mutation is a *decision* — the collapse rules, the
approval gate, the publish compare-and-swap — the decision stays where it was
and the statements are called through the transaction handle, so the atomicity
is unchanged and only the SQL moved.

`audit_in` is the in-transaction audit append, and `audit` is now a wrapper
over it: a decision and its audit row commit together or not at all, which is
what I10 actually claims.

Enforcement is two-layered, because one layer is a lie. `Writer::call`, `tx`
and `send` are `pub(crate)`, which keeps the crate's *users* out — the
integration tests and the shim binaries — but `pub(crate)` is crate-wide, so
on its own it would not stop `approve.rs` from writing SQL tomorrow. The layer
that does is `tests/schema_ownership.rs`: it walks `src/` and fails the build
if a statement literal or a rusqlite statement call appears outside `src/db/`.
It was checked against a deliberate violation. The test harness still needs to
construct states no typed API reaches, so the raw door exists but only under
the `test-support` feature, which nothing but this crate's own dev-dependency
enables; a production binary cannot see it.
</pre>
</div>
</content>
</entry>
<entry>
<title>http: surfaces driven by live state — staleness, downgrades, deps, rebuild (I6)</title>
<updated>2026-11-18T08:23:14+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T08:23:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=eefbefed9cbea6b2edef65900fbe6cb6da0b48e4'/>
<id>eefbefed9cbea6b2edef65900fbe6cb6da0b48e4</id>
<content type='text'>
Attention, the package page and the builds page now answer real questions
instead of rendering empty tables:

- Attention lists outdated dependencies derived from the recorded world
  snapshots, naming the dependency that moved, what the artifact was built
  against and what the index holds now; also missing dependencies and
  downgrades (AUR offering a lower version than we serve), which is an
  announcement for a human, not a build request.
- The package page shows depends-on from the recipe we actually serve and
  needed-by from the packages whose recipes name it, plus staleness and the
  aur_commit timeline, each release linking into cgit at that exact commit.
- Builds rows carry the version they are about, in both the live and the
  recently-finished table.
- A manual rebuild reuses the approved source identity and mints no approval
  (I6); the test asserts the approval count is unchanged before and after the
  rebuild runs.
- A paused subscription is not observed at all: detection returns Paused
  without polling, so pausing a broken package stops it opening reviews.
- Staleness stays computed on read (§10.2). Nothing stores a stale flag, so
  nothing can serve a stale lie.

Also: dep-client fixture added for dependency pairs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Attention, the package page and the builds page now answer real questions
instead of rendering empty tables:

- Attention lists outdated dependencies derived from the recorded world
  snapshots, naming the dependency that moved, what the artifact was built
  against and what the index holds now; also missing dependencies and
  downgrades (AUR offering a lower version than we serve), which is an
  announcement for a human, not a build request.
- The package page shows depends-on from the recipe we actually serve and
  needed-by from the packages whose recipes name it, plus staleness and the
  aur_commit timeline, each release linking into cgit at that exact commit.
- Builds rows carry the version they are about, in both the live and the
  recently-finished table.
- A manual rebuild reuses the approved source identity and mints no approval
  (I6); the test asserts the approval count is unchanged before and after the
  rebuild runs.
- A paused subscription is not observed at all: detection returns Paused
  without polling, so pausing a broken package stops it opening reviews.
- Staleness stays computed on read (§10.2). Nothing stores a stale flag, so
  nothing can serve a stale lie.

Also: dep-client fixture added for dependency pairs.
</pre>
</div>
</content>
</entry>
<entry>
<title>http: the review surface — server-rendered, no JavaScript required (§12, §13)</title>
<updated>2026-11-18T08:06:39+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-18T08:06:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=a6b652985f40cf022d6c522415c36fad13bc663d'/>
<id>a6b652985f40cf022d6c522415c36fad13bc663d</id>
<content type='text'>
tiny_http, thread-per-connection, askama templates. Every §13 surface is
server-rendered HTML that works with scripts switched off: Inbox, review
detail with the full panel set, Builds, Attention, Index, Subscriptions,
Ops/audit, Settings.

The parts that are easy to get wrong:

- Handlers read through thread-local READ-ONLY connections. They cannot
  take the write lock even by accident, so a slow page render never blocks
  the build pipeline's writer. tests/http.rs asserts this by trying to
  write through a read connection and requiring failure.
- Every POST requires a CSRF token derived from the session id. Logout
  drops the session, which invalidates every form still open in a browser.
- Approve carries identity_hash AND diff_digest (§7.1a). If either has
  moved, the approval is refused with 409 and the page re-renders the
  review AS IT IS NOW — never a silent retarget onto the newer state.
- Bulk approve refuses high-risk items unless each one is individually
  confirmed by id. Bulk is per-item, never 'approve everything forever'.
- Reject requires a note; it is re-openable, not a deletion.
- Optional password gate; anonymous visitors are redirected to /login.

Also: the index page states the pacman conf snippet including
'SigLevel = Required DatabaseOptional', because a repo consumers ignore the
signature is a repo that gets MITM'd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tiny_http, thread-per-connection, askama templates. Every §13 surface is
server-rendered HTML that works with scripts switched off: Inbox, review
detail with the full panel set, Builds, Attention, Index, Subscriptions,
Ops/audit, Settings.

The parts that are easy to get wrong:

- Handlers read through thread-local READ-ONLY connections. They cannot
  take the write lock even by accident, so a slow page render never blocks
  the build pipeline's writer. tests/http.rs asserts this by trying to
  write through a read connection and requiring failure.
- Every POST requires a CSRF token derived from the session id. Logout
  drops the session, which invalidates every form still open in a browser.
- Approve carries identity_hash AND diff_digest (§7.1a). If either has
  moved, the approval is refused with 409 and the page re-renders the
  review AS IT IS NOW — never a silent retarget onto the newer state.
- Bulk approve refuses high-risk items unless each one is individually
  confirmed by id. Bulk is per-item, never 'approve everything forever'.
- Reject requires a note; it is re-openable, not a deletion.
- Optional password gate; anonymous visitors are redirected to /login.

Also: the index page states the pacman conf snippet including
'SigLevel = Required DatabaseOptional', because a repo consumers ignore the
signature is a repo that gets MITM'd.
</pre>
</div>
</content>
</entry>
</feed>
