Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed tests/support/mcp_stub_trusted.rs,tests/support/mcp_stub_jail.rs

Steven Enamakeleb375e063465
diff --git a/tests/support/mcp_stub_jail.rs b/tests/support/mcp_stub_jail.rs
deleted file mode 100644
index 07ca2869d6..0000000000
--- a/tests/support/mcp_stub_jail.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-//! Test-only read grant for the Cargo-built `test-mcp-stub` binary.
-//!
-//! tinymcp starts every stdio server that is not `operator_trusted` inside a
-//! TinyBox jail, and the jail denies whatever it is not granted. The stub
-//! lives under `target/`, which no default grant covers, so the tests grant
-//! its directory read-only through the product's own `[runtime.local_jail]`
-//! setting. This changes nothing about the host's policy: the sandbox, the
-//! isolation floor and the protected-path floor all stay in force.
-
-#![allow(dead_code)]
-
-use std::path::Path;
-
-/// The directory holding the stub binary at `stub`.
-pub fn stub_dir(stub: &str) -> String {
- Path::new(stub)
- .parent()
- .expect("stub binary has a directory")
- .to_string_lossy()
- .into_owned()
-}
-
-/// A `config.toml` fragment granting the stub's directory, to append to a
-/// test config that has no `[runtime]` table of its own.
-pub fn local_jail_toml(stub: &str) -> String {
- format!(
- "\n[runtime.local_jail]\nextra_read_only = [{:?}]\n",
- stub_dir(stub)
- )
-}
-
-/// Grants the stub's directory on an in-memory config.
-pub fn grant_stub(config: &mut openhuman_core::config::Config, stub: &str) {
- config
- .runtime
- .local_jail
- .extra_read_only
- .push(stub_dir(stub));
-}
diff --git a/tests/support/mcp_stub_trusted.rs b/tests/support/mcp_stub_trusted.rs
new file mode 100644
index 0000000000..244a438c5c
--- /dev/null
+++ b/tests/support/mcp_stub_trusted.rs
@@ -0,0 +1,26 @@
+//! Test-only declaration of the Cargo-built `test-mcp-stub` as an
+//! operator-trusted stdio server.
+//!
+//! TEMPORARY. tinymcp starts every stdio server that is not `operator_trusted`
+//! inside a TinyBox jail and asks TinyBox for `Enforced` isolation. TinyBox's
+//! macOS Seatbelt backend only reports best-effort enforcement and its Linux
+//! Landlock backend reports no process isolation, so no jailed server can
+//! start on either platform today. Until the host can choose the enforcement
+//! level (tinyhumansai/tinymcp#126) and TinyBox has a Linux backend with real
+//! process isolation, the e2e tests declare the stub in the operator-owned
+//! `config.toml` (`[[mcp_client.servers]]`, `operator_trusted = true`), which
+//! tinymcp starts as an ordinary child process.
+//!
+//! Registry-installed servers (`mcp.json`, the registry RPCs) are never
+//! operator-trusted, so tests of that path cannot use this helper; they are
+//! `#[ignore]`d with the same two references until the jail can start them.
+
+#![allow(dead_code)]
+
+/// A `config.toml` fragment declaring the stub as an operator-trusted stdio
+/// server called `name`, to append to a test config.
+pub fn trusted_stub_toml(name: &str, stub: &str) -> String {
+ format!(
+ "\n[[mcp_client.servers]]\nname = {name:?}\ncommand = {stub:?}\noperator_trusted = true\n"
+ )
+}