<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/src/db/mod.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>config,db,fetch,ops: eleven pub(crate) items nothing outside their own file reaches</title>
<updated>2026-11-21T19:25:47+00:00</updated>
<author>
<name>dev</name>
<email>dev@example.com</email>
</author>
<published>2026-11-21T19:25:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=533835c6b49111d5520ccd7a7bdd008a428b560f'/>
<id>533835c6b49111d5520ccd7a7bdd008a428b560f</id>
<content type='text'>
Every one of these was found by taking the marker off and asking the compiler,
under both profiles, not by reading a grep. `cargo check --all-targets` builds
with `test-support` on, so it never compiles the `cfg(not(test-support))` half
of a feature-conditional declaration; the release check is the one that says
whether that half can go private, and it refused several of them that the dev
check appeared to accept.

Narrowed to private: config `shared_workspace` and `store_dir` (both are the
`cfg(not(test-support))` twin of a `pub` that only tests reach), db
`state_col`, `start`, `call`, `send`, fetch `Body` and `open`, ops
`build_success_rate`, `STAGING_GRACE_SECS` and `sweep_staging`.

Refused, and now argued in the budget file rather than left unexplained:
`EvictPlan`, because `plan_retention` is `pub(crate)` and returns
`Vec&lt;EvictPlan&gt;`, so a private row type is `error: type EvictPlan is private`
at `usecase/maintenance.rs:23` where the Vec is bound. `Readers`,
`OpenReview` and `ReviewSubject` are the same story in `db`.

priv 170 -&gt; 159, overwide 27 -&gt; 22. `cargo check` clean under both profiles
with no new warnings, including no new dead_code; `cargo test --test
architecture` 16 passed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every one of these was found by taking the marker off and asking the compiler,
under both profiles, not by reading a grep. `cargo check --all-targets` builds
with `test-support` on, so it never compiles the `cfg(not(test-support))` half
of a feature-conditional declaration; the release check is the one that says
whether that half can go private, and it refused several of them that the dev
check appeared to accept.

Narrowed to private: config `shared_workspace` and `store_dir` (both are the
`cfg(not(test-support))` twin of a `pub` that only tests reach), db
`state_col`, `start`, `call`, `send`, fetch `Body` and `open`, ops
`build_success_rate`, `STAGING_GRACE_SECS` and `sweep_staging`.

Refused, and now argued in the budget file rather than left unexplained:
`EvictPlan`, because `plan_retention` is `pub(crate)` and returns
`Vec&lt;EvictPlan&gt;`, so a private row type is `error: type EvictPlan is private`
at `usecase/maintenance.rs:23` where the Vec is bound. `Readers`,
`OpenReview` and `ReviewSubject` are the same story in `db`.

priv 170 -&gt; 159, overwide 27 -&gt; 22. `cargo check` clean under both profiles
with no new warnings, including no new dead_code; `cargo test --test
architecture` 16 passed.
</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>src: keep every remaining test-only item out of the release build</title>
<updated>2026-11-20T23:53:42+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T23:53:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=66814ddb86009de7a519f167db634dab3e924fa8'/>
<id>66814ddb86009de7a519f167db634dab3e924fa8</id>
<content type='text'>
The auditor was right and my "Rust has no test-conditional visibility" defence
was wrong. Two shapes do it, and both are now used wherever the item allows.

For free functions, methods, consts and statics: one body behind two visibility
declarations.

    #[cfg(feature = "test-support")]      pub fn probe(..) -&gt; .. { probe_impl(..) }
    #[cfg(not(feature = "test-support"))] pub(crate) fn probe(..) -&gt; .. { probe_impl(..) }
    fn probe_impl(..) -&gt; .. { .. }

The value lives once in a private `*_impl` / `*_VALUE`, so the aliases cannot
drift apart.

For types: a private inner module holding the real definition, re-exported under
a feature gate.

    mod kata_backend { pub struct KataBackend { .. } }
    #[cfg(feature = "test-support")]      pub use kata_backend::KataBackend;
    #[cfg(not(feature = "test-support"))] pub(crate) use kata_backend::KataBackend;

A `pub` item inside a private module has no nameable path from outside, but it is
visible enough to appear in a public trait signature — which is why `Exit`, the
return type of `Sandbox::run`, narrows this way and would not as a plain
`pub(crate) struct`. `ReleaseState` earns its keep the same route: `ReleaseRow`
is public and its `state` field is typed here.

Verified with an external crate against the built library: naming `Exit`,
`SandboxInfo`, `KataBackend`, `LoopbackBackend`, `RemoteBackend`, `ReleaseState`,
`BulkRefusal` or `LogTail` from a release build is `error[E0603]: .. is private`;
with `test-support` the same program compiles.

Where narrowing needed a re-export split by feature (`db::MIGRATIONS`,
`model::ReleaseState`) the alias is split; where nothing in the crate used the
alias (`watch::sync_mirror`) it is gone rather than gated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The auditor was right and my "Rust has no test-conditional visibility" defence
was wrong. Two shapes do it, and both are now used wherever the item allows.

For free functions, methods, consts and statics: one body behind two visibility
declarations.

    #[cfg(feature = "test-support")]      pub fn probe(..) -&gt; .. { probe_impl(..) }
    #[cfg(not(feature = "test-support"))] pub(crate) fn probe(..) -&gt; .. { probe_impl(..) }
    fn probe_impl(..) -&gt; .. { .. }

The value lives once in a private `*_impl` / `*_VALUE`, so the aliases cannot
drift apart.

For types: a private inner module holding the real definition, re-exported under
a feature gate.

    mod kata_backend { pub struct KataBackend { .. } }
    #[cfg(feature = "test-support")]      pub use kata_backend::KataBackend;
    #[cfg(not(feature = "test-support"))] pub(crate) use kata_backend::KataBackend;

A `pub` item inside a private module has no nameable path from outside, but it is
visible enough to appear in a public trait signature — which is why `Exit`, the
return type of `Sandbox::run`, narrows this way and would not as a plain
`pub(crate) struct`. `ReleaseState` earns its keep the same route: `ReleaseRow`
is public and its `state` field is typed here.

Verified with an external crate against the built library: naming `Exit`,
`SandboxInfo`, `KataBackend`, `LoopbackBackend`, `RemoteBackend`, `ReleaseState`,
`BulkRefusal` or `LogTail` from a release build is `error[E0603]: .. is private`;
with `test-support` the same program compiles.

Where narrowing needed a re-export split by feature (`db::MIGRATIONS`,
`model::ReleaseState`) the alias is split; where nothing in the crate used the
alias (`watch::sync_mirror`) it is gone rather than gated.
</pre>
</div>
</content>
</entry>
<entry>
<title>sandbox: keep `Exit` out of the release build</title>
<updated>2026-11-20T23:38:01+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T23:38:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=c295510e2bb0ee61234536c832dad87a45977fc8'/>
<id>c295510e2bb0ee61234536c832dad87a45977fc8</id>
<content type='text'>
`Exit` is the result of running a command in a sandbox. `pipeline` consumes it
through `Sandbox::run` — `.success()`, `.stderr` — without ever writing the name,
which is why the census called it dead outside `sandbox`.

The type now lives in a private `mod exit` and reaches the world through an
alias that is `pub` only under `test-support` and `pub(crate)` otherwise. A
`pub` definition inside a private module is not a nameable path from outside,
but it is visible enough to appear in a public trait signature, which is what
makes this possible where a plain `pub(crate) struct` is not.

Verified with an external crate: naming `aur_build::sandbox::Exit` in a release
build is `error[E0603]: struct Exit is private`; with `test-support` it compiles.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Exit` is the result of running a command in a sandbox. `pipeline` consumes it
through `Sandbox::run` — `.success()`, `.stderr` — without ever writing the name,
which is why the census called it dead outside `sandbox`.

The type now lives in a private `mod exit` and reaches the world through an
alias that is `pub` only under `test-support` and `pub(crate)` otherwise. A
`pub` definition inside a private module is not a nameable path from outside,
but it is visible enough to appear in a public trait signature, which is what
makes this possible where a plain `pub(crate) struct` is not.

Verified with an external crate: naming `aur_build::sandbox::Exit` in a release
build is `error[E0603]: struct Exit is private`; with `test-support` it compiles.
</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>db, sandbox: apply the dispositions the table decided</title>
<updated>2026-11-20T21:03:58+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T21:03:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=2210c934d4a25602318f094e0eca72f42862d44a'/>
<id>2210c934d4a25602318f094e0eca72f42862d44a</id>
<content type='text'>
Six db items are now gated behind `test-support`, each with a comment
saying what it is for and why production never calls it:

    builds::claim            production leases a batch; `claim_batch` is
                             what the dispatcher runs
    settings::set_setting    the readers are used, the setter is not
    Writer::shutdown         the server runs until the process ends
    snapshots::snapshot_by_commit
    world::world_members     production writes world snapshots, never
                             reads one back member by member
    invariants::unapproved_index_entries
                             gated, not relocated: reading it needs this
                             module's private helpers, and widening those
                             to let a test out would be the wrong trade

Gating them exposed three things they were the only user of, and each is
gated with them rather than left compiling into a binary that cannot reach
it: `Msg::Shutdown` and its loop arm, and `model::json_or`.
`arch-census.py --write-budget` also stopped erasing the `test_surface`
section — two writers of one file must not delete each other's axis, or
the ratchet quietly stops checking it.

`steps::touch` is deleted, not narrowed. Nothing called it — not
production, not a test. The census had credited it to `tests/shims.rs`,
where the word appears inside a string.

In sandbox, two tests moved into `src/sandbox/kata.rs`: the container
record a lease provisions, and the TTL expiry of a sandbox that never
dials in. Neither builds a fixture. `KataBackend::shared_for`,
`provision_request`, `sandbox_cr` and `K8sSandboxProvisioner::for_config`
are `pub(crate)` as a result.

`KataBackend::reclaim` is deleted — same story as `touch`. It forwarded to
`self.provisioner.reclaim`, which the reaping site already calls itself,
and the TTL test the census credited it for implements the *trait's*
`reclaim` on a null provisioner. Same word, different function.

Two honest costs, both recorded rather than smoothed over:

- `Provisioner` and `ProvisionRequest` are now named by nobody outside
  `sandbox`, yet cannot be narrowed: `LocalAgentProvisioner` is `pub`
  because two fixture tests construct it, and Rust forbids a public type
  implementing a private trait or taking a private parameter type.
  `sandbox.deadonly` therefore rises 0 → 2, with the reason here as the
  ratchet demands.
- `agent_sandbox_config()` now exists in both `tests/kata.rs` and
  `src/sandbox/kata.rs`. Three of that file's remaining tests still need
  it, and a test helper cannot be shared across the crate boundary without
  making it public again.

sandbox: 27 pub / 15 dead -&gt; 22 pub / 10 dead.
Suite: 284 passed, 0 failed, 0 ignored. Clippy clean.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Six db items are now gated behind `test-support`, each with a comment
saying what it is for and why production never calls it:

    builds::claim            production leases a batch; `claim_batch` is
                             what the dispatcher runs
    settings::set_setting    the readers are used, the setter is not
    Writer::shutdown         the server runs until the process ends
    snapshots::snapshot_by_commit
    world::world_members     production writes world snapshots, never
                             reads one back member by member
    invariants::unapproved_index_entries
                             gated, not relocated: reading it needs this
                             module's private helpers, and widening those
                             to let a test out would be the wrong trade

Gating them exposed three things they were the only user of, and each is
gated with them rather than left compiling into a binary that cannot reach
it: `Msg::Shutdown` and its loop arm, and `model::json_or`.
`arch-census.py --write-budget` also stopped erasing the `test_surface`
section — two writers of one file must not delete each other's axis, or
the ratchet quietly stops checking it.

`steps::touch` is deleted, not narrowed. Nothing called it — not
production, not a test. The census had credited it to `tests/shims.rs`,
where the word appears inside a string.

In sandbox, two tests moved into `src/sandbox/kata.rs`: the container
record a lease provisions, and the TTL expiry of a sandbox that never
dials in. Neither builds a fixture. `KataBackend::shared_for`,
`provision_request`, `sandbox_cr` and `K8sSandboxProvisioner::for_config`
are `pub(crate)` as a result.

`KataBackend::reclaim` is deleted — same story as `touch`. It forwarded to
`self.provisioner.reclaim`, which the reaping site already calls itself,
and the TTL test the census credited it for implements the *trait's*
`reclaim` on a null provisioner. Same word, different function.

Two honest costs, both recorded rather than smoothed over:

- `Provisioner` and `ProvisionRequest` are now named by nobody outside
  `sandbox`, yet cannot be narrowed: `LocalAgentProvisioner` is `pub`
  because two fixture tests construct it, and Rust forbids a public type
  implementing a private trait or taking a private parameter type.
  `sandbox.deadonly` therefore rises 0 → 2, with the reason here as the
  ratchet demands.
- `agent_sandbox_config()` now exists in both `tests/kata.rs` and
  `src/sandbox/kata.rs`. Three of that file's remaining tests still need
  it, and a test helper cannot be shared across the crate boundary without
  making it public again.

sandbox: 27 pub / 15 dead -&gt; 22 pub / 10 dead.
Suite: 284 passed, 0 failed, 0 ignored. Clippy 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>
</feed>
