@@ -28,7 +28,7 @@ source "$DSO_PLUGIN_DIR/hooks/lib/deps.sh"
2828# delete the production reviewer-findings.json — the root cause of the
2929# "reviewer-findings.json not found" bug that blocked the commit workflow.
3030ARTIFACTS_DIR=$( mktemp -d " ${TMPDIR:-/ tmp} /test-record-review-crossval-XXXXXX" )
31- export WORKFLOW_PLUGIN_ARTIFACTS_DIR=" $ARTIFACTS_DIR "
31+ export WORKFLOW_PLUGIN_ARTIFACTS_DIR=" $ARTIFACTS_DIR " # isolation-ok: test overrides hook artifact dir
3232FINDINGS_FILE=" $ARTIFACTS_DIR /reviewer-findings.json"
3333
3434PASS=0
@@ -40,38 +40,18 @@ RED='\033[0;31m'
4040GREEN=' \033[0;32m'
4141NC=' \033[0m' # No Color
4242
43- # Create a temp untracked file in the repo so findings files always overlap with
44- # the git diff regardless of the worktree's current state. The file is cleaned up on exit.
45- # NOTE: Do NOT use a .tmp extension — *.tmp is gitignored and won't appear in
46- # git ls-files --others, breaking the overlap check in record-review.sh.
47- #
48- # Clean up any stale sentinels from previous killed runs (e.g., timeout exit 144 where
49- # the EXIT trap did not fire). This prevents accumulation of untracked files that
50- # cause diff hash instability in the review gate.
51- # Only remove sentinels whose owner PID is no longer running — do NOT use a blind glob,
52- # which would remove other *concurrent* instances' sentinels and break their overlap checks.
53- for _stale in " $REPO_ROOT " /.crossval-test-sentinel-* .marker; do
54- [[ -f " $_stale " ]] || continue
55- _stale_pid=" ${_stale% .marker} "
56- _stale_pid=" ${_stale_pid##* -} "
57- if ! kill -0 " $_stale_pid " 2> /dev/null; then
58- rm -f " $_stale "
59- fi
60- done
61- SENTINEL_FILE=" $REPO_ROOT /.crossval-test-sentinel-$$ .marker"
62- touch " $SENTINEL_FILE "
63- SENTINEL_BASENAME=$( basename " $SENTINEL_FILE " )
43+ # Use a synthetic filename for the overlap check instead of writing to the repo.
44+ # record-review.sh accepts RECORD_REVIEW_CHANGED_FILES to inject changed files
45+ # without creating untracked files in the working tree.
46+ SENTINEL_BASENAME=" test-overlap-target.sh"
47+ export RECORD_REVIEW_CHANGED_FILES=" $SENTINEL_BASENAME " # isolation-ok: test injects overlap target without writing to repo
6448
6549cleanup () {
6650 rm -f " $FINDINGS_FILE "
67- # Re-create sentinel after cleanup so it stays present for overlap checks.
68- # The EXIT trap (cleanup_all) removes it finally at script exit.
69- touch " $SENTINEL_FILE "
7051}
7152
7253cleanup_all () {
7354 rm -rf " $ARTIFACTS_DIR "
74- rm -f " $SENTINEL_FILE "
7555}
7656trap cleanup_all EXIT
7757
0 commit comments