pi-lens 4.4.3 → 4.4.4

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 (143) hide show
  1. package/CHANGELOG.md +281 -0
  2. package/README.md +13 -1
  3. package/dist/{chunk-SS36ZX4J.js → chunk-24AKHFGP.js} +6 -6
  4. package/dist/{chunk-JSQFTSC6.js → chunk-2FN63LPV.js} +11 -11
  5. package/dist/{chunk-5UCAH366.js → chunk-2KXTHF3M.js} +20 -20
  6. package/dist/{chunk-EU63SDCG.js → chunk-3DA2JDOL.js} +367 -281
  7. package/dist/{chunk-RWWYJ623.js → chunk-3KAZU3VR.js} +1 -1
  8. package/dist/chunk-3PTHXJXR.js +28 -0
  9. package/dist/chunk-3QED2P4V.js +31 -0
  10. package/dist/{chunk-N2H3ZPZY.js → chunk-3RKP3FMS.js} +1 -0
  11. package/dist/{chunk-XVF2VVXP.js → chunk-5HSRT26B.js} +2 -2
  12. package/dist/{chunk-MXGY6KPT.js → chunk-5IUSNGOC.js} +15 -15
  13. package/dist/{chunk-EJIUXPBX.js → chunk-5OFV52AM.js} +1 -1
  14. package/dist/{chunk-AW7R2GWG.js → chunk-5VSF4UUQ.js} +12 -7
  15. package/dist/{chunk-6STA6Z7I.js → chunk-5WRPDP2A.js} +18 -18
  16. package/dist/{chunk-YIUAVF7E.js → chunk-6DLWKFEX.js} +35 -34
  17. package/dist/{chunk-WOA4LN2R.js → chunk-7D6L4MTX.js} +2 -2
  18. package/dist/{chunk-GAEGEPOC.js → chunk-7HXE67BN.js} +2 -2
  19. package/dist/chunk-AGSS7277.js +84 -0
  20. package/dist/{chunk-R3PCY3YS.js → chunk-AMERCH6V.js} +13 -13
  21. package/dist/{chunk-WU567RSC.js → chunk-ATKJFDQN.js} +14 -10
  22. package/dist/{chunk-VSSBEUFT.js → chunk-AWSCPCN2.js} +16 -16
  23. package/dist/{chunk-VCHXCQFG.js → chunk-BWD5EPKO.js} +3 -3
  24. package/dist/{chunk-H6MF6EVN.js → chunk-CT4MN5IU.js} +1200 -230
  25. package/dist/{chunk-FCSOVF55.js → chunk-CUHSHSB6.js} +6 -6
  26. package/dist/{chunk-CHOW74WE.js → chunk-CYRKQRPM.js} +7 -10
  27. package/dist/{chunk-Q7DUK4LX.js → chunk-DEL2U6CM.js} +5 -5
  28. package/dist/{chunk-6C7JWPCP.js → chunk-DGUKIYSI.js} +26 -23
  29. package/dist/{chunk-PHDMFAKM.js → chunk-DUO2TU77.js} +2 -2
  30. package/dist/{chunk-MRXKYPCS.js → chunk-EBC36LNN.js} +2 -2
  31. package/dist/{chunk-CSHFH5IN.js → chunk-ED36RF6Y.js} +1 -1
  32. package/dist/{chunk-76MWC2K6.js → chunk-EUXZEFTV.js} +90 -97
  33. package/dist/{chunk-QOZXJ4NA.js → chunk-FM4RDMKT.js} +11 -8
  34. package/dist/{chunk-ACXEQZOU.js → chunk-GAQ7OQG6.js} +31 -28
  35. package/dist/{chunk-XAGLWMJ4.js → chunk-GL5LUMZE.js} +23 -23
  36. package/dist/{chunk-BKE7E7TC.js → chunk-GMX5OS7B.js} +9 -9
  37. package/dist/{chunk-ZHFZWTZV.js → chunk-GSLNCYGG.js} +11 -11
  38. package/dist/{chunk-3W7IEVVL.js → chunk-GSM5UU7A.js} +26 -34
  39. package/dist/{chunk-724UL2TJ.js → chunk-GXFV6MYU.js} +3 -3
  40. package/dist/chunk-HAD7QRQI.js +30 -0
  41. package/dist/{chunk-QOBUHWHX.js → chunk-HRNHZA3N.js} +6 -6
  42. package/dist/{chunk-VWCXW2E7.js → chunk-HWCCCQNX.js} +1 -1
  43. package/dist/{chunk-7DYBLXYA.js → chunk-HYGZEMX6.js} +3 -3
  44. package/dist/chunk-IJYGIDF4.js +186 -0
  45. package/dist/{chunk-4W4VLAPJ.js → chunk-IQWN5JCP.js} +11 -11
  46. package/dist/{chunk-SQ4TVJBR.js → chunk-IUE7SSKV.js} +7 -7
  47. package/dist/{chunk-IBGIOBEE.js → chunk-IWDLU6K3.js} +68 -5
  48. package/dist/{chunk-XCJN5IJU.js → chunk-IYNJ6YPZ.js} +4 -4
  49. package/dist/{chunk-JAU72XNY.js → chunk-J64T55EI.js} +3 -3
  50. package/dist/{chunk-2BBLFX75.js → chunk-J6MPGQTS.js} +5 -5
  51. package/dist/chunk-JORED7EX.js +44 -0
  52. package/dist/{chunk-6SDEP3AJ.js → chunk-JUKMK5Y4.js} +8 -8
  53. package/dist/{chunk-FMSO6RDZ.js → chunk-JW3YWBVB.js} +15 -15
  54. package/dist/{chunk-L3BLXZG7.js → chunk-KAPJINKN.js} +30 -69
  55. package/dist/{chunk-2B73ZPOK.js → chunk-KN35K52N.js} +3 -3
  56. package/dist/{chunk-C34ZXZ7O.js → chunk-KUA4OJ5Y.js} +24 -11
  57. package/dist/chunk-KYUB6QDC.js +72 -0
  58. package/dist/{chunk-67WMNWEE.js → chunk-LLJNQKQW.js} +12 -10
  59. package/dist/chunk-LZSEQW6A.js +57 -0
  60. package/dist/{chunk-ZANLILYD.js → chunk-M2IFVFWU.js} +2 -2
  61. package/dist/chunk-M2UD3LPU.js +88 -0
  62. package/dist/{chunk-XIJZVPD5.js → chunk-MBKQHGA7.js} +15 -15
  63. package/dist/{chunk-P7266HLM.js → chunk-MPNJLASA.js} +2 -2
  64. package/dist/{chunk-6GFRNVYR.js → chunk-MZGQNL3Y.js} +10 -10
  65. package/dist/{chunk-ZWFS3OEF.js → chunk-N5FLEO7W.js} +33 -32
  66. package/dist/{chunk-3JNKMP3B.js → chunk-O4NWQT6I.js} +4 -4
  67. package/dist/{chunk-T6CPIZNT.js → chunk-OHKJ7PQF.js} +33 -32
  68. package/dist/{chunk-VRZP76YM.js → chunk-P63GXC37.js} +4 -1
  69. package/dist/{chunk-XTMJ7XDT.js → chunk-POMLXPMY.js} +1 -1
  70. package/dist/{chunk-QQNQ7SJW.js → chunk-QBFBRV2B.js} +10 -4
  71. package/dist/{chunk-CMMHNUZ2.js → chunk-R3T7CLQ2.js} +60 -38
  72. package/dist/{chunk-23WOO7TX.js → chunk-R7YOCSNV.js} +10 -10
  73. package/dist/{chunk-2CD5RS6M.js → chunk-RKBXZN3A.js} +23 -2
  74. package/dist/{chunk-OCAGUNBC.js → chunk-RKKOYPRA.js} +12 -12
  75. package/dist/{chunk-52FUZI6K.js → chunk-RMLC67LF.js} +1 -1
  76. package/dist/{chunk-XMSXXAHW.js → chunk-ROYSX2S5.js} +2 -2
  77. package/dist/{chunk-M6HSLBWY.js → chunk-RVK72CZX.js} +6507 -7514
  78. package/dist/{chunk-FLKWCIZH.js → chunk-S2HEXIWI.js} +5 -5
  79. package/dist/{chunk-UZ3TUTRV.js → chunk-S67KYG37.js} +1 -1
  80. package/dist/{chunk-VCO24T4L.js → chunk-SD4I7ZO4.js} +14 -14
  81. package/dist/{chunk-Z527N6YQ.js → chunk-SKAMFC7A.js} +12 -12
  82. package/dist/{chunk-MQLUAEOC.js → chunk-SRYEJNES.js} +2 -2
  83. package/dist/{chunk-BRGDSBJE.js → chunk-SYE6T2EB.js} +12 -12
  84. package/dist/{chunk-GXW6K4YJ.js → chunk-T57LYLZT.js} +1 -1
  85. package/dist/{chunk-ZXYDQ3TZ.js → chunk-T7FEBKXN.js} +48 -15
  86. package/dist/{chunk-3EFKIGZN.js → chunk-TIQ2PKDW.js} +3 -3
  87. package/dist/{chunk-QILIYSJF.js → chunk-TLX72JTG.js} +1 -1
  88. package/dist/{chunk-TYM6OUIT.js → chunk-TOY6QKOH.js} +12 -12
  89. package/dist/{chunk-IZSHAIJ7.js → chunk-TRETHTQO.js} +12 -12
  90. package/dist/{chunk-3VPVG5SU.js → chunk-U44DJXQP.js} +10 -6
  91. package/dist/{chunk-PNQDPDRC.js → chunk-UA7ZXYDR.js} +1 -1
  92. package/dist/{chunk-OXXKQCSV.js → chunk-UBOQLVT2.js} +4 -4
  93. package/dist/{chunk-QGQ5CCCG.js → chunk-UMS2MFPZ.js} +2 -2
  94. package/dist/{chunk-QHJ6DQ2R.js → chunk-US7ECLD7.js} +55 -13
  95. package/dist/{chunk-AB3YYG6N.js → chunk-UZ2XCLYS.js} +8 -8
  96. package/dist/chunk-V35JG4JB.js +2667 -0
  97. package/dist/{chunk-N3X6Q4YT.js → chunk-VOOAPROD.js} +3 -3
  98. package/dist/{chunk-SAEFPSB6.js → chunk-W66O5E25.js} +21 -11
  99. package/dist/{chunk-KBG47GHP.js → chunk-WMYE35PX.js} +15 -11
  100. package/dist/{chunk-5NGR67U5.js → chunk-XBJVAEEO.js} +32 -5
  101. package/dist/{chunk-YYOIQFRS.js → chunk-XHJBS436.js} +122 -44
  102. package/dist/{chunk-GBPP5P7X.js → chunk-XTBDCR27.js} +4 -4
  103. package/dist/{chunk-4UNXBNE2.js → chunk-XTFDJI3T.js} +11 -11
  104. package/dist/{chunk-UXGETRP4.js → chunk-XYURS6EN.js} +13 -12
  105. package/dist/{chunk-RPLINGVB.js → chunk-Y6GZHWSJ.js} +6 -6
  106. package/dist/{chunk-2VUQMUMT.js → chunk-YCWYO6TQ.js} +41 -38
  107. package/dist/{chunk-77M37OKR.js → chunk-YH5MVY2U.js} +7 -7
  108. package/dist/{chunk-AOHZU2BM.js → chunk-YNE3RP52.js} +1 -1
  109. package/dist/{chunk-YSZNHOBY.js → chunk-ZHH37KZL.js} +12 -12
  110. package/dist/{chunk-ZGDGW2V3.js → chunk-ZIVJBOO3.js} +2 -2
  111. package/dist/{chunk-RXCOMYPY.js → chunk-ZVUL7QYY.js} +29 -28
  112. package/dist/index.js +11052 -5852
  113. package/dist/mcp/analyze-cli.js +10 -9
  114. package/dist/mcp/cli.js +41 -38
  115. package/dist/mcp/server.js +1120 -474
  116. package/dist/mcp/worker.js +61 -58
  117. package/dist/probes/installer.js +19 -19
  118. package/dist/workers/project-snapshot-persist-worker.js +28 -9
  119. package/dist/workers/review-graph-persist-worker.js +1 -1
  120. package/docs/configuration.md +11 -0
  121. package/docs/engineering-principles.md +32 -0
  122. package/docs/lsp-capability-matrix.md +1 -1
  123. package/docs/lsp-idle-eviction.md +15 -26
  124. package/docs/pi-lens-fixer.md +117 -13
  125. package/docs/pi-lens-merge-policy.md +97 -7
  126. package/docs/pi-lens-monitor.md +8 -2
  127. package/docs/pi-lens-retro.md +4 -1
  128. package/docs/pi-lens-reviewer.md +112 -4
  129. package/docs/pi-lens-subagent.md +22 -14
  130. package/docs/release-qa-baseline.md +3 -1
  131. package/docs/servercapabilities.md +9 -19
  132. package/package.json +7 -5
  133. package/scripts/download-grammars.js +40 -7
  134. package/scripts/lib/latency-log-phases.mjs +95 -0
  135. package/scripts/rpc-load-check.mjs +570 -81
  136. package/dist/chunk-3YN6V5TV.js +0 -85
  137. package/dist/chunk-466Z26MG.js +0 -30
  138. package/dist/chunk-EC47DWFA.js +0 -56
  139. package/dist/chunk-KDERNTCQ.js +0 -28
  140. package/dist/chunk-KSX3TXSZ.js +0 -69
  141. package/dist/chunk-LOP6GRPH.js +0 -31
  142. package/dist/chunk-UOPVJQ4N.js +0 -103
  143. /package/dist/{chunk-FC4RP4I2.js → chunk-6HWVI6MI.js} +0 -0
@@ -3,20 +3,20 @@ import {
3
3
  extractTomlTableSection,
4
4
  hasTomlTable,
5
5
  parseTomlStringArray
6
- } from "./chunk-P7266HLM.js";
6
+ } from "./chunk-MPNJLASA.js";
7
7
  import {
8
8
  getProjectTrustState
9
- } from "./chunk-ZANLILYD.js";
9
+ } from "./chunk-M2IFVFWU.js";
10
10
  import {
11
11
  incrementDegradationCount,
12
12
  recordDegradationOnce
13
- } from "./chunk-JAU72XNY.js";
13
+ } from "./chunk-J64T55EI.js";
14
14
  import {
15
15
  logExtension
16
- } from "./chunk-XTMJ7XDT.js";
16
+ } from "./chunk-POMLXPMY.js";
17
17
  import {
18
18
  logLatency
19
- } from "./chunk-QQNQ7SJW.js";
19
+ } from "./chunk-QBFBRV2B.js";
20
20
  import {
21
21
  UV_WORKSPACE_EXCLUDE_DIALECT,
22
22
  UV_WORKSPACE_MEMBERS_DIALECT,
@@ -24,7 +24,7 @@ import {
24
24
  matchesWorkspaceMemberPattern,
25
25
  toPosix,
26
26
  walkUpDirs
27
- } from "./chunk-N2H3ZPZY.js";
27
+ } from "./chunk-3RKP3FMS.js";
28
28
 
29
29
  // dist/clients/bounded-telemetry.js
30
30
  var MAX_TRACKED_TURN_CAPS = 64;
@@ -1,10 +1,11 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
- BoundedLruCache
3
+ BoundedLruCache,
4
+ BoundedSet
4
5
  } from "./chunk-ABBOA7UD.js";
5
6
  import {
6
7
  normalizeMapKey
7
- } from "./chunk-N2H3ZPZY.js";
8
+ } from "./chunk-3RKP3FMS.js";
8
9
 
9
10
  // dist/clients/dispatch/fact-store.js
10
11
  var capacityEvictionReporter;
@@ -28,8 +29,10 @@ var FactStore = class {
28
29
  // oldest-inserted.
29
30
  boundedSessionFacts = new BoundedLruCache(MAX_SESSION_FACT_RECORDS);
30
31
  // Keys evicted from `boundedSessionFacts` and not written since, so a reader
31
- // can tell "evicted" from "never seen" (#2282). Same cap, same FIFO order.
32
- evictedSessionFactKeys = /* @__PURE__ */ new Set();
32
+ // can tell "evicted" from "never seen" (#2282). Same cap, same FIFO order —
33
+ // the cap lives in `BoundedSet.add`'s own overflow rather than in a
34
+ // hand-rolled tombstone trim here (#4580 review F1).
35
+ evictedSessionFactKeys = new BoundedSet(MAX_SESSION_FACT_RECORDS);
33
36
  // Pin refcount per file. A file is exempt from capacity eviction while its
34
37
  // count is > 0. Refcounted, not a Set, so two overlapping dispatches of the
35
38
  // same file both hold the pin until BOTH settle (#2243 item 2).
@@ -282,12 +285,6 @@ var FactStore = class {
282
285
  const evicted = this.boundedSessionFacts.set(factId, value);
283
286
  for (const [oldestKey] of evicted) {
284
287
  this.evictedSessionFactKeys.add(oldestKey);
285
- while (this.evictedSessionFactKeys.size > MAX_SESSION_FACT_RECORDS) {
286
- const oldestTombstone = this.evictedSessionFactKeys.values().next().value;
287
- if (oldestTombstone === void 0)
288
- break;
289
- this.evictedSessionFactKeys.delete(oldestTombstone);
290
- }
291
288
  capacityEvictionReporter?.(this.subject, "session-count", `session-fact store axis=count exceeded ${MAX_SESSION_FACT_RECORDS} records; evicted least-recently-used fact for ${oldestKey}`);
292
289
  }
293
290
  }
@@ -1,18 +1,18 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  rootMarkersForFile
4
- } from "./chunk-QOBUHWHX.js";
4
+ } from "./chunk-HRNHZA3N.js";
5
5
  import {
6
6
  createGenerationMap,
7
7
  createGenerationSource
8
- } from "./chunk-C34ZXZ7O.js";
8
+ } from "./chunk-KUA4OJ5Y.js";
9
9
  import {
10
10
  getDegradationLedgerGeneration,
11
11
  recordDegradationOnce
12
- } from "./chunk-JAU72XNY.js";
12
+ } from "./chunk-J64T55EI.js";
13
13
  import {
14
14
  logExtension
15
- } from "./chunk-XTMJ7XDT.js";
15
+ } from "./chunk-POMLXPMY.js";
16
16
  import {
17
17
  isAtOrAboveHomeDir,
18
18
  isRealGitMarker,
@@ -20,7 +20,7 @@ import {
20
20
  isWindowsPath,
21
21
  nameMatchesMarkerGlob,
22
22
  normalizeEphemeralMapKey
23
- } from "./chunk-N2H3ZPZY.js";
23
+ } from "./chunk-3RKP3FMS.js";
24
24
 
25
25
  // dist/clients/tool-cwd.js
26
26
  import * as os from "node:os";
@@ -3,31 +3,31 @@ import {
3
3
  shouldRecurseIntoDir,
4
4
  walkTreeRecursiveSync,
5
5
  walkTreeStackAsync
6
- } from "./chunk-5NGR67U5.js";
6
+ } from "./chunk-XBJVAEEO.js";
7
7
  import {
8
8
  getProjectIgnoreMatcher
9
- } from "./chunk-C34ZXZ7O.js";
9
+ } from "./chunk-KUA4OJ5Y.js";
10
10
  import {
11
11
  KIND_EXTENSIONS,
12
12
  isCodeKindFile
13
- } from "./chunk-PHDMFAKM.js";
13
+ } from "./chunk-DUO2TU77.js";
14
14
  import {
15
15
  classifyGeneratedOrArtifactDetailed,
16
16
  isDeclarationFile
17
- } from "./chunk-2BBLFX75.js";
17
+ } from "./chunk-J6MPGQTS.js";
18
18
  import {
19
19
  logLatency
20
- } from "./chunk-QQNQ7SJW.js";
20
+ } from "./chunk-QBFBRV2B.js";
21
21
  import {
22
22
  toPositiveFinite
23
- } from "./chunk-AOHZU2BM.js";
23
+ } from "./chunk-YNE3RP52.js";
24
24
  import {
25
25
  BoundedLruCache
26
26
  } from "./chunk-ABBOA7UD.js";
27
27
  import {
28
28
  normalizeEphemeralMapKey,
29
29
  normalizeFilePath
30
- } from "./chunk-N2H3ZPZY.js";
30
+ } from "./chunk-3RKP3FMS.js";
31
31
 
32
32
  // dist/clients/source-filter.js
33
33
  import * as fs2 from "node:fs";
@@ -110,14 +110,15 @@ function slowFsDegradationNotice() {
110
110
  function createArtifactProbeCache() {
111
111
  return /* @__PURE__ */ new Map();
112
112
  }
113
- function probeExists(filePath, cache) {
113
+ function probeExists(filePath, cache, siblings) {
114
+ const exists = () => (!siblings || siblings.mayContain(filePath)) && fs2.existsSync(filePath);
114
115
  if (!cache)
115
- return fs2.existsSync(filePath);
116
+ return exists();
116
117
  const key = normalizeEphemeralMapKey(filePath);
117
118
  const cached = cache.get(key);
118
119
  if (cached !== void 0)
119
120
  return cached;
120
- const result = fs2.existsSync(filePath);
121
+ const result = exists();
121
122
  cache.set(key, result);
122
123
  return result;
123
124
  }
@@ -225,9 +226,9 @@ function getBasename(filePath) {
225
226
  function getDir(filePath) {
226
227
  return path2.dirname(filePath);
227
228
  }
228
- function findSourceSibling(filePath, probeCache) {
229
+ function findSourceSibling(filePath, probeCache, siblings) {
229
230
  for (const candidate of sourceTwinCandidates(filePath)) {
230
- if (probeExists(candidate, probeCache))
231
+ if (probeExists(candidate, probeCache, siblings))
231
232
  return candidate;
232
233
  }
233
234
  const ext = path2.extname(filePath).toLowerCase();
@@ -236,7 +237,7 @@ function findSourceSibling(filePath, probeCache) {
236
237
  for (const [sourceExt, shadowedExts] of Object.entries(SOURCE_PRECEDENCE)) {
237
238
  if (!sourceExtsForCompiledExt(sourceExt).length && shadowedExts.includes(ext)) {
238
239
  const siblingPath = path2.join(dir, base + sourceExt);
239
- if (probeExists(siblingPath, probeCache))
240
+ if (probeExists(siblingPath, probeCache, siblings))
240
241
  return siblingPath;
241
242
  }
242
243
  }
@@ -245,8 +246,8 @@ function findSourceSibling(filePath, probeCache) {
245
246
  function sourceExtsForCompiledExt(sourceExt) {
246
247
  return sourceExt === ".ts" || sourceExt === ".tsx" || sourceExt === ".mts" || sourceExt === ".cts" ? [sourceExt] : [];
247
248
  }
248
- function isBuildArtifact(filePath, probeCache) {
249
- return findSourceSibling(filePath, probeCache) !== null;
249
+ function isBuildArtifact(filePath, probeCache, siblings) {
250
+ return findSourceSibling(filePath, probeCache, siblings) !== null;
250
251
  }
251
252
  function filterSourceFiles(filePaths, options) {
252
253
  const keep = [];
@@ -279,7 +280,7 @@ function resolveCollectionConfig(rootDir, options, config) {
279
280
  options
280
281
  };
281
282
  }
282
- function classifyEntry(entry, fullPath, cfg, probeCache, skipCounters) {
283
+ function classifyEntry(entry, fullPath, cfg, probeCache, skipCounters, siblings) {
283
284
  const { ignoreMatcher, extraExcludePatterns, extensions, options } = cfg;
284
285
  if (entry.isDirectory()) {
285
286
  const canRecurse = shouldRecurseIntoDir(
@@ -307,7 +308,7 @@ function classifyEntry(entry, fullPath, cfg, probeCache, skipCounters) {
307
308
  return {};
308
309
  if (ignoreMatcher.isIgnored(fullPath, false))
309
310
  return {};
310
- if (isBuildArtifact(fullPath, probeCache)) {
311
+ if (isBuildArtifact(fullPath, probeCache, siblings)) {
311
312
  if (skipCounters)
312
313
  skipCounters.buildArtifactSkips += 1;
313
314
  return {};
@@ -349,12 +350,12 @@ function collectSourceFilesWithBudget(dir, options) {
349
350
  const probeCache = createArtifactProbeCache();
350
351
  const budget = createEntryBudget(cfg.maxScanEntries);
351
352
  const skipCounters = createSourceWalkSkipCounters();
352
- walkTreeRecursiveSync(rootDir, (entry, fullPath) => {
353
+ walkTreeRecursiveSync(rootDir, (entry, fullPath, siblings) => {
353
354
  if (kept.isFull())
354
355
  return "stop";
355
356
  if (!chargeEntryBudget(budget))
356
357
  return "stop";
357
- const { recurseInto, keepFile } = classifyEntry(entry, fullPath, cfg, probeCache, skipCounters);
358
+ const { recurseInto, keepFile } = classifyEntry(entry, fullPath, cfg, probeCache, skipCounters, siblings);
358
359
  if (recurseInto)
359
360
  return "recurse";
360
361
  if (keepFile)
@@ -369,7 +370,8 @@ function collectSourceFilesWithBudget(dir, options) {
369
370
  buildArtifactSkips: skipCounters.buildArtifactSkips,
370
371
  generatedDirSkips: skipCounters.generatedDirSkips,
371
372
  generatedNameOverrides: skipCounters.generatedNameOverrides,
372
- generatedNameOnlySkips: skipCounters.generatedNameOnlySkips
373
+ generatedNameOnlySkips: skipCounters.generatedNameOnlySkips,
374
+ entriesVisited: budget.visited
373
375
  };
374
376
  }
375
377
  function collectSourceFiles(dir, options) {
@@ -385,11 +387,11 @@ async function collectSourceFilesWithBudgetAsync(dir, options) {
385
387
  const probeCache = createArtifactProbeCache();
386
388
  const budget = createEntryBudget(cfg.maxScanEntries);
387
389
  const skipCounters = createSourceWalkSkipCounters();
388
- await walkTreeStackAsync(rootDir, (entry, fullPath) => {
390
+ await walkTreeStackAsync(rootDir, (entry, fullPath, siblings) => {
389
391
  options?.onEntryVisited?.();
390
392
  if (!chargeEntryBudget(budget))
391
393
  return "stop";
392
- const { recurseInto, keepFile } = classifyEntry(entry, fullPath, cfg, probeCache, skipCounters);
394
+ const { recurseInto, keepFile } = classifyEntry(entry, fullPath, cfg, probeCache, skipCounters, siblings);
393
395
  if (recurseInto)
394
396
  return "recurse";
395
397
  if (keepFile) {
@@ -417,7 +419,8 @@ async function collectSourceFilesWithBudgetAsync(dir, options) {
417
419
  buildArtifactSkips: skipCounters.buildArtifactSkips,
418
420
  generatedDirSkips: skipCounters.generatedDirSkips,
419
421
  generatedNameOverrides: skipCounters.generatedNameOverrides,
420
- generatedNameOnlySkips: skipCounters.generatedNameOnlySkips
422
+ generatedNameOnlySkips: skipCounters.generatedNameOnlySkips,
423
+ entriesVisited: budget.visited
421
424
  };
422
425
  }
423
426
  function getFilterStats(allFiles, filteredFiles) {
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  findNearestDirWithMarker
4
- } from "./chunk-XVF2VVXP.js";
4
+ } from "./chunk-5HSRT26B.js";
5
5
  import {
6
6
  isWindowsPath
7
- } from "./chunk-N2H3ZPZY.js";
7
+ } from "./chunk-3RKP3FMS.js";
8
8
 
9
9
  // dist/clients/file-kinds.js
10
10
  import { basename, extname, win32 } from "node:path";
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  createToolchainAvailability
4
- } from "./chunk-7DYBLXYA.js";
4
+ } from "./chunk-HYGZEMX6.js";
5
5
  import {
6
6
  createSubsystemLogger
7
- } from "./chunk-XTMJ7XDT.js";
7
+ } from "./chunk-POMLXPMY.js";
8
8
 
9
9
  // dist/clients/rust-client.js
10
10
  import * as path from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  isTestMode
4
- } from "./chunk-AOHZU2BM.js";
4
+ } from "./chunk-YNE3RP52.js";
5
5
 
6
6
  // dist/clients/scanner-temp-root.js
7
7
  import * as os from "node:os";
@@ -1,17 +1,17 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  extractFactsFromTree
4
- } from "./chunk-GXW6K4YJ.js";
4
+ } from "./chunk-T57LYLZT.js";
5
5
  import {
6
6
  findOwnerName
7
7
  } from "./chunk-5W3R6LFT.js";
8
8
  import {
9
9
  firstChildOfType,
10
10
  walk
11
- } from "./chunk-QHJ6DQ2R.js";
11
+ } from "./chunk-US7ECLD7.js";
12
12
  import {
13
13
  isJstsFactFile
14
- } from "./chunk-PHDMFAKM.js";
14
+ } from "./chunk-DUO2TU77.js";
15
15
 
16
16
  // dist/clients/dispatch/facts/function-facts.js
17
17
  var BOUNDARY_PREFIXES = [
@@ -123,64 +123,29 @@ function isCallPassThrough(stmt, paramNames) {
123
123
  }
124
124
  return { pass: true, target: (expr.children ?? [])[0]?.text };
125
125
  }
126
+ function isDecisionPoint(type, children) {
127
+ if (COMPLEXITY_TYPES.has(type))
128
+ return true;
129
+ return type === "binary_expression" && children.some((c) => LOGICAL_OPERATORS.has(c?.type));
130
+ }
126
131
  function calcCyclomaticComplexity(body) {
127
132
  let cc = 1;
128
133
  walk(body, (node) => {
129
- if (COMPLEXITY_TYPES.has(node.type)) {
134
+ if (isDecisionPoint(node.type, node.children ?? []))
130
135
  cc++;
131
- } else if (node.type === "binary_expression") {
132
- if ((node.children ?? []).some((c) => LOGICAL_OPERATORS.has(c?.type))) {
133
- cc++;
134
- }
135
- }
136
136
  });
137
137
  return cc;
138
138
  }
139
- function calcMaxNestingDepth(body) {
140
- let maxDepth = 0;
141
- const walkDepth = (node, depth) => {
142
- if (depth > maxDepth)
143
- maxDepth = depth;
144
- const next = NESTING_TYPES.has(node.type) ? depth + 1 : depth;
145
- for (const child of node.children ?? []) {
146
- if (child)
147
- walkDepth(child, next);
148
- }
149
- };
150
- for (const child of body.children ?? []) {
151
- if (child)
152
- walkDepth(child, 0);
153
- }
154
- return maxDepth;
155
- }
156
- function collectOutgoingCalls(body) {
157
- const calls = /* @__PURE__ */ new Set();
158
- walk(body, (node) => {
159
- if (node.type === "call_expression") {
160
- const callee = (node.children ?? [])[0]?.text ?? "";
161
- if (callee.length < 80)
162
- calls.add(callee);
163
- }
164
- });
165
- return [...calls];
139
+ function memberCallSite(callee) {
140
+ if (callee?.type !== "member_expression")
141
+ return void 0;
142
+ const object = (callee.children ?? [])[0];
143
+ const property = (callee.children ?? []).find((c) => c?.type === "property_identifier");
144
+ if (object?.type !== "identifier" || !property)
145
+ return void 0;
146
+ return { receiver: object.text, method: property.text };
166
147
  }
167
- function collectMemberCallSites(body) {
168
- const sites = [];
169
- walk(body, (node) => {
170
- if (node.type !== "call_expression")
171
- return;
172
- const callee = (node.children ?? [])[0];
173
- if (!callee || callee.type !== "member_expression")
174
- return;
175
- const object = (callee.children ?? [])[0];
176
- const property = (callee.children ?? []).find((c) => c?.type === "property_identifier");
177
- if (!object || object.type !== "identifier" || !property)
178
- return;
179
- sites.push({ receiver: object.text, method: property.text });
180
- });
181
- return sites;
182
- }
183
- function collectReceiverTypes(body, params) {
148
+ function parameterReceiverTypes(params) {
184
149
  const types = {};
185
150
  for (const param of params) {
186
151
  const id = firstNamedChild(param);
@@ -191,49 +156,75 @@ function collectReceiverTypes(body, params) {
191
156
  if (typeId)
192
157
  types[id.text] = typeId.text;
193
158
  }
194
- walk(body, (node) => {
195
- if (node.type !== "variable_declarator")
196
- return;
197
- const id = firstChildOfType(node, "identifier");
198
- if (!id)
199
- return;
200
- const value = (node.children ?? []).find((c) => c?.type === "new_expression");
201
- if (!value)
202
- return;
203
- const ctor = firstNamedChild(value);
204
- if (ctor?.type === "identifier")
205
- types[id.text] = ctor.text;
206
- });
207
159
  return types;
208
160
  }
161
+ function returnsAwaitedCall(stmt) {
162
+ const ret = firstNamedChild(stmt);
163
+ return ret?.type === "await_expression" && firstNamedChild(ret)?.type === "call_expression";
164
+ }
165
+ function addCallFacts(callee, calls, memberCallSites) {
166
+ const calleeText = callee?.text ?? "";
167
+ if (calleeText.length < 80)
168
+ calls.add(calleeText);
169
+ const site = memberCallSite(callee);
170
+ if (site)
171
+ memberCallSites.push(site);
172
+ }
173
+ function addNewReceiverType(children, receiverTypes) {
174
+ const id = children.find((c) => c?.type === "identifier");
175
+ const value = children.find((c) => c?.type === "new_expression");
176
+ const ctor = value ? firstNamedChild(value) : void 0;
177
+ if (id && ctor?.type === "identifier")
178
+ receiverTypes[id.text] = ctor.text;
179
+ }
180
+ function summarizeBody(body, params) {
181
+ let hasAwait = false;
182
+ let hasReturnAwaitCall = false;
183
+ let cyclomaticComplexity = 1;
184
+ let maxNestingDepth = 0;
185
+ const calls = /* @__PURE__ */ new Set();
186
+ const memberCallSites = [];
187
+ const receiverTypes = parameterReceiverTypes(params);
188
+ const visit = (node, depth) => {
189
+ const type = node.type;
190
+ const children = node.children ?? [];
191
+ if (depth > maxNestingDepth)
192
+ maxNestingDepth = depth;
193
+ if (isDecisionPoint(type, children))
194
+ cyclomaticComplexity++;
195
+ if (type === "await_expression") {
196
+ hasAwait = true;
197
+ } else if (type === "return_statement") {
198
+ if (returnsAwaitedCall(node))
199
+ hasReturnAwaitCall = true;
200
+ } else if (type === "call_expression") {
201
+ addCallFacts(children[0], calls, memberCallSites);
202
+ } else if (type === "variable_declarator") {
203
+ addNewReceiverType(children, receiverTypes);
204
+ }
205
+ const next = NESTING_TYPES.has(type) ? depth + 1 : depth;
206
+ for (const child of children) {
207
+ if (child)
208
+ visit(child, next);
209
+ }
210
+ };
211
+ visit(body, 0);
212
+ return {
213
+ hasAwait,
214
+ hasReturnAwaitCall,
215
+ cyclomaticComplexity,
216
+ maxNestingDepth,
217
+ outgoingCalls: [...calls],
218
+ memberCallSites,
219
+ receiverTypes
220
+ };
221
+ }
209
222
  function hasExplicitPromiseReturnType(node) {
210
223
  const returnType = firstChildOfType(node, "type_annotation");
211
224
  if (!returnType)
212
225
  return false;
213
226
  return /:\s*Promise\b/.test(returnType.text);
214
227
  }
215
- function hasAwaitInNode(node) {
216
- let found = false;
217
- walk(node, (n) => {
218
- if (n.type === "await_expression")
219
- found = true;
220
- });
221
- return found;
222
- }
223
- function hasReturnAwaitCall(node) {
224
- let found = false;
225
- walk(node, (n) => {
226
- if (n.type !== "return_statement")
227
- return;
228
- const ret = firstNamedChild(n);
229
- if (ret?.type !== "await_expression")
230
- return;
231
- const awaited = firstNamedChild(ret);
232
- if (awaited?.type === "call_expression")
233
- found = true;
234
- });
235
- return found;
236
- }
237
228
  var functionFactProvider = {
238
229
  id: "fact.file.functions",
239
230
  provides: ["file.functionSummaries", "file.functionFactsCoverage"],
@@ -257,31 +248,33 @@ var functionFactProvider = {
257
248
  const target = passThrough.target ?? "";
258
249
  const lowerTarget = target.toLowerCase();
259
250
  const isBoundaryWrapper = BOUNDARY_PREFIXES.some((prefix) => lowerTarget.startsWith(prefix));
251
+ const bodySummary = summarizeBody(body, params);
260
252
  summaries.push({
261
253
  name: getFunctionName(node),
262
254
  line: node.startPosition.row + 1,
263
255
  column: node.startPosition.column + 1,
264
256
  endLine: body.endPosition.row + 1,
265
257
  isAsync: Boolean(firstChildOfType(node, "async")),
266
- hasAwait: hasAwaitInNode(body),
267
- hasReturnAwaitCall: hasReturnAwaitCall(body),
258
+ hasAwait: bodySummary.hasAwait,
259
+ hasReturnAwaitCall: bodySummary.hasReturnAwaitCall,
268
260
  statementCount,
269
261
  parameterCount: params.length,
270
262
  isPassThroughWrapper: passThrough.pass,
271
263
  passThroughTarget: passThrough.target,
272
264
  isBoundaryWrapper,
273
265
  hasExplicitPromiseReturnType: hasExplicitPromiseReturnType(node),
274
- cyclomaticComplexity: calcCyclomaticComplexity(body),
275
- maxNestingDepth: calcMaxNestingDepth(body),
276
- outgoingCalls: collectOutgoingCalls(body),
277
- memberCallSites: collectMemberCallSites(body),
278
- receiverTypes: collectReceiverTypes(body, params)
266
+ cyclomaticComplexity: bodySummary.cyclomaticComplexity,
267
+ maxNestingDepth: bodySummary.maxNestingDepth,
268
+ outgoingCalls: bodySummary.outgoingCalls,
269
+ memberCallSites: bodySummary.memberCallSites,
270
+ receiverTypes: bodySummary.receiverTypes
279
271
  });
280
272
  };
281
273
  walk(root, (node) => {
282
- if (FUNCTION_TYPES.has(node.type))
274
+ const type = node.type;
275
+ if (FUNCTION_TYPES.has(type))
283
276
  addSummary(node);
284
- if (node.type === "class_declaration" || node.type === "interface_declaration") {
277
+ if (type === "class_declaration" || type === "interface_declaration") {
285
278
  const nameNode = firstChildOfType(node, "type_identifier") ?? firstChildOfType(node, "identifier");
286
279
  if (nameNode) {
287
280
  containers.push({
@@ -1973,7 +1973,7 @@ function readBlockScalar(state, parentIndent, props) {
1973
1973
  state.position = linePosition + column;
1974
1974
  throwError(state, "tab characters must not be used in indentation");
1975
1975
  }
1976
- if (column < maxLeadingIndent) {
1976
+ if (column >= parentIndent && column < maxLeadingIndent) {
1977
1977
  state.position = linePosition + column;
1978
1978
  throwError(state, "bad indentation of a mapping entry");
1979
1979
  }
@@ -2183,13 +2183,16 @@ function readBlockMapping(state, nodeIndent, flowIndent, props) {
2183
2183
  ch = state.input.charCodeAt(++state.position);
2184
2184
  if (!isWsOrEolOrEnd(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
2185
2185
  if (!mappingOpened) {
2186
- restoreState(state, beforeKey);
2187
- addMappingEvent(state, beforeKey.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, COLLECTION_STYLE.BLOCK);
2186
+ state.events.splice(beforeKey.eventsLength, 0, {
2187
+ type: EVENT_ID.MAPPING,
2188
+ start: beforeKey.position,
2189
+ anchorStart: props.anchorStart,
2190
+ anchorEnd: props.anchorEnd,
2191
+ tagStart: props.tagStart,
2192
+ tagEnd: props.tagEnd,
2193
+ style: COLLECTION_STYLE.BLOCK
2194
+ });
2188
2195
  mappingOpened = true;
2189
- parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true);
2190
- ch = state.input.charCodeAt(state.position);
2191
- while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position);
2192
- state.position++;
2193
2196
  }
2194
2197
  detected = true;
2195
2198
  atExplicitKey = false;
@@ -3360,5 +3363,5 @@ export {
3360
3363
  /*! Bundled license information:
3361
3364
 
3362
3365
  js-yaml/dist/js-yaml.mjs:
3363
- (*! js-yaml 5.4.2 https://github.com/nodeca/js-yaml @license MIT *)
3366
+ (*! js-yaml 5.4.3 https://github.com/nodeca/js-yaml @license MIT *)
3364
3367
  */