Skip to content

Commit 073a743

Browse files
committed
fix: 同步上游两处纯代码修复(Windows hook 分发 + find-polluter 路径匹配)
对齐上游 v6.1.1 -> v6.2.0 时挑出的两处「无需翻译、无需 eval」的修复。 两个文件在我们这边都与上游 v6.1.1 字节一致(从未汉化改动),所以可直接取上游版。 1) hooks/hooks.json 加 "shell": "bash"(上游 5151e7a) SessionStart hook 在 Windows 上原先不经 Git Bash 分发。我们的 hooks.json 与上游 除这一行外完全相同。这条直接改善 Windows 用户的 bootstrap 可靠性 —— 而 bootstrap 不加载 skill 就是死重。 冒烟测试:CLAUDE_PLUGIN_ROOT 指向仓库跑 run-hook.cmd session-start, 退出码 0,输出正确的 SessionStart JSON(含中文 using-superpowers 正文)。 2) skills/systematic-debugging/find-polluter.sh 取上游修复版(上游 6015d37、c8921b5) 修三个真 bug,已逐个实测新旧版对比: - pattern 带 ./ 前缀时匹配不到(find . 输出 ./ 前缀路径):旧 1 个 -> 新 2 个 - -path 的 **/ 无法匹配零层目录,src/**/*.test.ts 漏掉 src/top.test.ts: 旧 1 个 -> 新 2 个 - 完全无匹配时计数为 1 而非 0(echo 空串仍算一行):旧 1 -> 新 0 验证:audit.sh 153 pass / 0 fail、verify-release.sh 82 pass / 0 fail。 注:audit 的上游漂移 warn 从 2 条变 3 条(新增 using-git-worktrees), 且 executing-plans / finishing-a-development-branch 的上游 H 值有变化 —— 这是本次 git fetch upstream 把对比基准从旧快照更新到 v6.2.0 导致的, 不是本提交的改动引起。三个 SKILL.md 本提交都没碰。漂移详情见 #19
1 parent 1321cc6 commit 073a743

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

hooks/hooks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{
88
"type": "command",
99
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
10+
"shell": "bash",
1011
"async": false
1112
}
1213
]

skills/systematic-debugging/find-polluter.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@ echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
1818
echo "Test pattern: $TEST_PATTERN"
1919
echo ""
2020

21-
# Get list of test files
22-
TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
23-
TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
21+
# Get list of test files (find . emits ./-prefixed paths, so accept the
22+
# pattern written with or without a leading ./)
23+
TEST_PATTERN="${TEST_PATTERN#./}"
24+
# find -path can't match '**/' against zero directory levels, so a pattern
25+
# like src/**/*.test.ts would skip src/top.test.ts; also try the pattern
26+
# with '**/' collapsed to cover files directly under the base directory.
27+
TEST_FILES=$(find . \( -path "./$TEST_PATTERN" -o -path "./${TEST_PATTERN//\*\*\//}" \) | sort -u)
28+
if [ -z "$TEST_FILES" ]; then
29+
TOTAL=0
30+
else
31+
TOTAL=$(printf '%s\n' "$TEST_FILES" | wc -l | tr -d ' ')
32+
fi
2433

2534
echo "Found $TOTAL test files"
2635
echo ""

0 commit comments

Comments
 (0)