gitnexus 1.6.8-rc.48 → 1.6.8-rc.49
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.
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import fs from 'fs/promises';
|
|
13
13
|
import path from 'path';
|
|
14
14
|
import { execSync, execFileSync } from 'child_process';
|
|
15
|
-
import { initWikiDb, closeWikiDb, touchWikiDb, getFilesWithExports, getAllFiles, getIntraModuleCallEdges, getInterModuleCallEdges, getProcessesForFiles, getAllProcesses, getInterModuleEdgesForOverview, } from './graph-queries.js';
|
|
15
|
+
import { initWikiDb, closeWikiDb, touchWikiDb, pinWikiDb, getFilesWithExports, getAllFiles, getIntraModuleCallEdges, getInterModuleCallEdges, getProcessesForFiles, getAllProcesses, getInterModuleEdgesForOverview, } from './graph-queries.js';
|
|
16
16
|
import { generateHTMLViewer } from './html-viewer.js';
|
|
17
17
|
import { sanitizeMermaidMarkdown } from './mermaid-sanitizer.js';
|
|
18
18
|
import { callLLM, estimateTokens, } from './llm-client.js';
|
|
@@ -183,6 +183,7 @@ export class WikiGenerator {
|
|
|
183
183
|
}
|
|
184
184
|
// Init graph
|
|
185
185
|
this.onProgress('init', 2, 'Connecting to knowledge graph...');
|
|
186
|
+
const releaseWikiDbPin = pinWikiDb();
|
|
186
187
|
await initWikiDb(this.lbugPath);
|
|
187
188
|
let result;
|
|
188
189
|
try {
|
|
@@ -201,6 +202,7 @@ export class WikiGenerator {
|
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
204
|
finally {
|
|
205
|
+
releaseWikiDbPin();
|
|
204
206
|
await closeWikiDb();
|
|
205
207
|
}
|
|
206
208
|
// Always generate the HTML viewer after wiki content changes
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
* Touch the wiki DB connection to prevent idle timeout during long LLM calls.
|
|
9
9
|
*/
|
|
10
10
|
export declare function touchWikiDb(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Keep the wiki DB resident for a full generation run. Wiki generation can spend
|
|
13
|
+
* minutes inside LLM calls, and the pooled DB must survive both idle cleanup and
|
|
14
|
+
* unrelated LRU pressure until the run reaches its final graph queries.
|
|
15
|
+
*/
|
|
16
|
+
export declare function pinWikiDb(): () => void;
|
|
11
17
|
export interface FileWithExports {
|
|
12
18
|
filePath: string;
|
|
13
19
|
symbols: Array<{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Encapsulated Cypher queries against the GitNexus knowledge graph.
|
|
5
5
|
* Uses the MCP-style pooled lbug-adapter for connection management.
|
|
6
6
|
*/
|
|
7
|
-
import { initLbug, executeQuery, closeLbug, touchRepo } from '../lbug/pool-adapter.js';
|
|
7
|
+
import { initLbug, executeQuery, closeLbug, touchRepo, pinRepo } from '../lbug/pool-adapter.js';
|
|
8
8
|
const REPO_ID = '__wiki__';
|
|
9
9
|
/**
|
|
10
10
|
* Touch the wiki DB connection to prevent idle timeout during long LLM calls.
|
|
@@ -12,6 +12,14 @@ const REPO_ID = '__wiki__';
|
|
|
12
12
|
export function touchWikiDb() {
|
|
13
13
|
touchRepo(REPO_ID);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Keep the wiki DB resident for a full generation run. Wiki generation can spend
|
|
17
|
+
* minutes inside LLM calls, and the pooled DB must survive both idle cleanup and
|
|
18
|
+
* unrelated LRU pressure until the run reaches its final graph queries.
|
|
19
|
+
*/
|
|
20
|
+
export function pinWikiDb() {
|
|
21
|
+
return pinRepo(REPO_ID);
|
|
22
|
+
}
|
|
15
23
|
/**
|
|
16
24
|
* Initialize the LadybugDB connection for wiki generation.
|
|
17
25
|
*/
|
package/package.json
CHANGED