summaryrefslogtreecommitdiffstats
path: root/tools/test-surface-reasons.json
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-20 22:13:44 +0000
committeraur-build <aur-build@localhost>2026-11-20 22:13:44 +0000
commit92ecaabd7c62d029eba239e95cc8a7d2520fe4a9 (patch)
tree2ff255b78ebf7f2e3a78d6c389670d704ae0af04 /tools/test-surface-reasons.json
parent2ed254f5487613e00dae4ee15dc63500c4edcce2 (diff)
downloadaur-build-92ecaabd7c62d029eba239e95cc8a7d2520fe4a9.tar.gz
aur-build-92ecaabd7c62d029eba239e95cc8a7d2520fe4a9.zip
tools: the test-surface detector credited four items with callers they lack
An audit found that `internal` — the check deciding whether a test-only item has a real production caller — was crediting non-calls. Four items were sorted into `residue` on false evidence, and each false credit was a different mistake: db::cas_accepted_release a `pub use` continuation line at db/mod.rs:55. Production does this CAS through `cas_accepted_release_in` inside a transaction; the two names differ by three characters. shims::invocations the string "invocations.jsonl", plus a call from `called_with`, which is itself test-support gated. A test-only function cannot be evidence that another function is production-used. sandbox::LocalAgentProvisioner its own struct and impl headers. Production selects `K8sSandboxProvisioner`. sandbox::local_addr `listener.local_addr()` — std's method on a TcpListener, in sibling files. The census treats all of src/sandbox as one module, and a name match cannot tell a receiver's type. All four are gated now. `KataBackend::local_addr` had zero callers in src and zero in tests — `tests/remote_agent.rs` calls `RemoteBackend::local_addr`, a different type — so it is deleted rather than gated. The detector now strips string literals and comments, skips `use` statements including the continuation lines of a brace-delimited block, skips an item's own impl headers, and refuses to count a call made inside a `#[cfg(test)]` module or a `test-support`-gated item. The case a regex cannot resolve is `self.store_dir()` versus `listener.local_addr()`: identical to a name match. Rows whose only evidence is a call in method position are flagged `⚑`, listed in `tools/test-surface-confirmed.json` only after a human read the cited line, and `the_test_surface_is_disposed_of` fails on any unconfirmed one. Four rows are confirmed that way — `config.store_dir`, `http.cookie`, `ops.build_success_rate`, `watch.needs_stage_b`. The table now prints each item's in-module call sites as its own column, because the residue count is the one number this work cannot eliminate and the claim underneath it has to be checkable rather than asserted. Suite: 284 passed, 0 failed. Clippy clean. Release build clean.
Diffstat (limited to 'tools/test-surface-reasons.json')
-rw-r--r--tools/test-surface-reasons.json16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/test-surface-reasons.json b/tools/test-surface-reasons.json
index 3ac9585..b85eeff 100644
--- a/tools/test-surface-reasons.json
+++ b/tools/test-surface-reasons.json
@@ -1,10 +1,10 @@
{
"config.TestHooks": "the `hooks` field is already gated; the type and its impl are not, so they compile into a release build that can never read them.",
"config.shared_workspace": "`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": "the content-addressed store layout is used at config.rs:313 and :355; tests/invariants.rs pins it and needs a fixture.",
- "db.MIGRATIONS": "`db::migrate` iterates it at db/mod.rs:135; tests/db.rs asserts the list is ordered and complete.",
+ "config.store_dir": "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": "`db::migrate` iterates it to apply pending migrations; tests/db.rs asserts the list is ordered and complete.",
"db.ReleaseState": "a row type named by twenty sites inside db; tests/pipeline.rs names it while driving a real pipeline.",
- "db.cas_accepted_release": "the compare-and-set on the accepted-release pointer; nothing in production performs that CAS today, but it is the primitive `accepted_release_for` is paired with.",
+ "db.cas_accepted_release": "production performs this CAS inside a transaction via `cas_accepted_release_in` (publish.rs:208); the standalone form has no caller in the crate. The census credited it with a production caller at the `pub use` continuation line in db/mod.rs \u2014 a re-export is not a call.",
"db.claim": "production leases with `claim_batch`; `claim` is called only by tests, so the release build need not compile it.",
"db.set_setting": "a settings writer with no production caller; `setting`/`setting_i64` readers are used, the setter is not.",
"db.shutdown": "`Writer::shutdown` is never called by the server; tests use it to quiesce the writer thread.",
@@ -36,21 +36,21 @@
"review.render_and_store": "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.",
"sandbox.Exit": "the sandbox exit record, named across the backends; tests/failure_modes.rs asserts on it.",
"sandbox.K8sSandboxProvisioner": "the kata provisioner impl; tests/kata.rs drives it directly.",
- "sandbox.KataBackend": "the kata backend; tests/kata.rs constructs it rather than going through `for_config`'s caller.",
- "sandbox.LocalAgentProvisioner": "the local agent provisioner impl; tests/kata.rs drives it.",
+ "sandbox.KataBackend": "selected by `backend_for` when the config names an agent-sandbox backend; tests/kata.rs drives it directly.",
+ "sandbox.LocalAgentProvisioner": "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.LoopbackBackend": "the default backend; tests/failure_modes.rs constructs it to inject a fault.",
"sandbox.ProvisionRequest": "kata provisioning internals; the test that names them needs no fixture.",
"sandbox.Provisioner": "kata provisioning internals; same test.",
"sandbox.RemoteBackend": "the remote backend; tests/remote_agent.rs constructs it against a real agent.",
- "sandbox.SandboxInfo": "the sandbox descriptor returned by the trait; tests/failure_modes.rs reads its fields.",
+ "sandbox.SandboxInfo": "the return type of `SandboxBackend::status`; tests/failure_modes.rs reads its fields.",
"sandbox.for_config": "kata backend constructor; same test.",
- "sandbox.local_addr": "the agent's local address, read by the backend selection at mod.rs:120; tests/remote_agent.rs asserts on it.",
+ "sandbox.local_addr": "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 \u2014 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.provision_request": "kata request builder; same test.",
"sandbox.reclaim": "kata reclaim path; the TTL test that names it needs no fixture.",
"sandbox.sandbox_cr": "kata container-record shape; same test.",
"sandbox.shared_for": "kata workspace helper; same test.",
"shims.called_with": "reads the shim's invocation log, which only tests inspect.",
- "shims.invocations": "reads the shim invocation log; the shim writes it in production (mod.rs:112) but nothing in src reads it back.",
+ "shims.invocations": "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": "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": "the shim's `--db` argument validator; production calls it at mod.rs:510, tests check its verdicts.",
"time.unpin": "the clock escape hatch; `pin`/`unpin` exist so a test can freeze time. Its only in-module mention is a unit test.",