fix(performance): match complexity-share registry globs per path segment, not with fnmatch
Maintainer antworten meist innerhalb von 1 Tag
Ein zugehöriger Pull Request wurde bereits gemerged.
- #7080 von @kyle-sexton — gemerged
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Shell
- Sterne
- 22
- Forks
- 2
- Ø Merge
- 8 Std. 24 Min.
- Gemergte PRs (30 T.)
- 947
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus melodic-software/claude-code-plugins
-
needs-human needs-triage priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
melodic-software/claude-code-plugins#7455 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
melodic-software/claude-code-plugins#7351 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent-ready priority: high work-class: scoped
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
melodic-software/claude-code-plugins#7312 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
melodic-software/claude-code-plugins#7288 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
knowledge: docpage-digest dual verification defines no verdict vocabulary or pass/fail thresholdOffenneeds-human
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
melodic-software/claude-code-plugins#7286 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in melodic-software/claude-code-plugins
Ähnliche Issues
-
bug needs-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
mattpocock/skills#1281 ·
Maintainer antworten meist innerhalb von 1 Tag
-
github_actions
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
hiero-ledger/hiero-consensus-node#27621 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Broken app label: JamoviOffenapplication-issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Installomator/Installomator#3427 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
software-mansion/argent#1483 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Broken links in the docsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100