From d6427ae4ec640ea5c353841bbeac4182a1f1030d Mon Sep 17 00:00:00 2001 From: Shay Date: Thu, 28 May 2026 07:12:19 -0700 Subject: [PATCH] fix(invariants): exclude .claude/ from architectural scan + prune stale worktrees Both INV-02/INV-21/INV-24 scan functions walked into .claude/worktrees/ and found vault recall/write callsites in the stale step-3-submission-invariants checkout, producing 3 false failures. Fix: add '.claude' to the os.walk exclusion set (INV-02) and to EXCLUDED_DIRS (INV-21/INV-24). Defensive against any future worktree that agents create under .claude/worktrees/. Also pruned 58 stale worktree git-dir entries via git worktree prune and removed the step-3-submission-invariants worktree directory. Smoke suite: 67/67 passed. --- tests/test_architectural_invariants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_architectural_invariants.py b/tests/test_architectural_invariants.py index f64ac169..01460afd 100644 --- a/tests/test_architectural_invariants.py +++ b/tests/test_architectural_invariants.py @@ -240,7 +240,7 @@ class TestINV02GateOnlyNormalization: for dirpath, dirnames, filenames in os.walk(root): dirnames[:] = [ d for d in dirnames - if d not in {".git", ".venv", "__pycache__", ".pytest_cache", ".hypothesis"} + if d not in {".git", ".venv", "__pycache__", ".pytest_cache", ".hypothesis", ".claude"} ] for fname in filenames: if not fname.endswith(".py"): @@ -649,7 +649,7 @@ PROJECT_ROOT_FOR_INV21 = Path(__file__).resolve().parent.parent EXCLUDED_DIRS: frozenset[str] = frozenset({ "tests", "evals", "benchmarks", "scripts", "docs", - "core-rs", ".venv", "__pycache__", + "core-rs", ".venv", "__pycache__", ".claude", })