From 9a4ece5d50783f7530642af54b387f7a2e2d12aa Mon Sep 17 00:00:00 2001 From: Berk Date: Wed, 18 Mar 2026 14:38:58 +0300 Subject: [PATCH 1/4] fix: mapping all supported languages to callRouters to fix undefined apply error (#352) --- gitnexus-web/src/config/supported-languages.ts | 1 + gitnexus-web/src/core/ingestion/call-processor.ts | 2 +- gitnexus-web/src/core/ingestion/call-routing.ts | 1 + gitnexus/src/core/ingestion/call-routing.ts | 2 ++ gitnexus/src/core/ingestion/workers/parse-worker.ts | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gitnexus-web/src/config/supported-languages.ts b/gitnexus-web/src/config/supported-languages.ts index 9282f16ed1..4c51b56abc 100644 --- a/gitnexus-web/src/config/supported-languages.ts +++ b/gitnexus-web/src/config/supported-languages.ts @@ -10,5 +10,6 @@ export enum SupportedLanguages { Rust = 'rust', PHP = 'php', Ruby = 'ruby', + Kotlin = 'kotlin', Swift = 'swift', } \ No newline at end of file diff --git a/gitnexus-web/src/core/ingestion/call-processor.ts b/gitnexus-web/src/core/ingestion/call-processor.ts index c3c17452f2..b2e30862fc 100644 --- a/gitnexus-web/src/core/ingestion/call-processor.ts +++ b/gitnexus-web/src/core/ingestion/call-processor.ts @@ -228,7 +228,7 @@ export const processCalls = async ( continue; } - const callRouter = callRouters[language]; + const callRouter = callRouters[language] || (() => null); // 3. Process each call match matches.forEach(match => { diff --git a/gitnexus-web/src/core/ingestion/call-routing.ts b/gitnexus-web/src/core/ingestion/call-routing.ts index 96a9d54fd8..f5032c4fb1 100644 --- a/gitnexus-web/src/core/ingestion/call-routing.ts +++ b/gitnexus-web/src/core/ingestion/call-routing.ts @@ -40,6 +40,7 @@ export const callRouters: Record = { [SupportedLanguages.CPlusPlus]: noRouting, [SupportedLanguages.C]: noRouting, [SupportedLanguages.Ruby]: routeRubyCall, + [SupportedLanguages.Kotlin]: noRouting, }; // ── Result types ──────────────────────────────────────────────────────────── diff --git a/gitnexus/src/core/ingestion/call-routing.ts b/gitnexus/src/core/ingestion/call-routing.ts index 50a91d29bb..bff1d5f417 100644 --- a/gitnexus/src/core/ingestion/call-routing.ts +++ b/gitnexus/src/core/ingestion/call-routing.ts @@ -41,6 +41,8 @@ export const callRouters: Record = { [SupportedLanguages.CPlusPlus]: noRouting, [SupportedLanguages.C]: noRouting, [SupportedLanguages.Ruby]: routeRubyCall, + [SupportedLanguages.Kotlin]: noRouting, + [SupportedLanguages.Swift]: noRouting, }; // ── Result types ──────────────────────────────────────────────────────────── diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index 0c90d8cd86..ce5f6c082b 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -875,7 +875,7 @@ const processFileGroup = ( // Build per-file type environment + constructor bindings in a single AST walk. // Constructor bindings are verified against the SymbolTable in processCallsFromExtracted. const typeEnv = buildTypeEnv(tree, language); - const callRouter = callRouters[language]; + const callRouter = callRouters[language] || (() => null); if (typeEnv.constructorBindings.length > 0) { result.constructorBindings.push({ filePath: file.path, bindings: [...typeEnv.constructorBindings] }); From fbf3f24a3026c3c50f2f1ff2059cc106680a1073 Mon Sep 17 00:00:00 2001 From: Berk Date: Wed, 18 Mar 2026 16:10:55 +0300 Subject: [PATCH 2/4] fix(cli): remove duplicate Swift/Kotlin keys in callRouters causing TS1117 --- gitnexus/src/core/ingestion/call-routing.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/gitnexus/src/core/ingestion/call-routing.ts b/gitnexus/src/core/ingestion/call-routing.ts index bff1d5f417..50a91d29bb 100644 --- a/gitnexus/src/core/ingestion/call-routing.ts +++ b/gitnexus/src/core/ingestion/call-routing.ts @@ -41,8 +41,6 @@ export const callRouters: Record = { [SupportedLanguages.CPlusPlus]: noRouting, [SupportedLanguages.C]: noRouting, [SupportedLanguages.Ruby]: routeRubyCall, - [SupportedLanguages.Kotlin]: noRouting, - [SupportedLanguages.Swift]: noRouting, }; // ── Result types ──────────────────────────────────────────────────────────── From 7165d0f35365e55ca36eb5af914104544a2b4087 Mon Sep 17 00:00:00 2001 From: Berk Date: Wed, 18 Mar 2026 17:17:04 +0300 Subject: [PATCH 3/4] refactor: remove runtime callRouter fallbacks, rely on Record compile-time enforcement --- gitnexus-web/src/core/ingestion/call-processor.ts | 2 +- gitnexus/src/core/ingestion/workers/parse-worker.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitnexus-web/src/core/ingestion/call-processor.ts b/gitnexus-web/src/core/ingestion/call-processor.ts index b2e30862fc..c3c17452f2 100644 --- a/gitnexus-web/src/core/ingestion/call-processor.ts +++ b/gitnexus-web/src/core/ingestion/call-processor.ts @@ -228,7 +228,7 @@ export const processCalls = async ( continue; } - const callRouter = callRouters[language] || (() => null); + const callRouter = callRouters[language]; // 3. Process each call match matches.forEach(match => { diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index ce5f6c082b..0c90d8cd86 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -875,7 +875,7 @@ const processFileGroup = ( // Build per-file type environment + constructor bindings in a single AST walk. // Constructor bindings are verified against the SymbolTable in processCallsFromExtracted. const typeEnv = buildTypeEnv(tree, language); - const callRouter = callRouters[language] || (() => null); + const callRouter = callRouters[language]; if (typeEnv.constructorBindings.length > 0) { result.constructorBindings.push({ filePath: file.path, bindings: [...typeEnv.constructorBindings] }); From 8c35cd38c9af38a136ca17e59a00feddb827ed6f Mon Sep 17 00:00:00 2001 From: Berk Date: Wed, 18 Mar 2026 17:35:01 +0300 Subject: [PATCH 4/4] refactor: use 'satisfies' keyword for callRouters compile-time enforcement --- gitnexus-web/src/core/ingestion/call-routing.ts | 4 ++-- gitnexus/src/core/ingestion/call-routing.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gitnexus-web/src/core/ingestion/call-routing.ts b/gitnexus-web/src/core/ingestion/call-routing.ts index f5032c4fb1..5a112aca15 100644 --- a/gitnexus-web/src/core/ingestion/call-routing.ts +++ b/gitnexus-web/src/core/ingestion/call-routing.ts @@ -27,7 +27,7 @@ export type CallRouter = ( const noRouting: CallRouter = () => null; /** Per-language call routing. noRouting = no special routing (normal call processing) */ -export const callRouters: Record = { +export const callRouters = { [SupportedLanguages.JavaScript]: noRouting, [SupportedLanguages.TypeScript]: noRouting, [SupportedLanguages.Python]: noRouting, @@ -41,7 +41,7 @@ export const callRouters: Record = { [SupportedLanguages.C]: noRouting, [SupportedLanguages.Ruby]: routeRubyCall, [SupportedLanguages.Kotlin]: noRouting, -}; +} satisfies Record; // ── Result types ──────────────────────────────────────────────────────────── diff --git a/gitnexus/src/core/ingestion/call-routing.ts b/gitnexus/src/core/ingestion/call-routing.ts index 50a91d29bb..8916d2a114 100644 --- a/gitnexus/src/core/ingestion/call-routing.ts +++ b/gitnexus/src/core/ingestion/call-routing.ts @@ -27,7 +27,7 @@ export type CallRouter = ( const noRouting: CallRouter = () => null; /** Per-language call routing. noRouting = no special routing (normal call processing) */ -export const callRouters: Record = { +export const callRouters = { [SupportedLanguages.JavaScript]: noRouting, [SupportedLanguages.TypeScript]: noRouting, [SupportedLanguages.Python]: noRouting, @@ -41,7 +41,7 @@ export const callRouters: Record = { [SupportedLanguages.CPlusPlus]: noRouting, [SupportedLanguages.C]: noRouting, [SupportedLanguages.Ruby]: routeRubyCall, -}; +} satisfies Record; // ── Result types ────────────────────────────────────────────────────────────