pi-lens 4.4.7 → 4.4.9

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 (186) hide show
  1. package/CHANGELOG-USER.md +31 -0
  2. package/CHANGELOG.md +327 -0
  3. package/README.md +13 -2
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -1
  5. package/config/markdownlint/run-no-fix.mjs +36 -0
  6. package/dist/{chunk-4LM3VAZH.js → chunk-2VZ3VN3N.js} +2 -2
  7. package/dist/{chunk-PUZ3E2J4.js → chunk-3HTZDY3C.js} +8 -6
  8. package/dist/{chunk-RORGS5II.js → chunk-3NPWO5UO.js} +7 -13
  9. package/dist/{chunk-MNJIXFX4.js → chunk-47UCC4MM.js} +1 -1
  10. package/dist/chunk-4ENEJHF4.js +198 -0
  11. package/dist/chunk-5GEYJJHG.js +22 -0
  12. package/dist/{chunk-U6VN4NVL.js → chunk-5YSEQHJN.js} +3 -3
  13. package/dist/{chunk-6IR3ZYIB.js → chunk-6GPB3JLL.js} +3 -3
  14. package/dist/{chunk-MB6PXBUA.js → chunk-7R5GZIA6.js} +7 -15
  15. package/dist/{chunk-DH5JPM3K.js → chunk-7UTSNTWM.js} +10 -9
  16. package/dist/{chunk-24BILSZW.js → chunk-7YTRG6YW.js} +2 -2
  17. package/dist/{chunk-KW5JQPO5.js → chunk-AACN5GNE.js} +2 -2
  18. package/dist/{chunk-PKES3ISE.js → chunk-ACRJ2GZ5.js} +2 -2
  19. package/dist/{chunk-4ZYJHQMB.js → chunk-C3YRO3EU.js} +10 -12
  20. package/dist/{chunk-PQJFG24Z.js → chunk-CB7PEVOJ.js} +1300 -946
  21. package/dist/{chunk-ABPKUVA4.js → chunk-CDFJF5YD.js} +1 -1
  22. package/dist/{chunk-T7A2HK2B.js → chunk-CJS6WE66.js} +17 -18
  23. package/dist/{chunk-3YY7IXIL.js → chunk-CM6BDY4E.js} +14 -60
  24. package/dist/{chunk-RZOXUSPC.js → chunk-CZCAZVTD.js} +16 -2
  25. package/dist/chunk-DGKFWQK4.js +23 -0
  26. package/dist/{chunk-NA7SEXHE.js → chunk-E65WJVI5.js} +7 -9
  27. package/dist/{chunk-2TF6RXWB.js → chunk-EKNYSXFB.js} +8 -10
  28. package/dist/{chunk-RRV3FNNM.js → chunk-EY6LY2HO.js} +27 -30
  29. package/dist/{chunk-LBLBAFG3.js → chunk-F6BEQWAK.js} +17 -5
  30. package/dist/{chunk-4L36HG27.js → chunk-FGNSESAC.js} +12 -14
  31. package/dist/{chunk-3FRLWYBG.js → chunk-FRUBVFXV.js} +39 -42
  32. package/dist/{chunk-FB5SCCPT.js → chunk-G22UNQID.js} +14 -15
  33. package/dist/{chunk-LV4UMYVH.js → chunk-GQTQUNCG.js} +26 -27
  34. package/dist/{chunk-E7HJ56Y7.js → chunk-H3BVMK47.js} +64 -73
  35. package/dist/chunk-H6FLQ5NW.js +28 -0
  36. package/dist/{chunk-QHSNL7B2.js → chunk-HEA3EM23.js} +15 -19
  37. package/dist/{chunk-AWDSEDER.js → chunk-HSOBIN22.js} +2 -2
  38. package/dist/{chunk-EAOK7MIZ.js → chunk-HYSKJMZK.js} +17 -4
  39. package/dist/{chunk-VUZWQ7UG.js → chunk-IICERRFF.js} +46 -72
  40. package/dist/{chunk-OXOI55RU.js → chunk-IILEH3ZC.js} +8 -10
  41. package/dist/{chunk-ZKXQKGWZ.js → chunk-J3Q2NYJR.js} +4 -3
  42. package/dist/{chunk-YHC2O2WO.js → chunk-JUZ67QZQ.js} +20 -9
  43. package/dist/chunk-KR5VGMVT.js +25 -0
  44. package/dist/{chunk-F7K5IBZG.js → chunk-KV6GQOGN.js} +41 -44
  45. package/dist/{chunk-SNDXCFRS.js → chunk-KXMJLOZF.js} +25 -23
  46. package/dist/{chunk-CB4WHS4H.js → chunk-L4Y3ROKQ.js} +3 -3
  47. package/dist/{chunk-3F6BMY53.js → chunk-L6WBJGQS.js} +1 -1
  48. package/dist/{chunk-MPKRJBPK.js → chunk-L7O774U7.js} +30 -32
  49. package/dist/{chunk-URCQWAQ4.js → chunk-LAHHGNAY.js} +21 -21
  50. package/dist/{chunk-V63BC55Q.js → chunk-LT62P654.js} +1 -1
  51. package/dist/{chunk-ZMAUPOMG.js → chunk-LWOM6LVS.js} +34 -34
  52. package/dist/{chunk-HO6LWE2E.js → chunk-MKPDIAZH.js} +21 -1
  53. package/dist/{chunk-2PHMIAKO.js → chunk-MN635QYA.js} +3 -4
  54. package/dist/{chunk-KDX35VXP.js → chunk-MQ4PPCJB.js} +166 -149
  55. package/dist/{chunk-QOE342SU.js → chunk-MRLH4MYU.js} +2 -2
  56. package/dist/{chunk-CE6VMBCB.js → chunk-N56BNAA6.js} +20 -21
  57. package/dist/{chunk-L3CMBQMH.js → chunk-N5CEGQPG.js} +14 -17
  58. package/dist/{chunk-7E2563GA.js → chunk-NCLO6E6N.js} +13 -33
  59. package/dist/{chunk-J6JP25XU.js → chunk-NL5LSKVD.js} +4 -3
  60. package/dist/{chunk-U7BD2QL7.js → chunk-NMUSOZ2D.js} +10 -12
  61. package/dist/{chunk-BZARLRJW.js → chunk-NOWH2VA2.js} +8 -33
  62. package/dist/{chunk-U2SDMG7C.js → chunk-NUSXS6YB.js} +6 -5
  63. package/dist/{chunk-ZJTT47IG.js → chunk-OSEKJEUU.js} +2 -2
  64. package/dist/{chunk-FZKFVUEC.js → chunk-OUYAUXAT.js} +647 -355
  65. package/dist/{chunk-ZE3KXHS7.js → chunk-PBZNYHMM.js} +84 -4
  66. package/dist/{chunk-U5HPROLA.js → chunk-PIIUNJIT.js} +2 -4
  67. package/dist/chunk-PKLB2XJL.js +8 -0
  68. package/dist/{chunk-RC2Z6K47.js → chunk-PRHYIA6X.js} +15 -6
  69. package/dist/{chunk-RQS4QQSD.js → chunk-PXQ45SGD.js} +2 -2
  70. package/dist/chunk-Q6JQKWPK.js +25 -0
  71. package/dist/{chunk-F6X3YJWD.js → chunk-QB7T2PHK.js} +2 -2
  72. package/dist/{chunk-TIQJPRDD.js → chunk-QGITU23N.js} +3 -2
  73. package/dist/chunk-QJJKOHLH.js +57 -0
  74. package/dist/{chunk-4LOE5R5P.js → chunk-QP33NKYC.js} +18 -15
  75. package/dist/{chunk-N5WSK2K7.js → chunk-QVBOXT3L.js} +12 -17
  76. package/dist/{chunk-DPGEAHZT.js → chunk-RNJFRXEN.js} +10 -18
  77. package/dist/{chunk-EKWX4WD3.js → chunk-RNXOWDM6.js} +10 -10
  78. package/dist/{chunk-O4BJFESU.js → chunk-RTFMDIKV.js} +1 -1
  79. package/dist/{chunk-LS3QJRUB.js → chunk-SIQHOB6P.js} +11 -13
  80. package/dist/{chunk-3K2F6UDZ.js → chunk-SLSMJPEF.js} +43 -42
  81. package/dist/chunk-T5QSLSMM.js +50 -0
  82. package/dist/chunk-TGQDAG4B.js +88 -0
  83. package/dist/{chunk-4YHYPW2G.js → chunk-THYHUIDR.js} +44 -13
  84. package/dist/{chunk-YVHBNSME.js → chunk-TMNUTMT5.js} +1099 -1100
  85. package/dist/{chunk-WDBICWH3.js → chunk-TOE2RRCS.js} +1 -1
  86. package/dist/chunk-TYHPVE5H.js +25 -0
  87. package/dist/chunk-UAKO2M6B.js +73 -0
  88. package/dist/chunk-UC5AXW5Z.js +20 -0
  89. package/dist/chunk-UTJP6WOS.js +28 -0
  90. package/dist/{chunk-DQZFQSR5.js → chunk-UXTQ3QPD.js} +4 -4
  91. package/dist/chunk-UYXV5NIS.js +20 -0
  92. package/dist/{chunk-KKCK636N.js → chunk-V2WDBOLZ.js} +10 -12
  93. package/dist/{chunk-PR6PO3ES.js → chunk-V67D6TMU.js} +22 -20
  94. package/dist/{chunk-VSFLRN5Y.js → chunk-VCRVNLE7.js} +135 -2
  95. package/dist/{chunk-CPSR3AVL.js → chunk-VO4JFPTV.js} +2 -2
  96. package/dist/{chunk-XT2HTCJ5.js → chunk-VWLSU3XV.js} +6 -5
  97. package/dist/{chunk-WME2OQST.js → chunk-W5E72HJA.js} +66 -24
  98. package/dist/{chunk-LLS45EWB.js → chunk-W7TY6HYX.js} +6 -8
  99. package/dist/{chunk-CCV2EU7T.js → chunk-WSSLVMDA.js} +12 -13
  100. package/dist/{chunk-YISME6ON.js → chunk-WTB4GKMH.js} +10 -1
  101. package/dist/{chunk-KPPJTH44.js → chunk-X5BJ3G2P.js} +64 -35
  102. package/dist/{chunk-JMEKXFOL.js → chunk-XKFO2SZV.js} +39 -34
  103. package/dist/{chunk-HR3OJ3TH.js → chunk-XLAI7UYY.js} +84 -31
  104. package/dist/{chunk-H7OR7DFZ.js → chunk-XO756WE5.js} +53 -37
  105. package/dist/{chunk-F5Z6URKM.js → chunk-XVB3Q2PG.js} +2 -4
  106. package/dist/{chunk-R5MOQM2H.js → chunk-YOXCCJDF.js} +607 -366
  107. package/dist/{chunk-ZGSJDWQU.js → chunk-ZCQBNPRH.js} +2 -2
  108. package/dist/chunk-ZD4KVFXI.js +234 -0
  109. package/dist/{chunk-WGRJOXED.js → chunk-ZDMFGACN.js} +1295 -966
  110. package/dist/{chunk-OSTKYB55.js → chunk-ZMMHHXSW.js} +1 -1
  111. package/dist/{chunk-75GAYVNO.js → chunk-ZPM7ZIFL.js} +6 -6
  112. package/dist/{chunk-LUBPZN36.js → chunk-ZVCDHYWZ.js} +9 -11
  113. package/dist/{chunk-Y7F7IEE3.js → chunk-ZZN74OGD.js} +102 -7
  114. package/dist/{chunk-L5JYIU47.js → chunk-ZZSJAR76.js} +39 -20
  115. package/dist/index.js +10933 -8644
  116. package/dist/mcp/analyze-cli.js +12 -17
  117. package/dist/mcp/cli.js +43 -42
  118. package/dist/mcp/server.js +3073 -1147
  119. package/dist/mcp/worker.js +61 -61
  120. package/dist/probes/installer.js +18 -19
  121. package/docs/adr/0003-git-guard-latch-writer.md +11 -6
  122. package/docs/agent-tools.md +58 -16
  123. package/docs/alignment-families.md +29 -0
  124. package/docs/analysisall.md +1 -1
  125. package/docs/ast-grep_rules_catalog.md +6 -4
  126. package/docs/ci-bot-pr-checks.md +128 -0
  127. package/docs/configuration.md +150 -12
  128. package/docs/defect-shapes.md +107 -15
  129. package/docs/engineering-principles.md +27 -2
  130. package/docs/environment-variables.md +18 -1
  131. package/docs/features.md +14 -7
  132. package/docs/globalconfig.md +11 -3
  133. package/docs/invariants/git-guard-host.md +7 -3
  134. package/docs/invariants/language-config.md +15 -4
  135. package/docs/invariants/lsp-trust-exec.md +25 -4
  136. package/docs/invariants/paths-os.md +4 -2
  137. package/docs/invariants/session-telemetry.md +2 -2
  138. package/docs/language-coverage.md +1 -0
  139. package/docs/lsp-capability-matrix.md +167 -65
  140. package/docs/lsp-idle-eviction.md +4 -1
  141. package/docs/merge-queue-rollout.md +10 -8
  142. package/docs/module-report-read-symbol.md +34 -23
  143. package/docs/pi-lens-fixer.md +34 -17
  144. package/docs/pi-lens-investigator.md +3 -0
  145. package/docs/pi-lens-merge-policy.md +34 -17
  146. package/docs/pi-lens-monitor.md +9 -0
  147. package/docs/pi-lens-orchestration.md +4 -1
  148. package/docs/pi-lens-reviewer.md +6 -6
  149. package/docs/pi-lens-subagent.md +19 -3
  150. package/docs/public-api-stability.md +57 -7
  151. package/docs/release-qa-baseline.md +7 -4
  152. package/docs/schema/pi-lens-config-v1.json +21 -2
  153. package/docs/servercapabilities.md +3 -1
  154. package/docs/settings.md +11 -7
  155. package/docs/word-index.md +20 -7
  156. package/package.json +11 -4
  157. package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  158. package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  159. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  160. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  161. package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  162. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  163. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  164. package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  165. package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  166. package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  167. package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  168. package/scripts/download-grammars.js +3 -2
  169. package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  170. package/dist/chunk-46TNM7XZ.js +0 -88
  171. package/dist/chunk-72OKUXSD.js +0 -31
  172. package/dist/chunk-7GLOLOSH.js +0 -57
  173. package/dist/chunk-AKUUMGD5.js +0 -26
  174. package/dist/chunk-ASUXV767.js +0 -22
  175. package/dist/chunk-CTADOKYM.js +0 -25
  176. package/dist/chunk-GNSIWBAT.js +0 -106
  177. package/dist/chunk-HWDAVBFU.js +0 -49
  178. package/dist/chunk-JJ2RRESP.js +0 -58
  179. package/dist/chunk-KXF5R4UN.js +0 -48
  180. package/dist/chunk-LSC3VADM.js +0 -23
  181. package/dist/chunk-OE5ZBP7F.js +0 -443
  182. package/dist/chunk-SHLDT3OI.js +0 -27
  183. package/dist/chunk-UF7RTZSO.js +0 -27
  184. package/dist/chunk-W4WP2ERB.js +0 -30
  185. package/dist/chunk-YES5CACN.js +0 -73
  186. package/dist/chunk-Z2XAOKHK.js +0 -136
@@ -1,8 +1,14 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ formatToolFailure
4
+ } from "./chunk-ZZN74OGD.js";
5
+ import {
6
+ scannerReportParentDir
7
+ } from "./chunk-LT62P654.js";
2
8
  import {
3
9
  createAvailabilityProbeFlight,
4
10
  probeToolAsync
5
- } from "./chunk-3F6BMY53.js";
11
+ } from "./chunk-L6WBJGQS.js";
6
12
  import {
7
13
  classifyProbeFailure,
8
14
  createAvailabilityLatch,
@@ -10,15 +16,17 @@ import {
10
16
  describeProbeEvidence,
11
17
  logAvailabilityDecision,
12
18
  startHostStallSampler
13
- } from "./chunk-KW5JQPO5.js";
19
+ } from "./chunk-AACN5GNE.js";
14
20
  import {
15
21
  createSingleFlight
16
22
  } from "./chunk-AWQWXSW4.js";
17
23
  import {
18
- createSubsystemLogger
19
- } from "./chunk-KXF5R4UN.js";
24
+ createSubsystemLogger,
25
+ incrementDegradationCount
26
+ } from "./chunk-W5E72HJA.js";
20
27
 
21
28
  // dist/clients/security-scan-client.js
29
+ import * as fs from "node:fs";
22
30
  import * as path from "node:path";
23
31
  var securityProbeFlights = createAvailabilityProbeFlight();
24
32
  var SecurityScanClient = class {
@@ -319,6 +327,78 @@ var SecurityScanClient = class {
319
327
  this.inFlight.set(key, promise);
320
328
  return promise;
321
329
  }
330
+ /**
331
+ * Shared body of a scan whose CLI writes a JSON report file (gitleaks,
332
+ * trivy): a private report directory under the scanner temp root, the spawn,
333
+ * the three non-parse outcomes (spawn error, no report written, a throw) and
334
+ * the directory's removal on every path.
335
+ *
336
+ * Result policy: a spawn error, a throw, or a non-zero exit that left no
337
+ * report is an unsuccessful empty result (`success` false) and one
338
+ * `security-scan-report-failed` row; a CLI that exits 0 without writing its
339
+ * report is a successful empty one carrying stderr's first line (both CLIs
340
+ * write the report even when nothing is found, so a missing file after a
341
+ * clean exit is an empty run, while a non-zero exit before the report means
342
+ * the scan never ran and must not be cached as clean). A report that exists
343
+ * is parsed whatever the exit code. `spec.parse` runs inside the guard, so
344
+ * its own throw lands in the same unsuccessful result.
345
+ */
346
+ async runReportScan(spec) {
347
+ const scannedAt = (/* @__PURE__ */ new Date()).toISOString();
348
+ const outDir = fs.mkdtempSync(path.join(scannerReportParentDir(), `pi-lens-${this.toolName}-`));
349
+ const reportPath = path.join(outDir, `${this.toolName}-report.json`);
350
+ try {
351
+ const result = await spec.spawn({ outDir, reportPath });
352
+ if (result.error) {
353
+ this.log(`Scan error: ${result.error.message}`);
354
+ this.recordReportScanFailure(result.error.message);
355
+ return spec.fail({
356
+ scannedAt,
357
+ summary: result.error.message.slice(0, 200)
358
+ });
359
+ }
360
+ if (!fs.existsSync(reportPath)) {
361
+ if (result.status !== 0) {
362
+ const reason = formatToolFailure({
363
+ tool: this.toolName,
364
+ status: result.status,
365
+ stderr: result.stderr,
366
+ reportMissing: true
367
+ });
368
+ this.recordReportScanFailure(reason);
369
+ return spec.fail({ scannedAt, summary: reason });
370
+ }
371
+ return spec.fail({
372
+ success: true,
373
+ scannedAt,
374
+ summary: (result.stderr ?? "").trim().split("\n")[0] || "no report produced"
375
+ });
376
+ }
377
+ return await spec.parse(fs.readFileSync(reportPath, "utf-8"), scannedAt);
378
+ } catch (err) {
379
+ const message = err instanceof Error ? err.message : String(err);
380
+ this.recordReportScanFailure(message);
381
+ return spec.fail({ scannedAt, summary: message.slice(0, 200) });
382
+ } finally {
383
+ try {
384
+ fs.rmSync(outDir, { recursive: true, force: true });
385
+ } catch {
386
+ }
387
+ }
388
+ }
389
+ /**
390
+ * Count a spawn error, a throw, or a non-zero exit that left no report in
391
+ * the degradation ledger, once per tool with the latest message kept. Before this, gitleaks and trivy surfaced
392
+ * these only as the result's `summary`, while opengrep, the same shape,
393
+ * recorded `opengrep-scan-refused`.
394
+ */
395
+ recordReportScanFailure(message) {
396
+ incrementDegradationCount({
397
+ kind: "security-scan-report-failed",
398
+ subject: this.toolName,
399
+ reason: message
400
+ });
401
+ }
322
402
  };
323
403
 
324
404
  export {
@@ -1,10 +1,8 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
+ logExtension,
3
4
  recordDegradation
4
- } from "./chunk-WME2OQST.js";
5
- import {
6
- logExtension
7
- } from "./chunk-KXF5R4UN.js";
5
+ } from "./chunk-W5E72HJA.js";
8
6
  import {
9
7
  stagePathFor
10
8
  } from "./chunk-LJDODBBZ.js";
@@ -0,0 +1,8 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+
3
+ // dist/clients/review-graph/types.js
4
+ var UNRESOLVED_NAME_NODE_PREFIX = "symbol-name:";
5
+
6
+ export {
7
+ UNRESOLVED_NAME_NODE_PREFIX
8
+ };
@@ -3,7 +3,7 @@ import {
3
3
  deserializeWordIndex,
4
4
  recordPersistedWordIndexWireBytes,
5
5
  serializeWordIndex
6
- } from "./chunk-SNDXCFRS.js";
6
+ } from "./chunk-KXMJLOZF.js";
7
7
  import {
8
8
  fingerprintProjectSnapshotJson
9
9
  } from "./chunk-2BEMIWEW.js";
@@ -11,24 +11,27 @@ import {
11
11
  readGzipStageWorkerResult,
12
12
  reapStageFile
13
13
  } from "./chunk-IJYGIDF4.js";
14
+ import {
15
+ registerBackgroundWriteDrain
16
+ } from "./chunk-UYXV5NIS.js";
14
17
  import {
15
18
  getProjectDataDir,
16
19
  isStaleStageFile,
17
20
  withGenerationLockSync
18
- } from "./chunk-YVHBNSME.js";
21
+ } from "./chunk-TMNUTMT5.js";
19
22
  import {
20
23
  writeFileAtomic
21
- } from "./chunk-U5HPROLA.js";
24
+ } from "./chunk-PIIUNJIT.js";
22
25
  import {
23
26
  incrementDegradationCount
24
- } from "./chunk-WME2OQST.js";
27
+ } from "./chunk-W5E72HJA.js";
25
28
  import {
26
29
  logLatency
27
- } from "./chunk-Z2XAOKHK.js";
30
+ } from "./chunk-VCRVNLE7.js";
28
31
  import {
29
32
  BoundedFifoMap,
30
33
  normalizeMapKey
31
- } from "./chunk-PQJFG24Z.js";
34
+ } from "./chunk-CB7PEVOJ.js";
32
35
 
33
36
  // dist/clients/project-snapshot.js
34
37
  import * as fs3 from "node:fs";
@@ -1431,6 +1434,12 @@ async function waitForProjectSnapshotPersistsForTests() {
1431
1434
  await new Promise((resolve2) => setTimeout(resolve2, 10));
1432
1435
  }
1433
1436
  }
1437
+ async function settleProjectSnapshotPersistsForTests() {
1438
+ await waitForProjectSnapshotPersistsForTests();
1439
+ const pending = _snapshotWorkerRequests.size + _activeSnapshotPersists.size + _queuedSnapshotPersists.size;
1440
+ return pending > 0 ? "project-snapshot persists still pending after the bounded wait" : void 0;
1441
+ }
1442
+ registerBackgroundWriteDrain(settleProjectSnapshotPersistsForTests);
1434
1443
  function flushProjectSnapshotPersistsForTests() {
1435
1444
  const requests = [..._snapshotWorkerRequests.values()];
1436
1445
  _snapshotWorkerRequests.clear();
@@ -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-CB4WHS4H.js";
4
+ } from "./chunk-L4Y3ROKQ.js";
5
5
  import {
6
6
  createSubsystemLogger
7
- } from "./chunk-KXF5R4UN.js";
7
+ } from "./chunk-W5E72HJA.js";
8
8
 
9
9
  // dist/clients/rust-client.js
10
10
  import * as path from "node:path";
@@ -0,0 +1,25 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ RustClient,
4
+ resetRustAvailability,
5
+ rustClient
6
+ } from "./chunk-PXQ45SGD.js";
7
+ import "./chunk-L4Y3ROKQ.js";
8
+ import "./chunk-L6WBJGQS.js";
9
+ import "./chunk-AACN5GNE.js";
10
+ import "./chunk-TMNUTMT5.js";
11
+ import "./chunk-AWQWXSW4.js";
12
+ import "./chunk-X5BJ3G2P.js";
13
+ import "./chunk-NL5LSKVD.js";
14
+ import "./chunk-PIIUNJIT.js";
15
+ import "./chunk-W5E72HJA.js";
16
+ import "./chunk-S26LC76R.js";
17
+ import "./chunk-VCRVNLE7.js";
18
+ import "./chunk-LJDODBBZ.js";
19
+ import "./chunk-CB7PEVOJ.js";
20
+ import "./chunk-NXL4FFQQ.js";
21
+ export {
22
+ RustClient,
23
+ resetRustAvailability,
24
+ rustClient
25
+ };
@@ -3,8 +3,8 @@ import {
3
3
  FactStore,
4
4
  getFactStoreEvictionReporter,
5
5
  setFactStoreEvictionReporter
6
- } from "./chunk-OSTKYB55.js";
7
- import "./chunk-PQJFG24Z.js";
6
+ } from "./chunk-ZMMHHXSW.js";
7
+ import "./chunk-CB7PEVOJ.js";
8
8
  import "./chunk-NXL4FFQQ.js";
9
9
  export {
10
10
  FactStore,
@@ -1,7 +1,8 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
+ realpathOrResolve,
3
4
  walkUpDirs
4
- } from "./chunk-PQJFG24Z.js";
5
+ } from "./chunk-CB7PEVOJ.js";
5
6
  import {
6
7
  __export
7
8
  } from "./chunk-NXL4FFQQ.js";
@@ -16,7 +17,7 @@ function getPackageRoot(importMetaUrl) {
16
17
  if (cached)
17
18
  return cached;
18
19
  let root = "";
19
- for (const dir of walkUpDirs(path.dirname(fileURLToPath(importMetaUrl)))) {
20
+ for (const dir of walkUpDirs(path.dirname(realpathOrResolve(fileURLToPath(importMetaUrl))))) {
20
21
  root = dir;
21
22
  if (fs.existsSync(path.join(dir, "package.json")))
22
23
  break;
@@ -0,0 +1,57 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ DependencyChecker,
4
+ buildMadgeArgs,
5
+ resetMadgeManagedPathMemo
6
+ } from "./chunk-QVBOXT3L.js";
7
+ import "./chunk-NCLO6E6N.js";
8
+ import "./chunk-7R5GZIA6.js";
9
+ import {
10
+ mapWithConcurrency
11
+ } from "./chunk-XIMYZ3JA.js";
12
+ import "./chunk-YOXCCJDF.js";
13
+ import "./chunk-7YTRG6YW.js";
14
+ import "./chunk-V67D6TMU.js";
15
+ import "./chunk-LT62P654.js";
16
+ import "./chunk-PRHYIA6X.js";
17
+ import "./chunk-ACRJ2GZ5.js";
18
+ import "./chunk-J3Q2NYJR.js";
19
+ import "./chunk-5YSEQHJN.js";
20
+ import "./chunk-QGITU23N.js";
21
+ import "./chunk-WTB4GKMH.js";
22
+ import "./chunk-RTFMDIKV.js";
23
+ import "./chunk-CKEQFGLT.js";
24
+ import "./chunk-KXMJLOZF.js";
25
+ import "./chunk-MRLH4MYU.js";
26
+ import "./chunk-MKPDIAZH.js";
27
+ import "./chunk-2BEMIWEW.js";
28
+ import "./chunk-IJYGIDF4.js";
29
+ import "./chunk-MQ4PPCJB.js";
30
+ import "./chunk-RNJFRXEN.js";
31
+ import "./chunk-E65WJVI5.js";
32
+ import "./chunk-L6WBJGQS.js";
33
+ import "./chunk-UYXV5NIS.js";
34
+ import "./chunk-AACN5GNE.js";
35
+ import "./chunk-3HTZDY3C.js";
36
+ import "./chunk-CDFJF5YD.js";
37
+ import "./chunk-RNXOWDM6.js";
38
+ import "./chunk-ZCQBNPRH.js";
39
+ import "./chunk-TMNUTMT5.js";
40
+ import "./chunk-AWQWXSW4.js";
41
+ import "./chunk-QYF5S6P6.js";
42
+ import "./chunk-CZCAZVTD.js";
43
+ import "./chunk-X5BJ3G2P.js";
44
+ import "./chunk-NL5LSKVD.js";
45
+ import "./chunk-PIIUNJIT.js";
46
+ import "./chunk-W5E72HJA.js";
47
+ import "./chunk-S26LC76R.js";
48
+ import "./chunk-VCRVNLE7.js";
49
+ import "./chunk-LJDODBBZ.js";
50
+ import "./chunk-CB7PEVOJ.js";
51
+ import "./chunk-NXL4FFQQ.js";
52
+ export {
53
+ DependencyChecker,
54
+ buildMadgeArgs,
55
+ mapWithConcurrency,
56
+ resetMadgeManagedPathMemo
57
+ };
@@ -1,6 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  TrivyClient,
4
+ existingDependencyManifests,
4
5
  hasAnyDependencyManifest,
5
6
  isTrivyEnabled,
6
7
  parseTrivyLicenses,
@@ -8,28 +9,29 @@ import {
8
9
  parseTrivySecrets,
9
10
  resolveSeverityFloor,
10
11
  shouldScanTrivy,
12
+ trivyEvidenceFiles,
11
13
  worktreeSkipDirs
12
- } from "./chunk-E7HJ56Y7.js";
13
- import "./chunk-V63BC55Q.js";
14
- import "./chunk-CPSR3AVL.js";
15
- import "./chunk-ZE3KXHS7.js";
16
- import "./chunk-3F6BMY53.js";
17
- import "./chunk-KW5JQPO5.js";
18
- import "./chunk-YVHBNSME.js";
14
+ } from "./chunk-H3BVMK47.js";
15
+ import "./chunk-VO4JFPTV.js";
16
+ import "./chunk-PBZNYHMM.js";
17
+ import "./chunk-ZZN74OGD.js";
18
+ import "./chunk-LT62P654.js";
19
+ import "./chunk-L6WBJGQS.js";
20
+ import "./chunk-AACN5GNE.js";
21
+ import "./chunk-TMNUTMT5.js";
19
22
  import "./chunk-AWQWXSW4.js";
20
- import "./chunk-KPPJTH44.js";
21
- import "./chunk-J6JP25XU.js";
22
- import "./chunk-U5HPROLA.js";
23
- import "./chunk-WME2OQST.js";
24
- import "./chunk-KXF5R4UN.js";
23
+ import "./chunk-X5BJ3G2P.js";
24
+ import "./chunk-NL5LSKVD.js";
25
+ import "./chunk-PIIUNJIT.js";
26
+ import "./chunk-W5E72HJA.js";
25
27
  import "./chunk-S26LC76R.js";
26
- import "./chunk-Z2XAOKHK.js";
27
- import "./chunk-VSFLRN5Y.js";
28
+ import "./chunk-VCRVNLE7.js";
28
29
  import "./chunk-LJDODBBZ.js";
29
- import "./chunk-PQJFG24Z.js";
30
+ import "./chunk-CB7PEVOJ.js";
30
31
  import "./chunk-NXL4FFQQ.js";
31
32
  export {
32
33
  TrivyClient,
34
+ existingDependencyManifests,
33
35
  hasAnyDependencyManifest,
34
36
  isTrivyEnabled,
35
37
  parseTrivyLicenses,
@@ -37,5 +39,6 @@ export {
37
39
  parseTrivySecrets,
38
40
  resolveSeverityFloor,
39
41
  shouldScanTrivy,
42
+ trivyEvidenceFiles,
40
43
  worktreeSkipDirs
41
44
  };
@@ -4,32 +4,31 @@ import {
4
4
  discoverManagedTool,
5
5
  getManagedToolEnvironment,
6
6
  resolveAvailableOrInstall
7
- } from "./chunk-7E2563GA.js";
7
+ } from "./chunk-NCLO6E6N.js";
8
8
  import {
9
9
  mapWithConcurrency
10
10
  } from "./chunk-XIMYZ3JA.js";
11
11
  import {
12
12
  findNodeToolBinary
13
- } from "./chunk-NA7SEXHE.js";
13
+ } from "./chunk-E65WJVI5.js";
14
14
  import {
15
15
  getIsolatedNpxSpawnOptions
16
- } from "./chunk-3F6BMY53.js";
16
+ } from "./chunk-L6WBJGQS.js";
17
17
  import {
18
18
  createAvailabilityLatch
19
- } from "./chunk-KW5JQPO5.js";
19
+ } from "./chunk-AACN5GNE.js";
20
20
  import {
21
21
  safeSpawnAsync
22
- } from "./chunk-YVHBNSME.js";
22
+ } from "./chunk-TMNUTMT5.js";
23
23
  import {
24
24
  compareOrdinal,
25
+ createSubsystemLogger,
25
26
  recordDegradationOnce
26
- } from "./chunk-WME2OQST.js";
27
+ } from "./chunk-W5E72HJA.js";
27
28
  import {
28
- createSubsystemLogger
29
- } from "./chunk-KXF5R4UN.js";
30
- import {
31
- isFullyQualified
32
- } from "./chunk-PQJFG24Z.js";
29
+ isFullyQualified,
30
+ isUnderDir
31
+ } from "./chunk-CB7PEVOJ.js";
33
32
 
34
33
  // dist/clients/dependency-checker.js
35
34
  import * as fs from "node:fs";
@@ -73,16 +72,12 @@ function parseMadgeCycles(stdout, baseDir, projectRoot) {
73
72
  var MADGE_BATCH_CONCURRENCY = 6;
74
73
  var MADGE_STATS_TARGET_CAP = 12;
75
74
  var MADGE_STATS_TARGET_MIN_DURATION_MS = 100;
76
- function isWithin(dir, target) {
77
- const rel = path.relative(dir, target);
78
- return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel);
79
- }
80
75
  function classifyMadgeKind(resolved, managedToolsDir, projectRoot) {
81
76
  if (!isFullyQualified(resolved))
82
77
  return "path";
83
- if (isWithin(managedToolsDir, resolved))
78
+ if (isUnderDir(resolved, managedToolsDir))
84
79
  return "managed";
85
- if (isWithin(projectRoot, resolved))
80
+ if (isUnderDir(resolved, projectRoot))
86
81
  return "local";
87
82
  return "global";
88
83
  }
@@ -1,27 +1,26 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  rootMarkersForFile
4
- } from "./chunk-PUZ3E2J4.js";
4
+ } from "./chunk-3HTZDY3C.js";
5
5
  import {
6
6
  createGenerationMap,
7
7
  createGenerationSource
8
- } from "./chunk-YVHBNSME.js";
8
+ } from "./chunk-TMNUTMT5.js";
9
9
  import {
10
10
  getDegradationLedgerGeneration,
11
+ logExtension,
11
12
  recordDegradationOnce
12
- } from "./chunk-WME2OQST.js";
13
+ } from "./chunk-W5E72HJA.js";
13
14
  import {
14
- logExtension
15
- } from "./chunk-KXF5R4UN.js";
16
- import {
17
- isAtOrAboveHomeDir,
18
15
  isRealGitMarker,
19
16
  isUnderDir,
20
17
  isWindowsPath,
21
18
  nameMatchesMarkerGlob,
22
19
  normalizeEphemeralMapKey,
23
- realpathOrResolve
24
- } from "./chunk-PQJFG24Z.js";
20
+ realpathOrResolve,
21
+ toPosix,
22
+ walkUpDirs
23
+ } from "./chunk-CB7PEVOJ.js";
25
24
 
26
25
  // dist/clients/tool-cwd.js
27
26
  import * as os from "node:os";
@@ -120,12 +119,9 @@ function syncGeneration() {
120
119
  }
121
120
  }
122
121
  function walkMarkerRoot(startDir, markers, homeDir) {
123
- let current = path.resolve(startDir);
124
- for (let depth = 0; depth < 64; depth++) {
125
- if (isAtOrAboveHomeDir(current, homeDir))
126
- break;
122
+ for (const current of walkUpDirs(startDir, { homeDir, maxDepth: 64 })) {
127
123
  for (const marker of markers) {
128
- const slash = marker.replace(/\\/g, "/").lastIndexOf("/");
124
+ const slash = toPosix(marker).lastIndexOf("/");
129
125
  const parent = slash >= 0 ? marker.slice(0, slash) : "";
130
126
  const basename = slash >= 0 ? marker.slice(slash + 1) : marker;
131
127
  const target = parent ? path.join(current, ...parent.split("/").filter(Boolean)) : current;
@@ -142,10 +138,6 @@ function walkMarkerRoot(startDir, markers, homeDir) {
142
138
  if (found)
143
139
  return { root: current, marker };
144
140
  }
145
- const parentDir = path.dirname(current);
146
- if (parentDir === current)
147
- break;
148
- current = parentDir;
149
141
  }
150
142
  return { root: null };
151
143
  }
@@ -3,29 +3,28 @@ import {
3
3
  shouldRecurseIntoDir,
4
4
  walkTreeRecursiveSync,
5
5
  walkTreeStackAsync
6
- } from "./chunk-ZGSJDWQU.js";
6
+ } from "./chunk-ZCQBNPRH.js";
7
7
  import {
8
8
  getProjectIgnoreMatcher
9
- } from "./chunk-YVHBNSME.js";
9
+ } from "./chunk-TMNUTMT5.js";
10
10
  import {
11
11
  KIND_EXTENSIONS,
12
+ SPECIAL_FILENAMES,
12
13
  isCodeKindFile
13
- } from "./chunk-RZOXUSPC.js";
14
+ } from "./chunk-CZCAZVTD.js";
14
15
  import {
15
16
  classifyGeneratedOrArtifactDetailed,
16
17
  isDeclarationFile
17
- } from "./chunk-KPPJTH44.js";
18
- import {
19
- logLatency
20
- } from "./chunk-Z2XAOKHK.js";
18
+ } from "./chunk-X5BJ3G2P.js";
21
19
  import {
20
+ logLatency,
22
21
  toPositiveFinite
23
- } from "./chunk-VSFLRN5Y.js";
22
+ } from "./chunk-VCRVNLE7.js";
24
23
  import {
25
24
  BoundedLruCache,
26
25
  normalizeEphemeralMapKey,
27
26
  normalizeFilePath
28
- } from "./chunk-PQJFG24Z.js";
27
+ } from "./chunk-CB7PEVOJ.js";
29
28
 
30
29
  // dist/clients/source-filter.js
31
30
  import * as fs2 from "node:fs";
@@ -302,8 +301,9 @@ function classifyEntry(entry, fullPath, cfg, probeCache, skipCounters, siblings)
302
301
  }
303
302
  if (entry.isFile()) {
304
303
  const ext = path2.extname(entry.name).toLowerCase();
305
- if (!extensions.has(ext))
304
+ if (!extensions.has(ext) && !(options?.includeNamedFiles === true && SPECIAL_FILENAMES.some(({ pattern }) => pattern.test(entry.name)))) {
306
305
  return {};
306
+ }
307
307
  if (ignoreMatcher.isIgnored(fullPath, false))
308
308
  return {};
309
309
  if (isBuildArtifact(fullPath, probeCache, siblings)) {
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getGlobalPiLensDir
4
- } from "./chunk-YVHBNSME.js";
4
+ } from "./chunk-TMNUTMT5.js";
5
5
 
6
6
  // dist/clients/opengrep-rule-pack.js
7
7
  import * as fs from "node:fs";
@@ -1,34 +1,32 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  parseSymbolKey
4
- } from "./chunk-6IR3ZYIB.js";
4
+ } from "./chunk-6GPB3JLL.js";
5
5
  import "./chunk-3MED75HT.js";
6
6
  import {
7
7
  isBuildArtifact
8
- } from "./chunk-EKWX4WD3.js";
9
- import "./chunk-ZGSJDWQU.js";
8
+ } from "./chunk-RNXOWDM6.js";
9
+ import "./chunk-ZCQBNPRH.js";
10
10
  import {
11
11
  getProjectDataDir
12
- } from "./chunk-YVHBNSME.js";
12
+ } from "./chunk-TMNUTMT5.js";
13
13
  import "./chunk-QYF5S6P6.js";
14
- import "./chunk-RZOXUSPC.js";
14
+ import "./chunk-CZCAZVTD.js";
15
15
  import {
16
16
  detectFileRole
17
- } from "./chunk-KPPJTH44.js";
18
- import "./chunk-J6JP25XU.js";
17
+ } from "./chunk-X5BJ3G2P.js";
18
+ import "./chunk-NL5LSKVD.js";
19
19
  import {
20
20
  writeFileAtomic
21
- } from "./chunk-U5HPROLA.js";
22
- import "./chunk-WME2OQST.js";
23
- import "./chunk-KXF5R4UN.js";
21
+ } from "./chunk-PIIUNJIT.js";
22
+ import "./chunk-W5E72HJA.js";
24
23
  import "./chunk-S26LC76R.js";
25
- import "./chunk-Z2XAOKHK.js";
26
- import "./chunk-VSFLRN5Y.js";
24
+ import "./chunk-VCRVNLE7.js";
27
25
  import "./chunk-LJDODBBZ.js";
28
26
  import {
29
27
  isExternalOrVendorFile,
30
28
  toProjectRelativePath
31
- } from "./chunk-PQJFG24Z.js";
29
+ } from "./chunk-CB7PEVOJ.js";
32
30
  import "./chunk-NXL4FFQQ.js";
33
31
 
34
32
  // dist/clients/codebase-model.js