diff --git a/src/signals/local-branch.ts b/src/signals/local-branch.ts index ffa32caebd..0f7c5bc0a5 100644 --- a/src/signals/local-branch.ts +++ b/src/signals/local-branch.ts @@ -26,6 +26,7 @@ import { deriveEligibilityPlan } from "../services/eligibility-plan"; import { scenarioInputFromLocalBranchMetadata } from "../scenarios/input-model"; import { renderPublicScenarioSummary, type PublicScenarioSummary, type ScenarioSummaryInput } from "../scenarios/scenario-summary"; import { simulateOpenPrPressure } from "../services/open-pr-pressure-scenarios"; +import { isTestPath } from "./test-evidence"; export type LocalBranchChangedFile = { path: string; @@ -1235,13 +1236,8 @@ function safeRepoPath(path: string): string { } export function isTestFile(file: string): boolean { - return ( - /(^|\/)(test|tests|spec|__tests__)\//i.test(file) || - /(^|\/)src\/test\//i.test(file) || - /(^|\/)[^/]+_test\.(go|py|rb)$/i.test(file) || - /(^|\/)[^/]+_spec\.rb$/i.test(file) || - /\.(test|spec)\.(ts|tsx|js|jsx|py|rb|rs)$/i.test(file) - ); + // Keep local scoring aligned with slop/test-evidence matchers (#561 / #1046). + return isTestPath(file); } export function isCodeFile(file: string): boolean { diff --git a/test/unit/local-branch-file-classifiers.test.ts b/test/unit/local-branch-file-classifiers.test.ts index 310ed41239..45c0589aa1 100644 --- a/test/unit/local-branch-file-classifiers.test.ts +++ b/test/unit/local-branch-file-classifiers.test.ts @@ -85,6 +85,10 @@ describe("isTestFile", () => { expect(isTestFile(path)).toBe(false); } }); + + it("delegates to test-evidence isTestPath so matchers stay in sync", () => { + expect(isTestFile("tests/integration/api.test.ts")).toBe(true); + }); }); describe("isCodeFile", () => {