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

Đang mở Phù hợp với người mới
#20,937 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
shell
Lĩnh vực
devtools, testing

Hướng nghiên cứu

Bắt đầu với plugins/harness-config/lib/permission-patterns.sh và kiểm tra CCPERM_P1_INTERP_ERE cùng với diff các mục kiểm tra và các bước kiểm tra P1 của permission-rule-check.sh. Thêm một bài kiểm tra dựa trên probe cho quy tắc trình thông dịch giới hạn theo đường dẫn, chẳng hạn Bash(bash tools/repo-grep.sh *), rồi xác minh rằng quá trình kiểm tra chỉ gắn cờ những mẫu bị chế độ tự động loại bỏ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
Shell
Star
22
Fork
2
Merge trung bình
3 giờ 4 phút
Pull request đã merge (30 ngày)
941

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của melodic-software/claude-code-plugins

Tất cả issue của melodic-software/claude-code-plugins

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.