harness-config: interpreter drop pattern flags path-scoped rules auto mode keeps

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

从 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
  1. Put a path-scoped interpreter rule in a project's .claude/settings.json allow list, for example Bash(bash tools/repo-grep.sh *) or Bash(bash .claude/hooks/*.test.sh *).
  2. Run the harness-config audit (audit-permission-state entry-diff, and audit-permission-grants permission-rule-check.sh P1).
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 模板
  • 阅读贡献指南

从这里开始

  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 摘要。