diff --git a/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts b/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts index b3312d4e8..6cd9a3d78 100644 --- a/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts +++ b/gitnexus/src/core/ingestion/scope-resolution/contract/scope-resolver.ts @@ -346,25 +346,6 @@ export interface ScopeResolver { */ loadResolutionConfig?(repoPath: string): Promise | unknown; - /** - * Optional one-shot loader for cross-file import-resolution config - * (e.g. tsconfig path aliases for TypeScript, go.mod paths for Go, - * composer.json autoload for PHP). The orchestrator calls this once - * per workspace pass with the repo root and threads the result into - * every subsequent `resolveImportTarget` call as the - * `resolutionConfig` parameter. - * - * Languages that don't need any per-workspace config leave this - * undefined; the orchestrator threads `undefined` to - * `resolveImportTarget` in that case. Returning `null` is also - * supported and equivalent to "no config available". - * - * May be sync or async — the orchestrator awaits the result. The - * shape is opaque to the orchestrator (`unknown`); the per-language - * `resolveImportTarget` casts it to the language's expected shape. - */ - loadResolutionConfig?(repoPath: string): Promise | unknown; - /** * Per-scope binding-merge precedence. The shared finalize pass * collects bindings from multiple sources (local declarations, diff --git a/gitnexus/src/server/validation.ts b/gitnexus/src/server/validation.ts index 54bf73d4f..83fa6922a 100644 --- a/gitnexus/src/server/validation.ts +++ b/gitnexus/src/server/validation.ts @@ -19,7 +19,7 @@ */ import path from 'node:path'; -import rateLimit, { type RateLimitRequestHandler } from 'express-rate-limit'; +import rateLimit, { ipKeyGenerator, type RateLimitRequestHandler } from 'express-rate-limit'; import type { Request } from 'express'; /** @@ -151,7 +151,7 @@ export function createRouteLimiter(opts?: RouteLimiterOverrides): RateLimitReque standardHeaders: 'draft-7', legacyHeaders: false, passOnStoreError: true, - keyGenerator: (req: Request) => req.ip ?? req.socket?.remoteAddress ?? 'unknown', + keyGenerator: (req: Request) => ipKeyGenerator(req.ip ?? req.socket?.remoteAddress ?? ''), message: { error: 'Too many requests, please try again later.' }, ...opts, });