You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(engine): scope Ruby test globs to spec/ and test/ directories (#80)
`**/*_spec.rb` and `**/*_test.rb` sat in both config.Default().Ignore and
.TestGlobs, matching on the basename alone. Any production file ending in
the token `_test` or `_spec` -- an A/B-test job, a load-test harness -- was
excluded from indexing AND routed to reference-only test-ref extraction, so
the class it declared never became a symbol fact. The failure was silent and
asymmetric: enola removed a right fact rather than adding a wrong one, so no
downstream finding looked suspicious, and dead-code, impact and performance
analysis were all quietly wrong for that file.
A file is now a Ruby test iff its basename ends `_spec.rb`/`_test.rb` AND
some directory segment is exactly `spec` or `test`. No filename-only rule
works: `foo_test.rb` (a test) and `ab_test.rb` (production) both end in the
token `test`. Ruby settles it by convention -- RSpec requires spec/,
Minitest defaults to test/.
Expressing that needed a pattern form the matcher lacked, so matchAnyGlob
gained `<prefix>/**/<fileglob>` via matchDirScopedGlob. It fires only on a
literal "/**/" in the pattern, which no shipped pattern contains, so
existing globs are untouched. isIgnored was a token-identical copy of
matchAnyGlob and now delegates to it -- one matcher is what keeps Ignore and
TestGlobs from disagreeing about a file, which is the drift that caused this
bug. Both lists change together: narrowing one alone leaves the file either
still ignored or still misrouted.
Go and TypeScript keep their filename patterns; those languages genuinely
co-locate tests. The bundled mcp-arch.yaml and examples/*.yaml ignore blocks
are updated in step, since a YAML `ignore:` replaces the default wholesale
and none of them declares `test_globs:`.
cacheVersion v96 -> v97: the file set reaching the extractor changes, so
cached snapshots must re-extract.
97: {"TestMatchAnyGlob_MidPatternDoublestar", "TestGolden"}, // Directory-scoped Ruby test globs: production *_ab_test.rb no longer deleted from the graph
0 commit comments