gitnexus 1.6.6-rc.25 → 1.6.6-rc.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,4 +18,5 @@ export declare class HttpRouteExtractor implements ContractExtractor {
18
18
  private extractConsumersGraph;
19
19
  private extractConsumersSourceScan;
20
20
  private dedupeContracts;
21
+ private mergeGraphAndSourceContracts;
21
22
  }
@@ -15,12 +15,14 @@ import { getPluginForFile, HTTP_SCAN_GLOB } from './http-patterns/index.js';
15
15
  * the preferred path because the graph has richer symbol metadata
16
16
  * (real uids, class/method structure, etc.).
17
17
  *
18
- * 2. **Source-scan fallback (Strategy B)** — parse files directly with
19
- * the per-language plugin registry in `./http-patterns/`. Used when
20
- * the graph has no routes/fetches for this repo (e.g. a repo that
21
- * hasn't been indexed yet, or whose indexer doesn't know the
22
- * framework). Each plugin owns its tree-sitter grammar and query
23
- * sources this orchestrator imports NO grammars or query strings.
18
+ * 2. **Source-scan supplement (Strategy B)** — parse files directly with
19
+ * the per-language plugin registry in `./http-patterns/`. Used to
20
+ * fill gaps when graph extraction only covers part of a polyglot repo
21
+ * (e.g. Java graph routes plus Go source-scan routes). Graph entries
22
+ * remain authoritative for duplicate contract IDs because they carry
23
+ * richer symbol metadata. Each plugin owns its tree-sitter grammar
24
+ * and query sources — this orchestrator imports NO grammars or query
25
+ * strings.
24
26
  *
25
27
  * Adding a new language for Strategy B is a one-file edit in
26
28
  * `http-patterns/index.ts`: register a new `HttpLanguagePlugin` and
@@ -175,13 +177,11 @@ export class HttpRouteExtractor {
175
177
  return scannedFiles;
176
178
  };
177
179
  const graphProviders = dbExecutor != null ? await this.extractProvidersGraph(dbExecutor, getDetections) : [];
178
- const providers = graphProviders.length > 0
179
- ? graphProviders
180
- : this.extractProvidersSourceScan(await getScannedFiles(), getDetections);
180
+ // Source scan always runs to capture routes in languages/files not covered
181
+ // by graph edges; the glob and per-file parse results are cached above.
182
+ const providers = this.mergeGraphAndSourceContracts(graphProviders, this.extractProvidersSourceScan(await getScannedFiles(), getDetections));
181
183
  const graphConsumers = dbExecutor != null ? await this.extractConsumersGraph(dbExecutor, getDetections) : [];
182
- const consumers = graphConsumers.length > 0
183
- ? graphConsumers
184
- : this.extractConsumersSourceScan(await getScannedFiles(), getDetections);
184
+ const consumers = this.mergeGraphAndSourceContracts(graphConsumers, this.extractConsumersSourceScan(await getScannedFiles(), getDetections));
185
185
  return [...providers, ...consumers];
186
186
  }
187
187
  async scanFiles(repoPath) {
@@ -427,4 +427,15 @@ export class HttpRouteExtractor {
427
427
  }
428
428
  return out;
429
429
  }
430
+ mergeGraphAndSourceContracts(graphContracts, sourceContracts) {
431
+ const seenContractIds = new Set(graphContracts.map((c) => c.contractId));
432
+ const out = [...graphContracts];
433
+ for (const contract of sourceContracts) {
434
+ if (seenContractIds.has(contract.contractId))
435
+ continue;
436
+ seenContractIds.add(contract.contractId);
437
+ out.push(contract);
438
+ }
439
+ return out;
440
+ }
430
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.6-rc.25",
3
+ "version": "1.6.6-rc.26",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",