Skip to content

Commit 0b18264

Browse files
committed
fix: accept joined-token alias evidence in AI game fallback gate
Alias evidence now allows multi-token aliases to match when words are joined in issue text (e.g. counterstrike vs counter strike), while keeping exact token checks for single-word aliases.
1 parent d19a66c commit 0b18264

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/labeler.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,17 @@ jobs:
192192
if (label !== targetLabel) continue;
193193
if (alias.length < 3) continue;
194194
if (paddedText.includes(` ${alias} `)) return true;
195+
196+
// Allow obvious joined-word variants for multi-token aliases
197+
// (e.g., "counter strike 1 6" matching "counterstrike 1.6").
198+
const aliasTokens = alias.split(/\s+/).filter(Boolean);
199+
if (aliasTokens.length > 1) {
200+
const escapedTokens = aliasTokens.map((token) =>
201+
token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
202+
);
203+
const flexibleAliasPattern = new RegExp(`\\b${escapedTokens.join('\\s*')}\\b`);
204+
if (flexibleAliasPattern.test(normalizedText)) return true;
205+
}
195206
}
196207
197208
return false;
@@ -1009,6 +1020,17 @@ jobs:
10091020
if (label !== targetLabel) continue;
10101021
if (alias.length < 3) continue;
10111022
if (paddedText.includes(` ${alias} `)) return true;
1023+
1024+
// Allow obvious joined-word variants for multi-token aliases
1025+
// (e.g., "counter strike 1 6" matching "counterstrike 1.6").
1026+
const aliasTokens = alias.split(/\s+/).filter(Boolean);
1027+
if (aliasTokens.length > 1) {
1028+
const escapedTokens = aliasTokens.map((token) =>
1029+
token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
1030+
);
1031+
const flexibleAliasPattern = new RegExp(`\\b${escapedTokens.join('\\s*')}\\b`);
1032+
if (flexibleAliasPattern.test(normalizedText)) return true;
1033+
}
10121034
}
10131035
10141036
return false;

0 commit comments

Comments
 (0)