Skip to content

Commit eff65cf

Browse files
committed
fix: use per-command matching for expected-patterns check
Addresses Cursor Bugbot feedback — expected-patterns was matching against the concatenated joined string, which could match across command boundaries. Now uses allCommands.some() consistent with anti-patterns check.
1 parent acdbc4c commit eff65cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/skill-eval/helpers/judge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function evaluateDeterministic(
2626
plan: AgentPlan
2727
): CriterionResult {
2828
const allCommands = plan.commands.map((c) => c.command.toLowerCase());
29-
const joined = allCommands.join(" ");
3029

3130
// Check anti-patterns: none of these strings should appear in any command
3231
if (def["anti-patterns"]) {
@@ -47,7 +46,8 @@ function evaluateDeterministic(
4746
// Check expected patterns: at least one command must contain each pattern
4847
if (def["expected-patterns"]) {
4948
for (const pattern of def["expected-patterns"]) {
50-
if (!joined.includes(pattern.toLowerCase())) {
49+
const lowerPattern = pattern.toLowerCase();
50+
if (!allCommands.some((cmd) => cmd.includes(lowerPattern))) {
5151
return {
5252
name,
5353
pass: false,

0 commit comments

Comments
 (0)