harness-config: interpreter drop pattern flags path-scoped rules auto mode keeps
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 plugins/harness-config/lib/permission-patterns.sh 开始,检查 CCPERM_P1_INTERP_ERE,并对照审计条目差异和 permission-rule-check.sh 中的 P1 检查。为路径限定的解释器规则(例如 Bash(bash tools/repo-grep.sh *))添加一个由探测支持的测试,然后验证审计只标记自动模式会丢弃的模式。
由索引模型根据 Issue 内容生成。
描述
Steps to reproduce
- Put a path-scoped interpreter rule in a project's
.claude/settings.jsonallow list, for exampleBash(bash tools/repo-grep.sh *)orBash(bash .claude/hooks/*.test.sh *). - Run the harness-config audit (
audit-permission-stateentry-diff, andaudit-permission-grantspermission-rule-check.shP1).
Expected behavior
The audit reports only rules auto mode drops. The docs list "Wildcarded interpreters like Bash(python*)" (permission modes, read 2026-12-03), a wildcard that reaches arbitrary code, not an interpreter fixed to one script path.
Actual behavior
CCPERM_P1_INTERP_ERE in plugins/harness-config/lib/permission-patterns.sh:12 matches an interpreter name followed by any text and then any *, so it flags every rule of the form Bash(bash <path> *). On melodic-software/medley#2533 it flagged 6 entry-diff rows and 3 P1 rows as dropped on entry to auto mode.
A live probe disproved the 6 entry-diff rows: Claude Code 2.1.335, claude --debug-file <scratch> --permission-mode auto -p "Reply with exactly: OK" in a medley worktree. The log confirmed mode=auto, all six rules loaded into projectSettings, and its one Ignoring dangerous permission ... (bypasses classifier) line named a different, user-scope rule (melodic-software/medley#2543 body). The audit's recommended fix, rewriting to bare-script form, would stop those rules matching the bash <script> calls the repository makes.
Severity
Medium
Severity justification
False positives recommend a rewrite that breaks working grants; one repository's owner-decision list carried 9 such rows.
Suggested fix location
plugins/harness-config/lib/permission-patterns.sh (CCPERM_P1_INTERP_ERE), with a probe-backed test case for a path-scoped interpreter rule.
Environment
Claude Code 2.1.335; harness-config 7.3.5 (audit run hc31-20261202T212912Z).
- 主要语言
- Shell
- 星标
- 22
- 派生
- 2
- 平均合并
- 3 小时 4 分钟
- 30 天内合并 PR
- 941
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
melodic-software/claude-code-plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
melodic-software/claude-code-plugins#21021 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
melodic-software/claude-code-plugins#20969 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
melodic-software/claude-code-plugins#20960 · 5 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
melodic-software/claude-code-plugins#20942 · 5 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
melodic-software/claude-code-plugins#20905 · 2 条评论 ·
维护者通常 1 天内回复
查看 melodic-software/claude-code-plugins 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
buildkite/elastic-ci-stack-for-aws#2050 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
ChurchCRM/docs.churchcrm.io#350 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
boyingliu01/xp-gate#906 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 63/100
rancher/stackstate-product-docs#516 ·
维护者通常 1 天内回复