pi-lens 4.4.8 → 4.4.10

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 (169) hide show
  1. package/CHANGELOG-USER.md +31 -0
  2. package/CHANGELOG.md +258 -0
  3. package/README.md +4 -1
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -1
  5. package/dist/{chunk-6YUNI7B5.js → chunk-2ADRLTM2.js} +14 -60
  6. package/dist/{chunk-4B2YFN4U.js → chunk-2LVJQU3I.js} +46 -33
  7. package/dist/{chunk-2453RRJ2.js → chunk-3FRI5H4T.js} +72 -23
  8. package/dist/{chunk-7MAD5ZAY.js → chunk-3HM4BUHR.js} +14 -16
  9. package/dist/chunk-3QWVOBZJ.js +73 -0
  10. package/dist/{chunk-PIQQM32Y.js → chunk-46TQJSUE.js} +4 -2
  11. package/dist/{chunk-RZG472YW.js → chunk-4ITEFRDH.js} +84 -46
  12. package/dist/{chunk-6FIRFP6A.js → chunk-4NCDHTFI.js} +10 -12
  13. package/dist/{chunk-7CGIDRIK.js → chunk-6I44EDNQ.js} +14 -16
  14. package/dist/{chunk-2BKUFQKR.js → chunk-6MDM5MQT.js} +554 -217
  15. package/dist/{chunk-BBET6HD6.js → chunk-7JX3RNG4.js} +1 -1
  16. package/dist/{chunk-JE6HKLC7.js → chunk-7WJ55KBN.js} +2 -4
  17. package/dist/{chunk-4BKU7PV3.js → chunk-A5TEJZGJ.js} +2 -1
  18. package/dist/{chunk-7ANZ7XDD.js → chunk-ACRJ2GZ5.js} +2 -2
  19. package/dist/{chunk-2ZE3AUJQ.js → chunk-ALIZWXHZ.js} +13 -15
  20. package/dist/{chunk-BQG2QFVO.js → chunk-AON2QIJF.js} +43 -55
  21. package/dist/chunk-B2YUE6YD.js +23 -0
  22. package/dist/{chunk-L4NEVZ4T.js → chunk-B6HXETWY.js} +25 -27
  23. package/dist/chunk-BDR5MEZY.js +25 -0
  24. package/dist/{chunk-HXFUTMX2.js → chunk-BGLS5SDN.js} +2 -2
  25. package/dist/{chunk-ZZDIOAAJ.js → chunk-BRESRQBE.js} +6 -6
  26. package/dist/{chunk-WXUDRAG6.js → chunk-C6AODRNU.js} +10 -12
  27. package/dist/{chunk-GMROJJRN.js → chunk-CB7PEVOJ.js} +9 -1
  28. package/dist/{chunk-BHWW6FAX.js → chunk-CTB5BAJI.js} +53 -22
  29. package/dist/{chunk-VN3L2JWZ.js → chunk-CYUJB552.js} +5 -5
  30. package/dist/{chunk-6GMGEKQN.js → chunk-CZAWWXP6.js} +39 -12
  31. package/dist/{chunk-G5GV2Q7K.js → chunk-CZCAZVTD.js} +16 -2
  32. package/dist/chunk-DBS736MA.js +57 -0
  33. package/dist/{chunk-OWTG6UMO.js → chunk-DOUAWKLO.js} +75 -22
  34. package/dist/{chunk-BOPDQ7AZ.js → chunk-DVRJBQOJ.js} +19 -21
  35. package/dist/{chunk-UHHLR2VY.js → chunk-E4VXKTBR.js} +38 -41
  36. package/dist/{chunk-X66YJ2SS.js → chunk-F6FT6BVQ.js} +33 -34
  37. package/dist/{chunk-GIRBSBGL.js → chunk-FCQSZQAT.js} +3 -3
  38. package/dist/{chunk-X35S7HSB.js → chunk-FOEPIX76.js} +41 -30
  39. package/dist/{chunk-MC6VB2E5.js → chunk-GMC4ZGYR.js} +17 -5
  40. package/dist/{chunk-7TNILKGY.js → chunk-GTTMQ6XB.js} +1 -1
  41. package/dist/{chunk-HHR7WGCI.js → chunk-GUGKKGG7.js} +3 -3
  42. package/dist/{chunk-OZWXLJMX.js → chunk-GVWIU7M7.js} +2 -2
  43. package/dist/{chunk-WMDUT4KH.js → chunk-H65TYP6V.js} +94 -90
  44. package/dist/{chunk-5F3XF3SX.js → chunk-HILZE4BQ.js} +9 -8
  45. package/dist/{chunk-PKSUMEPT.js → chunk-HSYFLOZY.js} +3 -3
  46. package/dist/{chunk-4QG55RRC.js → chunk-I32RSMH6.js} +10 -12
  47. package/dist/chunk-I74RQGKA.js +88 -0
  48. package/dist/{chunk-G6JKM4O7.js → chunk-IDCTDKIA.js} +10 -10
  49. package/dist/chunk-IK4YS3KC.js +25 -0
  50. package/dist/{chunk-O2ARHQKF.js → chunk-IL6PIV33.js} +2 -2
  51. package/dist/{chunk-L3CLUGDY.js → chunk-J6BR5XN2.js} +3 -3
  52. package/dist/chunk-JKOZ2Z4U.js +20 -0
  53. package/dist/{chunk-SP4TFY5F.js → chunk-JZQGRARR.js} +11 -13
  54. package/dist/{chunk-CUDD35TW.js → chunk-K6WIBVMK.js} +6 -5
  55. package/dist/{chunk-DIWK3LBC.js → chunk-KDCIG23C.js} +8 -10
  56. package/dist/{chunk-4NBWFYWW.js → chunk-KFRDFAOE.js} +8 -33
  57. package/dist/{chunk-I22THIHI.js → chunk-KJ3AHOCK.js} +10 -12
  58. package/dist/{chunk-VOP4PJKA.js → chunk-KSTQ4VXT.js} +7 -9
  59. package/dist/{chunk-RGGH6M34.js → chunk-LT62P654.js} +1 -1
  60. package/dist/chunk-MAD4QJTP.js +198 -0
  61. package/dist/{chunk-CM73PPGD.js → chunk-MN635QYA.js} +3 -4
  62. package/dist/{chunk-HUAM7QG3.js → chunk-NBM7PNBP.js} +25 -23
  63. package/dist/{chunk-DYRZGUMA.js → chunk-NE4EFHJX.js} +2 -2
  64. package/dist/{chunk-SQC7K3SP.js → chunk-NL5LSKVD.js} +2 -2
  65. package/dist/{chunk-JZRP4DGP.js → chunk-NPNFGYLV.js} +4 -2
  66. package/dist/{chunk-NM2NWH55.js → chunk-NUSXS6YB.js} +6 -5
  67. package/dist/{chunk-ZKLTNLAW.js → chunk-OPFNQBS5.js} +6 -6
  68. package/dist/{chunk-PPKECBPP.js → chunk-OTSTS7L2.js} +19 -1
  69. package/dist/{chunk-SFLHSL5R.js → chunk-PTSA6QKL.js} +18 -7
  70. package/dist/{chunk-OY7WZI7Q.js → chunk-Q2VCKC3X.js} +6 -6
  71. package/dist/{chunk-HKIL6DCL.js → chunk-QGITU23N.js} +1 -1
  72. package/dist/{chunk-3O5EII3W.js → chunk-QHOTTC4A.js} +2 -2
  73. package/dist/{chunk-35WKJWO5.js → chunk-QL37SGTS.js} +112 -20
  74. package/dist/{chunk-OC7VWJBZ.js → chunk-QMV2APEH.js} +35 -37
  75. package/dist/{chunk-BUZIQDFS.js → chunk-QSCZAP24.js} +3 -3
  76. package/dist/{chunk-O4N5BQ3T.js → chunk-QUPYLQA4.js} +8 -10
  77. package/dist/{chunk-A5GRLYPZ.js → chunk-QUQY3IME.js} +7 -13
  78. package/dist/{chunk-R2QQC33W.js → chunk-QWTHFFU6.js} +12 -14
  79. package/dist/{chunk-TV6RXRYH.js → chunk-RQRKIRFY.js} +8 -10
  80. package/dist/{chunk-ZFORSIED.js → chunk-S3WFVG5P.js} +15 -42
  81. package/dist/{chunk-5RNB4HVK.js → chunk-SG2JQ2YP.js} +1 -1
  82. package/dist/{chunk-KZ4ALBCH.js → chunk-SJQUWQR6.js} +2 -2
  83. package/dist/{chunk-T2S3FNNJ.js → chunk-SKVNHCT5.js} +41 -42
  84. package/dist/{chunk-SDFKOLSF.js → chunk-TJQSYX3J.js} +8 -6
  85. package/dist/{chunk-IYVYZQRL.js → chunk-TLWFZ66Y.js} +5 -7
  86. package/dist/{chunk-5T5A6YAJ.js → chunk-TN5CWX5D.js} +33 -34
  87. package/dist/chunk-TQHOKMVZ.js +28 -0
  88. package/dist/{chunk-XOMGO63G.js → chunk-TYHOEX4V.js} +19 -21
  89. package/dist/{chunk-6LJOJ6EO.js → chunk-UNBRHPHJ.js} +14 -16
  90. package/dist/{chunk-4LL2VRNY.js → chunk-UOO4D2TK.js} +16 -18
  91. package/dist/{chunk-AGGUWKRK.js → chunk-UY745U35.js} +1 -1
  92. package/dist/{chunk-LSFXZLPW.js → chunk-V7F7JHS5.js} +218 -253
  93. package/dist/{chunk-VLQ7UKZH.js → chunk-VCRVNLE7.js} +135 -2
  94. package/dist/{chunk-JPRDTY5S.js → chunk-VGTBLTPN.js} +8 -10
  95. package/dist/{chunk-JBP7KESM.js → chunk-VPFRU5IG.js} +1 -1
  96. package/dist/chunk-VS2L7QDI.js +25 -0
  97. package/dist/{chunk-4W52ZKZX.js → chunk-W4CUK5G6.js} +2 -2
  98. package/dist/{chunk-VPLBLWFO.js → chunk-W7TY6HYX.js} +1 -1
  99. package/dist/{chunk-JYLOYTZD.js → chunk-WAA63ZJV.js} +5 -1
  100. package/dist/{chunk-WC6WRNQT.js → chunk-WS3UFJOU.js} +2 -2
  101. package/dist/chunk-XAFZJEXY.js +50 -0
  102. package/dist/{chunk-XYLC35E4.js → chunk-XPGH5O74.js} +555 -336
  103. package/dist/{chunk-VOXTCULR.js → chunk-XVB3Q2PG.js} +2 -4
  104. package/dist/{chunk-FRLAUP2B.js → chunk-Y3EHLUPL.js} +4 -4
  105. package/dist/{chunk-CZL44WFN.js → chunk-YF4G5NN5.js} +2 -2
  106. package/dist/{chunk-XWIME22V.js → chunk-YQA34KAF.js} +11 -13
  107. package/dist/{chunk-FHEV6T4L.js → chunk-YT2VR4SL.js} +8 -10
  108. package/dist/chunk-ZD4KVFXI.js +234 -0
  109. package/dist/{chunk-NSPVR3FN.js → chunk-ZOPXB2KK.js} +17 -19
  110. package/dist/chunk-ZPFLHB3R.js +28 -0
  111. package/dist/{chunk-R4QWJQ2H.js → chunk-ZZDVGCGG.js} +9 -11
  112. package/dist/index.js +5398 -4438
  113. package/dist/mcp/analyze-cli.js +12 -17
  114. package/dist/mcp/cli.js +41 -42
  115. package/dist/mcp/server.js +1466 -663
  116. package/dist/mcp/worker.js +59 -60
  117. package/dist/probes/installer.js +17 -19
  118. package/docs/agent-guide.md +2 -1
  119. package/docs/agent-tools.md +53 -10
  120. package/docs/analysisall.md +1 -1
  121. package/docs/ci-bot-pr-checks.md +7 -5
  122. package/docs/configuration.md +60 -13
  123. package/docs/defect-shapes.md +67 -4
  124. package/docs/environment-variables.md +18 -1
  125. package/docs/features.md +23 -6
  126. package/docs/globalconfig.md +24 -3
  127. package/docs/invariants/language-config.md +9 -1
  128. package/docs/invariants/lsp-trust-exec.md +9 -2
  129. package/docs/invariants/session-telemetry.md +2 -2
  130. package/docs/language-coverage.md +67 -0
  131. package/docs/lsp-capability-matrix.md +121 -53
  132. package/docs/lsp-idle-eviction.md +20 -13
  133. package/docs/merge-queue-rollout.md +10 -8
  134. package/docs/module-report-read-symbol.md +34 -23
  135. package/docs/pi-lens-fixer.md +19 -7
  136. package/docs/pi-lens-investigator.md +3 -0
  137. package/docs/pi-lens-merge-policy.md +20 -8
  138. package/docs/pi-lens-release.md +3 -2
  139. package/docs/pi-lens-reviewer.md +53 -12
  140. package/docs/pi-lens-subagent.md +13 -0
  141. package/docs/public-api-stability.md +39 -5
  142. package/docs/release-qa-baseline.md +7 -4
  143. package/docs/schema/pi-lens-config-v1.json +11 -2
  144. package/docs/servercapabilities.md +3 -1
  145. package/docs/settings.md +9 -6
  146. package/docs/usage.md +1 -0
  147. package/docs/word-index.md +3 -2
  148. package/package.json +9 -4
  149. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  150. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  151. package/scripts/download-grammars.js +13 -2
  152. package/scripts/grammars.lock.json +7 -0
  153. package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  154. package/vendor/grammars/tree-sitter-groovy.wasm +0 -0
  155. package/dist/chunk-2TS4GLOJ.js +0 -31
  156. package/dist/chunk-3JAHQBSY.js +0 -27
  157. package/dist/chunk-447YZL4S.js +0 -25
  158. package/dist/chunk-565VRUP4.js +0 -136
  159. package/dist/chunk-57X2CDRX.js +0 -49
  160. package/dist/chunk-GGYOZWHW.js +0 -27
  161. package/dist/chunk-IE5D3RA5.js +0 -58
  162. package/dist/chunk-LPYTPNOJ.js +0 -22
  163. package/dist/chunk-OFNMHPBT.js +0 -89
  164. package/dist/chunk-U3AS2FR6.js +0 -106
  165. package/dist/chunk-W3BGKBBK.js +0 -27
  166. package/dist/chunk-WQV6BI4Q.js +0 -48
  167. package/dist/chunk-YHGYAEFH.js +0 -443
  168. package/dist/chunk-ZONZ6YY3.js +0 -74
  169. package/dist/chunk-ZSM35JF4.js +0 -30
@@ -6,14 +6,16 @@ import {
6
6
  UNRESOLVED_NAME_NODE_PREFIX
7
7
  } from "./chunk-PKLB2XJL.js";
8
8
  import {
9
+ LspRequestTimeoutError,
9
10
  buildReverseDependencyIndexFromGraph,
10
11
  getLSPService,
12
+ isLspRequestTimeoutError,
11
13
  rankFilesByReverseDependencyCentrality
12
- } from "./chunk-2BKUFQKR.js";
14
+ } from "./chunk-6MDM5MQT.js";
13
15
  import {
14
16
  notePersistWorkerMessageFault,
15
17
  readWorkerHeapStatistics
16
- } from "./chunk-ZZDIOAAJ.js";
18
+ } from "./chunk-BRESRQBE.js";
17
19
  import {
18
20
  buildQualifiedName,
19
21
  findOwnerName
@@ -29,59 +31,60 @@ import {
29
31
  resolveProjectReferenceImport,
30
32
  resolveWorkspacePackageImport,
31
33
  symbolExtractionGrammar
32
- } from "./chunk-35WKJWO5.js";
34
+ } from "./chunk-QL37SGTS.js";
33
35
  import {
34
36
  classifyTreeSitterWasmError,
35
37
  getSharedTreeSitterClient,
36
38
  logTreeSitterCacheStats,
37
39
  withTreeSitterRoot
38
- } from "./chunk-BHWW6FAX.js";
40
+ } from "./chunk-CTB5BAJI.js";
39
41
  import {
40
42
  getReviewGraphMaxFilesDerived
41
- } from "./chunk-HXFUTMX2.js";
43
+ } from "./chunk-BGLS5SDN.js";
44
+ import {
45
+ withBudget
46
+ } from "./chunk-WAA63ZJV.js";
42
47
  import {
43
48
  readGzipStageWorkerResult,
44
49
  reapStageFile
45
50
  } from "./chunk-IJYGIDF4.js";
46
51
  import {
47
52
  collectSourceFilesWithBudgetAsync
48
- } from "./chunk-G6JKM4O7.js";
53
+ } from "./chunk-IDCTDKIA.js";
49
54
  import {
50
55
  collectUntrackedIgnoredIds,
51
56
  createGitIdentityResolver,
52
57
  getProjectDataDir,
53
58
  isStaleStageFile,
54
59
  resolveGitIdentity
55
- } from "./chunk-WMDUT4KH.js";
60
+ } from "./chunk-H65TYP6V.js";
56
61
  import {
57
62
  KIND_EXTENSIONS,
58
63
  detectFileKind
59
- } from "./chunk-G5GV2Q7K.js";
64
+ } from "./chunk-CZCAZVTD.js";
60
65
  import {
61
66
  detectFileRole
62
- } from "./chunk-X35S7HSB.js";
67
+ } from "./chunk-FOEPIX76.js";
63
68
  import {
64
69
  writeFileAtomic
65
- } from "./chunk-JE6HKLC7.js";
70
+ } from "./chunk-7WJ55KBN.js";
66
71
  import {
67
72
  compareOrdinal,
68
73
  escapeRegExp,
69
74
  incrementDegradationCount
70
- } from "./chunk-2453RRJ2.js";
71
- import {
72
- logLatency
73
- } from "./chunk-565VRUP4.js";
75
+ } from "./chunk-3FRI5H4T.js";
74
76
  import {
75
77
  createNdjsonLogger,
76
78
  getGlobalPiLensLogDir,
77
79
  getMaxLogSizeMB,
78
80
  getTurnId,
79
81
  isTestMode,
80
- lazyEnvNumber
81
- } from "./chunk-VLQ7UKZH.js";
82
+ lazyEnvNumber,
83
+ logLatency
84
+ } from "./chunk-VCRVNLE7.js";
82
85
  import {
83
86
  FactStore
84
- } from "./chunk-4BKU7PV3.js";
87
+ } from "./chunk-A5TEJZGJ.js";
85
88
  import {
86
89
  BoundedFifoMap,
87
90
  BoundedLruCache,
@@ -92,7 +95,7 @@ import {
92
95
  realpathOrResolve,
93
96
  toPosix,
94
97
  toProjectRelativePath
95
- } from "./chunk-GMROJJRN.js";
98
+ } from "./chunk-CB7PEVOJ.js";
96
99
 
97
100
  // dist/clients/review-graph/builder.js
98
101
  import { createHash as createHash2 } from "node:crypto";
@@ -250,19 +253,17 @@ async function getOpenDocumentSymbols(filePath, timeoutMs = LSP_DOCUMENT_SYMBOL_
250
253
  if (!spawned || !spawned.client.isDocumentOpen(filePath) || !spawned.client.getOperationSupport().documentSymbol) {
251
254
  return void 0;
252
255
  }
253
- let timer;
254
256
  try {
255
- return await Promise.race([
256
- spawned.client.documentSymbol(filePath),
257
- new Promise((resolve2) => {
258
- timer = setTimeout(() => resolve2(void 0), timeoutMs);
259
- })
260
- ]);
261
- } catch {
257
+ const startedAt = Date.now();
258
+ const symbols = await withBudget(spawned.client.documentSymbol(filePath), timeoutMs);
259
+ if (symbols === void 0) {
260
+ throw new LspRequestTimeoutError("textDocument/documentSymbol", timeoutMs, Date.now() - startedAt);
261
+ }
262
+ return symbols;
263
+ } catch (err) {
264
+ if (isLspRequestTimeoutError(err))
265
+ throw err;
262
266
  return void 0;
263
- } finally {
264
- if (timer)
265
- clearTimeout(timer);
266
267
  }
267
268
  }
268
269
  function containerNameChain(symbol, allSymbols) {
@@ -2484,8 +2485,8 @@ async function ensureReviewGraphFacts(filePath, cwd, facts, contentOverride) {
2484
2485
  }
2485
2486
  try {
2486
2487
  const [{ importFactProvider }, { functionFactProvider }] = await Promise.all([
2487
- import("./chunk-ZSM35JF4.js"),
2488
- import("./chunk-2TS4GLOJ.js")
2488
+ import("./chunk-ZPFLHB3R.js"),
2489
+ import("./chunk-TQHOKMVZ.js")
2489
2490
  ]);
2490
2491
  await importFactProvider.run(ctx, facts);
2491
2492
  await functionFactProvider.run(ctx, facts);
@@ -3147,12 +3148,23 @@ async function addFileToGraph(graph, cwd, file, ignoredIds, contentOverride) {
3147
3148
  _wasmTrappedFiles.delete(file);
3148
3149
  addTreeSitterFile(graph, cwd, file, languageId, extracted, ignoredIds);
3149
3150
  if (extracted.symbols.length === 0) {
3150
- const lspSymbols = await getOpenDocumentSymbols(file);
3151
+ let lspSymbols;
3152
+ let lspSymbolTimedOut = false;
3153
+ let lspSymbolError;
3154
+ try {
3155
+ lspSymbols = await getOpenDocumentSymbols(file);
3156
+ } catch (err) {
3157
+ if (isLspRequestTimeoutError(err))
3158
+ lspSymbolTimedOut = true;
3159
+ else
3160
+ lspSymbolError = String(err instanceof Error ? err.message : err).slice(0, 512);
3161
+ }
3151
3162
  const added = lspSymbols ? addLspFallbackSymbols(graph, file, languageId, lspSymbols) : 0;
3152
3163
  logReviewGraph({
3153
3164
  phase: "lsp_symbol_fallback",
3154
3165
  cwd,
3155
- reason: lspSymbols ? added > 0 ? "added" : "empty-response" : "unavailable-or-failed",
3166
+ reason: lspSymbolTimedOut ? "timeout" : lspSymbols ? added > 0 ? "added" : "empty-response" : lspSymbolError !== void 0 ? "failed" : "unavailable",
3167
+ ...lspSymbolError !== void 0 && { error: lspSymbolError },
3156
3168
  nodes: added
3157
3169
  });
3158
3170
  }
@@ -4064,6 +4076,7 @@ function extractSymbolsAndRefsFromGraph(graph) {
4064
4076
  case "property":
4065
4077
  case "function":
4066
4078
  return node.symbolKind;
4079
+ case void 0:
4067
4080
  default:
4068
4081
  return "function";
4069
4082
  }
@@ -1,28 +1,62 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- logExtension
4
- } from "./chunk-WQV6BI4Q.js";
5
2
  import {
6
3
  DEPRECATED_CONFIG_SURFACES
7
4
  } from "./chunk-S26LC76R.js";
8
- import {
9
- logLatency
10
- } from "./chunk-565VRUP4.js";
11
5
  import {
12
6
  PROCESS_SINGLETON_RESET_KIND,
7
+ createNdjsonLogger,
8
+ getGlobalPiLensLogDir,
9
+ getMaxLogSizeMB,
13
10
  getProbeHomeRedirectEvent,
14
11
  getProcessSingletonResets,
15
12
  getSinkOptionConflicts,
16
13
  getSinkRotations,
17
14
  getSinkTruncateRefusals,
18
15
  getSinkWriteFailures,
16
+ getTurnId,
17
+ isTestMode,
18
+ logLatency,
19
19
  resetSinkRotations,
20
20
  resetSinkWriteFailures
21
- } from "./chunk-VLQ7UKZH.js";
21
+ } from "./chunk-VCRVNLE7.js";
22
22
  import {
23
23
  getPathIdentityFallbacks,
24
24
  resetPathIdentityFallbacks
25
- } from "./chunk-GMROJJRN.js";
25
+ } from "./chunk-CB7PEVOJ.js";
26
+
27
+ // dist/clients/extension-log.js
28
+ import * as path from "node:path";
29
+ var EXTENSION_LOG_FILE = path.join(getGlobalPiLensLogDir(), "extension.log");
30
+ var writer = createNdjsonLogger({
31
+ filePath: EXTENSION_LOG_FILE,
32
+ maxBytes: getMaxLogSizeMB() * 1024 * 1024
33
+ });
34
+ function logExtension(entry) {
35
+ if (isTestMode())
36
+ return;
37
+ writer.log({
38
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
39
+ pid: process.pid,
40
+ turnId: getTurnId(),
41
+ level: entry.level ?? "error",
42
+ subsystem: entry.subsystem,
43
+ message: entry.message,
44
+ ...entry.metadata ? { metadata: entry.metadata } : {}
45
+ });
46
+ }
47
+ function createSubsystemLogger(subsystem, defaultLevel = "debug") {
48
+ const at = (level) => (message, metadata) => {
49
+ logExtension({ subsystem, message, level, metadata });
50
+ };
51
+ const logger = at(defaultLevel);
52
+ logger.error = at("error");
53
+ logger.warn = at("warn");
54
+ logger.debug = at("debug");
55
+ return logger;
56
+ }
57
+ function flushExtensionLog() {
58
+ return writer.flush();
59
+ }
26
60
 
27
61
  // dist/clients/ledger-bounds.js
28
62
  var LEDGER_FIELD_MAX = 200;
@@ -511,6 +545,14 @@ var LENS_FLAGS = [
511
545
  default: false,
512
546
  scope: "global"
513
547
  },
548
+ {
549
+ name: "no-read-expansion",
550
+ description: "Disable automatic read widening while keeping the read-before-edit monitor active. Also via readGuard.expandReads=false in ~/.pi-lens/config.json.",
551
+ configKey: "readGuard.expandReads",
552
+ negated: true,
553
+ default: false,
554
+ scope: "global"
555
+ },
514
556
  {
515
557
  name: "no-lens-context",
516
558
  description: "Disable automatic context injection (session-start guidance, turn-end & test findings) while keeping tools, LSP, read-guard, and formatting active. Toggle with /lens-context-toggle. Also via contextInjection.enabled=false in config or PI_LENS_NO_CONTEXT_INJECTION=1.",
@@ -633,7 +675,11 @@ var GLOBAL_NON_FLAG_CONFIG_SECTIONS = [
633
675
  ];
634
676
  var GLOBAL_ONLY_NON_FLAG_KEYS = [
635
677
  "actionableWarnings.autoFix.maxFixes",
636
- "dispatch.runnerTimeoutFloorMs"
678
+ "dispatch.runnerTimeoutFloorMs",
679
+ // #5306: the explicit single-file diagnostics query's line limit. `lsp` is
680
+ // recognized at project scope (the LSP loader's namespace), so a project file
681
+ // carrying this is told it does nothing there.
682
+ "lsp.queryMaxFileLines"
637
683
  ];
638
684
  var PROJECT_NON_FLAG_CONFIG_SECTIONS = [
639
685
  "ignore",
@@ -696,7 +742,7 @@ function resolveFlagConfigPath(raw, configKey, warnInvalid) {
696
742
  const next = asConfigObject(object[segment]);
697
743
  if (!next) {
698
744
  if (warnInvalid) {
699
- warnInvalid(`${segments.slice(0, i + 1).join(".")} must be an object`);
745
+ warnInvalid(`${segments.slice(0, i + 1).join(".")} must be an object`, "PILENS_CFG_0005");
700
746
  }
701
747
  return void 0;
702
748
  }
@@ -715,32 +761,32 @@ function hasFlagConfigPath(raw, configKey) {
715
761
  return leaf !== void 0 && leaf in resolved.source;
716
762
  }
717
763
  function readFlagConfigValue(config, configKey) {
718
- const path = resolveFlagConfigPath(config, configKey);
719
- if (!path)
764
+ const path2 = resolveFlagConfigPath(config, configKey);
765
+ if (!path2)
720
766
  return void 0;
721
- const leaf = path.segments[path.segments.length - 1];
722
- const value = path.source[leaf];
767
+ const leaf = path2.segments[path2.segments.length - 1];
768
+ const value = path2.source[leaf];
723
769
  return typeof value === "boolean" ? value : void 0;
724
770
  }
725
771
  function flagValueFromConfig(spec, configValue) {
726
772
  return spec.negated ? !configValue : configValue;
727
773
  }
728
774
  function assignFlagConfigSection(raw, out, configKey, warnInvalid) {
729
- const path = resolveFlagConfigPath(raw, configKey, warnInvalid);
730
- if (!path)
775
+ const path2 = resolveFlagConfigPath(raw, configKey, warnInvalid);
776
+ if (!path2)
731
777
  return;
732
778
  let target = out;
733
- for (const segment of path.segments.slice(0, -1)) {
779
+ for (const segment of path2.segments.slice(0, -1)) {
734
780
  target[segment] ??= {};
735
781
  target = target[segment];
736
782
  }
737
- const leaf = path.segments[path.segments.length - 1];
738
- if (leaf in path.source && typeof path.source[leaf] !== "boolean") {
739
- warnInvalid(`${configKey} must be a boolean`);
783
+ const leaf = path2.segments[path2.segments.length - 1];
784
+ if (leaf in path2.source && typeof path2.source[leaf] !== "boolean") {
785
+ warnInvalid(`${configKey} must be a boolean`, "PILENS_CFG_0005");
740
786
  target[leaf] = void 0;
741
787
  return;
742
788
  }
743
- target[leaf] = path.source[leaf];
789
+ target[leaf] = path2.source[leaf];
744
790
  }
745
791
 
746
792
  // dist/clients/tool-config.js
@@ -958,12 +1004,12 @@ function readToolConfig(raw, warnInvalid) {
958
1004
  continue;
959
1005
  }
960
1006
  if (!value || typeof value !== "object" || Array.isArray(value)) {
961
- warnInvalid(`tools.${name} must be an object with enabled`);
1007
+ warnInvalid(`tools.${name} must be an object with enabled`, "PILENS_CFG_0005");
962
1008
  continue;
963
1009
  }
964
1010
  const enabled = value.enabled;
965
1011
  if (enabled !== void 0 && typeof enabled !== "boolean") {
966
- warnInvalid(`tools.${name}.enabled must be a boolean`);
1012
+ warnInvalid(`tools.${name}.enabled must be a boolean`, "PILENS_CFG_0005");
967
1013
  continue;
968
1014
  }
969
1015
  result[name] = enabled === void 0 ? {} : { enabled };
@@ -972,6 +1018,9 @@ function readToolConfig(raw, warnInvalid) {
972
1018
  }
973
1019
 
974
1020
  export {
1021
+ logExtension,
1022
+ createSubsystemLogger,
1023
+ flushExtensionLog,
975
1024
  LEDGER_FIELD_MAX,
976
1025
  DEGRADATION_ENTRIES_PER_KIND,
977
1026
  truncateForLedger,
@@ -9,26 +9,24 @@ import {
9
9
  getDeadCodeClients,
10
10
  parseVultureOutput,
11
11
  stableFindingKey
12
- } from "./chunk-2ZE3AUJQ.js";
12
+ } from "./chunk-ALIZWXHZ.js";
13
13
  import "./chunk-7U2IDNXN.js";
14
- import "./chunk-KZ4ALBCH.js";
15
- import "./chunk-RZG472YW.js";
16
- import "./chunk-WC6WRNQT.js";
17
- import "./chunk-VOP4PJKA.js";
18
- import "./chunk-JBP7KESM.js";
19
- import "./chunk-JZRP4DGP.js";
20
- import "./chunk-WMDUT4KH.js";
14
+ import "./chunk-SJQUWQR6.js";
15
+ import "./chunk-4ITEFRDH.js";
16
+ import "./chunk-WS3UFJOU.js";
17
+ import "./chunk-KSTQ4VXT.js";
18
+ import "./chunk-VPFRU5IG.js";
19
+ import "./chunk-NPNFGYLV.js";
20
+ import "./chunk-H65TYP6V.js";
21
21
  import "./chunk-AWQWXSW4.js";
22
- import "./chunk-X35S7HSB.js";
23
- import "./chunk-SQC7K3SP.js";
24
- import "./chunk-JE6HKLC7.js";
25
- import "./chunk-2453RRJ2.js";
26
- import "./chunk-WQV6BI4Q.js";
22
+ import "./chunk-FOEPIX76.js";
23
+ import "./chunk-NL5LSKVD.js";
24
+ import "./chunk-7WJ55KBN.js";
25
+ import "./chunk-3FRI5H4T.js";
27
26
  import "./chunk-S26LC76R.js";
28
- import "./chunk-565VRUP4.js";
29
- import "./chunk-VLQ7UKZH.js";
27
+ import "./chunk-VCRVNLE7.js";
30
28
  import "./chunk-LJDODBBZ.js";
31
- import "./chunk-GMROJJRN.js";
29
+ import "./chunk-CB7PEVOJ.js";
32
30
  import "./chunk-NXL4FFQQ.js";
33
31
  export {
34
32
  DEAD_CODE_DELTA_MAX_SHOWN,
@@ -0,0 +1,73 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ adaptLspService,
4
+ getLSPService,
5
+ groupFilesByPrimaryServer,
6
+ hasAuxiliaryLspPublishedForRoot,
7
+ notifyExternalFileChange,
8
+ peekLSPService,
9
+ resetLSPService,
10
+ resyncGitChangedFiles,
11
+ runPerServerGroups
12
+ } from "./chunk-6MDM5MQT.js";
13
+ import "./chunk-FCQSZQAT.js";
14
+ import "./chunk-XIMYZ3JA.js";
15
+ import "./chunk-XPGH5O74.js";
16
+ import "./chunk-NE4EFHJX.js";
17
+ import "./chunk-YT2VR4SL.js";
18
+ import "./chunk-LT62P654.js";
19
+ import "./chunk-BRESRQBE.js";
20
+ import "./chunk-XVB3Q2PG.js";
21
+ import "./chunk-QL37SGTS.js";
22
+ import "./chunk-K6WIBVMK.js";
23
+ import "./chunk-ACRJ2GZ5.js";
24
+ import "./chunk-WS3UFJOU.js";
25
+ import "./chunk-CTB5BAJI.js";
26
+ import "./chunk-Z54ZSOBZ.js";
27
+ import "./chunk-GUGKKGG7.js";
28
+ import "./chunk-QGITU23N.js";
29
+ import "./chunk-OTSTS7L2.js";
30
+ import "./chunk-6HWVI6MI.js";
31
+ import "./chunk-SG2JQ2YP.js";
32
+ import "./chunk-CKEQFGLT.js";
33
+ import "./chunk-NBM7PNBP.js";
34
+ import "./chunk-BGLS5SDN.js";
35
+ import "./chunk-YF4G5NN5.js";
36
+ import "./chunk-W7TY6HYX.js";
37
+ import "./chunk-WAA63ZJV.js";
38
+ import "./chunk-2BEMIWEW.js";
39
+ import "./chunk-IJYGIDF4.js";
40
+ import "./chunk-AON2QIJF.js";
41
+ import "./chunk-TLWFZ66Y.js";
42
+ import "./chunk-KSTQ4VXT.js";
43
+ import "./chunk-VPFRU5IG.js";
44
+ import "./chunk-UYXV5NIS.js";
45
+ import "./chunk-NPNFGYLV.js";
46
+ import "./chunk-TJQSYX3J.js";
47
+ import "./chunk-7JX3RNG4.js";
48
+ import "./chunk-IDCTDKIA.js";
49
+ import "./chunk-IL6PIV33.js";
50
+ import "./chunk-H65TYP6V.js";
51
+ import "./chunk-AWQWXSW4.js";
52
+ import "./chunk-QYF5S6P6.js";
53
+ import "./chunk-CZCAZVTD.js";
54
+ import "./chunk-FOEPIX76.js";
55
+ import "./chunk-NL5LSKVD.js";
56
+ import "./chunk-7WJ55KBN.js";
57
+ import "./chunk-3FRI5H4T.js";
58
+ import "./chunk-S26LC76R.js";
59
+ import "./chunk-VCRVNLE7.js";
60
+ import "./chunk-LJDODBBZ.js";
61
+ import "./chunk-CB7PEVOJ.js";
62
+ import "./chunk-NXL4FFQQ.js";
63
+ export {
64
+ adaptLspService,
65
+ getLSPService,
66
+ groupFilesByPrimaryServer,
67
+ hasAuxiliaryLspPublishedForRoot,
68
+ notifyExternalFileChange,
69
+ peekLSPService,
70
+ resetLSPService,
71
+ resyncGitChangedFiles,
72
+ runPerServerGroups
73
+ };
@@ -1,13 +1,15 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  FactStore,
4
+ MAX_SESSION_FACT_RECORDS,
4
5
  getFactStoreEvictionReporter,
5
6
  setFactStoreEvictionReporter
6
- } from "./chunk-4BKU7PV3.js";
7
- import "./chunk-GMROJJRN.js";
7
+ } from "./chunk-A5TEJZGJ.js";
8
+ import "./chunk-CB7PEVOJ.js";
8
9
  import "./chunk-NXL4FFQQ.js";
9
10
  export {
10
11
  FactStore,
12
+ MAX_SESSION_FACT_RECORDS,
11
13
  getFactStoreEvictionReporter,
12
14
  setFactStoreEvictionReporter
13
15
  };
@@ -1,56 +1,12 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  truncatedByOutputCap
4
- } from "./chunk-JE6HKLC7.js";
4
+ } from "./chunk-7WJ55KBN.js";
5
5
  import {
6
6
  LEDGER_FIELD_MAX,
7
7
  incrementDegradationCount,
8
8
  truncateForLedger
9
- } from "./chunk-2453RRJ2.js";
10
-
11
- // dist/clients/dispatch/runners/utils/spawn-outcome.js
12
- function firstOutputLine(text, max = LEDGER_FIELD_MAX) {
13
- for (const line of String(text ?? "").split(/\r?\n/)) {
14
- const trimmed = line.trim();
15
- if (!trimmed)
16
- continue;
17
- return trimmed.length > max ? `${trimmed.slice(0, max)}\u2026` : trimmed;
18
- }
19
- return "";
20
- }
21
- function processCutShort(result) {
22
- return Boolean(result.error || result.signal) || (result.status ?? null) === null;
23
- }
24
- function classifyRunOutcome(input) {
25
- const { result, exitCodes, reportMissing } = input;
26
- const status = result.status ?? null;
27
- const signal = result.signal ?? null;
28
- const output = input.output ?? result.stdout;
29
- const base = {
30
- status,
31
- signal,
32
- firstOutputLine: firstOutputLine(result.stderr) || firstOutputLine(result.stdout) || firstOutputLine(result.error?.message),
33
- // Evidence carried alongside the verdict, never part of deciding it — the
34
- // branches below are byte-for-byte the pre-#2100 rules.
35
- outputCapped: truncatedByOutputCap(result)
36
- };
37
- if (processCutShort(result) || status === null) {
38
- return { kind: "did-not-run", ...base };
39
- }
40
- if (reportMissing) {
41
- return status === 0 ? { kind: "ran", ...base } : { kind: "report-missing", ...base };
42
- }
43
- if (status !== 0 && exitCodes && !exitCodes.ran.includes(status)) {
44
- return { kind: "rejected-invocation", ...base };
45
- }
46
- if (status !== 0 && !output?.trim()) {
47
- return { kind: "did-not-run", ...base };
48
- }
49
- return { kind: "ran", ...base };
50
- }
51
- function spawnFailedWithNoOutput(result, output = result.stdout) {
52
- return classifyRunOutcome({ result, output }).kind !== "ran" && !output?.trim();
53
- }
9
+ } from "./chunk-3FRI5H4T.js";
54
10
 
55
11
  // dist/clients/dispatch/types.js
56
12
  function spanOverlapsModifiedRanges(startLine, endLine, ranges) {
@@ -58,6 +14,36 @@ function spanOverlapsModifiedRanges(startLine, endLine, ranges) {
58
14
  return true;
59
15
  return ranges.some((r) => startLine <= r.end && endLine >= r.start);
60
16
  }
17
+ var unchecked = (reason, surface = {}) => ({
18
+ checked: false,
19
+ reason,
20
+ ...surface
21
+ });
22
+ var widgetUncheckedReason = (verdict) => verdict.checked || verdict.inapplicable ? void 0 : verdict.reason;
23
+ function checkedVerdict(tier, rows) {
24
+ const [first, ...rest] = rows.filter((row) => row.inconclusive !== true && hasUsableResult(row)).map((row) => row.runnerId);
25
+ if (first === void 0)
26
+ return void 0;
27
+ const completed = [first, ...rest];
28
+ return { checked: true, tier, runnerIds: completed };
29
+ }
30
+ function emptyDispatchResult(verdict) {
31
+ return {
32
+ diagnostics: [],
33
+ blockers: [],
34
+ warnings: [],
35
+ baselineWarningCount: 0,
36
+ fixed: [],
37
+ resolvedCount: 0,
38
+ output: "",
39
+ blockerOutput: "",
40
+ hasBlockers: false,
41
+ verdict
42
+ };
43
+ }
44
+ var IN_FLIGHT_REASON = "the primary check is still running (findings arrive at turn end if it lands)";
45
+ var NO_ANALYZER_REASON = "no analyzer handles this file type";
46
+ var noPrimaryCheckerReason = (lspEnabled) => `no primary checker is enabled for this kind${lspEnabled ? "" : " (--no-lsp turns off its language server)"}`;
61
47
  var RUNNER_SKIP_REASONS = [
62
48
  "no-files-matched",
63
49
  "configured-non-biome-linter",
@@ -130,11 +116,56 @@ function reachedNoVerdict(result) {
130
116
  return true;
131
117
  case "skipped":
132
118
  return !isRunnerSkipReason(result.skipReason) || result.skipReason === "not-enabled";
119
+ case "succeeded":
133
120
  default:
134
121
  return false;
135
122
  }
136
123
  }
137
124
 
125
+ // dist/clients/dispatch/runners/utils/spawn-outcome.js
126
+ function firstOutputLine(text, max = LEDGER_FIELD_MAX) {
127
+ for (const line of String(text ?? "").split(/\r?\n/)) {
128
+ const trimmed = line.trim();
129
+ if (!trimmed)
130
+ continue;
131
+ return trimmed.length > max ? `${trimmed.slice(0, max)}\u2026` : trimmed;
132
+ }
133
+ return "";
134
+ }
135
+ function processCutShort(result) {
136
+ return Boolean(result.error || result.signal) || (result.status ?? null) === null;
137
+ }
138
+ function classifyRunOutcome(input) {
139
+ const { result, exitCodes, reportMissing } = input;
140
+ const status = result.status ?? null;
141
+ const signal = result.signal ?? null;
142
+ const output = input.output ?? result.stdout;
143
+ const base = {
144
+ status,
145
+ signal,
146
+ firstOutputLine: firstOutputLine(result.stderr) || firstOutputLine(result.stdout) || firstOutputLine(result.error?.message),
147
+ // Evidence carried alongside the verdict, never part of deciding it — the
148
+ // branches below are byte-for-byte the pre-#2100 rules.
149
+ outputCapped: truncatedByOutputCap(result)
150
+ };
151
+ if (processCutShort(result) || status === null) {
152
+ return { kind: "did-not-run", ...base };
153
+ }
154
+ if (reportMissing) {
155
+ return status === 0 ? { kind: "ran", ...base } : { kind: "report-missing", ...base };
156
+ }
157
+ if (status !== 0 && exitCodes && !exitCodes.ran.includes(status)) {
158
+ return { kind: "rejected-invocation", ...base };
159
+ }
160
+ if (status !== 0 && !output?.trim()) {
161
+ return { kind: "did-not-run", ...base };
162
+ }
163
+ return { kind: "ran", ...base };
164
+ }
165
+ function spawnFailedWithNoOutput(result, output = result.stdout) {
166
+ return classifyRunOutcome({ result, output }).kind !== "ran" && !output?.trim();
167
+ }
168
+
138
169
  // dist/clients/dispatch/runners/utils/tool-failure.js
139
170
  function describeEnding(input) {
140
171
  if (input.outputCapped)
@@ -259,6 +290,13 @@ function finishParsedRun(input) {
259
290
 
260
291
  export {
261
292
  spanOverlapsModifiedRanges,
293
+ unchecked,
294
+ widgetUncheckedReason,
295
+ checkedVerdict,
296
+ emptyDispatchResult,
297
+ IN_FLIGHT_REASON,
298
+ NO_ANALYZER_REASON,
299
+ noPrimaryCheckerReason,
262
300
  isNotApplicableSkipReason,
263
301
  isRunnerSkipReason,
264
302
  isRunnerClaimSource,
@@ -1,21 +1,19 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  collectSourceFiles
4
- } from "./chunk-G6JKM4O7.js";
5
- import "./chunk-O2ARHQKF.js";
6
- import "./chunk-WMDUT4KH.js";
4
+ } from "./chunk-IDCTDKIA.js";
5
+ import "./chunk-IL6PIV33.js";
6
+ import "./chunk-H65TYP6V.js";
7
7
  import "./chunk-QYF5S6P6.js";
8
- import "./chunk-G5GV2Q7K.js";
9
- import "./chunk-X35S7HSB.js";
10
- import "./chunk-SQC7K3SP.js";
11
- import "./chunk-JE6HKLC7.js";
12
- import "./chunk-2453RRJ2.js";
13
- import "./chunk-WQV6BI4Q.js";
8
+ import "./chunk-CZCAZVTD.js";
9
+ import "./chunk-FOEPIX76.js";
10
+ import "./chunk-NL5LSKVD.js";
11
+ import "./chunk-7WJ55KBN.js";
12
+ import "./chunk-3FRI5H4T.js";
14
13
  import "./chunk-S26LC76R.js";
15
- import "./chunk-565VRUP4.js";
16
- import "./chunk-VLQ7UKZH.js";
14
+ import "./chunk-VCRVNLE7.js";
17
15
  import "./chunk-LJDODBBZ.js";
18
- import "./chunk-GMROJJRN.js";
16
+ import "./chunk-CB7PEVOJ.js";
19
17
  import "./chunk-NXL4FFQQ.js";
20
18
 
21
19
  // dist/clients/todo-scanner.js