From 689b82bfe36660c18cbce66a3f05550c4d02dc12 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sat, 21 Nov 2026 17:07:56 +0000 Subject: error,tools: a variant nothing constructed, and three tool constructs nothing read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Missing::Snapshot` was declared, rendered by the `Display` arm, and constructed by nothing: `From<&str> 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. --- tools/test-surface.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/test-surface.md') diff --git a/tools/test-surface.md b/tools/test-surface.md index 37fba97..4535104 100644 --- a/tools/test-surface.md +++ b/tools/test-surface.md @@ -77,16 +77,16 @@ reaches the test tier also reaches a release build. | `config` | `shared_workspace` | `src/config.rs:98` | `config.rs`, `kata.rs`, `remote_agent.rs` | `src/config.rs:19`, `src/config.rs:30`, `src/config.rs:40` +8 | `Config::validate` calls it at config.rs:226; tests/kata.rs and tests/remote_agent.rs call it too and both need a fixture. | | `config` | `store_dir` | `src/config.rs:374` | `architecture.rs`, `invariants.rs` | `src/config.rs:331`, `src/config.rs:387` ⚑ | the content-addressed store layout is resolved by this module for the cache and blob paths; tests/invariants.rs pins where a blob lands and needs a fixture. | | `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:223`, `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:217` | the login route handler; same — its tests are harness-free and move with it. | +| `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. | | `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` | `index_world` | `src/pipeline/publish.rs:26` | `kata.rs` | `src/pipeline/mod.rs:269`, `src/pipeline/mod.rs:292`, `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:194` | `failure_modes.rs`, `kata.rs`, `remote_agent.rs` | `src/pipeline/mod.rs:186` | the run entry point with an injected sandbox; production uses `run`, tests inject a fake. | +| `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. | @@ -109,7 +109,7 @@ reaches the test tier also reaches a release build. | `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:144` ⚑ | 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. | +| `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. | | `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. | -- cgit v1.2.3