* fix(mcp): honor includeTests for C#, Java, Swift and PHP test paths
Test-file classification had two hand-maintained implementations that had drifted:
core/ingestion/entry-point-scoring.ts isTestFile — excludes tests from
process entry points
mcp/local/local-backend.ts isTestFilePath — backs `includeTests`
on impact/trace/context
The MCP copy recognized no C#, Java or Swift test convention and neither PHP
form, so `includeTests: false` silently failed to filter them — a C# project's
`*.Tests/` and a Maven project's `src/test/` landed in blast-radius output as
though they were production callers. The scoring copy missed `/fixtures/` and
`/conftest.`, so those could be selected as process entry points.
Both now delegate to one predicate carrying the union of the two pattern sets.
Public names are unchanged, so importers are unaffected.
The duplication was not gratuitous: `entry-point-scoring.ts` imports the
language-provider registry, and #2802 deliberately cut that closure out of MCP
server startup — importing it from `local-backend.ts` would put it back. The
shared predicate therefore lives in its own module with NO imports, and a test
asserts it declares none, so the startup cost cannot be reintroduced by a future
import added there.
19 new tests: the previously-missed paths per language, nullish and
Windows-separator handling, production paths that must NOT match, and a
cross-check that both public names agree on every case — the regression guard for
the drift itself.
Behavior-neutral on a Python/Go/TypeScript repository (204,336 nodes / 299,580
edges / 813 flows before and after), since the newly-recognized patterns are
languages it does not contain. `npx tsc --noEmit` clean; 728 tests pass across
the entry-point, process, impact and test-file suites.
* Address PR review feedback (#2866)
Tighten the shared test-path predicate so includeTests filtering no longer
treats Contest.swift/Latest.php as tests, unanchored uitests/ as a substring,
or production /fixtures/ trees as test code.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Simplify the shared test-path matcher
Drop substring needles already covered by /test/, /tests/, and /spec/,
and inline the one-off slash-prefix helper.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address PR review feedback (#2866)
Correct the module header: scoring already matched /test/, so
/test/fixtures/ was never the scoring gap — only /conftest. was.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address PR review feedback (#2866)
Classify Xcode *UITests path segments without restoring the
unanchored uitests/ substring that also matches fruitests.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Carter LaSalle <carterlasalle@gmail.com>
Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>