Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

fix(discover): retain external source directories in fast mode

Hubert Tarnacki80f8bda5670c
diff --git a/src/discover/discover.c b/src/discover/discover.c
index 5cadaed75..e42efa117 100644
--- a/src/discover/discover.c
+++ b/src/discover/discover.c
@@ -52,13 +52,23 @@ static const char *ALWAYS_SKIP_DIRS[] = {
".codebase-memory", ".qdrant_code_embeddings", ".tmp", "vendor", "vendored", NULL};
static const char *FAST_SKIP_DIRS[] = {
- "generated", "gen", "auto-generated", "fixtures", "testdata", "test_data",
- "__tests__", "__mocks__", "__snapshots__", "__fixtures__", "__test__", "docs",
- "doc", "documentation", "examples", "example", "samples", "sample",
- "assets", "static", "public", "media", "third_party", "thirdparty",
- "3rdparty", "external", "migrations", "seeds", "e2e", "integration",
- "locale", "locales", "i18n", "l10n", "scripts", "tools",
- "hack", "bin", "build", "out", NULL};
+ /* Generated */
+ "generated", "gen", "auto-generated",
+ /* Tests */
+ "fixtures", "testdata", "test_data", "__tests__", "__mocks__", "__snapshots__", "__fixtures__",
+ "__test__",
+ /* Docs and samples */
+ "docs", "doc", "documentation", "examples", "example", "samples", "sample",
+ /* Assets */
+ "assets", "static", "public", "media",
+ /* Third-party */
+ "third_party", "thirdparty", "3rdparty",
+ /* Data and integration tests */
+ "migrations", "seeds", "e2e", "integration",
+ /* Localization */
+ "locale", "locales", "i18n", "l10n",
+ /* Tooling and build output */
+ "scripts", "tools", "hack", "bin", "build", "out", NULL};
/* ── Ignored suffixes ───────────────────────────────── */
diff --git a/tests/test_discover.c b/tests/test_discover.c
index 0f3dac7d2..d44e82bf3 100644
--- a/tests/test_discover.c
+++ b/tests/test_discover.c
@@ -153,6 +153,12 @@ TEST(skip_fast_e2e) {
ASSERT_TRUE(cbm_should_skip_dir("e2e", CBM_MODE_FAST));
PASS();
}
+TEST(no_skip_fast_external) {
+ ASSERT_FALSE(cbm_should_skip_dir("external", CBM_MODE_FAST));
+ ASSERT_FALSE(cbm_should_skip_dir("external", CBM_MODE_MODERATE));
+ ASSERT_FALSE(cbm_should_skip_dir("shop-external-api", CBM_MODE_FAST));
+ PASS();
+}
/* ── Suffix filters ────────────────────────────────────────────── */
@@ -1867,6 +1873,7 @@ SUITE(discover) {
RUN_TEST(skip_fast_assets);
RUN_TEST(skip_fast_3rdparty);
RUN_TEST(skip_fast_e2e);
+ RUN_TEST(no_skip_fast_external);
/* Suffix filters */
RUN_TEST(suffix_pyc);