pi-lens 4.4.9 → 4.4.11

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 (383) hide show
  1. package/CHANGELOG-USER.md +12 -12
  2. package/CHANGELOG.md +262 -0
  3. package/README.md +2 -0
  4. package/dist/{chunk-7YTRG6YW.js → chunk-2SD2CGVH.js} +2 -2
  5. package/dist/{chunk-CDFJF5YD.js → chunk-34RXPR7M.js} +1 -1
  6. package/dist/{chunk-XO756WE5.js → chunk-3C6ZZAB2.js} +34 -27
  7. package/dist/{chunk-MKPDIAZH.js → chunk-3HZ6MNB2.js} +1 -1
  8. package/dist/{chunk-RNXOWDM6.js → chunk-3NVGBFJS.js} +6 -6
  9. package/dist/{chunk-DGKFWQK4.js → chunk-3QCI3V6C.js} +11 -11
  10. package/dist/{chunk-NL5LSKVD.js → chunk-3R3Z54J7.js} +10 -4
  11. package/dist/{chunk-PIIUNJIT.js → chunk-43KD3PPM.js} +1 -1
  12. package/dist/{chunk-LAHHGNAY.js → chunk-4HNBY7S7.js} +20 -19
  13. package/dist/chunk-4WWPDMRA.js +22 -0
  14. package/dist/{chunk-L7O774U7.js → chunk-532X3OCZ.js} +116 -22
  15. package/dist/{chunk-ZVCDHYWZ.js → chunk-5RLEDUUE.js} +9 -9
  16. package/dist/{chunk-5YSEQHJN.js → chunk-5YTDZ5WP.js} +3 -3
  17. package/dist/{chunk-X5BJ3G2P.js → chunk-6EIV3H7O.js} +158 -61
  18. package/dist/{chunk-KV6GQOGN.js → chunk-6K4X7IIF.js} +164 -172
  19. package/dist/{chunk-HYSKJMZK.js → chunk-6RXMQYNU.js} +3 -3
  20. package/dist/{chunk-7UTSNTWM.js → chunk-6XNVY3FW.js} +10 -10
  21. package/dist/{chunk-ACRJ2GZ5.js → chunk-7424ANRU.js} +2 -2
  22. package/dist/{chunk-JUZ67QZQ.js → chunk-A4HKPAEN.js} +8 -8
  23. package/dist/{chunk-EKNYSXFB.js → chunk-AFNPNHJV.js} +8 -8
  24. package/dist/{chunk-W5E72HJA.js → chunk-AGEQRJ5A.js} +37 -11
  25. package/dist/{chunk-4ENEJHF4.js → chunk-AJ62EQIQ.js} +15 -14
  26. package/dist/{chunk-VWLSU3XV.js → chunk-AOQKQWZU.js} +14 -5
  27. package/dist/{chunk-CJS6WE66.js → chunk-AVOUHMCS.js} +111 -107
  28. package/dist/{chunk-WTB4GKMH.js → chunk-AYDE7RFV.js} +45 -5
  29. package/dist/{chunk-AWQWXSW4.js → chunk-B4FAFEBP.js} +7 -2
  30. package/dist/{chunk-SLSMJPEF.js → chunk-B4K6OSLL.js} +49 -42
  31. package/dist/{chunk-CM6BDY4E.js → chunk-BBJXIZ3X.js} +3 -3
  32. package/dist/chunk-BJDB7PXU.js +25 -0
  33. package/dist/{chunk-TOE2RRCS.js → chunk-BLL4VYGZ.js} +1 -1
  34. package/dist/{chunk-THYHUIDR.js → chunk-BMMRLJA4.js} +7 -5
  35. package/dist/{chunk-LWOM6LVS.js → chunk-BN36MQW5.js} +35 -34
  36. package/dist/{chunk-ZCQBNPRH.js → chunk-C2REOMPO.js} +2 -2
  37. package/dist/{chunk-T5QSLSMM.js → chunk-C4ICGFEO.js} +23 -23
  38. package/dist/chunk-CIA7X2PZ.js +26 -0
  39. package/dist/{chunk-VO4JFPTV.js → chunk-D5L7Q57Z.js} +2 -2
  40. package/dist/{chunk-YOXCCJDF.js → chunk-DBAHJFBU.js} +70 -64
  41. package/dist/{chunk-TMNUTMT5.js → chunk-DNB4ZQGN.js} +59 -22
  42. package/dist/chunk-DPDA3ILA.js +108 -0
  43. package/dist/{chunk-QGITU23N.js → chunk-E3PNZDPH.js} +1 -1
  44. package/dist/{chunk-QVBOXT3L.js → chunk-E6Z3CJT2.js} +13 -9
  45. package/dist/{chunk-ZDMFGACN.js → chunk-ECYUBKYX.js} +588 -566
  46. package/dist/chunk-F37CCZUA.js +27 -0
  47. package/dist/{chunk-E65WJVI5.js → chunk-FVEEEEIM.js} +10 -13
  48. package/dist/{chunk-F6BEQWAK.js → chunk-GL6J5R34.js} +5 -5
  49. package/dist/{chunk-5GEYJJHG.js → chunk-GTNO6F6K.js} +11 -10
  50. package/dist/{chunk-NMUSOZ2D.js → chunk-HASJPQBC.js} +10 -10
  51. package/dist/{chunk-XVB3Q2PG.js → chunk-HGEE5LDW.js} +3 -2
  52. package/dist/{chunk-XKFO2SZV.js → chunk-HIUVHRLM.js} +35 -34
  53. package/dist/{chunk-PRHYIA6X.js → chunk-HTUG7ZFK.js} +8 -8
  54. package/dist/{chunk-HEA3EM23.js → chunk-IBEYUBCM.js} +9 -9
  55. package/dist/{chunk-WSSLVMDA.js → chunk-IJ55MYO6.js} +15 -12
  56. package/dist/{chunk-MRLH4MYU.js → chunk-IT7MFVGP.js} +2 -2
  57. package/dist/{chunk-MQ4PPCJB.js → chunk-ITAPXBIB.js} +42 -43
  58. package/dist/{chunk-RNJFRXEN.js → chunk-JSQK5DH3.js} +4 -4
  59. package/dist/{chunk-VCRVNLE7.js → chunk-K2GV34T2.js} +9 -1
  60. package/dist/{chunk-3NPWO5UO.js → chunk-KBSC5Z3G.js} +9 -8
  61. package/dist/{chunk-PXQ45SGD.js → chunk-KDGKKK7A.js} +2 -2
  62. package/dist/{chunk-SIQHOB6P.js → chunk-KDMJ2DJD.js} +11 -11
  63. package/dist/{chunk-RTFMDIKV.js → chunk-KNP4ENFT.js} +1 -1
  64. package/dist/chunk-KX4DF6XX.js +25 -0
  65. package/dist/{chunk-ZZN74OGD.js → chunk-LHCDWFDB.js} +37 -144
  66. package/dist/{chunk-N5CEGQPG.js → chunk-LHU6NG5Z.js} +16 -15
  67. package/dist/{chunk-G22UNQID.js → chunk-LIDFFCZZ.js} +17 -15
  68. package/dist/{chunk-NOWH2VA2.js → chunk-LPM6NKVI.js} +7 -7
  69. package/dist/{chunk-KXMJLOZF.js → chunk-LXE7JAMV.js} +37 -26
  70. package/dist/{chunk-47UCC4MM.js → chunk-ME6MF2N2.js} +1 -1
  71. package/dist/{chunk-V67D6TMU.js → chunk-NLRKB32C.js} +7 -7
  72. package/dist/{chunk-2VZ3VN3N.js → chunk-NQFXN5U7.js} +2 -2
  73. package/dist/{chunk-IILEH3ZC.js → chunk-NR4KQOXZ.js} +14 -9
  74. package/dist/{chunk-UXTQ3QPD.js → chunk-NWK7KKNO.js} +4 -4
  75. package/dist/{chunk-ZMMHHXSW.js → chunk-O6LCSHHI.js} +2 -1
  76. package/dist/{chunk-ZZSJAR76.js → chunk-OC4ZGVMH.js} +33 -17
  77. package/dist/{chunk-L6WBJGQS.js → chunk-OP5BMZKK.js} +3 -3
  78. package/dist/{chunk-MN635QYA.js → chunk-OYXD2MOM.js} +3 -3
  79. package/dist/{chunk-OSEKJEUU.js → chunk-PSUXESQ5.js} +41 -4
  80. package/dist/{chunk-6GPB3JLL.js → chunk-QAM2Q3VO.js} +3 -3
  81. package/dist/{chunk-OUYAUXAT.js → chunk-QBUSONNE.js} +518 -191
  82. package/dist/{chunk-PBZNYHMM.js → chunk-QDZ3ZZMY.js} +18 -66
  83. package/dist/{chunk-LT62P654.js → chunk-QJ4T73J5.js} +1 -1
  84. package/dist/{chunk-XLAI7UYY.js → chunk-QUZYRDT6.js} +12 -12
  85. package/dist/{chunk-QP33NKYC.js → chunk-R2UF54ON.js} +17 -15
  86. package/dist/{chunk-V2WDBOLZ.js → chunk-R2VUZZPJ.js} +11 -10
  87. package/dist/chunk-R5BNSOIV.js +29 -0
  88. package/dist/chunk-RV5VX2XW.js +29 -0
  89. package/dist/{chunk-FGNSESAC.js → chunk-SQBDX6IO.js} +12 -12
  90. package/dist/{chunk-CZCAZVTD.js → chunk-SRXYSLMW.js} +2 -2
  91. package/dist/{chunk-J3Q2NYJR.js → chunk-SUIZOCSY.js} +3 -2
  92. package/dist/{chunk-NUSXS6YB.js → chunk-T5EGSBM2.js} +4 -4
  93. package/dist/{chunk-FRUBVFXV.js → chunk-TBE4OLPA.js} +37 -35
  94. package/dist/{chunk-GQTQUNCG.js → chunk-TPMBNWHO.js} +28 -26
  95. package/dist/{chunk-IICERRFF.js → chunk-TRYOYWWU.js} +18 -12
  96. package/dist/{chunk-3HTZDY3C.js → chunk-TTGDTNSN.js} +6 -6
  97. package/dist/{chunk-NCLO6E6N.js → chunk-UELHWF5I.js} +139 -135
  98. package/dist/chunk-UG4YLCJ5.js +58 -0
  99. package/dist/chunk-UQ6OZYTO.js +91 -0
  100. package/dist/{chunk-L4Y3ROKQ.js → chunk-UY3WWW5R.js} +4 -4
  101. package/dist/chunk-V7IPIAE5.js +74 -0
  102. package/dist/{chunk-C3YRO3EU.js → chunk-VDMF7Q2P.js} +10 -10
  103. package/dist/{chunk-N56BNAA6.js → chunk-VI3BJMZO.js} +35 -34
  104. package/dist/{chunk-EY6LY2HO.js → chunk-VTXJAO5R.js} +34 -35
  105. package/dist/chunk-W6VLB6LL.js +145 -0
  106. package/dist/{chunk-AACN5GNE.js → chunk-WBXCIRVI.js} +21 -2
  107. package/dist/{chunk-CB7PEVOJ.js → chunk-WLD6BGON.js} +176 -60
  108. package/dist/{chunk-ZPM7ZIFL.js → chunk-WMCAEP2K.js} +11 -8
  109. package/dist/{chunk-H3BVMK47.js → chunk-WXMUGUZV.js} +21 -25
  110. package/dist/{chunk-QB7T2PHK.js → chunk-X33QECRJ.js} +4 -2
  111. package/dist/{chunk-7R5GZIA6.js → chunk-YUF4DRYB.js} +399 -308
  112. package/dist/{chunk-HSOBIN22.js → chunk-YVPB5YGO.js} +2 -2
  113. package/dist/{chunk-W7TY6HYX.js → chunk-ZRQMENT4.js} +5 -27
  114. package/dist/index.js +6100 -4440
  115. package/dist/mcp/analyze-cli.js +17 -11
  116. package/dist/mcp/cli.js +43 -42
  117. package/dist/mcp/server.js +1534 -623
  118. package/dist/mcp/worker.js +62 -59
  119. package/dist/probes/installer.js +19 -18
  120. package/docs/agent-guide.md +5 -2
  121. package/docs/agent-tools.md +17 -4
  122. package/docs/alignment-families.md +5 -1
  123. package/docs/ci.md +120 -0
  124. package/docs/configuration.md +30 -7
  125. package/docs/custom-rules.md +1 -0
  126. package/docs/defect-shapes.md +122 -72
  127. package/docs/durable-store-audit-1202.md +1 -1
  128. package/docs/engineering-principles.md +46 -12
  129. package/docs/environment-variables.md +25 -2
  130. package/docs/features.md +12 -2
  131. package/docs/globalconfig.md +13 -0
  132. package/docs/invariants/dispatch-runners.md +13 -0
  133. package/docs/invariants/language-config.md +9 -1
  134. package/docs/language-coverage.md +67 -1
  135. package/docs/lsp-capability-matrix.md +68 -23
  136. package/docs/lsp-idle-eviction.md +17 -13
  137. package/docs/module-report-read-symbol.md +2 -2
  138. package/docs/pi-lens-fixer.md +11 -8
  139. package/docs/pi-lens-merge-policy.md +6 -1
  140. package/docs/pi-lens-monitor.md +4 -1
  141. package/docs/pi-lens-release.md +22 -2
  142. package/docs/pi-lens-reviewer.md +60 -13
  143. package/docs/public-api-stability.md +41 -6
  144. package/docs/rfcs/5138-query-surface.md +121 -0
  145. package/docs/servercapabilities.md +1 -1
  146. package/docs/settings.md +16 -4
  147. package/docs/usage.md +1 -0
  148. package/docs/word-index.md +9 -10
  149. package/package.json +4 -4
  150. package/rules/ast-grep-rules/coderabbit/README.md +2 -0
  151. package/rules/ast-grep-rules/coderabbit/rules/c/security/dont-call-system-c.yml +2 -1
  152. package/rules/ast-grep-rules/coderabbit/rules/c/security/file-access-before-action-c.yml +2 -1
  153. package/rules/ast-grep-rules/coderabbit/rules/c/security/file-stat-before-action-c.yml +2 -1
  154. package/rules/ast-grep-rules/coderabbit/rules/c/security/insecure-hash-c.yml +2 -1
  155. package/rules/ast-grep-rules/coderabbit/rules/c/security/libxml2-audit-parser-c.yml +2 -1
  156. package/rules/ast-grep-rules/coderabbit/rules/c/security/null-library-function-c.yml +2 -1
  157. package/rules/ast-grep-rules/coderabbit/rules/c/security/sizeof-this-c.yml +2 -1
  158. package/rules/ast-grep-rules/coderabbit/rules/c/security/small-key-size-c.yml +2 -1
  159. package/rules/ast-grep-rules/coderabbit/rules/c/security/world-writable-file-c.yml +2 -1
  160. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/dont-call-system-cpp.yml +2 -1
  161. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/file-access-before-action-cpp.yml +2 -1
  162. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/file-stat-before-action-cpp.yml +2 -1
  163. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/fix-format-security-error-cpp.yml +2 -1
  164. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/insecure-hash-cpp.yml +2 -1
  165. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/libxml2-audit-parser-cpp.yml +2 -1
  166. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/missing-nul-cpp-string-memcpy-cpp.yml +2 -1
  167. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/null-library-function-cpp.yml +2 -1
  168. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/return-c-str-cpp.yml +2 -1
  169. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/sizeof-this-cpp.yml +2 -1
  170. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/small-key-size-cpp.yml +2 -1
  171. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/std-return-data-cpp.yml +2 -1
  172. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/std-vector-invalidation-cpp.yml +2 -1
  173. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/string-view-temporary-string-cpp.yml +2 -1
  174. package/rules/ast-grep-rules/coderabbit/rules/cpp/security/world-writable-file-cpp.yml +2 -1
  175. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/httponly-false-csharp.yml +2 -1
  176. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/insecure-binaryformatter-deserialization-csharp.yml +2 -1
  177. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/jwt-decode-without-verify-csharp.yml +2 -1
  178. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/jwt-hardcoded-secret-csharp.yml +2 -1
  179. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/jwt-tokenvalidationparameters-no-expiry-validation-csharp.yml +2 -1
  180. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/networkcredential-hardcoded-secret-python.yml +2 -1
  181. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/npgsqlconnectionstringbuilder-hardcoded-secret-csharp.yml +2 -1
  182. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/oracleconnectionstringbuilder-hardcoded-secret-csharp.yml +2 -1
  183. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/sqlconnectionstringbuilder-hardcoded-secret-csharp.yml +2 -1
  184. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/stacktrace-disclosure-csharp.yml +2 -1
  185. package/rules/ast-grep-rules/coderabbit/rules/csharp/security/use-ecb-mode-csharp.yml +2 -1
  186. package/rules/ast-grep-rules/coderabbit/rules/go/security/avoid-bind-to-all-interfaces-go.yml +2 -1
  187. package/rules/ast-grep-rules/coderabbit/rules/go/security/gorilla-cookie-store-hardcoded-session-key-go.yml +2 -1
  188. package/rules/ast-grep-rules/coderabbit/rules/go/security/gorilla-csrf-hardcoded-auth-key-go.yml +2 -1
  189. package/rules/ast-grep-rules/coderabbit/rules/go/security/grpc-client-insecure-connection-go.yml +2 -1
  190. package/rules/ast-grep-rules/coderabbit/rules/go/security/jwt-go-none-algorithm-go.yml +2 -1
  191. package/rules/ast-grep-rules/coderabbit/rules/go/security/missing-ssl-minversion-go.yml +2 -1
  192. package/rules/ast-grep-rules/coderabbit/rules/go/security/openai-empty-secret-go.yml +2 -1
  193. package/rules/ast-grep-rules/coderabbit/rules/go/security/openai-hardcoded-secret-go.yml +2 -1
  194. package/rules/ast-grep-rules/coderabbit/rules/go/security/ssl-v3-is-insecure-go.yml +2 -1
  195. package/rules/ast-grep-rules/coderabbit/rules/go/security/tls-with-insecure-cipher-go.yml +2 -1
  196. package/rules/ast-grep-rules/coderabbit/rules/go/security/use-of-weak-rsa-key-go.yml +2 -1
  197. package/rules/ast-grep-rules/coderabbit/rules/html/security/plaintext-http-link-html.yml +2 -1
  198. package/rules/ast-grep-rules/coderabbit/rules/java/security/cbc-padding-oracle-java.yml +2 -1
  199. package/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-httponly-false-java.yml +2 -1
  200. package/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-missing-httponly-java.yml +2 -1
  201. package/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-missing-samesite-java.yml +2 -1
  202. package/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-missing-secure-flag-java.yml +2 -1
  203. package/rules/ast-grep-rules/coderabbit/rules/java/security/cookie-secure-flag-false-java.yml +2 -1
  204. package/rules/ast-grep-rules/coderabbit/rules/java/security/datanucleus-hardcoded-connection-password-java.yml +2 -1
  205. package/rules/ast-grep-rules/coderabbit/rules/java/security/des-is-deprecated-java.yml +2 -1
  206. package/rules/ast-grep-rules/coderabbit/rules/java/security/desede-is-deprecated-java.yml +2 -1
  207. package/rules/ast-grep-rules/coderabbit/rules/java/security/documentbuilderfactory-disallow-doctype-decl-false-java.yml +2 -1
  208. package/rules/ast-grep-rules/coderabbit/rules/java/security/documentbuilderfactory-external-general-entities-true-java.yml +2 -1
  209. package/rules/ast-grep-rules/coderabbit/rules/java/security/documentbuilderfactory-external-parameter-entities-true-java.yml +2 -1
  210. package/rules/ast-grep-rules/coderabbit/rules/java/security/drivermanager-hardcoded-secret-java.yml +2 -1
  211. package/rules/ast-grep-rules/coderabbit/rules/java/security/ecb-cipher-java.yml +2 -1
  212. package/rules/ast-grep-rules/coderabbit/rules/java/security/hardcoded-connection-password-java.yml +2 -1
  213. package/rules/ast-grep-rules/coderabbit/rules/java/security/hardcoded-secret-in-credentials-java.yml +2 -1
  214. package/rules/ast-grep-rules/coderabbit/rules/java/security/java-jwt-hardcoded-secret-java.yml +2 -1
  215. package/rules/ast-grep-rules/coderabbit/rules/java/security/jedis-jedisclientconfig-hardcoded-password-java.yml +2 -1
  216. package/rules/ast-grep-rules/coderabbit/rules/java/security/jedis-jedisfactory-hardcoded-password-java.yml +2 -1
  217. package/rules/ast-grep-rules/coderabbit/rules/java/security/missing-httponly-java.yml +2 -1
  218. package/rules/ast-grep-rules/coderabbit/rules/java/security/missing-secure-java.yml +2 -1
  219. package/rules/ast-grep-rules/coderabbit/rules/java/security/no-null-cipher-java.yml +2 -1
  220. package/rules/ast-grep-rules/coderabbit/rules/java/security/passwordauthentication-hardcoded-password-java.yml +2 -1
  221. package/rules/ast-grep-rules/coderabbit/rules/java/security/rsa-no-padding-java.yml +2 -1
  222. package/rules/ast-grep-rules/coderabbit/rules/java/security/simple-command-injection-direct-input-java.yml +2 -1
  223. package/rules/ast-grep-rules/coderabbit/rules/java/security/system-setproperty-hardcoded-secret-java.yml +2 -1
  224. package/rules/ast-grep-rules/coderabbit/rules/java/security/unencrypted-socket-java.yml +2 -1
  225. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-aes-ecb-java.yml +2 -1
  226. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-blowfish-java.yml +2 -1
  227. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-default-aes-java.yml +2 -1
  228. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-md5-digest-utils-java.yml +2 -1
  229. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-md5-java.yml +2 -1
  230. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-rc2-java.yml +2 -1
  231. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-rc4-java.yml +2 -1
  232. package/rules/ast-grep-rules/coderabbit/rules/java/security/use-of-sha1-java.yml +2 -1
  233. package/rules/ast-grep-rules/coderabbit/rules/java/security/weak-ssl-context-java.yml +2 -1
  234. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/detect-angular-sce-disabled-javascript.yml +2 -1
  235. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/express-jwt-hardcoded-secret-javascript.yml +2 -1
  236. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/express-session-hardcoded-secret-javascript.yml +2 -1
  237. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/jwt-simple-noverify-javascript.yml +2 -1
  238. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/node-rsa-weak-key-javascript.yml +2 -1
  239. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/node-sequelize-empty-password-argument-javascript.yml +2 -1
  240. package/rules/ast-grep-rules/coderabbit/rules/javascript/security/node-sequelize-hardcoded-secret-argument-javascript.yml +2 -1
  241. package/rules/ast-grep-rules/coderabbit/rules/kotlin/security/des-is-deprecated-kotlin.yml +2 -1
  242. package/rules/ast-grep-rules/coderabbit/rules/kotlin/security/desede-is-deprecated-kotlin.yml +2 -1
  243. package/rules/ast-grep-rules/coderabbit/rules/kotlin/security/jwt-hardcode-kotlin.yml +2 -1
  244. package/rules/ast-grep-rules/coderabbit/rules/kotlin/security/rsa-no-padding-kotlin.yml +2 -1
  245. package/rules/ast-grep-rules/coderabbit/rules/kotlin/security/system-setproperty-hardcoded-secret-kotlin.yml +2 -1
  246. package/rules/ast-grep-rules/coderabbit/rules/php/security/openssl-cbc-static-iv-php.yml +2 -1
  247. package/rules/ast-grep-rules/coderabbit/rules/php/security/search-active-debug-php.yml +2 -1
  248. package/rules/ast-grep-rules/coderabbit/rules/python/security/avoid-mktemp-python.yml +2 -1
  249. package/rules/ast-grep-rules/coderabbit/rules/python/security/avoid_app_run_with_bad_host-python.yml +2 -1
  250. package/rules/ast-grep-rules/coderabbit/rules/python/security/debug-enabled-python.yml +2 -1
  251. package/rules/ast-grep-rules/coderabbit/rules/python/security/hashids-with-django-secret-python.yml +2 -1
  252. package/rules/ast-grep-rules/coderabbit/rules/python/security/hashids-with-flask-secret-python.yml +2 -1
  253. package/rules/ast-grep-rules/coderabbit/rules/python/security/insecure-cipher-algorithm-rc4-python.yml +2 -1
  254. package/rules/ast-grep-rules/coderabbit/rules/python/security/jwt-python-hardcoded-secret-python.yml +2 -1
  255. package/rules/ast-grep-rules/coderabbit/rules/python/security/openai-hardcoded-secret-python.yml +2 -1
  256. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-cassandra-empty-password-python.yml +2 -1
  257. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-cassandra-hardcoded-secret-python.yml +2 -1
  258. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-couchbase-empty-password-python.yml +2 -1
  259. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-couchbase-hardcoded-secret-python.yml +2 -1
  260. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-elasticsearch-hardcoded-bearer-auth-python.yml +2 -1
  261. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-ldap3-empty-password-python.yml +2 -1
  262. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-ldap3-hardcoded-secret-python.yml +2 -1
  263. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-mariadb-empty-password-python.yml +2 -1
  264. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-mariadb-hardcoded-secret-python.yml +2 -1
  265. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysql-empty-password-python.yml +2 -1
  266. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysql-hardcoded-secret-python.yml +2 -1
  267. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysqlclient-empty-password-python.yml +2 -1
  268. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-mysqlclient-hardcoded-secret-python.yml +2 -1
  269. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-neo4j-empty-password-python.yml +2 -1
  270. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-neo4j-hardcoded-secret-python.yml +2 -1
  271. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-mysql-empty-password-python.yml +2 -1
  272. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-mysql-hardcoded-secret-python.yml +2 -1
  273. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-pg-empty-password-python.yml +2 -1
  274. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-peewee-pg-hardcoded-secret-python.yml +2 -1
  275. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pg8000-empty-password-python.yml +2 -1
  276. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pg8000-hardcoded-secret-python.yml +2 -1
  277. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-psycopg2-empty-password-python.yml +2 -1
  278. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-psycopg2-hardcoded-secret-python.yml +2 -1
  279. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pyjwt-hardcoded-secret-python.yml +2 -1
  280. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymongo-empty-password-python.yml +2 -1
  281. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymongo-hardcoded-secret-python.yml +2 -1
  282. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymssql-empty-password-python.yml +2 -1
  283. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymssql-hardcoded-secret-python.yml +2 -1
  284. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymysql-empty-password-python.yml +2 -1
  285. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-pymysql-hardcoded-secret-python.yml +2 -1
  286. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-redis-empty-password-python.yml +2 -1
  287. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-redis-hardcoded-secret-python.yml +2 -1
  288. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-requests-empty-password-python.yml +2 -1
  289. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-requests-hardcoded-secret-python.yml +2 -1
  290. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-requests-oauth-hardcoded-secret-python.yml +2 -1
  291. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-tormysql-empty-password-python.yml +2 -1
  292. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-tormysql-hardcoded-secret-python.yml +2 -1
  293. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-urllib3-hardcoded-secret-python.yml +2 -1
  294. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-webrepl-empty-password-python.yml +2 -1
  295. package/rules/ast-grep-rules/coderabbit/rules/python/security/python-webrepl-hardcoded-secret-python.yml +2 -1
  296. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/force-ssl-false-ruby.yml +2 -1
  297. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/hardcoded-http-auth-in-controller-ruby.yml +2 -1
  298. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/hardcoded-secret-rsa-passphrase-ruby.yml +2 -1
  299. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/insufficient-rsa-key-size-ruby.yml +2 -1
  300. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-aws-sdk-hardcoded-secret-ruby.yml +2 -1
  301. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-cassandra-empty-password-ruby.yml +2 -1
  302. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-cassandra-hardcoded-secret-ruby.yml +2 -1
  303. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-excon-hardcoded-secret-ruby.yml +2 -1
  304. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-faraday-hardcoded-secret-ruby.yml +2 -1
  305. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mongo-empty-password-ruby.yml +2 -1
  306. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mongo-hardcoded-secret-ruby.yml +2 -1
  307. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mysql2-empty-password-ruby.yml +2 -1
  308. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-mysql2-hardcoded-secret-ruby.yml +2 -1
  309. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-octokit-hardcoded-secret-ruby.yml +2 -1
  310. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-pg-empty-password-ruby.yml +2 -1
  311. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-pg-hardcoded-secret-ruby.yml +2 -1
  312. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-redis-empty-password-ruby.yml +2 -1
  313. package/rules/ast-grep-rules/coderabbit/rules/ruby/security/ruby-redis-hardcoded-secret-ruby.yml +2 -1
  314. package/rules/ast-grep-rules/coderabbit/rules/rust/security/empty-password-rust.yml +2 -1
  315. package/rules/ast-grep-rules/coderabbit/rules/rust/security/hardcoded-password-rust.yml +2 -1
  316. package/rules/ast-grep-rules/coderabbit/rules/rust/security/postgres-empty-password-rust.yml +2 -1
  317. package/rules/ast-grep-rules/coderabbit/rules/rust/security/reqwest-accept-invalid-rust.yml +2 -1
  318. package/rules/ast-grep-rules/coderabbit/rules/rust/security/secrets-reqwest-hardcoded-auth-rust.yml +2 -1
  319. package/rules/ast-grep-rules/coderabbit/rules/rust/security/ssl-verify-none-rust.yml +2 -1
  320. package/rules/ast-grep-rules/coderabbit/rules/rust/security/tokio-postgres-empty-password-rust.yml +2 -1
  321. package/rules/ast-grep-rules/coderabbit/rules/rust/security/tokio-postgres-hardcoded-password-rust.yml +2 -1
  322. package/rules/ast-grep-rules/coderabbit/rules/scala/security/jwt-scala-hardcode-scala.yml +2 -1
  323. package/rules/ast-grep-rules/coderabbit/rules/scala/security/scala-jwt-hardcoded-secret-scala.yml +2 -1
  324. package/rules/ast-grep-rules/coderabbit/rules/swift/security/aes-hardcoded-secret-swift.yml +2 -1
  325. package/rules/ast-grep-rules/coderabbit/rules/swift/security/blowfish-hardcoded-secret-swift.yml +2 -1
  326. package/rules/ast-grep-rules/coderabbit/rules/swift/security/chacha20-hardcoded-secret-swift.yml +2 -1
  327. package/rules/ast-grep-rules/coderabbit/rules/swift/security/insecure-biometrics-swift.yml +2 -1
  328. package/rules/ast-grep-rules/coderabbit/rules/swift/security/rabbit-hardcoded-secret-swift.yml +2 -1
  329. package/rules/ast-grep-rules/coderabbit/rules/typescript/security/detect-angular-sce-disabled-typescript.yml +2 -1
  330. package/rules/ast-grep-rules/coderabbit/rules/typescript/security/express-session-hardcoded-secret-typescript.yml +2 -1
  331. package/rules/ast-grep-rules/coderabbit/rules/typescript/security/jwt-simple-noverify-typescript.yml +2 -1
  332. package/rules/ast-grep-rules/coderabbit/rules/typescript/security/node-rsa-weak-key-typescript.yml +2 -1
  333. package/rules/ast-grep-rules/coderabbit/rules/typescript/security/node-sequelize-empty-password-argument-typescript.yml +2 -1
  334. package/rules/ast-grep-rules/coderabbit/rules/typescript/security/node-sequelize-hardcoded-secret-argument-typescript.yml +2 -1
  335. package/rules/ast-grep-rules/rule-schema.json +1 -1
  336. package/rules/ast-grep-rules/rules/c-no-malloc-free.yml +13 -12
  337. package/rules/ast-grep-rules/rules/cpp-no-malloc-free.yml +11 -10
  338. package/rules/ast-grep-rules/rules/cpp-no-printf.yml +10 -9
  339. package/rules/ast-grep-rules/rules/go-defer-func-call-antipattern.yml +14 -13
  340. package/rules/ast-grep-rules/rules/go-no-fmt-println.yml +14 -13
  341. package/rules/ast-grep-rules/rules/go-no-panic-in-lib.yml +20 -19
  342. package/rules/ast-grep-rules/rules/go-no-underscore-func-name.yml +14 -13
  343. package/rules/ast-grep-rules/rules/go-prefer-errors-is.yml +14 -13
  344. package/rules/ast-grep-rules/rules/go-prefer-string-builder.yml +19 -18
  345. package/rules/ast-grep-rules/rules/go-test-functions.yml +14 -13
  346. package/rules/ast-grep-rules/rules/hyphenated-svg-attribute.yml +10 -9
  347. package/rules/ast-grep-rules/rules/kotlin-no-lateinit.yml +12 -11
  348. package/rules/ast-grep-rules/rules/kotlin-no-nullable-boolean.yml +11 -10
  349. package/rules/ast-grep-rules/rules/kotlin-no-println.yml +15 -14
  350. package/rules/ast-grep-rules/rules/kotlin-no-unnecessary-let.yml +10 -9
  351. package/rules/ast-grep-rules/rules/kotlin-no-unsafe-cast.yml +10 -9
  352. package/rules/ast-grep-rules/rules/kotlin-no-var.yml +11 -10
  353. package/rules/ast-grep-rules/rules/kotlin-prefer-data-class.yml +10 -9
  354. package/rules/ast-grep-rules/rules/kotlin-prefer-is-empty.yml +10 -9
  355. package/rules/ast-grep-rules/rules/no-aws-access-key-literal.yml +1 -1
  356. package/rules/ast-grep-rules/rules/no-compile-call.yml +13 -12
  357. package/rules/ast-grep-rules/rules/no-flask-secret-key-literal.yml +1 -1
  358. package/rules/ast-grep-rules/rules/no-hardcoded-password.yml +1 -1
  359. package/rules/ast-grep-rules/rules/no-marshal-load.yml +12 -11
  360. package/rules/ast-grep-rules/rules/no-python-sql-string-concat.yml +12 -11
  361. package/rules/ast-grep-rules/rules/no-requests-verify-false.yml +13 -12
  362. package/rules/ast-grep-rules/rules/no-secret-in-env-var-name.yml +1 -1
  363. package/rules/ast-grep-rules/rules/python-optional-type.yml +9 -8
  364. package/rules/ast-grep-rules/rules/reducible-list-comprehension.yml +8 -7
  365. package/rules/ast-grep-rules/rules/ruby-detect-path-traversal.yml +14 -13
  366. package/rules/ast-grep-rules/rules/ruby-symbol-to-proc-candidate.yml +8 -7
  367. package/rules/ast-grep-rules/rules/rust-no-chars-enumerate.yml +9 -8
  368. package/rules/ast-grep-rules/rules-disabled/gorm-unbounded-preload.yml +7 -6
  369. package/rules/ast-grep-rules/rules-disabled/shadow-err-variable.yml +6 -5
  370. package/scripts/analyze-pi-lens-logs.mjs +262 -3
  371. package/scripts/download-grammars.js +10 -0
  372. package/scripts/grammars.lock.json +7 -0
  373. package/scripts/lib/latency-log-phases.mjs +125 -0
  374. package/vendor/grammars/tree-sitter-groovy.wasm +0 -0
  375. package/dist/chunk-H6FLQ5NW.js +0 -28
  376. package/dist/chunk-KR5VGMVT.js +0 -25
  377. package/dist/chunk-Q6JQKWPK.js +0 -25
  378. package/dist/chunk-QJJKOHLH.js +0 -57
  379. package/dist/chunk-TGQDAG4B.js +0 -88
  380. package/dist/chunk-TYHPVE5H.js +0 -25
  381. package/dist/chunk-UAKO2M6B.js +0 -73
  382. package/dist/chunk-UC5AXW5Z.js +0 -20
  383. package/dist/chunk-UTJP6WOS.js +0 -28
@@ -2,51 +2,35 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  getLazyInstallAttempt,
4
4
  tryLazyInstall
5
- } from "./chunk-F6BEQWAK.js";
5
+ } from "./chunk-GL6J5R34.js";
6
6
  import {
7
7
  computeImpactCascade
8
- } from "./chunk-HYSKJMZK.js";
8
+ } from "./chunk-6RXMQYNU.js";
9
9
  import {
10
10
  goClient
11
- } from "./chunk-2VZ3VN3N.js";
11
+ } from "./chunk-NQFXN5U7.js";
12
12
  import {
13
13
  isTrivyEnabled,
14
14
  resolveSeverityFloor
15
- } from "./chunk-H3BVMK47.js";
15
+ } from "./chunk-WXMUGUZV.js";
16
16
  import {
17
- IN_FLIGHT_REASON,
18
- NO_ANALYZER_REASON,
19
- checkedVerdict,
20
- emptyDispatchResult,
21
17
  faultIfCutShort,
22
- faultResult,
23
- faultSkip,
24
- findingsResult,
25
18
  finishParsedRun,
26
19
  formatToolFailure,
27
- isNotApplicableSkipReason,
28
- isRunnerClaimSource,
29
- isRunnerSkipReason,
30
- noPrimaryCheckerReason,
31
20
  parseToolRun,
32
21
  processCutShort,
33
- reachedNoVerdict,
34
22
  skipUnlessToolRan,
35
- spanOverlapsModifiedRanges,
36
23
  spawnFailedWithNoOutput,
37
- unchecked,
38
- widgetUncheckedReason
39
- } from "./chunk-ZZN74OGD.js";
24
+ spawnTimedOut
25
+ } from "./chunk-LHCDWFDB.js";
40
26
  import {
41
27
  rustClient
42
- } from "./chunk-PXQ45SGD.js";
28
+ } from "./chunk-KDGKKK7A.js";
43
29
  import {
44
30
  coveringLaneAvailable,
45
31
  createAvailabilityChecker,
46
32
  createCwdCachedProbe,
47
- getDispatchAvailabilityGeneration,
48
33
  lspPrimaryCoversFile,
49
- recordAvailabilityProbeOverrun,
50
34
  resolveAdoptedRootCommand,
51
35
  resolveAvailableOrInstall,
52
36
  resolveCommandArgsWithInstallFallback,
@@ -55,10 +39,11 @@ import {
55
39
  resolveToolCommand,
56
40
  resolveToolCommandWithInstallFallback,
57
41
  resolveVendorToolCommand
58
- } from "./chunk-NCLO6E6N.js";
42
+ } from "./chunk-UELHWF5I.js";
59
43
  import {
60
44
  biomeConfigArgs,
61
45
  findCompiledClassesDir,
46
+ findToolConfig,
62
47
  getAutofixCapability,
63
48
  getJstsLintPolicyForCwd,
64
49
  getLinterPolicyForCwd,
@@ -70,25 +55,27 @@ import {
70
55
  hasPhpstanConfig,
71
56
  hasSqlfluffConfig,
72
57
  hasStylelintConfig,
58
+ hasToolConfig,
73
59
  hasVitePlusConfig,
74
60
  hasYamllintConfig,
75
61
  markdownlintConfigArgs,
62
+ readFileContent,
76
63
  ruffConfigArgs
77
- } from "./chunk-7R5GZIA6.js";
64
+ } from "./chunk-YUF4DRYB.js";
78
65
  import {
79
66
  importFactProvider
80
- } from "./chunk-UXTQ3QPD.js";
67
+ } from "./chunk-NWK7KKNO.js";
81
68
  import {
82
69
  functionFactProvider
83
- } from "./chunk-CM6BDY4E.js";
70
+ } from "./chunk-BBJXIZ3X.js";
84
71
  import {
85
72
  extractFactsFromTree
86
- } from "./chunk-TOE2RRCS.js";
73
+ } from "./chunk-BLL4VYGZ.js";
87
74
  import {
88
75
  buildOrUpdateGraph,
89
76
  clearReviewGraphWorkspaceCache,
90
77
  fileContentProvider
91
- } from "./chunk-XO756WE5.js";
78
+ } from "./chunk-3C6ZZAB2.js";
92
79
  import {
93
80
  MAX_BLOCKING_RULE_COMPLEXITY,
94
81
  PRIMARY_UNAVAILABLE_CAUSE,
@@ -121,14 +108,17 @@ import {
121
108
  retagAuxiliaryDiagnostics,
122
109
  touchCompletedConfirmationPolicy,
123
110
  touchCoverageGap,
111
+ trustedCitedOwnerContent,
124
112
  tryWarmAttachedCodeActions,
125
113
  tryWarmAttachedDiagnostics,
126
114
  warmAnswerBinding
127
- } from "./chunk-OUYAUXAT.js";
115
+ } from "./chunk-QBUSONNE.js";
128
116
  import {
129
117
  ANY_POSITION,
118
+ displayedMessage,
119
+ hashText,
130
120
  retainRecordedFindings
131
- } from "./chunk-VWLSU3XV.js";
121
+ } from "./chunk-AOQKQWZU.js";
132
122
  import {
133
123
  mapWithConcurrency
134
124
  } from "./chunk-XIMYZ3JA.js";
@@ -144,7 +134,7 @@ import {
144
134
  resolveSessionConfigRoot,
145
135
  resolveShellFileDialect,
146
136
  runnerIdentityPopulated
147
- } from "./chunk-YOXCCJDF.js";
137
+ } from "./chunk-DBAHJFBU.js";
148
138
  import {
149
139
  augmentPythonEnvironment,
150
140
  describePythonCompileWithheld,
@@ -153,25 +143,25 @@ import {
153
143
  emitBounded,
154
144
  partitionOutrankedPythonCompileVerdicts,
155
145
  recordPythonCompileVerdictDrop
156
- } from "./chunk-V67D6TMU.js";
146
+ } from "./chunk-NLRKB32C.js";
157
147
  import {
158
148
  scannerReportParentDir
159
- } from "./chunk-LT62P654.js";
149
+ } from "./chunk-QJ4T73J5.js";
160
150
  import {
161
151
  loadProjectSnapshot,
162
152
  readJsonCache,
163
153
  readJsonCacheAsync
164
- } from "./chunk-PRHYIA6X.js";
154
+ } from "./chunk-HTUG7ZFK.js";
165
155
  import {
166
156
  RUNTIME_CONFIG,
167
157
  exceedsLspSyncLimits,
168
158
  getRunnerTimeoutFloorMs,
169
159
  loadAstGrepNapi
170
- } from "./chunk-L7O774U7.js";
160
+ } from "./chunk-532X3OCZ.js";
171
161
  import {
172
162
  buildModuleGraph,
173
163
  clearModuleGraphCache
174
- } from "./chunk-7UTSNTWM.js";
164
+ } from "./chunk-6XNVY3FW.js";
175
165
  import {
176
166
  BUNDLED_QUERIES_ROOT,
177
167
  classifyTreeSitterWasmError,
@@ -191,10 +181,10 @@ import {
191
181
  ruleFilesForLanguage,
192
182
  ruleSourceLanguages,
193
183
  walk
194
- } from "./chunk-ZZSJAR76.js";
184
+ } from "./chunk-OC4ZGVMH.js";
195
185
  import {
196
186
  resolvePackagePath
197
- } from "./chunk-QGITU23N.js";
187
+ } from "./chunk-E3PNZDPH.js";
198
188
  import {
199
189
  stripAnsi
200
190
  } from "./chunk-6HWVI6MI.js";
@@ -206,36 +196,57 @@ import {
206
196
  scheduleWordIndexPersist,
207
197
  setWordIndexPublishedListener,
208
198
  updateWordIndexDocumentForEdit
209
- } from "./chunk-KXMJLOZF.js";
199
+ } from "./chunk-LXE7JAMV.js";
200
+ import {
201
+ isTypeScriptFile
202
+ } from "./chunk-AYDE7RFV.js";
203
+ import {
204
+ IN_FLIGHT_REASON,
205
+ NO_ANALYZER_REASON,
206
+ NO_SERVER_REASON,
207
+ checkedVerdict,
208
+ emptyDispatchResult,
209
+ faultResult,
210
+ faultSkip,
211
+ findingsResult,
212
+ isNotApplicableSkipReason,
213
+ isRunnerClaimSource,
214
+ isRunnerSkipReason,
215
+ noPrimaryCheckerReason,
216
+ reachedNoVerdict,
217
+ recordedUnchecked,
218
+ semanticFor,
219
+ spanOverlapsModifiedRanges,
220
+ unchecked
221
+ } from "./chunk-W6VLB6LL.js";
210
222
  import {
211
223
  WARM_CODE_ACTION_LOOKUP_LIMIT,
212
224
  contentHash
213
- } from "./chunk-HSOBIN22.js";
225
+ } from "./chunk-YVPB5YGO.js";
214
226
  import {
215
227
  resolveRunnerPath,
216
228
  toRunnerDisplayPath
217
- } from "./chunk-W7TY6HYX.js";
229
+ } from "./chunk-ZRQMENT4.js";
218
230
  import {
219
231
  withBudget
220
- } from "./chunk-MKPDIAZH.js";
232
+ } from "./chunk-3HZ6MNB2.js";
221
233
  import {
222
234
  findCommandOnPath,
223
235
  isSpawnableCommand
224
- } from "./chunk-MQ4PPCJB.js";
236
+ } from "./chunk-ITAPXBIB.js";
225
237
  import {
226
238
  logRunnerAdvisoryOnce,
227
239
  resolveRunnerCwd,
228
240
  resolveRunnerCwdWithReason
229
- } from "./chunk-RNJFRXEN.js";
241
+ } from "./chunk-JSQK5DH3.js";
230
242
  import {
231
243
  findLocalBinUpwards,
232
244
  localBinPath
233
- } from "./chunk-E65WJVI5.js";
245
+ } from "./chunk-FVEEEEIM.js";
234
246
  import {
235
- createAvailabilityProbeFlight,
236
247
  getIsolatedNpxSpawnOptions,
237
248
  probeToolAsync
238
- } from "./chunk-L6WBJGQS.js";
249
+ } from "./chunk-OP5BMZKK.js";
239
250
  import {
240
251
  classifyProbeFailure,
241
252
  createAvailabilityLatch,
@@ -243,14 +254,13 @@ import {
243
254
  describeUnavailability,
244
255
  isLatchingOutcome,
245
256
  logAvailabilityDecision,
246
- startHostStallSampler,
247
- transientRetryDelayMs
248
- } from "./chunk-AACN5GNE.js";
257
+ startHostStallSampler
258
+ } from "./chunk-WBXCIRVI.js";
249
259
  import {
250
260
  getLspCapableKinds,
251
261
  getPrimaryDispatchGroup,
252
262
  resolveLanguageRootForFile
253
- } from "./chunk-3HTZDY3C.js";
263
+ } from "./chunk-TTGDTNSN.js";
254
264
  import {
255
265
  getGlobalPiLensDir,
256
266
  getProjectDataDir,
@@ -258,17 +268,16 @@ import {
258
268
  isInSpawnTimeoutCooldown,
259
269
  isTestFile,
260
270
  loadPiLensGlobalConfig,
261
- noteSpawnTimeout,
262
271
  realIsPidAlive,
263
272
  resolvePiLensFlag,
264
273
  safeSpawnAsync
265
- } from "./chunk-TMNUTMT5.js";
274
+ } from "./chunk-DNB4ZQGN.js";
266
275
  import {
267
276
  DOTNET_CSHARP_PROJECT_MARKERS,
268
277
  DOTNET_CSHARP_SOLUTION_MARKERS,
269
278
  detectFileKind,
270
279
  isJstsFactFile
271
- } from "./chunk-CZCAZVTD.js";
280
+ } from "./chunk-SRXYSLMW.js";
272
281
  import {
273
282
  PathKeyedMap,
274
283
  boundedKeyLabel,
@@ -279,45 +288,45 @@ import {
279
288
  migrationSubject,
280
289
  reportPiLensConfigRecords,
281
290
  resolveOnePiLensConfigDocument,
282
- resolvePiLensConfig
283
- } from "./chunk-X5BJ3G2P.js";
291
+ resolvePiLensConfig,
292
+ spawnCooldownScope
293
+ } from "./chunk-6EIV3H7O.js";
284
294
  import {
285
- findNearestDirWithAnyBasename,
286
295
  findNearestDirWithMarker,
287
296
  getPiLensGlobalConfigPath
288
- } from "./chunk-NL5LSKVD.js";
297
+ } from "./chunk-3R3Z54J7.js";
289
298
  import {
290
299
  getProjectTrustState,
291
300
  killedForOutputCap,
292
301
  projectTrustDenialReason,
293
302
  truncatedByOutputCap,
294
303
  writeFileAtomic
295
- } from "./chunk-PIIUNJIT.js";
304
+ } from "./chunk-43KD3PPM.js";
296
305
  import {
297
306
  createSubsystemLogger,
298
307
  incrementDegradationCount,
299
308
  logExtension,
300
309
  recordDegradationOnce
301
- } from "./chunk-W5E72HJA.js";
310
+ } from "./chunk-AGEQRJ5A.js";
302
311
  import {
303
312
  createNdjsonLogger,
304
313
  getGlobalPiLensLogDir,
305
314
  getMaxLogSizeMB,
306
315
  isTestMode,
307
316
  logLatency,
317
+ nonNegativeIntEnv,
308
318
  phaseFinished,
309
319
  phaseStarted
310
- } from "./chunk-VCRVNLE7.js";
320
+ } from "./chunk-K2GV34T2.js";
311
321
  import {
312
322
  FactStore,
313
323
  setFactStoreEvictionReporter
314
- } from "./chunk-ZMMHHXSW.js";
324
+ } from "./chunk-O6LCSHHI.js";
315
325
  import {
316
326
  BoundedFifoMap,
317
327
  BoundedLruCache,
318
328
  direntsHaveMarkerGlobMatch,
319
329
  findLocalToolConfig,
320
- findNearestContaining,
321
330
  isAbsoluteFilePath,
322
331
  isUnderDir,
323
332
  isWindowsPath,
@@ -330,15 +339,16 @@ import {
330
339
  relativeInside,
331
340
  toPosix,
332
341
  toProjectRelativePath
333
- } from "./chunk-CB7PEVOJ.js";
342
+ } from "./chunk-WLD6BGON.js";
334
343
 
335
344
  // dist/clients/mcp/analyze.js
336
- import * as fs18 from "node:fs";
345
+ import * as fs15 from "node:fs";
337
346
  import * as path50 from "node:path";
338
347
 
339
348
  // dist/clients/cache-manager.js
340
349
  import * as fs from "node:fs";
341
350
  import * as path from "node:path";
351
+ var JSCPD_RESCAN_OTHER_EXTENSIONS = /\.(py|go|rs|rb|java|cs|php|cpp|c|h|hpp|swift|kt)$/;
342
352
  var DEFAULT_MAX_AGE_MS = 30 * 60 * 1e3;
343
353
  var DEFAULT_TURN_STATE = {
344
354
  files: {},
@@ -879,7 +889,7 @@ var CacheManager = class {
879
889
  */
880
890
  getFilesForJscpd(cwd, sessionId) {
881
891
  const state = this.readTurnState(cwd, sessionId);
882
- return Object.keys(state.files).filter((f) => /\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|rb|java|cs|php|cpp|c|h|hpp|swift|kt)$/.test(f));
892
+ return Object.keys(state.files).filter((f) => isJstsFactFile(f) || JSCPD_RESCAN_OTHER_EXTENSIONS.test(f));
883
893
  }
884
894
  /**
885
895
  * Get files that need madge re-scan (imports changed).
@@ -974,7 +984,7 @@ function createDiagnosticLogger() {
974
984
  }
975
985
 
976
986
  // dist/clients/dispatch/dispatcher.js
977
- import * as fs4 from "node:fs";
987
+ import * as fs3 from "node:fs";
978
988
  import * as path4 from "node:path";
979
989
 
980
990
  // dist/clients/line-alignment.js
@@ -1087,6 +1097,73 @@ function normalizeRuleId(ruleId) {
1087
1097
  }
1088
1098
  return normalized;
1089
1099
  }
1100
+ var FINDING_CLASS_RULES = /* @__PURE__ */ new Map([
1101
+ [
1102
+ "eslint",
1103
+ /* @__PURE__ */ new Map([
1104
+ ["no-unused-vars", "unused-variable"],
1105
+ ["@typescript-eslint/no-unused-vars", "unused-variable"],
1106
+ ["no-undef", "undefined-name"]
1107
+ ])
1108
+ ],
1109
+ [
1110
+ "oxlint",
1111
+ /* @__PURE__ */ new Map([
1112
+ ["no-unused-vars", "unused-variable"],
1113
+ ["no-undef", "undefined-name"]
1114
+ ])
1115
+ ],
1116
+ [
1117
+ "biome",
1118
+ /* @__PURE__ */ new Map([
1119
+ ["lint/correctness/noUnusedVariables", "unused-variable"],
1120
+ ["lint/correctness/noUnusedImports", "unused-import"],
1121
+ ["lint/correctness/noUndeclaredVariables", "undefined-name"]
1122
+ ])
1123
+ ],
1124
+ [
1125
+ "ruff",
1126
+ /* @__PURE__ */ new Map([
1127
+ ["F841", "unused-variable"],
1128
+ ["F401", "unused-import"],
1129
+ ["F821", "undefined-name"]
1130
+ ])
1131
+ ],
1132
+ [
1133
+ "pyright",
1134
+ /* @__PURE__ */ new Map([
1135
+ ["reportUnusedVariable", "unused-variable"],
1136
+ ["reportUnusedImport", "unused-import"],
1137
+ ["reportUndefinedVariable", "undefined-name"]
1138
+ ])
1139
+ ],
1140
+ ["mypy", /* @__PURE__ */ new Map([["name-defined", "undefined-name"]])]
1141
+ ]);
1142
+ var PYRIGHT_LSP_SOURCE = /^(?:Pyright|basedpyright):(.+)$/;
1143
+ function findingClassOf(d) {
1144
+ const rule = d.rule;
1145
+ if (!rule)
1146
+ return void 0;
1147
+ const tool = d.tool;
1148
+ if (tool === "lsp") {
1149
+ const code = PYRIGHT_LSP_SOURCE.exec(rule)?.[1];
1150
+ return code === void 0 ? void 0 : FINDING_CLASS_RULES.get("pyright")?.get(code);
1151
+ }
1152
+ return FINDING_CLASS_RULES.get(tool)?.get(rule);
1153
+ }
1154
+ function findingClassKey(d) {
1155
+ const cls = findingClassOf(d);
1156
+ return cls === void 0 ? void 0 : `${d.filePath}:${d.line ?? 1}:${d.column ?? 1}:class:${cls}`;
1157
+ }
1158
+ function withClassSeverity(d) {
1159
+ if (d.runnerFault === true)
1160
+ return d;
1161
+ if (d.semantic !== "warning" && d.semantic !== "none")
1162
+ return d;
1163
+ if (findingClassOf(d) === void 0)
1164
+ return d;
1165
+ return { ...d, severity: "error", semantic: "blocking" };
1166
+ }
1090
1167
 
1091
1168
  // dist/clients/dispatch/inline-suppressions.js
1092
1169
  var SUPPRESS_RE = /(?:\/\/|#)\s*pi-lens-ignore:\s*(.+)/;
@@ -1140,16 +1217,6 @@ function applyInlineSuppressions(diagnostics, content) {
1140
1217
  });
1141
1218
  }
1142
1219
 
1143
- // dist/clients/dispatch/runners/utils.js
1144
- import * as fs3 from "node:fs";
1145
- function readFileContent(filePath) {
1146
- try {
1147
- return fs3.readFileSync(filePath, "utf-8");
1148
- } catch {
1149
- return void 0;
1150
- }
1151
- }
1152
-
1153
1220
  // dist/clients/dispatch/rule-policy.js
1154
1221
  import * as nodePath from "node:path";
1155
1222
  function resolveDispatchPolicyConfig(root) {
@@ -1165,6 +1232,11 @@ function configOwnerFor(filePath, root) {
1165
1232
  function resolveDispatchPolicyConfigForFile(filePath, root) {
1166
1233
  return resolveDispatchPolicyConfig(configOwnerFor(filePath, root));
1167
1234
  }
1235
+ function ruleThresholdFromResolution(resolution, ruleId) {
1236
+ const rules2 = resolution.value.rules;
1237
+ const threshold = rules2?.[ruleId]?.threshold;
1238
+ return typeof threshold === "number" && threshold > 0 ? threshold : void 0;
1239
+ }
1168
1240
  function rulePolicyMapFromResolution(resolution, root) {
1169
1241
  const rules2 = resolution.value.rules;
1170
1242
  const map = rulePolicyMapFromConfig(rules2);
@@ -1367,7 +1439,7 @@ function convertLspDiagnostics(diags, filePath, options = {}) {
1367
1439
  4: "hint"
1368
1440
  };
1369
1441
  const severity = severityMap[d.severity] ?? "info";
1370
- const semantic = d.severity === 1 ? "blocking" : d.severity === 2 ? "warning" : "none";
1442
+ const semantic = d.severity === 1 || d.severity === 2 || d.severity === 3 ? semanticFor(severity) : "none";
1371
1443
  const code = String(d.code ?? "unknown");
1372
1444
  const source = d.source ?? tool;
1373
1445
  const hasSuggestion = options.fixSuggestionByIndex?.has(idx) ?? false;
@@ -1442,7 +1514,7 @@ function applyFindingPolicyByOwner(diagnostics, options) {
1442
1514
  };
1443
1515
  collect(applyFindingPolicy(own, options));
1444
1516
  for (const [owner, group] of byOwner) {
1445
- const content = isWithinIdentity(owner, options.cwd) ? readFileContent(owner) : void 0;
1517
+ const content = trustedCitedOwnerContent(owner, options.cwd, () => readFileContent(owner));
1446
1518
  if (content === void 0) {
1447
1519
  collect({
1448
1520
  kept: applyRulePolicy(group, options.policyMap, {
@@ -1949,8 +2021,52 @@ function observeRunnerLatency(options) {
1949
2021
  slowRunners.delete(runnerKey);
1950
2022
  return "inline";
1951
2023
  }
2024
+ var flights = /* @__PURE__ */ new Map();
2025
+ var DROPPED_BY_RESET = {
2026
+ status: "skipped",
2027
+ diagnostics: [],
2028
+ semantic: "none"
2029
+ };
2030
+ function runCollectLater(options) {
2031
+ const flightKey = key(options.projectRoot, options.runnerId);
2032
+ const flight = flights.get(flightKey);
2033
+ if (flight) {
2034
+ const fileKey = normalizeMapKey(options.filePath);
2035
+ const queued = flight.queued.get(fileKey);
2036
+ if (queued) {
2037
+ queued.start = options.start;
2038
+ return { promise: queued.promise, coalesced: true };
2039
+ }
2040
+ const slot = {
2041
+ start: options.start,
2042
+ promise: Promise.allSettled([flight.tail]).then(() => startQueued(flightKey, flight, fileKey, slot))
2043
+ };
2044
+ flight.queued.set(fileKey, slot);
2045
+ chain(flightKey, flight, slot.promise);
2046
+ return { promise: slot.promise, coalesced: true };
2047
+ }
2048
+ const promise = options.start();
2049
+ const started = { tail: promise, queued: /* @__PURE__ */ new Map() };
2050
+ flights.set(flightKey, started);
2051
+ chain(flightKey, started, promise);
2052
+ return { promise, coalesced: false };
2053
+ }
2054
+ function startQueued(flightKey, flight, fileKey, slot) {
2055
+ if (flights.get(flightKey) !== flight)
2056
+ return DROPPED_BY_RESET;
2057
+ flight.queued.delete(fileKey);
2058
+ return slot.start();
2059
+ }
2060
+ function chain(flightKey, flight, run) {
2061
+ flight.tail = run;
2062
+ void Promise.allSettled([run]).then(() => {
2063
+ if (flight.tail === run && flights.get(flightKey) === flight)
2064
+ flights.delete(flightKey);
2065
+ });
2066
+ }
1952
2067
  function resetObservedRunnerLatency() {
1953
2068
  slowRunners.clear();
2069
+ flights.clear();
1954
2070
  }
1955
2071
 
1956
2072
  // dist/clients/dispatch/pending-runner-findings.js
@@ -2325,7 +2441,6 @@ ${emoji} Auto-fixed ${diagnostics.length} issue(s):
2325
2441
  }
2326
2442
 
2327
2443
  // dist/clients/dispatch/dispatcher.js
2328
- var dispatcherProbeFlights = createAvailabilityProbeFlight({ generation: () => getDispatchAvailabilityGeneration() });
2329
2444
  var RunnerRegistry = class {
2330
2445
  runners = /* @__PURE__ */ new Map();
2331
2446
  register(runner) {
@@ -2364,105 +2479,37 @@ function normalizeCacheKey(cmd) {
2364
2479
  return `session.toolCache.${normalized}`;
2365
2480
  }
2366
2481
  var TOOL_PROBE_TIMEOUT_MS = 5e3;
2367
- function transientRetryKey(command) {
2368
- return `${normalizeCacheKey(command)}.retryAt`;
2369
- }
2370
- function transientAttemptsKey(command) {
2371
- return `${normalizeCacheKey(command)}.transientAttempts`;
2372
- }
2373
- async function checkToolAvailability(command, facts) {
2374
- const key2 = normalizeCacheKey(command);
2375
- const cached = facts.getSessionFact(key2);
2376
- if (cached !== void 0) {
2377
- return cached;
2378
- }
2379
- const retryAt = facts.getSessionFact(transientRetryKey(command));
2380
- if (retryAt !== void 0 && Date.now() < retryAt)
2381
- return false;
2382
- if (!await isSpawnableCommand(command)) {
2383
- facts.setSessionFact(key2, false);
2482
+ var commandCheckers = /* @__PURE__ */ new Map();
2483
+ async function checkToolAvailability(command) {
2484
+ if (!await isSpawnableCommand(command))
2384
2485
  return false;
2385
- }
2386
- try {
2387
- const sampler = startHostStallSampler();
2388
- const startedAt = Date.now();
2389
- let result;
2390
- let hostStallMs;
2391
- let probeJoined = false;
2392
- try {
2393
- const shared = dispatcherProbeFlights.run(`dispatcher:${key2}`, () => probeToolAsync(command, ["--version"], {
2394
- timeout: TOOL_PROBE_TIMEOUT_MS
2395
- }));
2396
- probeJoined = shared.joined;
2397
- result = await shared.promise;
2398
- } finally {
2399
- hostStallMs = sampler.stop();
2400
- }
2401
- const elapsedMs = Date.now() - startedAt;
2402
- recordAvailabilityProbeOverrun(command, key2, elapsedMs, TOOL_PROBE_TIMEOUT_MS, result.failure);
2403
- if (result.status === 0) {
2404
- facts.setSessionFact(key2, true);
2405
- facts.setSessionFact(transientRetryKey(command), 0);
2406
- facts.setSessionFact(transientAttemptsKey(command), 0);
2407
- logAvailabilityDecision({
2408
- tool: command,
2409
- verdict: "available",
2410
- outcome: "success",
2411
- cause: "ok",
2412
- elapsedMs,
2413
- latched: true,
2414
- classifiedBy: probeJoined ? "joined" : "probe",
2415
- hostStallMs,
2416
- budgetMs: TOOL_PROBE_TIMEOUT_MS
2417
- });
2418
- return true;
2419
- }
2420
- const { outcome, cause, evidence } = classifyProbeFailure(result, {
2421
- hostStallMs,
2486
+ const key2 = normalizeCacheKey(command);
2487
+ let checker = commandCheckers.get(key2);
2488
+ if (!checker) {
2489
+ checker = createAvailabilityChecker(command, "", ["--version"], {
2490
+ pathOnly: true,
2491
+ probeTimeout: TOOL_PROBE_TIMEOUT_MS,
2492
+ // A non-zero exit with no typed failure keeps its pre-#1476 meaning:
2493
+ // durable, cached for the session.
2422
2494
  unclassifiedFailureOutcome: "missing"
2423
2495
  });
2424
- let retryAfterMs;
2425
- if (outcome === "transient") {
2426
- const attempts = (facts.getSessionFact(transientAttemptsKey(command)) ?? 0) + 1;
2427
- facts.setSessionFact(transientAttemptsKey(command), attempts);
2428
- retryAfterMs = transientRetryDelayMs(attempts, cause);
2429
- facts.setSessionFact(transientRetryKey(command), Date.now() + retryAfterMs);
2430
- } else {
2431
- facts.setSessionFact(key2, false);
2432
- facts.setSessionFact(transientAttemptsKey(command), 0);
2433
- }
2434
- logAvailabilityDecision({
2435
- tool: command,
2436
- verdict: "unavailable",
2437
- outcome,
2438
- cause,
2439
- elapsedMs,
2440
- latched: outcome !== "transient",
2441
- hostStallMs,
2442
- ...retryAfterMs !== void 0 && { retryAfterMs },
2443
- budgetMs: TOOL_PROBE_TIMEOUT_MS,
2444
- classifiedBy: probeJoined ? "joined" : "probe",
2445
- evidence
2446
- });
2447
- return false;
2448
- } catch {
2449
- facts.setSessionFact(key2, false);
2450
- return false;
2496
+ commandCheckers.set(key2, checker);
2451
2497
  }
2498
+ return checker.isAvailableAsync();
2452
2499
  }
2453
2500
  function readFilePrefix(filePath, maxBytes = 4096) {
2454
2501
  let fd;
2455
2502
  try {
2456
- fd = fs4.openSync(filePath, "r");
2503
+ fd = fs3.openSync(filePath, "r");
2457
2504
  const buffer = Buffer.alloc(maxBytes);
2458
- const bytesRead = fs4.readSync(fd, buffer, 0, maxBytes, 0);
2505
+ const bytesRead = fs3.readSync(fd, buffer, 0, maxBytes, 0);
2459
2506
  return buffer.subarray(0, bytesRead).toString("utf8");
2460
2507
  } catch {
2461
2508
  return void 0;
2462
2509
  } finally {
2463
2510
  if (fd !== void 0) {
2464
2511
  try {
2465
- fs4.closeSync(fd);
2512
+ fs3.closeSync(fd);
2466
2513
  } catch {
2467
2514
  }
2468
2515
  }
@@ -2500,6 +2547,9 @@ function createDispatchContext(filePath, cwd, pi, facts, blockingOnly, modifiedR
2500
2547
  facts,
2501
2548
  projectConfig,
2502
2549
  rulePolicy,
2550
+ // Same resolution as `rulePolicy`, so a rule threshold follows the
2551
+ // edited file's nearest `.pi-lens.json` field by field (#5292).
2552
+ ruleThreshold: (ruleId) => ruleThresholdFromResolution(policyConfig, ruleId),
2503
2553
  ...disabledRunnerIds !== void 0 && { disabledRunnerIds },
2504
2554
  blockingOnly,
2505
2555
  modifiedRanges,
@@ -2510,7 +2560,7 @@ function createDispatchContext(filePath, cwd, pi, facts, blockingOnly, modifiedR
2510
2560
  telemetryProvider,
2511
2561
  toolCwdMemo: {},
2512
2562
  async hasTool(command) {
2513
- return checkToolAvailability(command, facts);
2563
+ return checkToolAvailability(command);
2514
2564
  },
2515
2565
  log(message, level) {
2516
2566
  logExtension({
@@ -2580,6 +2630,30 @@ function dedupeOverlappingDiagnostics(diagnostics) {
2580
2630
  }
2581
2631
  return [...byKey.values()];
2582
2632
  }
2633
+ function blocksAsClassMember(d) {
2634
+ return d.semantic !== "blocking" && withClassSeverity(d) !== d;
2635
+ }
2636
+ function mergeFindingClasses(visible, held) {
2637
+ const heldKeys = new Set(held.map(findingClassKey));
2638
+ const score = (d) => semanticRank(d.semantic) * 100 + toolPriority(d.tool, d.defectClass ?? classifyDiagnostic(d));
2639
+ const slotByKey = /* @__PURE__ */ new Map();
2640
+ const merged = [];
2641
+ for (const d of visible) {
2642
+ const key2 = findingClassKey(d);
2643
+ if (key2 === void 0 || heldKeys.has(key2)) {
2644
+ merged.push(d);
2645
+ continue;
2646
+ }
2647
+ const raised = withClassSeverity(d);
2648
+ const slot = slotByKey.get(key2);
2649
+ if (slot === void 0) {
2650
+ slotByKey.set(key2, merged.push(raised) - 1);
2651
+ } else if (score(raised) > score(merged[slot])) {
2652
+ merged[slot] = raised;
2653
+ }
2654
+ }
2655
+ return merged;
2656
+ }
2583
2657
  function suppressLintOverlapsWithLsp(diagnostics) {
2584
2658
  const lspBySpanClass = /* @__PURE__ */ new Set();
2585
2659
  const lspByLine = /* @__PURE__ */ new Set();
@@ -2742,7 +2816,7 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
2742
2816
  return { verdict: fallbackChecked, coverage: "fallback" };
2743
2817
  if (relevant.every((r) => r.runnerId === "lsp" && r.skipReason === "no-files-matched"))
2744
2818
  return {
2745
- verdict: unchecked("not analyzed (no language server handles this file)")
2819
+ verdict: unchecked(`not analyzed (${NO_SERVER_REASON})`)
2746
2820
  };
2747
2821
  const cause = combinePrimaryUnavailableCauses(relevant.flatMap((r) => r.primaryUnavailableCause ?? []));
2748
2822
  const deniedRunnerIds = relevant.filter((r) => r.skipReason === DISABLED_BY_CONFIG_SKIP_REASON).map((r) => r.runnerId);
@@ -2960,40 +3034,23 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
2960
3034
  const observedTier = ctx.writeIndex === void 0 ? "inline" : classifyObservedRunner(projectRoot, runner.id);
2961
3035
  if (observedTier === "collect-later") {
2962
3036
  const markedAtMs = Date.now();
2963
- const deferred = runRunner(runnerCtx, runner, semantic).then((result2) => {
2964
- const durationMs = Date.now() - markedAtMs;
2965
- const tier2 = observeRunnerLatency({
3037
+ const run = async () => {
3038
+ const startedAtMs = Date.now();
3039
+ const result2 = await runRunner(runnerCtx, runner, semantic);
3040
+ const durationMs = Date.now() - startedAtMs;
3041
+ observeRunnerTier({
3042
+ filePath: ctx.filePath,
2966
3043
  projectRoot,
2967
3044
  runnerId: runner.id,
3045
+ observedTier,
2968
3046
  durationMs,
2969
- timedOut: result2.failureKind === "timeout"
3047
+ result: result2
2970
3048
  });
2971
- if (tier2 !== observedTier) {
2972
- logLatency({
2973
- type: "phase",
2974
- filePath: ctx.filePath,
2975
- phase: "runner_collect_later_tier_flip",
2976
- durationMs: 0,
2977
- metadata: {
2978
- runnerId: runner.id,
2979
- from: observedTier,
2980
- to: tier2,
2981
- projectRoot
2982
- }
2983
- });
2984
- }
2985
- if (tier2 === "collect-later") {
2986
- incrementDegradationCount({
2987
- kind: "runner-collect-later",
2988
- subject: `${projectRoot}:${runner.id}`,
2989
- reason: `observed ${durationMs}ms, threshold ${COLLECT_LATER_THRESHOLD_MS}ms`
2990
- });
2991
- }
2992
3049
  logLatency({
2993
3050
  type: "runner",
2994
3051
  filePath: ctx.filePath,
2995
3052
  runnerId: runner.id,
2996
- startedAt: new Date(markedAtMs).toISOString(),
3053
+ startedAt: new Date(startedAtMs).toISOString(),
2997
3054
  durationMs,
2998
3055
  status: result2.status,
2999
3056
  diagnosticCount: result2.diagnostics.length,
@@ -3005,6 +3062,12 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
3005
3062
  }
3006
3063
  });
3007
3064
  return result2;
3065
+ };
3066
+ const { promise: deferred, coalesced } = runCollectLater({
3067
+ projectRoot,
3068
+ runnerId: runner.id,
3069
+ filePath: ctx.filePath,
3070
+ start: run
3008
3071
  });
3009
3072
  deferRunnerFindings({
3010
3073
  filePath: ctx.filePath,
@@ -3037,7 +3100,11 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
3037
3100
  status: "pending",
3038
3101
  diagnosticCount: 0,
3039
3102
  semantic,
3040
- metadata: { tier: "collect-later", delivered: "turn_end" }
3103
+ metadata: {
3104
+ tier: "collect-later",
3105
+ delivered: "turn_end",
3106
+ ...coalesced && { coalesced: true }
3107
+ }
3041
3108
  });
3042
3109
  continue;
3043
3110
  }
@@ -3045,31 +3112,14 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
3045
3112
  onRunnerResult?.(runnerId, result);
3046
3113
  const runnerEnd = Date.now();
3047
3114
  const duration = runnerEnd - runnerStart;
3048
- const tier = ctx.writeIndex === void 0 ? "inline" : observeRunnerLatency({
3049
- projectRoot,
3050
- runnerId: runner.id,
3051
- durationMs: duration,
3052
- timedOut: result.failureKind === "timeout"
3053
- });
3054
- if (tier !== observedTier) {
3055
- logLatency({
3056
- type: "phase",
3115
+ if (ctx.writeIndex !== void 0) {
3116
+ observeRunnerTier({
3057
3117
  filePath: ctx.filePath,
3058
- phase: "runner_collect_later_tier_flip",
3059
- durationMs: 0,
3060
- metadata: {
3061
- runnerId: runner.id,
3062
- from: observedTier,
3063
- to: tier,
3064
- projectRoot
3065
- }
3066
- });
3067
- }
3068
- if (tier === "collect-later") {
3069
- incrementDegradationCount({
3070
- kind: "runner-collect-later",
3071
- subject: `${projectRoot}:${runner.id}`,
3072
- reason: `observed ${duration}ms, threshold ${COLLECT_LATER_THRESHOLD_MS}ms`
3118
+ projectRoot,
3119
+ runnerId: runner.id,
3120
+ observedTier,
3121
+ durationMs: duration,
3122
+ result
3073
3123
  });
3074
3124
  }
3075
3125
  const skipReason = result.status === "skipped" && isRunnerSkipReason(result.skipReason) ? result.skipReason : void 0;
@@ -3309,7 +3359,7 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
3309
3359
  const filtered = filterDelta(visibleDiagnostics, applyOutputFilters(previousBaseline), { key: (d) => findingKey(d), lane: (d) => d.tool });
3310
3360
  const isNew = new Set(filtered.new);
3311
3361
  heldBackBlockers = visibleDiagnostics.filter((d) => d.semantic === "blocking" && !isNew.has(d));
3312
- stillObserved.push(...promoteDeltaUnusedToBlockers(visibleDiagnostics.flatMap((d) => !isNew.has(d) && d.semantic !== "blocking" && isUnusedValueDiagnostic(d) ? [d] : [])));
3362
+ stillObserved.push(...promoteDeltaUnusedToBlockers(visibleDiagnostics.flatMap((d) => !isNew.has(d) && d.semantic !== "blocking" && (isUnusedValueDiagnostic(d) || blocksAsClassMember(d)) ? [d] : [])).map(withClassSeverity));
3313
3363
  visibleDiagnostics = promoteDeltaUnusedToBlockers(filtered.new);
3314
3364
  resolvedCount = filtered.fixed.length;
3315
3365
  }
@@ -3319,7 +3369,9 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
3319
3369
  let preExisting = [];
3320
3370
  if (preEditSeed && seedContent !== void 0) {
3321
3371
  const classified = classifyPreExisting(preEditSeed, [
3322
- ...visibleDiagnostics.filter((d) => d.semantic === "blocking"),
3372
+ // #5416: and a class member the merge below would raise, so the
3373
+ // seed holds it before the raise can block on it.
3374
+ ...visibleDiagnostics.filter((d) => d.semantic === "blocking" || blocksAsClassMember(d)),
3323
3375
  ...heldBackBlockers
3324
3376
  ], seedContent, new Set([...answeredRunnerIds].filter((id) => !inconclusiveRunnerIds.has(id))));
3325
3377
  if (classified.preExisting.length > 0) {
@@ -3330,6 +3382,7 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
3330
3382
  }
3331
3383
  ctx.facts.setBoundedSessionFact(seedKey, classified.nextSeed);
3332
3384
  }
3385
+ visibleDiagnostics = mergeFindingClasses(visibleDiagnostics, preExisting);
3333
3386
  if (ctx.deltaMode && baselinePathSafe) {
3334
3387
  ctx.facts.setBoundedSessionFact(baselineAbsKey, [...dedupedDiagnostics]);
3335
3388
  }
@@ -3341,14 +3394,14 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
3341
3394
  provider: ctx.telemetryProvider
3342
3395
  };
3343
3396
  if (fixedItems.length > 0) {
3344
- import("./chunk-NOWH2VA2.js").then(({ appendToWorklog }) => {
3397
+ import("./chunk-LPM6NKVI.js").then(({ appendToWorklog }) => {
3345
3398
  appendToWorklog(ctx.cwd, fixedItems, true, worklogIdentity);
3346
3399
  }).catch(() => {
3347
3400
  });
3348
3401
  }
3349
3402
  const fixableWarnings = warnings.filter((d) => d.fixable);
3350
3403
  if (fixableWarnings.length > 0) {
3351
- import("./chunk-NOWH2VA2.js").then(({ appendToWorklog }) => {
3404
+ import("./chunk-LPM6NKVI.js").then(({ appendToWorklog }) => {
3352
3405
  appendToWorklog(ctx.cwd, fixableWarnings, false, worklogIdentity);
3353
3406
  }).catch(() => {
3354
3407
  });
@@ -3476,7 +3529,7 @@ function looksLikeDiagnosticCodePath(value) {
3476
3529
  const text = value.trim();
3477
3530
  if (!text)
3478
3531
  return false;
3479
- const base = path4.basename(text.replace(/\\/g, "/"));
3532
+ const base = path4.basename(toPosix(text));
3480
3533
  if (/^lsp:\d+(?::\d+)?$/i.test(text) || /^lsp:\d+(?::\d+)?$/i.test(base)) {
3481
3534
  return true;
3482
3535
  }
@@ -3506,11 +3559,44 @@ function failureRowMetadata(result) {
3506
3559
  }
3507
3560
  return result.inconclusive === true ? inconclusive : void 0;
3508
3561
  }
3562
+ function observeRunnerTier(options) {
3563
+ const { filePath, projectRoot, runnerId, observedTier, durationMs } = options;
3564
+ const tier = observeRunnerLatency({
3565
+ projectRoot,
3566
+ runnerId,
3567
+ durationMs,
3568
+ timedOut: options.result.failureKind === "timeout"
3569
+ });
3570
+ if (tier !== observedTier) {
3571
+ logLatency({
3572
+ type: "phase",
3573
+ filePath,
3574
+ phase: "runner_collect_later_tier_flip",
3575
+ durationMs: 0,
3576
+ metadata: { runnerId, from: observedTier, to: tier, projectRoot }
3577
+ });
3578
+ }
3579
+ if (tier === "collect-later") {
3580
+ incrementDegradationCount({
3581
+ kind: "runner-collect-later",
3582
+ subject: `${projectRoot}:${runnerId}`,
3583
+ reason: `observed ${durationMs}ms, threshold ${COLLECT_LATER_THRESHOLD_MS}ms`
3584
+ });
3585
+ }
3586
+ }
3509
3587
  async function runRunner(ctx, runner, defaultSemantic) {
3588
+ if (isInSpawnTimeoutCooldown(runner.id)) {
3589
+ recordDegradationOnce({
3590
+ kind: "runner-spawn-timeout-cooldown",
3591
+ subject: runner.id,
3592
+ reason: "skipped: its spawn timed out earlier this session"
3593
+ });
3594
+ return { status: "skipped", diagnostics: [], semantic: "none" };
3595
+ }
3510
3596
  const timeoutMs = Math.max(runner.timeoutMs ?? RUNNER_TIMEOUT_MS, getRunnerTimeoutFloorMs());
3511
3597
  const phaseToken = phaseStarted(runner.id);
3512
3598
  try {
3513
- const outcome = await withBudget(runner.run(ctx).then((value) => ({ value })), timeoutMs);
3599
+ const outcome = await withBudget(spawnCooldownScope.run({ tool: runner.id, subject: runner.id, phase: "lint" }, () => runner.run(ctx)).then((value) => ({ value })), timeoutMs);
3514
3600
  if (outcome === void 0) {
3515
3601
  throw new Error(`Runner ${runner.id} timed out after ${timeoutMs}ms`);
3516
3602
  }
@@ -3541,8 +3627,7 @@ async function runRunner(ctx, runner, defaultSemantic) {
3541
3627
 
3542
3628
  // dist/clients/cascade-budget.js
3543
3629
  function cascadeSettleWaitMs() {
3544
- const raw = Number(process.env.PI_LENS_CASCADE_SETTLE_WAIT_MS);
3545
- return Number.isFinite(raw) && raw >= 0 ? raw : 5e3;
3630
+ return nonNegativeIntEnv("PI_LENS_CASCADE_SETTLE_WAIT_MS", 5e3);
3546
3631
  }
3547
3632
  var MIN_NEIGHBOUR_BUDGET = RUNTIME_CONFIG.pipeline.cascadeMaxFiles;
3548
3633
  var DEFAULT_NEIGHBOUR_BUDGET = 40;
@@ -3841,7 +3926,7 @@ function formatCascadeNeighborDiagnostics(cwd, neighbors, options = {}) {
3841
3926
  const since = options.stillPresentSince?.(neighbor, d);
3842
3927
  const label = since === void 0 ? "" : ` (still present since turn ${since})`;
3843
3928
  out += `
3844
- line ${line}, col ${col}${rule}: ${d.message.split("\n")[0].slice(0, 100)}${label}`;
3929
+ line ${line}, col ${col}${rule}: ${displayedMessage(d.message)}${label}`;
3845
3930
  }
3846
3931
  out += "\n</diagnostics>";
3847
3932
  }
@@ -3928,7 +4013,7 @@ function cascadeErrorKey(diagnostic) {
3928
4013
  }
3929
4014
  function cascadeStillPresentSince(filePath, diagnostic, turn) {
3930
4015
  const first = pendingNeighbors.get(normalizeMapKey(filePath))?.errors.get(cascadeErrorKey(diagnostic));
3931
- return first !== void 0 && first < turn ? first : void 0;
4016
+ return first !== void 0 && first.turn < turn ? first.turn : void 0;
3932
4017
  }
3933
4018
  function recordDeliveredCascadeNeighbor(filePath, diagnostics, turn, checkedAt) {
3934
4019
  const key2 = normalizeMapKey(filePath);
@@ -3936,7 +4021,17 @@ function recordDeliveredCascadeNeighbor(filePath, diagnostics, turn, checkedAt)
3936
4021
  const errors = /* @__PURE__ */ new Map();
3937
4022
  for (const d of diagnostics) {
3938
4023
  const k = cascadeErrorKey(d);
3939
- errors.set(k, previous?.errors.get(k) ?? turn);
4024
+ errors.set(k, {
4025
+ turn: previous?.errors.get(k)?.turn ?? turn,
4026
+ identity: {
4027
+ filePath: d.filePath,
4028
+ message: d.message,
4029
+ ...d.line !== void 0 && { line: d.line },
4030
+ tool: d.tool,
4031
+ ...d.rule !== void 0 && { rule: d.rule },
4032
+ ...d.semantic !== void 0 && { semantic: d.semantic }
4033
+ }
4034
+ });
3940
4035
  }
3941
4036
  pendingNeighbors.delete(key2);
3942
4037
  if (errors.size === 0)
@@ -3962,7 +4057,8 @@ function listCascadePendingNeighbors() {
3962
4057
  return [...pendingNeighbors.values()].map((entry) => ({
3963
4058
  filePath: entry.filePath,
3964
4059
  errorCount: entry.errors.size,
3965
- checkedAt: entry.checkedAt
4060
+ checkedAt: entry.checkedAt,
4061
+ errors: [...entry.errors.values()].map((stored) => stored.identity)
3966
4062
  }));
3967
4063
  }
3968
4064
  function resetCascadePendingNeighbors() {
@@ -4223,7 +4319,7 @@ function peekOutstandingCascadeTouches(guard) {
4223
4319
  var _reconcileOptions = {};
4224
4320
 
4225
4321
  // dist/clients/dispatch/runners/ast-grep-napi.js
4226
- import * as fs5 from "node:fs";
4322
+ import * as fs4 from "node:fs";
4227
4323
  import * as path6 from "node:path";
4228
4324
 
4229
4325
  // dist/clients/dispatch/priorities.js
@@ -4881,7 +4977,7 @@ function evaluateAstGrepRules(filePath, rootNode, cwd, kind, options = {}) {
4881
4977
  }
4882
4978
  const toDiagnostic3 = (position) => {
4883
4979
  const severity = normalizeRuleSeverity(rule.severity);
4884
- const semantic = severity === "error" ? "blocking" : "warning";
4980
+ const semantic = semanticFor(severity);
4885
4981
  const defectClass = classifyDefect(rule.id, "ast-grep-napi", rule.message || rule.id);
4886
4982
  const ruleFix = explicitRuleFixSuggestion(rule);
4887
4983
  return {
@@ -4957,7 +5053,7 @@ var astGrepNapiRunner = {
4957
5053
  if (!sgModule) {
4958
5054
  return { status: "skipped", diagnostics: [], semantic: "none" };
4959
5055
  }
4960
- if (!fs5.existsSync(ctx.filePath)) {
5056
+ if (!fs4.existsSync(ctx.filePath)) {
4961
5057
  return { status: "skipped", diagnostics: [], semantic: "none" };
4962
5058
  }
4963
5059
  const lang = getLang(ctx.filePath, sgModule);
@@ -4966,7 +5062,7 @@ var astGrepNapiRunner = {
4966
5062
  }
4967
5063
  let stats;
4968
5064
  try {
4969
- stats = fs5.statSync(ctx.filePath);
5065
+ stats = fs4.statSync(ctx.filePath);
4970
5066
  } catch {
4971
5067
  return { status: "skipped", diagnostics: [], semantic: "none" };
4972
5068
  }
@@ -4979,7 +5075,7 @@ var astGrepNapiRunner = {
4979
5075
  content = contentFromFacts;
4980
5076
  } else {
4981
5077
  try {
4982
- content = fs5.readFileSync(ctx.filePath, "utf-8");
5078
+ content = fs4.readFileSync(ctx.filePath, "utf-8");
4983
5079
  } catch {
4984
5080
  return { status: "skipped", diagnostics: [], semantic: "none" };
4985
5081
  }
@@ -5180,7 +5276,7 @@ var commentFactProvider = {
5180
5276
  provides: ["file.comments"],
5181
5277
  requires: ["file.content"],
5182
5278
  appliesTo(ctx) {
5183
- return /\.tsx?$/.test(ctx.filePath);
5279
+ return isTypeScriptFile(ctx.filePath);
5184
5280
  },
5185
5281
  async run(ctx, store) {
5186
5282
  await extractFactsFromTree(ctx, store, commentFactProvider.id, { "file.comments": [] }, (root) => {
@@ -5243,7 +5339,7 @@ var tryCatchFactProvider = {
5243
5339
  provides: ["file.tryCatchSummaries"],
5244
5340
  requires: ["file.content"],
5245
5341
  appliesTo(ctx) {
5246
- return /\.tsx?$/.test(ctx.filePath);
5342
+ return isTypeScriptFile(ctx.filePath);
5247
5343
  },
5248
5344
  async run(ctx, store) {
5249
5345
  await extractFactsFromTree(ctx, store, tryCatchFactProvider.id, { "file.tryCatchSummaries": [] }, (root) => {
@@ -5296,7 +5392,6 @@ var tryCatchFactProvider = {
5296
5392
 
5297
5393
  // dist/clients/dispatch/runners/actionlint.js
5298
5394
  import path7 from "node:path";
5299
- var actionlint = createAvailabilityChecker("actionlint", ".exe");
5300
5395
  function isGitHubWorkflowFile(filePath) {
5301
5396
  const normalized = toPosix(filePath);
5302
5397
  return /(^|\/)\.github\/workflows\/[^/]+\.ya?ml$/i.test(normalized);
@@ -5358,11 +5453,7 @@ var actionlintRunner = {
5358
5453
  async run(ctx) {
5359
5454
  const cwd = resolveRunnerCwd(ctx, "actionlint");
5360
5455
  let cmd = null;
5361
- if (await actionlint.isAvailableAsync(cwd)) {
5362
- cmd = actionlint.getCommand(cwd);
5363
- } else {
5364
- cmd = await resolveToolCommandWithInstallFallback(cwd, "actionlint");
5365
- }
5456
+ cmd = await resolveToolCommandWithInstallFallback(cwd, "actionlint");
5366
5457
  if (!cmd)
5367
5458
  return { status: "skipped", diagnostics: [], semantic: "none" };
5368
5459
  const relativeFilePath = path7.relative(cwd, ctx.filePath) || ctx.filePath;
@@ -5402,6 +5493,7 @@ function normalizeBiomeSeverity(raw) {
5402
5493
  return "hint";
5403
5494
  case "warning":
5404
5495
  return "warning";
5496
+ case void 0:
5405
5497
  default:
5406
5498
  return "warning";
5407
5499
  }
@@ -5434,7 +5526,7 @@ function parseBiomeJson(raw, filePath, cwd, fixKindByRule) {
5434
5526
  line: d.location.start.line,
5435
5527
  column: d.location.start.column,
5436
5528
  severity: normalizeBiomeSeverity(d.severity),
5437
- semantic: d.severity === "error" ? "blocking" : "warning",
5529
+ semantic: semanticFor(normalizeBiomeSeverity(d.severity)),
5438
5530
  tool: "biome",
5439
5531
  rule: d.category,
5440
5532
  fixable: isFixable,
@@ -5580,7 +5672,7 @@ var biomeCheckJsonRunner = {
5580
5672
  var biome_check_default = biomeCheckJsonRunner;
5581
5673
 
5582
5674
  // dist/clients/dispatch/runners/cpp-check.js
5583
- import * as fs6 from "node:fs";
5675
+ import * as fs5 from "node:fs";
5584
5676
  import * as path9 from "node:path";
5585
5677
  var compilerCheckers = {
5586
5678
  clang: createAvailabilityChecker("clang", ".exe"),
@@ -5619,7 +5711,7 @@ var CPP_HEADER_EXTENSIONS = /* @__PURE__ */ new Set([
5619
5711
  ]);
5620
5712
  function headerLooksLikeCpp(absPath) {
5621
5713
  try {
5622
- const content = fs6.readFileSync(absPath, "utf-8");
5714
+ const content = fs5.readFileSync(absPath, "utf-8");
5623
5715
  return /\b(namespace|template|class|constexpr|concept|using)\b|std::|\b(public|private|protected)\s*:/.test(content);
5624
5716
  } catch {
5625
5717
  return false;
@@ -5770,7 +5862,6 @@ var cpp_check_default = cppCheckRunner;
5770
5862
 
5771
5863
  // dist/clients/dispatch/runners/credo.js
5772
5864
  import * as path10 from "node:path";
5773
- import * as fs7 from "node:fs";
5774
5865
  var CREDO_PROBE_BUDGET_MS = 1e4;
5775
5866
  var probeCredo = createCwdCachedProbe((cwd) => safeSpawnAsync("mix", ["credo", "--version"], {
5776
5867
  timeout: CREDO_PROBE_BUDGET_MS,
@@ -5795,17 +5886,16 @@ function parseCredoJson(raw, fallbackPath, cwd) {
5795
5886
  return [];
5796
5887
  }
5797
5888
  }
5798
- function hasMixExs(cwd) {
5799
- return fs7.existsSync(path10.join(cwd, "mix.exs"));
5800
- }
5801
5889
  var credoRunner = {
5802
5890
  id: "credo",
5803
5891
  appliesTo: ["elixir"],
5804
5892
  priority: PRIORITY.GENERAL_ANALYSIS,
5805
5893
  skipTestFiles: false,
5894
+ // mix never walks up, so the seam answers for `cwd` alone.
5895
+ requiresConfig: (cwd) => hasToolConfig("mix", cwd),
5806
5896
  async run(ctx) {
5807
5897
  const cwd = resolveRunnerCwd(ctx, "credo");
5808
- if (!hasMixExs(cwd)) {
5898
+ if (!credoRunner.requiresConfig?.(cwd)) {
5809
5899
  return { status: "skipped", diagnostics: [], semantic: "none" };
5810
5900
  }
5811
5901
  if (!await probeCredo(cwd)) {
@@ -5813,13 +5903,11 @@ var credoRunner = {
5813
5903
  }
5814
5904
  const absPath = path10.resolve(cwd, ctx.filePath);
5815
5905
  const result = await safeSpawnAsync("mix", ["credo", "--format", "json", "--strict", absPath], { timeout: 3e4, cwd });
5816
- const output = `${result.stdout ?? ""}${result.stderr ?? ""}`;
5817
5906
  const parsed = parseToolRun("credo", {
5818
5907
  result,
5819
- output,
5820
5908
  // EXIT TABLE (Credo 1.7 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
5821
5909
  exitCodes: { ran: [1, 2] }
5822
- }, (raw) => parseCredoJson(raw, ctx.filePath, cwd));
5910
+ }, (raw) => parseCredoJson(raw, ctx.filePath, cwd), { parseStreams: "stdout-else-stderr" });
5823
5911
  if (parsed.skipped)
5824
5912
  return parsed.skipped;
5825
5913
  return finishParsedRun({
@@ -5833,7 +5921,7 @@ var credoRunner = {
5833
5921
  var credo_default = credoRunner;
5834
5922
 
5835
5923
  // dist/clients/dispatch/runners/cue-vet.js
5836
- import * as fs8 from "node:fs";
5924
+ import * as fs6 from "node:fs";
5837
5925
  import * as path11 from "node:path";
5838
5926
  var cue = createAvailabilityChecker("cue", ".exe", ["version"]);
5839
5927
  function parseCueVetOutput(raw) {
@@ -5938,7 +6026,7 @@ var cueVetRunner = {
5938
6026
  const singleFileArgs = ["vet", "-c=false", `./${fileName}`];
5939
6027
  let touchedContent = null;
5940
6028
  try {
5941
- touchedContent = fs8.readFileSync(absPath, "utf8");
6029
+ touchedContent = fs6.readFileSync(absPath, "utf8");
5942
6030
  } catch {
5943
6031
  touchedContent = null;
5944
6032
  }
@@ -6106,7 +6194,7 @@ function parseDartMachineOutput(raw, filePath, cwd) {
6106
6194
  line: lineNum || 1,
6107
6195
  column: colNum || 1,
6108
6196
  severity,
6109
- semantic: severity === "error" ? "blocking" : "warning",
6197
+ semantic: semanticFor(severity),
6110
6198
  tool: "dart",
6111
6199
  rule: ruleId,
6112
6200
  defectClass: "style",
@@ -6155,15 +6243,8 @@ var dartAnalyzeRunner = {
6155
6243
  var dart_analyze_default = dartAnalyzeRunner;
6156
6244
 
6157
6245
  // dist/clients/dispatch/runners/detekt.js
6158
- import * as fs9 from "node:fs";
6159
6246
  import * as path13 from "node:path";
6160
6247
  var detekt = createAvailabilityChecker("detekt", ".bat");
6161
- var DETEKT_CONFIG_CANDIDATES = [
6162
- "detekt.yml",
6163
- ".detekt.yml",
6164
- path13.join("config", "detekt", "detekt.yml"),
6165
- path13.join("detekt", "detekt.yml")
6166
- ];
6167
6248
  var DETEKT_FIXABLE_RULES = /* @__PURE__ */ new Set([
6168
6249
  // formatting (ktlint wrapper) — every rule supports autocorrect
6169
6250
  "AnnotationOnSeparateLine",
@@ -6226,20 +6307,16 @@ var DETEKT_FIXABLE_RULES = /* @__PURE__ */ new Set([
6226
6307
  "UnusedPrivateClass",
6227
6308
  "RedundantVisibilityModifierRule"
6228
6309
  ]);
6229
- function findDetektConfig(cwd) {
6230
- for (const candidate of DETEKT_CONFIG_CANDIDATES) {
6231
- const full = path13.join(cwd, candidate);
6232
- if (fs9.existsSync(full))
6233
- return full;
6234
- }
6235
- return void 0;
6236
- }
6237
6310
  function parseDetektOutput(raw, filePath, cwd) {
6238
6311
  const diagnostics = [];
6312
+ if (!raw.trim())
6313
+ return diagnostics;
6314
+ let located = 0;
6239
6315
  const pattern = /^(.+?):(\d+):(\d+): (?:(error|warning): )?(.+?)(?:\s+\[([^\]]+)\])?$/gm;
6240
6316
  const absTarget = path13.resolve(cwd, filePath);
6241
6317
  for (const match of raw.matchAll(pattern)) {
6242
6318
  const [, file, lineStr, colStr, level, message, rule] = match;
6319
+ located += 1;
6243
6320
  if (!pathsEqual(path13.resolve(cwd, file.trim()), absTarget))
6244
6321
  continue;
6245
6322
  const severity = level === "error" ? "error" : "warning";
@@ -6254,7 +6331,7 @@ function parseDetektOutput(raw, filePath, cwd) {
6254
6331
  line: lineNum,
6255
6332
  column: colNum,
6256
6333
  severity,
6257
- semantic: severity === "error" ? "blocking" : "warning",
6334
+ semantic: semanticFor(severity),
6258
6335
  tool: "detekt",
6259
6336
  rule: ruleId,
6260
6337
  defectClass: "style",
@@ -6262,7 +6339,7 @@ function parseDetektOutput(raw, filePath, cwd) {
6262
6339
  fixSuggestion: fixable ? "Run `detekt --auto-correct` to apply the deterministic auto-correction for this rule." : void 0
6263
6340
  });
6264
6341
  }
6265
- return diagnostics;
6342
+ return located > 0 ? diagnostics : null;
6266
6343
  }
6267
6344
  var detektRunner = {
6268
6345
  id: "detekt",
@@ -6270,13 +6347,14 @@ var detektRunner = {
6270
6347
  priority: PRIORITY.GENERAL_ANALYSIS,
6271
6348
  timeoutMs: 9e4,
6272
6349
  skipTestFiles: false,
6350
+ requiresConfig: (cwd) => hasToolConfig("detekt", cwd),
6273
6351
  async run(ctx) {
6274
6352
  const cwd = resolveRunnerCwd(ctx, "detekt");
6275
6353
  const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
6276
6354
  if (policy && !policy.preferredRunners.includes("detekt")) {
6277
6355
  return { status: "skipped", diagnostics: [], semantic: "none" };
6278
6356
  }
6279
- const configPath = findDetektConfig(cwd);
6357
+ const configPath = findToolConfig("detekt", cwd)?.file;
6280
6358
  if (!configPath) {
6281
6359
  return { status: "skipped", diagnostics: [], semantic: "none" };
6282
6360
  }
@@ -6293,32 +6371,40 @@ var detektRunner = {
6293
6371
  // Exit 1 is a tool error with NO findings (captured broken-config run: an invalid detekt.yml
6294
6372
  // prints InvalidConfigurationError on stderr), and also can follow printed findings (captured
6295
6373
  // findings-then-exit1 run: a non-numeric build.weights value fails after the report). Exit 1 is
6296
- // therefore admitted, and skipWhenParsedNothing skips it only when the parser read no finding,
6297
- // so a printed finding is kept. Any other nonzero exit is rejected.
6374
+ // therefore admitted, and `finishParsedRun` reports it as failed/parser_error only when the
6375
+ // parser read no finding (#5411, was a skip), so a printed finding is kept. Any other nonzero
6376
+ // exit is rejected.
6298
6377
  exitCodes: { ran: [1, 2] }
6299
- }, (out) => parseDetektOutput(out, ctx.filePath, cwd), { skipWhenParsedNothing: true });
6378
+ }, (out) => parseDetektOutput(out, ctx.filePath, cwd));
6300
6379
  if (run.skipped)
6301
6380
  return run.skipped;
6302
- const diagnostics = run.diagnostics;
6303
- if (diagnostics.length === 0) {
6304
- return { status: "succeeded", diagnostics: [], semantic: "none" };
6305
- }
6306
- const hasErrors = diagnostics.some((d) => d.severity === "error");
6307
- const verdict = findingsResult(diagnostics, {
6308
- status: hasErrors ? "failed" : "succeeded",
6309
- semantic: hasErrors ? "blocking" : "warning"
6381
+ const verdict = finishParsedRun({
6382
+ tool: "detekt",
6383
+ ctx,
6384
+ result,
6385
+ diagnostics: run.diagnostics,
6386
+ unreadable: run.unreadable,
6387
+ classify: (diagnostics) => {
6388
+ const hasErrors = diagnostics.some((d) => d.severity === "error");
6389
+ return {
6390
+ status: hasErrors ? "failed" : "succeeded",
6391
+ semantic: hasErrors ? "blocking" : "warning"
6392
+ };
6393
+ }
6310
6394
  });
6395
+ if (run.diagnostics.length === 0)
6396
+ return verdict;
6311
6397
  return result.status === 1 ? { ...verdict, inconclusive: true } : verdict;
6312
6398
  }
6313
6399
  };
6314
6400
  var detekt_default = detektRunner;
6315
6401
 
6316
6402
  // dist/clients/dispatch/runners/dotnet-build.js
6317
- import * as fs10 from "node:fs";
6403
+ import * as fs7 from "node:fs";
6318
6404
  import * as path14 from "node:path";
6319
6405
  var dotnet = createAvailabilityChecker("dotnet", ".exe");
6320
6406
  function findProjectTarget(cwd) {
6321
- const entries = fs10.readdirSync(cwd, { withFileTypes: true });
6407
+ const entries = fs7.readdirSync(cwd, { withFileTypes: true });
6322
6408
  for (const patterns of [
6323
6409
  DOTNET_CSHARP_SOLUTION_MARKERS,
6324
6410
  DOTNET_CSHARP_PROJECT_MARKERS
@@ -6414,7 +6500,7 @@ function parseDotnetBuildOutput(raw, filePath, cwd) {
6414
6500
  line: lineNum,
6415
6501
  column: colNum,
6416
6502
  severity,
6417
- semantic: severity === "error" ? "blocking" : "warning",
6503
+ semantic: semanticFor(severity),
6418
6504
  tool: "dotnet-build",
6419
6505
  rule,
6420
6506
  fixable: false
@@ -6473,13 +6559,10 @@ ${result.stderr ?? ""}`.trim();
6473
6559
  var dotnet_build_default = dotnetBuildRunner;
6474
6560
 
6475
6561
  // dist/clients/dispatch/runners/elixir-check.js
6476
- import * as fs11 from "node:fs";
6562
+ import * as fs8 from "node:fs";
6477
6563
  import * as path15 from "node:path";
6478
6564
  var mix = createAvailabilityChecker("mix", ".bat");
6479
6565
  var elixirc = createAvailabilityChecker("elixirc", ".bat");
6480
- function hasMixExs2(cwd) {
6481
- return fs11.existsSync(path15.join(cwd, "mix.exs"));
6482
- }
6483
6566
  var ELIXIR_SNIPPET_LOCATION = /└─\s+(.+?):(\d+)(?::(\d+))?(?::|$)/;
6484
6567
  function parseElixirOutput(raw, filePath, cwd = process.cwd()) {
6485
6568
  const diagnostics = [];
@@ -6530,7 +6613,7 @@ function parseElixirOutput(raw, filePath, cwd = process.cwd()) {
6530
6613
  line: Number.parseInt(lineStr2, 10) || 1,
6531
6614
  column: Number.parseInt(colStr2 || "1", 10) || 1,
6532
6615
  severity,
6533
- semantic: severity === "error" ? "blocking" : "warning",
6616
+ semantic: semanticFor(severity),
6534
6617
  tool: "elixir-check",
6535
6618
  rule: severity === "error" ? "error" : "warning",
6536
6619
  fixable: false
@@ -6555,7 +6638,7 @@ function parseElixirOutput(raw, filePath, cwd = process.cwd()) {
6555
6638
  line: Number.parseInt(lineStr, 10) || 1,
6556
6639
  column: Number.parseInt(colStr || "1", 10) || 1,
6557
6640
  severity,
6558
- semantic: severity === "error" ? "blocking" : "warning",
6641
+ semantic: semanticFor(severity),
6559
6642
  tool: "elixir-check",
6560
6643
  rule: severity === "error" ? "error" : "warning",
6561
6644
  fixable: false
@@ -6573,12 +6656,12 @@ var elixirCheckRunner = {
6573
6656
  const absPath = path15.resolve(cwd, ctx.filePath);
6574
6657
  let command;
6575
6658
  let args = [];
6576
- if (hasMixExs2(cwd) && await mix.isAvailableAsync(cwd)) {
6659
+ if (hasToolConfig("mix", cwd) && await mix.isAvailableAsync(cwd)) {
6577
6660
  command = "mix";
6578
6661
  args = ["compile", "--warnings-as-errors"];
6579
6662
  } else if (await elixirc.isAvailableAsync(cwd)) {
6580
6663
  const outDir = path15.join(getProjectDataDir(cwd), "elixir-check");
6581
- fs11.mkdirSync(outDir, { recursive: true });
6664
+ fs8.mkdirSync(outDir, { recursive: true });
6582
6665
  command = "elixirc";
6583
6666
  args = ["-o", outDir, absPath];
6584
6667
  }
@@ -6662,7 +6745,7 @@ function parseEslintJson(raw, filePath, cwd) {
6662
6745
  line: msg.line ?? 1,
6663
6746
  column: msg.column ?? 1,
6664
6747
  severity,
6665
- semantic: severity === "error" ? "blocking" : "warning",
6748
+ semantic: semanticFor(severity),
6666
6749
  tool: "eslint",
6667
6750
  rule: msg.ruleId ?? void 0,
6668
6751
  fixable: !!msg.fix,
@@ -6683,10 +6766,10 @@ var eslintRunner = {
6683
6766
  id: "eslint",
6684
6767
  appliesTo: ["jsts"],
6685
6768
  priority: PRIORITY.LINT_SECONDARY,
6769
+ requiresConfig: (cwd) => hasEslintConfig(cwd),
6686
6770
  async run(ctx) {
6687
6771
  const cwd = resolveRunnerCwd(ctx, "eslint");
6688
- const userHasConfig = hasEslintConfig(cwd);
6689
- if (!userHasConfig) {
6772
+ if (!eslintRunner.requiresConfig?.(cwd)) {
6690
6773
  return { status: "skipped", diagnostics: [], semantic: "none" };
6691
6774
  }
6692
6775
  const cmd = resolveToolCommand(cwd, "eslint") ?? "eslint";
@@ -6694,17 +6777,11 @@ var eslintRunner = {
6694
6777
  return { status: "skipped", diagnostics: [], semantic: "none" };
6695
6778
  }
6696
6779
  const result = await safeSpawnAsync(cmd, ["--format", "json", "--no-error-on-unmatched-pattern", ctx.filePath], { timeout: 3e4, cwd });
6697
- const stdout = result.stdout ?? "";
6698
- let raw = stdout;
6699
- if (raw.length === 0 && result.status !== 0) {
6700
- raw = result.stderr || "";
6701
- }
6702
6780
  const parsed = parseToolRun("eslint", {
6703
6781
  result,
6704
- output: raw,
6705
6782
  // EXIT TABLE (ESLint 9.10 docs https://eslint.org/docs/latest/use/command-line-interface): 0 clean; 1 findings; 2 fatal findings/error; other nonzero rejected.
6706
6783
  exitCodes: { ran: [1, 2] }
6707
- }, (rawOutput) => parseEslintJson(rawOutput, ctx.filePath, cwd).diagnostics);
6784
+ }, (rawOutput) => parseEslintJson(rawOutput, ctx.filePath, cwd).diagnostics, { parseStreams: "stdout-else-stderr" });
6708
6785
  if (parsed.skipped)
6709
6786
  return parsed.skipped;
6710
6787
  return finishParsedRun({
@@ -6793,7 +6870,7 @@ function parseGleamOutput(raw, filePath, cwd) {
6793
6870
  line: Number.parseInt(lineStr, 10) || 1,
6794
6871
  column: Number.parseInt(colStr, 10) || 1,
6795
6872
  severity,
6796
- semantic: severity === "error" ? "blocking" : "warning",
6873
+ semantic: semanticFor(severity),
6797
6874
  tool: "gleam",
6798
6875
  rule: "gleam-check",
6799
6876
  fixable: false
@@ -6871,16 +6948,21 @@ function createLineParser(config) {
6871
6948
  const fixable = typeof config.fixable === "function" ? config.fixable(match) : config.fixable ?? false;
6872
6949
  const autoFixAvailable = typeof config.autoFixAvailable === "function" ? config.autoFixAvailable(match) : config.autoFixAvailable ?? false;
6873
6950
  const fixKind = typeof config.fixKind === "function" ? config.fixKind(match) : config.fixKind;
6951
+ const rule = config.extractRule?.(match);
6952
+ const message = config.extractMessage(match);
6874
6953
  diagnostics.push({
6875
- id: config.generateId(match),
6876
- message: config.extractMessage(match),
6954
+ // #5412: a finding with no rule keys its id on its message too. The
6955
+ // line alone gave two go vet findings at one position one id, and the
6956
+ // dispatcher's `findingKey` (rule || id) kept only one of them.
6957
+ id: rule ? config.generateId(match) : `${config.generateId(match)}-${hashText(message)}`,
6958
+ message,
6877
6959
  filePath,
6878
6960
  line: lineNum,
6879
6961
  column: colNum,
6880
6962
  severity,
6881
- semantic: severity === "error" ? "blocking" : "warning",
6963
+ semantic: semanticFor(severity),
6882
6964
  tool: config.tool,
6883
- rule: config.extractRule?.(match),
6965
+ rule,
6884
6966
  defectClass: config.defectClass,
6885
6967
  fixable,
6886
6968
  autoFixAvailable,
@@ -7001,7 +7083,7 @@ function parseGolangciJson(raw, filePath, cwd) {
7001
7083
  line: issue.Pos.Line,
7002
7084
  column: issue.Pos.Column,
7003
7085
  severity,
7004
- semantic: severity === "error" ? "blocking" : "warning",
7086
+ semantic: semanticFor(severity),
7005
7087
  tool: "golangci-lint",
7006
7088
  rule: issue.FromLinter,
7007
7089
  defectClass: "correctness",
@@ -7018,13 +7100,14 @@ var golangciRunner = {
7018
7100
  appliesTo: ["go"],
7019
7101
  priority: PRIORITY.GENERAL_ANALYSIS,
7020
7102
  timeoutMs: 9e4,
7103
+ requiresConfig: (cwd) => hasGolangciConfig(cwd),
7021
7104
  async run(ctx) {
7022
7105
  const cwd = resolveRunnerCwd(ctx, "golangci-lint");
7023
7106
  const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
7024
7107
  if (policy && !policy.preferredRunners.includes("golangci-lint")) {
7025
7108
  return { status: "skipped", diagnostics: [], semantic: "none" };
7026
7109
  }
7027
- if (!hasGolangciConfig(cwd)) {
7110
+ if (!golangciRunner.requiresConfig?.(cwd)) {
7028
7111
  return { status: "skipped", diagnostics: [], semantic: "none" };
7029
7112
  }
7030
7113
  const cmd = await resolveAvailableOrInstall(golangci, "golangci-lint", cwd);
@@ -7038,13 +7121,11 @@ var golangciRunner = {
7038
7121
  "--show-stats=false",
7039
7122
  ctx.filePath
7040
7123
  ], { timeout: 6e4, cwd });
7041
- const raw = (result.stdout ?? "").length > 0 ? result.stdout ?? "" : result.status !== 0 ? result.stderr || "" : "";
7042
7124
  const parsed = parseToolRun("golangci-lint", {
7043
7125
  result,
7044
- output: raw,
7045
7126
  // EXIT TABLE (golangci-lint v2 docs https://golangci-lint.run/docs/welcome/quick-start/; 2.14.0 exits 1 on findings and 3 on an unknown flag): 0 clean; 1 findings; 2 error; 3 error; 4 error; 5 error; other nonzero rejected.
7046
7127
  exitCodes: { ran: [1, 2, 3, 4, 5] }
7047
- }, (raw2) => parseGolangciJson(raw2, ctx.filePath, cwd));
7128
+ }, (raw) => parseGolangciJson(raw, ctx.filePath, cwd), { parseStreams: "stdout-else-stderr" });
7048
7129
  if (parsed.skipped)
7049
7130
  return parsed.skipped;
7050
7131
  return finishParsedRun({
@@ -7059,7 +7140,6 @@ var golangci_lint_default = golangciRunner;
7059
7140
 
7060
7141
  // dist/clients/dispatch/runners/hadolint.js
7061
7142
  import * as path20 from "node:path";
7062
- var hadolint = createAvailabilityChecker("hadolint", ".exe");
7063
7143
  function parseHadolintOutput(raw, filePath, cwd) {
7064
7144
  try {
7065
7145
  const parsed = JSON.parse(raw);
@@ -7078,7 +7158,7 @@ function parseHadolintOutput(raw, filePath, cwd) {
7078
7158
  line: item.line,
7079
7159
  column: item.column ?? 1,
7080
7160
  severity,
7081
- semantic: severity === "error" ? "blocking" : "warning",
7161
+ semantic: semanticFor(severity),
7082
7162
  tool: "hadolint",
7083
7163
  rule: item.code,
7084
7164
  fixable: false
@@ -7100,12 +7180,7 @@ var hadolintRunner = {
7100
7180
  if (policy && !policy.preferredRunners.includes("hadolint")) {
7101
7181
  return { status: "skipped", diagnostics: [], semantic: "none" };
7102
7182
  }
7103
- let cmd = null;
7104
- if (await hadolint.isAvailableAsync(cwd)) {
7105
- cmd = hadolint.getCommand(cwd);
7106
- } else {
7107
- cmd = await resolveToolCommandWithInstallFallback(cwd, "hadolint");
7108
- }
7183
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "hadolint");
7109
7184
  if (!cmd) {
7110
7185
  return { status: "skipped", diagnostics: [], semantic: "none" };
7111
7186
  }
@@ -7183,7 +7258,7 @@ ${line.trim()}`;
7183
7258
  line: location.line,
7184
7259
  column: 1,
7185
7260
  severity,
7186
- semantic: severity === "error" ? "blocking" : "warning",
7261
+ semantic: semanticFor(severity),
7187
7262
  tool: "helm-lint",
7188
7263
  rule: level.toLowerCase(),
7189
7264
  fixable: false
@@ -7222,15 +7297,18 @@ async function lintChart(chartRoot, cwd) {
7222
7297
  if (truncatedByOutputCap(result)) {
7223
7298
  return failedResult("parser_error", "helm lint output was truncated before parsing completed");
7224
7299
  }
7300
+ const timedOut = spawnTimedOut(result) ? skipUnlessToolRan("helm-lint", { result }) : null;
7301
+ if (timedOut)
7302
+ return timedOut;
7225
7303
  const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
7226
7304
  const diagnostics = parseHelmLintOutput(output, chartRoot);
7227
7305
  const typedFailure = result.spawnFailure?.kind;
7228
7306
  if (typedFailure) {
7229
- const failureKind = typedFailure === "tool-not-found" ? "unavailable" : typedFailure === "timeout" ? "timeout" : typedFailure === "killed" && result.failure === "aborted" ? "aborted" : "server_error";
7307
+ const failureKind = typedFailure === "tool-not-found" ? "unavailable" : typedFailure === "killed" && result.failure === "aborted" ? "aborted" : "server_error";
7230
7308
  return failedResult(failureKind, result.error?.message || `helm lint ${typedFailure}`);
7231
7309
  }
7232
7310
  if (result.failure) {
7233
- return failedResult(result.failure === "timeout" ? "timeout" : result.failure, result.error?.message || `helm lint ${result.failure}`);
7311
+ return failedResult(result.failure, result.error?.message || `helm lint ${result.failure}`);
7234
7312
  }
7235
7313
  const hasErrorDiagnostic = diagnostics.some((diagnostic) => diagnostic.severity === "error");
7236
7314
  if (result.status !== 0 && !hasErrorDiagnostic) {
@@ -7272,7 +7350,7 @@ var helmLintRunner = {
7272
7350
  var helm_lint_default = helmLintRunner;
7273
7351
 
7274
7352
  // dist/clients/dispatch/runners/helm-render.js
7275
- import * as fs12 from "node:fs";
7353
+ import * as fs9 from "node:fs";
7276
7354
  import * as path22 from "node:path";
7277
7355
  var helm2 = createAvailabilityChecker("helm", ".exe", ["version", "--short"]);
7278
7356
  var trivy = createAvailabilityChecker("trivy", ".exe");
@@ -7305,10 +7383,10 @@ function resolveTemplateSource(sourceRef, chartRoot, realChartRoot) {
7305
7383
  if (!isWithinIdentity(candidate, chartRoot))
7306
7384
  return null;
7307
7385
  try {
7308
- if (!fs12.lstatSync(candidate).isFile())
7386
+ if (!fs9.lstatSync(candidate).isFile())
7309
7387
  return null;
7310
- const root = realChartRoot ?? fs12.realpathSync(chartRoot);
7311
- if (!isWithinIdentity(fs12.realpathSync(candidate), root))
7388
+ const root = realChartRoot ?? fs9.realpathSync(chartRoot);
7389
+ if (!isWithinIdentity(fs9.realpathSync(candidate), root))
7312
7390
  return null;
7313
7391
  } catch {
7314
7392
  return null;
@@ -7317,7 +7395,7 @@ function resolveTemplateSource(sourceRef, chartRoot, realChartRoot) {
7317
7395
  }
7318
7396
  function canonicalChartRoot(chartRoot) {
7319
7397
  try {
7320
- return fs12.realpathSync(chartRoot);
7398
+ return fs9.realpathSync(chartRoot);
7321
7399
  } catch {
7322
7400
  return chartRoot;
7323
7401
  }
@@ -7519,6 +7597,10 @@ function failedResult2(kind, message) {
7519
7597
  failureMessage: message.slice(0, 200)
7520
7598
  };
7521
7599
  }
7600
+ function startupFailureResult(kind, render) {
7601
+ const timedOut = kind === "timeout" ? skipUnlessToolRan("helm-render", { result: render }) : null;
7602
+ return timedOut ?? failedResult2(kind, render.error?.message || `helm template ${kind}`);
7603
+ }
7522
7604
  var OUR_RENDER_FLAGS = ["--output-dir"];
7523
7605
  function rejectedOurInvocation(output) {
7524
7606
  if (!output)
@@ -7536,7 +7618,7 @@ function spawnFailureKind(result) {
7536
7618
  const typed = result.spawnFailure?.kind;
7537
7619
  if (typed === "tool-not-found")
7538
7620
  return "unavailable";
7539
- if (typed === "timeout" || result.failure === "timeout")
7621
+ if (spawnTimedOut(result))
7540
7622
  return "timeout";
7541
7623
  if (typed === "killed" || result.failure === "aborted")
7542
7624
  return "aborted";
@@ -7552,7 +7634,7 @@ function collectRenderedFiles(root) {
7552
7634
  const dir = stack.pop();
7553
7635
  let entries;
7554
7636
  try {
7555
- entries = fs12.readdirSync(dir, { withFileTypes: true });
7637
+ entries = fs9.readdirSync(dir, { withFileTypes: true });
7556
7638
  } catch {
7557
7639
  continue;
7558
7640
  }
@@ -7591,7 +7673,7 @@ function readRenderedTree(outputDir, chartRoot) {
7591
7673
  for (const renderedPath of walk2.files) {
7592
7674
  let content;
7593
7675
  try {
7594
- content = fs12.readFileSync(renderedPath, "utf-8");
7676
+ content = fs9.readFileSync(renderedPath, "utf-8");
7595
7677
  } catch {
7596
7678
  unreadable += 1;
7597
7679
  continue;
@@ -7710,7 +7792,7 @@ function logRenderPass(filePath, chartRoot, startedAt, metadata) {
7710
7792
  metadata: { chartRoot, ...metadata }
7711
7793
  });
7712
7794
  }
7713
- function discardScratchDir(outputDir, filePath, remove = (target) => fs12.rmSync(target, { recursive: true, force: true })) {
7795
+ function discardScratchDir(outputDir, filePath, remove = (target) => fs9.rmSync(target, { recursive: true, force: true })) {
7714
7796
  try {
7715
7797
  remove(outputDir);
7716
7798
  } catch (error) {
@@ -7731,7 +7813,7 @@ async function renderAndValidate(chartRoot, cwd, filePath) {
7731
7813
  const helmCmd = await resolveAvailableOrInstall(helm2, "helm", cwd);
7732
7814
  if (!helmCmd)
7733
7815
  return helmUnavailableResult(cwd);
7734
- const outputDir = fs12.mkdtempSync(path22.join(scannerReportParentDir(), "pi-lens-helm-render-"));
7816
+ const outputDir = fs9.mkdtempSync(path22.join(scannerReportParentDir(), "pi-lens-helm-render-"));
7735
7817
  try {
7736
7818
  const render = await safeSpawnAsync(helmCmd, ["template", "pi-lens-render", chartRoot, "--output-dir", outputDir], {
7737
7819
  cwd,
@@ -7757,7 +7839,7 @@ async function renderAndValidate(chartRoot, cwd, filePath) {
7757
7839
  outcome: "runner-failed",
7758
7840
  failureKind: startupFailure
7759
7841
  });
7760
- return failedResult2(startupFailure, render.error?.message || `helm template ${startupFailure}`);
7842
+ return startupFailureResult(startupFailure, render);
7761
7843
  }
7762
7844
  if (render.status !== 0) {
7763
7845
  const ourFlag = rejectedOurInvocation(renderOutput);
@@ -7864,7 +7946,6 @@ var helm_render_default = helmRenderRunner;
7864
7946
 
7865
7947
  // dist/clients/dispatch/runners/htmlhint.js
7866
7948
  import * as path23 from "node:path";
7867
- var htmlhint = createAvailabilityChecker("htmlhint");
7868
7949
  var HTMLHINT_RULES = {
7869
7950
  "tag-pair": true,
7870
7951
  "attr-no-duplication": true,
@@ -7896,7 +7977,7 @@ function parseHtmlhintOutput(raw, filePath, cwd) {
7896
7977
  line: lineNum,
7897
7978
  column: col,
7898
7979
  severity,
7899
- semantic: severity === "error" ? "blocking" : "warning",
7980
+ semantic: semanticFor(severity),
7900
7981
  tool: "htmlhint",
7901
7982
  rule,
7902
7983
  fixable: false
@@ -7915,12 +7996,7 @@ var htmlhintRunner = {
7915
7996
  if (policy && !policy.preferredRunners.includes("htmlhint")) {
7916
7997
  return { status: "skipped", diagnostics: [], semantic: "none" };
7917
7998
  }
7918
- let cmd = null;
7919
- if (await htmlhint.isAvailableAsync(cwd)) {
7920
- cmd = htmlhint.getCommand(cwd);
7921
- } else {
7922
- cmd = await resolveToolCommandWithInstallFallback(cwd, "htmlhint");
7923
- }
7999
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "htmlhint");
7924
8000
  if (!cmd) {
7925
8001
  return { status: "skipped", diagnostics: [], semantic: "none" };
7926
8002
  }
@@ -8041,7 +8117,6 @@ var javac_default = javacRunner;
8041
8117
 
8042
8118
  // dist/clients/dispatch/runners/ktlint.js
8043
8119
  import * as path25 from "node:path";
8044
- var ktlint = createAvailabilityChecker("ktlint", ".exe");
8045
8120
  var KTLINT_EXIT_CODES = { ran: [1, 2, 3] };
8046
8121
  function normalizeKtlintResults(parsed) {
8047
8122
  if (Array.isArray(parsed)) {
@@ -8117,12 +8192,7 @@ var ktlintRunner = {
8117
8192
  if (policy && !policy.preferredRunners.includes("ktlint")) {
8118
8193
  return { status: "skipped", diagnostics: [], semantic: "none" };
8119
8194
  }
8120
- let cmd = null;
8121
- if (await ktlint.isAvailableAsync(cwd)) {
8122
- cmd = ktlint.getCommand(cwd);
8123
- } else {
8124
- cmd = await resolveToolCommandWithInstallFallback(cwd, "ktlint");
8125
- }
8195
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "ktlint");
8126
8196
  if (!cmd)
8127
8197
  return { status: "skipped", diagnostics: [], semantic: "none" };
8128
8198
  const absPath = path25.resolve(cwd, ctx.filePath);
@@ -8453,7 +8523,7 @@ var lsp_default = lspRunner;
8453
8523
  import * as path27 from "node:path";
8454
8524
 
8455
8525
  // dist/clients/dispatch/runners/utils/markdownlint-api.js
8456
- import * as fs13 from "node:fs";
8526
+ import * as fs10 from "node:fs";
8457
8527
  import * as path26 from "node:path";
8458
8528
  var PACKAGE_NAME = "markdownlint-cli2";
8459
8529
  function locateCli2Entry(command) {
@@ -8468,14 +8538,14 @@ function locateCli2Entry(command) {
8468
8538
  candidates.push(path26.dirname(realpathOrResolve(shim)));
8469
8539
  for (const dir of candidates) {
8470
8540
  try {
8471
- const manifest = JSON.parse(fs13.readFileSync(path26.join(dir, "package.json"), "utf8"));
8541
+ const manifest = JSON.parse(fs10.readFileSync(path26.join(dir, "package.json"), "utf8"));
8472
8542
  if (manifest.name !== PACKAGE_NAME)
8473
8543
  continue;
8474
8544
  const root = manifest.exports && typeof manifest.exports === "object" ? manifest.exports["."] : manifest.exports;
8475
8545
  if (typeof root !== "string")
8476
8546
  continue;
8477
8547
  const entry = path26.resolve(dir, root);
8478
- if (fs13.statSync(entry).isFile())
8548
+ if (fs10.statSync(entry).isFile())
8479
8549
  return entry;
8480
8550
  } catch {
8481
8551
  }
@@ -8504,10 +8574,6 @@ function markdownlintNoFixInvocation(options) {
8504
8574
  }
8505
8575
 
8506
8576
  // dist/clients/dispatch/runners/markdownlint.js
8507
- var markdownlint = createAvailabilityChecker("markdownlint-cli2", ".cmd", [
8508
- "--no-globs",
8509
- "-"
8510
- ]);
8511
8577
  var MARKDOWNLINT_EXIT_CODES = { ran: [1] };
8512
8578
  var MARKDOWNLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
8513
8579
  "MD001",
@@ -8582,18 +8648,9 @@ var markdownlintRunner = {
8582
8648
  if (policy && !policy.preferredRunners.includes("markdownlint")) {
8583
8649
  return { status: "skipped", diagnostics: [], semantic: "none" };
8584
8650
  }
8585
- let cmd = null;
8586
- if (await markdownlint.isAvailableAsync(cwd)) {
8587
- cmd = markdownlint.getCommand(cwd);
8588
- } else {
8589
- cmd = await resolveToolCommandWithInstallFallback(cwd, "markdownlint");
8590
- }
8651
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "markdownlint");
8591
8652
  if (!cmd)
8592
8653
  return { status: "skipped", diagnostics: [], semantic: "none" };
8593
- if (isInSpawnTimeoutCooldown(cmd)) {
8594
- logRunnerAdvisoryOnce(ctx, "markdownlint", cwd, `markdownlint: ${cmd} is cooling down after a spawn timeout \u2014 skipping (one bounded failure budget per edit)`);
8595
- return { status: "skipped", diagnostics: [], semantic: "none" };
8596
- }
8597
8654
  const configArgs = markdownlintConfigArgs(cwd);
8598
8655
  const args = [...configArgs, ctx.filePath];
8599
8656
  const invocation = markdownlintNoFixInvocation({ command: cmd, cwd, args });
@@ -8601,15 +8658,6 @@ var markdownlintRunner = {
8601
8658
  timeout: 15e3,
8602
8659
  cwd
8603
8660
  });
8604
- if (result.failure === "timeout") {
8605
- noteSpawnTimeout({
8606
- tool: "markdownlint",
8607
- command: cmd,
8608
- phase: "lint",
8609
- durationMs: 15e3,
8610
- teardown: result.timeoutTeardown
8611
- });
8612
- }
8613
8661
  const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
8614
8662
  const run = parseToolRun("markdownlint", { result, output: raw, exitCodes: MARKDOWNLINT_EXIT_CODES }, (out) => parseMarkdownlintOutput(out, ctx.filePath, cwd));
8615
8663
  if (run.skipped)
@@ -8628,7 +8676,6 @@ var markdownlint_default = markdownlintRunner;
8628
8676
 
8629
8677
  // dist/clients/dispatch/runners/mypy.js
8630
8678
  import * as path28 from "node:path";
8631
- var mypy = createAvailabilityChecker("mypy", "");
8632
8679
  var MYPY_EXIT_CODES = { ran: [1, 2] };
8633
8680
  function parseMypyOutput(raw, fallbackPath, cwd) {
8634
8681
  const diagnostics = [];
@@ -8649,7 +8696,7 @@ function parseMypyOutput(raw, fallbackPath, cwd) {
8649
8696
  line: Number(lineNum),
8650
8697
  column: col ? Number(col) : 1,
8651
8698
  severity,
8652
- semantic: severity === "error" ? "blocking" : "warning",
8699
+ semantic: semanticFor(severity),
8653
8700
  tool: "mypy",
8654
8701
  rule,
8655
8702
  defectClass: "correctness"
@@ -8662,17 +8709,13 @@ var mypyRunner = {
8662
8709
  appliesTo: ["python"],
8663
8710
  priority: PRIORITY.GENERAL_ANALYSIS,
8664
8711
  skipTestFiles: false,
8712
+ requiresConfig: (cwd) => hasMypyConfig(cwd),
8665
8713
  async run(ctx) {
8666
8714
  const cwd = resolveRunnerCwd(ctx, "mypy");
8667
- if (!hasMypyConfig(cwd)) {
8715
+ if (!mypyRunner.requiresConfig?.(cwd)) {
8668
8716
  return { status: "skipped", diagnostics: [], semantic: "none" };
8669
8717
  }
8670
- let cmd = null;
8671
- if (await mypy.isAvailableAsync(cwd)) {
8672
- cmd = mypy.getCommand(cwd);
8673
- } else {
8674
- cmd = await resolveToolCommandWithInstallFallback(cwd, "mypy");
8675
- }
8718
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "mypy");
8676
8719
  if (!cmd)
8677
8720
  return { status: "skipped", diagnostics: [], semantic: "none" };
8678
8721
  const result = await safeSpawnAsync(cmd, ["--no-error-summary", "--show-column-numbers", ctx.filePath], { timeout: 3e4, cwd });
@@ -8736,8 +8779,7 @@ var oxlintRunner = {
8736
8779
  if (cmd) {
8737
8780
  args = ["lint", "--format", "json", ctx.filePath];
8738
8781
  } else {
8739
- const oxlintCmd = resolveToolCommand(cwd, "oxlint") ?? "oxlint";
8740
- cmd = await ctx.hasTool(oxlintCmd) ? oxlintCmd : await resolveToolCommandWithInstallFallback(cwd, "oxlint");
8782
+ cmd = await resolveToolCommandWithInstallFallback(cwd, "oxlint");
8741
8783
  args = ["--format", "json", ctx.filePath];
8742
8784
  }
8743
8785
  if (!cmd) {
@@ -8811,7 +8853,7 @@ function oxlintProcessState(result) {
8811
8853
  const failureKind = result.spawnFailure?.kind;
8812
8854
  if (truncatedByOutputCap(result))
8813
8855
  return "truncated";
8814
- if (result.failure === "timeout" || failureKind === "timeout")
8856
+ if (spawnTimedOut(result))
8815
8857
  return "timeout";
8816
8858
  if (result.failure === "aborted" || failureKind === "killed")
8817
8859
  return "killed";
@@ -8944,7 +8986,7 @@ function parseOxlintJson(raw, filePath, cwd) {
8944
8986
  line: lineNum,
8945
8987
  column: colNum,
8946
8988
  severity,
8947
- semantic: severity === "error" ? "blocking" : "warning",
8989
+ semantic: semanticFor(severity),
8948
8990
  tool: "oxlint",
8949
8991
  rule,
8950
8992
  // Oxlint's help text is rule-specific guidance ("Remove the debugger
@@ -9101,13 +9143,14 @@ var phpstanRunner = {
9101
9143
  appliesTo: ["php"],
9102
9144
  priority: PRIORITY.GENERAL_ANALYSIS,
9103
9145
  skipTestFiles: false,
9146
+ requiresConfig: (cwd) => hasPhpstanConfig(cwd),
9104
9147
  async run(ctx) {
9105
9148
  const cwd = resolveRunnerCwd(ctx, "phpstan");
9106
9149
  const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
9107
9150
  if (policy && !policy.preferredRunners.includes("phpstan")) {
9108
9151
  return { status: "skipped", diagnostics: [], semantic: "none" };
9109
9152
  }
9110
- if (!hasPhpstanConfig(cwd)) {
9153
+ if (!phpstanRunner.requiresConfig?.(cwd)) {
9111
9154
  return { status: "skipped", diagnostics: [], semantic: "none" };
9112
9155
  }
9113
9156
  const cmd = await resolvePhpstan(cwd);
@@ -9177,12 +9220,14 @@ var prismaValidateRunner = {
9177
9220
  ${result.stderr ?? ""}`;
9178
9221
  const diagnostics = parsePrismaValidateOutput(output, ctx.filePath);
9179
9222
  const findings = PRISMA_VALIDATION_REPORT.test(output) ? diagnostics : [];
9223
+ if (findings.length === 0) {
9224
+ const skipped = skipUnlessToolRan("prisma-validate", { result, output });
9225
+ if (skipped)
9226
+ return skipped;
9227
+ }
9180
9228
  const cutShort = faultIfCutShort(result, findings);
9181
9229
  if (cutShort)
9182
9230
  return cutShort;
9183
- if (diagnostics.length === 0) {
9184
- return { status: "skipped", diagnostics: [], semantic: "none" };
9185
- }
9186
9231
  return finishParsedRun({
9187
9232
  tool: "prisma-validate",
9188
9233
  ctx,
@@ -9199,7 +9244,7 @@ ${result.stderr ?? ""}`;
9199
9244
  var prisma_validate_default = prismaValidateRunner;
9200
9245
 
9201
9246
  // dist/clients/dispatch/runners/psscriptanalyzer.js
9202
- import * as fs14 from "node:fs/promises";
9247
+ import * as fs11 from "node:fs/promises";
9203
9248
  import * as path33 from "node:path";
9204
9249
  var PS_SCRIPT = `
9205
9250
  param([string]$FilePath)
@@ -9364,7 +9409,7 @@ function parsePSAnalyzerOutput(raw, filePath) {
9364
9409
  line: item.Line,
9365
9410
  column: item.Column ?? 1,
9366
9411
  severity,
9367
- semantic: severity === "error" ? "blocking" : "warning",
9412
+ semantic: semanticFor(severity),
9368
9413
  tool: "psscriptanalyzer",
9369
9414
  rule,
9370
9415
  fixable: false
@@ -9394,7 +9439,7 @@ var psScriptAnalyzerRunner = {
9394
9439
  const cwd = resolveRunnerCwd(ctx, "psscriptanalyzer");
9395
9440
  const absPath = path33.resolve(cwd, ctx.filePath);
9396
9441
  const tmpScript = path33.join(scannerReportParentDir(), `pi-lens-psa-${process.pid}.ps1`);
9397
- await fs14.writeFile(tmpScript, PS_SCRIPT, "utf-8");
9442
+ await fs11.writeFile(tmpScript, PS_SCRIPT, "utf-8");
9398
9443
  try {
9399
9444
  const sampler = startHostStallSampler();
9400
9445
  const startedAt = Date.now();
@@ -9423,7 +9468,7 @@ var psScriptAnalyzerRunner = {
9423
9468
  hostStallMs
9424
9469
  });
9425
9470
  incrementDegradationCount({
9426
- kind: "grammar-blocked",
9471
+ kind: "powershell-run-failed",
9427
9472
  subject: "psscriptanalyzer",
9428
9473
  reason: `PowerShell (${cmd}) -File analysis exited with no status -- crash or signal-killed process`
9429
9474
  });
@@ -9449,7 +9494,7 @@ var psScriptAnalyzerRunner = {
9449
9494
  hostStallMs
9450
9495
  });
9451
9496
  incrementDegradationCount({
9452
- kind: "grammar-blocked",
9497
+ kind: "powershell-run-failed",
9453
9498
  subject: "psscriptanalyzer",
9454
9499
  reason: policyDenied ? `PowerShell execution policy blocked -File analysis for ${cmd}: ${stderrText.trim().split("\n")[0] || "SecurityError"}` : `PowerShell -File analysis for ${cmd} exited ${result.status}: ${stderrText.trim().slice(0, 200) || "no stderr"}`
9455
9500
  });
@@ -9479,7 +9524,7 @@ var psScriptAnalyzerRunner = {
9479
9524
  classifiedBy: "caller"
9480
9525
  });
9481
9526
  incrementDegradationCount({
9482
- kind: "grammar-blocked",
9527
+ kind: "powershell-run-failed",
9483
9528
  subject: "psscriptanalyzer",
9484
9529
  reason: `PowerShell -File analysis for ${cmd} exited 0 but stdout was ${unreadableReason}`
9485
9530
  });
@@ -9494,7 +9539,7 @@ var psScriptAnalyzerRunner = {
9494
9539
  semantic: hasErrors ? "blocking" : "warning"
9495
9540
  });
9496
9541
  } finally {
9497
- await fs14.unlink(tmpScript).catch(() => {
9542
+ await fs11.unlink(tmpScript).catch(() => {
9498
9543
  });
9499
9544
  }
9500
9545
  }
@@ -9524,7 +9569,7 @@ var pyrightRunner = {
9524
9569
  cmd = installedPath;
9525
9570
  }
9526
9571
  if (!cmd) {
9527
- const { findCommandAsync } = await import("./chunk-3NPWO5UO.js");
9572
+ const { findCommandAsync } = await import("./chunk-KBSC5Z3G.js");
9528
9573
  const foundCmd = await findCommandAsync("pyright");
9529
9574
  if (foundCmd)
9530
9575
  cmd = foundCmd;
@@ -9602,16 +9647,24 @@ function parsePyrightOutput(data, _filePath) {
9602
9647
  const generalDiags = data.generalDiagnostics || [];
9603
9648
  for (const diag of generalDiags) {
9604
9649
  const start = diag.range?.start;
9650
+ const message = diag.message || "Type error";
9651
+ const severity = normalizePyrightSeverity(diag.severity);
9652
+ const line = (start?.line ?? 0) + 1;
9605
9653
  diagnostics.push({
9606
- id: `pyright-${diag.rule || start?.line || "unknown"}`,
9607
- message: diag.message || "Type error",
9654
+ // #5412: a rule-less finding (a syntax error, say) keys its id on its
9655
+ // line and its message, as go vet's id does (`go-vet-<line>-<hash>`).
9656
+ // A message-only id gave two identical messages on different lines one
9657
+ // id, and the delta reads `Diagnostic.id` alone, so the second line was
9658
+ // held back as already seen.
9659
+ id: diag.rule ? `pyright-${diag.rule}` : `pyright-${line}-${hashText(message)}`,
9660
+ message,
9608
9661
  filePath: diag.file || _filePath,
9609
- line: (start?.line ?? 0) + 1,
9662
+ line,
9610
9663
  column: (start?.character ?? 0) + 1,
9611
- severity: normalizePyrightSeverity(diag.severity),
9664
+ severity,
9612
9665
  // Blocking classification stays error-only — reviving the info tier
9613
- // must never widen what fails a turn.
9614
- semantic: diag.severity === "error" ? "blocking" : "warning",
9666
+ // must never widen what fails a turn (`semanticFor`).
9667
+ semantic: semanticFor(severity),
9615
9668
  tool: "pyright",
9616
9669
  rule: diag.rule
9617
9670
  });
@@ -9647,7 +9700,7 @@ function parseRubocopJson(raw, filePath, cwd) {
9647
9700
  line: offense.location.line,
9648
9701
  column: offense.location.column,
9649
9702
  severity,
9650
- semantic: severity === "error" ? "blocking" : "warning",
9703
+ semantic: semanticFor(severity),
9651
9704
  tool: "rubocop",
9652
9705
  rule: offense.cop_name,
9653
9706
  fixable: offense.correctable,
@@ -9677,13 +9730,7 @@ var rubocopRunner = {
9677
9730
  }
9678
9731
  const { cmd, args } = resolved;
9679
9732
  const result = await safeSpawnAsync(cmd, [...args, "--format", "json", "--no-color", ctx.filePath], { timeout: 3e4, cwd });
9680
- const run = parseToolRun("rubocop", {
9681
- result,
9682
- // Classify both streams so stderr-only failures reach the parse-error
9683
- // path, while parseOutput keeps RuboCop's native JSON parser on stdout.
9684
- output: `${result.stdout}${result.stderr}`,
9685
- exitCodes: { ran: [1, 2] }
9686
- }, (output) => parseRubocopJson(output, ctx.filePath, cwd), { parseOutput: result.stdout });
9733
+ const run = parseToolRun("rubocop", { result, exitCodes: { ran: [1, 2] } }, (output) => parseRubocopJson(output, ctx.filePath, cwd), { parseStreams: "stdout-else-stderr" });
9687
9734
  if (run.skipped)
9688
9735
  return run.skipped;
9689
9736
  return finishParsedRun({
@@ -9715,7 +9762,7 @@ function parseRuffJson(raw, filePath) {
9715
9762
  line: item.location?.row ?? 1,
9716
9763
  column: item.location?.column ?? 1,
9717
9764
  severity,
9718
- semantic: severity === "error" ? "blocking" : "warning",
9765
+ semantic: semanticFor(severity),
9719
9766
  tool: "ruff",
9720
9767
  rule: code,
9721
9768
  fixable: toolFixable,
@@ -9751,11 +9798,11 @@ var ruffRunner = {
9751
9798
  ...configArgs,
9752
9799
  ctx.filePath
9753
9800
  ], { cwd, timeout: 3e4 });
9754
- const raw = stripAnsi(checkResult.stdout + checkResult.stderr);
9755
- const run = parseToolRun("ruff", { result: checkResult, output: raw, exitCodes: { ran: [1, 2] } }, (output) => {
9801
+ const run = parseToolRun("ruff", { result: checkResult, exitCodes: { ran: [1, 2] } }, (rawOutput) => {
9802
+ const output = stripAnsi(rawOutput);
9756
9803
  const diagnostics = parseRuffJson(output, ctx.filePath);
9757
9804
  return diagnostics.length > 0 ? diagnostics : parseRuffOutput(output, ctx.filePath, cwd);
9758
- });
9805
+ }, { parseStreams: "stdout-else-stderr" });
9759
9806
  if (run.skipped)
9760
9807
  return run.skipped;
9761
9808
  return finishParsedRun({
@@ -9847,12 +9894,18 @@ var rustClippyRunner = {
9847
9894
  const diagnostics = allDiagnostics.filter((d) => pathsEqual(resolve32(cargoDir, d.filePath), absEdited));
9848
9895
  const hasBlocking = diagnostics.some((d) => d.semantic === "blocking");
9849
9896
  const semantic = hasBlocking ? "blocking" : diagnostics.length > 0 ? "warning" : "none";
9897
+ if (spawnTimedOut(result)) {
9898
+ const skipped = diagnostics.length === 0 ? skipUnlessToolRan("rust-clippy", { result }) : null;
9899
+ const cut = skipped ?? faultIfCutShort(result, diagnostics);
9900
+ if (cut)
9901
+ return cut;
9902
+ }
9850
9903
  if (result.error || result.failure) {
9851
9904
  return {
9852
9905
  status: "failed",
9853
9906
  diagnostics,
9854
9907
  semantic,
9855
- failureKind: result.failure === "timeout" || result.spawnFailure?.kind === "timeout" ? "timeout" : "server_error",
9908
+ failureKind: "server_error",
9856
9909
  rawOutput: raw.substring(0, 500)
9857
9910
  };
9858
9911
  }
@@ -9912,7 +9965,7 @@ function parseClippyOutput(raw, fallbackPath, cargoDir) {
9912
9965
  line: span.line_start || 0,
9913
9966
  column: span.column_start || 0,
9914
9967
  severity: normalizedSeverity,
9915
- semantic: normalizedSeverity === "error" ? "blocking" : "warning",
9968
+ semantic: semanticFor(normalizedSeverity),
9916
9969
  tool: "rust-clippy",
9917
9970
  rule: message.code?.code,
9918
9971
  defectClass: "correctness",
@@ -9928,7 +9981,7 @@ var rust_clippy_default = rustClippyRunner;
9928
9981
 
9929
9982
  // dist/clients/dispatch/runners/spotbugs.js
9930
9983
  import { randomUUID } from "node:crypto";
9931
- import * as fs15 from "node:fs";
9984
+ import * as fs12 from "node:fs";
9932
9985
  import * as path35 from "node:path";
9933
9986
  var java = createAvailabilityChecker("java", ".exe", ["-version"]);
9934
9987
  var spotbugs = createAvailabilityChecker("spotbugs", ".bat", ["-version"]);
@@ -9945,7 +9998,7 @@ function classesSignature(classesDir) {
9945
9998
  break;
9946
9999
  let entries;
9947
10000
  try {
9948
- entries = fs15.readdirSync(dir, { withFileTypes: true });
10001
+ entries = fs12.readdirSync(dir, { withFileTypes: true });
9949
10002
  } catch {
9950
10003
  continue;
9951
10004
  }
@@ -9956,7 +10009,7 @@ function classesSignature(classesDir) {
9956
10009
  } else if (entry.isFile() && entry.name.endsWith(".class")) {
9957
10010
  count++;
9958
10011
  try {
9959
- const m = fs15.statSync(full).mtimeMs;
10012
+ const m = fs12.statSync(full).mtimeMs;
9960
10013
  if (m > newest)
9961
10014
  newest = m;
9962
10015
  } catch {
@@ -10103,7 +10156,7 @@ var spotbugsRunner = {
10103
10156
  ], { cwd, timeout: 12e4 });
10104
10157
  let xml = "";
10105
10158
  try {
10106
- xml = fs15.readFileSync(tmpXml, "utf8");
10159
+ xml = fs12.readFileSync(tmpXml, "utf8");
10107
10160
  } catch {
10108
10161
  if (result.error || (result.status ?? 0) > 1) {
10109
10162
  return {
@@ -10116,7 +10169,7 @@ var spotbugsRunner = {
10116
10169
  return { status: "succeeded", diagnostics: [], semantic: "none" };
10117
10170
  } finally {
10118
10171
  try {
10119
- fs15.rmSync(tmpXml, { force: true });
10172
+ fs12.rmSync(tmpXml, { force: true });
10120
10173
  } catch {
10121
10174
  }
10122
10175
  }
@@ -10169,7 +10222,7 @@ function parseShellcheckOutput(raw, filePath, cwd) {
10169
10222
  line: item.line,
10170
10223
  column: item.column || 1,
10171
10224
  severity,
10172
- semantic: severity === "error" ? "blocking" : "warning",
10225
+ semantic: semanticFor(severity),
10173
10226
  tool: "shellcheck",
10174
10227
  rule: ruleCode,
10175
10228
  fixable: !!item.fix,
@@ -10237,8 +10290,7 @@ var shellcheckRunner = {
10237
10290
  if (result.status === 0 && !result.stdout?.trim()) {
10238
10291
  return { status: "succeeded", diagnostics: [], semantic: "none" };
10239
10292
  }
10240
- const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
10241
- const parsed = parseToolRun("shellcheck", { result, output: raw, exitCodes: SHELLCHECK_EXIT_CODES }, (output) => parseShellcheckOutput(output, ctx.filePath, cwd));
10293
+ const parsed = parseToolRun("shellcheck", { result, exitCodes: SHELLCHECK_EXIT_CODES }, (output) => parseShellcheckOutput(output, ctx.filePath, cwd), { parseStreams: "stdout-else-stderr" });
10242
10294
  if (parsed.skipped)
10243
10295
  return parsed.skipped;
10244
10296
  return finishParsedRun({
@@ -10365,9 +10417,6 @@ var fish_indent_default = fishIndentRunner;
10365
10417
 
10366
10418
  // dist/clients/dispatch/runners/shfmt.js
10367
10419
  var shfmt = createAvailabilityChecker("shfmt", ".exe");
10368
- function hasEditorConfig(cwd) {
10369
- return findNearestContaining(cwd, [".editorconfig"]) !== void 0;
10370
- }
10371
10420
  var shfmtRunner = {
10372
10421
  id: "shfmt",
10373
10422
  appliesTo: ["shell"],
@@ -10420,7 +10469,7 @@ var shfmtRunner = {
10420
10469
  semantic: "blocking"
10421
10470
  });
10422
10471
  }
10423
- if (!hasEditorConfig(cwd)) {
10472
+ if (!hasToolConfig("editorconfig", cwd)) {
10424
10473
  return { status: "skipped", diagnostics: [], semantic: "none" };
10425
10474
  }
10426
10475
  const diffOutput = result.stdout ?? result.stderr ?? "";
@@ -10455,6 +10504,7 @@ var typos = createAvailabilityChecker("typos", ".exe");
10455
10504
  var TYPOS_EXIT_CODES = { ran: [2] };
10456
10505
  function parseTyposOutput(raw, filePath, cwd) {
10457
10506
  const diagnostics = [];
10507
+ let readRecords = 0;
10458
10508
  const absTarget = path37.resolve(cwd, filePath);
10459
10509
  if (!raw.trim()) {
10460
10510
  return diagnostics;
@@ -10463,6 +10513,8 @@ function parseTyposOutput(raw, filePath, cwd) {
10463
10513
  for (const line of lines) {
10464
10514
  try {
10465
10515
  const parsed = JSON.parse(line);
10516
+ if (parsed && typeof parsed === "object")
10517
+ readRecords += 1;
10466
10518
  if (!parsed.typo || !parsed.line_num)
10467
10519
  continue;
10468
10520
  if (parsed.path && !pathsEqual(path37.resolve(cwd, parsed.path), absTarget))
@@ -10489,7 +10541,7 @@ function parseTyposOutput(raw, filePath, cwd) {
10489
10541
  void err;
10490
10542
  }
10491
10543
  }
10492
- return diagnostics;
10544
+ return diagnostics.length > 0 || readRecords > 0 ? diagnostics : null;
10493
10545
  }
10494
10546
  var spellcheckRunner = {
10495
10547
  id: "spellcheck",
@@ -10510,13 +10562,13 @@ var spellcheckRunner = {
10510
10562
  const run = parseToolRun("spellcheck", { result, exitCodes: TYPOS_EXIT_CODES }, (out) => parseTyposOutput(out, ctx.filePath, cwd), { parseOutput: `${result.stdout ?? ""}${result.stderr ?? ""}` });
10511
10563
  if (run.skipped)
10512
10564
  return run.skipped;
10513
- const diagnostics = run.diagnostics;
10514
- if (diagnostics.length === 0) {
10515
- return { status: "succeeded", diagnostics: [], semantic: "none" };
10516
- }
10517
- return findingsResult(diagnostics, {
10518
- status: "failed",
10519
- semantic: "warning"
10565
+ return finishParsedRun({
10566
+ tool: "spellcheck",
10567
+ ctx,
10568
+ result,
10569
+ diagnostics: run.diagnostics,
10570
+ unreadable: run.unreadable,
10571
+ classify: () => ({ status: "failed", semantic: "warning" })
10520
10572
  });
10521
10573
  }
10522
10574
  };
@@ -10524,7 +10576,6 @@ var spellcheck_default = spellcheckRunner;
10524
10576
 
10525
10577
  // dist/clients/dispatch/runners/sqlfluff.js
10526
10578
  import * as path38 from "node:path";
10527
- var sqlfluff = createAvailabilityChecker("sqlfluff", ".exe");
10528
10579
  var SQLFLUFF_EXIT_CODES = { ran: [1] };
10529
10580
  var SQLFLUFF_FIXABLE_RULES = /* @__PURE__ */ new Set([
10530
10581
  // Layout — pure formatting
@@ -10622,12 +10673,7 @@ var sqlfluffRunner = {
10622
10673
  if (!hasConfig) {
10623
10674
  logRunnerAdvisoryOnce(ctx, "sqlfluff", cwd, "sqlfluff: no config detected, using ANSI dialect defaults");
10624
10675
  }
10625
- let cmd = null;
10626
- if (await sqlfluff.isAvailableAsync(cwd)) {
10627
- cmd = sqlfluff.getCommand(cwd);
10628
- } else {
10629
- cmd = await resolveToolCommandWithInstallFallback(cwd, "sqlfluff");
10630
- }
10676
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "sqlfluff");
10631
10677
  if (!cmd)
10632
10678
  return { status: "skipped", diagnostics: [], semantic: "none" };
10633
10679
  const args = ["lint", "--format", "json"];
@@ -10656,7 +10702,6 @@ var sqlfluff_default = sqlfluffRunner;
10656
10702
 
10657
10703
  // dist/clients/dispatch/runners/stylelint.js
10658
10704
  import * as path39 from "node:path";
10659
- var stylelint = createAvailabilityChecker("stylelint", ".cmd");
10660
10705
  var STYLELINT_EXIT_CODES = { ran: [1, 2] };
10661
10706
  function stylelintReport(stdout, stderr) {
10662
10707
  for (const stream of [stdout, stderr]) {
@@ -10714,7 +10759,7 @@ function parseStylelintJson(raw, filePath, cwd) {
10714
10759
  line: w.line,
10715
10760
  column: w.column,
10716
10761
  severity,
10717
- semantic: severity === "error" ? "blocking" : "warning",
10762
+ semantic: semanticFor(severity),
10718
10763
  tool: "stylelint",
10719
10764
  rule: w.rule,
10720
10765
  fixable,
@@ -10743,12 +10788,7 @@ var stylelintRunner = {
10743
10788
  if (!hasConfig) {
10744
10789
  logRunnerAdvisoryOnce(ctx, "stylelint", cwd, "stylelint: no config detected, running with default rules");
10745
10790
  }
10746
- let cmd = null;
10747
- if (await stylelint.isAvailableAsync(cwd)) {
10748
- cmd = stylelint.getCommand(cwd);
10749
- } else {
10750
- cmd = await resolveToolCommandWithInstallFallback(cwd, "stylelint");
10751
- }
10791
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "stylelint");
10752
10792
  if (!cmd)
10753
10793
  return { status: "skipped", diagnostics: [], semantic: "none" };
10754
10794
  const result = await safeSpawnAsync(cmd, ["--formatter", "json", ctx.filePath], { timeout: 2e4, cwd });
@@ -10769,7 +10809,6 @@ var stylelint_default = stylelintRunner;
10769
10809
 
10770
10810
  // dist/clients/dispatch/runners/swiftlint.js
10771
10811
  import * as path40 from "node:path";
10772
- var swiftlint = createAvailabilityChecker("swiftlint", ".exe");
10773
10812
  var SWIFTLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
10774
10813
  "closing_brace",
10775
10814
  "colon",
@@ -10835,7 +10874,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10835
10874
  try {
10836
10875
  const parsed = JSON.parse(raw);
10837
10876
  if (!Array.isArray(parsed))
10838
- return diagnostics;
10877
+ return null;
10839
10878
  for (const item of parsed) {
10840
10879
  if (!item.reason)
10841
10880
  continue;
@@ -10856,7 +10895,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10856
10895
  line: item.line ?? 1,
10857
10896
  column: item.character ?? 1,
10858
10897
  severity,
10859
- semantic: severity === "error" ? "blocking" : "warning",
10898
+ semantic: semanticFor(severity),
10860
10899
  tool: "swiftlint",
10861
10900
  rule: ruleId,
10862
10901
  defectClass: "style",
@@ -10865,7 +10904,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10865
10904
  });
10866
10905
  }
10867
10906
  } catch {
10868
- return diagnostics;
10907
+ return null;
10869
10908
  }
10870
10909
  return diagnostics;
10871
10910
  }
@@ -10876,30 +10915,26 @@ var swiftlintRunner = {
10876
10915
  skipTestFiles: false,
10877
10916
  async run(ctx) {
10878
10917
  const cwd = resolveRunnerCwd(ctx, "swiftlint");
10879
- let cmd = null;
10880
- if (await swiftlint.isAvailableAsync(cwd)) {
10881
- cmd = swiftlint.getCommand(cwd);
10882
- } else {
10883
- cmd = await resolveToolCommandWithInstallFallback(cwd, "swiftlint");
10884
- }
10918
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "swiftlint");
10885
10919
  if (!cmd)
10886
10920
  return { status: "skipped", diagnostics: [], semantic: "none" };
10887
10921
  const result = await safeSpawnAsync(cmd, ["--reporter", "json", path40.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
10888
10922
  const run = parseToolRun("swiftlint", {
10889
10923
  result,
10890
10924
  // EXIT TABLE (SwiftLint 0.56 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
10925
+ // 2 is admitted although it is an error: its output is then read by
10926
+ // the parser, and a run that printed nothing parseable is a parse
10927
+ // error (failed/parser_error), never a clean file (#5411).
10891
10928
  exitCodes: { ran: [1, 2] }
10892
10929
  }, (out) => parseSwiftLintOutput(out, ctx.filePath, cwd));
10893
10930
  if (run.skipped)
10894
10931
  return run.skipped;
10895
- const diagnostics = run.diagnostics;
10896
- if (diagnostics.length === 0) {
10897
- return { status: "succeeded", diagnostics: [], semantic: "none" };
10898
- }
10899
- const hasBlocking = diagnostics.some((d) => d.semantic === "blocking");
10900
- return findingsResult(diagnostics, {
10901
- status: hasBlocking ? "failed" : "succeeded",
10902
- semantic: hasBlocking ? "blocking" : "warning"
10932
+ return finishParsedRun({
10933
+ tool: "swiftlint",
10934
+ ctx,
10935
+ result,
10936
+ diagnostics: run.diagnostics,
10937
+ unreadable: run.unreadable
10903
10938
  });
10904
10939
  }
10905
10940
  };
@@ -10907,13 +10942,15 @@ var swiftlint_default = swiftlintRunner;
10907
10942
 
10908
10943
  // dist/clients/dispatch/runners/taplo.js
10909
10944
  import * as path41 from "node:path";
10910
- var taplo = createAvailabilityChecker("taplo", ".exe");
10911
10945
  var TAPLO_EXIT_CODES = { ran: [1] };
10912
10946
  var HEADER_PATTERN = /^\s*(error|warning):(.*)$/;
10913
10947
  var LOCATION_LEAD = "\u250C\u2500";
10914
10948
  var LOCATION_PATTERN = /^\s*┌─\s+(.+?):(\d+):(\d+)$/;
10915
10949
  function parseTaploOutput(raw, filePath, cwd) {
10916
10950
  const diagnostics = [];
10951
+ let located = 0;
10952
+ if (!raw.trim())
10953
+ return diagnostics;
10917
10954
  const absTarget = path41.resolve(cwd, filePath);
10918
10955
  const lines = stripAnsi(raw ?? "").split(/\r?\n/);
10919
10956
  for (let i = 0; i < lines.length; i++) {
@@ -10932,6 +10969,7 @@ function parseTaploOutput(raw, filePath, cwd) {
10932
10969
  const location = LOCATION_PATTERN.exec(lines[j].trimEnd());
10933
10970
  if (!location)
10934
10971
  continue;
10972
+ located += 1;
10935
10973
  if (!pathsEqual(path41.resolve(cwd, location[1].trim()), absTarget))
10936
10974
  continue;
10937
10975
  line = Number.parseInt(location[2], 10) || 1;
@@ -10948,13 +10986,13 @@ function parseTaploOutput(raw, filePath, cwd) {
10948
10986
  line,
10949
10987
  column,
10950
10988
  severity,
10951
- semantic: severity === "error" ? "blocking" : "warning",
10989
+ semantic: semanticFor(severity),
10952
10990
  tool: "taplo",
10953
10991
  rule: `taplo/${severity}`,
10954
10992
  fixable: false
10955
10993
  });
10956
10994
  }
10957
- return diagnostics;
10995
+ return located > 0 ? diagnostics : null;
10958
10996
  }
10959
10997
  var taploRunner = {
10960
10998
  id: "taplo",
@@ -10986,27 +11024,23 @@ var taploRunner = {
10986
11024
  }
10987
11025
  let cmd = localBinPath(findLocalBinUpwards("taplo", cwd)) ?? null;
10988
11026
  if (!cmd) {
10989
- if (await taplo.isAvailableAsync(cwd)) {
10990
- cmd = taplo.getCommand(cwd);
10991
- } else {
10992
- cmd = await resolveToolCommandWithInstallFallback(cwd, "taplo");
10993
- }
11027
+ cmd = await resolveToolCommandWithInstallFallback(cwd, "taplo");
10994
11028
  }
10995
11029
  if (!cmd)
10996
11030
  return { status: "skipped", diagnostics: [], semantic: "none" };
10997
11031
  const absPath = path41.resolve(cwd, ctx.filePath);
10998
11032
  const result = await safeSpawnAsync(cmd, ["check", "--colors", "never", absPath], { cwd, timeout: 15e3 });
10999
11033
  const raw = result.stderr?.trim() ? result.stderr : result.stdout ?? "";
11000
- const run = parseToolRun("taplo", { result, output: raw, exitCodes: TAPLO_EXIT_CODES }, (out) => parseTaploOutput(out, ctx.filePath, cwd), { skipWhenParsedNothing: true });
11034
+ const run = parseToolRun("taplo", { result, output: raw, exitCodes: TAPLO_EXIT_CODES }, (out) => parseTaploOutput(out, ctx.filePath, cwd));
11001
11035
  if (run.skipped)
11002
11036
  return run.skipped;
11003
- const diagnostics = run.diagnostics;
11004
- if (diagnostics.length === 0) {
11005
- return { status: "succeeded", diagnostics: [], semantic: "none" };
11006
- }
11007
- return findingsResult(diagnostics, {
11008
- status: "failed",
11009
- semantic: "blocking"
11037
+ return finishParsedRun({
11038
+ tool: "taplo",
11039
+ ctx,
11040
+ result,
11041
+ diagnostics: run.diagnostics,
11042
+ unreadable: run.unreadable,
11043
+ classify: () => ({ status: "failed", semantic: "blocking" })
11010
11044
  });
11011
11045
  }
11012
11046
  };
@@ -11061,7 +11095,7 @@ function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)
11061
11095
  line,
11062
11096
  column,
11063
11097
  severity,
11064
- semantic: severity === "error" ? "blocking" : "warning",
11098
+ semantic: semanticFor(severity),
11065
11099
  tool: "terragrunt",
11066
11100
  fixable: false
11067
11101
  });
@@ -11122,13 +11156,6 @@ var terragrunt_default = terragruntRunner;
11122
11156
  // dist/clients/dispatch/runners/tflint.js
11123
11157
  import * as path43 from "node:path";
11124
11158
  var tflint = createAvailabilityChecker("tflint", ".exe");
11125
- var TFLINT_CONFIG = ".tflint.hcl";
11126
- function findTflintConfig(fileDir) {
11127
- if (process.env.TFLINT_CONFIG_FILE)
11128
- return null;
11129
- const dir = findNearestDirWithAnyBasename(fileDir, [TFLINT_CONFIG]);
11130
- return dir ? path43.join(dir, TFLINT_CONFIG) : null;
11131
- }
11132
11159
  function parseTflintOutput(raw, filePath, toolCwd) {
11133
11160
  try {
11134
11161
  const parsed = JSON.parse(raw);
@@ -11146,7 +11173,7 @@ function parseTflintOutput(raw, filePath, toolCwd) {
11146
11173
  line: issue.range.start.line,
11147
11174
  column: issue.range.start.column,
11148
11175
  severity,
11149
- semantic: severity === "error" ? "blocking" : "warning",
11176
+ semantic: semanticFor(severity),
11150
11177
  tool: "tflint",
11151
11178
  rule: issue.rule.name,
11152
11179
  fixable: false
@@ -11185,7 +11212,7 @@ var tflintRunner = {
11185
11212
  "--no-color",
11186
11213
  `--filter=${path43.basename(absPath)}`
11187
11214
  ];
11188
- const configPath = findTflintConfig(fileDir);
11215
+ const configPath = process.env.TFLINT_CONFIG_FILE ? void 0 : findToolConfig("tflint", fileDir)?.file;
11189
11216
  if (configPath)
11190
11217
  args.push(`--config=${configPath}`);
11191
11218
  const result = await safeSpawnAsync(cmd, args, {
@@ -11218,7 +11245,7 @@ var tflintRunner = {
11218
11245
  var tflint_default = tflintRunner;
11219
11246
 
11220
11247
  // dist/clients/dispatch/runners/trivy-config.js
11221
- import * as fs16 from "node:fs";
11248
+ import * as fs13 from "node:fs";
11222
11249
  import * as path44 from "node:path";
11223
11250
  var trivy2 = createAvailabilityChecker("trivy", ".exe");
11224
11251
  function looksLikeKubernetesManifest(content) {
@@ -11314,7 +11341,7 @@ var trivyConfigRunner = {
11314
11341
  if (ctx.kind === "yaml" || ctx.kind === "json") {
11315
11342
  let content = "";
11316
11343
  try {
11317
- content = fs16.readFileSync(absPath, "utf-8");
11344
+ content = fs13.readFileSync(absPath, "utf-8");
11318
11345
  } catch {
11319
11346
  return { status: "skipped", diagnostics: [], semantic: "none" };
11320
11347
  }
@@ -11383,7 +11410,6 @@ var trivy_config_default = trivyConfigRunner;
11383
11410
 
11384
11411
  // dist/clients/dispatch/runners/vale.js
11385
11412
  import * as path45 from "node:path";
11386
- var vale = createAvailabilityChecker("vale", ".exe");
11387
11413
  function findValeConfig(cwd) {
11388
11414
  return findLocalToolConfig(cwd, [".vale.ini"]);
11389
11415
  }
@@ -11394,8 +11420,8 @@ function parseValeOutput(raw, filePath, cwd) {
11394
11420
  const absTarget = path45.resolve(cwd, filePath);
11395
11421
  try {
11396
11422
  const parsed = JSON.parse(raw);
11397
- if (!parsed || typeof parsed !== "object")
11398
- return diagnostics;
11423
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
11424
+ return null;
11399
11425
  for (const [reported, alerts] of Object.entries(parsed)) {
11400
11426
  if (!Array.isArray(alerts))
11401
11427
  continue;
@@ -11418,7 +11444,7 @@ function parseValeOutput(raw, filePath, cwd) {
11418
11444
  line: alert.Line ?? 1,
11419
11445
  column: alert.Span?.[0] ?? 1,
11420
11446
  severity,
11421
- semantic: severity === "error" ? "blocking" : "warning",
11447
+ semantic: semanticFor(severity),
11422
11448
  tool: "vale",
11423
11449
  rule: alert.Check ?? "vale",
11424
11450
  fixable: false
@@ -11426,7 +11452,7 @@ function parseValeOutput(raw, filePath, cwd) {
11426
11452
  }
11427
11453
  }
11428
11454
  } catch {
11429
- return diagnostics;
11455
+ return null;
11430
11456
  }
11431
11457
  return diagnostics;
11432
11458
  }
@@ -11435,35 +11461,32 @@ var valeRunner = {
11435
11461
  appliesTo: ["markdown"],
11436
11462
  priority: PRIORITY.DOC_QUALITY,
11437
11463
  skipTestFiles: false,
11464
+ requiresConfig: (cwd) => findValeConfig(cwd) !== void 0,
11438
11465
  async run(ctx) {
11439
11466
  const cwd = resolveRunnerCwd(ctx, "vale");
11440
- if (!findValeConfig(cwd)) {
11467
+ if (!valeRunner.requiresConfig?.(cwd)) {
11441
11468
  return { status: "skipped", diagnostics: [], semantic: "none" };
11442
11469
  }
11443
- let cmd = null;
11444
- if (await vale.isAvailableAsync(cwd)) {
11445
- cmd = vale.getCommand(cwd);
11446
- } else {
11447
- cmd = await resolveToolCommandWithInstallFallback(cwd, "vale");
11448
- }
11470
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "vale");
11449
11471
  if (!cmd)
11450
11472
  return { status: "skipped", diagnostics: [], semantic: "none" };
11451
11473
  const result = await safeSpawnAsync(cmd, ["--output", "JSON", ctx.filePath], { cwd, timeout: 15e3 });
11452
11474
  const run = parseToolRun("vale", {
11453
11475
  result,
11454
11476
  // EXIT TABLE (Vale 3.9.6 docs https://vale.sh/docs/topics/metrics/): 0 clean; 1 findings; 2 error; other nonzero rejected.
11477
+ // 2 is admitted although it is an error: its output is then read by
11478
+ // the parser, so a run that printed nothing parseable is a parse
11479
+ // error, never a clean file (#5411).
11455
11480
  exitCodes: { ran: [1, 2] }
11456
11481
  }, (raw) => parseValeOutput(raw, ctx.filePath, cwd));
11457
11482
  if (run.skipped)
11458
11483
  return run.skipped;
11459
- const diagnostics = run.diagnostics;
11460
- if (diagnostics.length === 0) {
11461
- return { status: "succeeded", diagnostics: [], semantic: "none" };
11462
- }
11463
- const hasBlocking = diagnostics.some((d) => d.semantic === "blocking");
11464
- return findingsResult(diagnostics, {
11465
- status: hasBlocking ? "failed" : "succeeded",
11466
- semantic: hasBlocking ? "blocking" : "warning"
11484
+ return finishParsedRun({
11485
+ tool: "vale",
11486
+ ctx,
11487
+ result,
11488
+ diagnostics: run.diagnostics,
11489
+ unreadable: run.unreadable
11467
11490
  });
11468
11491
  }
11469
11492
  };
@@ -11473,7 +11496,7 @@ var vale_default = valeRunner;
11473
11496
  import * as path47 from "node:path";
11474
11497
 
11475
11498
  // dist/clients/cache/rule-cache.js
11476
- import * as fs17 from "node:fs";
11499
+ import * as fs14 from "node:fs";
11477
11500
  import * as path46 from "node:path";
11478
11501
  var CACHE_VERSION = "v7";
11479
11502
  function reportBundledRulesRootHealth() {
@@ -11490,8 +11513,8 @@ var RuleCache = class {
11490
11513
  this.cacheFile = path46.join(this.cacheDir, `${language}-rules-${CACHE_VERSION}.json`);
11491
11514
  }
11492
11515
  ensureCacheDir() {
11493
- if (!fs17.existsSync(this.cacheDir)) {
11494
- fs17.mkdirSync(this.cacheDir, { recursive: true });
11516
+ if (!fs14.existsSync(this.cacheDir)) {
11517
+ fs14.mkdirSync(this.cacheDir, { recursive: true });
11495
11518
  }
11496
11519
  }
11497
11520
  computeRuleHash(ruleFiles) {
@@ -11500,7 +11523,7 @@ var RuleCache = class {
11500
11523
  get(ruleFiles) {
11501
11524
  try {
11502
11525
  this.ensureCacheDir();
11503
- if (!fs17.existsSync(this.cacheFile))
11526
+ if (!fs14.existsSync(this.cacheFile))
11504
11527
  return null;
11505
11528
  const currentHash = this.computeRuleHash(ruleFiles);
11506
11529
  const cached = readJsonCache(this.cacheFile, (parsed) => {
@@ -11538,7 +11561,7 @@ var RuleCache = class {
11538
11561
  const pattern = new RegExp(`^${this.language}-rules-v\\d+\\.json$`);
11539
11562
  let dirents;
11540
11563
  try {
11541
- dirents = fs17.readdirSync(this.cacheDir);
11564
+ dirents = fs14.readdirSync(this.cacheDir);
11542
11565
  } catch {
11543
11566
  return;
11544
11567
  }
@@ -11546,15 +11569,15 @@ var RuleCache = class {
11546
11569
  if (name === currentName || !pattern.test(name))
11547
11570
  continue;
11548
11571
  try {
11549
- fs17.unlinkSync(path46.join(this.cacheDir, name));
11572
+ fs14.unlinkSync(path46.join(this.cacheDir, name));
11550
11573
  } catch {
11551
11574
  }
11552
11575
  }
11553
11576
  }
11554
11577
  clear() {
11555
11578
  try {
11556
- if (fs17.existsSync(this.cacheFile)) {
11557
- fs17.unlinkSync(this.cacheFile);
11579
+ if (fs14.existsSync(this.cacheFile)) {
11580
+ fs14.unlinkSync(this.cacheFile);
11558
11581
  }
11559
11582
  } catch {
11560
11583
  }
@@ -11956,7 +11979,7 @@ var treeSitterRunner = {
11956
11979
  const isSeverityBlocking = query.severity === "error" || query.inline_tier === "blocking" || SILENT_ERROR_QUERY_IDS.has(query.id);
11957
11980
  const endLine = line + (match.matchedText.match(/\n/g)?.length ?? 0);
11958
11981
  const outOfScope = ctx.blockingOnly && isSeverityBlocking && !spanOverlapsModifiedRanges(line, endLine, ctx.modifiedRanges);
11959
- const semantic = query.severity === "error" ? "blocking" : query.severity === "warning" ? "warning" : "none";
11982
+ const semantic = semanticFor(query.severity);
11960
11983
  const defectClass = query.defect_class ?? classifyDefect(query.id, "tree-sitter", query.message);
11961
11984
  const suggestion = query.has_fix && query.fix_action ? `${query.fix_action} this statement` : semantic === "blocking" ? defaultFixSuggestion2(defectClass, query.id) : void 0;
11962
11985
  const hasSuggestedFix = !!query.has_fix;
@@ -12103,7 +12126,6 @@ var tree_sitter_default = treeSitterRunner;
12103
12126
 
12104
12127
  // dist/clients/dispatch/runners/yamllint.js
12105
12128
  import * as path48 from "node:path";
12106
- var yamllint = createAvailabilityChecker("yamllint", ".exe");
12107
12129
  function parseYamllintParsable(raw, filePath, cwd) {
12108
12130
  const diagnostics = [];
12109
12131
  const absTarget = path48.resolve(cwd, filePath);
@@ -12123,7 +12145,7 @@ function parseYamllintParsable(raw, filePath, cwd) {
12123
12145
  line: Number(match[2]),
12124
12146
  column: Number(match[3]),
12125
12147
  severity,
12126
- semantic: severity === "error" ? "blocking" : "warning",
12148
+ semantic: semanticFor(severity),
12127
12149
  tool: "yamllint",
12128
12150
  rule: match[6]
12129
12151
  });
@@ -12145,12 +12167,7 @@ var yamllintRunner = {
12145
12167
  if (!hasConfig) {
12146
12168
  logRunnerAdvisoryOnce(ctx, "yamllint", cwd, "yamllint: no config detected, running with default rules");
12147
12169
  }
12148
- let cmd = null;
12149
- if (await yamllint.isAvailableAsync(cwd)) {
12150
- cmd = yamllint.getCommand(cwd);
12151
- } else {
12152
- cmd = await resolveToolCommandWithInstallFallback(cwd, "yamllint");
12153
- }
12170
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "yamllint");
12154
12171
  if (!cmd)
12155
12172
  return { status: "skipped", diagnostics: [], semantic: "none" };
12156
12173
  const result = await safeSpawnAsync(cmd, ["-f", "parsable", ctx.filePath], {
@@ -12306,7 +12323,7 @@ var asyncNoiseRule = {
12306
12323
  id: "async-noise",
12307
12324
  requires: ["file.functionSummaries"],
12308
12325
  appliesTo(ctx) {
12309
- return /\.tsx?$/.test(ctx.filePath) && !isTestFile(ctx.filePath);
12326
+ return isTypeScriptFile(ctx.filePath) && !isTestFile(ctx.filePath);
12310
12327
  },
12311
12328
  evaluate(ctx, store) {
12312
12329
  const summaries = store.getFileFact(ctx.filePath, "file.functionSummaries");
@@ -12339,7 +12356,7 @@ var asyncUnnecessaryWrapperRule = {
12339
12356
  id: "async-unnecessary-wrapper",
12340
12357
  requires: ["file.functionSummaries"],
12341
12358
  appliesTo(ctx) {
12342
- return /\.tsx?$/.test(ctx.filePath);
12359
+ return isTypeScriptFile(ctx.filePath);
12343
12360
  },
12344
12361
  evaluate(ctx, store) {
12345
12362
  const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
@@ -12368,7 +12385,7 @@ var corsWildcardRule = {
12368
12385
  id: "cors-wildcard",
12369
12386
  requires: ["file.content"],
12370
12387
  appliesTo(ctx) {
12371
- return /\.(tsx?|py|go)$/.test(ctx.filePath);
12388
+ return isTypeScriptFile(ctx.filePath) || /\.(py|go)$/.test(ctx.filePath);
12372
12389
  },
12373
12390
  evaluate(ctx, store) {
12374
12391
  const content = store.getFileFact(ctx.filePath, "file.content");
@@ -12414,7 +12431,7 @@ var errorObscuringRule = {
12414
12431
  id: "error-obscuring",
12415
12432
  requires: ["file.tryCatchSummaries"],
12416
12433
  appliesTo(ctx) {
12417
- return /\.tsx?$/.test(ctx.filePath);
12434
+ return isTypeScriptFile(ctx.filePath);
12418
12435
  },
12419
12436
  evaluate(ctx, store) {
12420
12437
  const summaries = store.getFileFact(ctx.filePath, "file.tryCatchSummaries");
@@ -12445,7 +12462,7 @@ var errorSwallowingRule = {
12445
12462
  id: "error-swallowing",
12446
12463
  requires: ["file.tryCatchSummaries"],
12447
12464
  appliesTo(ctx) {
12448
- return /\.tsx?$/.test(ctx.filePath);
12465
+ return isTypeScriptFile(ctx.filePath);
12449
12466
  },
12450
12467
  evaluate(ctx, store) {
12451
12468
  const summaries = store.getFileFact(ctx.filePath, "file.tryCatchSummaries");
@@ -12518,7 +12535,7 @@ var highComplexityRule = {
12518
12535
  evaluate(ctx, store) {
12519
12536
  const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
12520
12537
  const diagnostics = [];
12521
- const configuredCcThreshold = ctx.projectConfig?.rules["high-complexity"]?.threshold;
12538
+ const configuredCcThreshold = ctx.ruleThreshold?.("high-complexity");
12522
12539
  const activeCcThreshold = configuredCcThreshold ?? DEFAULT_HIGH_COMPLEXITY_THRESHOLD;
12523
12540
  for (const f of fns) {
12524
12541
  if (isTestSuiteOrganizer(f.outgoingCalls))
@@ -12554,12 +12571,12 @@ var highFanOutRule = {
12554
12571
  id: "high-fan-out",
12555
12572
  requires: ["file.functionSummaries"],
12556
12573
  appliesTo(ctx) {
12557
- return /\.tsx?$/.test(ctx.filePath);
12574
+ return isTypeScriptFile(ctx.filePath);
12558
12575
  },
12559
12576
  evaluate(ctx, store) {
12560
12577
  const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
12561
12578
  const diagnostics = [];
12562
- const configuredFanOutThreshold = ctx.projectConfig?.rules["high-fan-out"]?.threshold;
12579
+ const configuredFanOutThreshold = ctx.ruleThreshold?.("high-fan-out");
12563
12580
  const activeFanOutThreshold = configuredFanOutThreshold ?? DEFAULT_HIGH_FAN_OUT_THRESHOLD;
12564
12581
  for (const f of fns) {
12565
12582
  if (isTestSuiteOrganizer(f.outgoingCalls))
@@ -12593,7 +12610,7 @@ var highImportCouplingRule = {
12593
12610
  id: "high-import-coupling",
12594
12611
  requires: ["file.imports"],
12595
12612
  appliesTo(ctx) {
12596
- return /\.tsx?$/.test(ctx.filePath);
12613
+ return isTypeScriptFile(ctx.filePath);
12597
12614
  },
12598
12615
  evaluate(ctx, store) {
12599
12616
  if (IMPORT_COUPLING_EXEMPT.test(ctx.filePath))
@@ -12624,7 +12641,7 @@ var missingErrorPropagationRule = {
12624
12641
  id: "missing-error-propagation",
12625
12642
  requires: ["file.functionSummaries", "file.tryCatchSummaries"],
12626
12643
  appliesTo(ctx) {
12627
- return /\.tsx?$/.test(ctx.filePath);
12644
+ return isTypeScriptFile(ctx.filePath);
12628
12645
  },
12629
12646
  evaluate(ctx, store) {
12630
12647
  const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
@@ -12672,7 +12689,11 @@ var CREDENTIAL_PATTERNS = [
12672
12689
  /(?:api[_-]?key|secret|token)\s*[:=]\s*["'][^"']{6,}/i,
12673
12690
  /(?:aws|gcp|azure)[_-]?(?:key|secret|token)\s*[:=]\s*["'][^"']{6,}/i
12674
12691
  ];
12675
- var CREDENTIALS_EXEMPT = /[/\\](secrets?[-_]?(scanner|detect|check)|scanner|fixture|mock)[^/\\]*\.(tsx?|ya?ml|json|env)$/i;
12692
+ var CREDENTIALS_EXEMPT_NAME = /[/\\](secrets?[-_]?(scanner|detect|check)|scanner|fixture|mock)[^/\\]*$/i;
12693
+ var CREDENTIALS_EXEMPT_DATA_EXTENSION = /\.(ya?ml|json|env)$/i;
12694
+ function isCredentialsExempt(filePath) {
12695
+ return CREDENTIALS_EXEMPT_NAME.test(filePath) && (isTypeScriptFile(filePath) || CREDENTIALS_EXEMPT_DATA_EXTENSION.test(filePath));
12696
+ }
12676
12697
  function isCommentLine(line) {
12677
12698
  return line.startsWith("//") || line.startsWith("#") || line.startsWith("*");
12678
12699
  }
@@ -12680,7 +12701,7 @@ var commentedCredentialsRule = {
12680
12701
  id: "no-commented-credentials",
12681
12702
  requires: ["file.content"],
12682
12703
  appliesTo(ctx) {
12683
- return /\.(tsx?|py|go|rb|ya?ml|json|env)$/.test(ctx.filePath) && !CREDENTIALS_EXEMPT.test(ctx.filePath);
12704
+ return (isTypeScriptFile(ctx.filePath) || /\.(py|go|rb|ya?ml|json|env)$/.test(ctx.filePath)) && !isCredentialsExempt(ctx.filePath);
12684
12705
  },
12685
12706
  evaluate(ctx, store) {
12686
12707
  const content = store.getFileFact(ctx.filePath, "file.content");
@@ -12722,7 +12743,7 @@ var passThroughWrappersRule = {
12722
12743
  id: "pass-through-wrappers",
12723
12744
  requires: ["file.functionSummaries", "file.comments"],
12724
12745
  appliesTo(ctx) {
12725
- return /\.tsx?$/.test(ctx.filePath) && !isTestFile(ctx.filePath);
12746
+ return isTypeScriptFile(ctx.filePath) && !isTestFile(ctx.filePath);
12726
12747
  },
12727
12748
  evaluate(ctx, store) {
12728
12749
  const summaries = store.getFileFact(ctx.filePath, "file.functionSummaries");
@@ -12766,7 +12787,7 @@ var placeholderCommentsRule = {
12766
12787
  id: "placeholder-comments",
12767
12788
  requires: ["file.comments"],
12768
12789
  appliesTo(ctx) {
12769
- return /\.tsx?$/.test(ctx.filePath) && !isTestFile(ctx.filePath);
12790
+ return isTypeScriptFile(ctx.filePath) && !isTestFile(ctx.filePath);
12770
12791
  },
12771
12792
  evaluate(ctx, store) {
12772
12793
  const comments = store.getFileFact(ctx.filePath, "file.comments");
@@ -12862,7 +12883,7 @@ var unsafeBoundaryRule = {
12862
12883
  id: "unsafe-boundary",
12863
12884
  requires: ["file.functionSummaries", "file.tryCatchSummaries"],
12864
12885
  appliesTo(ctx) {
12865
- return /\.tsx?$/.test(ctx.filePath);
12886
+ return isTypeScriptFile(ctx.filePath);
12866
12887
  },
12867
12888
  evaluate(ctx, store) {
12868
12889
  const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
@@ -13198,14 +13219,14 @@ async function dispatchLintWithResult(filePath, cwd, pi, modifiedRanges, logCont
13198
13219
  sessionFacts.endDispatchFor(ctx.filePath);
13199
13220
  }
13200
13221
  }
13201
- async function getAvailableRunners(filePath) {
13222
+ async function getAvailableRunners(filePath, options = {}) {
13202
13223
  const kind = detectFileKind(filePath);
13203
13224
  if (!kind)
13204
13225
  return [];
13205
13226
  const normalizedPath = toPosix(filePath);
13206
13227
  const pathForFilter = normalizedPath.startsWith("/") ? normalizedPath : `/${normalizedPath}`;
13207
- const runners = sessionRunnerRegistry.getForKind(kind, pathForFilter);
13208
- return runners.map((r) => r.id);
13228
+ const { configCwd } = options;
13229
+ return sessionRunnerRegistry.getForKind(kind, pathForFilter).flatMap((r) => configCwd && r.requiresConfig?.(configCwd(r.id)) === false ? [] : [r.id]);
13209
13230
  }
13210
13231
 
13211
13232
  // dist/clients/mcp/host-shim.js
@@ -13384,7 +13405,7 @@ async function warmLspForFile(absPath, host) {
13384
13405
  return;
13385
13406
  let content;
13386
13407
  try {
13387
- content = fs18.readFileSync(absPath, "utf8");
13408
+ content = fs15.readFileSync(absPath, "utf8");
13388
13409
  } catch {
13389
13410
  return;
13390
13411
  }
@@ -13433,7 +13454,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
13433
13454
  void 0,
13434
13455
  observedAt,
13435
13456
  // #5258: the footer reads the same verdict the dispatch gave.
13436
- widgetUncheckedReason(result.verdict)
13457
+ recordedUnchecked(result.verdict)
13437
13458
  );
13438
13459
  if (result.diagnostics.length > 0) {
13439
13460
  getDiagnosticTracker().trackShown(result.diagnostics);
@@ -13441,7 +13462,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
13441
13462
  }
13442
13463
  if (options.registerTurnState) {
13443
13464
  try {
13444
- const lineCount = fs18.readFileSync(absPath, "utf8").split("\n").length;
13465
+ const lineCount = fs15.readFileSync(absPath, "utf8").split("\n").length;
13445
13466
  new CacheManager().addModifiedRange(absPath, { start: 1, end: lineCount }, true, cwd, options.ownerId ?? MCP_TURN_STATE_OWNER_ID, "mcp");
13446
13467
  } catch {
13447
13468
  }
@@ -13459,7 +13480,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
13459
13480
  try {
13460
13481
  if (warmIndex) {
13461
13482
  try {
13462
- const content = fs18.readFileSync(absPath, "utf8");
13483
+ const content = fs15.readFileSync(absPath, "utf8");
13463
13484
  if (!canWriteAnalysisRoot(analysisRootMode)) {
13464
13485
  emitBounded("adopted_root_writer_skipped", `${absPath}:word-index`, {
13465
13486
  filePath: absPath,
@@ -13509,6 +13530,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
13509
13530
  fileKind: latencyReport?.fileKind,
13510
13531
  durationMs,
13511
13532
  hasBlockers: result.hasBlockers,
13533
+ verdict: result.verdict,
13512
13534
  counts: {
13513
13535
  diagnostics: listedDiagnostics.length,
13514
13536
  blockers: result.blockers.length,
@@ -13542,7 +13564,7 @@ export {
13542
13564
  CacheManager,
13543
13565
  getDiagnosticTracker,
13544
13566
  normalizeRuleId,
13545
- readFileContent,
13567
+ findingClassKey,
13546
13568
  applyRulePolicy,
13547
13569
  convertLspDiagnostics,
13548
13570
  applyFindingPolicy,