@colbymchenry/codegraph-win32-x64 1.3.0 → 1.4.0

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.
Files changed (68) hide show
  1. package/lib/dist/db/index.d.ts +64 -5
  2. package/lib/dist/db/index.d.ts.map +1 -1
  3. package/lib/dist/db/index.js +170 -12
  4. package/lib/dist/db/index.js.map +1 -1
  5. package/lib/dist/db/queries.d.ts +25 -1
  6. package/lib/dist/db/queries.d.ts.map +1 -1
  7. package/lib/dist/db/queries.js +39 -0
  8. package/lib/dist/db/queries.js.map +1 -1
  9. package/lib/dist/db/wal-valve.d.ts +106 -0
  10. package/lib/dist/db/wal-valve.d.ts.map +1 -0
  11. package/lib/dist/db/wal-valve.js +208 -0
  12. package/lib/dist/db/wal-valve.js.map +1 -0
  13. package/lib/dist/extraction/grammars.d.ts +16 -1
  14. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  15. package/lib/dist/extraction/grammars.js +85 -43
  16. package/lib/dist/extraction/grammars.js.map +1 -1
  17. package/lib/dist/extraction/index.d.ts +1 -1
  18. package/lib/dist/extraction/index.d.ts.map +1 -1
  19. package/lib/dist/extraction/index.js +113 -37
  20. package/lib/dist/extraction/index.js.map +1 -1
  21. package/lib/dist/extraction/parse-pool.d.ts +27 -1
  22. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  23. package/lib/dist/extraction/parse-pool.js +75 -7
  24. package/lib/dist/extraction/parse-pool.js.map +1 -1
  25. package/lib/dist/extraction/parse-worker.js +9 -2
  26. package/lib/dist/extraction/parse-worker.js.map +1 -1
  27. package/lib/dist/index.d.ts.map +1 -1
  28. package/lib/dist/index.js +70 -4
  29. package/lib/dist/index.js.map +1 -1
  30. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  31. package/lib/dist/mcp/daemon.js +23 -1
  32. package/lib/dist/mcp/daemon.js.map +1 -1
  33. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  34. package/lib/dist/mcp/proxy.js +8 -0
  35. package/lib/dist/mcp/proxy.js.map +1 -1
  36. package/lib/dist/mcp/query-pool.d.ts +14 -0
  37. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  38. package/lib/dist/mcp/query-pool.js +18 -0
  39. package/lib/dist/mcp/query-pool.js.map +1 -1
  40. package/lib/dist/mcp/session.d.ts.map +1 -1
  41. package/lib/dist/mcp/session.js +6 -0
  42. package/lib/dist/mcp/session.js.map +1 -1
  43. package/lib/dist/mcp/tools.d.ts.map +1 -1
  44. package/lib/dist/mcp/tools.js +14 -9
  45. package/lib/dist/mcp/tools.js.map +1 -1
  46. package/lib/dist/mcp/transport.d.ts.map +1 -1
  47. package/lib/dist/mcp/transport.js +18 -0
  48. package/lib/dist/mcp/transport.js.map +1 -1
  49. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
  50. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  51. package/lib/dist/resolution/c-fnptr-synthesizer.js +170 -146
  52. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  53. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  54. package/lib/dist/resolution/callback-synthesizer.js +381 -101
  55. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  56. package/lib/dist/resolution/goframe-synthesizer.d.ts +2 -1
  57. package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
  58. package/lib/dist/resolution/goframe-synthesizer.js +8 -3
  59. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
  60. package/lib/dist/resolution/index.d.ts +10 -0
  61. package/lib/dist/resolution/index.d.ts.map +1 -1
  62. package/lib/dist/resolution/index.js +55 -15
  63. package/lib/dist/resolution/index.js.map +1 -1
  64. package/lib/dist/resolution/types.d.ts +9 -0
  65. package/lib/dist/resolution/types.d.ts.map +1 -1
  66. package/lib/node_modules/.package-lock.json +1 -1
  67. package/lib/package.json +1 -1
  68. package/package.json +1 -1
@@ -46,6 +46,7 @@ exports.isShopifyLiquidJson = isShopifyLiquidJson;
46
46
  exports.isErlangAppFile = isErlangAppFile;
47
47
  exports.isPlayRoutesFile = isPlayRoutesFile;
48
48
  exports.initGrammars = initGrammars;
49
+ exports.readGrammarWasmBytes = readGrammarWasmBytes;
49
50
  exports.loadGrammarsForLanguages = loadGrammarsForLanguages;
50
51
  exports.loadAllGrammars = loadAllGrammars;
51
52
  exports.isGrammarsInitialized = isGrammarsInitialized;
@@ -60,6 +61,7 @@ exports.clearParserCache = clearParserCache;
60
61
  exports.getUnavailableGrammarErrors = getUnavailableGrammarErrors;
61
62
  exports.getLanguageDisplayName = getLanguageDisplayName;
62
63
  const path = __importStar(require("path"));
64
+ const fsp = __importStar(require("fs/promises"));
63
65
  const web_tree_sitter_1 = require("web-tree-sitter");
64
66
  /**
65
67
  * WASM filename map — maps each language to its .wasm grammar file
@@ -290,28 +292,94 @@ async function initGrammars() {
290
292
  parserInitialized = true;
291
293
  }
292
294
  /**
293
- * Load grammar WASM files for specific languages only.
294
- * Skips languages that are already loaded or have no WASM grammar.
295
- * Must be called after initGrammars().
295
+ * Grammars that ship their own vendored WASMs under `dist/extraction/wasm/`
296
+ * (not in tree-sitter-wasms, or the tree-sitter-wasms build is too old).
297
+ * Lua: tree-sitter-wasms ships an ABI-13 build that corrupts the shared WASM
298
+ * heap under web-tree-sitter 0.25 (drops nested calls/imports on every file
299
+ * after the first); we vendor the upstream ABI-15 wasm instead. C#: the
300
+ * tree-sitter-wasms build (ABI 13) has no primary-constructor support and
301
+ * parses `class Foo(...)` as an ERROR that swallows the whole class (#237); we
302
+ * vendor the upstream ABI-15 tree-sitter-c-sharp 0.23.5 wasm, which parses
303
+ * primary constructors natively. Terraform: tree-sitter-wasms does not ship
304
+ * HCL/Terraform at all, so we vendor the prebuilt tree-sitter-terraform.wasm
305
+ * from @tree-sitter-grammars/tree-sitter-hcl 1.2.0 (Apache-2.0) —
306
+ * byte-identical to the npm package's artifact. ArkTS: tree-sitter-wasms
307
+ * doesn't ship it either; we vendor the prebuilt tree-sitter-arkts.wasm from
308
+ * the tree-sitter-arkts 0.2.0 npm package (harmony-contrib/tree-sitter-arkts,
309
+ * MIT) — byte-identical to the npm tarball's artifact. It extends the
310
+ * tree-sitter-javascript grammar the same way tree-sitter-typescript does,
311
+ * adding `struct_declaration` and the `arkui_component_expression` build()
312
+ * DSL. Nix: tree-sitter-wasms doesn't ship it; we vendor a wasm built from
313
+ * nix-community/tree-sitter-nix @ 3d0173d (MIT) with tree-sitter-cli 0.25.10
314
+ * (`generate` + `build --wasm`, ABI 15 — upstream's checked-in parser.c is
315
+ * still ABI 13; all 54 upstream corpus tests pass on the regenerated parser).
296
316
  */
297
- async function loadGrammarsForLanguages(languages) {
298
- if (!parserInitialized) {
299
- await initGrammars();
300
- }
301
- // SFC languages (svelte/vue/astro) have no grammar of their own — their
302
- // extractors delegate <script>/frontmatter content to the TS/JS extractor,
303
- // so those grammars must be loaded even when no plain .ts/.js file is in
304
- // the index set (e.g. a pure-.astro content site).
317
+ const VENDORED_WASM_LANGS = new Set([
318
+ 'pascal', 'scala', 'lua', 'luau', 'csharp', 'r', 'cfml', 'cfscript', 'cfquery',
319
+ 'cobol', 'vbnet', 'erlang', 'terraform', 'arkts', 'nix',
320
+ ]);
321
+ /** Absolute path of a language's grammar WASM (vendored or tree-sitter-wasms). */
322
+ function resolveWasmPath(lang) {
323
+ const wasmFile = WASM_GRAMMAR_FILES[lang];
324
+ return VENDORED_WASM_LANGS.has(lang)
325
+ ? path.join(__dirname, 'wasm', wasmFile)
326
+ : require.resolve(`tree-sitter-wasms/out/${wasmFile}`);
327
+ }
328
+ /**
329
+ * Expand an index set's languages to the grammars actually needed to parse it.
330
+ * SFC languages (svelte/vue/astro) have no grammar of their own — their
331
+ * extractors delegate <script>/frontmatter content to the TS/JS extractor, so
332
+ * those grammars must be loaded even when no plain .ts/.js file is in the index
333
+ * set (e.g. a pure-.astro content site). CFML (.cfc/.cfm) likewise delegates
334
+ * bare-script content, <cfscript> tag bodies, and <cfquery> SQL bodies to the
335
+ * cfscript/cfquery grammars (see injections.scm in tree-sitter-cfml).
336
+ */
337
+ function expandGrammarLanguages(languages) {
305
338
  if (languages.some((l) => l === 'svelte' || l === 'vue' || l === 'astro')) {
306
339
  languages = [...languages, 'typescript', 'javascript'];
307
340
  }
308
- // CFML (.cfc/.cfm) delegates bare-script content, <cfscript> tag bodies, and
309
- // <cfquery> SQL bodies to the cfscript/cfquery grammars (see injections.scm in
310
- // tree-sitter-cfml) — load both even when no standalone .cfs file is in the
311
- // index set.
312
341
  if (languages.some((l) => l === 'cfml')) {
313
342
  languages = [...languages, 'cfscript', 'cfquery'];
314
343
  }
344
+ return languages;
345
+ }
346
+ /**
347
+ * Pre-read the grammar WASM bytes for an index set, keyed by language. The
348
+ * orchestrator reads each grammar ONCE and hands the bytes to every parse
349
+ * worker via its `load-grammars` message, so worker spawns/respawns load
350
+ * grammars from memory instead of re-reading them from disk — on slow storage
351
+ * (HDD, issue #1231) each respawn's grammar re-read otherwise amplifies the
352
+ * I/O contention that caused the respawn. Best-effort: a language whose WASM
353
+ * can't be read here is simply omitted, and the worker falls back to its own
354
+ * disk load (which surfaces the real error/warning path).
355
+ */
356
+ async function readGrammarWasmBytes(languages) {
357
+ const out = {};
358
+ const toRead = [...new Set(expandGrammarLanguages(languages))].filter((lang) => lang in WASM_GRAMMAR_FILES);
359
+ for (const lang of toRead) {
360
+ try {
361
+ out[lang] = await fsp.readFile(resolveWasmPath(lang));
362
+ }
363
+ catch {
364
+ // fall through — the worker's own load reports the failure
365
+ }
366
+ }
367
+ return out;
368
+ }
369
+ /**
370
+ * Load grammar WASM files for specific languages only.
371
+ * Skips languages that are already loaded or have no WASM grammar.
372
+ * Must be called after initGrammars().
373
+ *
374
+ * `wasmBytes` (optional) holds pre-read grammar bytes keyed by language (from
375
+ * {@link readGrammarWasmBytes}, forwarded through the parse pool); when a
376
+ * language's bytes are present they're loaded from memory instead of disk.
377
+ */
378
+ async function loadGrammarsForLanguages(languages, wasmBytes) {
379
+ if (!parserInitialized) {
380
+ await initGrammars();
381
+ }
382
+ languages = expandGrammarLanguages(languages);
315
383
  // Deduplicate and filter to languages that have WASM grammars and aren't already loaded
316
384
  const toLoad = [...new Set(languages)].filter((lang) => lang in WASM_GRAMMAR_FILES &&
317
385
  !languageCache.has(lang) &&
@@ -319,35 +387,9 @@ async function loadGrammarsForLanguages(languages) {
319
387
  // Load grammars sequentially to avoid web-tree-sitter WASM race condition on Node 20+
320
388
  // See: https://github.com/tree-sitter/tree-sitter/issues/2338
321
389
  for (const lang of toLoad) {
322
- const wasmFile = WASM_GRAMMAR_FILES[lang];
323
390
  try {
324
- // Some grammars ship their own WASMs (not in tree-sitter-wasms, or the
325
- // tree-sitter-wasms build is too old). Lua: tree-sitter-wasms ships an
326
- // ABI-13 build that corrupts the shared WASM heap under web-tree-sitter
327
- // 0.25 (drops nested calls/imports on every file after the first); we
328
- // vendor the upstream ABI-15 wasm instead. C#: the tree-sitter-wasms
329
- // build (ABI 13) has no primary-constructor support and parses
330
- // `class Foo(...)` as an ERROR that swallows the whole class (#237); we
331
- // vendor the upstream ABI-15 tree-sitter-c-sharp 0.23.5 wasm, which parses
332
- // primary constructors natively. Terraform: tree-sitter-wasms does not
333
- // ship HCL/Terraform at all, so we vendor the prebuilt
334
- // tree-sitter-terraform.wasm from @tree-sitter-grammars/tree-sitter-hcl
335
- // 1.2.0 (Apache-2.0) — byte-identical to the npm package's artifact.
336
- // ArkTS: tree-sitter-wasms doesn't ship it either; we vendor the prebuilt
337
- // tree-sitter-arkts.wasm from the tree-sitter-arkts 0.2.0 npm package
338
- // (harmony-contrib/tree-sitter-arkts, MIT) — byte-identical to the npm
339
- // tarball's artifact. It extends the tree-sitter-javascript grammar the
340
- // same way tree-sitter-typescript does, adding `struct_declaration` and
341
- // the `arkui_component_expression` build() DSL.
342
- // Nix: tree-sitter-wasms doesn't ship it; we vendor a wasm built from
343
- // nix-community/tree-sitter-nix @ 3d0173d (MIT) with tree-sitter-cli
344
- // 0.25.10 (`generate` + `build --wasm`, ABI 15 — upstream's checked-in
345
- // parser.c is still ABI 13; all 54 upstream corpus tests pass on the
346
- // regenerated parser).
347
- const wasmPath = (lang === 'pascal' || lang === 'scala' || lang === 'lua' || lang === 'luau' || lang === 'csharp' || lang === 'r' || lang === 'cfml' || lang === 'cfscript' || lang === 'cfquery' || lang === 'cobol' || lang === 'vbnet' || lang === 'erlang' || lang === 'terraform' || lang === 'arkts' || lang === 'nix')
348
- ? path.join(__dirname, 'wasm', wasmFile)
349
- : require.resolve(`tree-sitter-wasms/out/${wasmFile}`);
350
- const language = await web_tree_sitter_1.Language.load(wasmPath);
391
+ const bytes = wasmBytes?.[lang];
392
+ const language = await web_tree_sitter_1.Language.load(bytes ?? resolveWasmPath(lang));
351
393
  languageCache.set(lang, language);
352
394
  }
353
395
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"grammars.js","sourceRoot":"","sources":["../../src/extraction/grammars.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgLH,oCAQC;AAOD,kDAIC;AAUD,0CAEC;AAOD,4CAMC;AAgBD,oCAMC;AAOD,4DAoEC;AAMD,0CAGC;AAKD,sDAEC;AAMD,8BAcC;AASD,wCAoBC;AAgCD,kDAYC;AAKD,0CAKC;AAWD,0DAEC;AAKD,sDAEC;AASD,kCAMC;AAKD,4CAQC;AAKD,kEAMC;AAKD,wDA8CC;AAhiBD,2CAA6B;AAC7B,qDAAmE;AAKnE;;;GAGG;AACH,MAAM,kBAAkB,GAAoC;IAC1D,UAAU,EAAE,6BAA6B;IACzC,GAAG,EAAE,sBAAsB;IAC3B,UAAU,EAAE,6BAA6B;IACzC,GAAG,EAAE,6BAA6B;IAClC,MAAM,EAAE,yBAAyB;IACjC,EAAE,EAAE,qBAAqB;IACzB,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,CAAC,EA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AK;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,mBAAmB;QAC1B,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,WAAW;QACtB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;KACnB,CAAC;IACF,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AACrC,CAAC"}
@@ -190,7 +190,7 @@ export declare class ExtractionOrchestrator {
190
190
  /**
191
191
  * Index all files in the project
192
192
  */
193
- indexAll(onProgress?: (progress: IndexProgress) => void, signal?: AbortSignal, verbose?: boolean): Promise<IndexResult>;
193
+ indexAll(onProgress?: (progress: IndexProgress) => void, signal?: AbortSignal, verbose?: boolean, walBackpressure?: () => Promise<void> | null): Promise<IndexResult>;
194
194
  /**
195
195
  * Index specific files
196
196
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extraction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAMzB,OAAO,EAGL,gBAAgB,EAChB,eAAe,EAEhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ7C,OAAe,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAwCxC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EA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QhC;;OAEG;IACG,QAAQ,CACZ,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,EAC9C,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,OAAO,EAKjB,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAC3C,OAAO,CAAC,WAAW,CAAC;IAkfvB;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IA4C3D;;OAEG;IACG,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwChE;;;OAGG;IACG,oBAAoB,CACxB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,EAAE,CAAC,KAAK,GACd,OAAO,CAAC,gBAAgB,CAAC;IA0D5B;;OAEG;YACW,qBAAqB;IA+HnC;;;;;;;OAOG;IACG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC;IA8I/E;;;OAGG;IACH,eAAe,IAAI;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;CAwF9E;AAGD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,YAAY,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -64,6 +64,7 @@ const errors_1 = require("../errors");
64
64
  const utils_1 = require("../utils");
65
65
  const ignore_1 = __importDefault(require("ignore"));
66
66
  const frameworks_1 = require("../resolution/frameworks");
67
+ const cooperative_yield_1 = require("../resolution/cooperative-yield");
67
68
  /**
68
69
  * Number of files to read in parallel during indexing.
69
70
  * File reads are I/O-bound; batching overlaps I/O wait with CPU parse work.
@@ -84,9 +85,10 @@ const SYNC_RECONCILE_YIELD_INTERVAL = 1000;
84
85
  /**
85
86
  * Maximum time (ms) to wait for a single file to parse in the worker thread.
86
87
  * If tree-sitter hangs or WASM runs out of memory, this prevents the entire
87
- * indexing run from freezing. The worker is restarted after a timeout.
88
+ * indexing run from freezing. The worker is restarted after a (hard) timeout.
89
+ * Env-overridable via CODEGRAPH_PARSE_TIMEOUT_MS for slow storage (#1231).
88
90
  */
89
- const PARSE_TIMEOUT_MS = 10_000;
91
+ const PARSE_TIMEOUT_MS = (0, parse_pool_1.resolveParseTimeoutMs)(process.env.CODEGRAPH_PARSE_TIMEOUT_MS);
90
92
  /**
91
93
  * Number of files to parse before recycling the worker thread.
92
94
  * WASM linear memory can grow but NEVER shrink (WebAssembly spec limitation).
@@ -1370,7 +1372,12 @@ class ExtractionOrchestrator {
1370
1372
  /**
1371
1373
  * Index all files in the project
1372
1374
  */
1373
- async indexAll(onProgress, signal, verbose) {
1375
+ async indexAll(onProgress, signal, verbose,
1376
+ // Writer-side backstop for deferred WAL checkpointing (#1231): returns
1377
+ // null in the normal case, or a promise to await (at this safe,
1378
+ // between-transactions boundary) when the WAL has outrun the off-thread
1379
+ // checkpointer past its hard cap. See db/wal-valve.ts.
1380
+ walBackpressure) {
1374
1381
  await (0, grammars_1.initGrammars)();
1375
1382
  const startTime = Date.now();
1376
1383
  const errors = [];
@@ -1392,6 +1399,10 @@ class ExtractionOrchestrator {
1392
1399
  current: 0,
1393
1400
  total: 0,
1394
1401
  });
1402
+ // Phase attribution to stderr (same opt-in as the synthesis timings):
1403
+ // early-run 5-10s single stalls were observed on 95k-file repos but never
1404
+ // attributed — these labels settle scan vs framework-detect vs grammars.
1405
+ const tScan = Date.now();
1395
1406
  const files = await scanDirectoryAsync(this.rootDir, (current, file) => {
1396
1407
  onProgress?.({
1397
1408
  phase: 'scanning',
@@ -1400,13 +1411,18 @@ class ExtractionOrchestrator {
1400
1411
  currentFile: file,
1401
1412
  });
1402
1413
  });
1414
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
1415
+ console.error(`[phase-timing] scan: ${Date.now() - tScan}ms (${files.length} files)`);
1403
1416
  // Detect frameworks once per indexAll run using the scanned file list.
1404
1417
  // Names are passed to each parse call so framework-specific extractors
1405
1418
  // (route nodes, middleware, etc.) run after the tree-sitter pass.
1406
1419
  // Framework detection is reset each run so adding e.g. requirements.txt
1407
1420
  // between runs is picked up without restarting the process.
1408
1421
  this.detectedFrameworkNames = null;
1422
+ const tFw = Date.now();
1409
1423
  const frameworkNames = this.ensureDetectedFrameworks(files);
1424
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
1425
+ console.error(`[phase-timing] framework-detect: ${Date.now() - tFw}ms`);
1410
1426
  if (signal?.aborted) {
1411
1427
  return {
1412
1428
  success: false,
@@ -1447,6 +1463,11 @@ class ExtractionOrchestrator {
1447
1463
  // CODEGRAPH_PARSE_WORKERS: explicit worker count; 1 = the old single-worker
1448
1464
  // behaviour (the conservative rollback). Unset → clamp(cores-1, 1, 8).
1449
1465
  const poolSize = (0, parse_pool_1.resolveParsePoolSize)(process.env.CODEGRAPH_PARSE_WORKERS, os.cpus().length);
1466
+ // Read each needed grammar's WASM ONCE here and hand the bytes to every
1467
+ // worker, so spawns/respawns load grammars from memory instead of
1468
+ // re-reading them from disk (#1231: on an HDD, respawn re-reads amplify
1469
+ // the very I/O contention that caused the respawn).
1470
+ const grammarBuffers = await (0, grammars_1.readGrammarWasmBytes)(neededLanguages);
1450
1471
  pool = new parse_pool_1.ParseWorkerPool({
1451
1472
  languages: neededLanguages,
1452
1473
  size: poolSize,
@@ -1454,6 +1475,7 @@ class ExtractionOrchestrator {
1454
1475
  recycleInterval: WORKER_RECYCLE_INTERVAL,
1455
1476
  parseTimeoutMs: PARSE_TIMEOUT_MS,
1456
1477
  log,
1478
+ grammarBuffers,
1457
1479
  });
1458
1480
  log(`Parse worker pool: ${poolSize} worker(s)`);
1459
1481
  }
@@ -1489,12 +1511,23 @@ class ExtractionOrchestrator {
1489
1511
  let nextSeq = 0; // file-order sequence assigned at dispatch
1490
1512
  let nextToStore = 0; // cursor: next sequence to commit
1491
1513
  let aborted = false;
1492
- const storeResult = (filePath, content, stats, result) => {
1514
+ // Yielder for the in-order commit path: a single giant generated file's
1515
+ // store is otherwise one unyielding multi-second transaction span on the
1516
+ // main thread (5–14s single stalls measured on llvm-project), starving
1517
+ // the #850 watchdog heartbeat on slow hardware.
1518
+ const commitYield = (0, cooperative_yield_1.createYielder)();
1519
+ const storeResult = async (filePath, content, stats, result) => {
1493
1520
  processed++;
1521
+ // WAL hard-cap backstop: between files (never mid-transaction), pause
1522
+ // the store until the off-thread checkpoint catches up. Resolves to
1523
+ // null in the normal case — a single size check, no cost.
1524
+ const bp = walBackpressure?.();
1525
+ if (bp)
1526
+ await bp;
1494
1527
  // Store in database on main thread (SQLite is not thread-safe)
1495
1528
  if (result.nodes.length > 0 || result.errors.length === 0) {
1496
1529
  const language = (0, grammars_1.detectLanguage)(filePath, content, overrides);
1497
- this.storeExtractionResult(filePath, content, language, stats, result);
1530
+ await this.storeExtractionResult(filePath, content, language, stats, result, commitYield);
1498
1531
  }
1499
1532
  if (result.errors.length > 0) {
1500
1533
  for (const err of result.errors) {
@@ -1538,20 +1571,35 @@ class ExtractionOrchestrator {
1538
1571
  };
1539
1572
  // Commit buffered parses to the DB in file order, advancing the cursor over
1540
1573
  // contiguous completed results. Runs after each parse settles (and once more
1541
- // after the drain). storeResult / recordParseFailure run here single-threaded,
1542
- // so shared counters and SQLite writes never race despite parallel parsing.
1574
+ // after the drain). storeResult is now async (it yields between chunked
1575
+ // inserts), so commits are SERIALIZED on a promise chain — concurrent parse
1576
+ // completions append to the chain instead of interleaving mid-store, which
1577
+ // preserves both the file-order commit invariant (#1015: resolution
1578
+ // disambiguates same-named candidates by insertion order) and the
1579
+ // single-writer discipline for SQLite. Errors are recorded and re-thrown
1580
+ // at the drain, matching the old synchronous propagation.
1581
+ let flushChain = Promise.resolve();
1582
+ let flushError = null;
1543
1583
  const flushOrdered = () => {
1544
- if (aborted)
1545
- return;
1546
- while (completed.has(nextToStore)) {
1547
- const item = completed.get(nextToStore);
1548
- completed.delete(nextToStore);
1549
- nextToStore++;
1550
- if (item.ok)
1551
- storeResult(item.filePath, item.content, item.stats, item.result);
1552
- else
1553
- recordParseFailure(item.filePath, item.err);
1554
- }
1584
+ flushChain = flushChain.then(async () => {
1585
+ if (aborted || flushError)
1586
+ return;
1587
+ try {
1588
+ while (completed.has(nextToStore)) {
1589
+ const item = completed.get(nextToStore);
1590
+ completed.delete(nextToStore);
1591
+ nextToStore++;
1592
+ if (item.ok)
1593
+ await storeResult(item.filePath, item.content, item.stats, item.result);
1594
+ else
1595
+ recordParseFailure(item.filePath, item.err);
1596
+ }
1597
+ }
1598
+ catch (err) {
1599
+ flushError = err;
1600
+ }
1601
+ });
1602
+ return flushChain;
1555
1603
  };
1556
1604
  // Dispatch one file's parse (parses run concurrently across the pool), tagged
1557
1605
  // with its file-order sequence so flushOrdered commits results in order. The
@@ -1574,10 +1622,15 @@ class ExtractionOrchestrator {
1574
1622
  // buffered), not just in-flight: a slow file sitting at the commit cursor
1575
1623
  // lets later parses finish and buffer, which would otherwise grow without
1576
1624
  // bound. Wait for parses to settle (each may advance the cursor) until the
1577
- // window has room. `inFlight.size > 0` guards against an empty race — the
1578
- // cursor file is always still in flight when the window is full.
1579
- while (nextSeq - nextToStore >= windowSize && inFlight.size > 0) {
1580
- await Promise.race(inFlight);
1625
+ // window has room. When nothing is in flight but the window is still full,
1626
+ // the async commit chain is what's behind — await it so the cursor
1627
+ // advances (buffered items hold whole file contents, so this bound is
1628
+ // load-bearing for memory).
1629
+ while (nextSeq - nextToStore >= windowSize) {
1630
+ if (inFlight.size > 0)
1631
+ await Promise.race(inFlight);
1632
+ else
1633
+ await flushOrdered();
1581
1634
  }
1582
1635
  };
1583
1636
  for (let i = 0; i < files.length; i += FILE_IO_BATCH_SIZE) {
@@ -1652,7 +1705,9 @@ class ExtractionOrchestrator {
1652
1705
  // then commit any results the cursor hasn't reached yet.
1653
1706
  if (!aborted) {
1654
1707
  await Promise.all(inFlight);
1655
- flushOrdered();
1708
+ await flushOrdered();
1709
+ if (flushError)
1710
+ throw flushError;
1656
1711
  }
1657
1712
  if (signal?.aborted || aborted) {
1658
1713
  if (pool)
@@ -1681,11 +1736,16 @@ class ExtractionOrchestrator {
1681
1736
  await new Promise(resolve => setImmediate(resolve));
1682
1737
  // Retry pass: files that failed due to WASM memory corruption may succeed
1683
1738
  // on a fresh worker with a clean heap. Recycle before each attempt so
1684
- // every file gets the absolute cleanest WASM state possible.
1739
+ // every file gets the absolute cleanest WASM state possible. Timeouts are
1740
+ // retried too (#1231): most are main-thread-stall artifacts, not slow
1741
+ // parses, and this pass parses one file at a time with the store strictly
1742
+ // after each parse resolves, so the stall window can't recur here.
1685
1743
  const retryableErrors = errors.filter((e) => e.code === 'parse_error' && e.filePath &&
1686
- (e.message.includes('Worker exited') || e.message.includes('memory access out of bounds')));
1744
+ (e.message.includes('Worker exited') ||
1745
+ e.message.includes('memory access out of bounds') ||
1746
+ e.message.includes('timed out')));
1687
1747
  if (retryableErrors.length > 0 && pool) {
1688
- log(`Retrying ${retryableErrors.length} files that failed due to WASM memory errors...`);
1748
+ log(`Retrying ${retryableErrors.length} files that failed due to WASM memory errors or timeouts...`);
1689
1749
  // Fresh WASM heaps for the retry phase. A retry that still crashes its
1690
1750
  // worker makes the pool respawn it, so later retries keep landing on clean
1691
1751
  // workers too.
@@ -1716,7 +1776,7 @@ class ExtractionOrchestrator {
1716
1776
  if (result.nodes.length > 0 || result.errors.length === 0) {
1717
1777
  const language = (0, grammars_1.detectLanguage)(filePath, content, overrides);
1718
1778
  const stats = await fsp.stat(path.join(this.rootDir, filePath));
1719
- this.storeExtractionResult(filePath, content, language, stats, result);
1779
+ await this.storeExtractionResult(filePath, content, language, stats, result, commitYield);
1720
1780
  const idx = errors.indexOf(errEntry);
1721
1781
  if (idx >= 0)
1722
1782
  errors.splice(idx, 1);
@@ -1764,7 +1824,7 @@ class ExtractionOrchestrator {
1764
1824
  if (result.nodes.length > 0 || result.errors.length === 0) {
1765
1825
  const language = (0, grammars_1.detectLanguage)(filePath, fullContent, overrides);
1766
1826
  const stats = await fsp.stat(path.join(this.rootDir, filePath));
1767
- this.storeExtractionResult(filePath, fullContent, language, stats, result);
1827
+ await this.storeExtractionResult(filePath, fullContent, language, stats, result, commitYield);
1768
1828
  const idx = errors.indexOf(errEntry);
1769
1829
  if (idx >= 0)
1770
1830
  errors.splice(idx, 1);
@@ -1929,14 +1989,21 @@ class ExtractionOrchestrator {
1929
1989
  const result = (0, tree_sitter_1.extractFromSource)(relativePath, content, language, frameworkNames);
1930
1990
  // Store in database
1931
1991
  if (result.nodes.length > 0 || result.errors.length === 0) {
1932
- this.storeExtractionResult(relativePath, content, language, stats, result);
1992
+ await this.storeExtractionResult(relativePath, content, language, stats, result, (0, cooperative_yield_1.createYielder)());
1933
1993
  }
1934
1994
  return result;
1935
1995
  }
1936
1996
  /**
1937
1997
  * Store extraction result in database
1938
1998
  */
1939
- storeExtractionResult(filePath, content, language, stats, result) {
1999
+ async storeExtractionResult(filePath, content, language, stats, result, onYield) {
2000
+ // Bulk inserts run in bounded sub-transactions with a yield between, so a
2001
+ // giant generated file (tens of thousands of symbols) can't block the
2002
+ // event loop — and the #850 watchdog heartbeat — for the whole store.
2003
+ // The file was NEVER one atomic transaction (each insert call has its
2004
+ // own), and the files-table record still lands last, so crash recovery
2005
+ // is unchanged: a partially-stored file has no record and re-indexes.
2006
+ const STORE_CHUNK = 2000;
1940
2007
  const contentHash = hashContent(content);
1941
2008
  // Check if file already exists and hasn't changed
1942
2009
  const existingFile = this.queries.getFileByPath(filePath);
@@ -1970,16 +2037,18 @@ class ExtractionOrchestrator {
1970
2037
  // This prevents FK violations when edges reference nodes that would
1971
2038
  // be silently skipped by insertNode() (see issue #42).
1972
2039
  const validNodes = result.nodes.filter((n) => n.id && n.kind && n.name && n.filePath && n.language);
1973
- // Insert nodes
1974
- if (validNodes.length > 0) {
1975
- this.queries.insertNodes(validNodes);
2040
+ // Insert nodes (chunked — see STORE_CHUNK above)
2041
+ for (let i = 0; i < validNodes.length; i += STORE_CHUNK) {
2042
+ this.queries.insertNodes(validNodes.slice(i, i + STORE_CHUNK));
2043
+ await onYield?.();
1976
2044
  }
1977
2045
  // Filter edges to only reference nodes that were actually inserted
1978
2046
  if (result.edges.length > 0) {
1979
2047
  const insertedIds = new Set(validNodes.map((n) => n.id));
1980
2048
  const validEdges = result.edges.filter((e) => insertedIds.has(e.source) && insertedIds.has(e.target));
1981
- if (validEdges.length > 0) {
1982
- this.queries.insertEdges(validEdges);
2049
+ for (let i = 0; i < validEdges.length; i += STORE_CHUNK) {
2050
+ this.queries.insertEdges(validEdges.slice(i, i + STORE_CHUNK));
2051
+ await onYield?.();
1983
2052
  }
1984
2053
  }
1985
2054
  // Re-insert cross-file incoming edges snapshotted before the delete,
@@ -2017,8 +2086,9 @@ class ExtractionOrchestrator {
2017
2086
  filePath: ref.filePath ?? filePath,
2018
2087
  language: ref.language ?? language,
2019
2088
  }));
2020
- if (refsWithContext.length > 0) {
2021
- this.queries.insertUnresolvedRefsBatch(refsWithContext);
2089
+ for (let i = 0; i < refsWithContext.length; i += STORE_CHUNK) {
2090
+ this.queries.insertUnresolvedRefsBatch(refsWithContext.slice(i, i + STORE_CHUNK));
2091
+ await onYield?.();
2022
2092
  }
2023
2093
  }
2024
2094
  // Insert file record
@@ -2066,10 +2136,16 @@ class ExtractionOrchestrator {
2066
2136
  // whether or not the project uses git, and crucially also catches committed
2067
2137
  // changes from `git pull`/`checkout`/`merge`/`rebase` — which `git status`
2068
2138
  // cannot see, because the working tree is clean afterward.
2139
+ const tSyncScan = Date.now();
2069
2140
  const currentFiles = await scanDirectoryAsync(this.rootDir);
2141
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2142
+ console.error(`[phase-timing] sync-scan: ${Date.now() - tSyncScan}ms (${currentFiles.length} files)`);
2070
2143
  filesChecked = currentFiles.length;
2071
2144
  const currentSet = new Set(currentFiles);
2145
+ const tTracked = Date.now();
2072
2146
  const trackedFiles = this.queries.getAllFiles();
2147
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2148
+ console.error(`[phase-timing] sync-tracked-load: ${Date.now() - tTracked}ms (${trackedFiles.length} tracked)`);
2073
2149
  const trackedMap = new Map();
2074
2150
  for (const f of trackedFiles) {
2075
2151
  trackedMap.set(f.path, f);