test(loop-lock): tests no longer take the checkout's loop lock (v4.8.9) #54

Merged
Godopu merged 2 commits from test/loop-marker-tmp into main 2026-10-09 01:59:58 +00:00
Owner

v4.8.9 (PATCH, tests only). This explains the empty .mam/ that a review worktree was left with after the v4.8.8 sentinel run.

Cause

test_o3_scoped_guard.py's test_b13_reexec_preserves_original_argv and test_b13_no_freeze_switch_disables_reexec run the checkout's own run_loop.sh with --creator, which gets as far as mam_acquire_loop_lock. The default marker is $MAM_REAL_ROOT/.mam/loop-guard-active, and MAM_REAL_ROOT is the script's own checkout: it does not follow WORKSPACE_ROOT. The run ends at once because no such session exists. The marker is removed, but .mam/ stays behind. In the main checkout, the test takes and releases the live loop lock for a moment, so either a real loop or the test can be refused.

Fix

Both tests set MAM_LOOP_MARKER under their tmp_path. A sweep of the 16 modules that use run_loop.sh watched for a new .mam per test. It found only these two: the others already pin the marker, end before the lock (--help, argument errors), or run a copy of the tree. Tests that exercise the lock itself are unchanged.

Verification

  • New tests/test_loop_marker_isolation.py (L1). W1 in test_issue17_workspace_root_isolation.py now requires that no .mam exists at all. Both fail at 97c2946.
  • Review loop in the merge workspace, all four reviewers: round 1 4/4 PASS.
  • Full suite at a93c9bf (macOS, Python 3.9, herdr 0.9.3), run with WORKSPACE_ROOT pointing at an empty sentinel: 1752 passed / 0 failed / 38 skipped. Afterwards the sentinel was empty, the worktree had no .mam/, and the main checkout's shim was unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff

v4.8.9 (PATCH, tests only). This explains the empty `.mam/` that a review worktree was left with after the v4.8.8 sentinel run. ## Cause `test_o3_scoped_guard.py`'s `test_b13_reexec_preserves_original_argv` and `test_b13_no_freeze_switch_disables_reexec` run the checkout's own `run_loop.sh` with `--creator`, which gets as far as `mam_acquire_loop_lock`. The default marker is `$MAM_REAL_ROOT/.mam/loop-guard-active`, and `MAM_REAL_ROOT` is the script's own checkout: it does not follow `WORKSPACE_ROOT`. The run ends at once because no such session exists. The marker is removed, but `.mam/` stays behind. In the main checkout, the test takes and releases the live loop lock for a moment, so either a real loop or the test can be refused. ## Fix Both tests set `MAM_LOOP_MARKER` under their `tmp_path`. A sweep of the 16 modules that use `run_loop.sh` watched for a new `.mam` per test. It found only these two: the others already pin the marker, end before the lock (`--help`, argument errors), or run a copy of the tree. Tests that exercise the lock itself are unchanged. ## Verification - New `tests/test_loop_marker_isolation.py` (L1). W1 in `test_issue17_workspace_root_isolation.py` now requires that no `.mam` exists at all. Both fail at 97c2946. - Review loop in the merge workspace, all four reviewers: round 1 **4/4 PASS**. - Full suite at a93c9bf (macOS, Python 3.9, herdr 0.9.3), run with `WORKSPACE_ROOT` pointing at an empty sentinel: **1752 passed / 0 failed / 38 skipped**. Afterwards the sentinel was empty, the worktree had no `.mam/`, and the main checkout's shim was unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
Godopu added 2 commits 2026-10-09 01:59:50 +00:00
test_b13_reexec_preserves_original_argv and test_b13_no_freeze_switch_
disables_reexec ran the checkout's run_loop.sh with --creator, which gets
past argument parsing to mam_acquire_loop_lock on the default marker,
$MAM_REAL_ROOT/.mam/loop-guard-active with MAM_REAL_ROOT = the script's own
checkout. In the main checkout that is the live loop's lock (taken and
released for a moment: a real loop refused, or the test refused); in a review
tree it left an empty .mam. Both now set MAM_LOOP_MARKER under their tmp_path.

A sweep of the 16 modules that use run_loop.sh (a per-test watcher for a new
.mam in the checkout, an empty .mam removed before each test) found only
these two; the others pin MAM_LOOP_MARKER already, end before the lock
(--help, argument errors), or run a copy of the tree.

Tests: test_loop_marker_isolation.py L1 runs every test that reaches the lock
through the checkout's run_loop.sh in a copy of the checkout and requires no
.mam there; W1 of the Issue #17 isolation test now also requires that no .mam
exists (it only looked for files, so the empty lock directory passed it). At
97c2946 both fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCGpJXhSZasJLU38ksDghe
Merge-workspace review loop (--all-reviewer): round 1 (@a93c9bf) 4/4
PASS. Full suite at a93c9bf on macOS / Python 3.9 / herdr 0.9.3 with
WORKSPACE_ROOT set to an empty sentinel: 1752 passed / 0 failed / 38
skipped; the sentinel stayed empty, the review worktree had no .mam, and
the main checkout's shim was not touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
Godopu merged commit 42e51735ba into main 2026-10-09 01:59:58 +00:00
Author
Owner

병합했습니다 (v4.8.9). 리뷰 1회차 4/4 PASS, 센티널 WORKSPACE_ROOT 로 전체 스위트 1752 passed / 0 failed / 38 skipped — 센티널 빔, 워크트리 .mam/ 없음, 본 체크아웃 shim 불변. 병합 후 본 체크아웃 가드 테스트 통과.

병합했습니다 (v4.8.9). 리뷰 1회차 4/4 PASS, 센티널 `WORKSPACE_ROOT` 로 전체 스위트 1752 passed / 0 failed / 38 skipped — 센티널 빔, 워크트리 `.mam/` 없음, 본 체크아웃 shim 불변. 병합 후 본 체크아웃 가드 테스트 통과.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmpl/multi-agent-mux#54