From 6790e1ac0fc134360cda6544befc1af2e29b9605 Mon Sep 17 00:00:00 2001 From: Hubert Tarnacki Date: Wed, 9 Sep 2026 22:44:19 +0200 Subject: [PATCH] fix(discover): retain external source directories in fast mode `external` was listed in FAST_SKIP_DIRS, so fast and moderate discovery silently dropped every directory named `external`. In many codebases that name holds first-party code (external-facing APIs, adapters, integration layers) rather than vendored third-party sources, and the dedicated `vendor` / `third_party` / `3rdparty` entries already cover the vendored case. Remove `external` from the fast skip list so those sources are indexed in every mode. The shortened list is regrouped with category comments in the same style as ALWAYS_SKIP_DIRS; element order is unchanged. Signed-off-by: Hubert Tarnacki --- src/discover/discover.c | 24 +++++++++++++++++------- tests/test_discover.c | 7 +++++++ 2 files changed, 24 insertions(+), 7 deletions(-) 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);