fix(performance): match complexity-share registry globs per path segment, not with fnmatch
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #7080 của @kyle-sexton — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start with registry_key and the fnmatchcase call in scripts/js-complexity-share.py (around lines 72-74), which exist only on the PR #6806 branch, not main. Compare them with the pathglob matcher in plugins/code-metrics/skills/audit-duplication/scripts/registry-filter.py. Done means a member glob like plugins/*/hooks/x.js no longer matches nested paths, both tools agree on the same registry file, and a test covers a nested path that must not match.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
scripts/js-complexity-share.py, added by PR #6806 (not yet on main; the evidence below is pinned to that branch), matches registry cluster members with fnmatch.fnmatchcase. In fnmatch, * matches any characters including /, so a member glob such as plugins/*/hooks/x.js also matches nested paths, and a registry line can sanction more files than it names. The sibling registry reader in the code-metrics plugin uses the gitignore-style pathglob matcher, where * does not cross /.
Failure scenario
Expected: a cluster member glob matches the same set of files here as it does in registry-filter.py, so both tools agree on what counts as a sanctioned copy.
Actual: a member glob with * matches deeper paths here. Files that the registry does not intend to sanction collapse into the cluster and are counted once, which lowers the measured share and loosens the ratchet. The two tools can also disagree on the same registry file.
Evidence
Pinned to the head of PR #6806, branch js-complexity-share-ratchet, commit 108b03fb37d24ca04ea8d6d5d1527b0a596f8531:
registry_keyand thefnmatchcasecall: https://github.com/melodic-software/claude-code-plugins/blob/108b03fb37d24ca04ea8d6d5d1527b0a596f8531/scripts/js-complexity-share.py#L72-L74- Registry format described as a "member glob": https://github.com/melodic-software/claude-code-plugins/blob/108b03fb37d24ca04ea8d6d5d1527b0a596f8531/scripts/js-complexity-share.py#L21-L23
- The sibling matcher (
pathglob, gitignore-style): https://github.com/melodic-software/claude-code-plugins/blob/108b03fb37d24ca04ea8d6d5d1527b0a596f8531/plugins/code-metrics/skills/audit-duplication/scripts/registry-filter.py#L23-L24 registry_keyandfnmatchdo not exist underscripts/or.performance/onorigin/main(7787be41e98e30cd6e3b82e99494886d77e30895).
Suggested fix
Reuse pathglob.matches from the code-metrics plugin, or implement segment-aware matching, so * stops at / and ** is explicit. Add a test with a member glob and a nested path that must not match.
Related
- PR #6806
🤖 Generated with Claude Code
- Ngôn ngữ chính
- Shell
- Star
- 22
- Fork
- 2
- Merge trung bình
- 8 giờ 41 phút
- Pull request đã merge (30 ngày)
- 892
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của melodic-software/claude-code-plugins
-
good first issue needs-human priority: low work-class: mechanical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
melodic-software/claude-code-plugins#8023 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-human work-class: mechanical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
melodic-software/claude-code-plugins#8021 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-human work-class: scoped
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
melodic-software/claude-code-plugins#8018 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(planning): point the interview surface context at the surface README instead of restating itĐang mởneeds-human work-class: mechanical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
melodic-software/claude-code-plugins#8015 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-human work-class: mechanical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
melodic-software/claude-code-plugins#8004 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của melodic-software/claude-code-plugins
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
good first issue packaging
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Let's document: tailscale funnelĐang mởhelp wanted let's document new command
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
tldr-pages/tldr#24773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày