@opensip-cli/graph-typescript 0.1.10 → 0.1.11

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.
@@ -0,0 +1,143 @@
1
+ import { appendEdge, ownerEdgeKey, resolveSpecifierToPackage, truncateForCallEdge, } from '@opensip-cli/graph';
2
+ import ts from 'typescript';
3
+ import { DeclShape, functionLikeFromDeclaration } from './edge-helpers/declaration-to-node.js';
4
+ import { unaliasSymbol } from './edge-helpers/unalias-symbol.js';
5
+ import { resolveByCatalogFallback } from './edge-resolvers/catalog-fallback.js';
6
+ import { resolveDirectCall } from './edge-resolvers/direct-call.js';
7
+ import { resolveJsxElement } from './edge-resolvers/jsx-element.js';
8
+ import { resolveNewExpression } from './edge-resolvers/new-expression.js';
9
+ import { resolvePolymorphicCall } from './edge-resolvers/polymorphic.js';
10
+ import { resolvePropertyAccessCall } from './edge-resolvers/property-access.js';
11
+ import { calleeAnchorNode } from './edge-resolvers/syntactic.js';
12
+ import { isValueReference, resolveShorthandAssignment, resolveValueReference, } from './edges-value-reference.js';
13
+ export function tsPosition(node, sourceFile) {
14
+ const anchor = calleeAnchorNode(node).getStart(sourceFile);
15
+ const anchorLC = sourceFile.getLineAndCharacterOfPosition(anchor);
16
+ return {
17
+ line: anchorLC.line + 1,
18
+ column: anchorLC.character,
19
+ text: sourceFile.text.slice(node.getStart(sourceFile), node.getEnd()),
20
+ };
21
+ }
22
+ export function pushCallEdge(node, sourceFile, verdict, ownerKey, sink) {
23
+ const { edgesByOwner: callsByHash, stats } = sink;
24
+ stats.totalCallSites++;
25
+ const pos = tsPosition(node, sourceFile);
26
+ const edge = {
27
+ to: verdict.to,
28
+ line: pos.line,
29
+ column: pos.column,
30
+ resolution: verdict.resolution,
31
+ confidence: verdict.confidence,
32
+ text: truncateForCallEdge(pos.text),
33
+ discarded: isReturnValueDiscarded(node),
34
+ };
35
+ appendEdge(callsByHash, ownerKey, edge);
36
+ stats.apply(edge);
37
+ }
38
+ function verdictEntry(predicate, resolve) {
39
+ return { predicate, resolve: (n, c) => resolve(n, c) };
40
+ }
41
+ const isJsxLikeOpening = (n) => ts.isJsxOpeningElement(n) || ts.isJsxSelfClosingElement(n);
42
+ const isValueRefIdentifier = (n) => ts.isIdentifier(n) && isValueReference(n);
43
+ const VERDICT_TABLE = [
44
+ verdictEntry(ts.isCallExpression, (n, c) => dispatchCall(n, c)),
45
+ verdictEntry(ts.isNewExpression, (n, c) => resolveNewExpression(n, c)),
46
+ verdictEntry(isJsxLikeOpening, (n, c) => resolveJsxElement(n, c)),
47
+ verdictEntry(isValueRefIdentifier, (n, c) => {
48
+ const v = resolveValueReference(n, c);
49
+ return v.to.length > 0 ? v : null;
50
+ }),
51
+ verdictEntry(ts.isShorthandPropertyAssignment, (n, c) => {
52
+ const v = resolveShorthandAssignment(n, c);
53
+ return v.to.length > 0 ? v : null;
54
+ }),
55
+ ];
56
+ export function computeVerdict(node, ctx) {
57
+ for (const entry of VERDICT_TABLE) {
58
+ if (entry.predicate(node))
59
+ return entry.resolve(node, ctx);
60
+ }
61
+ return null;
62
+ }
63
+ function dispatchCall(node, ctx) {
64
+ if (ts.isIdentifier(node.expression)) {
65
+ const direct = resolveDirectCall(node, ctx);
66
+ if (direct.to.length > 0)
67
+ return direct;
68
+ return fallbackWithBinding(node.expression, node.expression.text, ctx);
69
+ }
70
+ if (ts.isPropertyAccessExpression(node.expression)) {
71
+ const direct = resolvePropertyAccessCall(node, ctx);
72
+ if (direct.to.length > 0)
73
+ return direct;
74
+ const poly = resolvePolymorphicCall(node, ctx);
75
+ if (poly.to.length > 0)
76
+ return poly;
77
+ return fallbackWithBinding(node.expression, node.expression.name.text, ctx);
78
+ }
79
+ return { to: [], resolution: 'unknown', confidence: 'low' };
80
+ }
81
+ const UNRESOLVED_VERDICT = { to: [], resolution: 'unknown', confidence: 'low' };
82
+ function fallbackWithBinding(calleeExpr, name, ctx) {
83
+ if (!hasProjectBinding(calleeExpr, name, ctx))
84
+ return UNRESOLVED_VERDICT;
85
+ return resolveByCatalogFallback(name, ctx.catalog);
86
+ }
87
+ function hasProjectBinding(calleeExpr, name, ctx) {
88
+ if (symbolHasInProjectSourceDecl(calleeExpr, ctx))
89
+ return true;
90
+ const spec = ctx.importSpecifiers.get(name);
91
+ if (spec !== undefined) {
92
+ if (spec.startsWith('.'))
93
+ return true;
94
+ return resolveSpecifierToPackage(spec, ctx.crossPackage.manifestIndex) !== undefined;
95
+ }
96
+ return false;
97
+ }
98
+ const CALLABLE_DECL = DeclShape.FunctionDeclaration |
99
+ DeclShape.ArrowFunction |
100
+ DeclShape.FunctionExpression |
101
+ DeclShape.MethodDeclaration |
102
+ DeclShape.ConstructorDeclaration |
103
+ DeclShape.Accessor |
104
+ DeclShape.VariableInitializer |
105
+ DeclShape.PropertyAssignmentInitializer;
106
+ function symbolHasInProjectSourceDecl(calleeExpr, ctx) {
107
+ const symbol = ctx.typeChecker.getSymbolAtLocation(calleeExpr);
108
+ if (!symbol)
109
+ return false;
110
+ const real = unaliasSymbol(symbol, ctx.typeChecker);
111
+ for (const d of real.getDeclarations() ?? []) {
112
+ if (!d.getSourceFile().isDeclarationFile &&
113
+ functionLikeFromDeclaration(d, CALLABLE_DECL) !== null) {
114
+ return true;
115
+ }
116
+ }
117
+ return false;
118
+ }
119
+ export function isReturnValueDiscarded(node) {
120
+ let parent = node.parent;
121
+ while (parent) {
122
+ if (ts.isParenthesizedExpression(parent) || ts.isAwaitExpression(parent)) {
123
+ parent = parent.parent;
124
+ continue;
125
+ }
126
+ return ts.isExpressionStatement(parent);
127
+ }
128
+ return false;
129
+ }
130
+ export function rebuildCatalog(catalog, callsByHash) {
131
+ const functions = Object.create(null);
132
+ for (const name of Object.keys(catalog.functions)) {
133
+ const occs = catalog.functions[name];
134
+ if (!occs)
135
+ continue;
136
+ functions[name] = occs.map((o) => ({
137
+ ...o,
138
+ calls: callsByHash.get(ownerEdgeKey(o.bodyHash, o.filePath)) ?? [],
139
+ }));
140
+ }
141
+ return { ...catalog, functions };
142
+ }
143
+ //# sourceMappingURL=edges-dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edges-dispatch.js","sourceRoot":"","sources":["../src/edges-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAWpC,MAAM,UAAU,UAAU,CACxB,IAAa,EACb,UAAyB;IAMzB,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,UAAU,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;IAClE,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,CAAC;QACvB,MAAM,EAAE,QAAQ,CAAC,SAAS;QAC1B,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,C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12
12
  * 1).
13
13
  */
14
- import ts from 'typescript';
15
14
  import type { CallSiteRecord } from './walk.js';
16
15
  import type { Catalog, ResolutionStats } from '@opensip-cli/graph';
17
- /** Output of TS edge resolution: catalog (with edges populated) and per-stage stats. */
16
+ import type ts from 'typescript';
17
+ export { isReturnValueDiscarded } from './edges-dispatch.js';
18
18
  export interface EdgeResolutionOutput {
19
19
  readonly catalog: Catalog;
20
20
  readonly resolutionStats: ResolutionStats;
21
21
  }
22
- /** Input for re-resolving edges from cached {@link CallSiteRecord} arrays (warm path). */
23
22
  export interface EdgeResolutionFromRecordsInput {
24
23
  readonly catalog: Catalog;
25
24
  readonly program: ts.Program;
26
25
  readonly projectDirAbs: string;
27
26
  readonly callSites: readonly CallSiteRecord[];
28
27
  }
29
- /**
30
- * Stage 2 entry point: resolve a pre-collected list of call-site records
31
- * produced by `walkProgram` (no AST re-descent). The orchestrator's
32
- * `resolveCallSitesAdapter` drives this directly with the records the walk
33
- * already emitted.
34
- */
35
28
  export declare function resolveEdgesFromRecords(input: EdgeResolutionFromRecordsInput): Promise<EdgeResolutionOutput>;
36
- /** Input for the fast (syntactic, checker-free) resolve path. */
37
29
  export interface EdgeResolutionSyntacticInput {
38
30
  readonly catalog: Catalog;
39
31
  readonly projectDirAbs: string;
40
32
  readonly callSites: readonly CallSiteRecord[];
41
33
  }
42
- /**
43
- * Fast-tier Stage 2 entry point: resolve the same pre-collected call-site
44
- * records WITHOUT a `ts.Program` or type checker. Creation edges are
45
- * static and handled identically to the exact path; call edges are
46
- * resolved syntactically (callee name + the file's import graph) and
47
- * labeled `resolution: 'syntactic'` with capped confidence (never
48
- * `'high'`). The output shape is identical to {@link resolveEdgesFromRecords}
49
- * — only the verdicts differ — so the catalog stitches the same way.
50
- *
51
- * Stats stay honest: fast edges land in `resolvedMedium`/`resolvedLow`/
52
- * `unresolved`, never `resolvedHigh`.
53
- */
54
34
  export declare function resolveEdgesSyntactic(input: EdgeResolutionSyntacticInput): Promise<EdgeResolutionOutput>;
55
- /**
56
- * The call's return value is discarded when the call expression is the
57
- * entire expression of an ExpressionStatement (`foo();`). Anything else
58
- * — assignment RHS, return value, argument, conditional, member chain
59
- * — consumes the return value.
60
- *
61
- * `await foo()` and `(foo())` wrappers are unwrapped so the underlying
62
- * intent is preserved.
63
- */
64
- export declare function isReturnValueDiscarded(node: ts.Node): boolean;
65
35
  //# sourceMappingURL=edges.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../src/edges.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AAaH,OAAO,EAAE,MAAM,YAAY,CAAC;AA0B5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAEV,OAAO,EAGP,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAmC5B,wFAAwF;AACxF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC3C;AAED,0FAA0F;AAC1F,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,oBAAoB,CAAC,CA0E/B;AAED,iEAAiE;AACjE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED;;;;;;;;;;;GAW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js CHANGED
@@ -1,4 +1,3 @@
1
- // @fitness-ignore-file file-length-limit -- Stage 2 edge resolver covering call+import+dependency edges in one cohesive pass; the resolution logic is contiguous and a split would push state across module boundaries.
2
1
  /**
3
2
  * Stage 2 — Edge resolution.
4
3
  *
@@ -14,83 +13,34 @@
14
13
  */
15
14
  import { relative, sep } from 'node:path';
16
15
  import { logger } from '@opensip-cli/core';
17
- import { appendEdge, createMutableStats, ownerEdgeKey, pushCreationEdge as pushSharedCreationEdge, resolveSpecifierToPackage, truncateForCallEdge, } from '@opensip-cli/graph';
18
- import ts from 'typescript';
16
+ import { createMutableStats, ownerEdgeKey, pushCreationEdge as pushSharedCreationEdge, } from '@opensip-cli/graph';
19
17
  import { buildCrossPackageContext } from './edge-helpers/cross-package-context.js';
20
- import { DeclShape, functionLikeFromDeclaration } from './edge-helpers/declaration-to-node.js';
21
- import { unaliasSymbol } from './edge-helpers/unalias-symbol.js';
22
- import { resolveByCatalogFallback } from './edge-resolvers/catalog-fallback.js';
23
- import { resolveDirectCall } from './edge-resolvers/direct-call.js';
24
- import { resolveJsxElement } from './edge-resolvers/jsx-element.js';
25
- import { resolveNewExpression } from './edge-resolvers/new-expression.js';
26
- import { resolvePolymorphicCall } from './edge-resolvers/polymorphic.js';
27
- import { resolvePropertyAccessCall } from './edge-resolvers/property-access.js';
28
- import { buildImportIndex, buildImportSpecifierIndex, calleeAnchorNode, collectKnownFiles, resolveSyntactic, } from './edge-resolvers/syntactic.js';
29
- import { isValueReference, resolveShorthandAssignment, resolveValueReference, } from './edges-value-reference.js';
30
- /** How many call sites to process between cooperative event-loop yields. Tuned
31
- * so the live view's 80ms clock ticks several times per second during a long
32
- * resolve, while keeping the macrotask-hop count (and its overhead) tiny. */
18
+ import { buildImportIndex, buildImportSpecifierIndex, collectKnownFiles, resolveSyntactic, } from './edge-resolvers/syntactic.js';
19
+ import { computeVerdict, pushCallEdge, rebuildCatalog, tsPosition } from './edges-dispatch.js';
20
+ export { isReturnValueDiscarded } from './edges-dispatch.js';
33
21
  const YIELD_EVERY_CALL_SITES = 250;
34
- /** Yield to the event loop once (a macrotask hop), so the in-process live view
35
- * can paint a frame mid-stage (ADR-0016). */
36
22
  function yieldToEventLoop() {
37
23
  return new Promise((resolve) => {
38
24
  setImmediate(resolve);
39
25
  });
40
26
  }
41
- function tsPosition(node, sourceFile) {
42
- // Anchor the edge identity at the CALLEE token (method name / callee / class),
43
- // not the whole expression's start — so chained calls `a().b()` don't collide
44
- // on one (line,column) key. The display TEXT stays the whole expression.
45
- const anchor = calleeAnchorNode(node).getStart(sourceFile);
46
- const anchorLC = sourceFile.getLineAndCharacterOfPosition(anchor);
47
- return {
48
- line: anchorLC.line + 1,
49
- column: anchorLC.character,
50
- text: sourceFile.text.slice(node.getStart(sourceFile), node.getEnd()),
51
- };
52
- }
53
- /**
54
- * Stage 2 entry point: resolve a pre-collected list of call-site records
55
- * produced by `walkProgram` (no AST re-descent). The orchestrator's
56
- * `resolveCallSitesAdapter` drives this directly with the records the walk
57
- * already emitted.
58
- */
59
27
  export async function resolveEdgesFromRecords(input) {
60
28
  logger.info({ evt: 'graph.edges.start', module: 'graph:edges' });
61
29
  const checker = input.program.getTypeChecker();
62
30
  const callsByHash = new Map();
63
31
  const stats = createMutableStats();
64
32
  const sink = { edgesByOwner: callsByHash, stats };
65
- // Cross-package resolution context (export index + manifest index) — the SAME
66
- // model the sharded linker uses. Built once for the whole resolve stage so a
67
- // workspace `@scope/pkg` call resolves to the SOURCE occurrence instead of the
68
- // type checker's bodiless `dist/*.d.ts` declaration (ADR — exact↔sharded
69
- // convergence). The per-file raw-import-specifier index (binding name → raw
70
- // specifier) is built lazily and cached, mirroring the boundary extractor.
71
33
  const crossPackage = buildCrossPackageContext(input.catalog, input.projectDirAbs);
72
- // One import-specifier index per source file, built lazily and cached inline in
73
- // the loop below (the cache Map is a local of THIS function, like the fast
74
- // path's `importIndexByFile`).
75
34
  const importSpecifiersByFile = new Map();
76
35
  let processed = 0;
77
36
  for (const r of input.callSites) {
78
- // Cooperative yield (ADR-0016): resolve is the heaviest stage (tens of
79
- // thousands of sites). Yielding to the event loop every N sites lets the
80
- // in-process live view's 80ms clock tick, so the spinner animates instead
81
- // of freezing for the whole stage. The macrotask hops (~1 per N sites) are
82
- // negligible against the per-site type-checker work.
83
37
  if (processed > 0 && processed % YIELD_EVERY_CALL_SITES === 0)
84
38
  await yieldToEventLoop();
85
39
  processed += 1;
86
- // Bucket edges per OWNER OCCURRENCE (bodyHash + file), not bodyHash alone:
87
- // body-twin functions in different files share a hash, and a hash-only
88
- // bucket would union their edges into phantom cross-package calls.
89
40
  const ownerKey = ownerEdgeKey(r.ownerHash, relative(input.projectDirAbs, r.sourceFile.fileName));
90
41
  if (r.kind === 'creation') {
91
42
  if (r.childHash === undefined)
92
43
  continue;
93
- // @fitness-ignore-next-line detached-promises -- pushCallEdge/pushSharedCreationEdge return void (synchronous edge-sink writes), not promises
94
44
  pushSharedCreationEdge(tsPosition(r.node, r.sourceFile), ownerKey, r.childHash, sink);
95
45
  continue;
96
46
  }
@@ -111,7 +61,6 @@ export async function resolveEdgesFromRecords(input) {
111
61
  const verdict = computeVerdict(r.node, ctx);
112
62
  if (verdict === null)
113
63
  continue;
114
- // @fitness-ignore-next-line detached-promises -- pushCallEdge/pushSharedCreationEdge return void (synchronous edge-sink writes), not promises
115
64
  pushCallEdge(r.node, r.sourceFile, verdict, ownerKey, sink);
116
65
  }
117
66
  const newCatalog = rebuildCatalog(input.catalog, callsByHash);
@@ -126,39 +75,22 @@ export async function resolveEdgesFromRecords(input) {
126
75
  });
127
76
  return { catalog: newCatalog, resolutionStats: stats };
128
77
  }
129
- /**
130
- * Fast-tier Stage 2 entry point: resolve the same pre-collected call-site
131
- * records WITHOUT a `ts.Program` or type checker. Creation edges are
132
- * static and handled identically to the exact path; call edges are
133
- * resolved syntactically (callee name + the file's import graph) and
134
- * labeled `resolution: 'syntactic'` with capped confidence (never
135
- * `'high'`). The output shape is identical to {@link resolveEdgesFromRecords}
136
- * — only the verdicts differ — so the catalog stitches the same way.
137
- *
138
- * Stats stay honest: fast edges land in `resolvedMedium`/`resolvedLow`/
139
- * `unresolved`, never `resolvedHigh`.
140
- */
141
78
  export async function resolveEdgesSyntactic(input) {
142
79
  logger.info({ evt: 'graph.edges.syntactic.start', module: 'graph:edges' });
143
80
  const callsByHash = new Map();
144
81
  const stats = createMutableStats();
145
82
  const sink = { edgesByOwner: callsByHash, stats };
146
83
  const knownFiles = collectKnownFiles(input.catalog);
147
- // One import index per source file — cached across that file's sites.
148
84
  const importIndexByFile = new Map();
149
85
  let processed = 0;
150
86
  for (const r of input.callSites) {
151
- // Cooperative yield — see resolveEdgesFromRecords (ADR-0016).
152
- // @fitness-ignore-next-line performance-anti-patterns -- cooperative yield (ADR-0016) runs once per N call-sites so the live view stays responsive; intentionally serial, not parallelizable
153
87
  if (processed > 0 && processed % YIELD_EVERY_CALL_SITES === 0)
154
88
  await yieldToEventLoop();
155
89
  processed += 1;
156
- // Per-owner-occurrence bucket key (see resolveEdgesFromRecords).
157
90
  const ownerKey = ownerEdgeKey(r.ownerHash, relative(input.projectDirAbs, r.sourceFile.fileName));
158
91
  if (r.kind === 'creation') {
159
92
  if (r.childHash === undefined)
160
93
  continue;
161
- // @fitness-ignore-next-line detached-promises -- pushCallEdge/pushSharedCreationEdge return void (synchronous edge-sink writes), not promises
162
94
  pushSharedCreationEdge(tsPosition(r.node, r.sourceFile), ownerKey, r.childHash, sink);
163
95
  continue;
164
96
  }
@@ -177,7 +109,6 @@ export async function resolveEdgesSyntactic(input) {
177
109
  });
178
110
  if (verdict === null)
179
111
  continue;
180
- // @fitness-ignore-next-line detached-promises -- pushCallEdge/pushSharedCreationEdge return void (synchronous edge-sink writes), not promises
181
112
  pushCallEdge(r.node, r.sourceFile, verdict, ownerKey, sink);
182
113
  }
183
114
  const newCatalog = rebuildCatalog(input.catalog, callsByHash);
@@ -191,202 +122,4 @@ export async function resolveEdgesSyntactic(input) {
191
122
  });
192
123
  return { catalog: newCatalog, resolutionStats: stats };
193
124
  }
194
- /**
195
- * Append an ordinary call/new/jsx/value-reference edge from a resolver
196
- * verdict. Bumps `totalCallSites` directly (every call expression is
197
- * a site, even unresolved-by-shape ones); delegates per-confidence
198
- * classification to `stats.apply`.
199
- */
200
- function pushCallEdge(node, sourceFile, verdict, ownerKey, sink) {
201
- const { edgesByOwner: callsByHash, stats } = sink;
202
- stats.totalCallSites++;
203
- const pos = tsPosition(node, sourceFile);
204
- const edge = {
205
- to: verdict.to,
206
- line: pos.line,
207
- column: pos.column,
208
- resolution: verdict.resolution,
209
- confidence: verdict.confidence,
210
- text: truncateForCallEdge(pos.text),
211
- discarded: isReturnValueDiscarded(node),
212
- };
213
- appendEdge(callsByHash, ownerKey, edge);
214
- stats.apply(edge);
215
- }
216
- function verdictEntry(predicate, resolve) {
217
- return { predicate, resolve: (n, c) => resolve(n, c) };
218
- }
219
- const isJsxLikeOpening = (n) => ts.isJsxOpeningElement(n) || ts.isJsxSelfClosingElement(n);
220
- const isValueRefIdentifier = (n) => ts.isIdentifier(n) && isValueReference(n);
221
- const VERDICT_TABLE = [
222
- verdictEntry(ts.isCallExpression, (n, c) => dispatchCall(n, c)),
223
- verdictEntry(ts.isNewExpression, (n, c) => resolveNewExpression(n, c)),
224
- verdictEntry(isJsxLikeOpening, (n, c) => resolveJsxElement(n, c)),
225
- verdictEntry(isValueRefIdentifier, (n, c) => {
226
- const v = resolveValueReference(n, c);
227
- return v.to.length > 0 ? v : null;
228
- }),
229
- verdictEntry(ts.isShorthandPropertyAssignment, (n, c) => {
230
- const v = resolveShorthandAssignment(n, c);
231
- return v.to.length > 0 ? v : null;
232
- }),
233
- ];
234
- /** Returns null if `node` is not a call/new/jsx/value-reference site. */
235
- function computeVerdict(node, ctx) {
236
- for (const entry of VERDICT_TABLE) {
237
- if (entry.predicate(node))
238
- return entry.resolve(node, ctx);
239
- }
240
- return null;
241
- }
242
- function dispatchCall(node, ctx) {
243
- // Direct identifier call: foo()
244
- if (ts.isIdentifier(node.expression)) {
245
- const direct = resolveDirectCall(node, ctx);
246
- if (direct.to.length > 0)
247
- return direct;
248
- return fallbackWithBinding(node.expression, node.expression.text, ctx);
249
- }
250
- // Property access call: obj.method()
251
- if (ts.isPropertyAccessExpression(node.expression)) {
252
- const direct = resolvePropertyAccessCall(node, ctx);
253
- if (direct.to.length > 0)
254
- return direct;
255
- const poly = resolvePolymorphicCall(node, ctx);
256
- if (poly.to.length > 0)
257
- return poly;
258
- // Fallback: look up by the rightmost simple name (binding-gated).
259
- return fallbackWithBinding(node.expression, node.expression.name.text, ctx);
260
- }
261
- return { to: [], resolution: 'unknown', confidence: 'low' };
262
- }
263
- const UNRESOLVED_VERDICT = { to: [], resolution: 'unknown', confidence: 'low' };
264
- /**
265
- * Binding-gated catalog fallback. The unique-name catalog lookup
266
- * ({@link resolveByCatalogFallback}) only fires when the call site has a binding
267
- * that points INTO the project. A project binding is any of:
268
- *
269
- * - the callee expression's resolved symbol has an IN-PROJECT SOURCE
270
- * declaration (a `.ts(x)` file, not a `.d.ts`). This is the receiver/type
271
- * case the import graph can't see: `g.greet()` where `g: Greeter` resolves
272
- * to the interface method declared in a project source file, even though
273
- * `greet` was never imported by name;
274
- * - the name is imported via a RELATIVE specifier (`./x`) — intra-package; or
275
- * - the name is imported via a WORKSPACE specifier (`@scope/pkg`) the manifest
276
- * index knows — inter-package.
277
- *
278
- * A callee whose symbol resolves only into an EXTERNAL/ambient `.d.ts` (Vitest's
279
- * `describe`, `process.cwd`, a `Map`'s `.set`/`.get`) has NO project binding:
280
- * the real target is outside the catalog, so a unique project function sharing
281
- * the simple name would be a phantom. Without a project binding we decline —
282
- * decline-beats-guess.
283
- *
284
- * NOTE: a same-named function merely EXISTING in the caller's file is NOT a
285
- * binding — its presence is no evidence THIS call targets it. The former
286
- * same-file name-presence branch let `process.send()` / `arr.push()` /
287
- * `new Map().has()` / core `logger.info()` enter the name-only catalog fallback,
288
- * which then resolved by SHARD-SCOPED catalog uniqueness — unsound under sharding
289
- * (unique-in-shard ≠ unique-in-repo). That fabricated 33 local same-name edges on
290
- * this repo (a cross-package/external method call → a same-file same-name
291
- * function) that the whole-program checker correctly declines. Removed:
292
- * decline-beats-guess. (Genuine cross-package edges sharded *does* resolve come
293
- * from the type-checker resolvers' `.d.ts`→source hop, not this fallback, so they
294
- * are unaffected.)
295
- */
296
- function fallbackWithBinding(calleeExpr, name, ctx) {
297
- if (!hasProjectBinding(calleeExpr, name, ctx))
298
- return UNRESOLVED_VERDICT;
299
- return resolveByCatalogFallback(name, ctx.catalog);
300
- }
301
- /** True when the call's callee binds into the project (see {@link fallbackWithBinding}). */
302
- function hasProjectBinding(calleeExpr, name, ctx) {
303
- if (symbolHasInProjectSourceDecl(calleeExpr, ctx))
304
- return true;
305
- const spec = ctx.importSpecifiers.get(name);
306
- if (spec !== undefined) {
307
- if (spec.startsWith('.'))
308
- return true; // relative → intra-project
309
- // Bare specifier → only a project binding if it resolves to a workspace pkg.
310
- return resolveSpecifierToPackage(spec, ctx.crossPackage.manifestIndex) !== undefined;
311
- }
312
- // No type-checked in-project binding and no import specifier ⇒ no binding.
313
- // (A same-named function merely existing in this file is not a binding — see
314
- // the fallbackWithBinding doc. Declining here is the decline-beats-guess floor.)
315
- return false;
316
- }
317
- /** Concrete-callable declaration shapes a name-only fallback may resolve against
318
- * — excludes parameters / property- and method-signatures (a function-TYPED
319
- * binding whose actual target the fallback cannot know). Mirrors the
320
- * property-access resolver's ACCEPT set. */
321
- const CALLABLE_DECL = DeclShape.FunctionDeclaration |
322
- DeclShape.ArrowFunction |
323
- DeclShape.FunctionExpression |
324
- DeclShape.MethodDeclaration |
325
- DeclShape.ConstructorDeclaration |
326
- DeclShape.Accessor |
327
- DeclShape.VariableInitializer |
328
- DeclShape.PropertyAssignmentInitializer;
329
- /**
330
- * True when the callee expression's resolved symbol has at least one declaration
331
- * in an IN-PROJECT SOURCE file (a non-`.d.ts` source file in the program). This
332
- * is the binding the import graph can't express: a receiver-typed method call
333
- * (`g.greet()` where `g: Greeter`) whose target is declared in project source,
334
- * even though the method name was never imported. A symbol that resolves only
335
- * into `.d.ts` (external / ambient) declarations fails this check, so the
336
- * name-only fallback stays declined for globals.
337
- */
338
- function symbolHasInProjectSourceDecl(calleeExpr, ctx) {
339
- const symbol = ctx.typeChecker.getSymbolAtLocation(calleeExpr);
340
- if (!symbol)
341
- return false;
342
- const real = unaliasSymbol(symbol, ctx.typeChecker);
343
- for (const d of real.getDeclarations() ?? []) {
344
- // Only a CONCRETE CALLABLE source declaration is a binding the name-only
345
- // fallback may resolve against. A parameter / property-signature / method-
346
- // signature (`options.shouldNotRetry?.()`, `push: PushViolation`) is NOT —
347
- // the call's real target is whatever VALUE flows into it, which the shard-
348
- // scoped name fallback cannot know, so it guesses a same-name occurrence
349
- // (resolved when unique IN THE SHARD, declined when ambiguous WHOLE-PROGRAM
350
- // — the exact↔sharded divergence). Gating to a callable decl declines those
351
- // guesses in BOTH engines: decline-beats-guess, and convergent.
352
- if (!d.getSourceFile().isDeclarationFile &&
353
- functionLikeFromDeclaration(d, CALLABLE_DECL) !== null) {
354
- return true;
355
- }
356
- }
357
- return false;
358
- }
359
- /**
360
- * The call's return value is discarded when the call expression is the
361
- * entire expression of an ExpressionStatement (`foo();`). Anything else
362
- * — assignment RHS, return value, argument, conditional, member chain
363
- * — consumes the return value.
364
- *
365
- * `await foo()` and `(foo())` wrappers are unwrapped so the underlying
366
- * intent is preserved.
367
- */
368
- export function isReturnValueDiscarded(node) {
369
- let parent = node.parent;
370
- while (parent) {
371
- if (ts.isParenthesizedExpression(parent) || ts.isAwaitExpression(parent)) {
372
- parent = parent.parent;
373
- continue;
374
- }
375
- return ts.isExpressionStatement(parent);
376
- }
377
- return false;
378
- }
379
- function rebuildCatalog(catalog, callsByHash) {
380
- const functions = Object.create(null);
381
- for (const name of Object.keys(catalog.functions)) {
382
- const occs = catalog.functions[name];
383
- if (!occs)
384
- continue;
385
- functions[name] = occs.map((o) => ({
386
- ...o,
387
- calls: callsByHash.get(ownerEdgeKey(o.bodyHash, o.filePath)) ?? [],
388
- }));
389
- }
390
- return { ...catalog, functions };
391
- }
392
125
  //# sourceMappingURL=edges.js.map
package/dist/edges.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"edges.js","sourceRoot":"","sources":["../src/edges.ts"],"names":[],"mappings":"AAAA,wNAAwN;AACxN;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,IAAI,sBAAsB,EAC1C,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAapC;;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CAAC;IAE9D,MAAM,CAAC,IAAI,CAAC;QACV,GAAG,EAAE,gCAAgC;QACrC,MAAM,EAAE,aAAa;QACrB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AACzD,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // @fitness-ignore-file unbounded-memory -- reads single source files for parsing; per-file memory bounded by source size
1
+ // @fitness-ignore-file unbounded-memory -- the only read here is `ts.sys.readFile` inside the ModuleResolutionHost (tsconfig + module-resolution lookups), bounded by TypeScript's own resolution behavior. Source-file parsing reads go through `readSourceFileGuarded` in `parse-fast.ts`.
2
2
  /**
3
3
  * @opensip-cli/graph — TypeScript language adapter.
4
4
  *