fix(performance): match complexity-share registry globs per path segment, not with fnmatch
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #7080 来自 @kyle-sexton —— 已合并
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Shell
- 星标
- 22
- 派生
- 2
- 平均合并
- 8 小时 27 分钟
- 30 天内合并 PR
- 957
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
melodic-software/claude-code-plugins 的其他 Issue
-
priority: medium
难度 2/5 1-3 小时 新手友好度 68/100
melodic-software/claude-code-plugins#7351 · 2 条评论 ·
维护者通常 1 天内回复
-
agent-ready priority: high work-class: scoped
难度 2/5 1-3 小时 新手友好度 74/100
melodic-software/claude-code-plugins#7312 · 3 条评论 ·
维护者通常 1 天内回复
-
priority: medium
难度 2/5 1-3 小时 新手友好度 76/100
melodic-software/claude-code-plugins#7288 · 2 条评论 ·
维护者通常 1 天内回复
-
knowledge: docpage-digest dual verification defines no verdict vocabulary or pass/fail threshold未关闭needs-human
难度 2/5 1-3 小时 新手友好度 78/100
melodic-software/claude-code-plugins#7286 · 2 条评论 ·
维护者通常 1 天内回复
-
priority: low
难度 2/5 1-3 小时 新手友好度 76/100
melodic-software/claude-code-plugins#7282 · 2 条评论 ·
维护者通常 1 天内回复
查看 melodic-software/claude-code-plugins 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ajeetdsouza/zoxide#1323 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 72/100
redhat-developer/rhdh-plugin-export-overlays#4391 · 1 条评论 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 72/100
graygarbage/HermesKey#20 ·
-
Version-drift constraint evaluator (#40): validate the candidate version and run its unit test in CI未关闭
难度 2/5 1-3 小时 新手友好度 78/100
n8n-io/terraform-google-n8n#41 ·
维护者通常 5 天内回复