From 7f5d3dc2ae540b7d4faf5e8c854e638fe70b9fd3 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sat, 21 Nov 2026 11:06:01 +0000 Subject: tools: a re-export is not a call, and an alias is not a stranger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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::()` 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. --- tools/test-surface.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools/test-surface.md') diff --git a/tools/test-surface.md b/tools/test-surface.md index 740cf61..7f22e16 100644 --- a/tools/test-surface.md +++ b/tools/test-surface.md @@ -94,7 +94,7 @@ reaches the test tier also reaches a release build. | `watch` | `probe` | `src/watch/upstream.rs:44` | `architecture.rs`, `ops.rs`, `vcs.rs` | `src/watch/detect.rs:95` | the upstream probe, called by detect.rs:95; tests/ops.rs and tests/vcs.rs both need a fixture. | | `watch` | `sync_mirror` | `src/watch/mirror.rs:22` | `detect.rs` | `src/watch/detect.rs:40` | the mirror sync, called by detect.rs:40; tests/detect.rs drives a real sync. | -## Already gated — 17 items +## Already gated — 16 items | module | item | declared at | test files | in-module call sites | why | |---|---|---|---|---|---| @@ -106,7 +106,6 @@ reaches the test tier also reaches a release build. | `db` | `tx_for_tests` | `src/db/mod.rs:284` | `approve.rs`, `common/mod.rs`, `db.rs`, `invariants.rs` … | — | already gated behind test-support — the pattern the rest of this table asks for. | | `db` | `unapproved_index_entries` | `src/db/invariants.rs:15` | `db.rs`, `detect.rs`, `notices.rs`, `shims.rs` | — | an invariant query nothing runs; it needs `pub(crate)` diff internals to be useful, so it is gated rather than relocated. | | `db` | `world_members` | `src/db/world.rs:32` | `db.rs` | — | a world-snapshot reader nothing calls; `put_world_snapshot` is the half production uses. | -| `pipeline` | `shutdown` | `src/pipeline/dispatch.rs:61` | `architecture.rs`, `common/mod.rs`, `crash.rs`, `dispatch.rs` | — | `Pool::shutdown` stops and joins the dispatcher threads. Production runs the pool until the process exits and never asks it to stop; tests/dispatch.rs and tests/crash.rs need the join so they can assert on the pool's effects after it is gone. Gated, not narrowed: no production build should carry a stop path nothing invokes. | | `review` | `render_and_store` | `src/review/diff.rs:282` | `approve.rs`, `common/mod.rs`, `crash.rs`, `dispatch.rs` … | — | intake renders through `review::intake::record`; this wrapper has zero callers in src and 17 in tests. Gated, not relocated: it needs the module-private diff renderer. | | `review` | `withdraw` | `src/review/approve.rs:234` | `architecture.rs`, `pipeline.rs`, `production_surface.rs` | — | Single-release withdraw. The CLI and the web UI both go through `usecase::withdraw_package` -> `pipeline::publish::withdraw_package`; nothing invokes this. tests/pipeline.rs pins its invariants (a second withdraw is refused, an unknown release is refused), so it is gated rather than deleted: the test is the cover for the operation production has not grown yet. | | `sandbox` | `LocalAgentProvisioner` | `src/sandbox/kata.rs:134` | `kata.rs` | — | production selects `K8sSandboxProvisioner` (kata.rs:193); nothing in the crate constructs this type. It exists so tests can drive the real agent protocol against the shim binary without a cluster, so it is gated rather than deleted. The census credited its own `impl` headers as callers. | @@ -122,8 +121,8 @@ reaches the test tier also reaches a release build. |---|---| | `interface` | 1 | | `narrowed` | 19 | -| `already-gated` | 17 | -| **total** | **37** | +| `already-gated` | 16 | +| **total** | **36** | Of these, 1 are ungated today. Gating the `gate` rows and narrowing the `narrow` rows removes 0 items from the release build's public surface; the -- cgit v1.2.3