summaryrefslogtreecommitdiffstats
path: root/src/sandbox/loopback.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 17:33:17 +0000
committeraur-build <aur-build@localhost>2026-11-19 17:33:17 +0000
commit4304b0f336ddba7b4ec6780795059ff2066d105b (patch)
tree10edea744a1c2bf3fc363b4dc7f64abac8b1a0d3 /src/sandbox/loopback.rs
parente757979f1a2afdbe7146066345bb9acd19d3b151 (diff)
downloadaur-build-4304b0f336ddba7b4ec6780795059ff2066d105b.tar.gz
aur-build-4304b0f336ddba7b4ec6780795059ff2066d105b.zip
comments: keep only what the code cannot show
Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound.
Diffstat (limited to 'src/sandbox/loopback.rs')
-rw-r--r--src/sandbox/loopback.rs14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs
index 8a3c229..1173562 100644
--- a/src/sandbox/loopback.rs
+++ b/src/sandbox/loopback.rs
@@ -19,9 +19,6 @@ impl LoopbackBackend {
impl SandboxBackend for LoopbackBackend {
fn acquire(&self, spec: &SandboxSpec) -> Result<Arc<dyn Sandbox>> {
- // The "pool" is this machine: acquire always succeeds, instantly, and
- // the TTL is a promise the loopback sandbox does not have to keep
- // because there is nothing to leak — the process dies with the hub.
let blobs = blob_root(&self.cfg).join(safe_name(&spec.task));
fs::create_dir_all(&blobs)?;
Ok(Arc::new(LoopbackSandbox {
@@ -55,9 +52,6 @@ impl Sandbox for LoopbackSandbox {
if cmd.argv.is_empty() {
return Err(Error::invalid("sandbox command has no argv[0]"));
}
- // Expand `blob:<digest>` argv elements to the staged blob's path —
- // the loopback sandbox's blob dir is "inside the sandbox" as much as
- // anything here is. An unstaged blob is a caller bug and fails closed.
let mut argv: Vec<String> = Vec::with_capacity(cmd.argv.len());
for a in &cmd.argv {
match a.strip_prefix("blob:") {
@@ -79,8 +73,6 @@ impl Sandbox for LoopbackSandbox {
if let Some(dir) = &cmd.cwd {
c.current_dir(dir);
}
- // The shim protocol lives here, not in the steps: a step that cannot
- // tell loopback from a remote sandbox is the property under test.
self.cfg.child_env(&mut c);
let out = c.output()?;
on_log(&out.stdout);
@@ -101,16 +93,11 @@ impl Sandbox for LoopbackSandbox {
}
fn destroy(&self) -> Result<()> {
- // Nothing to reclaim: the sandbox is this process. Blob scratch is
- // disposable staging and falls to `gc` like the rest of `staging/`.
Ok(())
}
}
impl LoopbackSandbox {
- /// Digests double as blob filenames, so they must be path-safe. The digests
- /// this codebase produces are hex or `hex-sig`; anything else is a caller
- /// bug (or, later, a hostile sandbox) and fails closed.
fn blob_path(&self, digest: &str) -> Result<PathBuf> {
if digest.is_empty() || digest.len() > 128 {
return Err(Error::invalid(format!("blob digest {digest:?} is not usable")));
@@ -126,7 +113,6 @@ fn blob_root(cfg: &Config) -> PathBuf {
cfg.staging_dir().join("blobs")
}
-/// Filesystem-safe name for a task id, same spirit as `config::slug`.
fn safe_name(s: &str) -> String {
s.chars()
.map(|c| if c.is_ascii_alphanumeric() { c.to_ascii_lowercase() } else { '-' })