From b5e9531d5b565202fa724039ab6d1c09cdf33079 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 21 Jan 2026 01:24:19 +0000 Subject: [PATCH 1/2] Document parallel vs serial execution for manual tests Clarify that "should NOT fire" tests can run in parallel since they complete rule requirements, while "should fire" tests must run serially to avoid cross-contamination from shared git state. --- manual_tests/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/manual_tests/README.md b/manual_tests/README.md index 42569421..13520a94 100644 --- a/manual_tests/README.md +++ b/manual_tests/README.md @@ -12,6 +12,24 @@ This approach works because: 2. The Stop hook evaluates rules when the sub-agent completes 3. Using a fast model keeps test iterations quick and cheap +### Parallel vs Serial Execution + +**Important:** All sub-agents share the same git working directory. This affects which tests can run in parallel. + +**"Should NOT fire" tests CAN run in parallel:** +- These tests edit both trigger AND safety files (completing the rule requirements) +- Even though `git status` shows changes from all sub-agents, each rule only matches its own scoped file patterns +- Since the safety file is edited, the rule won't fire regardless of other changes +- No cross-contamination possible + +**"Should fire" tests MUST run serially with git reverts between each:** +- These tests deliberately edit only the trigger file (not the safety) +- If multiple run in parallel, sub-agent A's hook will see changes from sub-agent B +- This causes cross-contamination: A gets blocked by rules triggered by B's changes +- Run one at a time, reverting between each test + +### Verification Commands + After each sub-agent returns, run the hook to verify: ```bash echo '{}' | python -m deepwork.hooks.rules_check From bb3ee8e227e650d76ef848b45a40c52dca19b4e6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 21 Jan 2026 01:36:08 +0000 Subject: [PATCH 2/2] Add revert reminder after parallel 'should NOT fire' tests --- manual_tests/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/manual_tests/README.md b/manual_tests/README.md index 13520a94..f3ab985b 100644 --- a/manual_tests/README.md +++ b/manual_tests/README.md @@ -21,6 +21,7 @@ This approach works because: - Even though `git status` shows changes from all sub-agents, each rule only matches its own scoped file patterns - Since the safety file is edited, the rule won't fire regardless of other changes - No cross-contamination possible +- **Revert all changes after these tests complete** before running "should fire" tests **"Should fire" tests MUST run serially with git reverts between each:** - These tests deliberately edit only the trigger file (not the safety)