diff options
| author | dev <dev@example.com> | 2026-11-21 19:29:41 +0000 |
|---|---|---|
| committer | dev <dev@example.com> | 2026-11-21 19:29:41 +0000 |
| commit | bb1d533515c8f63faacb00b3ef59232cf2d4a1c5 (patch) | |
| tree | 94da9ecc261f28f12ac6e74b29b27f3aef4b1e77 /tools | |
| parent | 0f18ebddc1c138c531e3e331786c7fa917d9186f (diff) | |
| download | aur-build-bb1d533515c8f63faacb00b3ef59232cf2d4a1c5.tar.gz aur-build-bb1d533515c8f63faacb00b3ef59232cf2d4a1c5.zip | |
pipeline,sandbox,shims: thirty-two more markers the compiler was willing to take
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 -> 4 and `sandbox` 16 -> 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 -> 117, overwide 21 -> 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.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/test-surface.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/test-surface.md b/tools/test-surface.md index 3d69623..5cc9274 100644 --- a/tools/test-surface.md +++ b/tools/test-surface.md @@ -70,25 +70,19 @@ reaches the test tier also reaches a release build. |---|---|---|---|---|---| | `db` | `Writer` | `src/db/mod.rs:191` | `architecture.rs` | `src/db/audit.rs:10`, `src/db/audit.rs:74`, `src/db/mod.rs:329` +15 | `Db` has a `pub writer: Writer` field and pipeline, ops, review, watch and usecase all call `db.writer.tx(..)`. A field cannot be `pub` with a `pub(crate)` type — the compiler rejects it — so `Writer` is public because the public interface of `Db` requires it, not because a test asked. `tools/release-surface-probe.py` confirms it is reachable in a release build; that reachability is load-bearing, not residue. | -## Feature-conditional visibility — production uses it, only from inside its module — 13 items +## Feature-conditional visibility — production uses it, only from inside its module — 7 items | module | item | declared at | test files | in-module call sites | why | |---|---|---|---|---|---| | `db` | `MIGRATIONS` | `src/db/migrations.rs:344` | `db.rs` | `src/db/mod.rs:157` | `db::migrate` iterates it to apply pending migrations; tests/db.rs asserts the list is ordered and complete. | | `http` | `login` | `src/http/routes/mod.rs:51` | `common/mod.rs`, `http.rs` | `src/http/mod.rs:218` | the login route handler; same — its tests are harness-free and move with it. | -| `pipeline` | `admissible` | `src/pipeline/dispatch.rs:130` | `dispatch.rs` | `src/pipeline/dispatch.rs:111` | the dispatch filter, called at dispatch.rs:86; tests/dispatch.rs pins which builds it admits. | -| `pipeline` | `dispatch_once` | `src/pipeline/dispatch.rs:87` | `dispatch.rs` | `src/pipeline/dispatch.rs:71` | one tick of the dispatcher, called by the scheduler loop at dispatch.rs:60; tests/dispatch.rs drives single ticks. | -| `pipeline` | `free_disk_mb` | `src/pipeline/dispatch.rs:157` | `dispatch.rs` | `src/pipeline/dispatch.rs:145` | the disk probe the dispatcher consults at dispatch.rs:106. | | `pipeline` | `index_world` | `src/pipeline/publish.rs:26` | `kata.rs` | `src/pipeline/mod.rs:268`, `src/pipeline/mod.rs:291`, `src/pipeline/steps.rs:92` | the world-index step, used by the pipeline at mod.rs:255 and steps.rs:92; tests/kata.rs checks what landed in the index. | -| `pipeline` | `run_with` | `src/pipeline/mod.rs:193` | `failure_modes.rs`, `kata.rs`, `remote_agent.rs` | `src/pipeline/mod.rs:185` | the run entry point with an injected sandbox; production uses `run`, tests inject a fake. | | `review` | `LOW` | `src/review/risk.rs:13` | `notices.rs` | `src/review/risk.rs:105`, `src/review/risk.rs:200`, `src/review/risk.rs:206` | the risk floor, compared at risk.rs:94,189,195; tests/notices.rs pins where the floor bites. | -| `shims` | `manifest` | `src/shims/mod.rs:96` | `common/mod.rs`, `invariants.rs`, `pipeline.rs`, `production_surface.rs` … | `src/shims/mod.rs:194` | 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:521` | `shims.rs` | `src/shims/mod.rs:561` | the shim's `--db` argument validator; production calls it at mod.rs:510, tests check its verdicts. | | `watch` | `needs_stage_b` | `src/watch/upstream.rs:26` | `vcs.rs` | `src/watch/detect.rs:102` ⚑ | the stage-B predicate, consulted by detect.rs:101. | | `watch` | `probe` | `src/watch/upstream.rs:45` | `architecture.rs`, `ops.rs`, `vcs.rs` | `src/watch/detect.rs:96` | 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:41` | the mirror sync, called by detect.rs:40; tests/detect.rs drives a real sync. | -## Already gated — 22 items +## Already gated — 28 items | module | item | declared at | test files | in-module call sites | why | |---|---|---|---|---|---| @@ -106,12 +100,18 @@ reaches the test tier also reaches a release build. | `ops` | `STAGING_GRACE_SECS` | `src/ops.rs:333` | `ops.rs` | `src/ops.rs:300` | the grace period the staging sweep applies at ops.rs:286; tests/ops.rs pins the value it must be. | | `ops` | `build_success_rate` | `src/ops.rs:51` | `ops.rs` | `src/ops.rs:101` ⚑ | computed inside the maintenance report at ops.rs:87; tests/ops.rs checks the arithmetic. | | `ops` | `sweep_staging` | `src/ops.rs:363` | `ops.rs` | `src/ops.rs:300` | called by the maintenance pass at ops.rs:286; tests/ops.rs exercises it directly. | +| `pipeline` | `admissible` | `src/pipeline/dispatch.rs:130` | `dispatch.rs` | `src/pipeline/dispatch.rs:111` | the dispatch filter, called at dispatch.rs:86; tests/dispatch.rs pins which builds it admits. | +| `pipeline` | `dispatch_once` | `src/pipeline/dispatch.rs:87` | `dispatch.rs` | `src/pipeline/dispatch.rs:71` | one tick of the dispatcher, called by the scheduler loop at dispatch.rs:60; tests/dispatch.rs drives single ticks. | +| `pipeline` | `free_disk_mb` | `src/pipeline/dispatch.rs:157` | `dispatch.rs` | `src/pipeline/dispatch.rs:145` | the disk probe the dispatcher consults at dispatch.rs:106. | +| `pipeline` | `run_with` | `src/pipeline/mod.rs:193` | `failure_modes.rs`, `kata.rs`, `remote_agent.rs` | `src/pipeline/mod.rs:185` | the run entry point with an injected sandbox; production uses `run`, tests inject a fake. | | `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:235` | `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:136` | `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. | | `sandbox` | `local_addr` | `src/sandbox/remote.rs:57` | `architecture.rs`, `remote_agent.rs` | `src/sandbox/kata.rs:240`, `src/sandbox/mod.rs:142` ⚑ | DELETED from kata.rs and gated on remote.rs. `KataBackend::local_addr` had zero callers anywhere and is gone; `RemoteBackend::local_addr` is called only by tests/remote_agent.rs, so it is gated. Both were credited with production callers at `listener.local_addr()`, which is std's method on a TcpListener in a sibling file — the census treats all of src/sandbox as one module and a name match cannot tell a receiver's type. This row is why `dotted_only` confirmation exists. | | `shims` | `called_with` | `src/shims/mod.rs:177` | `crash.rs`, `dispatch.rs`, `invariants.rs`, `kata.rs` … | — | reads the shim's invocation log, which only tests inspect. | | `shims` | `invocations` | `src/shims/mod.rs:159` | `shims.rs` | — | the shim appends to invocations.jsonl in production but nothing reads it back; the two credited sites name the *filename* in a string, and the only reader, `called_with`, is itself gated. Gated with it. | +| `shims` | `manifest` | `src/shims/mod.rs:96` | `common/mod.rs`, `invariants.rs`, `pipeline.rs`, `production_surface.rs` … | `src/shims/mod.rs:194` | 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:521` | `shims.rs` | `src/shims/mod.rs:561` | the shim's `--db` argument validator; production calls it at mod.rs:510, tests check its verdicts. | | `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` | `virtualize` | `src/time.rs:129` | `crash.rs`, `dispatch.rs`, `production_surface.rs` | — | already gated behind test-support. | @@ -120,8 +120,8 @@ reaches the test tier also reaches a release build. | disposition | count | |---|---| | `interface` | 1 | -| `narrowed` | 13 | -| `already-gated` | 22 | +| `narrowed` | 7 | +| `already-gated` | 28 | | **total** | **36** | Of these, 1 are ungated today. Gating the `gate` rows and narrowing the |
