From 6d1b61493038df19802e2062e0d1e3741597c0b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 30 Aug 2026 18:55:06 +0000 Subject: [PATCH] fix: the MCP fixture uses the Btrfs scratch the harness hands it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only FAILED left in a full `dev/verify.sh` on Fedora was `cargo test --workspace`, and two tests in `the_adapter_speaks_mcp.rs` were all of it: both reported «there is no Btrfs here, so no boundary can be opened» on the same run that had just PROVEN stages 58 and 59 against real Btrfs. Nothing was wrong with Thalyx. `started_with()` built its workspace with `tempfile::tempdir()`, which answers `/tmp`, and `/tmp` on Fedora is tmpfs — so `hacer` could not open a boundary there, correctly. The harness had already solved this: `verify.sh` sets `THALYX_BTRFS_SCRATCH` beside `THALYX_REQUIRE_BTRFS_TESTS=1`, after physically creating a subvolume at that path. This fixture was the one place ignoring it, so the demand turned an honest NOT PROVEN into a failure of the machine — rule 5, the instrument including the harness. Two things were needed, not one. The TempDir now goes on the scratch when the variable is set (`tempdir_in`, one per fixture, so the tests that share the scratch do not share a tree), and the workspace inside it is made as a subvolume: being *on* Btrfs is not enough, because a boundary is about the subvolume the session stands in and never looks upwards for one, so a plain directory on the scratch answers `not_a_subvolume` exactly as tmpfs does. With the variable unset the fixture is byte for byte what it was, and the subvolume create is best effort: where the scratch is not Btrfs the skip still says NOT PROVEN rather than this panicking about a machine it was never promised. `THALYX_REQUIRE_BTRFS_TESTS` is untouched and still turns that skip into a failure. --- .../tests/the_adapter_speaks_mcp.rs | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/crates/thalyx-mcp/tests/the_adapter_speaks_mcp.rs b/crates/thalyx-mcp/tests/the_adapter_speaks_mcp.rs index 78cd519..64096fb 100644 --- a/crates/thalyx-mcp/tests/the_adapter_speaks_mcp.rs +++ b/crates/thalyx-mcp/tests/the_adapter_speaks_mcp.rs @@ -54,9 +54,41 @@ fn start() -> Stack { } fn started_with(surface: &str) -> Stack { - let home = tempfile::tempdir().expect("tempdir"); + // `tempfile::tempdir()` and nothing else is what stood here, and on + // 2026-08-30 it made two tests on a machine with Btrfs report that there + // was none: `/tmp` on Fedora is tmpfs, so the workspace this hands the + // bridge could never be a subvolume, and the same run had just proven two + // stages of `dev/verify.sh` against real Btrfs. The harness already said + // where to go — it sets `THALYX_BTRFS_SCRATCH` beside + // `THALYX_REQUIRE_BTRFS_TESTS=1`, after physically making a subvolume + // there — and this fixture was the one thing ignoring it. + // + // Still a `TempDir`, and still one per fixture: the scratch holds every + // Btrfs test of the whole workspace at once, so a shared name is a test + // deleting the tree another is working in (rule 11's entry of 2026-08-29). + let scratch = std::env::var_os("THALYX_BTRFS_SCRATCH"); + let home = match &scratch { + Some(base) => tempfile::Builder::new() + .prefix("thalyx-mcp-") + .tempdir_in(base) + .expect("a temporary directory on THALYX_BTRFS_SCRATCH"), + None => tempfile::tempdir().expect("tempdir"), + }; let workspace = home.path().join("project"); let store = home.path().join("store"); + // Being *on* Btrfs is not enough: `hacer` opens its boundary on the + // subvolume the session stands in and never looks upwards for one, so a + // plain directory on the scratch answers `not_a_subvolume` exactly as tmpfs + // does. Best effort and unchecked — where the scratch turns out not to be + // Btrfs the create fails, the `create_dir_all` below makes an ordinary + // directory instead, and the `NOT PROVEN` skips say so rather than this + // panicking about a machine it was never promised. + if scratch.is_some() { + let _ = Command::new("btrfs") + .args(["subvolume", "create"]) + .arg(&workspace) + .output(); + } std::fs::create_dir_all(workspace.join("src")).expect("src"); std::fs::create_dir_all(&store).expect("store"); std::fs::write(