Repository navigation
fix(explore): tests and examples the engine knows stay out of explore's answer - #2557
Merged
Merged
Conversation
…'s answer codegraph_explore's low-value check (the hard filter, the rank penalty and the comparator key) and the dominant-file, route-file and routing-manifest filter in db/queries.ts each kept a regex list of their own. They missed every test convention isTestFile learned since: C++ `foo_test.cc` and `FooTest.cpp`, Google's `foo_unittest.cc`, LLVM's `unittests/`, `testing/`, `e2e/`, `__mocks__/`, Gradle `foo-test/` modules, Kotlin source sets, and the examples, samples, fixtures and benchmarks that explore's gather already dampens through isTestFile. Both now build on isTestFile, keeping icons/i18n (explore) and generated files (queries), plus the singular `__test__/` the old lists matched. Dropping their lowercase suffix patterns also ends false positives such as `Latest.java` and `contest.cs`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 14, 2026
bompus
added a commit
to bompus/codegraph
that referenced
this pull request
Oct 14, 2026
…est (#500) isTestPath matched /__tests__/ only below another directory, so __tests__/foo.ts was taken for production code while src/__tests__/foo.ts was not. After upstream colbymchenry#2557 moved the dominant-file and explore filters onto isTestFile, the old start-of-path match for __tests__/ was lost.
danusha2345
pushed a commit
to danusha2345/codegraph
that referenced
this pull request
Oct 15, 2026
…t JSX by import, sync through barrels, colbymchenry#2557 explore) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
codegraph_exploredecides which files are low value (tests, plus icons and i18n) to drop them before the score floor, halve their rank, and break ties against them.db/queries.tslikewise keeps tests and generated files out of the dominant-file, top-route-file and routing-manifest candidates. Both kept a regex list of their own, written before the engine'sisTestFilelearned most of what it knows. They missed:foo_test.ccandFooTest.cpp;foo_unittest.cc(fix(c,cpp): a file named like a Google unittest, foo_unittest.cc, is a test #2434);unittests/trees (fix(c,cpp): a file in a unittests/ or foo_unittest/ folder is a test #2484);testing/,e2e/,__mocks__/, Gradlefoo-test/modules and KotlinjvmTest/source sets;On LLVM-style and Google-style C++ repos, a unit test that calls the code an agent asked about took a file slot in explore's answer.
Both now build on
isTestFile, the same reading explore's gather already dampens scores by (×0.3 and a 15% node cap in the context builder). They keep their own extras:__test__/folder the old lists matched andisTestFiledoesn't.The old lowercase suffix patterns go, along with their false positives:
Latest.java,Contest.swiftandcontest.csread as tests.Follow-up from #2484's chip.
Validation: deterministic explore A/B (base main 1753472 vs this change)
codegraph_exploreon the same indexes (the change is query-time only). Each repo got the README suite's flow question or an agent-style one, plus three symbol-bag queries.clang-tools-extra/clangdandlldb/{include,source,unittests,tools}.tokio-test/src/task.rs)src/logging_unittest.cc)DescriptorPool BuildFile FindMessageTypeByNamehad rendereddescriptor_unittest.cc,code_generator_unittest.ccandinternal_feature_helper_test.cc. Those slots now go to the PHP, C# and RubyDescriptorPoolimplementations.TextFormat Printer Printtradedexamples/ListPeople.javaforDescriptors.java. clangd tradedunittests/SymbolCollectorTests.cppforindex/Ref.h. Every other change only dropped a test file, or moved bytes between the same files.Agent A/B not run. A nested
claude -pon this machine fails with "OAuth session expired and could not be refreshed", the same blocker #2447 hit. Re-logging the CLI is the maintainer's call. The deterministic A/B above is the evidence for now; the change only removes files the gather already scores at 0.3× from the answer, and backfills from production files.Tests
__tests__/explore-low-value-tests.test.ts(new):Parser parseExpression parseStatement Lexer nextTokenfromsrc/parser.ccwithout rendering an LLVM-styleunittests/Parse/ParserHarness.h, aparser_unittest.ccor aParserTest.cpp;getTopRouteFile()names the app'ssrc/routes.js, not ane2e/mock-server.jswith more routes.Both fail on main: explore rendered
unittests/Parse/ParserHarness.h, and the route file wase2e/mock-server.js. The 40 explore, context and route-related test files pass (475 tests).Full suite on Windows: 6,663 passed. 6 failed in the parallel run (daemon-pid-reuse, git-index-currency, mcp-daemon), and all three files pass when rerun serially (35/35); the notes on this box list them as load-sensitive. The 404 skipped are the native-kernel suites, which skip because no kernel was built in this worktree; this change doesn't touch extraction.
🤖 Generated with Claude Code