pi-lens 4.4.4 → 4.4.5

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 (179) hide show
  1. package/CHANGELOG.md +440 -0
  2. package/README.md +13 -3
  3. package/config/dependency-cruiser-eager-allowlist.json +1 -0
  4. package/dist/chunk-22Y2BM7H.js +23 -0
  5. package/dist/{chunk-ATKJFDQN.js → chunk-27VWVB23.js} +12 -14
  6. package/dist/{chunk-S2HEXIWI.js → chunk-2FYKETQJ.js} +10 -6
  7. package/dist/{chunk-SRYEJNES.js → chunk-2LDMXL2M.js} +2 -2
  8. package/dist/{chunk-ZHH37KZL.js → chunk-2SDHYHHO.js} +17 -17
  9. package/dist/chunk-2Y6OJRSI.js +38 -0
  10. package/dist/chunk-3SNDVPOR.js +507 -0
  11. package/dist/{chunk-5OFV52AM.js → chunk-3WCEHYOI.js} +1 -1
  12. package/dist/chunk-44X7VIKR.js +73 -0
  13. package/dist/{chunk-DEL2U6CM.js → chunk-4FHUGDKU.js} +16 -14
  14. package/dist/{chunk-CT4MN5IU.js → chunk-4ODSZ35Z.js} +353 -359
  15. package/dist/{chunk-ZIVJBOO3.js → chunk-4U7GDSZQ.js} +2 -2
  16. package/dist/chunk-54NIOJJZ.js +25 -0
  17. package/dist/{chunk-N5FLEO7W.js → chunk-5DKE4HGX.js} +37 -37
  18. package/dist/{chunk-P63GXC37.js → chunk-5LRUKYFA.js} +31 -4
  19. package/dist/{chunk-HRNHZA3N.js → chunk-63NMUNYP.js} +12 -16
  20. package/dist/{chunk-HWCCCQNX.js → chunk-6XSESGWD.js} +13 -6
  21. package/dist/{chunk-UMS2MFPZ.js → chunk-72J27ICO.js} +2 -3
  22. package/dist/{chunk-ED36RF6Y.js → chunk-7FLRUH6B.js} +1 -1
  23. package/dist/chunk-7IYC4ENJ.js +297 -0
  24. package/dist/chunk-7WWQAW5P.js +30 -0
  25. package/dist/{chunk-3DA2JDOL.js → chunk-7ZS7MC24.js} +551 -203
  26. package/dist/{chunk-WMYE35PX.js → chunk-AHWA4AKM.js} +7 -5
  27. package/dist/{chunk-JW3YWBVB.js → chunk-AI3GP74G.js} +17 -19
  28. package/dist/{chunk-AGSS7277.js → chunk-APFJKOP6.js} +6 -23
  29. package/dist/{chunk-ZVUL7QYY.js → chunk-ASRAO7KG.js} +29 -32
  30. package/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
  31. package/dist/{chunk-TLX72JTG.js → chunk-CG5V25HX.js} +1 -1
  32. package/dist/chunk-CKEQFGLT.js +32 -0
  33. package/dist/{chunk-Y6GZHWSJ.js → chunk-COOUUC5W.js} +6 -6
  34. package/dist/{chunk-XTBDCR27.js → chunk-CPZ5JJW6.js} +4 -4
  35. package/dist/{chunk-RKKOYPRA.js → chunk-DS2USX5G.js} +13 -15
  36. package/dist/chunk-EA2ZRG44.js +27 -0
  37. package/dist/{chunk-GSLNCYGG.js → chunk-EDMLIW6W.js} +13 -14
  38. package/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
  39. package/dist/chunk-EKNWOL2I.js +27 -0
  40. package/dist/{chunk-R3T7CLQ2.js → chunk-ELZRSR5N.js} +41 -41
  41. package/dist/{chunk-GMX5OS7B.js → chunk-EN5AM7PX.js} +11 -12
  42. package/dist/{chunk-3RKP3FMS.js → chunk-EWXXLS26.js} +226 -24
  43. package/dist/chunk-EX4EXBW7.js +37 -0
  44. package/dist/{chunk-XHJBS436.js → chunk-EXVXBSGN.js} +25 -25
  45. package/dist/{chunk-MZGQNL3Y.js → chunk-F7BO6FWH.js} +12 -13
  46. package/dist/{chunk-V35JG4JB.js → chunk-FEDWAYDS.js} +152 -334
  47. package/dist/{chunk-J64T55EI.js → chunk-FWZRGGGY.js} +73 -9
  48. package/dist/{chunk-T57LYLZT.js → chunk-G224FADB.js} +1 -1
  49. package/dist/chunk-G5UCJFT7.js +26 -0
  50. package/dist/{chunk-LLJNQKQW.js → chunk-GLW3YDZZ.js} +20 -13
  51. package/dist/{chunk-GXFV6MYU.js → chunk-GTDSYEA2.js} +72 -39
  52. package/dist/{chunk-DUO2TU77.js → chunk-GYRZ72R4.js} +10 -4
  53. package/dist/chunk-HYVXA3BB.js +49 -0
  54. package/dist/{chunk-W66O5E25.js → chunk-IEBJF3PN.js} +13 -15
  55. package/dist/{chunk-GAQ7OQG6.js → chunk-IL7K66ZQ.js} +83 -94
  56. package/dist/{chunk-T7FEBKXN.js → chunk-JWOVP5BL.js} +7 -9
  57. package/dist/{chunk-UBOQLVT2.js → chunk-K2GUZ4DN.js} +4 -4
  58. package/dist/{chunk-5VSF4UUQ.js → chunk-K4SZB56V.js} +34 -39
  59. package/dist/{chunk-7D6L4MTX.js → chunk-KCBRHV5E.js} +3 -3
  60. package/dist/{chunk-GSM5UU7A.js → chunk-KFXCL4OV.js} +38 -28
  61. package/dist/{chunk-J6MPGQTS.js → chunk-KJJAVH3X.js} +81 -15
  62. package/dist/{chunk-BWD5EPKO.js → chunk-KPVLQHCZ.js} +4 -6
  63. package/dist/{chunk-MPNJLASA.js → chunk-KX56K73G.js} +10 -13
  64. package/dist/{chunk-AWSCPCN2.js → chunk-LMCTHJ2H.js} +19 -19
  65. package/dist/{chunk-IWDLU6K3.js → chunk-MEFLGBCS.js} +4 -6
  66. package/dist/{chunk-TOY6QKOH.js → chunk-MKPCELNI.js} +17 -17
  67. package/dist/{chunk-POMLXPMY.js → chunk-N3PLNNCW.js} +1 -1
  68. package/dist/chunk-N5FBM25N.js +22 -0
  69. package/dist/{chunk-CYRKQRPM.js → chunk-NFNVDDGB.js} +2 -4
  70. package/dist/{chunk-RMLC67LF.js → chunk-NLIVE7L6.js} +2 -30
  71. package/dist/{chunk-24AKHFGP.js → chunk-OMJ3OFBJ.js} +6 -6
  72. package/dist/{chunk-IQWN5JCP.js → chunk-OZNCKLOX.js} +13 -14
  73. package/dist/chunk-P5XUGPIX.js +31 -0
  74. package/dist/{chunk-2KXTHF3M.js → chunk-PJXNTPB2.js} +253 -33
  75. package/dist/chunk-PKOXJIVT.js +88 -0
  76. package/dist/{chunk-DGUKIYSI.js → chunk-PP2A5V2T.js} +8 -10
  77. package/dist/{chunk-KAPJINKN.js → chunk-Q42LJANT.js} +2 -2
  78. package/dist/{chunk-UZ2XCLYS.js → chunk-Q4BKKOVC.js} +8 -8
  79. package/dist/{chunk-TIQ2PKDW.js → chunk-QT66NEYN.js} +4 -4
  80. package/dist/{chunk-U44DJXQP.js → chunk-RCHO5W7M.js} +15 -18
  81. package/dist/{chunk-YH5MVY2U.js → chunk-RG3MXTRI.js} +7 -7
  82. package/dist/chunk-RG7OODGM.js +57 -0
  83. package/dist/{chunk-OHKJ7PQF.js → chunk-RU34BA4D.js} +43 -39
  84. package/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
  85. package/dist/{chunk-XBJVAEEO.js → chunk-S55TEC7I.js} +3 -2
  86. package/dist/{chunk-RVK72CZX.js → chunk-SJHC3BCZ.js} +1397 -481
  87. package/dist/{chunk-IYNJ6YPZ.js → chunk-SNEUMLM7.js} +4 -4
  88. package/dist/{chunk-S67KYG37.js → chunk-T4NGVFYI.js} +2 -2
  89. package/dist/{chunk-YCWYO6TQ.js → chunk-THEXI2QO.js} +48 -45
  90. package/dist/{chunk-AMERCH6V.js → chunk-TL2TCJYL.js} +15 -16
  91. package/dist/{chunk-KUA4OJ5Y.js → chunk-TPYYEDP5.js} +823 -350
  92. package/dist/{chunk-YNE3RP52.js → chunk-TVZRLTG6.js} +8 -1
  93. package/dist/{chunk-ROYSX2S5.js → chunk-UCVMSOXF.js} +2 -2
  94. package/dist/chunk-UL5SXQVX.js +32 -0
  95. package/dist/{chunk-7HXE67BN.js → chunk-UO66IMVP.js} +2 -2
  96. package/dist/{chunk-VOOAPROD.js → chunk-UVY4TOJH.js} +3 -3
  97. package/dist/{chunk-RKBXZN3A.js → chunk-VIDEKABZ.js} +2 -2
  98. package/dist/{chunk-2FN63LPV.js → chunk-VITFDI3O.js} +13 -14
  99. package/dist/{chunk-6DLWKFEX.js → chunk-VUAVE3QC.js} +41 -42
  100. package/dist/{chunk-FM4RDMKT.js → chunk-WUY4BZEP.js} +10 -12
  101. package/dist/{chunk-SD4I7ZO4.js → chunk-X3UTCXAA.js} +43 -53
  102. package/dist/chunk-XHDBJODR.js +45 -0
  103. package/dist/{chunk-5IUSNGOC.js → chunk-XHLK33VM.js} +28 -21
  104. package/dist/{chunk-3KAZU3VR.js → chunk-XI34NWDI.js} +2 -2
  105. package/dist/{chunk-QBFBRV2B.js → chunk-XWFIHYCH.js} +4 -2
  106. package/dist/{chunk-JUKMK5Y4.js → chunk-Y2TPADJR.js} +10 -11
  107. package/dist/{chunk-EBC36LNN.js → chunk-Y5KTA2OB.js} +17 -17
  108. package/dist/{chunk-HYGZEMX6.js → chunk-YKVDBNPO.js} +11 -5
  109. package/dist/{chunk-KN35K52N.js → chunk-YSDPVDFC.js} +3 -3
  110. package/dist/chunk-YWNO5Q4R.js +44 -0
  111. package/dist/{chunk-US7ECLD7.js → chunk-YWWG4AQA.js} +119 -28
  112. package/dist/{chunk-O4NWQT6I.js → chunk-YXDCRUKQ.js} +4 -4
  113. package/dist/{chunk-XYURS6EN.js → chunk-YXGRRORB.js} +15 -17
  114. package/dist/{chunk-IUE7SSKV.js → chunk-ZAPSUBLU.js} +13 -7
  115. package/dist/{chunk-EUXZEFTV.js → chunk-ZPJM7DID.js} +3 -3
  116. package/dist/{chunk-5HSRT26B.js → chunk-ZSUX7KEM.js} +16 -15
  117. package/dist/index.js +37155 -32210
  118. package/dist/mcp/analyze-cli.js +11 -12
  119. package/dist/mcp/cli.js +46 -45
  120. package/dist/mcp/server.js +1210 -574
  121. package/dist/mcp/worker.js +65 -65
  122. package/dist/probes/installer.js +21 -23
  123. package/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
  124. package/docs/adr/README.md +1 -0
  125. package/docs/ast-grep_rules_catalog.md +5 -3
  126. package/docs/configuration.md +9 -0
  127. package/docs/engineering-principles.md +12 -0
  128. package/docs/environment-variables.md +20 -0
  129. package/docs/features.md +16 -1
  130. package/docs/globalconfig.md +37 -8
  131. package/docs/lsp-capability-matrix.md +105 -12
  132. package/docs/lsp-idle-eviction.md +37 -18
  133. package/docs/pi-lens-fixer.md +22 -1
  134. package/docs/pi-lens-investigator.md +14 -0
  135. package/docs/pi-lens-merge-policy.md +23 -10
  136. package/docs/pi-lens-monitor.md +64 -8
  137. package/docs/pi-lens-retro.md +2 -2
  138. package/docs/pi-lens-reviewer.md +48 -1
  139. package/docs/pi-lens-subagent.md +8 -1
  140. package/docs/release-qa-baseline.md +19 -7
  141. package/docs/servercapabilities.md +47 -47
  142. package/docs/settings.md +9 -5
  143. package/docs/subagent-compat.md +1 -1
  144. package/docs/usage.md +1 -0
  145. package/package.json +6 -4
  146. package/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
  147. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
  148. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
  149. package/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
  150. package/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
  151. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
  152. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
  153. package/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
  154. package/rules/rule-catalog.json +25 -1
  155. package/scripts/analyze-pi-lens-logs.mjs +15 -5
  156. package/scripts/lib/is-main-module.mjs +27 -0
  157. package/scripts/lib/scratch-home-env.mjs +21 -0
  158. package/scripts/rpc-load-check.mjs +4 -6
  159. package/scripts/warm-loader-cache.mjs +2 -5
  160. package/dist/chunk-3PTHXJXR.js +0 -28
  161. package/dist/chunk-3QED2P4V.js +0 -31
  162. package/dist/chunk-5WRPDP2A.js +0 -47
  163. package/dist/chunk-ABBOA7UD.js +0 -157
  164. package/dist/chunk-CUHSHSB6.js +0 -273
  165. package/dist/chunk-GL5LUMZE.js +0 -51
  166. package/dist/chunk-HAD7QRQI.js +0 -30
  167. package/dist/chunk-JORED7EX.js +0 -44
  168. package/dist/chunk-KYUB6QDC.js +0 -72
  169. package/dist/chunk-LZSEQW6A.js +0 -57
  170. package/dist/chunk-M2IFVFWU.js +0 -79
  171. package/dist/chunk-M2UD3LPU.js +0 -88
  172. package/dist/chunk-MBKQHGA7.js +0 -39
  173. package/dist/chunk-R7YOCSNV.js +0 -23
  174. package/dist/chunk-SKAMFC7A.js +0 -28
  175. package/dist/chunk-SYE6T2EB.js +0 -28
  176. package/dist/chunk-TRETHTQO.js +0 -26
  177. package/dist/chunk-UA7ZXYDR.js +0 -184
  178. package/dist/chunk-XTFDJI3T.js +0 -24
  179. package/dist/chunk-Z3CCVDUB.js +0 -76
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  getLazyInstallAttempt,
4
4
  tryLazyInstall
5
- } from "./chunk-UBOQLVT2.js";
5
+ } from "./chunk-K2GUZ4DN.js";
6
6
  import {
7
7
  findingsResult,
8
8
  finishParsedRun,
@@ -14,26 +14,23 @@ import {
14
14
  reachedNoVerdict,
15
15
  skipUnlessToolRan,
16
16
  spanOverlapsModifiedRanges
17
- } from "./chunk-RKBXZN3A.js";
18
- import {
19
- stripAnsi
20
- } from "./chunk-6HWVI6MI.js";
17
+ } from "./chunk-VIDEKABZ.js";
21
18
  import {
22
19
  spawnFailedWithNoOutput
23
- } from "./chunk-S67KYG37.js";
20
+ } from "./chunk-T4NGVFYI.js";
24
21
  import {
25
22
  computeImpactCascade
26
- } from "./chunk-KN35K52N.js";
23
+ } from "./chunk-YSDPVDFC.js";
27
24
  import {
28
25
  goClient
29
- } from "./chunk-ROYSX2S5.js";
26
+ } from "./chunk-UCVMSOXF.js";
30
27
  import {
31
28
  isTrivyEnabled,
32
29
  resolveSeverityFloor
33
- } from "./chunk-YH5MVY2U.js";
30
+ } from "./chunk-RG3MXTRI.js";
34
31
  import {
35
32
  rustClient
36
- } from "./chunk-EBC36LNN.js";
33
+ } from "./chunk-Y5KTA2OB.js";
37
34
  import {
38
35
  coveringLaneAvailable,
39
36
  createAvailabilityChecker,
@@ -49,7 +46,7 @@ import {
49
46
  resolveToolCommand,
50
47
  resolveToolCommandWithInstallFallback,
51
48
  resolveVendorToolCommand
52
- } from "./chunk-ZHH37KZL.js";
49
+ } from "./chunk-2SDHYHHO.js";
53
50
  import {
54
51
  biomeConfigArgs,
55
52
  findCompiledClassesDir,
@@ -68,21 +65,21 @@ import {
68
65
  hasYamllintConfig,
69
66
  markdownlintConfigArgs,
70
67
  ruffConfigArgs
71
- } from "./chunk-Y6GZHWSJ.js";
68
+ } from "./chunk-COOUUC5W.js";
72
69
  import {
73
70
  importFactProvider
74
- } from "./chunk-IYNJ6YPZ.js";
71
+ } from "./chunk-SNEUMLM7.js";
75
72
  import {
76
73
  functionFactProvider
77
- } from "./chunk-EUXZEFTV.js";
74
+ } from "./chunk-ZPJM7DID.js";
78
75
  import {
79
76
  extractFactsFromTree
80
- } from "./chunk-T57LYLZT.js";
77
+ } from "./chunk-G224FADB.js";
81
78
  import {
82
79
  buildOrUpdateGraph,
83
80
  clearReviewGraphWorkspaceCache,
84
81
  fileContentProvider
85
- } from "./chunk-XHJBS436.js";
82
+ } from "./chunk-EXVXBSGN.js";
86
83
  import {
87
84
  MAX_BLOCKING_RULE_COMPLEXITY,
88
85
  PRIMARY_UNAVAILABLE_CAUSE,
@@ -95,8 +92,8 @@ import {
95
92
  classifyDiagnosticTier,
96
93
  clearPendingAuxiliaryCoverage,
97
94
  combinePrimaryUnavailableCauses,
95
+ demoteLanguageServerRows,
98
96
  enabledAuxiliaryLspServerIds,
99
- fetchTsserverProjectIdentity,
100
97
  getLSPService,
101
98
  hasAnyDispositionMarks,
102
99
  hasAuxiliaryLspPublishedForRoot,
@@ -113,40 +110,46 @@ import {
113
110
  touchCoverageGap,
114
111
  tryWarmAttachedCodeActions,
115
112
  tryWarmAttachedDiagnostics
116
- } from "./chunk-RVK72CZX.js";
113
+ } from "./chunk-SJHC3BCZ.js";
117
114
  import {
118
115
  ANY_POSITION,
119
116
  retainRecordedFindings
120
- } from "./chunk-IWDLU6K3.js";
117
+ } from "./chunk-MEFLGBCS.js";
121
118
  import {
122
119
  mapWithConcurrency
123
120
  } from "./chunk-XIMYZ3JA.js";
124
121
  import {
125
122
  LSP_SERVERS,
123
+ canWriteAnalysisRoot,
126
124
  disabledPrimaries,
127
125
  getAstGrepRuleSources,
128
126
  registerRunnerId,
129
127
  resolveAnalysisRoot
130
- } from "./chunk-3DA2JDOL.js";
128
+ } from "./chunk-7ZS7MC24.js";
131
129
  import {
132
130
  augmentPythonEnvironment,
133
- detectPythonEnvironment
134
- } from "./chunk-CUHSHSB6.js";
131
+ describePythonCompileWithheld,
132
+ detectPythonEnvironment,
133
+ detectPythonTargetVersion,
134
+ emitBounded,
135
+ partitionOutrankedPythonCompileVerdicts,
136
+ recordPythonCompileVerdictDrop
137
+ } from "./chunk-3SNDVPOR.js";
135
138
  import {
136
139
  loadProjectSnapshot,
137
140
  readJsonCache,
138
141
  readJsonCacheAsync
139
- } from "./chunk-T7FEBKXN.js";
142
+ } from "./chunk-JWOVP5BL.js";
140
143
  import {
141
144
  RUNTIME_CONFIG,
142
145
  exceedsLspSyncLimits,
143
146
  getRunnerTimeoutFloorMs,
144
147
  loadAstGrepNapi
145
- } from "./chunk-V35JG4JB.js";
148
+ } from "./chunk-FEDWAYDS.js";
146
149
  import {
147
150
  buildModuleGraph,
148
151
  clearModuleGraphCache
149
- } from "./chunk-XTBDCR27.js";
152
+ } from "./chunk-CPZ5JJW6.js";
150
153
  import {
151
154
  BUNDLED_QUERIES_ROOT,
152
155
  classifyTreeSitterWasmError,
@@ -166,7 +169,10 @@ import {
166
169
  ruleFilesForLanguage,
167
170
  ruleSourceLanguages,
168
171
  walk
169
- } from "./chunk-US7ECLD7.js";
172
+ } from "./chunk-YWWG4AQA.js";
173
+ import {
174
+ stripAnsi
175
+ } from "./chunk-6HWVI6MI.js";
170
176
  import {
171
177
  WORD_INDEX_MAX_BYTES,
172
178
  deserializeWordIndex,
@@ -175,35 +181,32 @@ import {
175
181
  scheduleWordIndexPersist,
176
182
  setWordIndexPublishedListener,
177
183
  updateWordIndexDocumentForEdit
178
- } from "./chunk-W66O5E25.js";
179
- import {
180
- PathKeyedMap
181
- } from "./chunk-Z3CCVDUB.js";
184
+ } from "./chunk-IEBJF3PN.js";
182
185
  import {
183
186
  WARM_CODE_ACTION_LOOKUP_LIMIT,
184
187
  contentHash
185
- } from "./chunk-KAPJINKN.js";
188
+ } from "./chunk-Q42LJANT.js";
186
189
  import {
187
190
  resolveRunnerPath,
188
191
  toRunnerDisplayPath
189
- } from "./chunk-AGSS7277.js";
192
+ } from "./chunk-APFJKOP6.js";
190
193
  import {
191
194
  isSpawnableCommand
192
- } from "./chunk-GAQ7OQG6.js";
195
+ } from "./chunk-IL7K66ZQ.js";
193
196
  import {
194
197
  logRunnerAdvisoryOnce,
195
198
  resolveRunnerCwd,
196
199
  resolveRunnerCwdWithReason
197
- } from "./chunk-DEL2U6CM.js";
200
+ } from "./chunk-4FHUGDKU.js";
198
201
  import {
199
202
  findLocalBinUpwards,
200
203
  localBinPath
201
- } from "./chunk-5VSF4UUQ.js";
204
+ } from "./chunk-K4SZB56V.js";
202
205
  import {
203
206
  createAvailabilityProbeFlight,
204
207
  getIsolatedNpxSpawnOptions,
205
208
  probeToolAsync
206
- } from "./chunk-3KAZU3VR.js";
209
+ } from "./chunk-XI34NWDI.js";
207
210
  import {
208
211
  classifyProbeFailure,
209
212
  createAvailabilityLatch,
@@ -213,12 +216,12 @@ import {
213
216
  logAvailabilityDecision,
214
217
  startHostStallSampler,
215
218
  transientRetryDelayMs
216
- } from "./chunk-P63GXC37.js";
219
+ } from "./chunk-5LRUKYFA.js";
217
220
  import {
218
221
  getLspCapableKinds,
219
222
  getPrimaryDispatchGroup,
220
223
  resolveLanguageRootForFile
221
- } from "./chunk-HRNHZA3N.js";
224
+ } from "./chunk-63NMUNYP.js";
222
225
  import {
223
226
  getGlobalPiLensDir,
224
227
  getProjectDataDir,
@@ -228,58 +231,59 @@ import {
228
231
  noteSpawnTimeout,
229
232
  resolvePiLensFlag,
230
233
  safeSpawnAsync
231
- } from "./chunk-KUA4OJ5Y.js";
234
+ } from "./chunk-TPYYEDP5.js";
232
235
  import {
236
+ DOTNET_CSHARP_PROJECT_MARKERS,
237
+ DOTNET_CSHARP_SOLUTION_MARKERS,
233
238
  detectFileKind
234
- } from "./chunk-DUO2TU77.js";
239
+ } from "./chunk-GYRZ72R4.js";
235
240
  import {
241
+ PathKeyedMap,
236
242
  classifyGeneratedOrArtifactDetailed,
237
243
  detectFileRole,
238
244
  loadPiLensProjectConfig,
239
245
  resolvePiLensConfig
240
- } from "./chunk-J6MPGQTS.js";
246
+ } from "./chunk-KJJAVH3X.js";
241
247
  import {
242
248
  findNearestDirWithAnyBasename,
243
249
  findNearestDirWithMarker,
244
250
  getPiLensGlobalConfigPath
245
- } from "./chunk-5HSRT26B.js";
251
+ } from "./chunk-ZSUX7KEM.js";
246
252
  import {
247
253
  getProjectTrustState,
248
- projectTrustDenialReason
249
- } from "./chunk-M2IFVFWU.js";
250
- import {
251
254
  killedForOutputCap,
255
+ projectTrustDenialReason,
252
256
  truncatedByOutputCap,
253
257
  writeFileAtomic
254
- } from "./chunk-2EECBNC5.js";
258
+ } from "./chunk-EIKRZ32J.js";
255
259
  import {
256
260
  incrementDegradationCount,
257
261
  recordDegradationOnce
258
- } from "./chunk-J64T55EI.js";
262
+ } from "./chunk-FWZRGGGY.js";
259
263
  import {
260
264
  createSubsystemLogger,
261
265
  logExtension
262
- } from "./chunk-POMLXPMY.js";
266
+ } from "./chunk-N3PLNNCW.js";
263
267
  import {
264
268
  logLatency,
265
269
  phaseFinished,
266
270
  phaseStarted
267
- } from "./chunk-QBFBRV2B.js";
271
+ } from "./chunk-XWFIHYCH.js";
268
272
  import {
269
273
  createNdjsonLogger,
270
274
  getGlobalPiLensLogDir,
271
275
  getMaxLogSizeMB,
272
276
  isTestMode
273
- } from "./chunk-YNE3RP52.js";
277
+ } from "./chunk-TVZRLTG6.js";
274
278
  import {
275
279
  FactStore,
276
280
  setFactStoreEvictionReporter
277
- } from "./chunk-CYRKQRPM.js";
281
+ } from "./chunk-NFNVDDGB.js";
278
282
  import {
279
283
  BoundedFifoMap,
280
- BoundedLruCache
281
- } from "./chunk-ABBOA7UD.js";
282
- import {
284
+ BoundedLruCache,
285
+ direntsHaveMarkerGlobMatch,
286
+ findLocalToolConfig,
283
287
  findNearestContaining,
284
288
  isAbsoluteFilePath,
285
289
  isUnderDir,
@@ -287,13 +291,12 @@ import {
287
291
  normalizeEphemeralMapKey,
288
292
  normalizeLoggedPath,
289
293
  normalizeMapKey,
290
- pathsEqual,
291
- toProjectRelativePath
292
- } from "./chunk-3RKP3FMS.js";
294
+ pathsEqual
295
+ } from "./chunk-EWXXLS26.js";
293
296
 
294
297
  // dist/clients/mcp/analyze.js
295
- import * as fs19 from "node:fs";
296
- import * as path50 from "node:path";
298
+ import * as fs18 from "node:fs";
299
+ import * as path49 from "node:path";
297
300
 
298
301
  // dist/clients/cache-manager.js
299
302
  import * as fs from "node:fs";
@@ -578,6 +581,44 @@ var CacheManager = class {
578
581
  sessions: { ...envelope.sessions, [sessionId]: secondary }
579
582
  }, cwd);
580
583
  }
584
+ /**
585
+ * #4751: the primary's half of the turn_start role mirror above. The
586
+ * envelope's owner is the identity `resolveTurnStatePartition` reads the
587
+ * role from, so it must name the live primary. A departing primary keeps
588
+ * its worklist for successor replay, which left its id there: its
589
+ * in-process successor (pi's newSession, fork, clone, a resume of another
590
+ * session) was read as a secondary, wrote a partition no turn end of its
591
+ * own reads, and its turn end found no files. The claim admits two forms
592
+ * and refuses every other: a pi owner of THIS process with another id (an
593
+ * in-process predecessor, whose files the successor's turn end replays),
594
+ * and an envelope with no owner and no files. A predecessor past the
595
+ * #2504 stale bound (`isTurnStateOwnerStale`) is still claimed, or the
596
+ * successor's write would be stranded again, but its files are evicted
597
+ * here, as the turn end would evict them: they are not this turn's work.
598
+ * Files under another process's owner, or under no owner, stay for the
599
+ * liveness rule and the #2504 eviction at turn end.
600
+ */
601
+ claimPrimaryTurnState(cwd, sessionId) {
602
+ const envelope = this.readTurnStateEnvelope(cwd);
603
+ const owner = envelope.owner;
604
+ const filesKept = Object.keys(envelope.files ?? {}).length;
605
+ const predecessor = owner?.kind === "pi" && owner.pid === process.pid && owner.id !== sessionId;
606
+ const arm = predecessor ? this.isTurnStateOwnerStale(owner) ? "evicted" : "predecessor" : owner === void 0 && filesKept === 0 ? "empty" : void 0;
607
+ if (arm === void 0)
608
+ return void 0;
609
+ const base = arm === "evicted" ? { ...envelope, ...DEFAULT_TURN_STATE, files: {} } : envelope;
610
+ this.writeTurnState({
611
+ ...base,
612
+ sessionId,
613
+ owner: {
614
+ kind: "pi",
615
+ id: sessionId,
616
+ pid: process.pid,
617
+ lastSeen: (/* @__PURE__ */ new Date()).toISOString()
618
+ }
619
+ }, cwd);
620
+ return arm === "evicted" ? { from: owner?.id, arm, filesKept: 0, filesDropped: filesKept } : { from: owner?.id, arm, filesKept };
621
+ }
581
622
  /** Resolve the persisted primary/secondary turn-state partition. */
582
623
  resolveTurnStatePartition(cwd, sessionId) {
583
624
  const envelope = this.readTurnStateEnvelope(cwd);
@@ -997,7 +1038,12 @@ if (bundledCodeRabbitRules) {
997
1038
  RULE_ID_LANGUAGE_SUFFIXES.add(suffix);
998
1039
  }
999
1040
  }
1000
- var LSP_SOURCE_PREFIXES = ["ast-grep:", "shuck:"];
1041
+ var LSP_SOURCE_PREFIXES = [
1042
+ "ast-grep:",
1043
+ "shuck:",
1044
+ "Pyright:",
1045
+ "basedpyright:"
1046
+ ];
1001
1047
  function normalizeRuleId(ruleId) {
1002
1048
  let normalized = ruleId;
1003
1049
  for (const prefix of LSP_SOURCE_PREFIXES) {
@@ -1987,24 +2033,47 @@ function createDispatchContext(filePath, cwd, pi, facts, blockingOnly, modifiedR
1987
2033
  function deltaBaselineFactKey(filePath) {
1988
2034
  return `session.baseline.${filePath}`;
1989
2035
  }
1990
- function filterDelta(after, before, keyFn) {
1991
- const beforeSet = new Set((before ?? []).map(keyFn));
1992
- const afterSet = new Set(after.map(keyFn));
1993
- const fixed = (before ?? []).filter((d) => !afterSet.has(keyFn(d)));
1994
- const newItems = after.filter((d) => !beforeSet.has(keyFn(d)));
2036
+ function filterDelta(after, before, copyOf) {
2037
+ const namedBy = (side) => {
2038
+ const ids = new Set(side.map((d) => d.id));
2039
+ const lanesByKey = /* @__PURE__ */ new Map();
2040
+ for (const d of side) {
2041
+ const key2 = copyOf.key(d);
2042
+ const lanes = lanesByKey.get(key2) ?? /* @__PURE__ */ new Set();
2043
+ lanes.add(copyOf.lane(d));
2044
+ lanesByKey.set(key2, lanes);
2045
+ }
2046
+ return (d) => {
2047
+ if (ids.has(d.id))
2048
+ return true;
2049
+ const lane = copyOf.lane(d);
2050
+ for (const other of lanesByKey.get(copyOf.key(d)) ?? []) {
2051
+ if (other !== lane)
2052
+ return true;
2053
+ }
2054
+ return false;
2055
+ };
2056
+ };
2057
+ const inBefore = namedBy(before ?? []);
2058
+ const inAfter = namedBy(after);
2059
+ const fixed = (before ?? []).filter((d) => !inAfter(d));
2060
+ const newItems = after.filter((d) => !inBefore(d));
1995
2061
  return { new: newItems, fixed };
1996
2062
  }
1997
2063
  function toolPriority(tool, defectClass) {
1998
2064
  return getToolProfile(tool, defectClass).dedupPriority;
1999
2065
  }
2066
+ function findingKey(d, defectClass = d.defectClass ?? classifyDiagnostic(d)) {
2067
+ const line = d.line ?? 1;
2068
+ const column = d.column ?? 1;
2069
+ const ruleKey = normalizeRuleId(d.rule || d.id || "unknown");
2070
+ return `${d.filePath}:${line}:${column}:${defectClass}:${ruleKey}`;
2071
+ }
2000
2072
  function dedupeOverlappingDiagnostics(diagnostics) {
2001
2073
  const byKey = /* @__PURE__ */ new Map();
2002
2074
  for (const d of diagnostics) {
2003
2075
  const defectClass = d.defectClass ?? classifyDiagnostic(d);
2004
- const line = d.line ?? 1;
2005
- const column = d.column ?? 1;
2006
- const ruleKey = d.rule || d.id || "unknown";
2007
- const key2 = `${d.filePath}:${line}:${column}:${defectClass}:${ruleKey}`;
2076
+ const key2 = findingKey(d, defectClass);
2008
2077
  const current = byKey.get(key2);
2009
2078
  if (!current) {
2010
2079
  byKey.set(key2, { ...d, defectClass });
@@ -2096,7 +2165,7 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
2096
2165
  const lspEnabled = !ctx.pi.getFlag("no-lsp");
2097
2166
  const primary2 = getPrimaryDispatchGroup(ctx.kind, lspEnabled);
2098
2167
  if (!primary2 || primary2.runnerIds.length === 0)
2099
- return {};
2168
+ return { coverage: "unconfigured" };
2100
2169
  const relevant = runnerLatencies.filter((r) => primary2.runnerIds.includes(r.runnerId));
2101
2170
  if (relevant.length === 0)
2102
2171
  return {};
@@ -2138,11 +2207,17 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
2138
2207
  };
2139
2208
  }
2140
2209
  const primaryHasCoverage = relevant.some(hasUsableResult);
2141
- if (primaryHasCoverage)
2142
- return {};
2210
+ if (primaryHasCoverage) {
2211
+ return {
2212
+ coverage: "primary",
2213
+ ...relevant.some((r) => r.runnerId === "lsp" && hasUsableResult(r)) && {
2214
+ primaryLspChecked: true
2215
+ }
2216
+ };
2217
+ }
2143
2218
  const primaryStillInFlight = relevant.some((r) => r.status === "pending" || r.status === "deferred");
2144
2219
  if (primaryStillInFlight)
2145
- return {};
2220
+ return { coverage: "in_flight" };
2146
2221
  const plan = getToolPlan(ctx.kind);
2147
2222
  const fallbackRunnerIds = new Set((plan?.groups ?? []).filter((group) => !group.runnerIds.every((runnerId) => primary2.runnerIds.includes(runnerId))).flatMap((group) => group.runnerIds).filter((runnerId) => !primary2.runnerIds.includes(runnerId)));
2148
2223
  const STRUCTURAL_RUNNERS = /* @__PURE__ */ new Set([
@@ -2155,7 +2230,7 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
2155
2230
  const TYPE_CAPABLE_FALLBACK_RUNNERS = /* @__PURE__ */ new Set(["mypy"]);
2156
2231
  const anyFallbackHasCoverage = runnerLatencies.some((r) => fallbackRunnerIds.has(r.runnerId) && !STRUCTURAL_RUNNERS.has(r.runnerId) && hasUsableResult(r) && (!plan?.capabilities.includes("types") || TYPE_CAPABLE_FALLBACK_RUNNERS.has(r.runnerId)));
2157
2232
  if (anyFallbackHasCoverage)
2158
- return {};
2233
+ return { coverage: "fallback" };
2159
2234
  const cause = combinePrimaryUnavailableCauses(relevant.flatMap((r) => r.primaryUnavailableCause ?? []));
2160
2235
  const unconfirmedStatus = cause ? `no language server answered (${PRIMARY_UNAVAILABLE_CAUSE[cause]})` : "not fully checked (a language tool is missing, timed out, or failed to run)";
2161
2236
  if (cause === "disabled" || cause === "disabledFallback") {
@@ -2484,6 +2559,9 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
2484
2559
  },
2485
2560
  ...result.disabledPrimaryServerIds !== void 0 && {
2486
2561
  disabledPrimaryServerIds: result.disabledPrimaryServerIds
2562
+ },
2563
+ ...result.withheldNotice !== void 0 && {
2564
+ withheldNotice: result.withheldNotice
2487
2565
  }
2488
2566
  });
2489
2567
  logLatency({
@@ -2694,7 +2772,7 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
2694
2772
  const stillObserved = outOfEditScope.length > 0 ? applyOutputFilters(outOfEditScope).flatMap((d) => d.semantic === "blocking" ? [d] : []) : [];
2695
2773
  let heldBackBlockers = [];
2696
2774
  if (ctx.deltaMode && previousBaseline) {
2697
- const filtered = filterDelta(visibleDiagnostics, applyOutputFilters(previousBaseline), (d) => d.id);
2775
+ const filtered = filterDelta(visibleDiagnostics, applyOutputFilters(previousBaseline), { key: (d) => findingKey(d), lane: (d) => d.tool });
2698
2776
  const isNew = new Set(filtered.new);
2699
2777
  heldBackBlockers = visibleDiagnostics.filter((d) => d.semantic === "blocking" && !isNew.has(d));
2700
2778
  stillObserved.push(...promoteDeltaUnusedToBlockers(visibleDiagnostics.flatMap((d) => !isNew.has(d) && d.semantic !== "blocking" && isUnusedValueDiagnostic(d) ? [d] : [])));
@@ -2729,27 +2807,42 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
2729
2807
  provider: ctx.telemetryProvider
2730
2808
  };
2731
2809
  if (fixedItems.length > 0) {
2732
- import("./chunk-JUKMK5Y4.js").then(({ appendToWorklog }) => {
2810
+ import("./chunk-Y2TPADJR.js").then(({ appendToWorklog }) => {
2733
2811
  appendToWorklog(ctx.cwd, fixedItems, true, worklogIdentity);
2734
2812
  }).catch(() => {
2735
2813
  });
2736
2814
  }
2737
2815
  const fixableWarnings = warnings.filter((d) => d.fixable);
2738
2816
  if (fixableWarnings.length > 0) {
2739
- import("./chunk-JUKMK5Y4.js").then(({ appendToWorklog }) => {
2817
+ import("./chunk-Y2TPADJR.js").then(({ appendToWorklog }) => {
2740
2818
  appendToWorklog(ctx.cwd, fixableWarnings, false, worklogIdentity);
2741
2819
  }).catch(() => {
2742
2820
  });
2743
2821
  }
2744
2822
  const inlineBlockers = blockers;
2745
2823
  const inlineFixed = fixedItems;
2746
- const { notice: coverageNotice, unconfirmedStatus } = buildCoverageNotice(ctx, runnerLatencies, options?.dedupeCoverageNotice ?? true);
2824
+ const { notice: coverageNotice, unconfirmedStatus, coverage, primaryLspChecked } = buildCoverageNotice(ctx, runnerLatencies, options?.dedupeCoverageNotice ?? true);
2747
2825
  const blockerOutput = formatDiagnostics(inlineBlockers, "blocking");
2748
2826
  let output = blockerOutput;
2749
2827
  output += formatDiagnostics(inlineFixed, "fixed");
2750
- if (coverageNotice) {
2751
- output += formatDiagnostics([coverageNotice], "warning", 1);
2752
- warnings.push(coverageNotice);
2828
+ const withheldMessages = [
2829
+ ...new Set(runnerLatencies.flatMap((r) => r.withheldNotice ?? []))
2830
+ ];
2831
+ const withheldNotice = withheldMessages.length > 0 ? {
2832
+ id: `withheld-compile:${ctx.kind}:${path4.basename(ctx.filePath)}`,
2833
+ message: withheldMessages.join("\n"),
2834
+ filePath: ctx.filePath,
2835
+ severity: "warning",
2836
+ semantic: "warning",
2837
+ tool: "pi-lens"
2838
+ } : void 0;
2839
+ const inlineNotices = [
2840
+ ...coverageNotice ? [coverageNotice] : [],
2841
+ ...withheldNotice ? [withheldNotice] : []
2842
+ ];
2843
+ if (inlineNotices.length > 0) {
2844
+ output += formatDiagnostics(inlineNotices, "warning", inlineNotices.length);
2845
+ warnings.push(...inlineNotices);
2753
2846
  }
2754
2847
  const pendingRunners = runnerLatencies.filter((runner) => runner.status === "pending").map((runner) => runner.runnerId);
2755
2848
  if (pendingRunners.length > 0) {
@@ -2838,7 +2931,9 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
2838
2931
  collectLaterRunnerIds: [...collectLaterRunnerIds]
2839
2932
  }
2840
2933
  },
2841
- ...unconfirmedStatus !== void 0 && { unconfirmedStatus }
2934
+ ...unconfirmedStatus !== void 0 && { unconfirmedStatus },
2935
+ ...coverage !== void 0 && { coverage },
2936
+ ...primaryLspChecked && { primaryLspChecked }
2842
2937
  };
2843
2938
  }
2844
2939
  var RUNNER_TIMEOUT_MS = RUNTIME_CONFIG.dispatch.runnerTimeoutMs;
@@ -2868,10 +2963,15 @@ function normalizeDiagnosticFilePath(ctx, rawPath) {
2868
2963
  return resolveRunnerPath(ctx.cwd, rawPath || ctx.filePath);
2869
2964
  }
2870
2965
  function failureRowMetadata(result) {
2871
- return result.status === "failed" && result.failureKind ? {
2872
- failureKind: result.failureKind,
2873
- failureMessage: result.failureMessage
2874
- } : void 0;
2966
+ const inconclusive = result.inconclusive === true ? { inconclusive: true } : {};
2967
+ if (result.status === "failed" && result.failureKind) {
2968
+ return {
2969
+ failureKind: result.failureKind,
2970
+ failureMessage: result.failureMessage,
2971
+ ...inconclusive
2972
+ };
2973
+ }
2974
+ return result.inconclusive === true ? inconclusive : void 0;
2875
2975
  }
2876
2976
  async function runRunner(ctx, runner, defaultSemantic) {
2877
2977
  const timeoutMs = Math.max(runner.timeoutMs ?? RUNNER_TIMEOUT_MS, getRunnerTimeoutFloorMs());
@@ -5854,7 +5954,7 @@ function findDetektConfig(cwd) {
5854
5954
  }
5855
5955
  function parseDetektOutput(raw, filePath, cwd) {
5856
5956
  const diagnostics = [];
5857
- const pattern = /^(.+?):(\d+):(\d+): (error|warning): (.+?)(?:\s+\[([^\]]+)\])?$/gm;
5957
+ const pattern = /^(.+?):(\d+):(\d+): (?:(error|warning): )?(.+?)(?:\s+\[([^\]]+)\])?$/gm;
5858
5958
  const absTarget = path13.resolve(cwd, filePath);
5859
5959
  for (const match of raw.matchAll(pattern)) {
5860
5960
  const [, file, lineStr, colStr, level, message, rule] = match;
@@ -5907,9 +6007,14 @@ var detektRunner = {
5907
6007
  const run = parseToolRun("detekt", {
5908
6008
  result,
5909
6009
  output: raw,
5910
- // EXIT TABLE (detekt 1.23 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
6010
+ // EXIT TABLE (detekt 1.23.8 captured fixtures): 0 clean; 2 findings on stdout with empty stderr.
6011
+ // Exit 1 is a tool error with NO findings (captured broken-config run: an invalid detekt.yml
6012
+ // prints InvalidConfigurationError on stderr), and also can follow printed findings (captured
6013
+ // findings-then-exit1 run: a non-numeric build.weights value fails after the report). Exit 1 is
6014
+ // therefore admitted, and skipWhenParsedNothing skips it only when the parser read no finding,
6015
+ // so a printed finding is kept. Any other nonzero exit is rejected.
5911
6016
  exitCodes: { ran: [1, 2] }
5912
- }, (out) => parseDetektOutput(out, ctx.filePath, cwd));
6017
+ }, (out) => parseDetektOutput(out, ctx.filePath, cwd), { skipWhenParsedNothing: true });
5913
6018
  if (run.skipped)
5914
6019
  return run.skipped;
5915
6020
  const diagnostics = run.diagnostics;
@@ -5917,10 +6022,11 @@ var detektRunner = {
5917
6022
  return { status: "succeeded", diagnostics: [], semantic: "none" };
5918
6023
  }
5919
6024
  const hasErrors = diagnostics.some((d) => d.severity === "error");
5920
- return findingsResult(diagnostics, {
6025
+ const verdict = findingsResult(diagnostics, {
5921
6026
  status: hasErrors ? "failed" : "succeeded",
5922
6027
  semantic: hasErrors ? "blocking" : "warning"
5923
6028
  });
6029
+ return result.status === 1 ? { ...verdict, inconclusive: true } : verdict;
5924
6030
  }
5925
6031
  };
5926
6032
  var detekt_default = detektRunner;
@@ -5930,11 +6036,16 @@ import * as fs10 from "node:fs";
5930
6036
  import * as path14 from "node:path";
5931
6037
  var dotnet = createAvailabilityChecker("dotnet", ".exe");
5932
6038
  function findProjectTarget(cwd) {
5933
- const entries = fs10.readdirSync(cwd);
5934
- const solution = entries.find((entry) => /\.(sln|slnx)$/i.test(entry));
5935
- if (solution)
5936
- return solution;
5937
- return entries.find((entry) => /\.(csproj)$/i.test(entry));
6039
+ const entries = fs10.readdirSync(cwd, { withFileTypes: true });
6040
+ for (const patterns of [
6041
+ DOTNET_CSHARP_SOLUTION_MARKERS,
6042
+ DOTNET_CSHARP_PROJECT_MARKERS
6043
+ ]) {
6044
+ const hit = entries.find((entry) => patterns.some((pattern) => direntsHaveMarkerGlobMatch([entry], pattern)));
6045
+ if (hit)
6046
+ return hit.name;
6047
+ }
6048
+ return void 0;
5938
6049
  }
5939
6050
  function isDotnetRuleId(value) {
5940
6051
  if (value.length < 2)
@@ -7772,126 +7883,6 @@ ${result.stderr ?? ""}`,
7772
7883
  };
7773
7884
  var ktlint_default = ktlintRunner;
7774
7885
 
7775
- // dist/clients/lsp/inferred-project.js
7776
- import * as path26 from "node:path";
7777
- var INFERRED_PROJECT_MARKER = "not in any tsconfig project \u2014 checked with inferred settings";
7778
- var TS_PROJECT_EXTENSIONS = /* @__PURE__ */ new Set([
7779
- ".ts",
7780
- ".tsx",
7781
- ".mts",
7782
- ".cts",
7783
- ".js",
7784
- ".jsx",
7785
- ".mjs",
7786
- ".cjs"
7787
- ]);
7788
- var TYPESCRIPT_DIAGNOSTIC_SOURCES = /* @__PURE__ */ new Set(["typescript", "ts", "tsserver"]);
7789
- function isTsProjectFile(filePath) {
7790
- return TS_PROJECT_EXTENSIONS.has(path26.extname(filePath).toLowerCase());
7791
- }
7792
- function isTypeScriptSourcedDiagnostic(d) {
7793
- return TYPESCRIPT_DIAGNOSTIC_SOURCES.has((d.source ?? "").toLowerCase());
7794
- }
7795
- function suggestTsconfigInclude(filePath, cwd) {
7796
- const relative5 = toProjectRelativePath(filePath, cwd);
7797
- if (path26.posix.isAbsolute(relative5) || /^[A-Za-z]:/.test(relative5)) {
7798
- const dir = relative5.slice(0, relative5.lastIndexOf("/"));
7799
- return dir ? `${dir}/**` : relative5;
7800
- }
7801
- const segments = relative5.split("/").filter(Boolean);
7802
- return segments.length > 1 ? `${segments[0]}/**` : relative5;
7803
- }
7804
- function inferredProjectNotice(filePath, cwd) {
7805
- return `[${INFERRED_PROJECT_MARKER}; add ${suggestTsconfigInclude(filePath, cwd)} to a tsconfig for authoritative checking]`;
7806
- }
7807
- function applyInferredProjectDemotion(diagnostics, filePath, cwd) {
7808
- if (!diagnostics.some(isDemotableDiagnostic))
7809
- return diagnostics;
7810
- const notice = inferredProjectNotice(filePath, cwd);
7811
- return diagnostics.map((d) => isDemotableDiagnostic(d) ? { ...d, severity: 2, message: `${d.message} ${notice}` } : d);
7812
- }
7813
- function isDemotableDiagnostic(d) {
7814
- return d.severity === 1 && isTypeScriptSourcedDiagnostic(d);
7815
- }
7816
- async function demoteInferredProjectDiagnostics(diagnostics, options) {
7817
- const { filePath, cwd, service } = options;
7818
- if (!isTsProjectFile(filePath))
7819
- return diagnostics;
7820
- if (!diagnostics.some(isDemotableDiagnostic))
7821
- return diagnostics;
7822
- if (options.signal?.aborted)
7823
- return diagnostics;
7824
- const fetchIdentity = options.fetchIdentity ?? fetchTsserverProjectIdentity;
7825
- const cache = options.identityCache;
7826
- let identity;
7827
- if (cache?.has(filePath)) {
7828
- identity = cache.get(filePath);
7829
- } else {
7830
- identity = await fetchIdentity(service, filePath);
7831
- cache?.set(filePath, identity);
7832
- }
7833
- if (identity?.projectKind !== "inferred")
7834
- return diagnostics;
7835
- return applyInferredProjectDemotion(diagnostics, filePath, cwd);
7836
- }
7837
- var INFERRED_PROJECT_PROBE_BUDGET = 300;
7838
- async function demoteInferredProjectSweepResults(results, cwd, service, signal) {
7839
- if (typeof service?.executeReadOnlyCommandOnLiveClient !== "function") {
7840
- return results;
7841
- }
7842
- const startedAt = Date.now();
7843
- const identityCache = /* @__PURE__ */ new Map();
7844
- const out = [];
7845
- let demotedFiles = 0;
7846
- let demotedDiagnostics = 0;
7847
- let budgetExhausted = false;
7848
- let aborted = false;
7849
- for (const result of results) {
7850
- const diagnostics = result.diagnostics ?? [];
7851
- if (signal?.aborted) {
7852
- aborted = true;
7853
- out.push(result);
7854
- continue;
7855
- }
7856
- if (identityCache.size >= INFERRED_PROJECT_PROBE_BUDGET && !identityCache.has(result.filePath)) {
7857
- budgetExhausted = true;
7858
- out.push(result);
7859
- continue;
7860
- }
7861
- const demoted = await demoteInferredProjectDiagnostics(diagnostics, {
7862
- filePath: result.filePath,
7863
- cwd,
7864
- service,
7865
- identityCache,
7866
- signal
7867
- });
7868
- if (demoted === diagnostics) {
7869
- out.push(result);
7870
- continue;
7871
- }
7872
- demotedFiles += 1;
7873
- demotedDiagnostics += demoted.filter((d, i) => d !== diagnostics[i]).length;
7874
- out.push({ ...result, diagnostics: demoted });
7875
- }
7876
- if (demotedFiles > 0 || budgetExhausted || aborted) {
7877
- logLatency({
7878
- type: "phase",
7879
- phase: "lsp_inferred_project_demote",
7880
- filePath: cwd,
7881
- durationMs: Date.now() - startedAt,
7882
- metadata: {
7883
- filesConsidered: results.length,
7884
- filesProbed: identityCache.size,
7885
- demotedFiles,
7886
- demotedDiagnostics,
7887
- budgetExhausted,
7888
- aborted
7889
- }
7890
- });
7891
- }
7892
- return out;
7893
- }
7894
-
7895
7886
  // dist/clients/dispatch/runners/lsp.js
7896
7887
  var LSP_SPAWN_BUDGET_MS = RUNTIME_CONFIG.pipeline.lspSpawnBudgetMs;
7897
7888
  var LSP_DIAGNOSTICS_WAIT_MS = 2500;
@@ -7948,6 +7939,7 @@ var lspRunner = {
7948
7939
  let unconfirmedServerIds = [];
7949
7940
  let deferredServerIds = [];
7950
7941
  let usedWarmAttach = false;
7942
+ let incumbentProjectIdentity;
7951
7943
  let failureReason = "";
7952
7944
  const readStamp = performance.now();
7953
7945
  const content = readFileContent(ctx.filePath);
@@ -7961,6 +7953,9 @@ var lspRunner = {
7961
7953
  try {
7962
7954
  const attached = await tryWarmAttachedDiagnostics(ctx.filePath, content, Math.max(LSP_SPAWN_BUDGET_MS, LSP_DIAGNOSTICS_WAIT_MS));
7963
7955
  usedWarmAttach = attached?.available === true;
7956
+ if (attached?.available) {
7957
+ incumbentProjectIdentity = attached.response.projectIdentity;
7958
+ }
7964
7959
  const touched = attached?.available ? {
7965
7960
  diags: attached.response.diagnostics,
7966
7961
  ...attached.response.unconfirmedServerIds !== void 0 && {
@@ -8020,6 +8015,16 @@ var lspRunner = {
8020
8015
  });
8021
8016
  }
8022
8017
  }
8018
+ let withheldNotice;
8019
+ if (lspDiags.length > 0) {
8020
+ const declared = await detectPythonTargetVersion(diagnosticPath);
8021
+ const { kept, dropped } = partitionOutrankedPythonCompileVerdicts(lspDiags, declared);
8022
+ if (dropped > 0 && declared) {
8023
+ recordPythonCompileVerdictDrop(diagnosticPath, declared, dropped);
8024
+ lspDiags = kept;
8025
+ withheldNotice = describePythonCompileWithheld(dropped, declared);
8026
+ }
8027
+ }
8023
8028
  if (serverFailed) {
8024
8029
  return {
8025
8030
  status: "failed",
@@ -8079,15 +8084,19 @@ var lspRunner = {
8079
8084
  status: "succeeded",
8080
8085
  diagnostics: [],
8081
8086
  semantic: "none",
8082
- rawOutput: "no-diagnostics"
8087
+ rawOutput: "no-diagnostics",
8088
+ ...withheldNotice !== void 0 && { withheldNotice }
8083
8089
  };
8084
8090
  }
8085
8091
  const rawValidLspDiags = lspDiags.filter((d) => d.range?.start?.line !== void 0);
8086
- const validLspDiags = usedWarmAttach ? rawValidLspDiags : await demoteInferredProjectDiagnostics(rawValidLspDiags, {
8092
+ const validLspDiags = (await demoteLanguageServerRows(rawValidLspDiags, {
8087
8093
  filePath: diagnosticPath,
8088
8094
  cwd: ctx.cwd,
8089
- service: lspService
8090
- });
8095
+ ...!usedWarmAttach && { service: lspService },
8096
+ ...incumbentProjectIdentity !== void 0 && {
8097
+ identityCache: /* @__PURE__ */ new Map([[diagnosticPath, incumbentProjectIdentity]])
8098
+ }
8099
+ })).rows;
8091
8100
  const fixSuggestionByIndex = /* @__PURE__ */ new Map();
8092
8101
  const blockingDiagIndexes = rawValidLspDiags.map((d, idx) => ({ d, idx })).filter(({ d }) => d.severity === 1).slice(0, WARM_CODE_ACTION_LOOKUP_LIMIT);
8093
8102
  if (usedWarmAttach) {
@@ -8144,14 +8153,15 @@ var lspRunner = {
8144
8153
  ...deferredServerIds.length > 0 && {
8145
8154
  deferredServerIds: [...deferredServerIds]
8146
8155
  },
8147
- ...outOfEditScope.length > 0 && { outOfEditScope }
8156
+ ...outOfEditScope.length > 0 && { outOfEditScope },
8157
+ ...withheldNotice !== void 0 && { withheldNotice }
8148
8158
  };
8149
8159
  }
8150
8160
  };
8151
8161
  var lsp_default = lspRunner;
8152
8162
 
8153
8163
  // dist/clients/dispatch/runners/markdownlint.js
8154
- import * as path27 from "node:path";
8164
+ import * as path26 from "node:path";
8155
8165
  var markdownlint = createAvailabilityChecker("markdownlint-cli2", ".cmd", [
8156
8166
  "--no-globs",
8157
8167
  "-"
@@ -8191,7 +8201,7 @@ var MARKDOWNLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
8191
8201
  ]);
8192
8202
  function parseMarkdownlintOutput(raw, filePath, cwd) {
8193
8203
  const diagnostics = [];
8194
- const absTarget = path27.resolve(cwd, filePath);
8204
+ const absTarget = path26.resolve(cwd, filePath);
8195
8205
  for (const line of raw.split(/\r?\n/)) {
8196
8206
  if (!line.trim())
8197
8207
  continue;
@@ -8199,7 +8209,7 @@ function parseMarkdownlintOutput(raw, filePath, cwd) {
8199
8209
  if (!match)
8200
8210
  continue;
8201
8211
  const [, reported, lineNum, col, ruleCode, message] = match;
8202
- if (reported && !pathsEqual(path27.resolve(cwd, reported), absTarget))
8212
+ if (reported && !pathsEqual(path26.resolve(cwd, reported), absTarget))
8203
8213
  continue;
8204
8214
  const ruleName = ruleCode.split("/")[0];
8205
8215
  const fixable = MARKDOWNLINT_FIXABLE_RULES.has(ruleName);
@@ -8273,7 +8283,7 @@ var markdownlintRunner = {
8273
8283
  var markdownlint_default = markdownlintRunner;
8274
8284
 
8275
8285
  // dist/clients/dispatch/runners/mypy.js
8276
- import * as path28 from "node:path";
8286
+ import * as path27 from "node:path";
8277
8287
  var mypy = createAvailabilityChecker("mypy", "");
8278
8288
  var MYPY_EXIT_CODES = { ran: [1, 2] };
8279
8289
  function parseMypyOutput(raw, fallbackPath, cwd) {
@@ -8287,7 +8297,7 @@ function parseMypyOutput(raw, fallbackPath, cwd) {
8287
8297
  continue;
8288
8298
  const severity = level === "error" ? "error" : "warning";
8289
8299
  const rule = errorCode ?? "mypy";
8290
- const filePath = file && file.trim() ? path28.isAbsolute(file) ? file : path28.resolve(cwd, file) : fallbackPath;
8300
+ const filePath = file && file.trim() ? path27.isAbsolute(file) ? file : path27.resolve(cwd, file) : fallbackPath;
8291
8301
  diagnostics.push({
8292
8302
  id: `mypy-${lineNum}-${rule}`,
8293
8303
  message: errorCode ? `[${errorCode}] ${message}` : message,
@@ -8338,7 +8348,7 @@ var mypyRunner = {
8338
8348
  var mypy_default = mypyRunner;
8339
8349
 
8340
8350
  // dist/clients/dispatch/runners/oxlint.js
8341
- import * as path29 from "node:path";
8351
+ import * as path28 from "node:path";
8342
8352
  var MAX_OXLINT_OUTPUT_BYTES = 8 * 1024 * 1024;
8343
8353
  var OXLINT_NO_FILES = /* @__PURE__ */ Symbol("oxlint-no-files");
8344
8354
  var OXLINT_NO_FILES_UNCONFIRMED = /* @__PURE__ */ Symbol("oxlint-no-files-unconfirmed");
@@ -8582,9 +8592,9 @@ function parseOxlintJson(raw, filePath, cwd) {
8582
8592
  if (!Array.isArray(parsed.diagnostics))
8583
8593
  return [];
8584
8594
  const diagnostics = [];
8585
- const absTarget = path29.resolve(cwd, filePath);
8595
+ const absTarget = path28.resolve(cwd, filePath);
8586
8596
  for (const d of parsed.diagnostics) {
8587
- if (!d.filename || !pathsEqual(path29.resolve(cwd, d.filename), absTarget)) {
8597
+ if (!d.filename || !pathsEqual(path28.resolve(cwd, d.filename), absTarget)) {
8588
8598
  continue;
8589
8599
  }
8590
8600
  const rule = extractOxlintRule(d.code);
@@ -8614,14 +8624,14 @@ function parseOxlintJson(raw, filePath, cwd) {
8614
8624
  }
8615
8625
  function parseOxlintUnix(raw, filePath, cwd) {
8616
8626
  const diagnostics = [];
8617
- const absTarget = path29.resolve(cwd, filePath);
8627
+ const absTarget = path28.resolve(cwd, filePath);
8618
8628
  for (const line of raw.split("\n")) {
8619
8629
  const match = line.match(/^(.+):(\d+):(\d+):\s*(.+?)\s*\(([^)]+)\)$/);
8620
8630
  if (match) {
8621
8631
  const [, reportedPath, lineStr, _col, message, rule] = match;
8622
8632
  if (!reportedPath || !lineStr || !message || !rule)
8623
8633
  continue;
8624
- if (!pathsEqual(path29.resolve(cwd, reportedPath), absTarget))
8634
+ if (!pathsEqual(path28.resolve(cwd, reportedPath), absTarget))
8625
8635
  continue;
8626
8636
  diagnostics.push({
8627
8637
  id: `oxlint-${rule}-${lineStr}`,
@@ -8640,7 +8650,7 @@ function parseOxlintUnix(raw, filePath, cwd) {
8640
8650
  var oxlint_default = oxlintRunner;
8641
8651
 
8642
8652
  // dist/clients/dispatch/runners/php-lint.js
8643
- import * as path30 from "node:path";
8653
+ import * as path29 from "node:path";
8644
8654
  var PHP_LINT_EXIT_CODES = { ran: [1, 255] };
8645
8655
  var php = createAvailabilityChecker("php", ".exe");
8646
8656
  function parsePhpLintOutput(raw, filePath, cwd) {
@@ -8650,7 +8660,7 @@ function parsePhpLintOutput(raw, filePath, cwd) {
8650
8660
  const lineMatch = output.match(/on line (\d+)/i);
8651
8661
  const messageMatch = output.match(/PHP Parse error:\s*(.+?)(?:\s+in\s+(.+?)\s+on line \d+)?$/im) ?? output.match(/Parse error:\s*(.+?)(?:\s+in\s+(.+?)\s+on line \d+)?$/im);
8652
8662
  const reported = messageMatch?.[2]?.trim();
8653
- if (reported && !pathsEqual(path30.resolve(cwd, reported), path30.resolve(cwd, filePath)))
8663
+ if (reported && !pathsEqual(path29.resolve(cwd, reported), path29.resolve(cwd, filePath)))
8654
8664
  return [];
8655
8665
  return [
8656
8666
  {
@@ -8677,7 +8687,7 @@ var phpLintRunner = {
8677
8687
  const cmd = ctx.analysisRootMode === "adopted" ? resolveAdoptedRootCommand("php", ctx, cwd) : await php.isAvailableAsync(cwd) ? php.getCommand(cwd) : null;
8678
8688
  if (!cmd)
8679
8689
  return { status: "skipped", diagnostics: [], semantic: "none" };
8680
- const absPath = path30.resolve(cwd, ctx.filePath);
8690
+ const absPath = path29.resolve(cwd, ctx.filePath);
8681
8691
  const result = await safeSpawnAsync(cmd, ["-l", absPath], {
8682
8692
  timeout: 15e3,
8683
8693
  cwd
@@ -8702,7 +8712,7 @@ ${result.stderr ?? ""}`,
8702
8712
  var php_lint_default = phpLintRunner;
8703
8713
 
8704
8714
  // dist/clients/dispatch/runners/phpstan.js
8705
- import * as path31 from "node:path";
8715
+ import * as path30 from "node:path";
8706
8716
  var PHPSTAN_EXIT_CODES = { ran: [1] };
8707
8717
  var phpstan = createAvailabilityChecker("phpstan", ".phar");
8708
8718
  function parsePhpstanJson(raw, fallbackPath, cwd) {
@@ -8710,7 +8720,7 @@ function parsePhpstanJson(raw, fallbackPath, cwd) {
8710
8720
  const output = JSON.parse(raw);
8711
8721
  const diagnostics = [];
8712
8722
  for (const [file, fileErrors] of Object.entries(output.files ?? {})) {
8713
- const filePath = file && file.trim() ? path31.isAbsolute(file) ? file : path31.resolve(cwd, file) : fallbackPath;
8723
+ const filePath = file && file.trim() ? path30.isAbsolute(file) ? file : path30.resolve(cwd, file) : fallbackPath;
8714
8724
  for (const err of fileErrors?.messages ?? []) {
8715
8725
  diagnostics.push({
8716
8726
  id: `phpstan:${err.line ?? 1}:${err.message.slice(0, 40)}`,
@@ -8769,7 +8779,7 @@ var phpstanRunner = {
8769
8779
  const cmd = await resolvePhpstan(cwd);
8770
8780
  if (!cmd)
8771
8781
  return { status: "skipped", diagnostics: [], semantic: "none" };
8772
- const absPath = path31.resolve(cwd, ctx.filePath);
8782
+ const absPath = path30.resolve(cwd, ctx.filePath);
8773
8783
  const result = await safeSpawnAsync(cmd, ["analyse", "--error-format=json", "--no-progress", absPath], { timeout: 3e4, cwd });
8774
8784
  const run = parseToolRun("phpstan", { result, exitCodes: PHPSTAN_EXIT_CODES }, (out) => parsePhpstanJson(out, ctx.filePath, cwd), { parseOutput: result.stdout ?? "" });
8775
8785
  if (run.skipped)
@@ -8787,7 +8797,7 @@ var phpstanRunner = {
8787
8797
  var phpstan_default = phpstanRunner;
8788
8798
 
8789
8799
  // dist/clients/dispatch/runners/prisma-validate.js
8790
- import * as path32 from "node:path";
8800
+ import * as path31 from "node:path";
8791
8801
  var PRISMA_VALIDATION_REPORT = /\bValidation Error Count:\s*\d+/;
8792
8802
  function parsePrismaValidateOutput(raw, filePath) {
8793
8803
  const output = raw.split("\n").map((line) => line.trim()).filter(Boolean).filter((line) => !line.startsWith("Environment variables loaded")).filter((line) => !line.startsWith("Prisma schema loaded")).join(" ");
@@ -8818,7 +8828,7 @@ var prismaValidateRunner = {
8818
8828
  async run(ctx) {
8819
8829
  const cwd = resolveRunnerCwd(ctx, "prisma-validate");
8820
8830
  const resolved = await resolveLocalFirstAsync("prisma", cwd);
8821
- const absPath = path32.resolve(cwd, ctx.filePath);
8831
+ const absPath = path31.resolve(cwd, ctx.filePath);
8822
8832
  const result = await safeSpawnAsync(resolved.cmd, [...resolved.args, "validate", "--schema", absPath], {
8823
8833
  timeout: 2e4,
8824
8834
  // ONE neutral-cwd seam for npx fallbacks (#4193, #4268 acceptance 3),
@@ -8856,7 +8866,7 @@ var prisma_validate_default = prismaValidateRunner;
8856
8866
  // dist/clients/dispatch/runners/psscriptanalyzer.js
8857
8867
  import * as fs13 from "node:fs/promises";
8858
8868
  import * as os2 from "node:os";
8859
- import * as path33 from "node:path";
8869
+ import * as path32 from "node:path";
8860
8870
  var PS_SCRIPT = `
8861
8871
  param([string]$FilePath)
8862
8872
  Import-Module PSScriptAnalyzer -ErrorAction Stop
@@ -9048,8 +9058,8 @@ var psScriptAnalyzerRunner = {
9048
9058
  return { status: "skipped", diagnostics: [], semantic: "none" };
9049
9059
  }
9050
9060
  const cwd = resolveRunnerCwd(ctx, "psscriptanalyzer");
9051
- const absPath = path33.resolve(cwd, ctx.filePath);
9052
- const tmpScript = path33.join(os2.tmpdir(), `pi-lens-psa-${process.pid}.ps1`);
9061
+ const absPath = path32.resolve(cwd, ctx.filePath);
9062
+ const tmpScript = path32.join(os2.tmpdir(), `pi-lens-psa-${process.pid}.ps1`);
9053
9063
  await fs13.writeFile(tmpScript, PS_SCRIPT, "utf-8");
9054
9064
  try {
9055
9065
  const sampler = startHostStallSampler();
@@ -9180,7 +9190,7 @@ var pyrightRunner = {
9180
9190
  cmd = installedPath;
9181
9191
  }
9182
9192
  if (!cmd) {
9183
- const { findCommandAsync } = await import("./chunk-LLJNQKQW.js");
9193
+ const { findCommandAsync } = await import("./chunk-GLW3YDZZ.js");
9184
9194
  const foundCmd = await findCommandAsync("pyright");
9185
9195
  if (foundCmd)
9186
9196
  cmd = foundCmd;
@@ -9277,7 +9287,7 @@ function parsePyrightOutput(data, _filePath) {
9277
9287
  var pyright_default = pyrightRunner;
9278
9288
 
9279
9289
  // dist/clients/dispatch/runners/rubocop.js
9280
- import * as path34 from "node:path";
9290
+ import * as path33 from "node:path";
9281
9291
  var SEVERITY_MAP = {
9282
9292
  fatal: "error",
9283
9293
  error: "error",
@@ -9290,9 +9300,9 @@ function parseRubocopJson(raw, filePath, cwd) {
9290
9300
  const output = JSON.parse(raw);
9291
9301
  const autofix = getAutofixCapability("rubocop");
9292
9302
  const diagnostics = [];
9293
- const absTarget = path34.resolve(cwd, filePath);
9303
+ const absTarget = path33.resolve(cwd, filePath);
9294
9304
  for (const file of output.files) {
9295
- if (file.path && !pathsEqual(path34.resolve(cwd, file.path), absTarget))
9305
+ if (file.path && !pathsEqual(path33.resolve(cwd, file.path), absTarget))
9296
9306
  continue;
9297
9307
  for (const offense of file.offenses) {
9298
9308
  const severity = SEVERITY_MAP[offense.severity] ?? "warning";
@@ -9577,7 +9587,7 @@ var rust_clippy_default = rustClippyRunner;
9577
9587
  // dist/clients/dispatch/runners/spotbugs.js
9578
9588
  import * as fs14 from "node:fs";
9579
9589
  import * as os3 from "node:os";
9580
- import * as path35 from "node:path";
9590
+ import * as path34 from "node:path";
9581
9591
  var java = createAvailabilityChecker("java", ".exe", ["-version"]);
9582
9592
  var spotbugs = createAvailabilityChecker("spotbugs", ".bat", ["-version"]);
9583
9593
  var MAX_DIAGNOSTICS = 50;
@@ -9598,7 +9608,7 @@ function classesSignature(classesDir) {
9598
9608
  continue;
9599
9609
  }
9600
9610
  for (const entry of entries) {
9601
- const full = path35.join(dir, entry.name);
9611
+ const full = path34.join(dir, entry.name);
9602
9612
  if (entry.isDirectory()) {
9603
9613
  stack.push(full);
9604
9614
  } else if (entry.isFile() && entry.name.endsWith(".class")) {
@@ -9689,7 +9699,7 @@ function parseSpotbugsXml(raw) {
9689
9699
  const message = shortMsg || longMsg || type;
9690
9700
  const fixSuggestion = longMsg ? firstSentence(longMsg) : void 0;
9691
9701
  diagnostics.push({
9692
- id: `spotbugs:${type}:${path35.basename(filePath)}:${line}:${index}`,
9702
+ id: `spotbugs:${type}:${path34.basename(filePath)}:${line}:${index}`,
9693
9703
  message: `[${type}] ${message}`,
9694
9704
  filePath,
9695
9705
  line,
@@ -9739,7 +9749,7 @@ var spotbugsRunner = {
9739
9749
  const cmd = await resolveAvailableOrInstall(spotbugs, "spotbugs", cwd);
9740
9750
  if (!cmd)
9741
9751
  return { status: "skipped", diagnostics: [], semantic: "none" };
9742
- const tmpXml = path35.join(os3.tmpdir(), `pi-lens-spotbugs-${process.pid}-${Date.now()}.xml`);
9752
+ const tmpXml = path34.join(os3.tmpdir(), `pi-lens-spotbugs-${process.pid}-${Date.now()}.xml`);
9743
9753
  const result = await safeSpawnAsync(cmd, [
9744
9754
  "-textui",
9745
9755
  "-xml:withMessages",
@@ -9781,7 +9791,7 @@ var spotbugs_default = spotbugsRunner;
9781
9791
 
9782
9792
  // dist/clients/dispatch/runners/shellcheck.js
9783
9793
  import * as fs15 from "node:fs";
9784
- import * as path36 from "node:path";
9794
+ import * as path35 from "node:path";
9785
9795
  var shellcheck = createAvailabilityChecker("shellcheck", ".exe");
9786
9796
  var SHELLCHECK_EXIT_CODES = { ran: [1] };
9787
9797
  var SHELLCHECK_DIALECTS = [
@@ -9823,7 +9833,7 @@ function resolveShellFileDialect(filePath) {
9823
9833
  }
9824
9834
  const directive = parseShellDirective(content);
9825
9835
  const shebang = parseShebang(content);
9826
- const parsed = directive ?? shebang ?? (path36.extname(filePath).toLowerCase() === ".zsh" ? "zsh" : null);
9836
+ const parsed = directive ?? shebang ?? (path35.extname(filePath).toLowerCase() === ".zsh" ? "zsh" : null);
9827
9837
  return {
9828
9838
  shebang,
9829
9839
  directive,
@@ -9831,24 +9841,11 @@ function resolveShellFileDialect(filePath) {
9831
9841
  };
9832
9842
  }
9833
9843
  function findShellcheckConfig(cwd) {
9834
- const local = path36.join(cwd, ".shellcheckrc");
9835
- if (fs15.existsSync(local))
9836
- return local;
9837
- let current = path36.resolve(cwd);
9838
- while (true) {
9839
- const candidate = path36.join(current, ".shellcheckrc");
9840
- if (fs15.existsSync(candidate))
9841
- return candidate;
9842
- const parent = path36.dirname(current);
9843
- if (parent === current)
9844
- break;
9845
- current = parent;
9846
- }
9847
- return void 0;
9844
+ return findLocalToolConfig(cwd, [".shellcheckrc"]);
9848
9845
  }
9849
9846
  function parseShellcheckOutput(raw, filePath, cwd) {
9850
9847
  const diagnostics = [];
9851
- const absTarget = path36.resolve(cwd, filePath);
9848
+ const absTarget = path35.resolve(cwd, filePath);
9852
9849
  if (!raw.trim()) {
9853
9850
  return diagnostics;
9854
9851
  }
@@ -9860,7 +9857,7 @@ function parseShellcheckOutput(raw, filePath, cwd) {
9860
9857
  for (const item of parsed) {
9861
9858
  if (!item.message || !item.line)
9862
9859
  continue;
9863
- if (!item.file || !pathsEqual(path36.resolve(cwd, item.file), absTarget))
9860
+ if (!item.file || !pathsEqual(path35.resolve(cwd, item.file), absTarget))
9864
9861
  continue;
9865
9862
  const severityMap = {
9866
9863
  error: "error",
@@ -10158,12 +10155,12 @@ var shfmtRunner = {
10158
10155
  var shfmt_default = shfmtRunner;
10159
10156
 
10160
10157
  // dist/clients/dispatch/runners/spellcheck.js
10161
- import * as path37 from "node:path";
10158
+ import * as path36 from "node:path";
10162
10159
  var typos = createAvailabilityChecker("typos", ".exe");
10163
10160
  var TYPOS_EXIT_CODES = { ran: [2] };
10164
10161
  function parseTyposOutput(raw, filePath, cwd) {
10165
10162
  const diagnostics = [];
10166
- const absTarget = path37.resolve(cwd, filePath);
10163
+ const absTarget = path36.resolve(cwd, filePath);
10167
10164
  if (!raw.trim()) {
10168
10165
  return diagnostics;
10169
10166
  }
@@ -10173,7 +10170,7 @@ function parseTyposOutput(raw, filePath, cwd) {
10173
10170
  const parsed = JSON.parse(line);
10174
10171
  if (!parsed.typo || !parsed.line_num)
10175
10172
  continue;
10176
- if (parsed.path && !pathsEqual(path37.resolve(cwd, parsed.path), absTarget))
10173
+ if (parsed.path && !pathsEqual(path36.resolve(cwd, parsed.path), absTarget))
10177
10174
  continue;
10178
10175
  const corrections = parsed.corrections?.join(", ") || "no suggestions";
10179
10176
  const message = `Typo: "${parsed.typo}" \u2192 ${corrections}`;
@@ -10231,7 +10228,7 @@ var spellcheckRunner = {
10231
10228
  var spellcheck_default = spellcheckRunner;
10232
10229
 
10233
10230
  // dist/clients/dispatch/runners/sqlfluff.js
10234
- import * as path38 from "node:path";
10231
+ import * as path37 from "node:path";
10235
10232
  var sqlfluff = createAvailabilityChecker("sqlfluff", ".exe");
10236
10233
  var SQLFLUFF_EXIT_CODES = { ran: [1] };
10237
10234
  var SQLFLUFF_FIXABLE_RULES = /* @__PURE__ */ new Set([
@@ -10286,9 +10283,9 @@ function parseSqlfluffOutput(raw, filePath, cwd) {
10286
10283
  if (!Array.isArray(parsed))
10287
10284
  return [];
10288
10285
  const diagnostics = [];
10289
- const absTarget = path38.resolve(cwd, filePath);
10286
+ const absTarget = path37.resolve(cwd, filePath);
10290
10287
  for (const item of parsed) {
10291
- if (item.filepath && !pathsEqual(path38.resolve(cwd, item.filepath), absTarget))
10288
+ if (item.filepath && !pathsEqual(path37.resolve(cwd, item.filepath), absTarget))
10292
10289
  continue;
10293
10290
  for (const v of item.violations ?? []) {
10294
10291
  if (!v.description)
@@ -10363,7 +10360,7 @@ var sqlfluffRunner = {
10363
10360
  var sqlfluff_default = sqlfluffRunner;
10364
10361
 
10365
10362
  // dist/clients/dispatch/runners/stylelint.js
10366
- import * as path39 from "node:path";
10363
+ import * as path38 from "node:path";
10367
10364
  var stylelint = createAvailabilityChecker("stylelint", ".cmd");
10368
10365
  var STYLELINT_EXIT_CODES = { ran: [1, 2] };
10369
10366
  function stylelintReport(stdout, stderr) {
@@ -10408,9 +10405,9 @@ function parseStylelintJson(raw, filePath, cwd) {
10408
10405
  try {
10409
10406
  const results = JSON.parse(raw);
10410
10407
  const diagnostics = [];
10411
- const absTarget = path39.resolve(cwd, filePath);
10408
+ const absTarget = path38.resolve(cwd, filePath);
10412
10409
  for (const result of results) {
10413
- if (result.source && !pathsEqual(path39.resolve(cwd, result.source), absTarget))
10410
+ if (result.source && !pathsEqual(path38.resolve(cwd, result.source), absTarget))
10414
10411
  continue;
10415
10412
  for (const w of result.warnings) {
10416
10413
  const severity = w.severity === "error" ? "error" : "warning";
@@ -10446,7 +10443,7 @@ var stylelintRunner = {
10446
10443
  if (policy && !policy.preferredRunners.includes("stylelint")) {
10447
10444
  return { status: "skipped", diagnostics: [], semantic: "none" };
10448
10445
  }
10449
- const fileDir = path39.dirname(path39.resolve(cwd, ctx.filePath));
10446
+ const fileDir = path38.dirname(path38.resolve(cwd, ctx.filePath));
10450
10447
  const hasConfig = hasStylelintConfig(fileDir) || hasStylelintConfig(cwd);
10451
10448
  if (!hasConfig) {
10452
10449
  logRunnerAdvisoryOnce(ctx, "stylelint", cwd, "stylelint: no config detected, running with default rules");
@@ -10476,7 +10473,7 @@ var stylelintRunner = {
10476
10473
  var stylelint_default = stylelintRunner;
10477
10474
 
10478
10475
  // dist/clients/dispatch/runners/swiftlint.js
10479
- import * as path40 from "node:path";
10476
+ import * as path39 from "node:path";
10480
10477
  var swiftlint = createAvailabilityChecker("swiftlint", ".exe");
10481
10478
  var SWIFTLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
10482
10479
  "closing_brace",
@@ -10539,7 +10536,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10539
10536
  const diagnostics = [];
10540
10537
  if (!raw.trim())
10541
10538
  return diagnostics;
10542
- const absTarget = path40.resolve(cwd, filePath);
10539
+ const absTarget = path39.resolve(cwd, filePath);
10543
10540
  try {
10544
10541
  const parsed = JSON.parse(raw);
10545
10542
  if (!Array.isArray(parsed))
@@ -10547,7 +10544,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10547
10544
  for (const item of parsed) {
10548
10545
  if (!item.reason)
10549
10546
  continue;
10550
- if (item.file && !pathsEqual(path40.resolve(cwd, item.file), absTarget))
10547
+ if (item.file && !pathsEqual(path39.resolve(cwd, item.file), absTarget))
10551
10548
  continue;
10552
10549
  const severityMap = {
10553
10550
  error: "error",
@@ -10592,7 +10589,7 @@ var swiftlintRunner = {
10592
10589
  }
10593
10590
  if (!cmd)
10594
10591
  return { status: "skipped", diagnostics: [], semantic: "none" };
10595
- const result = await safeSpawnAsync(cmd, ["--reporter", "json", path40.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
10592
+ const result = await safeSpawnAsync(cmd, ["--reporter", "json", path39.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
10596
10593
  const run = parseToolRun("swiftlint", {
10597
10594
  result,
10598
10595
  // EXIT TABLE (SwiftLint 0.56 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
@@ -10614,7 +10611,7 @@ var swiftlintRunner = {
10614
10611
  var swiftlint_default = swiftlintRunner;
10615
10612
 
10616
10613
  // dist/clients/dispatch/runners/taplo.js
10617
- import * as path41 from "node:path";
10614
+ import * as path40 from "node:path";
10618
10615
  var taplo = createAvailabilityChecker("taplo", ".exe");
10619
10616
  var TAPLO_EXIT_CODES = { ran: [1] };
10620
10617
  var HEADER_PATTERN = /^\s*(error|warning):(.*)$/;
@@ -10622,7 +10619,7 @@ var LOCATION_LEAD = "\u250C\u2500";
10622
10619
  var LOCATION_PATTERN = /^\s*┌─\s+(.+?):(\d+):(\d+)$/;
10623
10620
  function parseTaploOutput(raw, filePath, cwd) {
10624
10621
  const diagnostics = [];
10625
- const absTarget = path41.resolve(cwd, filePath);
10622
+ const absTarget = path40.resolve(cwd, filePath);
10626
10623
  const lines = stripAnsi(raw ?? "").split(/\r?\n/);
10627
10624
  for (let i = 0; i < lines.length; i++) {
10628
10625
  const header = HEADER_PATTERN.exec(lines[i].trimEnd());
@@ -10640,7 +10637,7 @@ function parseTaploOutput(raw, filePath, cwd) {
10640
10637
  const location = LOCATION_PATTERN.exec(lines[j].trimEnd());
10641
10638
  if (!location)
10642
10639
  continue;
10643
- if (!pathsEqual(path41.resolve(cwd, location[1].trim()), absTarget))
10640
+ if (!pathsEqual(path40.resolve(cwd, location[1].trim()), absTarget))
10644
10641
  continue;
10645
10642
  line = Number.parseInt(location[2], 10) || 1;
10646
10643
  column = Number.parseInt(location[3], 10) || 1;
@@ -10702,7 +10699,7 @@ var taploRunner = {
10702
10699
  }
10703
10700
  if (!cmd)
10704
10701
  return { status: "skipped", diagnostics: [], semantic: "none" };
10705
- const absPath = path41.resolve(cwd, ctx.filePath);
10702
+ const absPath = path40.resolve(cwd, ctx.filePath);
10706
10703
  const result = await safeSpawnAsync(cmd, ["check", "--colors", "never", absPath], { cwd, timeout: 15e3 });
10707
10704
  const raw = result.stderr?.trim() ? result.stderr : result.stdout ?? "";
10708
10705
  const run = parseToolRun("taplo", { result, output: raw, exitCodes: TAPLO_EXIT_CODES }, (out) => parseTaploOutput(out, ctx.filePath, cwd), { skipWhenParsedNothing: true });
@@ -10721,7 +10718,7 @@ var taploRunner = {
10721
10718
  var taplo_default = taploRunner;
10722
10719
 
10723
10720
  // dist/clients/dispatch/runners/terragrunt.js
10724
- import * as path42 from "node:path";
10721
+ import * as path41 from "node:path";
10725
10722
  var terragrunt = createAvailabilityChecker("terragrunt", ".exe");
10726
10723
  function normalizeSeverity(raw) {
10727
10724
  if (typeof raw === "number")
@@ -10740,7 +10737,7 @@ function toRawDiagnostics(parsed) {
10740
10737
  return [];
10741
10738
  return invalidFiles.flatMap((f) => Array.isArray(f?.diagnostics) ? f.diagnostics : []);
10742
10739
  }
10743
- function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)) {
10740
+ function parseTerragruntOutput(raw, filePath, absPath = path41.resolve(filePath)) {
10744
10741
  if (!raw.trim())
10745
10742
  return [];
10746
10743
  let parsed;
@@ -10749,13 +10746,13 @@ function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)
10749
10746
  } catch {
10750
10747
  return [];
10751
10748
  }
10752
- const unitDir = path42.dirname(absPath);
10749
+ const unitDir = path41.dirname(absPath);
10753
10750
  const diagnostics = [];
10754
10751
  for (const d of toRawDiagnostics(parsed)) {
10755
10752
  if (!d || typeof d !== "object")
10756
10753
  continue;
10757
10754
  const diagFile = d.range?.filename;
10758
- if (diagFile && !pathsEqual(path42.resolve(unitDir, diagFile), absPath))
10755
+ if (diagFile && !pathsEqual(path41.resolve(unitDir, diagFile), absPath))
10759
10756
  continue;
10760
10757
  const line = d.range?.start?.line ?? 1;
10761
10758
  const column = d.range?.start?.column ?? 1;
@@ -10801,8 +10798,8 @@ var terragruntRunner = {
10801
10798
  }
10802
10799
  if (!cmd)
10803
10800
  return SKIPPED3;
10804
- const absPath = path42.resolve(cwd, ctx.filePath);
10805
- const fileDir = path42.dirname(absPath);
10801
+ const absPath = path41.resolve(cwd, ctx.filePath);
10802
+ const fileDir = path41.dirname(absPath);
10806
10803
  const result = await safeSpawnAsync(cmd, ["hcl", "validate", "--json", "--non-interactive"], { cwd: fileDir, timeout: 3e4 });
10807
10804
  if (spawnFailedWithNoOutput(result))
10808
10805
  return SKIPPED3;
@@ -10825,22 +10822,22 @@ var terragruntRunner = {
10825
10822
  var terragrunt_default = terragruntRunner;
10826
10823
 
10827
10824
  // dist/clients/dispatch/runners/tflint.js
10828
- import * as path43 from "node:path";
10825
+ import * as path42 from "node:path";
10829
10826
  var tflint = createAvailabilityChecker("tflint", ".exe");
10830
10827
  var TFLINT_CONFIG = ".tflint.hcl";
10831
10828
  function findTflintConfig(fileDir) {
10832
10829
  if (process.env.TFLINT_CONFIG_FILE)
10833
10830
  return null;
10834
10831
  const dir = findNearestDirWithAnyBasename(fileDir, [TFLINT_CONFIG]);
10835
- return dir ? path43.join(dir, TFLINT_CONFIG) : null;
10832
+ return dir ? path42.join(dir, TFLINT_CONFIG) : null;
10836
10833
  }
10837
10834
  function parseTflintOutput(raw, filePath, toolCwd) {
10838
10835
  try {
10839
10836
  const parsed = JSON.parse(raw);
10840
10837
  const issues = parsed.issues ?? [];
10841
- const absTarget = path43.resolve(toolCwd, filePath);
10838
+ const absTarget = path42.resolve(toolCwd, filePath);
10842
10839
  return issues.flatMap((issue) => {
10843
- if (issue.range?.filename && !pathsEqual(path43.resolve(toolCwd, issue.range.filename), absTarget))
10840
+ if (issue.range?.filename && !pathsEqual(path42.resolve(toolCwd, issue.range.filename), absTarget))
10844
10841
  return [];
10845
10842
  const severity = issue.rule.severity === "error" ? "error" : "warning";
10846
10843
  return [
@@ -10883,12 +10880,12 @@ var tflintRunner = {
10883
10880
  }
10884
10881
  if (!cmd)
10885
10882
  return { status: "skipped", diagnostics: [], semantic: "none" };
10886
- const absPath = path43.resolve(cwd, ctx.filePath);
10887
- const fileDir = path43.dirname(absPath);
10883
+ const absPath = path42.resolve(cwd, ctx.filePath);
10884
+ const fileDir = path42.dirname(absPath);
10888
10885
  const args = [
10889
10886
  "--format=json",
10890
10887
  "--no-color",
10891
- `--filter=${path43.basename(absPath)}`
10888
+ `--filter=${path42.basename(absPath)}`
10892
10889
  ];
10893
10890
  const configPath = findTflintConfig(fileDir);
10894
10891
  if (configPath)
@@ -10924,7 +10921,7 @@ var tflint_default = tflintRunner;
10924
10921
 
10925
10922
  // dist/clients/dispatch/runners/trivy-config.js
10926
10923
  import * as fs16 from "node:fs";
10927
- import * as path44 from "node:path";
10924
+ import * as path43 from "node:path";
10928
10925
  var trivy2 = createAvailabilityChecker("trivy", ".exe");
10929
10926
  function looksLikeKubernetesManifest(content) {
10930
10927
  for (const doc of content.split(/^---\s*$/m)) {
@@ -10961,12 +10958,12 @@ function parseTrivyConfigOutput(raw, filePath, cwd = process.cwd()) {
10961
10958
  if (!Array.isArray(results))
10962
10959
  return [];
10963
10960
  const diagnostics = [];
10964
- const absTarget = path44.resolve(cwd, filePath);
10961
+ const absTarget = path43.resolve(cwd, filePath);
10965
10962
  for (const resultEntry of results) {
10966
10963
  if (!resultEntry || typeof resultEntry !== "object")
10967
10964
  continue;
10968
10965
  const target = resultEntry.Target;
10969
- if (typeof target !== "string" || !pathsEqual(path44.resolve(cwd, target), absTarget))
10966
+ if (typeof target !== "string" || !pathsEqual(path43.resolve(cwd, target), absTarget))
10970
10967
  continue;
10971
10968
  const rows = resultEntry.Misconfigurations;
10972
10969
  if (!Array.isArray(rows))
@@ -11010,7 +11007,7 @@ var trivyConfigRunner = {
11010
11007
  if (!isTrivyEnabled(cwd)) {
11011
11008
  return { status: "skipped", diagnostics: [], semantic: "none" };
11012
11009
  }
11013
- const absPath = path44.resolve(cwd, ctx.filePath);
11010
+ const absPath = path43.resolve(cwd, ctx.filePath);
11014
11011
  if (ctx.kind === "yaml" || ctx.kind === "json") {
11015
11012
  let content = "";
11016
11013
  try {
@@ -11082,30 +11079,16 @@ var trivyConfigRunner = {
11082
11079
  var trivy_config_default = trivyConfigRunner;
11083
11080
 
11084
11081
  // dist/clients/dispatch/runners/vale.js
11085
- import * as fs17 from "node:fs";
11086
- import * as path45 from "node:path";
11082
+ import * as path44 from "node:path";
11087
11083
  var vale = createAvailabilityChecker("vale", ".exe");
11088
11084
  function findValeConfig(cwd) {
11089
- const local = path45.join(cwd, ".vale.ini");
11090
- if (fs17.existsSync(local))
11091
- return local;
11092
- let current = path45.resolve(cwd);
11093
- while (true) {
11094
- const candidate = path45.join(current, ".vale.ini");
11095
- if (fs17.existsSync(candidate))
11096
- return candidate;
11097
- const parent = path45.dirname(current);
11098
- if (parent === current)
11099
- break;
11100
- current = parent;
11101
- }
11102
- return void 0;
11085
+ return findLocalToolConfig(cwd, [".vale.ini"]);
11103
11086
  }
11104
11087
  function parseValeOutput(raw, filePath, cwd) {
11105
11088
  const diagnostics = [];
11106
11089
  if (!raw.trim())
11107
11090
  return diagnostics;
11108
- const absTarget = path45.resolve(cwd, filePath);
11091
+ const absTarget = path44.resolve(cwd, filePath);
11109
11092
  try {
11110
11093
  const parsed = JSON.parse(raw);
11111
11094
  if (!parsed || typeof parsed !== "object")
@@ -11113,7 +11096,7 @@ function parseValeOutput(raw, filePath, cwd) {
11113
11096
  for (const [reported, alerts] of Object.entries(parsed)) {
11114
11097
  if (!Array.isArray(alerts))
11115
11098
  continue;
11116
- if (reported && !pathsEqual(path45.resolve(cwd, reported), absTarget))
11099
+ if (reported && !pathsEqual(path44.resolve(cwd, reported), absTarget))
11117
11100
  continue;
11118
11101
  for (const alert of alerts) {
11119
11102
  if (!alert.Message)
@@ -11184,11 +11167,11 @@ var valeRunner = {
11184
11167
  var vale_default = valeRunner;
11185
11168
 
11186
11169
  // dist/clients/dispatch/runners/tree-sitter.js
11187
- import * as path47 from "node:path";
11170
+ import * as path46 from "node:path";
11188
11171
 
11189
11172
  // dist/clients/cache/rule-cache.js
11190
- import * as fs18 from "node:fs";
11191
- import * as path46 from "node:path";
11173
+ import * as fs17 from "node:fs";
11174
+ import * as path45 from "node:path";
11192
11175
  var CACHE_VERSION = "v7";
11193
11176
  function reportBundledRulesRootHealth() {
11194
11177
  reportBundledResourceDirHealth("tree-sitter-queries-dir-missing", BUNDLED_QUERIES_ROOT, getBundledQueriesRootHealth(), "bundled tree-sitter query rules");
@@ -11200,12 +11183,12 @@ var RuleCache = class {
11200
11183
  constructor(language, rootDir = process.cwd()) {
11201
11184
  this.language = language;
11202
11185
  reportBundledRulesRootHealth();
11203
- this.cacheDir = path46.join(getProjectDataDir(rootDir), "cache");
11204
- this.cacheFile = path46.join(this.cacheDir, `${language}-rules-${CACHE_VERSION}.json`);
11186
+ this.cacheDir = path45.join(getProjectDataDir(rootDir), "cache");
11187
+ this.cacheFile = path45.join(this.cacheDir, `${language}-rules-${CACHE_VERSION}.json`);
11205
11188
  }
11206
11189
  ensureCacheDir() {
11207
- if (!fs18.existsSync(this.cacheDir)) {
11208
- fs18.mkdirSync(this.cacheDir, { recursive: true });
11190
+ if (!fs17.existsSync(this.cacheDir)) {
11191
+ fs17.mkdirSync(this.cacheDir, { recursive: true });
11209
11192
  }
11210
11193
  }
11211
11194
  computeRuleHash(ruleFiles) {
@@ -11214,7 +11197,7 @@ var RuleCache = class {
11214
11197
  get(ruleFiles) {
11215
11198
  try {
11216
11199
  this.ensureCacheDir();
11217
- if (!fs18.existsSync(this.cacheFile))
11200
+ if (!fs17.existsSync(this.cacheFile))
11218
11201
  return null;
11219
11202
  const currentHash = this.computeRuleHash(ruleFiles);
11220
11203
  const cached = readJsonCache(this.cacheFile, (parsed) => {
@@ -11248,11 +11231,11 @@ var RuleCache = class {
11248
11231
  // on their own — nothing ever read or removed them again once the version
11249
11232
  // bumped. Delete every sibling for this language that isn't the current file.
11250
11233
  pruneStaleVersions() {
11251
- const currentName = path46.basename(this.cacheFile);
11234
+ const currentName = path45.basename(this.cacheFile);
11252
11235
  const pattern = new RegExp(`^${this.language}-rules-v\\d+\\.json$`);
11253
11236
  let dirents;
11254
11237
  try {
11255
- dirents = fs18.readdirSync(this.cacheDir);
11238
+ dirents = fs17.readdirSync(this.cacheDir);
11256
11239
  } catch {
11257
11240
  return;
11258
11241
  }
@@ -11260,15 +11243,15 @@ var RuleCache = class {
11260
11243
  if (name === currentName || !pattern.test(name))
11261
11244
  continue;
11262
11245
  try {
11263
- fs18.unlinkSync(path46.join(this.cacheDir, name));
11246
+ fs17.unlinkSync(path45.join(this.cacheDir, name));
11264
11247
  } catch {
11265
11248
  }
11266
11249
  }
11267
11250
  }
11268
11251
  clear() {
11269
11252
  try {
11270
- if (fs18.existsSync(this.cacheFile)) {
11271
- fs18.unlinkSync(this.cacheFile);
11253
+ if (fs17.existsSync(this.cacheFile)) {
11254
+ fs17.unlinkSync(this.cacheFile);
11272
11255
  }
11273
11256
  } catch {
11274
11257
  }
@@ -11582,7 +11565,7 @@ var treeSitterRunner = {
11582
11565
  return { status: "skipped", diagnostics: [], semantic: "none" };
11583
11566
  }
11584
11567
  const filePath = ctx.filePath;
11585
- const ext = path47.extname(filePath).toLowerCase();
11568
+ const ext = path46.extname(filePath).toLowerCase();
11586
11569
  const languageId = resolveTreeSitterLanguage(filePath);
11587
11570
  if (!languageId) {
11588
11571
  logTreeSitter({
@@ -11816,18 +11799,18 @@ var treeSitterRunner = {
11816
11799
  var tree_sitter_default = treeSitterRunner;
11817
11800
 
11818
11801
  // dist/clients/dispatch/runners/yamllint.js
11819
- import * as path48 from "node:path";
11802
+ import * as path47 from "node:path";
11820
11803
  var yamllint = createAvailabilityChecker("yamllint", ".exe");
11821
11804
  function parseYamllintParsable(raw, filePath, cwd) {
11822
11805
  const diagnostics = [];
11823
- const absTarget = path48.resolve(cwd, filePath);
11806
+ const absTarget = path47.resolve(cwd, filePath);
11824
11807
  for (const line of raw.split(/\r?\n/)) {
11825
11808
  if (!line.trim())
11826
11809
  continue;
11827
11810
  const match = line.match(/^(.*?):(\d+):(\d+):\s*\[(error|warning)\]\s*(.*?)\s*\(([^)]+)\)\s*$/i);
11828
11811
  if (!match)
11829
11812
  continue;
11830
- if (!pathsEqual(path48.resolve(cwd, match[1]), absTarget))
11813
+ if (!pathsEqual(path47.resolve(cwd, match[1]), absTarget))
11831
11814
  continue;
11832
11815
  const severity = match[4].toLowerCase() === "error" ? "error" : "warning";
11833
11816
  diagnostics.push({
@@ -11892,17 +11875,17 @@ var yamllintRunner = {
11892
11875
  var yamllint_default = yamllintRunner;
11893
11876
 
11894
11877
  // dist/clients/dispatch/runners/zig-check.js
11895
- import * as path49 from "node:path";
11878
+ import * as path48 from "node:path";
11896
11879
  var zig = createAvailabilityChecker("zig", ".exe", ["version"]);
11897
11880
  function parseZigOutput(raw, filePath, cwd) {
11898
11881
  const diagnostics = [];
11899
- const absTarget = path49.resolve(cwd, filePath);
11882
+ const absTarget = path48.resolve(cwd, filePath);
11900
11883
  for (const line of raw.split(/\r?\n/)) {
11901
11884
  const match = line.match(/^(.*?):(\d+):(\d+):\s*(error|warning|note):\s*(.+)$/);
11902
11885
  if (!match)
11903
11886
  continue;
11904
11887
  const [, rawFile, lineStr, colStr, level, message] = match;
11905
- if (!pathsEqual(path49.resolve(cwd, rawFile.trim()), absTarget))
11888
+ if (!pathsEqual(path48.resolve(cwd, rawFile.trim()), absTarget))
11906
11889
  continue;
11907
11890
  const severity = level === "error" ? "error" : "warning";
11908
11891
  diagnostics.push({
@@ -11933,7 +11916,7 @@ var zigCheckRunner = {
11933
11916
  return { status: "skipped", diagnostics: [], semantic: "none" };
11934
11917
  }
11935
11918
  const cmd = zig.getCommand(cwd);
11936
- const absPath = path49.resolve(cwd, ctx.filePath);
11919
+ const absPath = path48.resolve(cwd, ctx.filePath);
11937
11920
  const result = await safeSpawnAsync(cmd, ["build-exe", absPath, "-fno-emit-bin"], { cwd, timeout: 3e4 });
11938
11921
  if (result.error && !result.stdout && !result.stderr) {
11939
11922
  return { status: "skipped", diagnostics: [], semantic: "none" };
@@ -12697,7 +12680,7 @@ async function runAstGrepWarningScan(filePath, cwd, pi, logContext, facts = sess
12697
12680
  try {
12698
12681
  const group = {
12699
12682
  mode: "all",
12700
- runnerIds: ["ast-grep"],
12683
+ runnerIds: ["ast-grep-napi"],
12701
12684
  filterKinds: ["jsts"]
12702
12685
  };
12703
12686
  await runProviders(ctx);
@@ -13010,7 +12993,7 @@ function usableWarmWordIndex(index) {
13010
12993
  return index?.forward ? index : void 0;
13011
12994
  }
13012
12995
  function acquireWarmWordIndex(cwd) {
13013
- const key2 = path50.resolve(cwd);
12996
+ const key2 = path49.resolve(cwd);
13014
12997
  let entry = warmWordIndexes.get(key2);
13015
12998
  if (!entry) {
13016
12999
  const snapshot = loadProjectSnapshot(key2);
@@ -13048,7 +13031,7 @@ function adoptPublishedWarmWordIndex(cwd, published, trigger) {
13048
13031
  const index = usableWarmWordIndex(published);
13049
13032
  if (!index)
13050
13033
  return;
13051
- const key2 = path50.resolve(cwd);
13034
+ const key2 = path49.resolve(cwd);
13052
13035
  const entry = warmWordIndexes.get(key2);
13053
13036
  if (!entry || entry.index)
13054
13037
  return;
@@ -13115,7 +13098,7 @@ async function warmLspForFile(absPath, host) {
13115
13098
  return;
13116
13099
  let content;
13117
13100
  try {
13118
- content = fs19.readFileSync(absPath, "utf8");
13101
+ content = fs18.readFileSync(absPath, "utf8");
13119
13102
  } catch {
13120
13103
  return;
13121
13104
  }
@@ -13138,16 +13121,17 @@ async function warmLspForFile(absPath, host) {
13138
13121
  }
13139
13122
  }
13140
13123
  async function analyzeFile(filePath, cwd, options = {}) {
13141
- const absPath = path50.isAbsolute(filePath) ? filePath : path50.resolve(cwd, filePath);
13124
+ const absPath = path49.isAbsolute(filePath) ? filePath : path49.resolve(cwd, filePath);
13142
13125
  const host = createMcpHost({ "no-delta": true, ...options.flags }, cwd);
13143
13126
  const observedAt = Date.now();
13127
+ const analysisRootMode = resolveAnalysisRoot(absPath, cwd);
13144
13128
  if (options.warmLsp !== false) {
13145
13129
  await warmLspForFile(absPath, host);
13146
13130
  }
13147
13131
  const start = Date.now();
13148
13132
  const result = await dispatchLintWithResult(absPath, cwd, host, void 0, void 0, {
13149
13133
  blockingOnly: options.blockingOnly ?? false,
13150
- analysisRootMode: resolveAnalysisRoot(absPath, cwd),
13134
+ analysisRootMode,
13151
13135
  // #3791: this is a pull surface. Each call is an independent question,
13152
13136
  // so the synthetic coverage notice must come back on every call rather
13153
13137
  // than being latched once per session by the dispatcher — otherwise a
@@ -13164,7 +13148,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
13164
13148
  }
13165
13149
  if (options.registerTurnState) {
13166
13150
  try {
13167
- const lineCount = fs19.readFileSync(absPath, "utf8").split("\n").length;
13151
+ const lineCount = fs18.readFileSync(absPath, "utf8").split("\n").length;
13168
13152
  new CacheManager().addModifiedRange(absPath, { start: 1, end: lineCount }, true, cwd, options.ownerId ?? MCP_TURN_STATE_OWNER_ID, "mcp");
13169
13153
  } catch {
13170
13154
  }
@@ -13182,17 +13166,28 @@ async function analyzeFile(filePath, cwd, options = {}) {
13182
13166
  try {
13183
13167
  if (warmIndex) {
13184
13168
  try {
13185
- const content = fs19.readFileSync(absPath, "utf8");
13186
- const byteLength = Buffer.byteLength(content, "utf-8");
13187
- if (byteLength > WORD_INDEX_MAX_BYTES) {
13188
- await removeWordIndexDocumentAsync(warmIndex, absPath);
13189
- } else {
13190
- await updateWordIndexDocumentForEdit(warmIndex, {
13191
- path: absPath,
13192
- content
13169
+ const content = fs18.readFileSync(absPath, "utf8");
13170
+ if (!canWriteAnalysisRoot(analysisRootMode)) {
13171
+ emitBounded("adopted_root_writer_skipped", `${absPath}:word-index`, {
13172
+ filePath: absPath,
13173
+ durationMs: 0,
13174
+ metadata: { writer: "word-index" }
13175
+ }, {
13176
+ ledgerKind: "adopted-root-writer-skipped",
13177
+ risingEdgePer: "identity"
13193
13178
  });
13179
+ } else {
13180
+ const byteLength = Buffer.byteLength(content, "utf-8");
13181
+ if (byteLength > WORD_INDEX_MAX_BYTES) {
13182
+ await removeWordIndexDocumentAsync(warmIndex, absPath);
13183
+ } else {
13184
+ await updateWordIndexDocumentForEdit(warmIndex, {
13185
+ path: absPath,
13186
+ content
13187
+ });
13188
+ }
13189
+ scheduleWordIndexPersist(cwd, warmIndex);
13194
13190
  }
13195
- scheduleWordIndexPersist(cwd, warmIndex);
13196
13191
  } catch {
13197
13192
  }
13198
13193
  }
@@ -13249,6 +13244,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
13249
13244
  }
13250
13245
 
13251
13246
  export {
13247
+ DEFAULT_MAX_AGE_MS,
13252
13248
  MCP_TURN_STATE_OWNER_ID,
13253
13249
  CacheManager,
13254
13250
  getDiagnosticTracker,
@@ -13300,8 +13296,6 @@ export {
13300
13296
  evaluateAstGrepRules,
13301
13297
  runProviders,
13302
13298
  evaluateRules,
13303
- demoteInferredProjectDiagnostics,
13304
- demoteInferredProjectSweepResults,
13305
13299
  resetPsScriptAnalyzerAvailability,
13306
13300
  resetDispatchBaselines,
13307
13301
  getAvailableRunners,