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 <checkout>/.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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-10-13 11:57:46 +09:00
1 parent 42e2a7ea9b
commit 3a30d7da89
2 files changed
+5 -1

No files matched your search

+4 -1
View File
@@ -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)