diff options
| author | dev <dev@example.com> | 2026-11-21 19:27:26 +0000 |
|---|---|---|
| committer | dev <dev@example.com> | 2026-11-21 19:27:26 +0000 |
| commit | 0f18ebddc1c138c531e3e331786c7fa917d9186f (patch) | |
| tree | b99428e80e267d8a1b4665b46aa67212fb42f154 /tools | |
| parent | 533835c6b49111d5520ccd7a7bdd008a428b560f (diff) | |
| download | aur-build-0f18ebddc1c138c531e3e331786c7fa917d9186f.tar.gz aur-build-0f18ebddc1c138c531e3e331786c7fa917d9186f.zip | |
http: ten request and response helpers were never crate-internal, just unmarked
`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 -> 149 (http 81 -> 71), overwide 22 -> 21. `cargo check` clean under
both profiles, no new warnings; tests/http.rs, surfaces.rs, notices.rs and
invariants.rs all pass (43 tests).
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/test-surface.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/test-surface.md b/tools/test-surface.md index 16f931f..3d69623 100644 --- a/tools/test-surface.md +++ b/tools/test-surface.md @@ -70,12 +70,11 @@ 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 — 14 items +## Feature-conditional visibility — production uses it, only from inside its module — 13 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` | `cookie` | `src/http/mod.rs:42` | `common/mod.rs`, `http.rs` | `src/http/mod.rs:224`, `src/http/routes/mod.rs:38`, `src/http/routes/mod.rs:64` +2 ⚑ | the auth cookie helper; the tests that use it build no fixture, so they move into the module and it narrows. | | `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. | @@ -89,7 +88,7 @@ reaches the test tier also reaches a release build. | `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 — 21 items +## Already gated — 22 items | module | item | declared at | test files | in-module call sites | why | |---|---|---|---|---|---| @@ -103,6 +102,7 @@ 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. | +| `http` | `cookie` | `src/http/mod.rs:42` | `common/mod.rs`, `http.rs` | `src/http/mod.rs:224`, `src/http/routes/mod.rs:38`, `src/http/routes/mod.rs:64` +2 ⚑ | the auth cookie helper; the tests that use it build no fixture, so they move into the module and it narrows. | | `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. | @@ -120,8 +120,8 @@ reaches the test tier also reaches a release build. | disposition | count | |---|---| | `interface` | 1 | -| `narrowed` | 14 | -| `already-gated` | 21 | +| `narrowed` | 13 | +| `already-gated` | 22 | | **total** | **36** | Of these, 1 are ungated today. Gating the `gate` rows and narrowing the |
