<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/tools, branch ai/main</title>
<subtitle>Unnamed repository
</subtitle>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/'/>
<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>error,tools: a variant nothing constructed, and three tool constructs nothing read</title>
<updated>2026-11-21T17:07:56+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T17:07:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=689b82bfe36660c18cbce66a3f05550c4d02dc12'/>
<id>689b82bfe36660c18cbce66a3f05550c4d02dc12</id>
<content type='text'>
`Missing::Snapshot` was declared, rendered by the `Display` arm, and constructed
by nothing: `From&lt;&amp;str&gt; for Missing` routes a bare sentence to `Missing::Other`,
and the test that mentions a snapshot asserts `Other(_)`. The variant and its
formatting arm are gone. A variant scan that counted *mentions* could not see it,
because the formatting arm is a mention; the scan now ignores a line that only
renders the variant, and what it reports afterwards is `Error::Json` and
`Error::Sqlite`, both of which the compiler proves live — deleting either breaks
the hundred-odd `?` sites that reach them through `#[from]`.

Three survivors in `tools/`, none of them caught by the audit that claimed the
axis was empty, because that audit looked at module-level constants and function
parameters and never at local bindings:

- `test-surface.py` opened `render()` with `out = [...] if False else []`, a
  literal dead branch whose binding was then never read. Both gone.
- `test-surface.py` computed a `collisions` set that nothing consulted; the rule
  it narrated had moved into `mentioned` as `sole_owner`. The set is deleted and
  the explanation now sits in the docstring of the function that applies it.
- `release-surface-probe.py` built `decl_line` and used `decl_no` instead.

`a, b = item.split(" as ", 1)` became `_, b = ..` for the same reason. The scans
now cover locals and constant conditions as well, and report nothing: no unread
binding, no `if False`, no unreachable statement after a terminator, no unused
import, constant, parameter, or unread argparse option across the five tools.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Missing::Snapshot` was declared, rendered by the `Display` arm, and constructed
by nothing: `From&lt;&amp;str&gt; for Missing` routes a bare sentence to `Missing::Other`,
and the test that mentions a snapshot asserts `Other(_)`. The variant and its
formatting arm are gone. A variant scan that counted *mentions* could not see it,
because the formatting arm is a mention; the scan now ignores a line that only
renders the variant, and what it reports afterwards is `Error::Json` and
`Error::Sqlite`, both of which the compiler proves live — deleting either breaks
the hundred-odd `?` sites that reach them through `#[from]`.

Three survivors in `tools/`, none of them caught by the audit that claimed the
axis was empty, because that audit looked at module-level constants and function
parameters and never at local bindings:

- `test-surface.py` opened `render()` with `out = [...] if False else []`, a
  literal dead branch whose binding was then never read. Both gone.
- `test-surface.py` computed a `collisions` set that nothing consulted; the rule
  it narrated had moved into `mentioned` as `sole_owner`. The set is deleted and
  the explanation now sits in the docstring of the function that applies it.
- `release-surface-probe.py` built `decl_line` and used `decl_no` instead.

`a, b = item.split(" as ", 1)` became `_, b = ..` for the same reason. The scans
now cover locals and constant conditions as well, and report nothing: no unread
binding, no `if False`, no unreachable statement after a terminator, no unused
import, constant, parameter, or unread argparse option across the five tools.
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: audit the tools, and let them regenerate what they already claim</title>
<updated>2026-11-21T14:09:28+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T14:09:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=141a14112554707e04bc2dd33f0c8071c1d74441'/>
<id>141a14112554707e04bc2dd33f0c8071c1d74441</id>
<content type='text'>
Five axes were asked of `tools/*.py` — unreachable statements, unused imports,
module-level functions no tool calls, constants nothing reads, parameters nothing
passes, and argparse options nothing reads — and all five came back empty, which
is worth recording because the alternative is to assume a script directory rots.
The one real finding was staleness rather than dead code: `tools/test-surface.md`
still cited line numbers from before the narrowing, and `tools/arch-census.md`
last recorded a census of 470 `pub` / 84 dead / 35 unargued. Both were
regenerated by the tools that own them, so the committed reports now say
448 / 49 / 0. `gen-vercmp-oracle.py` was run and reproduces the committed oracle
byte for byte.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Five axes were asked of `tools/*.py` — unreachable statements, unused imports,
module-level functions no tool calls, constants nothing reads, parameters nothing
passes, and argparse options nothing reads — and all five came back empty, which
is worth recording because the alternative is to assume a script directory rots.
The one real finding was staleness rather than dead code: `tools/test-surface.md`
still cited line numbers from before the narrowing, and `tools/arch-census.md`
last recorded a census of 470 `pub` / 84 dead / 35 unargued. Both were
regenerated by the tools that own them, so the committed reports now say
448 / 49 / 0. `gen-vercmp-oracle.py` was run and reproduces the committed oracle
byte for byte.
</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: the probe enumerates pub items itself instead of trusting the table</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=4aaa0b87618ab3f41049a4da587421b758449f6f'/>
<id>4aaa0b87618ab3f41049a4da587421b758449f6f</id>
<content type='text'>
`release-surface-probe.py` used to take its candidate list from
`tools/test-surface.py`. That made it strictly downstream of the inference it
existed to audit: an item the detector dropped could never be probed, and the
tool reported "0 leaked" about a table that was missing the leak. The auditor was
right that "proven by compiling, not inferring" did not hold.

It now enumerates on its own — every `pub` declaration in `src/`, found by
scanning the files — and applies its own deliberately simpler production-use
rule (comments, strings and `use` lines do not count). Two independent rules that
must agree is a check; one rule consulted twice is not.

Three control experiments were run against it, and the first two failed before
the tool was correct:

- un-gating `review::approve::withdraw` initially reported nothing, because the
  probe built paths from the census module (`aur_build::review::withdraw`)
  instead of the real one (`aur_build::review::approve::withdraw`). A path that
  cannot compile even with the feature was silently filed as "not nameable".
  Paths are now derived from the declaring file, with the module-door and
  intermediate re-export paths tried too.
- with that fixed, un-gating `withdraw` is caught by name and location.
- restoring `open_reviews_for` together with the test that used it is caught too.
  Restoring only the function is correctly not caught: with no test naming it,
  it is dead code, not a test-only leak.

That last distinction is a separate category now. A public item that nothing in
`src` or `tests` reaches — `reopen_rejected`'s shape — is reported and fails the
run, counted over the declaring file too so a helper used only by its own module
is not falsely called unreachable.

`db::Writer` stays reachable on purpose and is now probed for that claim: an item
listed in `test-surface-interface.json` must actually resolve, or the file is
stale and the probe says so.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`release-surface-probe.py` used to take its candidate list from
`tools/test-surface.py`. That made it strictly downstream of the inference it
existed to audit: an item the detector dropped could never be probed, and the
tool reported "0 leaked" about a table that was missing the leak. The auditor was
right that "proven by compiling, not inferring" did not hold.

It now enumerates on its own — every `pub` declaration in `src/`, found by
scanning the files — and applies its own deliberately simpler production-use
rule (comments, strings and `use` lines do not count). Two independent rules that
must agree is a check; one rule consulted twice is not.

Three control experiments were run against it, and the first two failed before
the tool was correct:

- un-gating `review::approve::withdraw` initially reported nothing, because the
  probe built paths from the census module (`aur_build::review::withdraw`)
  instead of the real one (`aur_build::review::approve::withdraw`). A path that
  cannot compile even with the feature was silently filed as "not nameable".
  Paths are now derived from the declaring file, with the module-door and
  intermediate re-export paths tried too.
- with that fixed, un-gating `withdraw` is caught by name and location.
- restoring `open_reviews_for` together with the test that used it is caught too.
  Restoring only the function is correctly not caught: with no test naming it,
  it is dead code, not a test-only leak.

That last distinction is a separate category now. A public item that nothing in
`src` or `tests` reaches — `reopen_rejected`'s shape — is reported and fails the
run, counted over the declaring file too so a helper used only by its own module
is not falsely called unreachable.

`db::Writer` stays reachable on purpose and is now probed for that claim: an item
listed in `test-surface-interface.json` must actually resolve, or the file is
stale and the probe says so.
</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>
</feed>
