<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/src/db/pkgbases.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>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>src: delete the fields nothing reads, and the two knobs nothing obeys</title>
<updated>2026-11-21T13:43:30+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T13:43:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=7afffd1a0ca798dd5826c2e1881b09fe135dbcbd'/>
<id>7afffd1a0ca798dd5826c2e1881b09fe135dbcbd</id>
<content type='text'>
The census only sees `pub` items, so the constructs below it stayed invisible
until narrowing made the compiler look: rustc reported `ReviewSubject::pkgbase`,
`StageB::cached` and `StageB::version` as dead the moment their structs stopped
being exported, and the same question asked of every struct field, enum variant
and SQL literal in the crate found six more.

`BuildRow::lease_owner` and `BuildRow::priority` were selected out of the
database into a row nobody read; the *columns* are live — the dispatcher leases
through one and orders by the other — so the SELECT list and the row mapper lost
them and the schema did not. `Pkgbase::unpinable` and `SnapshotRow::files_json`
are the same shape, and `Config::git_bin` and `Config::build_user` are worse:
they are knobs an operator can set, defaulted, serialized, and consulted by
nothing. A setting that changes nothing is not an unimplemented feature, it is a
lie in a config file, so both are gone; `a_config_init_wrote_before_the_enum_
still_loads` now proves a config that still names them loads anyway.

Two axes came back empty, and both were checked rather than assumed: every string
literal containing SQL is passed to a call, and the two `Error` variants that
name matches never mention — `Json` and `Sqlite` — are constructed by `?` in
about a hundred places, which is why they were left alone. Every template and
every static asset is reachable from a route or an `extends`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The census only sees `pub` items, so the constructs below it stayed invisible
until narrowing made the compiler look: rustc reported `ReviewSubject::pkgbase`,
`StageB::cached` and `StageB::version` as dead the moment their structs stopped
being exported, and the same question asked of every struct field, enum variant
and SQL literal in the crate found six more.

`BuildRow::lease_owner` and `BuildRow::priority` were selected out of the
database into a row nobody read; the *columns* are live — the dispatcher leases
through one and orders by the other — so the SELECT list and the row mapper lost
them and the schema did not. `Pkgbase::unpinable` and `SnapshotRow::files_json`
are the same shape, and `Config::git_bin` and `Config::build_user` are worse:
they are knobs an operator can set, defaulted, serialized, and consulted by
nothing. A setting that changes nothing is not an unimplemented feature, it is a
lie in a config file, so both are gone; `a_config_init_wrote_before_the_enum_
still_loads` now proves a config that still names them loads anyway.

Two axes came back empty, and both were checked rather than assumed: every string
literal containing SQL is passed to a call, and the two `Error` variants that
name matches never mention — `Json` and `Sqlite` — are constructed by `?` in
about a hundred places, which is why they were left alone. Every template and
every static asset is reachable from a route or an `extends`.
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: the test-surface detector credited four items with callers they lack</title>
<updated>2026-11-20T22:13:44+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T22:13:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=92ecaabd7c62d029eba239e95cc8a7d2520fe4a9'/>
<id>92ecaabd7c62d029eba239e95cc8a7d2520fe4a9</id>
<content type='text'>
An audit found that `internal` — the check deciding whether a test-only item
has a real production caller — was crediting non-calls. Four items were
sorted into `residue` on false evidence, and each false credit was a
different mistake:

  db::cas_accepted_release   a `pub use` continuation line at db/mod.rs:55.
                             Production does this CAS through
                             `cas_accepted_release_in` inside a transaction;
                             the two names differ by three characters.
  shims::invocations         the string "invocations.jsonl", plus a call from
                             `called_with`, which is itself test-support
                             gated. A test-only function cannot be evidence
                             that another function is production-used.
  sandbox::LocalAgentProvisioner   its own struct and impl headers.
                             Production selects `K8sSandboxProvisioner`.
  sandbox::local_addr        `listener.local_addr()` — std's method on a
                             TcpListener, in sibling files. The census treats
                             all of src/sandbox as one module, and a name
                             match cannot tell a receiver's type.

All four are gated now. `KataBackend::local_addr` had zero callers in src and
zero in tests — `tests/remote_agent.rs` calls `RemoteBackend::local_addr`, a
different type — so it is deleted rather than gated.

The detector now strips string literals and comments, skips `use` statements
including the continuation lines of a brace-delimited block, skips an item's
own impl headers, and refuses to count a call made inside a `#[cfg(test)]`
module or a `test-support`-gated item.

The case a regex cannot resolve is `self.store_dir()` versus
`listener.local_addr()`: identical to a name match. Rows whose only evidence
is a call in method position are flagged `⚑`, listed in
`tools/test-surface-confirmed.json` only after a human read the cited line,
and `the_test_surface_is_disposed_of` fails on any unconfirmed one. Four rows
are confirmed that way — `config.store_dir`, `http.cookie`,
`ops.build_success_rate`, `watch.needs_stage_b`.

The table now prints each item's in-module call sites as its own column,
because the residue count is the one number this work cannot eliminate and the
claim underneath it has to be checkable rather than asserted.

Suite: 284 passed, 0 failed. Clippy clean. Release build clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An audit found that `internal` — the check deciding whether a test-only item
has a real production caller — was crediting non-calls. Four items were
sorted into `residue` on false evidence, and each false credit was a
different mistake:

  db::cas_accepted_release   a `pub use` continuation line at db/mod.rs:55.
                             Production does this CAS through
                             `cas_accepted_release_in` inside a transaction;
                             the two names differ by three characters.
  shims::invocations         the string "invocations.jsonl", plus a call from
                             `called_with`, which is itself test-support
                             gated. A test-only function cannot be evidence
                             that another function is production-used.
  sandbox::LocalAgentProvisioner   its own struct and impl headers.
                             Production selects `K8sSandboxProvisioner`.
  sandbox::local_addr        `listener.local_addr()` — std's method on a
                             TcpListener, in sibling files. The census treats
                             all of src/sandbox as one module, and a name
                             match cannot tell a receiver's type.

All four are gated now. `KataBackend::local_addr` had zero callers in src and
zero in tests — `tests/remote_agent.rs` calls `RemoteBackend::local_addr`, a
different type — so it is deleted rather than gated.

The detector now strips string literals and comments, skips `use` statements
including the continuation lines of a brace-delimited block, skips an item's
own impl headers, and refuses to count a call made inside a `#[cfg(test)]`
module or a `test-support`-gated item.

The case a regex cannot resolve is `self.store_dir()` versus
`listener.local_addr()`: identical to a name match. Rows whose only evidence
is a call in method position are flagged `⚑`, listed in
`tools/test-surface-confirmed.json` only after a human read the cited line,
and `the_test_surface_is_disposed_of` fails on any unconfirmed one. Four rows
are confirmed that way — `config.store_dir`, `http.cookie`,
`ops.build_success_rate`, `watch.needs_stage_b`.

The table now prints each item's in-module call sites as its own column,
because the residue count is the one number this work cannot eliminate and the
claim underneath it has to be checkable rather than asserted.

Suite: 284 passed, 0 failed. Clippy clean. Release build clean.
</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>db: close what nothing reaches, and say what cannot be closed</title>
<updated>2026-11-20T17:26:52+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T17:26:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=154f6f6dd284c11da82cf1188ff8549db6459228'/>
<id>154f6f6dd284c11da82cf1188ff8549db6459228</id>
<content type='text'>
db handed out 226 items and 36 of them were named by nobody at all — not by
the crate, not by the tests. Making them private is the whole of this commit,
but the interesting part is what the compiler said afterwards.

Twenty-five closed cleanly. Eleven did not, and they are the ones worth
writing down: AuditRow, NoticeRow, PackageRow, Subscription, StepRow,
Unbuilt, OpenReview, ReviewSubject, Migration, Writer, predecessors. None is
named outside db, yet none can be made private, because a public query
returns them and callers bind them with `let` and call methods on them.
They are load-bearing and invisible to a name search. So the census's `dead`
count means "the name is never written outside the module", which is a lead
rather than a verdict, and the census now says so: the way to find out which
flagged items are real is to privatize them and let rustc answer. Those
eleven are budgeted with that reason, not zeroed to make a number look good.

Nineteen items turned out to be dead code rather than merely unexported —
set_release, set_candidate, set_pkgbase, set_profile, set_kind,
current_state, index_pkgbase_drift, wal_stats, call_for_tests, put_notice,
is_ours, list_pkgbases, set_unpinable, artifact_id_by_digest_in,
subscription_poll_interval, the four never-emitted notice kinds, and
StateEnum::as_str, which the impl_state_enum macro was required to define
for all five enums while nothing called it through the trait. Privatizing
is what proved they were unused; leaving them private-but-present would have
just hidden dead code behind a narrower address.

Ten items became pub(crate): the Writer actor's call/tx/send surface,
Readers, the StateEnum trait, json_or, predecessors, DEFAULT_SETTINGS.
`Db.readers` was named nowhere outside db, so the field closed with the type.

db: 226 pub / 36 dead-only -&gt; 201 pub / 11 dead-only. 277 passed / 0 failed,
clippy -D warnings clean, schema_ownership and architecture green.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
db handed out 226 items and 36 of them were named by nobody at all — not by
the crate, not by the tests. Making them private is the whole of this commit,
but the interesting part is what the compiler said afterwards.

Twenty-five closed cleanly. Eleven did not, and they are the ones worth
writing down: AuditRow, NoticeRow, PackageRow, Subscription, StepRow,
Unbuilt, OpenReview, ReviewSubject, Migration, Writer, predecessors. None is
named outside db, yet none can be made private, because a public query
returns them and callers bind them with `let` and call methods on them.
They are load-bearing and invisible to a name search. So the census's `dead`
count means "the name is never written outside the module", which is a lead
rather than a verdict, and the census now says so: the way to find out which
flagged items are real is to privatize them and let rustc answer. Those
eleven are budgeted with that reason, not zeroed to make a number look good.

Nineteen items turned out to be dead code rather than merely unexported —
set_release, set_candidate, set_pkgbase, set_profile, set_kind,
current_state, index_pkgbase_drift, wal_stats, call_for_tests, put_notice,
is_ours, list_pkgbases, set_unpinable, artifact_id_by_digest_in,
subscription_poll_interval, the four never-emitted notice kinds, and
StateEnum::as_str, which the impl_state_enum macro was required to define
for all five enums while nothing called it through the trait. Privatizing
is what proved they were unused; leaving them private-but-present would have
just hidden dead code behind a narrower address.

Ten items became pub(crate): the Writer actor's call/tx/send surface,
Readers, the StateEnum trait, json_or, predecessors, DEFAULT_SETTINGS.
`Db.readers` was named nowhere outside db, so the field closed with the type.

db: 226 pub / 36 dead-only -&gt; 201 pub / 11 dead-only. 277 passed / 0 failed,
clippy -D warnings clean, schema_ownership and architecture green.
</pre>
</div>
</content>
</entry>
<entry>
<title>db: one module per aggregate, and an interface you can read</title>
<updated>2026-11-20T17:13:44+00:00</updated>
<author>
<name>dev</name>
<email>dev@localhost</email>
</author>
<published>2026-11-20T17:13:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=8cd32e5309b14f5264813e5f2ce6ecdb5aa41fb4'/>
<id>8cd32e5309b14f5264813e5f2ce6ecdb5aa41fb4</id>
<content type='text'>
queries.rs was 1,501 lines holding 83 queries across seventeen aggregates,
separated by comment banners that said "settings", "release", "notices" and
then kept them in one file. The banners were the design; they just never got
files. Each one has one now, verbatim — the split is provably content-only,
the moved text being identical to the original as a sorted set of lines.

model.rs and builds.rs were each two concerns deep, so they became
directories. model.rs held what a row looks like and, separately, the state
machines that say which moves are legal; builds.rs held the build machine and,
below its own `step rows` banner, the step machine. The impl_state_enum!
macro implements StateEnum for all five enums from one place, so it moved
with its invocations rather than being exported across a boundary to chase
them.

They are directories rather than new sibling modules on purpose:
`db::model::CandidateState` and `db::builds::steps` are used across the crate
and by the integration tests, and renaming them would be a bigger change than
the one being made. No call site and no test changed.

db/mod.rs now lists its interface instead of spraying one. `pub use model::*`
and `pub use queries::*` are gone, replaced by seventeen explicit exports, and
the query modules are private — so a query that was not chosen for export is
not reachable, and the width of the module is visible from its own text
rather than only from a grep.

The ratchet caught the win immediately: db.glob went 2 -&gt; 0, which failed
a_shrunk_interface_is_written_back until the budget was written back at the
new value. db is off the glob allowlist now rather than holding a stale zero.

277 passed / 0 failed, clippy -D warnings clean, largest file in src/db 363
lines (candidates.rs, unchanged from before this work).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
queries.rs was 1,501 lines holding 83 queries across seventeen aggregates,
separated by comment banners that said "settings", "release", "notices" and
then kept them in one file. The banners were the design; they just never got
files. Each one has one now, verbatim — the split is provably content-only,
the moved text being identical to the original as a sorted set of lines.

model.rs and builds.rs were each two concerns deep, so they became
directories. model.rs held what a row looks like and, separately, the state
machines that say which moves are legal; builds.rs held the build machine and,
below its own `step rows` banner, the step machine. The impl_state_enum!
macro implements StateEnum for all five enums from one place, so it moved
with its invocations rather than being exported across a boundary to chase
them.

They are directories rather than new sibling modules on purpose:
`db::model::CandidateState` and `db::builds::steps` are used across the crate
and by the integration tests, and renaming them would be a bigger change than
the one being made. No call site and no test changed.

db/mod.rs now lists its interface instead of spraying one. `pub use model::*`
and `pub use queries::*` are gone, replaced by seventeen explicit exports, and
the query modules are private — so a query that was not chosen for export is
not reachable, and the width of the module is visible from its own text
rather than only from a grep.

The ratchet caught the win immediately: db.glob went 2 -&gt; 0, which failed
a_shrunk_interface_is_written_back until the budget was written back at the
new value. db is off the glob allowlist now rather than holding a stale zero.

277 passed / 0 failed, clippy -D warnings clean, largest file in src/db 363
lines (candidates.rs, unchanged from before this work).
</pre>
</div>
</content>
</entry>
</feed>
