<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/tests/architecture-budget.json, branch ai/main</title>
<subtitle>Unnamed repository
</subtitle>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/'/>
<entry>
<title>tests: the ratchet says what the code says now</title>
<updated>2026-11-23T13:56:40+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-23T13:56:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=6872e81644546a9ccd0e1420c3ef64a26358f78a'/>
<id>6872e81644546a9ccd0e1420c3ef64a26358f78a</id>
<content type='text'>
The architecture test's own essays were the largest block of prose left
in the tree, and the test-file headers were notes about which tests moved
into `src/` — history the file no longer needs.

Removing those mentions moved two measured numbers, and the ratchet was
right to complain. `db.Writer` now sits in the allowlist with the
compiler fact that keeps it `pub` — narrowing it makes every call site
say `type db::Writer is private` — and the counts that got smaller are
written back at the smaller value, as the ratchet demands.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The architecture test's own essays were the largest block of prose left
in the tree, and the test-file headers were notes about which tests moved
into `src/` — history the file no longer needs.

Removing those mentions moved two measured numbers, and the ratchet was
right to complain. `db.Writer` now sits in the allowlist with the
compiler fact that keeps it `pub` — narrowing it makes every call site
say `type db::Writer is private` — and the counts that got smaller are
written back at the smaller value, as the ratchet demands.
</pre>
</div>
</content>
</entry>
<entry>
<title>pipeline,sandbox,shims: thirty-two more markers the compiler was willing to take</title>
<updated>2026-11-21T19:29:41+00:00</updated>
<author>
<name>dev</name>
<email>dev@example.com</email>
</author>
<published>2026-11-21T19:29:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=bb1d533515c8f63faacb00b3ef59232cf2d4a1c5'/>
<id>bb1d533515c8f63faacb00b3ef59232cf2d4a1c5</id>
<content type='text'>
The whole `shims` module is behind `test-support`, so its thirteen `pub(crate)`
items were invisible to a release build already — but `pub(crate)` still made
each of them part of the crate's interface to every other module, and none of
them had a reader outside the file that declares it. `manifest`, `record`,
`split_version`, `valid_db_arg`, `DB_SUFFIXES` and the nine tool entry points
are now private to `src/shims/mod.rs`, which is where the shim binaries reach
them through the module's own `pub` surface.

`pipeline` went 16 -&gt; 4 and `sandbox` 16 -&gt; 9. Two refusals are worth the
sentence: `SourceIdentity` is the type of the `pub(crate)` field `Ctx::src`, and
a field may not be more reachable than its type, so making it private is the
`private_interfaces` warning rather than a legal narrowing. `provision_request`
is declared inside the private `kata_backend` module and called from the
sibling `#[cfg(test)] mod tests`, and privacy does not cross to a sibling —
E0624. Both are argued in `over_visibility.allowlist` now instead of sitting
unexplained.

`LOW` in `review` is the same sibling case one level up: it lives in the
`pub mod level` nested in risk.rs and the scorer in the parent module reads
`level::LOW`, so `pub(crate)` is the narrowest thing that reaches, given that
this crate does not admit `pub(super)`.

priv 149 -&gt; 117, overwide 21 -&gt; 0 unargued. `cargo check` clean under both
profiles with no new warnings; tests/pipeline.rs, remote_agent.rs, kata.rs,
approve.rs, shims.rs and world.rs pass (62 tests), and `cargo test --test
architecture` is 16 passed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The whole `shims` module is behind `test-support`, so its thirteen `pub(crate)`
items were invisible to a release build already — but `pub(crate)` still made
each of them part of the crate's interface to every other module, and none of
them had a reader outside the file that declares it. `manifest`, `record`,
`split_version`, `valid_db_arg`, `DB_SUFFIXES` and the nine tool entry points
are now private to `src/shims/mod.rs`, which is where the shim binaries reach
them through the module's own `pub` surface.

`pipeline` went 16 -&gt; 4 and `sandbox` 16 -&gt; 9. Two refusals are worth the
sentence: `SourceIdentity` is the type of the `pub(crate)` field `Ctx::src`, and
a field may not be more reachable than its type, so making it private is the
`private_interfaces` warning rather than a legal narrowing. `provision_request`
is declared inside the private `kata_backend` module and called from the
sibling `#[cfg(test)] mod tests`, and privacy does not cross to a sibling —
E0624. Both are argued in `over_visibility.allowlist` now instead of sitting
unexplained.

`LOW` in `review` is the same sibling case one level up: it lives in the
`pub mod level` nested in risk.rs and the scorer in the parent module reads
`level::LOW`, so `pub(crate)` is the narrowest thing that reaches, given that
this crate does not admit `pub(super)`.

priv 149 -&gt; 117, overwide 21 -&gt; 0 unargued. `cargo check` clean under both
profiles with no new warnings; tests/pipeline.rs, remote_agent.rs, kata.rs,
approve.rs, shims.rs and world.rs pass (62 tests), and `cargo test --test
architecture` is 16 passed.
</pre>
</div>
</content>
</entry>
<entry>
<title>http: ten request and response helpers were never crate-internal, just unmarked</title>
<updated>2026-11-21T19:27:26+00:00</updated>
<author>
<name>dev</name>
<email>dev@example.com</email>
</author>
<published>2026-11-21T19:27:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=0f18ebddc1c138c531e3e331786c7fa917d9186f'/>
<id>0f18ebddc1c138c531e3e331786c7fa917d9186f</id>
<content type='text'>
`http` declares 81 `pub(crate)` items, the densest cluster in the tree, and the
census called every one of them the good state. Ten of them are not
crate-internal at all: `State`, `Req`, `Res`, `logout`, and the five accessors
on `Req` and constructors on `Res` are named only from `http/mod.rs`, the file
that declares them. The router dispatches through them in the same file; the
`pub(crate)` was describing an outside caller that does not exist.

`cookie` is the one worth naming: it is the auth-cookie helper, it looked used
from `http/routes/mod.rs`, and what is used there is a *field* named `cookie`
on `Req`. A word-match census cannot tell those apart, which is the whole
reason this pass was done by stripping markers and compiling rather than by
reading the census output.

priv 159 -&gt; 149 (http 81 -&gt; 71), overwide 22 -&gt; 21. `cargo check` clean under
both profiles, no new warnings; tests/http.rs, surfaces.rs, notices.rs and
invariants.rs all pass (43 tests).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`http` declares 81 `pub(crate)` items, the densest cluster in the tree, and the
census called every one of them the good state. Ten of them are not
crate-internal at all: `State`, `Req`, `Res`, `logout`, and the five accessors
on `Req` and constructors on `Res` are named only from `http/mod.rs`, the file
that declares them. The router dispatches through them in the same file; the
`pub(crate)` was describing an outside caller that does not exist.

`cookie` is the one worth naming: it is the auth-cookie helper, it looked used
from `http/routes/mod.rs`, and what is used there is a *field* named `cookie`
on `Req`. A word-match census cannot tell those apart, which is the whole
reason this pass was done by stripping markers and compiling rather than by
reading the census output.

priv 159 -&gt; 149 (http 81 -&gt; 71), overwide 22 -&gt; 21. `cargo check` clean under
both profiles, no new warnings; tests/http.rs, surfaces.rs, notices.rs and
invariants.rs all pass (43 tests).
</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>tools,tests: count the pub(crate) items nothing outside their own file reaches</title>
<updated>2026-11-21T19:24:13+00:00</updated>
<author>
<name>dev</name>
<email>dev@example.com</email>
</author>
<published>2026-11-21T19:24:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=db11b540b1b4c60926c175cb5cd043c7555b99f3'/>
<id>db11b540b1b4c60926c175cb5cd043c7555b99f3</id>
<content type='text'>
`pub(crate)` was the good state in the census by decree: `priv` was reported
and deliberately left out of the budget, on the grounds that a rising count of
crate-internal items is progress. That is true of `pub` -&gt; `pub(crate)` and
false of the next step. A `pub(crate)` item that no file except the one that
declares it ever names is offering the whole crate a thing nothing reaches, and
nothing in the suite said so.

`overwide` counts them. Same shape as `deadonly`, on purpose: a per-module
number that may only shrink, an item allowed to stay only by name in
`over_visibility.allowlist`, and the compiler fact that forces it written
beside the name. `--list-overwide` names every one with its file:line, and
`tests/architecture.rs` mirrors the definition so the two implementations are
cross-checked against each other, the way the census already is.

Baseline, before any item is narrowed: 35 of 170 `pub(crate)` declarations are
over-wide. Eight of them are already argued — a `pub(crate)` field cannot carry
a private type, privacy does not reach up to a parent module or across to a
sibling one, and `pub(super)` is not a form this crate admits — which leaves 27
unargued, and 27 is what the budget now holds.

The count is a grep and a grep is a lead, not a verdict: the verdict is the
compiler's, and it has to be asked under both profiles, because the
`cfg(not(feature = "test-support"))` half of a feature-conditional declaration
is never compiled by `cargo check --all-targets`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`pub(crate)` was the good state in the census by decree: `priv` was reported
and deliberately left out of the budget, on the grounds that a rising count of
crate-internal items is progress. That is true of `pub` -&gt; `pub(crate)` and
false of the next step. A `pub(crate)` item that no file except the one that
declares it ever names is offering the whole crate a thing nothing reaches, and
nothing in the suite said so.

`overwide` counts them. Same shape as `deadonly`, on purpose: a per-module
number that may only shrink, an item allowed to stay only by name in
`over_visibility.allowlist`, and the compiler fact that forces it written
beside the name. `--list-overwide` names every one with its file:line, and
`tests/architecture.rs` mirrors the definition so the two implementations are
cross-checked against each other, the way the census already is.

Baseline, before any item is narrowed: 35 of 170 `pub(crate)` declarations are
over-wide. Eight of them are already argued — a `pub(crate)` field cannot carry
a private type, privacy does not reach up to a parent module or across to a
sibling one, and `pub(super)` is not a form this crate admits — which leaves 27
unargued, and 27 is what the budget now holds.

The count is a grep and a grep is a lead, not a verdict: the verdict is the
compiler's, and it has to be asked under both profiles, because the
`cfg(not(feature = "test-support"))` half of a feature-conditional declaration
is never compiled by `cargo check --all-targets`.
</pre>
</div>
</content>
</entry>
<entry>
<title>src: narrow what only its own module reads, and delete what nothing reads at all</title>
<updated>2026-11-21T13:28:55+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T13:28:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=48fecfe03be4f214eaf4f9c49cb3c27496bb74ba'/>
<id>48fecfe03be4f214eaf4f9c49cb3c27496bb74ba</id>
<content type='text'>
The census's 35 `deadonly` items were a lead, not a verdict, and the compiler
answered it: 17 of them are read only inside their own module and were declared
`pub` for no reason, so they are `pub(crate)` now — `db::OpenReview` and its two
queries, `ReviewSubject` and its query, `fetch::Body`, `http`'s `form_get`,
`query_get` and `Page::flash`, `ops::EvictPlan`, `usecase`'s `StageB`… — and two
are read by nobody: `ReleaseState::can_transition` and
`SubscriptionState::can_transition`, both already annotated "nothing consults
this table today", which is the definition of dead rather than the argument for
keeping.

Narrowing them is what made the compiler look harder, and it found three more:
`ReviewSubject::pkgbase` was selected out of the database and never read,
`StageB::cached` was written in three places and never read, and
`StageB::version` was never called. All gone, the SELECT column with them.

The other 18 cannot be narrowed and now say so, once at the declaration and once
in the budget file: a row type the `aur-build` binary binds without naming
(`PackageRow`, `Checked`, `GcPlan`, `Prepared`), a type behind a `pub` fn a test
calls (`Unbuilt`, `BulkItem`, `StageA`, `CheckReport`, `PkgInfo`, `Installed`,
`Subscription`, `Manifest`), a trait a public test provisioner implements
(`Provisioner`, `ProvisionRequest`), and three that a release build never even
compiles because their module is `test-support`-gated (`shims::*`, `VirtualClock`).

`deadonly` therefore means *dead and unargued* now: an allowlisted item leaves the
dead columns, which is the only way the number can be held at zero forever.
448 pub, 49 dead, 0 unargued; 284 tests pass, one ignored, none lost.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The census's 35 `deadonly` items were a lead, not a verdict, and the compiler
answered it: 17 of them are read only inside their own module and were declared
`pub` for no reason, so they are `pub(crate)` now — `db::OpenReview` and its two
queries, `ReviewSubject` and its query, `fetch::Body`, `http`'s `form_get`,
`query_get` and `Page::flash`, `ops::EvictPlan`, `usecase`'s `StageB`… — and two
are read by nobody: `ReleaseState::can_transition` and
`SubscriptionState::can_transition`, both already annotated "nothing consults
this table today", which is the definition of dead rather than the argument for
keeping.

Narrowing them is what made the compiler look harder, and it found three more:
`ReviewSubject::pkgbase` was selected out of the database and never read,
`StageB::cached` was written in three places and never read, and
`StageB::version` was never called. All gone, the SELECT column with them.

The other 18 cannot be narrowed and now say so, once at the declaration and once
in the budget file: a row type the `aur-build` binary binds without naming
(`PackageRow`, `Checked`, `GcPlan`, `Prepared`), a type behind a `pub` fn a test
calls (`Unbuilt`, `BulkItem`, `StageA`, `CheckReport`, `PkgInfo`, `Installed`,
`Subscription`, `Manifest`), a trait a public test provisioner implements
(`Provisioner`, `ProvisionRequest`), and three that a release build never even
compiles because their module is `test-support`-gated (`shims::*`, `VirtualClock`).

`deadonly` therefore means *dead and unargued* now: an allowlisted item leaves the
dead columns, which is the only way the number can be held at zero forever.
448 pub, 49 dead, 0 unargued; 284 tests pass, one ignored, none lost.
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: the census names its dead items, and the budget argues its survivors</title>
<updated>2026-11-21T13:04:12+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T13:04:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=a200edaac2056dd9c85d6bddff3ca181f0cc277e'/>
<id>a200edaac2056dd9c85d6bddff3ca181f0cc277e</id>
<content type='text'>
A count cannot be acted on. `db: 8 dead-only` tells a module is wide and sends
the reader back to grep for which eight, so the census now records where every
dead item is declared and `--list-dead` prints them: 35 named by nobody, 49
named only by tests.

What is *accepted* moves into the one file the ratchet already reads, under a
`dead_code` section — the accepted `deadonly` count per module, and an allowlist
of `module.item` to a one-line reason. `--budget` now fails three ways: a module
over its accepted count, a dead item no one argued for, and an allowlist entry
that no longer names a dead item. The third is the one that matters, because a
stale permission is how a deleted item comes back: the excuse is still on the
books, so nobody notices the new one. `--write-budget` writes the counts and
preserves the allowlist, the same way it already preserves the section
tools/test-surface.py owns — two writers of one file may not erase each other.

All 35 are unargued today, which is the point: the check is the worklist.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A count cannot be acted on. `db: 8 dead-only` tells a module is wide and sends
the reader back to grep for which eight, so the census now records where every
dead item is declared and `--list-dead` prints them: 35 named by nobody, 49
named only by tests.

What is *accepted* moves into the one file the ratchet already reads, under a
`dead_code` section — the accepted `deadonly` count per module, and an allowlist
of `module.item` to a one-line reason. `--budget` now fails three ways: a module
over its accepted count, a dead item no one argued for, and an allowlist entry
that no longer names a dead item. The third is the one that matters, because a
stale permission is how a deleted item comes back: the excuse is still on the
books, so nobody notices the new one. `--write-budget` writes the counts and
preserves the allowlist, the same way it already preserves the section
tools/test-surface.py owns — two writers of one file may not erase each other.

All 35 are unargued today, which is the point: the check is the worklist.
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: a re-export is not a call, and an alias is not a stranger</title>
<updated>2026-11-21T11:06:01+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T11:06:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=7f5d3dc2ae540b7d4faf5e8c854e638fe70b9fd3'/>
<id>7f5d3dc2ae540b7d4faf5e8c854e638fe70b9fd3</id>
<content type='text'>
The auditor's `open_reviews_for` was invisible for one reason: the cross-module
mention index counted `pub use` lines as production use, so the item was
discarded before it could become a row. The tool's own docstring already said
"a re-export is not a call" — the rule was simply applied to the in-module loop
and never to the cross-module one. Two implementations of one idea, one of them
ignored.

Fixing that exposed the next layer, because once re-exports stop counting, the
calls that remain are mostly made through a name the declaring module did not
choose:

- `ap::approve(..)` from `use crate::review::{approve as ap, ..}`
- `sources::recipe_hash(..)` from `use crate::watch::sources;`
- `crate::db::model::BUILD_STEPS` — a path is not just its last token
- `candidates::mark_viewed(..)` — an item declared in `db`, re-exported by
  `review`, and called through `review`

So the mention resolver now resolves import prefixes, walks the whole qualified
path, and follows re-export edges (collected from the entire `use` statement,
not just its first line — the names live on the continuation lines, which is how
`mark_viewed` hid too).

It also learned the opposite lesson. `Vec::new()`, `v.parse::&lt;u64&gt;()` and
`stop.load(..)` are not mentions of `db::new`, `pkgver::parse` or
`pipeline::load`. Treating every unresolvable receiver as ambiguous buried the
real rows, so a qualified mention must now name a crate module or an imported
prefix to count as anything, and a method name declared in exactly one module is
credited on a value receiver — `cfg.validate()` is `config::validate`, because
nothing else in the crate could mean it. With that, the ambiguous column is empty
instead of full of noise.

`use_block_lines`, `gated_declarations`, `line_context` and `use_prefixes` each
re-read their file on every call — 15,280 reads of the same dozen files, two and
a half minutes per run. Memoised: 20.7s, same output.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The auditor's `open_reviews_for` was invisible for one reason: the cross-module
mention index counted `pub use` lines as production use, so the item was
discarded before it could become a row. The tool's own docstring already said
"a re-export is not a call" — the rule was simply applied to the in-module loop
and never to the cross-module one. Two implementations of one idea, one of them
ignored.

Fixing that exposed the next layer, because once re-exports stop counting, the
calls that remain are mostly made through a name the declaring module did not
choose:

- `ap::approve(..)` from `use crate::review::{approve as ap, ..}`
- `sources::recipe_hash(..)` from `use crate::watch::sources;`
- `crate::db::model::BUILD_STEPS` — a path is not just its last token
- `candidates::mark_viewed(..)` — an item declared in `db`, re-exported by
  `review`, and called through `review`

So the mention resolver now resolves import prefixes, walks the whole qualified
path, and follows re-export edges (collected from the entire `use` statement,
not just its first line — the names live on the continuation lines, which is how
`mark_viewed` hid too).

It also learned the opposite lesson. `Vec::new()`, `v.parse::&lt;u64&gt;()` and
`stop.load(..)` are not mentions of `db::new`, `pkgver::parse` or
`pipeline::load`. Treating every unresolvable receiver as ambiguous buried the
real rows, so a qualified mention must now name a crate module or an imported
prefix to count as anything, and a method name declared in exactly one module is
credited on a value receiver — `cfg.validate()` is `config::validate`, because
nothing else in the crate could mean it. With that, the ambiguous column is empty
instead of full of noise.

`use_block_lines`, `gated_declarations`, `line_context` and `use_prefixes` each
re-read their file on every call — 15,280 reads of the same dozen files, two and
a half minutes per run. Memoised: 20.7s, same output.
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: key items by (module, name), and prove the surface by compiling</title>
<updated>2026-11-21T09:38:33+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T09:38:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=d3da3a1882999a80db34089153f9684fd8d7bbee'/>
<id>d3da3a1882999a80db34089153f9684fd8d7bbee</id>
<content type='text'>
The auditor's two counterexamples were both detector bugs, and they were the
same class of bug as the ones before: the instrument was reading the source in a
way that flattered the number.

- Rows are keyed by `(module, name)`. Keyed by bare name,
  `pipeline::dispatch::Pool::shutdown` merged into the `db::Writer::shutdown`
  row, which is gated, so an ungated item was reported `already-gated`.
- The production-mention index is built from lines with comments and string
  literals removed. Searching raw text made `review::approve::withdraw` look
  production-used because the *string* "withdraw" appears in an HTTP route
  pattern and an audit action; every real caller named `withdraw_package` or
  `withdraw_release_in`, which are different items.
- A `pub` declaration inside a private module is not a public declaration.
  Without that, the inner-module narrowing made the detector report an
  `http::new` nobody could name.
- For a name declared in several modules — `new`, `open`, `record`, `parse` — a
  bare mention elsewhere cannot be resolved, so the row is kept and flagged
  `ambiguous` rather than silently dropped, and
  `tools/test-surface-ambiguous.json` holds the human verdict. An ambiguous row
  with no verdict fails the architecture test; "the tool could not tell" is not a
  disposition.
- The count rule was duplicated between `--json` and `--write-budget` and the
  two drifted the moment a rule was added to one. `tally()` is now the one place.

`tools/release-surface-probe.py` replaces inference with compilation for the
final claim. It writes a throwaway crate depending on `aur-build` twice, with and
without `test-support`, and tries to name every dispositioned item from outside.
A path that compiles with the feature proves the path is real; every such path
must fail without it. Current result: 28 real external paths, 27 closed in a
release build, and the one that stays open is `db::Writer`, which is public
because `Db` has a `pub writer: Writer` field and Rust will not type a public
field with a private type. That is recorded as `interface` in
`tools/test-surface-interface.json` — a disposition that admits reachability and
names the signature that forces it — and the probe fails if the file claims an
item that is not in fact reachable, so it cannot quietly rot.

The tool's own docstring and the generated table claimed "Rust has no
test-conditional visibility". That was false and is gone, replaced with the two
shapes that do it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The auditor's two counterexamples were both detector bugs, and they were the
same class of bug as the ones before: the instrument was reading the source in a
way that flattered the number.

- Rows are keyed by `(module, name)`. Keyed by bare name,
  `pipeline::dispatch::Pool::shutdown` merged into the `db::Writer::shutdown`
  row, which is gated, so an ungated item was reported `already-gated`.
- The production-mention index is built from lines with comments and string
  literals removed. Searching raw text made `review::approve::withdraw` look
  production-used because the *string* "withdraw" appears in an HTTP route
  pattern and an audit action; every real caller named `withdraw_package` or
  `withdraw_release_in`, which are different items.
- A `pub` declaration inside a private module is not a public declaration.
  Without that, the inner-module narrowing made the detector report an
  `http::new` nobody could name.
- For a name declared in several modules — `new`, `open`, `record`, `parse` — a
  bare mention elsewhere cannot be resolved, so the row is kept and flagged
  `ambiguous` rather than silently dropped, and
  `tools/test-surface-ambiguous.json` holds the human verdict. An ambiguous row
  with no verdict fails the architecture test; "the tool could not tell" is not a
  disposition.
- The count rule was duplicated between `--json` and `--write-budget` and the
  two drifted the moment a rule was added to one. `tally()` is now the one place.

`tools/release-surface-probe.py` replaces inference with compilation for the
final claim. It writes a throwaway crate depending on `aur-build` twice, with and
without `test-support`, and tries to name every dispositioned item from outside.
A path that compiles with the feature proves the path is real; every such path
must fail without it. Current result: 28 real external paths, 27 closed in a
release build, and the one that stays open is `db::Writer`, which is public
because `Db` has a `pub writer: Writer` field and Rust will not type a public
field with a private type. That is recorded as `interface` in
`tools/test-surface-interface.json` — a disposition that admits reachability and
names the signature that forces it — and the probe fails if the file claims an
item that is not in fact reachable, so it cannot quietly rot.

The tool's own docstring and the generated table claimed "Rust has no
test-conditional visibility". That was false and is gone, replaced with the two
shapes that do it.
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: the detector learns to see through a private inner module</title>
<updated>2026-11-20T23:53:49+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-20T23:53:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=28023ba17adbe6fc096a31d5e2c62d017a88fc4c'/>
<id>28023ba17adbe6fc096a31d5e2c62d017a88fc4c</id>
<content type='text'>
`aliased_behind_private_module` reports an item as not release-exposed only when
both halves of the pattern hold: a `pub use ..::NAME;` whose attribute block
carries the test-support gate, and every `pub` declaration of the name sitting
inside a module that is itself private. Either half alone is not enough — a
gated alias to a genuinely public type says nothing, and a `pub` type in a
public module is reachable whatever the alias says.

The census still counts the inner `pub` as a public declaration, which is the
honest reading of the text and the reason this needed a second check rather than
a change to the first.

New `narrowed` disposition, distinct from `already-gated`: production *does* use
these items, just never from outside their module. `residue` and `ungated` are
now 0 and the ratchet records it.

Every one of the 46 items carries a hand-written reason naming its production
caller or explaining why it has none.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`aliased_behind_private_module` reports an item as not release-exposed only when
both halves of the pattern hold: a `pub use ..::NAME;` whose attribute block
carries the test-support gate, and every `pub` declaration of the name sitting
inside a module that is itself private. Either half alone is not enough — a
gated alias to a genuinely public type says nothing, and a `pub` type in a
public module is reachable whatever the alias says.

The census still counts the inner `pub` as a public declaration, which is the
honest reading of the text and the reason this needed a second check rather than
a change to the first.

New `narrowed` disposition, distinct from `already-gated`: production *does* use
these items, just never from outside their module. `residue` and `ungated` are
now 0 and the ratchet records it.

Every one of the 46 items carries a hand-written reason naming its production
caller or explaining why it has none.
</pre>
</div>
</content>
</entry>
</feed>
