fix(signals): match configured label globs in config quality and label audit (#1769)#1774
Conversation
…l audit (JSONbored#1769) Configured labelMultipliers keys are resolved by scoring as case-insensitive fnmatch globs (selectLabelMultiplier / labelPatternToRegExp in src/scoring/preview.ts), but buildConfigQuality and buildLabelAudit compared them as literal strings. A wildcard key such as `type:*` never appears verbatim on a real issue/PR, so every glob-configured repo was mis-audited: keys reported as not-observed/missing, never marked configured, docking the config-quality score and emitting spurious trusted_labels_missing / configured_labels_unused findings. Export labelMatchesPattern from the scoring matcher and use it in both signals surfaces so configured keys are matched as the globs they are. Literal keys keep exact-match behavior, so non-glob configs are unaffected.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-06-29 22:37:48 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Fixes #1769.
The signals layer audited a repo's configured
labelMultiplierskeys by comparing them as literal strings, but scoring resolves those same keys as case-insensitive fnmatch globs (selectLabelMultiplier/labelPatternToRegExpinsrc/scoring/preview.ts, which documents the upstreamfnmatch(label.lower(), pattern.lower())semantics). A wildcard key such astype:*never appears verbatim on a real issue/PR, so every glob-configured repo was mis-audited.src/scoring/preview.ts: export a smalllabelMatchesPattern(label, pattern)built on the existinglabelPatternToRegExp, so the one matcher is shared rather than duplicated.src/signals/engine.ts:buildConfigQuality—notObservedConfiguredLabelsnow treats a configured key as observed when it matches any cached label as a glob (no more spuriousconfigured_labels_not_observedand score dock).buildLabelAudit—configuredandmissingConfiguredLabelsnow match live/observed labels against the configured glob keys (no more spurioustrusted_labels_missing/configured_labels_unused, andtrustedPipelineReadyresolves correctly).Literal keys (no glob metacharacter) keep exact-match behavior, so non-glob configs are byte-identical.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally; both branches of every changed predicate are exercised by a new regression test intest/unit/signals-coverage.test.ts(glob key observed/missing/configured, literal key, and an unmatched label).npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate(found 0 vulnerabilities)If any required check was skipped, explain why:
npm run test:cigate was run locally and is green.Safety
UI Evidencesection. (N/A — no visible UI change.)Notes