summaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
authordev <dev@example.com>2026-11-21 19:29:41 +0000
committerdev <dev@example.com>2026-11-21 19:29:41 +0000
commitbb1d533515c8f63faacb00b3ef59232cf2d4a1c5 (patch)
tree94da9ecc261f28f12ac6e74b29b27f3aef4b1e77 /src/sandbox
parent0f18ebddc1c138c531e3e331786c7fa917d9186f (diff)
downloadaur-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 'src/sandbox')
-rw-r--r--src/sandbox/kata.rs6
-rw-r--r--src/sandbox/loopback.rs2
-rw-r--r--src/sandbox/mod.rs4
-rw-r--r--src/sandbox/wire.rs2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/sandbox/kata.rs b/src/sandbox/kata.rs
index a54110a..cfc3bd6 100644
--- a/src/sandbox/kata.rs
+++ b/src/sandbox/kata.rs
@@ -40,7 +40,7 @@ pub trait Provisioner: Send + Sync {
/// TTL even if the hub dies. The token rides in args for v1; a production
/// deployment should mount it from a Secret, and this comment is the honest
/// place that says so.
-pub(crate) fn sandbox_cr(req: &ProvisionRequest) -> serde_json::Value {
+fn sandbox_cr(req: &ProvisionRequest) -> serde_json::Value {
serde_json::json!({
"apiVersion": "agents.x-k8s.io/v1alpha1",
"kind": "Sandbox",
@@ -75,7 +75,7 @@ pub(crate) fn sandbox_cr(req: &ProvisionRequest) -> serde_json::Value {
}
impl K8sSandboxProvisioner {
- pub(crate) fn for_config(cfg: &Config) -> Option<Self> {
+ fn for_config(cfg: &Config) -> Option<Self> {
match &cfg.sandbox {
crate::config::Sandbox::AgentSandbox { api, namespace, bearer, .. } => Some(Self {
api: api.clone(),
@@ -87,7 +87,7 @@ impl K8sSandboxProvisioner {
}
}
-pub(crate) struct K8sSandboxProvisioner {
+struct K8sSandboxProvisioner {
pub api: String,
pub bearer: String,
pub namespace: String,
diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs
index fb5ba00..64875c6 100644
--- a/src/sandbox/loopback.rs
+++ b/src/sandbox/loopback.rs
@@ -57,7 +57,7 @@ impl SandboxBackend for LoopbackBackend {
}
}
-pub(crate) struct LoopbackSandbox {
+struct LoopbackSandbox {
id: String,
blobs: PathBuf,
cfg: Config,
diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs
index b82647b..bb6ab60 100644
--- a/src/sandbox/mod.rs
+++ b/src/sandbox/mod.rs
@@ -123,12 +123,12 @@ pub fn backend_for(cfg: &Config) -> Result<Arc<dyn SandboxBackend>> {
}
#[derive(Clone)]
-pub(crate) struct Bound {
+struct Bound {
pub local: String,
pub rx: Receiver<TcpStream>,
}
-pub(crate) fn bound_listener(addr: &str, token: &str) -> Result<Bound> {
+fn bound_listener(addr: &str, token: &str) -> Result<Bound> {
static REGISTRY: OnceLock<Mutex<HashMap<(String, String), Bound>>> = OnceLock::new();
let registry = REGISTRY.get_or_init(|| Mutex::new(HashMap::new()));
let key = (addr.to_string(), token.to_string());
diff --git a/src/sandbox/wire.rs b/src/sandbox/wire.rs
index ae89d6d..4ae1ec0 100644
--- a/src/sandbox/wire.rs
+++ b/src/sandbox/wire.rs
@@ -2,7 +2,7 @@ use std::io::{self, BufRead, Write};
use serde::{Deserialize, Serialize};
-pub(crate) const MAX_FRAME_BYTES: u32 = 2 * 1024 * 1024 * 1024;
+const MAX_FRAME_BYTES: u32 = 2 * 1024 * 1024 * 1024;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "t", rename_all = "snake_case")]