fix(decision): match label history against config labels case-insensitively#2580
Conversation
…tively buildContributorDecisionPack built its label-history Set straight from registeredRepoActivity.dominantLabels (raw GitHub casing) and looked up config labels with a raw `.has(label)`. The opportunity engine (signals/engine.ts) lowercases both sides, and this file's own languageSet is already case-insensitive, so labels were the local outlier: a mixed-case dominant label (e.g. "Good first issue") never overlapped a differently-cased config label (e.g. "good first issue"), silently dropping it from the decision-pack label-overlap copy. Lowercase both the built Set and the config-key lookup so label overlap is case-insensitive, matching the engine and the languageSet handling. Adds a regression test covering a mixed-case dominant label end-to-end and a mixed-case config key on the lookup side. No issue because issue creation is restricted on this repo; this aligns a duplicated case-insensitive-label-overlap concept with its canonical sibling, no schema or API change.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 11:03:42 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 1 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2580 +/- ##
==========================================
- Coverage 95.98% 95.98% -0.01%
==========================================
Files 229 229
Lines 25814 25810 -4
Branches 9391 9388 -3
==========================================
- Hits 24778 24774 -4
Misses 425 425
Partials 611 611
🚀 New features to boost your workflow:
|
Summary
buildContributorDecisionPackbuilt its label-historySetstraight fromregisteredRepoActivity.dominantLabels(raw GitHub casing) and looked up config labels with a raw.has(label):The canonical sibling — the opportunity engine — lowercases both sides (
src/signals/engine.ts:1385buildsnew Set(dominantLabels.map((l) => l.toLowerCase())), queriedlabelHistory.has(label.toLowerCase())), and this same function'slanguageSetis already case-insensitive (:618build +:772toLowerCase()lookup). Labels were the local outlier: a mixed-case dominant label (e.g."Good first issue") never overlapped a differently-cased config label (e.g."good first issue"), so it was silently dropped from the decision-pack's user-facing label-overlap copy ("Label overlap with your history: …", "target labels: …").Fix: lowercase both the built Set and the config-key lookup, so label overlap is case-insensitive — matching the engine and the
languageSethandling.No issue because issue creation is restricted on this repo for outside accounts; this aligns a duplicated case-insensitive-label-overlap concept with its canonical sibling.
Scope
Validation
git diff --checknpm run typechecknpm run test:coverage(scoped:test/unit/decision-pack.test.ts— 45 pass; both changed lines and their branches are exercised by the added mixed-case regression plus the existing empty/absent cases)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=moderateIf any required check was skipped, explain why:
src/services/decision-pack.ts.typecheckclean;decision-pack.test.tspasses (45), including the added regression that pins case-insensitive label overlap end-to-end (mixed-case dominant label) and on the lookup side (mixed-case config key). I did not run the full UI/workers/MCP steps (unrelated to this diff), and the local Windows tree has pre-existing unrelated failures (CRLF, missing CLI binaries, Node 24 vs pinned 22). CI runs the full matrix on a clean checkout.Safety
Notes
signals/engine.ts) already lowercases label history for its opportunitylabelFit; this brings the decision-pack path to the same case-insensitive behavior, so the two surfaces agree.