summaryrefslogtreecommitdiffstats
path: root/src/sandbox/remote.rs
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 /src/sandbox/remote.rs
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 'src/sandbox/remote.rs')
-rw-r--r--src/sandbox/remote.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sandbox/remote.rs b/src/sandbox/remote.rs
index 2f5a1b7..c648843 100644
--- a/src/sandbox/remote.rs
+++ b/src/sandbox/remote.rs
@@ -22,6 +22,17 @@ impl RemoteBackend {
Ok(Self { cfg: cfg.clone(), token: token.to_string(), addr: bound.local, queue: bound.rx })
}
+ /// The address the rendezvous listener actually bound to.
+ ///
+ /// Test-tier only. Production binds through `bound_listener` and hands the
+ /// address to the agent itself, so nothing in the crate asks for it back;
+ /// `tests/remote_agent.rs` needs it to point a real agent at the socket.
+ /// It is gated rather than left public because the census believed it had
+ /// production callers at two `listener.local_addr()` calls — std's method
+ /// on a `TcpListener`, in sibling files, which a name match cannot tell
+ /// apart from this one. That confusion is what `dotted_only` confirmation
+ /// in `tools/test-surface.py` now forces a human to resolve.
+ #[cfg(feature = "test-support")]
pub fn local_addr(&self) -> &str {
&self.addr
}