Resolve Windows .cmd and .bat shims in the harness-config audit's server-command check

未关闭 适合新手
#20,960 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
shell
领域
tooling

调研方向

阅读 plugins/harness-config/skills/audit/scripts/audit-engine.sh 中裸命令分支,以及 audit-engine.test.sh 中相关的检查;lib/prerequisites.mjs 将 #19808 引为先例。添加测试,模拟 Windows 主机和 .cmd shim,然后验证审计会为它报告 command-resolves,并且在没有主机能解析该命令时仍报告 command-missing:<server>。

由索引模型根据 Issue 内容生成。

描述

Context

Item 1 of #20519, split out because #20933 closes #20519 with changes for items 2-5 (item 2 still had three open review regressions at filing) and none for this item. The harness-config audit's C/server-command check resolves a stdio MCP server's bare command with command -v "$cmd" (plugins/harness-config/skills/audit/scripts/audit-engine.sh, the bare-command branch). Git Bash does not resolve .cmd or .bat shims through command -v, so a server launched through a shim (for example dnx, which where.exe resolves to dnx.cmd) is reported command-missing though it starts.

Proposed work

  • In the bare-command branch, on a Windows host ($OSTYPE msys or cygwin), also try command -v "$cmd.cmd", "$cmd.bat" and "$cmd.exe" (or where.exe) before reporting command-missing. Precedent: #19808 made lib/prerequisites.mjs probe the same way.
  • Keep the Linux and macOS paths unchanged.

Acceptance criteria

  • On a Windows host, a stdio MCP server whose command resolves only as <name>.cmd on PATH yields command-resolves, covered by a test in audit-engine.test.sh that fakes the shim and the host type.
  • A bare command that resolves on no host still yields command-missing:<server>.

Refs: #20519, #20933

🤖 Generated with Claude Code

主要语言
Shell
星标
22
派生
2
平均合并
3 小时 4 分钟
30 天内合并 PR
941

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

melodic-software/claude-code-plugins 的其他 Issue

查看 melodic-software/claude-code-plugins 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。