@optave/codegraph 3.11.0 → 3.11.1
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.
- package/README.md +38 -31
- package/dist/ast-analysis/engine.d.ts.map +1 -1
- package/dist/ast-analysis/engine.js +91 -60
- package/dist/ast-analysis/engine.js.map +1 -1
- package/dist/ast-analysis/visitor-utils.d.ts +3 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -1
- package/dist/ast-analysis/visitor-utils.js +83 -49
- package/dist/ast-analysis/visitor-utils.js.map +1 -1
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/ast-store-visitor.js +78 -62
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/dataflow-visitor.js +61 -42
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -1
- package/dist/cli/commands/embed.d.ts.map +1 -1
- package/dist/cli/commands/embed.js +49 -4
- package/dist/cli/commands/embed.js.map +1 -1
- package/dist/domain/analysis/dependencies.d.ts.map +1 -1
- package/dist/domain/analysis/dependencies.js +106 -80
- package/dist/domain/analysis/dependencies.js.map +1 -1
- package/dist/domain/analysis/fn-impact.d.ts.map +1 -1
- package/dist/domain/analysis/fn-impact.js +77 -52
- package/dist/domain/analysis/fn-impact.js.map +1 -1
- package/dist/domain/analysis/module-map.d.ts.map +1 -1
- package/dist/domain/analysis/module-map.js +132 -121
- package/dist/domain/analysis/module-map.js.map +1 -1
- package/dist/domain/graph/builder/helpers.d.ts +4 -4
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -1
- package/dist/domain/graph/builder/helpers.js +47 -33
- package/dist/domain/graph/builder/helpers.js.map +1 -1
- package/dist/domain/graph/builder/incremental.d.ts +6 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -1
- package/dist/domain/graph/builder/incremental.js +142 -76
- package/dist/domain/graph/builder/incremental.js.map +1 -1
- package/dist/domain/graph/builder/pipeline.d.ts +1 -44
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -1
- package/dist/domain/graph/builder/pipeline.js +10 -766
- package/dist/domain/graph/builder/pipeline.js.map +1 -1
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/build-edges.js +133 -96
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -1
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/build-structure.js +82 -65
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -1
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/detect-changes.js +84 -56
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -1
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/finalize.js +60 -51
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -1
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +8 -6
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/insert-nodes.js +107 -122
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -1
- package/dist/domain/graph/builder/stages/native-db-lifecycle.d.ts +14 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.js +77 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.js.map +1 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts +62 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.js +747 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +6 -4
- package/dist/domain/graph/cycles.d.ts.map +1 -1
- package/dist/domain/graph/cycles.js +50 -55
- package/dist/domain/graph/cycles.js.map +1 -1
- package/dist/domain/graph/journal.d.ts.map +1 -1
- package/dist/domain/graph/journal.js +89 -70
- package/dist/domain/graph/journal.js.map +1 -1
- package/dist/domain/graph/watcher.d.ts.map +1 -1
- package/dist/domain/graph/watcher.js +5 -2
- package/dist/domain/graph/watcher.js.map +1 -1
- package/dist/domain/parser.d.ts +12 -23
- package/dist/domain/parser.d.ts.map +1 -1
- package/dist/domain/parser.js +126 -79
- package/dist/domain/parser.js.map +1 -1
- package/dist/domain/search/generator.d.ts +3 -1
- package/dist/domain/search/generator.d.ts.map +1 -1
- package/dist/domain/search/generator.js +68 -45
- package/dist/domain/search/generator.js.map +1 -1
- package/dist/domain/search/models.d.ts +2 -0
- package/dist/domain/search/models.d.ts.map +1 -1
- package/dist/domain/search/models.js +37 -3
- package/dist/domain/search/models.js.map +1 -1
- package/dist/domain/search/search/hybrid.d.ts.map +1 -1
- package/dist/domain/search/search/hybrid.js +49 -40
- package/dist/domain/search/search/hybrid.js.map +1 -1
- package/dist/domain/search/search/semantic.d.ts.map +1 -1
- package/dist/domain/search/search/semantic.js +69 -49
- package/dist/domain/search/search/semantic.js.map +1 -1
- package/dist/domain/wasm-worker-entry.js +201 -136
- package/dist/domain/wasm-worker-entry.js.map +1 -1
- package/dist/extractors/elixir.js +95 -71
- package/dist/extractors/elixir.js.map +1 -1
- package/dist/extractors/gleam.d.ts.map +1 -1
- package/dist/extractors/gleam.js +23 -31
- package/dist/extractors/gleam.js.map +1 -1
- package/dist/extractors/helpers.d.ts +79 -1
- package/dist/extractors/helpers.d.ts.map +1 -1
- package/dist/extractors/helpers.js +137 -0
- package/dist/extractors/helpers.js.map +1 -1
- package/dist/extractors/java.d.ts.map +1 -1
- package/dist/extractors/java.js +37 -49
- package/dist/extractors/java.js.map +1 -1
- package/dist/extractors/javascript.d.ts.map +1 -1
- package/dist/extractors/javascript.js +44 -44
- package/dist/extractors/javascript.js.map +1 -1
- package/dist/extractors/julia.js +27 -34
- package/dist/extractors/julia.js.map +1 -1
- package/dist/extractors/r.d.ts.map +1 -1
- package/dist/extractors/r.js +33 -58
- package/dist/extractors/r.js.map +1 -1
- package/dist/extractors/solidity.d.ts.map +1 -1
- package/dist/extractors/solidity.js +38 -61
- package/dist/extractors/solidity.js.map +1 -1
- package/dist/features/boundaries.d.ts.map +1 -1
- package/dist/features/boundaries.js +49 -39
- package/dist/features/boundaries.js.map +1 -1
- package/dist/features/cfg.d.ts.map +1 -1
- package/dist/features/cfg.js +90 -63
- package/dist/features/cfg.js.map +1 -1
- package/dist/features/check.d.ts.map +1 -1
- package/dist/features/check.js +43 -34
- package/dist/features/check.js.map +1 -1
- package/dist/features/cochange.d.ts.map +1 -1
- package/dist/features/cochange.js +68 -56
- package/dist/features/cochange.js.map +1 -1
- package/dist/features/complexity.d.ts.map +1 -1
- package/dist/features/complexity.js +105 -75
- package/dist/features/complexity.js.map +1 -1
- package/dist/features/dataflow.d.ts.map +1 -1
- package/dist/features/dataflow.js +37 -29
- package/dist/features/dataflow.js.map +1 -1
- package/dist/features/flow.d.ts.map +1 -1
- package/dist/features/flow.js +31 -22
- package/dist/features/flow.js.map +1 -1
- package/dist/features/graph-enrichment.d.ts.map +1 -1
- package/dist/features/graph-enrichment.js +77 -70
- package/dist/features/graph-enrichment.js.map +1 -1
- package/dist/features/owners.d.ts +17 -26
- package/dist/features/owners.d.ts.map +1 -1
- package/dist/features/owners.js +120 -109
- package/dist/features/owners.js.map +1 -1
- package/dist/features/sequence.d.ts.map +1 -1
- package/dist/features/sequence.js +59 -54
- package/dist/features/sequence.js.map +1 -1
- package/dist/features/structure-query.d.ts.map +1 -1
- package/dist/features/structure-query.js +60 -60
- package/dist/features/structure-query.js.map +1 -1
- package/dist/features/structure.js +28 -36
- package/dist/features/structure.js.map +1 -1
- package/dist/graph/algorithms/leiden/optimiser.d.ts.map +1 -1
- package/dist/graph/algorithms/leiden/optimiser.js +100 -69
- package/dist/graph/algorithms/leiden/optimiser.js.map +1 -1
- package/dist/graph/classifiers/roles.d.ts.map +1 -1
- package/dist/graph/classifiers/roles.js +63 -59
- package/dist/graph/classifiers/roles.js.map +1 -1
- package/dist/infrastructure/config.d.ts +1 -1
- package/dist/infrastructure/config.d.ts.map +1 -1
- package/dist/infrastructure/config.js +1 -1
- package/dist/infrastructure/config.js.map +1 -1
- package/dist/presentation/cfg.d.ts.map +1 -1
- package/dist/presentation/cfg.js +44 -29
- package/dist/presentation/cfg.js.map +1 -1
- package/dist/presentation/flow.d.ts.map +1 -1
- package/dist/presentation/flow.js +58 -38
- package/dist/presentation/flow.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/ast-analysis/engine.ts +145 -61
- package/src/ast-analysis/visitor-utils.ts +86 -46
- package/src/ast-analysis/visitors/ast-store-visitor.ts +104 -69
- package/src/ast-analysis/visitors/dataflow-visitor.ts +86 -47
- package/src/cli/commands/embed.ts +54 -4
- package/src/domain/analysis/dependencies.ts +166 -85
- package/src/domain/analysis/fn-impact.ts +120 -50
- package/src/domain/analysis/module-map.ts +175 -140
- package/src/domain/graph/builder/helpers.ts +85 -76
- package/src/domain/graph/builder/incremental.ts +217 -90
- package/src/domain/graph/builder/pipeline.ts +19 -957
- package/src/domain/graph/builder/stages/build-edges.ts +198 -140
- package/src/domain/graph/builder/stages/build-structure.ts +115 -82
- package/src/domain/graph/builder/stages/detect-changes.ts +107 -64
- package/src/domain/graph/builder/stages/finalize.ts +72 -70
- package/src/domain/graph/builder/stages/insert-nodes.ts +154 -120
- package/src/domain/graph/builder/stages/native-db-lifecycle.ts +74 -0
- package/src/domain/graph/builder/stages/native-orchestrator.ts +942 -0
- package/src/domain/graph/cycles.ts +51 -49
- package/src/domain/graph/journal.ts +84 -69
- package/src/domain/graph/watcher.ts +8 -2
- package/src/domain/parser.ts +143 -66
- package/src/domain/search/generator.ts +132 -74
- package/src/domain/search/models.ts +39 -3
- package/src/domain/search/search/hybrid.ts +53 -42
- package/src/domain/search/search/semantic.ts +105 -65
- package/src/domain/wasm-worker-entry.ts +235 -152
- package/src/extractors/elixir.ts +91 -64
- package/src/extractors/gleam.ts +33 -37
- package/src/extractors/helpers.ts +205 -1
- package/src/extractors/java.ts +42 -45
- package/src/extractors/javascript.ts +44 -43
- package/src/extractors/julia.ts +28 -35
- package/src/extractors/r.ts +38 -56
- package/src/extractors/solidity.ts +43 -71
- package/src/features/boundaries.ts +64 -46
- package/src/features/cfg.ts +145 -74
- package/src/features/check.ts +60 -43
- package/src/features/cochange.ts +95 -72
- package/src/features/complexity.ts +134 -79
- package/src/features/dataflow.ts +57 -34
- package/src/features/flow.ts +48 -24
- package/src/features/graph-enrichment.ts +105 -70
- package/src/features/owners.ts +186 -146
- package/src/features/sequence.ts +99 -69
- package/src/features/structure-query.ts +94 -79
- package/src/features/structure.ts +56 -56
- package/src/graph/algorithms/leiden/optimiser.ts +142 -87
- package/src/graph/classifiers/roles.ts +64 -54
- package/src/infrastructure/config.ts +1 -1
- package/src/presentation/cfg.ts +48 -32
- package/src/presentation/flow.ts +100 -52
- package/src/types.ts +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NativeDatabase connection lifecycle helpers.
|
|
3
|
+
*
|
|
4
|
+
* The Rust orchestrator and the JS pipeline stages both juggle the same
|
|
5
|
+
* `nativeDb` handle (rusqlite) alongside `ctx.db` (better-sqlite3). These
|
|
6
|
+
* helpers centralise the open/close/reopen sequence so both call sites
|
|
7
|
+
* preserve the same WAL-safety invariants:
|
|
8
|
+
*
|
|
9
|
+
* - Always checkpoint WAL before closing rusqlite — otherwise better-sqlite3's
|
|
10
|
+
* internal WAL index can drift and surface as SQLITE_CORRUPT on the next
|
|
11
|
+
* read (#715, #736).
|
|
12
|
+
* - Always reopen better-sqlite3 after rusqlite writes to drop the stale
|
|
13
|
+
* page cache.
|
|
14
|
+
*
|
|
15
|
+
* Lives in its own module so `tryNativeOrchestrator` (in `native-orchestrator.ts`)
|
|
16
|
+
* and the JS pipeline stages driver (in `pipeline.ts`) can share the helpers
|
|
17
|
+
* without either file importing the other.
|
|
18
|
+
*/
|
|
19
|
+
import { openDb } from '../../../../db/index.js';
|
|
20
|
+
import { debug } from '../../../../infrastructure/logger.js';
|
|
21
|
+
import { loadNative } from '../../../../infrastructure/native.js';
|
|
22
|
+
import { toErrorMessage } from '../../../../shared/errors.js';
|
|
23
|
+
/** Checkpoint WAL through rusqlite and close the native connection. */
|
|
24
|
+
export function closeNativeDb(ctx, label) {
|
|
25
|
+
if (!ctx.nativeDb)
|
|
26
|
+
return;
|
|
27
|
+
try {
|
|
28
|
+
ctx.nativeDb.exec('PRAGMA wal_checkpoint(TRUNCATE)');
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
debug(`${label} WAL checkpoint failed: ${toErrorMessage(e)}`);
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
ctx.nativeDb.close();
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
debug(`${label} nativeDb close failed: ${toErrorMessage(e)}`);
|
|
38
|
+
}
|
|
39
|
+
ctx.nativeDb = undefined;
|
|
40
|
+
}
|
|
41
|
+
/** Try to reopen the native connection for a given pipeline phase. */
|
|
42
|
+
export function reopenNativeDb(ctx, label) {
|
|
43
|
+
if ((ctx.opts.engine ?? 'auto') === 'wasm')
|
|
44
|
+
return;
|
|
45
|
+
const native = loadNative();
|
|
46
|
+
if (!native?.NativeDatabase)
|
|
47
|
+
return;
|
|
48
|
+
try {
|
|
49
|
+
ctx.nativeDb = native.NativeDatabase.openReadWrite(ctx.dbPath);
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
debug(`reopen nativeDb for ${label} failed: ${toErrorMessage(e)}`);
|
|
53
|
+
ctx.nativeDb = undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Close nativeDb and clear stale references in engineOpts. */
|
|
57
|
+
export function suspendNativeDb(ctx, label) {
|
|
58
|
+
closeNativeDb(ctx, label);
|
|
59
|
+
if (ctx.engineOpts?.nativeDb) {
|
|
60
|
+
ctx.engineOpts.nativeDb = undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* After native writes, reopen the JS db connection to get a fresh page cache.
|
|
65
|
+
* Rusqlite WAL truncation invalidates better-sqlite3's internal WAL index,
|
|
66
|
+
* causing SQLITE_CORRUPT on the next read (#715, #736).
|
|
67
|
+
*/
|
|
68
|
+
export function refreshJsDb(ctx) {
|
|
69
|
+
try {
|
|
70
|
+
ctx.db.close();
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
debug(`refreshJsDb close failed: ${toErrorMessage(e)}`);
|
|
74
|
+
}
|
|
75
|
+
ctx.db = openDb(ctx.dbPath);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=native-db-lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-db-lifecycle.js","sourceRoot":"","sources":["../../../../../src/domain/graph/builder/stages/native-db-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,GAAoB,EAAE,KAAa;IAC/D,IAAI,CAAC,GAAG,CAAC,QAAQ;QAAE,OAAO;IAC1B,IAAI,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,KAAK,CAAC,GAAG,KAAK,2BAA2B,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,IAAI,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,KAAK,CAAC,GAAG,KAAK,2BAA2B,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,GAAG,CAAC,QAAQ,GAAG,SAAS,CAAC;AAC3B,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAAC,GAAoB,EAAE,KAAa;IAChE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,MAAM;QAAE,OAAO;IACnD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,EAAE,cAAc;QAAE,OAAO;IACpC,IAAI,CAAC;QACH,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,KAAK,CAAC,uBAAuB,KAAK,YAAY,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACnE,GAAG,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,eAAe,CAAC,GAAoB,EAAE,KAAa;IACjE,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1B,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC;QAC7B,GAAG,CAAC,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC9C,IAAI,CAAC;QACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,KAAK,CAAC,6BAA6B,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { BuildResult } from '../../../../types.js';
|
|
2
|
+
import type { PipelineContext } from '../context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Inputs to {@link computeWasmOnlyStaleFiles}. Sets are passed in so the helper
|
|
5
|
+
* is pure and unit-testable independently of `getInstalledWasmExtensions` and
|
|
6
|
+
* the `NATIVE_SUPPORTED_EXTENSIONS` global state.
|
|
7
|
+
*/
|
|
8
|
+
export interface WasmOnlyStaleFilesInput {
|
|
9
|
+
/** Distinct `file` values from the `nodes` table. */
|
|
10
|
+
existingNodes: ReadonlySet<string>;
|
|
11
|
+
/** Distinct `file` values from the `file_hashes` table. */
|
|
12
|
+
existingHashes: ReadonlySet<string>;
|
|
13
|
+
/** Relative paths currently on disk (from `collectFilesUtil`). */
|
|
14
|
+
expected: ReadonlySet<string>;
|
|
15
|
+
/** Lowercased extensions whose WASM grammar is installed. */
|
|
16
|
+
installedExts: ReadonlySet<string>;
|
|
17
|
+
/** Extensions covered by the Rust addon — Rust owns deletion for these. */
|
|
18
|
+
nativeSupported: ReadonlySet<string>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Compute the WASM-only files present in the DB but missing from disk (#1073).
|
|
22
|
+
*
|
|
23
|
+
* Returns relative paths that:
|
|
24
|
+
* - appear in `existingNodes` or `existingHashes` (in DB),
|
|
25
|
+
* - are absent from `expected` (not on disk),
|
|
26
|
+
* - have an extension installed for WASM, AND
|
|
27
|
+
* - have an extension NOT covered by `nativeSupported` — Rust's
|
|
28
|
+
* `purge_changed_files` handles deletion for natively-supported extensions
|
|
29
|
+
* via its own `detect_removed_files`, so the caller must not double-purge.
|
|
30
|
+
*
|
|
31
|
+
* Extensions are lowercased before lookup to match the registry and Rust's
|
|
32
|
+
* `LanguageKind::from_extension` (which normalises case for the languages
|
|
33
|
+
* where both cases are conventional, e.g. R's `.r` / `.R`).
|
|
34
|
+
*
|
|
35
|
+
* DB paths are forced to forward slashes before comparison with `expected`
|
|
36
|
+
* (which is always normalised). The on-disk invariant is that DB rows are
|
|
37
|
+
* written with forward slashes, but a stale row written by older code on
|
|
38
|
+
* Windows could carry back-slashes — normalising here makes the comparison
|
|
39
|
+
* platform-safe and prevents false-positive purges of live rows. We replace
|
|
40
|
+
* `\\` explicitly (rather than calling `normalizePath`, which only touches
|
|
41
|
+
* `path.sep`) so the defence works when running on POSIX against a DB that
|
|
42
|
+
* was migrated from Windows.
|
|
43
|
+
*
|
|
44
|
+
* Exported for unit testing.
|
|
45
|
+
*/
|
|
46
|
+
export declare function computeWasmOnlyStaleFiles(input: WasmOnlyStaleFilesInput): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Try the native build orchestrator.
|
|
49
|
+
*
|
|
50
|
+
* Returns:
|
|
51
|
+
* - `BuildResult` on success (caller should return it directly).
|
|
52
|
+
* - `'early-exit'` when the orchestrator detected no changes (caller should return undefined).
|
|
53
|
+
* - `undefined` when native is unavailable or skipped (caller should fall through to the JS pipeline).
|
|
54
|
+
*
|
|
55
|
+
* Encapsulates the orchestrator-selection strategy: open `NativeDatabase`,
|
|
56
|
+
* invoke `nativeDb.buildGraph()` (the Rust pipeline), and run post-native
|
|
57
|
+
* structure + analysis fallbacks. Lives in its own file to keep the Rust
|
|
58
|
+
* orchestrator entry point separated from the JS-side `buildGraph()` driver
|
|
59
|
+
* in `pipeline.ts`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function tryNativeOrchestrator(ctx: PipelineContext): Promise<BuildResult | undefined | 'early-exit'>;
|
|
62
|
+
//# sourceMappingURL=native-orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-orchestrator.d.ts","sourceRoot":"","sources":["../../../../../src/domain/graph/builder/stages/native-orchestrator.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAEV,WAAW,EAIZ,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA2CrD;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,2DAA2D;IAC3D,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,kEAAkE;IAClE,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,6DAA6D;IAC7D,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,2EAA2E;IAC3E,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACtC;AAoTD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,EAAE,CAsBlF;AA4RD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC,CAuLjD"}
|