From 38d18906cb45d30d6cd3a5018afa00a0cbafbb11 Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Wed, 28 Oct 2026 20:25:07 +0000 Subject: [PATCH] fix(ingestion): use glob public path type Keep the parse-cache dependency ownership audit intact and strengthen the unlisted-directory control with a non-ignored path. --- gitnexus/src/core/ingestion/utils/include-dot-dirs.ts | 3 +-- gitnexus/test/unit/group/include-extractor.test.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gitnexus/src/core/ingestion/utils/include-dot-dirs.ts b/gitnexus/src/core/ingestion/utils/include-dot-dirs.ts index 0db3a38cf..21ea63361 100644 --- a/gitnexus/src/core/ingestion/utils/include-dot-dirs.ts +++ b/gitnexus/src/core/ingestion/utils/include-dot-dirs.ts @@ -1,6 +1,5 @@ import { logger } from '../../logger.js'; -import type { IgnoreLike } from 'glob'; -import type { Path } from 'path-scurry'; +import type { IgnoreLike, Path } from 'glob'; /** * Directory names that must never be indexed, even when listed. These hold diff --git a/gitnexus/test/unit/group/include-extractor.test.ts b/gitnexus/test/unit/group/include-extractor.test.ts index 528aaedfc..fdda09ae4 100644 --- a/gitnexus/test/unit/group/include-extractor.test.ts +++ b/gitnexus/test/unit/group/include-extractor.test.ts @@ -663,7 +663,7 @@ int auto_main() { return 0; }`, it('registers headers in a dot directory only when GITNEXUS_INCLUDE_DOT_DIRS lists it', async () => { const previous = process.env.GITNEXUS_INCLUDE_DOT_DIRS; writeFile('.config/listed.h', '#pragma once'); - writeFile('.cache/unlisted.h', '#pragma once'); + writeFile('.unlisted-source/unlisted.h', '#pragma once'); try { delete process.env.GITNEXUS_INCLUDE_DOT_DIRS; const before = await extractor.extract(null, tmpDir, makeRepo(tmpDir)); @@ -674,7 +674,13 @@ int auto_main() { return 0; }`, const providerIds = contracts.filter((c) => c.role === 'provider').map((p) => p.contractId); expect(providerIds).toContain('include::.config/listed.h'); - expect(providerIds).not.toContain('include::.cache/unlisted.h'); + expect(providerIds).not.toContain('include::.unlisted-source/unlisted.h'); + + process.env.GITNEXUS_INCLUDE_DOT_DIRS = '.config,.unlisted-source'; + const both = await extractor.extract(null, tmpDir, makeRepo(tmpDir)); + expect(both.filter((c) => c.role === 'provider').map((p) => p.contractId)).toContain( + 'include::.unlisted-source/unlisted.h', + ); } finally { if (previous === undefined) delete process.env.GITNEXUS_INCLUDE_DOT_DIRS; else process.env.GITNEXUS_INCLUDE_DOT_DIRS = previous;