test(testing): build test-scan suite payloads without MSYS path conversion
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bash, git, shell
调研方向
从 plugins/testing/hooks/test-scan.test.sh 开始:为每个 jq --arg 路径构建器(payload()、bash_payload()、diff_of(),以及约第 516、522、548、607 行的内联调用)按次调用加上前缀 MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*',与 PR #6356 相同,不要 export 这些变量。保持 297a19f13bd5fbd8 session-key oracle 不变。在带原生 jq 的 Windows Git Bash 上运行 bash plugins/testing/hooks/test-scan.test.sh;所列 assertion 上仍失败的 .file/.repo 不匹配视为后续跟进。
由索引模型根据 Issue 内容生成。
描述
Summary
On Windows Git Bash with a native jq.exe, plugins/testing/hooks/test-scan.test.sh builds its hook payloads by passing POSIX paths to jq through --arg, and MSYS rewrites those arguments to Windows form. The hook then hashes a converted transcript_path against an unconverted CLAUDE_PROJECT_DIR, so the project-key checks cannot match their literal. This is the same fixture defect #6266 fixed for the test-judge suites; PR #6356 added the per-call MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' prefix there but did not touch test-scan.test.sh, which carries no such prefix anywhere.
This is a test-fixture defect. Live sessions are unaffected for the reasons #6266 gives: Claude Code supplies drive-letter paths, which MSYS leaves alone.
plugins/testing/skills/audit/scripts/cant-fail-scan.test.sh was checked and is not affected: its only jq call (:1734) reads a file operand, where conversion is wanted. A full local run on Windows Git Bash passed 1195 of 1195.
Steps to reproduce
- On Windows Git Bash where
jqresolves to a native Windows binary, runbash plugins/testing/hooks/test-scan.test.sh. - Look at the
pkey:checks.
Not run this pass (see Evidence); the failure is derived from the code.
Expected
The pkey: checks pass, as they do on Linux: the record lands under sessions/297a19f13bd5fbd8/.
Actual (derived)
payload() passes TPATH=/nonexistent/transcripts/-proj/a.jsonl through --arg tp. MSYS converts it to a path under the Git install root (for example C:/Program Files/Git/nonexistent/transcripts/-proj/a.jsonl), while CLAUDE_PROJECT_DIR=/nonexistent/proj reaches the hook unconverted through the environment. testing::pkey hashes the mixed pair, so the key is not 297a19f13bd5fbd8 and the checks at :437, :439, :441 and :446 fail. :446 also passes PCWD=$P through --arg c, which is converted too.
Evidence (file:line, origin/main 9680bdaa1)
plugins/testing/hooks/test-scan.test.sh:135-141:payload()runsjq -cn --arg t ... --arg f "$2" ... --arg tp "$TPATH" --arg c "$PCWD"with no MSYS prefix.test-scan.test.sh:434-446:P=/nonexistent/proj,TP=/nonexistent/transcripts/-proj;CLAUDE_PROJECT_DIR=$Pis set as an environment prefix (not converted),TPATHandPCWDgo throughpayload()(converted). Assertions expect/sessions/297a19f13bd5fbd8/.plugins/testing/hooks/test-scan.sh:55-63reads.cwdand.transcript_pathraw from the payload, and:90callstesting::pkey "${CLAUDE_PROJECT_DIR:-$pcwd}" "$tpath".plugins/testing/hooks/scanner-run.sh:37-44:testing::pkeyhashes$1and the directory of$2with no path-form normalization.- Other
--argpath builders in the same file with no prefix:bash_payload():474(--arg tp,--arg c),diff_of():481(--arg f), and inline builders at:516,:522,:548,:607. - Likely second failure, inferred:
:378-379asserts.file == "$REPO/src/mixed.test.ts" and .repo == "$REPO"with$REPOundermktemp -d(a/c/...or/tmp/...path). The recorded.filecomes from the converted payload path, and.repofrom the git toplevel, which Git for Windows reports inC:/...form. The per-call prefix alone may not fix this one, becausetest-scan.sh:94itself passes--arg file "$FILE"to native jq; PR #6356's Related section names the same hook-side follow-up for the judge hooks. - Precedent for the fix: PR #6356 (
judge-test-helpers.sh,test-judge.test.sh,test-judge-start.test.sh), andlib/hook-utils.test.sh:393-399. - Not run: this suite was not executed on Windows this pass, so no failure count is measured. The mechanism rests on the code above and on the native
jq.exeestablished in #6266.
Suggested fix
Prefix each jq call in test-scan.test.sh that passes a filesystem path through --arg into a payload (payload(), bash_payload(), diff_of(), and the inline builders at :516, :522, :548, :607) with MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*', per call, as PR #6356 did. Do not export either variable; the node exec-bash.mjs calls at :159 and :503 need conversion. Leave the 297a19f13bd5fbd8 literal as the independent oracle. Then run the suite on Windows Git Bash and handle any remaining .file/.repo path-form mismatches at :378-379, :544 and :610 separately.
Related: #6266, PR #6356, #6135.
- 主要语言
- Shell
- 星标
- 22
- 派生
- 2
- 平均合并
- 3 小时 42 分钟
- 30 天内合并 PR
- 938
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
melodic-software/claude-code-plugins 的其他 Issue
-
evals: run-validity calls runs VALID when every Bash call failed to start the sandbox (long TMPDIR)未关闭priority: medium status: needs-decision work-class: scoped
难度 2/5 1-3 小时 新手友好度 72/100
melodic-software/claude-code-plugins#9611 · 2 条评论 ·
维护者通常 1 天内回复
-
fix(pr-pipeline): apply-verdict readFields reads a malformed field-values answer as no fields set未关闭priority: low status: confirmed
难度 2/5 1-3 小时 新手友好度 83/100
melodic-software/claude-code-plugins#9598 · 1 条评论 ·
维护者通常 1 天内回复
-
priority: medium status: needs-decision work-class: scoped
难度 2/5 1-3 小时 新手友好度 72/100
melodic-software/claude-code-plugins#9578 · 2 条评论 ·
维护者通常 1 天内回复
-
needs-human priority: medium status: ready work-class: scoped
难度 2/5 1-3 小时 新手友好度 78/100
melodic-software/claude-code-plugins#9547 · 2 条评论 ·
维护者通常 1 天内回复
-
needs-human status: needs-decision
难度 2/5 1-3 小时 新手友好度 82/100
melodic-software/claude-code-plugins#9520 · 1 条评论 ·
维护者通常 1 天内回复
查看 melodic-software/claude-code-plugins 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Leonxlnx/taste-skill#164 ·
维护者通常 1 天内回复
-
patch: moving an executable script removes its executable bit可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭reproduced
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#58651 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
使用脚本 DD 腾讯云 报错未关闭
难度 2/5 1-3 小时 新手友好度 82/100