gitnexus 1.6.10-aptos.1 → 1.6.10-aptos.2

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 (53) hide show
  1. package/dist/_shared/graph/types.d.ts +3 -2
  2. package/dist/_shared/graph/types.d.ts.map +1 -1
  3. package/dist/_shared/lbug/schema-constants.d.ts +1 -1
  4. package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
  5. package/dist/_shared/lbug/schema-constants.js +1 -0
  6. package/dist/_shared/lbug/schema-constants.js.map +1 -1
  7. package/dist/core/incremental/subgraph-extract.d.ts +3 -0
  8. package/dist/core/incremental/subgraph-extract.js +17 -1
  9. package/dist/core/ingestion/pipeline-phases/standalone-ingest.d.ts +7 -0
  10. package/dist/core/ingestion/pipeline-phases/standalone-ingest.js +4 -1
  11. package/dist/core/ingestion/pipeline.d.ts +4 -4
  12. package/dist/core/ingestion/pipeline.js +5 -9
  13. package/dist/core/ingestion/process-processor.d.ts +2 -1
  14. package/dist/core/ingestion/process-processor.js +94 -48
  15. package/dist/core/lbug/csv-generator.js +1 -0
  16. package/dist/core/lbug/lbug-adapter.d.ts +20 -9
  17. package/dist/core/lbug/lbug-adapter.js +51 -22
  18. package/dist/core/lbug/node-table-layout.d.ts +1 -0
  19. package/dist/core/lbug/node-table-layout.js +12 -0
  20. package/dist/core/lbug/schema.d.ts +2 -1
  21. package/dist/core/lbug/schema.js +9 -0
  22. package/dist/core/move/compiler-facts.d.ts +5 -0
  23. package/dist/core/move/concurrency.d.ts +16 -0
  24. package/dist/core/move/concurrency.js +36 -0
  25. package/dist/core/move/consistency.d.ts +23 -1
  26. package/dist/core/move/consistency.js +156 -7
  27. package/dist/core/move/constants.d.ts +6 -0
  28. package/dist/core/move/constants.js +6 -0
  29. package/dist/core/move/facts-mapper.d.ts +4 -45
  30. package/dist/core/move/facts-mapper.js +385 -433
  31. package/dist/core/move/function-usage.d.ts +22 -0
  32. package/dist/core/move/function-usage.js +40 -0
  33. package/dist/core/move/install.js +21 -0
  34. package/dist/core/move/mcp-client.d.ts +38 -1
  35. package/dist/core/move/mcp-client.js +101 -21
  36. package/dist/core/move/move-ingest.d.ts +6 -5
  37. package/dist/core/move/move-ingest.js +109 -188
  38. package/dist/core/move/move-linker.d.ts +40 -0
  39. package/dist/core/move/move-linker.js +331 -0
  40. package/dist/core/move/provision.js +66 -8
  41. package/dist/core/move/refs.d.ts +24 -0
  42. package/dist/core/move/refs.js +1 -0
  43. package/dist/core/move/symbol-id.d.ts +2 -0
  44. package/dist/core/move/symbol-id.js +4 -0
  45. package/dist/core/move/type-parser.js +17 -2
  46. package/dist/core/run-analyze.js +71 -49
  47. package/dist/storage/repo-manager.d.ts +13 -1
  48. package/dist/storage/repo-manager.js +6 -1
  49. package/dist/types/pipeline.d.ts +6 -6
  50. package/package.json +1 -1
  51. package/web/assets/{agent-Bqxn-abU.js → agent-NGATqfuu.js} +1 -1
  52. package/web/assets/{index-D1Z3dGGz.js → index-CxGcYetu.js} +3 -3
  53. package/web/index.html +1 -1
@@ -98,9 +98,10 @@ export type NodeProperties = {
98
98
  /**
99
99
  * Node-location precision. `'precise'` = per-symbol file/span from the
100
100
  * move-flow `facts` query; `'module'` = only the containing module/type file
101
- * is known; `'package'` = coarse package-root fallback.
101
+ * is known; `'package'` = coarse package-root fallback; `'external'` =
102
+ * declaration belongs to a dependency outside the indexed repository.
102
103
  */
103
- locationFidelity?: 'precise' | 'module' | 'package';
104
+ locationFidelity?: 'precise' | 'module' | 'package' | 'external';
104
105
  text?: string;
105
106
  /** BasicBlock: space-joined leaf callee names invoked in the block — the
106
107
  * statement-precise inter-procedural reach substrate for impact mode. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,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AC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL"}
@@ -7,7 +7,7 @@
7
7
  * Full DDL schemas remain in each package's own schema.ts because
8
8
  * the CLI uses native LadybugDB and the web uses WASM.
9
9
  */
10
- export declare const NODE_TABLES: readonly ["File", "Folder", "Function", "Class", "Interface", "Method", "CodeElement", "Community", "Process", "Section", "Struct", "Enum", "EnumVariant", "Macro", "Typedef", "Union", "Namespace", "Trait", "Impl", "TypeAlias", "Const", "Static", "Variable", "Property", "Record", "Delegate", "Annotation", "Constructor", "Template", "Module", "Route", "Tool", "BasicBlock"];
10
+ export declare const NODE_TABLES: readonly ["File", "Folder", "Function", "Class", "Interface", "Method", "CodeElement", "Community", "Process", "Section", "Struct", "Enum", "EnumVariant", "Macro", "Typedef", "Union", "Namespace", "Trait", "Impl", "TypeAlias", "Type", "Const", "Static", "Variable", "Property", "Record", "Delegate", "Annotation", "Constructor", "Template", "Module", "Route", "Tool", "BasicBlock"];
11
11
  export type NodeTableName = (typeof NODE_TABLES)[number];
12
12
  export declare const REL_TABLE_NAME = "CodeRelation";
13
13
  export declare const REL_TYPES: readonly ["CONTAINS", "DEFINES", "IMPORTS", "CALLS", "EXTENDS", "IMPLEMENTS", "HAS_METHOD", "HAS_PROPERTY", "ACCESSES", "METHOD_OVERRIDES", "OVERRIDES", "METHOD_IMPLEMENTS", "MEMBER_OF", "STEP_IN_PROCESS", "HANDLES_ROUTE", "FETCHES", "HANDLES_TOOL", "ENTRY_POINT_OF", "WRAPS", "QUERIES", "INJECTS", "FRIEND_OF", "READS_RESOURCE", "WRITES_RESOURCE", "ACQUIRES", "USES_TYPE", "EMITS", "CFG", "REACHING_DEF", "TAINTED", "SANITIZES", "TAINT_PATH", "CDG", "POST_DOMINATE"];
@@ -1 +1 @@
1
- {"version":3,"file":"schema-constants.d.ts","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,uXAmCd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,SAAS,qdA2CZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"schema-constants.d.ts","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,+XAoCd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,SAAS,qdA2CZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
@@ -28,6 +28,7 @@ export const NODE_TABLES = [
28
28
  'Trait',
29
29
  'Impl',
30
30
  'TypeAlias',
31
+ 'Type',
31
32
  'Const',
32
33
  'Static',
33
34
  'Variable',
@@ -1 +1 @@
1
- {"version":3,"file":"schema-constants.js","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,WAAW;IACX,QAAQ;IACR,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,aAAa;IACb,OAAO;IACP,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;IACN,2EAA2E;IAC3E,YAAY;CACJ,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,WAAW,EAAE,mEAAmE;IAChF,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,SAAS;IACT,SAAS;IACT,gEAAgE;IAChE,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,UAAU;IACV,WAAW;IACX,OAAO;IACP,yEAAyE;IACzE,yEAAyE;IACzE,6EAA6E;IAC7E,KAAK;IACL,cAAc;IACd,SAAS;IACT,WAAW;IACX,YAAY;IACZ,4EAA4E;IAC5E,uEAAuE;IACvE,4EAA4E;IAC5E,8EAA8E;IAC9E,KAAK;IACL,eAAe;CACP,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"schema-constants.js","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,WAAW;IACX,QAAQ;IACR,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,aAAa;IACb,OAAO;IACP,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,WAAW;IACX,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;IACN,2EAA2E;IAC3E,YAAY;CACJ,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,WAAW,EAAE,mEAAmE;IAChF,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,SAAS;IACT,SAAS;IACT,gEAAgE;IAChE,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,UAAU;IACV,WAAW;IACX,OAAO;IACP,yEAAyE;IACzE,yEAAyE;IACzE,6EAA6E;IAC7E,KAAK;IACL,cAAc;IACd,SAAS;IACT,WAAW;IACX,YAAY;IACZ,4EAA4E;IAC5E,uEAAuE;IACvE,4EAA4E;IAC5E,8EAA8E;IAC9E,KAAK;IACL,eAAe;CACP,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
@@ -9,6 +9,9 @@
9
9
  * - Every graph-wide node (Community, Process) — these are regenerated
10
10
  * each run by the communities/processes phases and must be fully
11
11
  * rewritten.
12
+ * - Every external dependency node (`locationFidelity: 'external'`, no
13
+ * filePath) — regenerated each run by the standalone ingest phase and
14
+ * delete-all'd by the orchestrator, same contract as Community/Process.
12
15
  * - Every relationship where AT LEAST ONE endpoint is in the writable
13
16
  * set above. Relationships entirely between unchanged-file nodes
14
17
  * are skipped — their rows are still in the DB and re-inserting
@@ -9,6 +9,9 @@
9
9
  * - Every graph-wide node (Community, Process) — these are regenerated
10
10
  * each run by the communities/processes phases and must be fully
11
11
  * rewritten.
12
+ * - Every external dependency node (`locationFidelity: 'external'`, no
13
+ * filePath) — regenerated each run by the standalone ingest phase and
14
+ * delete-all'd by the orchestrator, same contract as Community/Process.
12
15
  * - Every relationship where AT LEAST ONE endpoint is in the writable
13
16
  * set above. Relationships entirely between unchanged-file nodes
14
17
  * are skipped — their rows are still in the DB and re-inserting
@@ -49,6 +52,19 @@
49
52
  */
50
53
  import { createKnowledgeGraph } from '../graph/graph.js';
51
54
  const isGraphWide = (label) => label === 'Community' || label === 'Process';
55
+ /**
56
+ * Externally-declared dependency symbols (compiler-backed ingesters stamp
57
+ * `locationFidelity: 'external'`) carry no filePath, so the file-keyed
58
+ * delete/write cycle can never refresh them — an external symbol first
59
+ * referenced during an incremental run would be skipped here while its edges
60
+ * are extracted, and the dangling endpoints would fail the rel COPY into the
61
+ * per-row fallback (which silently drops them). They are regenerated
62
+ * whole-program by every ingest run, so they get the Community/Process
63
+ * treatment: the orchestrator delete-alls them first
64
+ * (`deleteAllExternalNodes`) and this extractor re-includes them from the
65
+ * fresh graph.
66
+ */
67
+ const isExternalNode = (n) => n.properties?.locationFidelity === 'external';
52
68
  /**
53
69
  * Relationship types whose VALIDITY is a whole-program property, not a
54
70
  * function of their endpoints' files (#2084 M4 U6). `TAINT_PATH` (cross-
@@ -95,7 +111,7 @@ export const extractChangedSubgraph = (fullGraph, toWriteSet) => {
95
111
  const writableNodeIds = new Set();
96
112
  fullGraph.forEachNode((n) => {
97
113
  const filePath = n.properties?.filePath;
98
- const include = (filePath && toWriteSet.has(filePath)) || isGraphWide(n.label);
114
+ const include = (filePath && toWriteSet.has(filePath)) || isGraphWide(n.label) || isExternalNode(n);
99
115
  if (include) {
100
116
  sub.addNode(n);
101
117
  writableNodeIds.add(n.id);
@@ -5,6 +5,13 @@ import type { PipelinePhase } from './types.js';
5
5
  */
6
6
  export interface StandaloneIngestOutput {
7
7
  readonly ingestedFiles: ReadonlySet<string>;
8
+ /**
9
+ * Whether this run produced a complete replacement snapshot of external
10
+ * dependency nodes. `false` tells incremental persistence to preserve the
11
+ * prior snapshot because at least one standalone-ingest input was skipped.
12
+ * Omitted is treated as complete for backward-compatible custom phases.
13
+ */
14
+ readonly externalNodeSnapshotComplete?: boolean;
8
15
  /**
9
16
  * Operator-actionable warnings the ingester wants surfaced in the persistent
10
17
  * CLI summary (e.g. a package it had to skip or ingest at degraded fidelity).
@@ -2,5 +2,8 @@
2
2
  export const emptyStandaloneIngestPhase = {
3
3
  name: 'standaloneIngest',
4
4
  deps: ['structure'],
5
- execute: () => Promise.resolve({ ingestedFiles: new Set() }),
5
+ execute: () => Promise.resolve({
6
+ ingestedFiles: new Set(),
7
+ externalNodeSnapshotComplete: true,
8
+ }),
6
9
  };
@@ -17,7 +17,7 @@
17
17
  import { type PipelineProgress } from '../../_shared/index.js';
18
18
  import { PipelineResult } from '../../types/pipeline.js';
19
19
  import { type StandaloneIngestOutput, type PipelinePhase } from './pipeline-phases/index.js';
20
- export interface PipelineOptions {
20
+ export interface PipelineOptions<TStandaloneIngest extends StandaloneIngestOutput = StandaloneIngestOutput> {
21
21
  /**
22
22
  * Skip MRO, community detection, and process extraction for faster test runs.
23
23
  * The `pruneLocalSymbols` phase still runs — it is graph construction (it cleans
@@ -187,7 +187,7 @@ export interface PipelineOptions {
187
187
  */
188
188
  keepLocalValueSymbols?: boolean;
189
189
  /** Optional compiler-backed or otherwise standalone ingester. */
190
- standaloneIngestPhase?: PipelinePhase<StandaloneIngestOutput>;
190
+ standaloneIngestPhase?: PipelinePhase<TStandaloneIngest>;
191
191
  /**
192
192
  * Extra fetch-wrapper function names to treat as HTTP consumers, threaded
193
193
  * from `.gitnexusrc` `fetchWrappers` via `AnalyzeOptions` (#1589/#1852
@@ -217,5 +217,5 @@ export interface PipelineOptions {
217
217
  * asserts the produced list is byte-identical to the legacy array for every
218
218
  * options combination.
219
219
  */
220
- export declare function buildPhaseList(options?: PipelineOptions): PipelinePhase[];
221
- export declare const runPipelineFromRepo: (repoPath: string, onProgress: (progress: PipelineProgress) => void, options?: PipelineOptions) => Promise<PipelineResult>;
220
+ export declare function buildPhaseList<TStandaloneIngest extends StandaloneIngestOutput>(options?: PipelineOptions<TStandaloneIngest>): PipelinePhase[];
221
+ export declare const runPipelineFromRepo: <TStandaloneIngest extends StandaloneIngestOutput = StandaloneIngestOutput>(repoPath: string, onProgress: (progress: PipelineProgress) => void, options?: PipelineOptions<TStandaloneIngest>) => Promise<PipelineResult<TStandaloneIngest>>;
@@ -81,14 +81,10 @@ export const runPipelineFromRepo = async (repoPath, onProgress, options) => {
81
81
  const { totalFiles, usedWorkerPool } = getPhaseOutput(results, 'parse');
82
82
  let communityResult;
83
83
  let processResult;
84
- // Standalone-ingest warnings, passed through opaquely (language-neutral).
85
- let ingestWarnings;
86
- try {
87
- ingestWarnings = getPhaseOutput(results, 'standaloneIngest').ingestWarnings;
88
- }
89
- catch {
90
- /* phase filtered out of this run — nothing to surface */
91
- }
84
+ // Standalone ingest is always registered (it defaults to the empty phase),
85
+ // so its output — and the language-neutral warnings it passes through — are
86
+ // always present.
87
+ const standaloneIngest = getPhaseOutput(results, 'standaloneIngest');
92
88
  const scopeResolutionOutput = getPhaseOutput(results, 'scopeResolution');
93
89
  const resolutionOutcomes = scopeResolutionOutput.resolutionOutcomes;
94
90
  // Streamed PDG-emit manifest (#2202): present only when streaming was on.
@@ -118,6 +114,6 @@ export const runPipelineFromRepo = async (repoPath, onProgress, options) => {
118
114
  resolutionOutcomes,
119
115
  usedWorkerPool,
120
116
  pdgEmitManifest,
121
- ingestWarnings,
117
+ standaloneIngest,
122
118
  };
123
119
  };
@@ -2,7 +2,8 @@
2
2
  * Process Detection Processor
3
3
  *
4
4
  * Detects execution flows (Processes) in the code graph by:
5
- * 1. Finding entry points (functions with no internal callers)
5
+ * 1. Finding entry points (explicit graph roots plus functions that call
6
+ * others but have few callers)
6
7
  * 2. Tracing forward via CALLS edges (BFS)
7
8
  * 3. Grouping and deduplicating similar paths
8
9
  * 4. Labeling with heuristic names
@@ -2,7 +2,8 @@
2
2
  * Process Detection Processor
3
3
  *
4
4
  * Detects execution flows (Processes) in the code graph by:
5
- * 1. Finding entry points (functions with no internal callers)
5
+ * 1. Finding entry points (explicit graph roots plus functions that call
6
+ * others but have few callers)
6
7
  * 2. Tracing forward via CALLS edges (BFS)
7
8
  * 3. Grouping and deduplicating similar paths
8
9
  * 4. Labeling with heuristic names
@@ -33,14 +34,11 @@ export const processProcesses = async (knowledgeGraph, memberships, onProgress,
33
34
  // Build lookup maps
34
35
  const membershipMap = new Map();
35
36
  memberships.forEach((m) => membershipMap.set(m.nodeId, m.communityId));
36
- const callsEdges = buildCallsGraph(knowledgeGraph);
37
- const reverseCallsEdges = buildReverseCallsGraph(knowledgeGraph);
38
- const nodeMap = new Map();
39
- for (const n of knowledgeGraph.iterNodes())
40
- nodeMap.set(n.id, n);
41
- // Step 1: Find entry points (functions that call others but have few callers)
42
- const entryPoints = findEntryPoints(knowledgeGraph, reverseCallsEdges, callsEdges);
43
- onProgress?.(`Found ${entryPoints.length} entry points, tracing flows...`, 20);
37
+ const { forward: callsEdges, reverse: reverseCallsEdges } = buildCallsAdjacency(knowledgeGraph);
38
+ // Step 1: Find entry points — explicit ENTRY_POINT_OF graph roots plus
39
+ // heuristic ones (functions that call others but have few callers).
40
+ const explicitEntryPointIds = collectExplicitEntryPointIds(knowledgeGraph);
41
+ const entryPoints = findEntryPoints(knowledgeGraph, reverseCallsEdges, callsEdges, explicitEntryPointIds);
44
42
  onProgress?.(`Found ${entryPoints.length} entry points, tracing flows...`, 20);
45
43
  // Step 2: Trace processes from each entry point
46
44
  const allTraces = [];
@@ -55,14 +53,20 @@ export const processProcesses = async (knowledgeGraph, memberships, onProgress,
55
53
  }
56
54
  onProgress?.(`Found ${allTraces.length} traces, deduplicating...`, 60);
57
55
  // Step 3: Deduplicate similar traces (subset removal)
58
- const uniqueTraces = deduplicateTraces(allTraces);
56
+ const uniqueTraces = deduplicateTraces(allTraces, explicitEntryPointIds);
59
57
  // Step 3b: Deduplicate by entry+terminal pair (keep longest path per pair)
60
58
  const endpointDeduped = deduplicateByEndpoints(uniqueTraces);
61
59
  onProgress?.(`Deduped ${uniqueTraces.length} → ${endpointDeduped.length} unique endpoint pairs`, 70);
62
- // Step 4: Limit to max processes (prioritize longer traces)
63
- const limitedTraces = endpointDeduped
64
- .sort((a, b) => b.length - a.length)
65
- .slice(0, cfg.maxProcesses);
60
+ // Step 4: Interleave compiler-declared and heuristic roots so a large
61
+ // explicit API surface cannot consume the entire process budget.
62
+ // Each tier still prefers longer traces.
63
+ const explicitTraces = endpointDeduped
64
+ .filter((trace) => explicitEntryPointIds.has(trace[0]))
65
+ .sort((a, b) => b.length - a.length);
66
+ const heuristicTraces = endpointDeduped
67
+ .filter((trace) => !explicitEntryPointIds.has(trace[0]))
68
+ .sort((a, b) => b.length - a.length);
69
+ const limitedTraces = interleaveTiers(explicitTraces, heuristicTraces).slice(0, cfg.maxProcesses);
66
70
  onProgress?.(`Creating ${limitedTraces.length} process nodes...`, 80);
67
71
  // Step 5: Create process nodes
68
72
  const processes = [];
@@ -81,8 +85,8 @@ export const processProcesses = async (knowledgeGraph, memberships, onProgress,
81
85
  // Determine process type
82
86
  const processType = communities.length > 1 ? 'cross_community' : 'intra_community';
83
87
  // Generate label
84
- const entryNode = nodeMap.get(entryPointId);
85
- const terminalNode = nodeMap.get(terminalId);
88
+ const entryNode = knowledgeGraph.getNode(entryPointId);
89
+ const terminalNode = knowledgeGraph.getNode(terminalId);
86
90
  const entryName = entryNode?.properties.name || 'Unknown';
87
91
  const terminalName = terminalNode?.properties.name || 'Unknown';
88
92
  const heuristicLabel = `${capitalize(entryName)} → ${capitalize(terminalName)}`;
@@ -130,29 +134,55 @@ export const processProcesses = async (knowledgeGraph, memberships, onProgress,
130
134
  * traces to jump across unrelated code areas.
131
135
  */
132
136
  const MIN_TRACE_CONFIDENCE = 0.5;
133
- const buildCallsGraph = (graph) => {
134
- const adj = new Map();
137
+ /** Build forward and reverse CALLS adjacency lists in one relationship scan. */
138
+ const buildCallsAdjacency = (graph) => {
139
+ const forward = new Map();
140
+ const reverse = new Map();
141
+ const push = (adj, key, value) => {
142
+ const bucket = adj.get(key);
143
+ if (bucket === undefined)
144
+ adj.set(key, [value]);
145
+ else
146
+ bucket.push(value);
147
+ };
135
148
  for (const rel of graph.iterRelationships()) {
136
149
  if (rel.type === 'CALLS' && rel.confidence >= MIN_TRACE_CONFIDENCE) {
137
- if (!adj.has(rel.sourceId)) {
138
- adj.set(rel.sourceId, []);
139
- }
140
- adj.get(rel.sourceId).push(rel.targetId);
150
+ push(forward, rel.sourceId, rel.targetId);
151
+ push(reverse, rel.targetId, rel.sourceId);
141
152
  }
142
153
  }
143
- return adj;
154
+ return { forward, reverse };
144
155
  };
145
- const buildReverseCallsGraph = (graph) => {
146
- const adj = new Map();
147
- for (const rel of graph.iterRelationships()) {
148
- if (rel.type === 'CALLS' && rel.confidence >= MIN_TRACE_CONFIDENCE) {
149
- if (!adj.has(rel.targetId)) {
150
- adj.set(rel.targetId, []);
151
- }
152
- adj.get(rel.targetId).push(rel.sourceId);
153
- }
156
+ /** IDs of nodes carrying a pre-phase ENTRY_POINT_OF edge (compiler-backed
157
+ * runtime/API roots stamped by the standalone ingest phase). */
158
+ function collectExplicitEntryPointIds(graph) {
159
+ const ids = new Set();
160
+ for (const rel of graph.iterRelationshipsByType('ENTRY_POINT_OF')) {
161
+ // Only callable roots qualify. Route/Tool→Process ENTRY_POINT_OF edges
162
+ // are created after this phase; the label filter keeps them out even if
163
+ // phase ordering ever changes.
164
+ const label = graph.getNode(rel.sourceId)?.label;
165
+ if (label === 'Function' || label === 'Method')
166
+ ids.add(rel.sourceId);
154
167
  }
155
- return adj;
168
+ return ids;
169
+ }
170
+ /** Global cap on heuristic (non-explicit) entry points, to prevent explosion
171
+ * on large polyglot repos. Explicit graph roots are interleaved separately. */
172
+ const HEURISTIC_ENTRY_POINT_BUDGET = 200;
173
+ /** Comparator combinator: explicit items first, then a secondary order. */
174
+ const explicitFirst = (isExplicit, then) => (a, b) => Number(isExplicit(b)) - Number(isExplicit(a)) || then(a, b);
175
+ /** Alternate between two independently ranked tiers, starting with primary. */
176
+ const interleaveTiers = (primary, secondary) => {
177
+ const interleaved = [];
178
+ const length = Math.max(primary.length, secondary.length);
179
+ for (let i = 0; i < length; i++) {
180
+ if (i < primary.length)
181
+ interleaved.push(primary[i]);
182
+ if (i < secondary.length)
183
+ interleaved.push(secondary[i]);
184
+ }
185
+ return interleaved;
156
186
  };
157
187
  /**
158
188
  * Find functions/methods that are good entry points for tracing.
@@ -164,8 +194,14 @@ const buildReverseCallsGraph = (graph) => {
164
194
  *
165
195
  * Test files are excluded entirely.
166
196
  */
167
- const findEntryPoints = (graph, reverseCallsEdges, callsEdges) => {
197
+ const findEntryPoints = (graph, reverseCallsEdges, callsEdges, explicitEntryPointIds) => {
168
198
  const symbolTypes = new Set(['Function', 'Method']);
199
+ // ENTRY_POINT_OF is the graph-wide, language-neutral signal for a known
200
+ // runtime/API root. Only edges emitted BEFORE this phase count — today
201
+ // that is compiler-backed standalone ingesters; the
202
+ // Route/Tool ENTRY_POINT_OF edges are created after process extraction
203
+ // and point Route/Tool→Process, so they never land here. These roots must
204
+ // survive the global heuristic top-200 budget on large polyglot repos.
169
205
  const entryPointCandidates = [];
170
206
  for (const node of graph.iterNodes()) {
171
207
  if (!symbolTypes.has(node.label))
@@ -182,17 +218,22 @@ const findEntryPoints = (graph, reverseCallsEdges, callsEdges) => {
182
218
  // Calculate entry point score using new scoring system
183
219
  const { score: baseScore, reasons } = calculateEntryPointScore(node.properties.name, (node.properties.language ?? SupportedLanguages.JavaScript), node.properties.isExported ?? false, callers.length, callees.length, filePath);
184
220
  let score = baseScore;
221
+ const explicit = explicitEntryPointIds.has(node.id);
222
+ if (explicit)
223
+ reasons.push('graph-entry-point');
185
224
  const astFrameworkMultiplier = node.properties.astFrameworkMultiplier ?? 1.0;
186
225
  if (astFrameworkMultiplier > 1.0) {
187
226
  score *= astFrameworkMultiplier;
188
227
  reasons.push(`framework-ast:${node.properties.astFrameworkReason || 'decorator'}`);
189
228
  }
190
- if (score > 0) {
191
- entryPointCandidates.push({ id: node.id, score, reasons });
229
+ if (explicit || score > 0) {
230
+ entryPointCandidates.push({ id: node.id, score, reasons, explicit });
192
231
  }
193
232
  }
194
- // Sort by score descending and return top candidates
195
- const sorted = entryPointCandidates.sort((a, b) => b.score - a.score);
233
+ // Rank each tier independently, then interleave them. This retains the
234
+ // explicit-root guarantee without letting a large compiler-backed package
235
+ // starve every heuristic root before the trace budget is reached.
236
+ const sorted = entryPointCandidates.sort(explicitFirst((candidate) => candidate.explicit, (a, b) => b.score - a.score));
196
237
  // DEBUG: Log top candidates with new scoring details
197
238
  if (sorted.length > 0 && isDev) {
198
239
  logger.info(`[Process] Top 10 entry point candidates (new scoring):`);
@@ -204,9 +245,11 @@ const findEntryPoints = (graph, reverseCallsEdges, callsEdges) => {
204
245
  logger.info(` score: ${c.score.toFixed(2)} = [${c.reasons.join(' × ')}]`);
205
246
  });
206
247
  }
207
- return sorted
208
- .slice(0, 200) // Limit to prevent explosion
209
- .map((c) => c.id);
248
+ const explicit = sorted.filter((candidate) => candidate.explicit);
249
+ const heuristic = sorted
250
+ .filter((candidate) => !candidate.explicit)
251
+ .slice(0, HEURISTIC_ENTRY_POINT_BUDGET);
252
+ return interleaveTiers(explicit, heuristic).map((candidate) => candidate.id);
210
253
  };
211
254
  // ============================================================================
212
255
  // HELPER: Trace from entry point (BFS)
@@ -262,21 +305,24 @@ const traceFromEntryPoint = (entryId, callsEdges, config) => {
262
305
  * Merge traces that are subsets of other traces.
263
306
  * Keep longer traces, remove redundant shorter ones.
264
307
  */
265
- const deduplicateTraces = (traces) => {
308
+ const deduplicateTraces = (traces, explicitEntryPointIds = new Set()) => {
266
309
  if (traces.length === 0)
267
310
  return [];
268
311
  // Sort by length descending
269
312
  const sorted = [...traces].sort((a, b) => b.length - a.length);
270
313
  const unique = [];
314
+ // Cache each kept trace's join key so the redundancy scan below doesn't
315
+ // recompute `existing.join('->')` on every comparison.
316
+ const uniqueKeys = [];
271
317
  for (const trace of sorted) {
272
- // Check if this trace is a subset of any already-added trace
273
318
  const traceKey = trace.join('->');
274
- const isSubset = unique.some((existing) => {
275
- const existingKey = existing.join('->');
276
- return existingKey.includes(traceKey);
277
- });
278
- if (!isSubset) {
319
+ // Explicit entry points dedupe on exact equality; heuristic traces are
320
+ // dropped when a longer kept trace already contains them as a substring.
321
+ const exactOnly = explicitEntryPointIds.has(trace[0]);
322
+ const isRedundant = uniqueKeys.some((existingKey) => exactOnly ? existingKey === traceKey : existingKey.includes(traceKey));
323
+ if (!isRedundant) {
279
324
  unique.push(trace);
325
+ uniqueKeys.push(traceKey);
280
326
  }
281
327
  }
282
328
  return unique;
@@ -449,6 +449,7 @@ export const streamAllCSVsToDisk = async (graph, repoPath, csvDir, onNodePhaseCo
449
449
  const MULTI_LANG_TYPES = [
450
450
  'Struct',
451
451
  'Enum',
452
+ 'Type',
452
453
  'EnumVariant',
453
454
  'Macro',
454
455
  'Typedef',
@@ -295,12 +295,7 @@ export declare const deleteNodesForFile: (filePath: string, dbPath?: string) =>
295
295
  }>;
296
296
  /**
297
297
  * Chunk size for {@link deleteNodesForFiles}. 200 paths keeps each
298
- * statement ~13KB (well inside parser limits) while a ~700-file write set
299
- * still collapses from ~13,000 statements to 124: 31 statements per chunk
300
- * (1 CodeEmbedding join-delete + 30 filePath-bearing node tables — the
301
- * 32-table NODE_TABLES roster minus Community/Process) × 4 chunks. The
302
- * original "~40" claim under-counted the per-chunk statement fan-out
303
- * (tri-review 4669518496 accuracy sweep).
298
+ * statement ~13KB while batching one delete per file-backed table.
304
299
  */
305
300
  export declare const DELETE_FILES_CHUNK_SIZE = 200;
306
301
  /**
@@ -320,9 +315,7 @@ export declare const DELETE_FILES_CHUNK_SIZE = 200;
320
315
  * binder error on the embedding join-delete: a DB created without
321
316
  * EMBEDDING_SCHEMA cannot own embedding rows, so skipping that one
322
317
  * statement is sound, while failing would brick every incremental run on
323
- * such a DB until `--force`. Statement count per chunk is unchanged by the
324
- * multi-label join: 1 embedding join-delete + 30 node-table deletes = 31
325
- * (the rejected per-label fallback shape would have been 19 + 30 = 49).
318
+ * such a DB until `--force`.
326
319
  * Singleton-connection only: the analyze writeback owns the write lock,
327
320
  * and `queryAndDrain` routes through `withConnLock` for it (the WAL
328
321
  * checkpoint driver is live during this).
@@ -381,6 +374,24 @@ export declare const queryImportersBatch: (targetFilePaths: readonly string[], o
381
374
  export declare const deleteAllCommunitiesAndProcesses: () => Promise<{
382
375
  nodesDeleted: number;
383
376
  }>;
377
+ /**
378
+ * Drop every externally-declared dependency node (and, via DETACH, its
379
+ * edges). Used at the start of an incremental writeback: external nodes have
380
+ * no filePath, so `deleteNodesForFiles` can never remove them and the
381
+ * file-keyed write set can never refresh them. The standalone ingest phase
382
+ * regenerates the full external surface every run and
383
+ * `extractChangedSubgraph` re-includes it (`isExternalNode`), so
384
+ * delete-all-then-rebuild keeps first-referenced externals from dangling
385
+ * their edges — same contract as Community/Process. Crash-recovery matches
386
+ * INJECTS: delete-then-COPY is not atomic, and the `incrementalInProgress`
387
+ * dirty flag forces a full rebuild if we die between them.
388
+ *
389
+ * Every external label is backticked unconditionally so this table list stays
390
+ * safe even if it diverges from BACKTICK_TABLES in the future.
391
+ */
392
+ export declare const deleteAllExternalNodes: () => Promise<{
393
+ nodesDeleted: number;
394
+ }>;
384
395
  /**
385
396
  * Drop every interprocedural `TAINT_PATH` relationship (#2084 M4 U6). Used at
386
397
  * the start of an incremental `--pdg` writeback so the `taintSummaries` phase
@@ -1072,6 +1072,7 @@ const BACKTICK_TABLES = new Set([
1072
1072
  'Trait',
1073
1073
  'Impl',
1074
1074
  'TypeAlias',
1075
+ 'Type',
1075
1076
  'Const',
1076
1077
  'Static',
1077
1078
  'Property',
@@ -2019,12 +2020,7 @@ export const deleteNodesForFile = async (filePath, dbPath) => {
2019
2020
  };
2020
2021
  /**
2021
2022
  * Chunk size for {@link deleteNodesForFiles}. 200 paths keeps each
2022
- * statement ~13KB (well inside parser limits) while a ~700-file write set
2023
- * still collapses from ~13,000 statements to 124: 31 statements per chunk
2024
- * (1 CodeEmbedding join-delete + 30 filePath-bearing node tables — the
2025
- * 32-table NODE_TABLES roster minus Community/Process) × 4 chunks. The
2026
- * original "~40" claim under-counted the per-chunk statement fan-out
2027
- * (tri-review 4669518496 accuracy sweep).
2023
+ * statement ~13KB while batching one delete per file-backed table.
2028
2024
  */
2029
2025
  export const DELETE_FILES_CHUNK_SIZE = 200;
2030
2026
  /**
@@ -2044,9 +2040,7 @@ export const DELETE_FILES_CHUNK_SIZE = 200;
2044
2040
  * binder error on the embedding join-delete: a DB created without
2045
2041
  * EMBEDDING_SCHEMA cannot own embedding rows, so skipping that one
2046
2042
  * statement is sound, while failing would brick every incremental run on
2047
- * such a DB until `--force`. Statement count per chunk is unchanged by the
2048
- * multi-label join: 1 embedding join-delete + 30 node-table deletes = 31
2049
- * (the rejected per-label fallback shape would have been 19 + 30 = 49).
2043
+ * such a DB until `--force`.
2050
2044
  * Singleton-connection only: the analyze writeback owns the write lock,
2051
2045
  * and `queryAndDrain` routes through `withConnLock` for it (the WAL
2052
2046
  * checkpoint driver is live during this).
@@ -2220,32 +2214,37 @@ export const queryImportersBatch = async (targetFilePaths, options = {}) => {
2220
2214
  return [...importers].sort();
2221
2215
  };
2222
2216
  /**
2223
- * Drop every Community and Process node (and their MEMBER_OF /
2224
- * STEP_IN_PROCESS edges via DETACH DELETE). Used at the start of an
2225
- * incremental run so the communities and processes phases regenerate
2226
- * them from scratch on the merged graph required for the
2227
- * "Leiden runs on the FULL graph" correctness invariant.
2217
+ * Shared mechanics for the delete-all-nodes-by-label family
2218
+ * ({@link deleteAllCommunitiesAndProcesses}, {@link deleteAllExternalNodes}).
2219
+ * For each label: count matching nodes, then `DETACH DELETE` them if any.
2220
+ * The whole loop runs inside `withConnLock` so it cannot execute concurrently
2221
+ * with the WAL-checkpoint driver's CHECKPOINT on the singleton connection
2222
+ * (this runs during incremental --pdg writeback while the driver is live;
2223
+ * mirrors the wrapped deleteAllInterprocTaintPaths / deleteAllCallSummaries).
2224
+ * A missing table on a freshly-initialized DB is swallowed — it simply holds
2225
+ * no rows to delete.
2226
+ *
2227
+ * `labels` are pre-formatted label tokens (the caller decides backticking).
2228
+ * `filter` is an optional Cypher predicate on the bound node `n`
2229
+ * (e.g. `WHERE n.locationFidelity = 'external'`); omitted → delete all rows.
2228
2230
  */
2229
- export const deleteAllCommunitiesAndProcesses = async () => {
2231
+ const deleteAllNodesByLabels = async (labels, filter = '') => {
2230
2232
  const c = conn;
2231
2233
  if (!c) {
2232
2234
  throw new Error('LadybugDB not initialized. Call initLbug first.');
2233
2235
  }
2234
- // count + DETACH DELETE run inside the connection lock so they cannot execute
2235
- // concurrently with the WAL-checkpoint driver's CHECKPOINT on the singleton
2236
- // connection. This runs during incremental --pdg writeback while the driver is
2237
- // live; mirrors the wrapped deleteAllInterprocTaintPaths / deleteAllCallSummaries.
2236
+ const clause = filter ? ` ${filter}` : '';
2238
2237
  return withConnLock(async () => {
2239
2238
  let nodesDeleted = 0;
2240
- for (const label of ['Community', 'Process']) {
2239
+ for (const label of labels) {
2241
2240
  let countResult;
2242
2241
  try {
2243
- countResult = await c.query(`MATCH (n:${label}) RETURN count(n) AS cnt`);
2242
+ countResult = await c.query(`MATCH (n:${label})${clause} RETURN count(n) AS cnt`);
2244
2243
  const result = Array.isArray(countResult) ? countResult[0] : countResult;
2245
2244
  const rows = await result.getAll();
2246
2245
  const count = Number(rows[0]?.cnt ?? rows[0]?.[0] ?? 0);
2247
2246
  if (count > 0) {
2248
- await closeQueryResults(await c.query(`MATCH (n:${label}) DETACH DELETE n`));
2247
+ await closeQueryResults(await c.query(`MATCH (n:${label})${clause} DETACH DELETE n`));
2249
2248
  nodesDeleted += count;
2250
2249
  }
2251
2250
  }
@@ -2260,6 +2259,36 @@ export const deleteAllCommunitiesAndProcesses = async () => {
2260
2259
  return { nodesDeleted };
2261
2260
  });
2262
2261
  };
2262
+ /**
2263
+ * Drop every Community and Process node (and their MEMBER_OF /
2264
+ * STEP_IN_PROCESS edges via DETACH DELETE). Used at the start of an
2265
+ * incremental run so the communities and processes phases regenerate
2266
+ * them from scratch on the merged graph — required for the
2267
+ * "Leiden runs on the FULL graph" correctness invariant.
2268
+ */
2269
+ export const deleteAllCommunitiesAndProcesses = async () => deleteAllNodesByLabels(['Community', 'Process']);
2270
+ /**
2271
+ * Node tables that can hold externally-declared dependency symbols
2272
+ * (`locationFidelity = 'external'`, filePath '') — the labels
2273
+ * `ExternalMoveSymbols` in move-linker materializes. Extend alongside it.
2274
+ */
2275
+ const EXTERNAL_NODE_TABLES = ['Module', 'Function', 'Type'];
2276
+ /**
2277
+ * Drop every externally-declared dependency node (and, via DETACH, its
2278
+ * edges). Used at the start of an incremental writeback: external nodes have
2279
+ * no filePath, so `deleteNodesForFiles` can never remove them and the
2280
+ * file-keyed write set can never refresh them. The standalone ingest phase
2281
+ * regenerates the full external surface every run and
2282
+ * `extractChangedSubgraph` re-includes it (`isExternalNode`), so
2283
+ * delete-all-then-rebuild keeps first-referenced externals from dangling
2284
+ * their edges — same contract as Community/Process. Crash-recovery matches
2285
+ * INJECTS: delete-then-COPY is not atomic, and the `incrementalInProgress`
2286
+ * dirty flag forces a full rebuild if we die between them.
2287
+ *
2288
+ * Every external label is backticked unconditionally so this table list stays
2289
+ * safe even if it diverges from BACKTICK_TABLES in the future.
2290
+ */
2291
+ export const deleteAllExternalNodes = async () => deleteAllNodesByLabels(EXTERNAL_NODE_TABLES.map((t) => `\`${t}\``), `WHERE n.locationFidelity = 'external'`);
2263
2292
  /**
2264
2293
  * Shared mechanics for the delete-all-relationships-of-one-type family
2265
2294
  * ({@link deleteAllInterprocTaintPaths}, {@link deleteAllCallSummaries},