fix(strict): bind the bundled stdlib and verify strict resources

- Strict child now gets the verified stdlib tree read-only at
  /run/marqdo-stdlib with MARQDO_STDLIB_DIR set, so Compat-C 打印 works under
  strict without exposing a host path (ADR-0021 update).
- Add a strict-lane negative: resource.open(file) is refused with
  permission.denied; hello/factorial/multi-module and --json still pass.
- StrictHostCommand gains stdlib_dir; CLI discovers the bundle and sandbox
  binds it; sandbox tests constructors updated.

Evidence: G-C lane PASS on the disposable Ubuntu 26.04 VM (7/7 adversarial
matrix, positive CLI, strict language-resource refusal, forged marker), plus
fmt/clippy/423 local tests.
This commit is contained in:
cflmy committed 2026-11-20 22:57:49 +08:00
1 parent 1be4662049
commit 1d87f98539
9 files changed
+65 -4

No files matched your search

+12
View File
@@ -317,6 +317,16 @@ fn run_with(
})?;
let mut args = common_args();
if let Some(stdlib) = command.stdlib_dir {
args.extend([
OsString::from("--ro-bind"),
stdlib.as_os_str().to_os_string(),
OsString::from("/run/marqdo-stdlib"),
OsString::from("--setenv"),
OsString::from("MARQDO_STDLIB_DIR"),
OsString::from("/run/marqdo-stdlib"),
]);
}
args.extend([
OsString::from("--ro-bind"),
project_root.as_os_str().to_os_string(),
@@ -548,6 +558,7 @@ mod tests {
original_document: None,
output_limit: 4096,
timeout: Duration::from_secs(1),
stdlib_dir: None,
};
let error = run_with(
&command,
@@ -585,6 +596,7 @@ mod tests {
original_document: None,
output_limit: 4096,
timeout: Duration::from_secs(1),
stdlib_dir: None,
};
let error = run_with(
&command,