From b3c326735e4c212afed8c6a25411a1040a67f760 Mon Sep 17 00:00:00 2001 From: aur-build Date: Fri, 20 Nov 2026 21:20:05 +0000 Subject: review, shims, time: gate the last three test-only entry points MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `review::diff::render_and_store` is the alarming row in the table: zero callers in `src/`, seventeen test files. Intake renders through `review::intake::record` — the single entry point the pipeline and both front ends use — and this is the older uncomposed form. It is gated, not relocated to `tests/common`, because it needs this module's private `panels`/`render_text` and `candidates::set_diff_digest`; widening those to let a test out would undo the narrowing the last dozen commits did. `shims::called_with` is gated: the shim *writes* its invocation log in production, which is how a fake tool leaves evidence, but nothing in the crate reads it back. Only tests ask what a build actually did. `time::pin` and `time::unpin` are gated together. Gating half of a two-function capability would leave a release binary able to freeze the clock and unable to release it. `pin` is worth naming because the census never reported it as test-only at all: its name match also fires inside `upstream_pins`, so a genuinely test-only function hid in plain sight until its counterpart was examined. The only callers in the crate are tests, and the unit test that uses them is gated with them. Nothing was relocated to `tests/common`. The table chose no `relocate` disposition — every item either needed module-private internals or moved into its own module instead — and no API was widened to accommodate a test, which was the condition on relocating anything. Test-only items across the crate: 61 at the start of this work, 46 now, of which 33 are residue and 13 already gated. `gate_pending` is zero. Suite: 284 passed, 0 failed, 0 ignored. Clippy clean. --- tools/test-surface.md | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'tools') diff --git a/tools/test-surface.md b/tools/test-surface.md index cd6851e..9f85c5f 100644 --- a/tools/test-surface.md +++ b/tools/test-surface.md @@ -46,14 +46,6 @@ The `residue` count is ratcheted by `tests/architecture.rs`, so it can only shrink. -## Gate behind `test-support` — 3 items - -| module | item | declared at | test files | why | -|---|---|---|---|---| -| `review` | `render_and_store` | `src/review/diff.rs:269` | `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. | -| `shims` | `called_with` | `src/shims/mod.rs:144` | `crash.rs`, `dispatch.rs`, `invariants.rs`, `kata.rs` … | reads the shim's invocation log, which only tests inspect. | -| `time` | `unpin` | `src/time.rs:47` | `time.rs` | the clock escape hatch; `pin`/`unpin` exist so a test can freeze time. Its only in-module mention is a unit test. | - ## Residue — `pub` because Rust has no test-conditional visibility — 33 items | module | item | declared at | test files | why | @@ -86,13 +78,13 @@ shrink. | `sandbox` | `local_addr` | `src/sandbox/kata.rs:250` | `remote_agent.rs` | the agent's local address, read by the backend selection at mod.rs:120; tests/remote_agent.rs asserts on it. | | `shims` | `invocations` | `src/shims/mod.rs:133` | `shims.rs` | reads the shim invocation log; the shim writes it in production (mod.rs:112) but nothing in src reads it back. | | `shims` | `manifest` | `src/shims/mod.rs:88` | `common/mod.rs`, `invariants.rs`, `pipeline.rs`, `production_surface.rs` … | the shim manifest, read by `run` at mod.rs:161; seven test files read it to assert what a build did. | -| `shims` | `valid_db_arg` | `src/shims/mod.rs:479` | `shims.rs` | the shim's `--db` argument validator; production calls it at mod.rs:510, tests check its verdicts. | +| `shims` | `valid_db_arg` | `src/shims/mod.rs:486` | `shims.rs` | the shim's `--db` argument validator; production calls it at mod.rs:510, tests check its verdicts. | | `watch` | `StageBSlot` | `src/watch/upstream.rs:118` | `vcs.rs` | the stage-B cache slot shape; tests/vcs.rs asserts on it while driving a real mirror. | | `watch` | `needs_stage_b` | `src/watch/upstream.rs:20` | `vcs.rs` | the stage-B predicate, consulted by detect.rs:101. | | `watch` | `probe` | `src/watch/upstream.rs:25` | `ops.rs`, `vcs.rs` | 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:17` | `detect.rs` | the mirror sync, called by detect.rs:40; tests/detect.rs drives a real sync. | -## Already gated — 10 items +## Already gated — 13 items | module | item | declared at | test files | why | |---|---|---|---|---| @@ -104,19 +96,21 @@ shrink. | `db` | `tx_for_tests` | `src/db/mod.rs:271` | `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. | -| `time` | `virtual_sleep` | `src/time.rs:168` | `production_surface.rs` | already gated behind test-support. | -| `time` | `virtualize` | `src/time.rs:119` | `crash.rs`, `dispatch.rs`, `production_surface.rs` | already gated behind test-support. | +| `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. | +| `shims` | `called_with` | `src/shims/mod.rs:151` | `crash.rs`, `dispatch.rs`, `invariants.rs`, `kata.rs` … | reads the shim's invocation log, which only tests inspect. | +| `time` | `unpin` | `src/time.rs:57` | `time.rs` | the clock escape hatch; `pin`/`unpin` exist so a test can freeze time. Its only in-module mention is a unit test. | +| `time` | `virtual_sleep` | `src/time.rs:178` | `production_surface.rs` | already gated behind test-support. | +| `time` | `virtualize` | `src/time.rs:129` | `crash.rs`, `dispatch.rs`, `production_surface.rs` | already gated behind test-support. | ## Totals | disposition | count | |---|---| -| `gate` | 3 | | `residue` | 33 | -| `already-gated` | 10 | +| `already-gated` | 13 | | **total** | **46** | -Of these, 36 are ungated today. Gating the `gate` rows and narrowing the -`narrow` rows removes 3 items from the release build's public surface; the +Of these, 33 are ungated today. Gating the `gate` rows and narrowing the +`narrow` rows removes 0 items from the release build's public surface; the `move-test` rows remove 0 more and take their tests home with them. -- cgit v1.2.3