Problem
block-noncanonical-commit.test.sh (and any guard suite whose hook consults ambient repo state) is sensitive to the state of the ENCLOSING repository: the hook's sequencer_in_progress exemption resolves git rev-parse --absolute-git-dir from the process cwd, so running the suite inside a worktree with an in-progress merge (MERGE_HEAD present) silently flips all 26 "blocked" fixtures to allowed — 37/63 instead of 63/63 — with no hint the environment caused it.
Repro
In a worktree of this repo: git merge <anything> to the conflicted state (do not commit), then run bash plugins/guardrails/hooks/block-noncanonical-commit.test.sh → 26 failures. Commit or abort the merge → 63/63. Observed live 2026-07-22 while restacking PR #903's branch; cost ~20 min of misdiagnosis toward the PR's own changes.
Fix direction
The suite already isolates git config (GIT_CONFIG_GLOBAL=/dev/null); extend the same doctrine to repo state — run fixtures from a mktemp -d cwd (or an initialized scratch repo when a fixture needs one) so the hook's repo-state probes never see the developer's checkout. Audit sibling guard suites for the same leak.
Classification
Test-infrastructure isolation gap; no guard behavior defect (the sequencer exemption behaved as designed). Fail-safe direction (spurious FAILURES, never spurious passes) — deferrable per the direction test.
Problem
block-noncanonical-commit.test.sh(and any guard suite whose hook consults ambient repo state) is sensitive to the state of the ENCLOSING repository: the hook'ssequencer_in_progressexemption resolvesgit rev-parse --absolute-git-dirfrom the process cwd, so running the suite inside a worktree with an in-progress merge (MERGE_HEAD present) silently flips all 26 "blocked" fixtures to allowed — 37/63 instead of 63/63 — with no hint the environment caused it.Repro
In a worktree of this repo:
git merge <anything>to the conflicted state (do not commit), then runbash plugins/guardrails/hooks/block-noncanonical-commit.test.sh→ 26 failures. Commit or abort the merge → 63/63. Observed live 2026-07-22 while restacking PR #903's branch; cost ~20 min of misdiagnosis toward the PR's own changes.Fix direction
The suite already isolates git config (
GIT_CONFIG_GLOBAL=/dev/null); extend the same doctrine to repo state — run fixtures from amktemp -dcwd (or an initialized scratch repo when a fixture needs one) so the hook's repo-state probes never see the developer's checkout. Audit sibling guard suites for the same leak.Classification
Test-infrastructure isolation gap; no guard behavior defect (the sequencer exemption behaved as designed). Fail-safe direction (spurious FAILURES, never spurious passes) — deferrable per the direction test.