gitnexus 1.6.6-rc.53 → 1.6.6-rc.54

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.
@@ -64,22 +64,22 @@ export async function syncGroup(config, opts) {
64
64
  let manifestCrossLinks = [];
65
65
  let dbExecutors;
66
66
  let registryEntries;
67
- const eo = opts?.extractorOverride;
68
- if (eo && eo.length === 0) {
69
- autoContracts = await eo();
70
- }
71
- else {
72
- registryEntries = await readRegistry();
73
- const entries = registryEntries;
74
- const resolve = opts?.resolveRepoHandle ?? defaultResolveHandle(entries);
75
- const httpEx = new HttpRouteExtractor();
76
- const grpcEx = new GrpcExtractor();
77
- const thriftEx = new ThriftExtractor();
78
- const topicEx = new TopicExtractor();
79
- const includeEx = new IncludeExtractor();
80
- dbExecutors = new Map();
81
- const openPoolIds = [];
82
- try {
67
+ const openPoolIds = [];
68
+ try {
69
+ const eo = opts?.extractorOverride;
70
+ if (eo && eo.length === 0) {
71
+ autoContracts = await eo();
72
+ }
73
+ else {
74
+ registryEntries = await readRegistry();
75
+ const entries = registryEntries;
76
+ const resolve = opts?.resolveRepoHandle ?? defaultResolveHandle(entries);
77
+ const httpEx = new HttpRouteExtractor();
78
+ const grpcEx = new GrpcExtractor();
79
+ const thriftEx = new ThriftExtractor();
80
+ const topicEx = new TopicExtractor();
81
+ const includeEx = new IncludeExtractor();
82
+ dbExecutors = new Map();
83
83
  for (const [groupPath, regName] of Object.entries(config.repos)) {
84
84
  const handle = await resolve(regName, groupPath);
85
85
  if (!handle) {
@@ -166,55 +166,49 @@ export async function syncGroup(config, opts) {
166
166
  }
167
167
  }
168
168
  }
169
- finally {
170
- for (const id of [...new Set(openPoolIds)]) {
171
- await closeLbug(id).catch(() => { });
169
+ // Workspace discovery and manifest extraction run inside this outer try
170
+ // block so dbExecutors closures resolve against live pools (issue #1802).
171
+ // The finally below closes pools after this completes (or throws).
172
+ let allLinks = [...config.links];
173
+ if (config.detect.workspace_deps) {
174
+ const repoPaths = new Map();
175
+ if (!registryEntries)
176
+ registryEntries = await readRegistry();
177
+ for (const [groupPath, regName] of Object.entries(config.repos)) {
178
+ const e = registryEntries.find((en) => en.name === regName);
179
+ if (e)
180
+ repoPaths.set(groupPath, e.path);
172
181
  }
173
- }
174
- }
175
- // Auto-discover workspace dependency contracts (Rust Cargo workspaces, etc.)
176
- // and merge them with explicit manifest links. Discovered links use the same
177
- // ManifestExtractor pipeline as hand-written links in group.yaml.
178
- let allLinks = [...config.links];
179
- if (config.detect.workspace_deps) {
180
- const repoPaths = new Map();
181
- if (!registryEntries)
182
- registryEntries = await readRegistry();
183
- for (const [groupPath, regName] of Object.entries(config.repos)) {
184
- const e = registryEntries.find((en) => en.name === regName);
185
- if (e)
186
- repoPaths.set(groupPath, e.path);
187
- }
188
- const wsResult = await discoverWorkspaceLinks(config.repos, repoPaths, dbExecutors);
189
- if (wsResult.links.length > 0) {
190
- allLinks = [...allLinks, ...wsResult.links];
191
- if (opts?.verbose) {
192
- for (const s of wsResult.stats) {
193
- logger.info(` workspace-deps: discovered ${s.linkCount} cross-${s.ecosystem.toLowerCase()} links from ${s.projectCount} ${s.ecosystem} projects`);
182
+ const wsResult = await discoverWorkspaceLinks(config.repos, repoPaths, dbExecutors);
183
+ if (wsResult.links.length > 0) {
184
+ allLinks = [...allLinks, ...wsResult.links];
185
+ if (opts?.verbose) {
186
+ for (const s of wsResult.stats) {
187
+ logger.info(` workspace-deps: discovered ${s.linkCount} cross-${s.ecosystem.toLowerCase()} links from ${s.projectCount} ${s.ecosystem} projects`);
188
+ }
194
189
  }
195
190
  }
196
191
  }
197
- }
198
- // Process manifest links declared in group.yaml (plus any auto-discovered).
199
- // ManifestExtractor is fully implemented but was never wired into this
200
- // pipeline config.links were parsed and validated but silently dropped.
201
- // Placed after the DB try/finally: resolveSymbol falls back to synthetic
202
- // UIDs when dbExecutors is undefined or a pool is closed, so cross-links
203
- // are always generated regardless of whether real DB executors are available.
204
- if (allLinks.length > 0) {
205
- const knownRepos = new Set(Object.keys(config.repos));
206
- for (const link of allLinks) {
207
- const dangling = [link.from, link.to].filter((r) => !knownRepos.has(r));
208
- if (dangling.length > 0) {
209
- logger.warn(`[group/sync] manifest link ${link.type}:${link.contract} references repos not in config.repos: ${dangling.join(', ')} — cross-links will use synthetic UIDs`);
192
+ if (allLinks.length > 0) {
193
+ const knownRepos = new Set(Object.keys(config.repos));
194
+ for (const link of allLinks) {
195
+ const dangling = [link.from, link.to].filter((r) => !knownRepos.has(r));
196
+ if (dangling.length > 0) {
197
+ logger.warn(`[group/sync] manifest link ${link.type}:${link.contract} references repos not in config.repos: ${dangling.join(', ')} cross-links will use synthetic UIDs`);
198
+ }
199
+ }
200
+ const manifestEx = new ManifestExtractor();
201
+ const manifestResult = await manifestEx.extractFromManifest(allLinks, dbExecutors);
202
+ autoContracts.push(...manifestResult.contracts);
203
+ manifestCrossLinks = manifestResult.crossLinks;
204
+ if (opts?.verbose) {
205
+ logger.info(` manifest: ${manifestCrossLinks.length} cross-links from ${allLinks.length} links (${config.links.length} declared + ${allLinks.length - config.links.length} discovered)`);
210
206
  }
211
207
  }
212
- const manifestEx = new ManifestExtractor();
213
- const manifestResult = await manifestEx.extractFromManifest(allLinks, dbExecutors);
214
- autoContracts.push(...manifestResult.contracts);
215
- manifestCrossLinks = manifestResult.crossLinks;
216
- if (opts?.verbose) {
217
- logger.info(` manifest: ${manifestCrossLinks.length} cross-links from ${allLinks.length} links (${config.links.length} declared + ${allLinks.length - config.links.length} discovered)`);
208
+ }
209
+ finally {
210
+ for (const id of [...new Set(openPoolIds)]) {
211
+ await closeLbug(id).catch(() => { });
218
212
  }
219
213
  }
220
214
  const providerIndex = buildProviderIndex(autoContracts, config.matching);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.6-rc.53",
3
+ "version": "1.6.6-rc.54",
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",