gitnexus 1.6.6-rc.155 → 1.6.6-rc.157
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/dist/_shared/index.d.ts +0 -4
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +0 -3
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.js +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.js +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -1
- package/dist/cli/analyze.js +16 -0
- package/dist/core/ingestion/call-processor.d.ts +2 -13
- package/dist/core/ingestion/call-processor.js +2 -79
- package/dist/core/ingestion/export-detection.d.ts +2 -1
- package/dist/core/ingestion/export-detection.js +2 -1
- package/dist/core/ingestion/filesystem-walker.d.ts +0 -9
- package/dist/core/ingestion/filesystem-walker.js +0 -11
- package/dist/core/ingestion/languages/csharp/index.d.ts +3 -4
- package/dist/core/ingestion/languages/csharp/index.js +3 -4
- package/dist/core/ingestion/languages/php/index.d.ts +3 -4
- package/dist/core/ingestion/languages/php/index.js +3 -4
- package/dist/core/ingestion/languages/python/captures.js +4 -3
- package/dist/core/ingestion/languages/python/index.d.ts +3 -4
- package/dist/core/ingestion/languages/python/index.js +3 -4
- package/dist/core/ingestion/languages/typescript/index.d.ts +3 -4
- package/dist/core/ingestion/languages/typescript/index.js +3 -4
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +0 -10
- package/dist/core/ingestion/workers/parse-worker.js +16 -2
- package/dist/core/ingestion/workers/worker-pool.js +25 -2
- package/dist/core/lbug/lbug-adapter.js +29 -10
- package/dist/core/lbug/pool-adapter.js +38 -7
- package/dist/core/lbug/query-result-utils.d.ts +19 -0
- package/dist/core/lbug/query-result-utils.js +28 -0
- package/dist/mcp/local/local-backend.js +14 -1
- package/dist/types/pipeline.d.ts +6 -3
- package/package.json +1 -2
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +0 -63
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.js +0 -122
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +0 -59
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.js +0 -79
- package/dist/_shared/scope-resolution/shadow/diff.js.map +0 -1
- package/dist/core/ingestion/ast-cache.d.ts +0 -26
- package/dist/core/ingestion/ast-cache.js +0 -48
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +0 -22
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +0 -92
package/dist/_shared/index.d.ts
CHANGED
|
@@ -58,8 +58,4 @@ export { resilientFetch, ResilientFetchExhaustedError, RETRY_AFTER_CAP_MS, parse
|
|
|
58
58
|
export type { ResilientFetchOptions } from './integrations/resilient-fetch.js';
|
|
59
59
|
export { UNDERSTAND_QUICKLY_DISPATCH_URL, UNDERSTAND_QUICKLY_EVENT_TYPE, UNDERSTAND_QUICKLY_TOKEN_ENV, buildUqDispatchPayload, isValidOwnerRepo, parseOwnerRepoFromRemote, stripGitSuffix, } from './integrations/understand-quickly.js';
|
|
60
60
|
export type { UqDispatchPayload } from './integrations/understand-quickly.js';
|
|
61
|
-
export { diffResolutions } from './scope-resolution/shadow/diff.js';
|
|
62
|
-
export type { ShadowAgreement, ShadowCallsite, ShadowDiff, } from './scope-resolution/shadow/diff.js';
|
|
63
|
-
export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
|
|
64
|
-
export type { LanguageParityRow, ShadowParityReport } from './scope-resolution/shadow/aggregate.js';
|
|
65
61
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIrE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AACpG,YAAY,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,UAAU,EACV,OAAO,EACP,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,WAAW,GACZ,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG/E,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,+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EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,cAAc,EACd,cAAc,EACd,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAM1E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACjG,YAAY,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/_shared/index.js
CHANGED
|
@@ -43,7 +43,4 @@ export { CircuitBreaker, CircuitOpenError, getBreaker } from './integrations/cir
|
|
|
43
43
|
export { resilientFetch, ResilientFetchExhaustedError, RETRY_AFTER_CAP_MS, parseRetryAfter, } from './integrations/resilient-fetch.js';
|
|
44
44
|
// Understand-Quickly registry integration (opt-in)
|
|
45
45
|
export { UNDERSTAND_QUICKLY_DISPATCH_URL, UNDERSTAND_QUICKLY_EVENT_TYPE, UNDERSTAND_QUICKLY_TOKEN_ENV, buildUqDispatchPayload, isValidOwnerRepo, parseOwnerRepoFromRemote, stripGitSuffix, } from './integrations/understand-quickly.js';
|
|
46
|
-
// Shadow-mode diff + aggregation (RFC §6.3; Ring 2 SHARED #918)
|
|
47
|
-
export { diffResolutions } from './scope-resolution/shadow/diff.js';
|
|
48
|
-
export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
|
|
49
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,mBAAmB;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAiCjC,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,yDAAyD;AACzD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AAGvD,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAGrF,gEAAgE;AAChE,yEAAyE;AACzE,2DAA2D;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAOxE,oFAAoF;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAMvF,uEAAuE;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAUpE,sEAAsE;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,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EAAE,MAAM,2CAA2C,CAAC;AAEpG,OAAO,EACL,gCAAgC,EAChC,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,0CAA0C,CAAC;AAUlD,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,EACL,cAAc,EACd,cAAc,EACd,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,8EAA8E;AAC9E,wEAAwE;AACxE,wEAAwE;AACxE,8DAA8D;AAC9D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEjG,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAG3C,mDAAmD;AACnD,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sCAAsC,CAAC"}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Part of RFC #909 Ring 2 SHARED — #913.
|
|
10
10
|
*
|
|
11
|
-
* Consumed by: #915 (SCC finalize link pass)
|
|
12
|
-
* resolving callsite file → enclosing module).
|
|
11
|
+
* Consumed by: #915 (SCC finalize link pass).
|
|
13
12
|
*/
|
|
14
13
|
import type { ScopeId } from './types.js';
|
|
15
14
|
export interface ModuleScopeIndex {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-scope-index.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/module-scope-index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"module-scope-index.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/module-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAC3C,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,gBAAgB,CAO5F"}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Part of RFC #909 Ring 2 SHARED — #913.
|
|
10
10
|
*
|
|
11
|
-
* Consumed by: #915 (SCC finalize link pass)
|
|
12
|
-
* resolving callsite file → enclosing module).
|
|
11
|
+
* Consumed by: #915 (SCC finalize link pass).
|
|
13
12
|
*/
|
|
14
13
|
/**
|
|
15
14
|
* Build a `ModuleScopeIndex` from a flat list of `{ filePath, moduleScopeId }`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-scope-index.js","sourceRoot":"","sources":["../../src/scope-resolution/module-scope-index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"module-scope-index.js","sourceRoot":"","sources":["../../src/scope-resolution/module-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgBH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAoC;IACxE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,KAAK,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,OAAO,EAAE,CAAC;QAClD,IAAI,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,SAAS,CAAC,mBAAmB;QAC3D,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,SAAS,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC;AAED,+EAA+E;AAE/E,SAAS,SAAS,CAAC,UAAgC;IACjD,OAAO;QACL,UAAU;QACV,IAAI,IAAI;YACN,OAAO,UAAU,CAAC,IAAI,CAAC;QACzB,CAAC;QACD,GAAG,CAAC,QAAgB;YAClB,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QACD,GAAG,CAAC,QAAgB;YAClB,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -44,13 +44,12 @@ export interface RawSignals {
|
|
|
44
44
|
*
|
|
45
45
|
* Emission order mirrors the `EvidenceWeights` layout: where-found →
|
|
46
46
|
* type-binding → corroborators → arity → degraded. Stable order makes
|
|
47
|
-
* the per-signal contributions easy to reason about in tests
|
|
48
|
-
* shadow-mode parity dashboard.
|
|
47
|
+
* the per-signal contributions easy to reason about in tests.
|
|
49
48
|
*/
|
|
50
49
|
export declare function composeEvidence(signals: RawSignals): readonly ResolutionEvidence[];
|
|
51
50
|
/**
|
|
52
51
|
* Sum evidence weights and clamp to `[0, 1]`. Separate from `composeEvidence`
|
|
53
|
-
* so tests
|
|
52
|
+
* so tests can inspect the raw evidence list.
|
|
54
53
|
*/
|
|
55
54
|
export declare function confidenceFromEvidence(evidence: readonly ResolutionEvidence[]): number;
|
|
56
55
|
//# sourceMappingURL=evidence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGlE;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAEzB,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;IAC5E,uEAAuE;IACvE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAGrC,4EAA4E;IAC5E,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAGtC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAGzB,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,cAAc,CAAC;IAGlE,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED
|
|
1
|
+
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGlE;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAEzB,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;IAC5E,uEAAuE;IACvE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAGrC,4EAA4E;IAC5E,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAGtC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAGzB,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,cAAc,CAAC;IAGlE,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,kBAAkB,EAAE,CA6ElF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAMtF"}
|
|
@@ -22,8 +22,7 @@ import { EvidenceWeights, typeBindingWeightAtDepth } from '../evidence-weights.j
|
|
|
22
22
|
*
|
|
23
23
|
* Emission order mirrors the `EvidenceWeights` layout: where-found →
|
|
24
24
|
* type-binding → corroborators → arity → degraded. Stable order makes
|
|
25
|
-
* the per-signal contributions easy to reason about in tests
|
|
26
|
-
* shadow-mode parity dashboard.
|
|
25
|
+
* the per-signal contributions easy to reason about in tests.
|
|
27
26
|
*/
|
|
28
27
|
export function composeEvidence(signals) {
|
|
29
28
|
const out = [];
|
|
@@ -96,7 +95,7 @@ export function composeEvidence(signals) {
|
|
|
96
95
|
}
|
|
97
96
|
/**
|
|
98
97
|
* Sum evidence weights and clamp to `[0, 1]`. Separate from `composeEvidence`
|
|
99
|
-
* so tests
|
|
98
|
+
* so tests can inspect the raw evidence list.
|
|
100
99
|
*/
|
|
101
100
|
export function confidenceFromEvidence(evidence) {
|
|
102
101
|
let sum = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAkCnF
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAkCnF;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAmB;IACjD,MAAM,GAAG,GAAyB,EAAE,CAAC;IAErC,0EAA0E;IAC1E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB;YACtC,CAAC,CAAC,UAAU,GAAG,eAAe,CAAC,wBAAwB;YACvD,CAAC,CAAC,UAAU,CAAC;QACf,MAAM,YAAY,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5D,GAAG,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,MAAM;YACd,GAAG,CAAC,OAAO,CAAC,iBAAiB;gBAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,0BAA0B,eAAe,CAAC,wBAAwB,QAAQ,EAAE;gBACtF,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;IACL,CAAC;IAED,uEAAuE;IACvE,uEAAuE;IACvE,sEAAsE;IACtE,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,IAAI,OAAO,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC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ACjB,KAAK,UAAU;YACb,OAAO,QAAQ,CAAC;QAClB,KAAK,kBAAkB;YACrB,OAAO,kBAAkB,CAAC;QAC5B,KAAK,aAAa;YAChB,OAAO,aAAa,CAAC;IACzB,CAAC;AACH,CAAC"}
|
package/dist/cli/analyze.js
CHANGED
|
@@ -41,6 +41,22 @@ const writeFatalToStderr = (label, err) => {
|
|
|
41
41
|
realStderrWrite(`\n ${label}: ${message}\n`);
|
|
42
42
|
if (isErr && err.stack)
|
|
43
43
|
realStderrWrite(`${err.stack}\n`);
|
|
44
|
+
// Walk and print the `cause` chain. The phase runner wraps the underlying
|
|
45
|
+
// failure as `new Error("Phase 'X' failed: …", { cause })`, so the original
|
|
46
|
+
// error (e.g. a WorkerPoolDispatchError carrying the worker-side stack from
|
|
47
|
+
// #2068) is only reachable via `.cause`. Without this the user sees the
|
|
48
|
+
// wrapper's main-thread stack and never the real frame. `cause.stack` already
|
|
49
|
+
// begins with the cause's message, so we print the stack alone (not message +
|
|
50
|
+
// stack) to avoid repeating it. Depth-bounded so a cyclic `cause` can't loop
|
|
51
|
+
// (the phase runner wraps one level; the bound leaves headroom for future
|
|
52
|
+
// nesting); uses realStderrWrite so the redirected console.error's ANSI
|
|
53
|
+
// clear-line wrapping can't erase it (#1169).
|
|
54
|
+
const MAX_CAUSE_DEPTH = 5;
|
|
55
|
+
let cause = isErr ? err.cause : undefined;
|
|
56
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH && cause instanceof Error; depth++) {
|
|
57
|
+
realStderrWrite(`\n Caused by: ${cause.stack ?? cause.message}\n`);
|
|
58
|
+
cause = cause.cause;
|
|
59
|
+
}
|
|
44
60
|
};
|
|
45
61
|
let fatalHandlersInstalled = false;
|
|
46
62
|
/**
|
|
@@ -9,14 +9,12 @@
|
|
|
9
9
|
*
|
|
10
10
|
* - `processRoutesFromExtracted` — CALLS edges from framework routes
|
|
11
11
|
* (e.g. Laravel) to their controller methods.
|
|
12
|
-
* - `processNextjsFetchRoutes` / `
|
|
13
|
-
*
|
|
14
|
-
* Next.js Route nodes.
|
|
12
|
+
* - `processNextjsFetchRoutes` / `extractConsumerAccessedKeys` — FETCHES edges
|
|
13
|
+
* from `fetch()` calls to Next.js Route nodes.
|
|
15
14
|
* - `buildExportedTypeMapFromGraph` — exported symbol → return/declared type
|
|
16
15
|
* map, consumed by the cross-file enrichment pass.
|
|
17
16
|
*/
|
|
18
17
|
import { KnowledgeGraph } from '../graph/types.js';
|
|
19
|
-
import { ASTCache } from './ast-cache.js';
|
|
20
18
|
import type { SemanticModel, SymbolTableReader } from './model/index.js';
|
|
21
19
|
import type { ExtractedRoute, ExtractedFetchCall } from './workers/parse-worker.js';
|
|
22
20
|
/** Per-file resolved type bindings for exported symbols.
|
|
@@ -76,12 +74,3 @@ export declare const extractConsumerAccessedKeys: (content: string) => string[];
|
|
|
76
74
|
*/
|
|
77
75
|
export declare const processNextjsFetchRoutes: (graph: KnowledgeGraph, fetchCalls: ExtractedFetchCall[], routeRegistry: Map<string, string>, // routeURL → handlerFilePath
|
|
78
76
|
consumerContents?: Map<string, string>) => void;
|
|
79
|
-
/**
|
|
80
|
-
* Extract fetch() calls from source files (sequential path).
|
|
81
|
-
* Workers handle this via tree-sitter captures in parse-worker; this function
|
|
82
|
-
* provides the same extraction for the sequential fallback path.
|
|
83
|
-
*/
|
|
84
|
-
export declare const extractFetchCallsFromFiles: (files: {
|
|
85
|
-
path: string;
|
|
86
|
-
content: string;
|
|
87
|
-
}[], astCache: ASTCache) => Promise<ExtractedFetchCall[]>;
|
|
@@ -9,20 +9,13 @@
|
|
|
9
9
|
*
|
|
10
10
|
* - `processRoutesFromExtracted` — CALLS edges from framework routes
|
|
11
11
|
* (e.g. Laravel) to their controller methods.
|
|
12
|
-
* - `processNextjsFetchRoutes` / `
|
|
13
|
-
*
|
|
14
|
-
* Next.js Route nodes.
|
|
12
|
+
* - `processNextjsFetchRoutes` / `extractConsumerAccessedKeys` — FETCHES edges
|
|
13
|
+
* from `fetch()` calls to Next.js Route nodes.
|
|
15
14
|
* - `buildExportedTypeMapFromGraph` — exported symbol → return/declared type
|
|
16
15
|
* map, consumed by the cross-file enrichment pass.
|
|
17
16
|
*/
|
|
18
|
-
import Parser from 'tree-sitter';
|
|
19
|
-
import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/parser-loader.js';
|
|
20
|
-
import { getProvider } from './languages/index.js';
|
|
21
17
|
import { generateId } from '../../lib/utils.js';
|
|
22
|
-
import { getLanguageFromFilename } from '../../_shared/index.js';
|
|
23
18
|
import { yieldToEventLoop } from './utils/event-loop.js';
|
|
24
|
-
import { parseSourceSafe } from '../tree-sitter/safe-parse.js';
|
|
25
|
-
import { getTreeSitterBufferSize } from './constants.js';
|
|
26
19
|
import { normalizeFetchURL, routeMatches } from './route-extractors/nextjs.js';
|
|
27
20
|
import { extractReturnTypeName } from './type-extractors/shared.js';
|
|
28
21
|
const MAX_EXPORTS_PER_FILE = 500;
|
|
@@ -408,73 +401,3 @@ consumerContents) => {
|
|
|
408
401
|
}
|
|
409
402
|
}
|
|
410
403
|
};
|
|
411
|
-
/**
|
|
412
|
-
* Extract fetch() calls from source files (sequential path).
|
|
413
|
-
* Workers handle this via tree-sitter captures in parse-worker; this function
|
|
414
|
-
* provides the same extraction for the sequential fallback path.
|
|
415
|
-
*/
|
|
416
|
-
export const extractFetchCallsFromFiles = async (files, astCache) => {
|
|
417
|
-
const parser = await loadParser();
|
|
418
|
-
const result = [];
|
|
419
|
-
for (const file of files) {
|
|
420
|
-
const language = getLanguageFromFilename(file.path);
|
|
421
|
-
if (!language)
|
|
422
|
-
continue;
|
|
423
|
-
if (!isLanguageAvailable(language))
|
|
424
|
-
continue;
|
|
425
|
-
const provider = getProvider(language);
|
|
426
|
-
const queryStr = provider.treeSitterQueries;
|
|
427
|
-
if (!queryStr)
|
|
428
|
-
continue;
|
|
429
|
-
await loadLanguage(language, file.path);
|
|
430
|
-
let tree = astCache.get(file.path);
|
|
431
|
-
if (!tree) {
|
|
432
|
-
const parseContent = provider.preprocessSource?.(file.content, file.path) ?? file.content;
|
|
433
|
-
try {
|
|
434
|
-
tree = parseSourceSafe(parser, parseContent, undefined, {
|
|
435
|
-
bufferSize: getTreeSitterBufferSize(parseContent),
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
catch {
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
astCache.set(file.path, tree);
|
|
442
|
-
}
|
|
443
|
-
let matches;
|
|
444
|
-
try {
|
|
445
|
-
const lang = parser.getLanguage();
|
|
446
|
-
const query = new Parser.Query(lang, queryStr);
|
|
447
|
-
matches = query.matches(tree.rootNode);
|
|
448
|
-
}
|
|
449
|
-
catch {
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
for (const match of matches) {
|
|
453
|
-
const captureMap = {};
|
|
454
|
-
match.captures.forEach((c) => (captureMap[c.name] = c.node));
|
|
455
|
-
if (captureMap['route.fetch']) {
|
|
456
|
-
const urlNode = captureMap['route.url'] ?? captureMap['route.template_url'];
|
|
457
|
-
if (urlNode) {
|
|
458
|
-
result.push({
|
|
459
|
-
filePath: file.path,
|
|
460
|
-
fetchURL: urlNode.text,
|
|
461
|
-
lineNumber: captureMap['route.fetch'].startPosition.row,
|
|
462
|
-
});
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
else if (captureMap['http_client'] && captureMap['http_client.url']) {
|
|
466
|
-
const method = captureMap['http_client.method']?.text;
|
|
467
|
-
const url = captureMap['http_client.url'].text;
|
|
468
|
-
const HTTP_CLIENT_ONLY = new Set(['head', 'options', 'request', 'ajax']);
|
|
469
|
-
if (method && HTTP_CLIENT_ONLY.has(method) && url.startsWith('/')) {
|
|
470
|
-
result.push({
|
|
471
|
-
filePath: file.path,
|
|
472
|
-
fetchURL: url,
|
|
473
|
-
lineNumber: captureMap['http_client'].startPosition.row,
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return result;
|
|
480
|
-
};
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Determines whether a symbol (function, class, etc.) is exported/public
|
|
5
5
|
* in its language. This is a pure function — safe for use in worker threads.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Used by the language providers during worker parsing (parse-worker.ts) — the
|
|
8
|
+
* sole parse path. (Sequential parsing was removed.)
|
|
8
9
|
*/
|
|
9
10
|
import { type SyntaxNode } from './utils/ast-helpers.js';
|
|
10
11
|
/** Handler type: given a node and symbol name, return true if the symbol is exported/public. */
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Determines whether a symbol (function, class, etc.) is exported/public
|
|
5
5
|
* in its language. This is a pure function — safe for use in worker threads.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Used by the language providers during worker parsing (parse-worker.ts) — the
|
|
8
|
+
* sole parse path. (Sequential parsing was removed.)
|
|
8
9
|
*/
|
|
9
10
|
import { findSiblingChild } from './utils/ast-helpers.js';
|
|
10
11
|
// ============================================================================
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export interface FileEntry {
|
|
2
|
-
path: string;
|
|
3
|
-
content: string;
|
|
4
|
-
}
|
|
5
1
|
/** Lightweight entry — path + size from stat, no content in memory */
|
|
6
2
|
export interface ScannedFile {
|
|
7
3
|
path: string;
|
|
@@ -21,8 +17,3 @@ export declare const walkRepositoryPaths: (repoPath: string, onProgress?: (curre
|
|
|
21
17
|
* Returns a Map for O(1) lookup. Silently skips files that fail to read.
|
|
22
18
|
*/
|
|
23
19
|
export declare const readFileContents: (repoPath: string, relativePaths: string[]) => Promise<Map<string, string>>;
|
|
24
|
-
/**
|
|
25
|
-
* Legacy API — scans and reads everything into memory.
|
|
26
|
-
* Used by sequential fallback path only.
|
|
27
|
-
*/
|
|
28
|
-
export declare const walkRepository: (repoPath: string, onProgress?: (current: number, total: number, filePath: string) => void) => Promise<FileEntry[]>;
|
|
@@ -111,14 +111,3 @@ export const readFileContents = async (repoPath, relativePaths) => {
|
|
|
111
111
|
}
|
|
112
112
|
return contents;
|
|
113
113
|
};
|
|
114
|
-
/**
|
|
115
|
-
* Legacy API — scans and reads everything into memory.
|
|
116
|
-
* Used by sequential fallback path only.
|
|
117
|
-
*/
|
|
118
|
-
export const walkRepository = async (repoPath, onProgress) => {
|
|
119
|
-
const scanned = await walkRepositoryPaths(repoPath, onProgress);
|
|
120
|
-
const contents = await readFileContents(repoPath, scanned.map((f) => f.path));
|
|
121
|
-
return scanned
|
|
122
|
-
.filter((f) => contents.has(f.path))
|
|
123
|
-
.map((f) => ({ path: f.path, content: contents.get(f.path) }));
|
|
124
|
-
};
|
|
@@ -68,10 +68,9 @@
|
|
|
68
68
|
* `using static X = Y.Z;`, attributes, and preprocessor-gated
|
|
69
69
|
* declarations are all recognized correctly.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
* of these matter in practice
|
|
73
|
-
*
|
|
74
|
-
* `test/integration/resolvers/csharp.test.ts`.
|
|
71
|
+
* The `test/integration/resolvers/csharp.test.ts` resolver suite is the
|
|
72
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
73
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
75
74
|
*/
|
|
76
75
|
export { emitCsharpScopeCaptures } from './captures.js';
|
|
77
76
|
export { getCsharpCaptureCacheStats, resetCsharpCaptureCacheStats } from './cache-stats.js';
|
|
@@ -68,10 +68,9 @@
|
|
|
68
68
|
* `using static X = Y.Z;`, attributes, and preprocessor-gated
|
|
69
69
|
* declarations are all recognized correctly.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
* of these matter in practice
|
|
73
|
-
*
|
|
74
|
-
* `test/integration/resolvers/csharp.test.ts`.
|
|
71
|
+
* The `test/integration/resolvers/csharp.test.ts` resolver suite is the
|
|
72
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
73
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
75
74
|
*/
|
|
76
75
|
export { emitCsharpScopeCaptures } from './captures.js';
|
|
77
76
|
export { getCsharpCaptureCacheStats, resetCsharpCaptureCacheStats } from './cache-stats.js';
|
|
@@ -54,10 +54,9 @@
|
|
|
54
54
|
* 6. **Intersection types in parameters** — `T&U $param` takes the first
|
|
55
55
|
* named part (`T`). This matches the legacy type-extractor's behavior.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `test/integration/resolvers/php.test.ts`.
|
|
57
|
+
* The `test/integration/resolvers/php.test.ts` resolver suite is the
|
|
58
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
59
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
61
60
|
*/
|
|
62
61
|
export { emitPhpScopeCaptures } from './captures.js';
|
|
63
62
|
export { getPhpCaptureCacheStats, resetPhpCaptureCacheStats } from './cache-stats.js';
|
|
@@ -54,10 +54,9 @@
|
|
|
54
54
|
* 6. **Intersection types in parameters** — `T&U $param` takes the first
|
|
55
55
|
* named part (`T`). This matches the legacy type-extractor's behavior.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `test/integration/resolvers/php.test.ts`.
|
|
57
|
+
* The `test/integration/resolvers/php.test.ts` resolver suite is the
|
|
58
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
59
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
61
60
|
*/
|
|
62
61
|
export { emitPhpScopeCaptures } from './captures.js';
|
|
63
62
|
export { getPhpCaptureCacheStats, resetPhpCaptureCacheStats } from './cache-stats.js';
|
|
@@ -26,9 +26,10 @@ import { getTreeSitterBufferSize } from '../../constants.js';
|
|
|
26
26
|
import { parseSourceSafe } from '../../../tree-sitter/safe-parse.js';
|
|
27
27
|
import { pythonFunctionDefinitionLabel } from './simple-hooks.js';
|
|
28
28
|
export function emitPythonScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
29
|
-
// Skip the parse when the caller (
|
|
30
|
-
// produced a Tree for this source
|
|
31
|
-
//
|
|
29
|
+
// Skip the parse when the caller (the scope-resolution orchestrator's
|
|
30
|
+
// `treeCache`) already produced a Tree for this source — empty under
|
|
31
|
+
// worker-pool runs, so cache miss = re-parse. The cachedTree parameter
|
|
32
|
+
// is typed as `unknown` at the
|
|
32
33
|
// contract layer (see `LanguageProvider.emitScopeCaptures`); cast
|
|
33
34
|
// here at the use site.
|
|
34
35
|
let tree = cachedTree;
|
|
@@ -66,10 +66,9 @@
|
|
|
66
66
|
* site where the enclosing class can't be statically determined
|
|
67
67
|
* is left unresolved.
|
|
68
68
|
*
|
|
69
|
-
*
|
|
70
|
-
* of these matter in practice
|
|
71
|
-
*
|
|
72
|
-
* `test/integration/resolvers/python.test.ts`.
|
|
69
|
+
* The `test/integration/resolvers/python.test.ts` resolver suite is the
|
|
70
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
71
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
73
72
|
*/
|
|
74
73
|
export { emitPythonScopeCaptures } from './captures.js';
|
|
75
74
|
export { getPythonCaptureCacheStats, resetPythonCaptureCacheStats } from './cache-stats.js';
|
|
@@ -66,10 +66,9 @@
|
|
|
66
66
|
* site where the enclosing class can't be statically determined
|
|
67
67
|
* is left unresolved.
|
|
68
68
|
*
|
|
69
|
-
*
|
|
70
|
-
* of these matter in practice
|
|
71
|
-
*
|
|
72
|
-
* `test/integration/resolvers/python.test.ts`.
|
|
69
|
+
* The `test/integration/resolvers/python.test.ts` resolver suite is the
|
|
70
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
71
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
73
72
|
*/
|
|
74
73
|
export { emitPythonScopeCaptures } from './captures.js';
|
|
75
74
|
export { getPythonCaptureCacheStats, resetPythonCaptureCacheStats } from './cache-stats.js';
|
|
@@ -80,10 +80,9 @@
|
|
|
80
80
|
* identifiers are narrowed (`user instanceof User`). Member paths
|
|
81
81
|
* such as `user.address instanceof Address` remain unresolved.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* either the legacy or registry-primary run.
|
|
83
|
+
* The `test/integration/resolvers/typescript.test.ts` resolver suite is
|
|
84
|
+
* the authoritative signal for which of these matter in practice; it runs
|
|
85
|
+
* in the standard CI test workflow, so a regression blocks the merge.
|
|
87
86
|
*/
|
|
88
87
|
export { emitTsScopeCaptures } from './captures.js';
|
|
89
88
|
export { getTypescriptCaptureCacheStats, resetTypescriptCaptureCacheStats } from './cache-stats.js';
|
|
@@ -80,10 +80,9 @@
|
|
|
80
80
|
* identifiers are narrowed (`user instanceof User`). Member paths
|
|
81
81
|
* such as `user.address instanceof Address` remain unresolved.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* either the legacy or registry-primary run.
|
|
83
|
+
* The `test/integration/resolvers/typescript.test.ts` resolver suite is
|
|
84
|
+
* the authoritative signal for which of these matter in practice; it runs
|
|
85
|
+
* in the standard CI test workflow, so a regression blocks the merge.
|
|
87
86
|
*/
|
|
88
87
|
export { emitTsScopeCaptures } from './captures.js';
|
|
89
88
|
export { getTypescriptCaptureCacheStats, resetTypescriptCaptureCacheStats } from './cache-stats.js';
|
|
@@ -20,7 +20,6 @@ import { fileContentHash, computeChunkHash, loadParseCacheChunk, persistParseCac
|
|
|
20
20
|
import { clearParsedFileStore, persistParsedFileChunk, getDurableParsedFileDir, loadDurableParsedFileIndex, restoreDurableParsedFileShard, } from '../../../storage/parsedfile-store.js';
|
|
21
21
|
import { processRoutesFromExtracted, buildExportedTypeMapFromGraph, } from '../call-processor.js';
|
|
22
22
|
import { createSemanticModel } from '../model/index.js';
|
|
23
|
-
import { createASTCache } from '../ast-cache.js';
|
|
24
23
|
import { getLanguageFromFilename } from '../../../_shared/index.js';
|
|
25
24
|
import { readFileContents } from '../filesystem-walker.js';
|
|
26
25
|
import { isLanguageAvailable } from '../../tree-sitter/parser-loader.js';
|
|
@@ -328,13 +327,6 @@ export async function runChunkedParseAndResolve(graph, scannedFiles, allPaths, t
|
|
|
328
327
|
}
|
|
329
328
|
};
|
|
330
329
|
let filesParsedSoFar = 0;
|
|
331
|
-
// Chunk-local tree-sitter cache, cleared between chunks — call / heritage /
|
|
332
|
-
// import processors read it during parse to avoid re-parsing within the same
|
|
333
|
-
// chunk. (The former cross-phase `scopeTreeCache` was only ever populated by
|
|
334
|
-
// the sequential parser, which has been removed; workers can't return native
|
|
335
|
-
// Trees across the MessageChannel, so scope-resolution re-parses as needed.)
|
|
336
|
-
const maxChunkFiles = chunks.reduce((max, c) => Math.max(max, c.length), 0);
|
|
337
|
-
const astCache = createASTCache(maxChunkFiles);
|
|
338
330
|
const exportedTypeMap = new Map();
|
|
339
331
|
const bindingAccumulator = new BindingAccumulator();
|
|
340
332
|
const allFetchCalls = [];
|
|
@@ -494,7 +486,6 @@ export async function runChunkedParseAndResolve(graph, scannedFiles, allPaths, t
|
|
|
494
486
|
}
|
|
495
487
|
}
|
|
496
488
|
filesParsedSoFar += chunkFiles.length;
|
|
497
|
-
astCache.clear();
|
|
498
489
|
if (verboseThroughputLog && chunkStartMs !== null) {
|
|
499
490
|
const elapsedMs = Date.now() - chunkStartMs;
|
|
500
491
|
const filesPerSec = elapsedMs > 0 ? (chunkFiles.length * 1000) / elapsedMs : 0;
|
|
@@ -747,7 +738,6 @@ export async function runChunkedParseAndResolve(graph, scannedFiles, allPaths, t
|
|
|
747
738
|
// Finalize the accumulator and propagate any fixpoint-inferred exports before
|
|
748
739
|
// `crossFile` disposes it downstream. Wrapped in try/catch so a cleanup
|
|
749
740
|
// failure never masks a real parse error; disposal stays with `crossFile`.
|
|
750
|
-
astCache.clear();
|
|
751
741
|
try {
|
|
752
742
|
bindingAccumulator.finalize();
|
|
753
743
|
const enriched = enrichExportedTypeMap(bindingAccumulator, graph, exportedTypeMap);
|
|
@@ -1888,7 +1888,21 @@ parentPort.on('message', (msg) => {
|
|
|
1888
1888
|
}
|
|
1889
1889
|
}
|
|
1890
1890
|
catch (err) {
|
|
1891
|
-
|
|
1892
|
-
|
|
1891
|
+
// Carry the worker-side stack across the MessageChannel, not just the
|
|
1892
|
+
// message. Without this, an unexpected worker throw (e.g. the minified
|
|
1893
|
+
// `this.#<x> is not a function` family) reaches the operator as a bare
|
|
1894
|
+
// one-liner with no file:line — exactly what made #2068 undebuggable. The
|
|
1895
|
+
// pool embeds `errorStack` into its death/circuit-breaker reason so the
|
|
1896
|
+
// surfaced "Phase 'parse' failed" message points at the real frame (the
|
|
1897
|
+
// stack's first line already carries the error's type + message). We send
|
|
1898
|
+
// primitive fields (not the raw Error) so a non-cloneable `cause` payload
|
|
1899
|
+
// can never turn the report itself into a `messageerror`. `errorStack` is
|
|
1900
|
+
// optional on the wire, so an older pool ignores it.
|
|
1901
|
+
const e = err instanceof Error ? err : new Error(String(err));
|
|
1902
|
+
parentPort.postMessage({
|
|
1903
|
+
type: 'error',
|
|
1904
|
+
error: e.message,
|
|
1905
|
+
errorStack: e.stack,
|
|
1906
|
+
});
|
|
1893
1907
|
}
|
|
1894
1908
|
});
|
|
@@ -356,6 +356,24 @@ function withStderr(worker, message) {
|
|
|
356
356
|
const tail = workerStderrTail(worker);
|
|
357
357
|
return tail ? `${message}. Worker stderr:\n${tail}` : message;
|
|
358
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Build a worker-death reason string that carries the worker-side stack when one
|
|
361
|
+
* is available (#2068). The stack is appended AFTER the `Worker N error: <msg>`
|
|
362
|
+
* prefix so every prefix/substring consumer downstream — recoverAndResume →
|
|
363
|
+
* handleWorkerDeath → the circuit-breaker `WorkerPoolDispatchError` message, and
|
|
364
|
+
* the tests that regex-match those — keeps working unchanged, while the operator
|
|
365
|
+
* now gets the real frame instead of a bare one-liner. The stack's first line is
|
|
366
|
+
* normally the message itself; keeping both is harmless and the indented block
|
|
367
|
+
* scans cleanly in a log. The stack is capped at WORKER_STDERR_TAIL_LIMIT,
|
|
368
|
+
* mirroring the sibling stderr-tail bound, so a pathological error type (or a
|
|
369
|
+
* raised `Error.stackTraceLimit`) can't bloat the death reason. `stack` is
|
|
370
|
+
* `undefined` for an older worker build (or a thrown non-Error), in which case
|
|
371
|
+
* the reason is exactly the prior message-only form.
|
|
372
|
+
*/
|
|
373
|
+
function workerErrorReason(workerIndex, message, stack) {
|
|
374
|
+
const base = `Worker ${workerIndex} error: ${message}`;
|
|
375
|
+
return stack ? `${base}\n worker stack:\n${stack.slice(0, WORKER_STDERR_TAIL_LIMIT)}` : base;
|
|
376
|
+
}
|
|
359
377
|
/**
|
|
360
378
|
* Wait for a freshly-spawned replacement worker to emit the
|
|
361
379
|
* `{type:'ready'}` handshake from `parse-worker.ts` before treating its
|
|
@@ -1338,7 +1356,7 @@ export const createWorkerPool = (workerUrl, poolSize, options) => {
|
|
|
1338
1356
|
else if (msg.type === 'error') {
|
|
1339
1357
|
settled = true;
|
|
1340
1358
|
cleanup();
|
|
1341
|
-
void recoverAndResume(
|
|
1359
|
+
void recoverAndResume(workerErrorReason(workerIndex, msg.error, msg.errorStack), resolveExcludePaths());
|
|
1342
1360
|
}
|
|
1343
1361
|
else if (msg.type === 'result') {
|
|
1344
1362
|
if (!waitingForFlush) {
|
|
@@ -1379,7 +1397,12 @@ export const createWorkerPool = (workerUrl, poolSize, options) => {
|
|
|
1379
1397
|
if (!settled) {
|
|
1380
1398
|
settled = true;
|
|
1381
1399
|
cleanup();
|
|
1382
|
-
|
|
1400
|
+
// The Node 'error' event fires on an UNCAUGHT worker throw (one that
|
|
1401
|
+
// escaped the worker's own try/catch, or an async rejection). Unlike
|
|
1402
|
+
// the `{type:'error'}` message, the event delivers a real Error whose
|
|
1403
|
+
// `.stack` is the worker-side frame — carry it so the surfaced reason
|
|
1404
|
+
// points at the actual failure site, not just `err.message` (#2068).
|
|
1405
|
+
void recoverAndResume(workerErrorReason(workerIndex, err.message, err.stack), resolveExcludePaths());
|
|
1383
1406
|
}
|
|
1384
1407
|
};
|
|
1385
1408
|
const exitHandler = (code) => {
|