From 3a30d7da894cdac26b7ec054b4e66fe9fa3dc8db Mon Sep 17 00:00:00 2001 From: Godopu Date: Tue, 13 Oct 2026 11:57:46 +0900 Subject: [PATCH] fix(tests): u1e gives the wrapper its own WORKSPACE_ROOT - it wrote the checkout's .mam/shim/herdr test_u1e_a_dry_run_record_is_not_an_open_job (PR #56) ran the delegate-job wrapper without WORKSPACE_ROOT; the wrapper sources lib.sh, which then defaults it to the checkout and rewrites /.mam/shim/herdr (found by review 38a64423). The node joins W1's list, which runs its nodes in a copy of the checkout and fails on any .mam written there. A scan of the #50/#55 and leak modules from a clean worktree found no other writer. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff --- tests/test_issue17_workspace_root_isolation.py | 1 + tests/test_issue50_dispatch.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_issue17_workspace_root_isolation.py b/tests/test_issue17_workspace_root_isolation.py index fa2913f..f710855 100644 --- a/tests/test_issue17_workspace_root_isolation.py +++ b/tests/test_issue17_workspace_root_isolation.py @@ -40,6 +40,7 @@ NODES = [ "tests/test_issue17_item4_decisions.py::test_c_cmd_wait", "tests/test_o2_race_free_lock.py::test_o2_12_run_loop_exits_on_lock_failure", "tests/test_o1_rebuttal.py::test_v3_rebut_option_parsing_and_budget", + "tests/test_issue50_dispatch.py::test_u1e_a_dry_run_record_is_not_an_open_job", ] diff --git a/tests/test_issue50_dispatch.py b/tests/test_issue50_dispatch.py index 12e9d03..ae35548 100644 --- a/tests/test_issue50_dispatch.py +++ b/tests/test_issue50_dispatch.py @@ -164,7 +164,10 @@ def test_u1e_a_dry_run_record_is_not_an_open_job(tmp_path): dispatches; it stays pending (Issue #34 shows it as an open job), but the admission must not wait for it.""" reg = tmp_path / "jobs" - env = dict(os.environ, HOME=str(tmp_path), MAM_ENV_FILE=str(tmp_path / ".mam.env.absent")) + # WORKSPACE_ROOT: the wrapper sources lib.sh, which otherwise writes the + # checkout's own .mam/shim/herdr (Issue #17 follow-up; W1 runs this node) + env = dict(os.environ, HOME=str(tmp_path), MAM_ENV_FILE=str(tmp_path / ".mam.env.absent"), + WORKSPACE_ROOT=str(tmp_path)) res = subprocess.run(["bash", str(WRAPPER), "submit", "--agent", "human", "--agent-session", "herdr:s", "--dry-run", "--registry-dir", str(reg), "--prompt", "preview only"], capture_output=True, text=True, env=env, cwd=str(tmp_path), timeout=120)