@herbertgao/pi-extensions 2026.11.11 → 2026.11.13

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 (262) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +13 -11
  3. package/THIRD_PARTY_NOTICES.md +3 -3
  4. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +10 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -4
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -4
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +22 -15
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +22 -8
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +0 -29
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +5 -2
  11. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +60 -39
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +3 -2
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +0 -40
  14. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-parse.ts +4 -1
  15. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +21 -3
  16. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +15 -0
  17. package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
  18. package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +6 -0
  19. package/node_modules/@herbertgao/pi-impeccable/README.md +2 -2
  20. package/node_modules/@herbertgao/pi-impeccable/package.json +4 -4
  21. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/SKILL.md +2 -2
  22. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/adapt.md +1 -1
  23. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/animate.md +17 -0
  24. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique-rubric.md +496 -0
  25. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique.md +12 -504
  26. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/motion-reviewer.md +29 -0
  27. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/hooks.md +3 -3
  28. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work-comp.md +24 -0
  29. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work-world.md +20 -0
  30. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work.md +5 -34
  31. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/typeset.md +6 -0
  32. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/VERSION +1 -1
  33. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt +5 -5
  34. package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/live-browser.js +17 -18
  35. package/node_modules/@herbertgao/pi-inline-skill-commands/LICENSE +21 -0
  36. package/node_modules/@herbertgao/pi-inline-skill-commands/README.md +33 -0
  37. package/node_modules/@herbertgao/pi-inline-skill-commands/package.json +53 -0
  38. package/node_modules/@herbertgao/pi-inline-skill-commands/src/index.ts +213 -0
  39. package/node_modules/pi-antigravity/README.md +58 -9
  40. package/node_modules/pi-antigravity/docs/reader-guarantees.md +35 -0
  41. package/node_modules/pi-antigravity/package.json +15 -6
  42. package/node_modules/pi-antigravity/src/client/client.ts +63 -14
  43. package/node_modules/pi-antigravity/src/client/enterprise.ts +150 -0
  44. package/node_modules/pi-antigravity/src/client/index.ts +1 -0
  45. package/node_modules/pi-antigravity/src/diagnostics/diagnostics.ts +7 -0
  46. package/node_modules/pi-antigravity/src/features/generate-image.ts +56 -2
  47. package/node_modules/pi-antigravity/src/features/read-url-content.ts +124 -0
  48. package/node_modules/pi-antigravity/src/image/image.ts +16 -2
  49. package/node_modules/pi-antigravity/src/index.ts +145 -2
  50. package/node_modules/pi-antigravity/src/models/discovery.ts +3 -4
  51. package/node_modules/pi-antigravity/src/models/grouping.ts +39 -15
  52. package/node_modules/pi-antigravity/src/models/models.ts +126 -14
  53. package/node_modules/pi-antigravity/src/stream/stream.ts +189 -30
  54. package/node_modules/pi-antigravity/src/types/types.ts +30 -1
  55. package/node_modules/pi-antigravity/src/usage/usage.ts +58 -0
  56. package/node_modules/pi-antigravity/src/utils/address.ts +180 -0
  57. package/node_modules/pi-antigravity/src/utils/credits.ts +149 -0
  58. package/node_modules/pi-antigravity/src/utils/html.ts +31 -0
  59. package/node_modules/pi-antigravity/src/utils/index.ts +2 -0
  60. package/node_modules/pi-antigravity/src/utils/security.ts +172 -13
  61. package/node_modules/pi-antigravity/src/utils/text.ts +66 -0
  62. package/node_modules/pi-antigravity/src/utils/util.ts +5 -4
  63. package/node_modules/pi-antigravity/src/web-fetch/document.ts +83 -0
  64. package/node_modules/pi-antigravity/src/web-fetch/fences.ts +24 -0
  65. package/node_modules/pi-antigravity/src/web-fetch/header.ts +97 -0
  66. package/node_modules/pi-antigravity/src/web-fetch/index.ts +3 -0
  67. package/node_modules/pi-antigravity/src/web-fetch/inspect.ts +328 -0
  68. package/node_modules/pi-antigravity/src/web-fetch/limits.ts +4 -0
  69. package/node_modules/pi-antigravity/src/web-fetch/markdown.ts +744 -0
  70. package/node_modules/pi-antigravity/src/web-fetch/mdn.ts +164 -0
  71. package/node_modules/pi-antigravity/src/web-fetch/media.ts +11 -0
  72. package/node_modules/pi-antigravity/src/web-fetch/metadata.ts +9 -0
  73. package/node_modules/pi-antigravity/src/web-fetch/representation.ts +93 -0
  74. package/node_modules/pi-antigravity/src/web-fetch/save.ts +71 -0
  75. package/node_modules/pi-antigravity/src/web-fetch/sites.ts +138 -0
  76. package/node_modules/pi-antigravity/src/web-fetch/vendor.d.ts +9 -0
  77. package/node_modules/pi-antigravity/src/web-fetch/web-fetch.ts +957 -0
  78. package/node_modules/pi-antigravity/tsconfig.json +2 -2
  79. package/node_modules/pi-commandcode-provider/CHANGELOG.md +10 -0
  80. package/node_modules/pi-commandcode-provider/README.md +2 -2
  81. package/node_modules/pi-commandcode-provider/package.json +1 -1
  82. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +15 -9
  83. package/node_modules/pi-commandcode-provider/src/oauth.ts +69 -12
  84. package/node_modules/pi-lens/CHANGELOG-USER.md +6 -6
  85. package/node_modules/pi-lens/CHANGELOG.md +172 -0
  86. package/node_modules/pi-lens/README.md +103 -217
  87. package/node_modules/pi-lens/dist/{chunk-KXDQD34C.js → chunk-27JQHK7Y.js} +1 -1
  88. package/node_modules/pi-lens/dist/{chunk-W6VLB6LL.js → chunk-2APSZHHI.js} +61 -3
  89. package/node_modules/pi-lens/dist/{chunk-5EEWCJG7.js → chunk-2H5GHZKC.js} +8 -8
  90. package/node_modules/pi-lens/dist/{chunk-TS5EIWEF.js → chunk-2H7NFZ4Q.js} +11 -11
  91. package/node_modules/pi-lens/dist/{chunk-6GWCYEP7.js → chunk-37IDWT6O.js} +64 -16
  92. package/node_modules/pi-lens/dist/{chunk-OEPWTSUG.js → chunk-3PAS2ERX.js} +8 -8
  93. package/node_modules/pi-lens/dist/{chunk-ET3DSSFZ.js → chunk-3PO4YYOX.js} +9 -17
  94. package/node_modules/pi-lens/dist/{chunk-C6V2DSZZ.js → chunk-3QXFUP6T.js} +11 -11
  95. package/node_modules/pi-lens/dist/{chunk-HWMNTQBJ.js → chunk-3TSMQZG6.js} +32 -11
  96. package/node_modules/pi-lens/dist/{chunk-QY6J2FTK.js → chunk-4DAHGU3V.js} +15 -14
  97. package/node_modules/pi-lens/dist/{chunk-PCREZ4HJ.js → chunk-4IZZEN63.js} +33 -34
  98. package/node_modules/pi-lens/dist/{chunk-OYXD2MOM.js → chunk-5HBQL7DH.js} +2 -2
  99. package/node_modules/pi-lens/dist/{chunk-B4FAFEBP.js → chunk-5JB4WENL.js} +1 -1
  100. package/node_modules/pi-lens/dist/chunk-5YJXF2IS.js +56 -0
  101. package/node_modules/pi-lens/dist/{chunk-GHATCG2A.js → chunk-6CFSDLHE.js} +22 -18
  102. package/node_modules/pi-lens/dist/{chunk-FVQKX5KI.js → chunk-6E5QLMWI.js} +24 -22
  103. package/node_modules/pi-lens/dist/{chunk-AVBEPUCD.js → chunk-6GLMMGCX.js} +2 -2
  104. package/node_modules/pi-lens/dist/{chunk-YTXFNCVN.js → chunk-74AMPWNC.js} +2 -2
  105. package/node_modules/pi-lens/dist/{chunk-K2GV34T2.js → chunk-7CLWC2UH.js} +26 -37
  106. package/node_modules/pi-lens/dist/{chunk-MOEWCPMC.js → chunk-7DPXUPRF.js} +2 -2
  107. package/node_modules/pi-lens/dist/{chunk-7BEADGAZ.js → chunk-7U36VQL6.js} +2 -2
  108. package/node_modules/pi-lens/dist/{chunk-PPYUBO6Y.js → chunk-7WKVCZI4.js} +1 -1
  109. package/node_modules/pi-lens/dist/{chunk-ILC2B7IJ.js → chunk-7ZVTFLCC.js} +10 -10
  110. package/node_modules/pi-lens/dist/{chunk-IT7MFVGP.js → chunk-ADYQRETD.js} +2 -2
  111. package/node_modules/pi-lens/dist/{chunk-NCDH2JB7.js → chunk-ARTYCUGF.js} +25 -10
  112. package/node_modules/pi-lens/dist/{chunk-Z6WTLVUL.js → chunk-AXAR5ZW2.js} +225 -104
  113. package/node_modules/pi-lens/dist/{chunk-PK3GDU4M.js → chunk-AZG5UJYY.js} +1 -1
  114. package/node_modules/pi-lens/dist/{chunk-NRVWLTOY.js → chunk-B2OXE4AH.js} +60 -21
  115. package/node_modules/pi-lens/dist/{chunk-ORYQGVC3.js → chunk-B42AIWPJ.js} +2 -2
  116. package/node_modules/pi-lens/dist/{chunk-IC4L65U7.js → chunk-BBSDJTOV.js} +12 -13
  117. package/node_modules/pi-lens/dist/{chunk-HJWF7CGW.js → chunk-BKWFDWYM.js} +16 -16
  118. package/node_modules/pi-lens/dist/{chunk-D2ZYRI7M.js → chunk-C5PLBTNR.js} +1 -1
  119. package/node_modules/pi-lens/dist/{chunk-SRXYSLMW.js → chunk-CQY2HEH7.js} +1 -1
  120. package/node_modules/pi-lens/dist/{chunk-7424ANRU.js → chunk-CXQYK4YT.js} +1 -1
  121. package/node_modules/pi-lens/dist/{chunk-HYR25MV3.js → chunk-CZJGAOKL.js} +8 -7
  122. package/node_modules/pi-lens/dist/{chunk-DIIDMDZU.js → chunk-DCA2MXVQ.js} +11 -11
  123. package/node_modules/pi-lens/dist/{chunk-K2LD6YNH.js → chunk-DFKOA74L.js} +9 -9
  124. package/node_modules/pi-lens/dist/{chunk-AYDE7RFV.js → chunk-DI4AZZNY.js} +2 -2
  125. package/node_modules/pi-lens/dist/{chunk-6EXGCXM5.js → chunk-G53LBDNU.js} +99 -5
  126. package/node_modules/pi-lens/dist/chunk-GCSDF5IE.js +27 -0
  127. package/node_modules/pi-lens/dist/{chunk-5KLRCUDT.js → chunk-H5API74E.js} +6 -6
  128. package/node_modules/pi-lens/dist/chunk-HBX55MWO.js +27 -0
  129. package/node_modules/pi-lens/dist/{chunk-JRSS6KM4.js → chunk-HIJ4CHFF.js} +2 -2
  130. package/node_modules/pi-lens/dist/{chunk-3MHY4BQY.js → chunk-HIRBC72R.js} +4 -4
  131. package/node_modules/pi-lens/dist/{chunk-F7AMFFVK.js → chunk-HRLF35WL.js} +8 -8
  132. package/node_modules/pi-lens/dist/{chunk-HSTN27NR.js → chunk-I2FYOZNW.js} +9 -9
  133. package/node_modules/pi-lens/dist/{chunk-5FDUKJZO.js → chunk-I3NZVAMN.js} +9 -9
  134. package/node_modules/pi-lens/dist/{chunk-NZINZCHB.js → chunk-INBK3HIT.js} +3 -3
  135. package/node_modules/pi-lens/dist/{chunk-PXGVB2CY.js → chunk-J2ZB5MDS.js} +20 -18
  136. package/node_modules/pi-lens/dist/{chunk-HYDJUVOE.js → chunk-JGUDT5KD.js} +4 -4
  137. package/node_modules/pi-lens/dist/chunk-JOIKBUQN.js +88 -0
  138. package/node_modules/pi-lens/dist/{chunk-AZXTLZHE.js → chunk-K4Z7MK6T.js} +169 -165
  139. package/node_modules/pi-lens/dist/{chunk-WTSQKJAR.js → chunk-K7O6AHSJ.js} +10 -10
  140. package/node_modules/pi-lens/dist/{chunk-S6ZQFPOX.js → chunk-KNJH6WJQ.js} +6 -6
  141. package/node_modules/pi-lens/dist/{chunk-SUIZOCSY.js → chunk-KNSOA43J.js} +1 -1
  142. package/node_modules/pi-lens/dist/{chunk-3QMLB4TI.js → chunk-KXGTLAUW.js} +2 -2
  143. package/node_modules/pi-lens/dist/{chunk-OHEUOWYT.js → chunk-KZ732ZVW.js} +1 -1
  144. package/node_modules/pi-lens/dist/{chunk-G3LR6V6N.js → chunk-L6BDRYUK.js} +19 -17
  145. package/node_modules/pi-lens/dist/{chunk-OVPR3GQ6.js → chunk-LGH2HHZG.js} +24 -6
  146. package/node_modules/pi-lens/dist/{chunk-3R3Z54J7.js → chunk-LOEJFTF2.js} +1 -1
  147. package/node_modules/pi-lens/dist/{chunk-HGEE5LDW.js → chunk-LQQNFCQJ.js} +1 -1
  148. package/node_modules/pi-lens/dist/chunk-LVLPA32Q.js +810 -0
  149. package/node_modules/pi-lens/dist/chunk-M2YMBT5G.js +73 -0
  150. package/node_modules/pi-lens/dist/{chunk-Z2W5YJBW.js → chunk-MJRGPEQ5.js} +11 -11
  151. package/node_modules/pi-lens/dist/{chunk-3EIZMRXI.js → chunk-MOAVEPC4.js} +10 -10
  152. package/node_modules/pi-lens/dist/{chunk-TOOXNL6M.js → chunk-NGNBJIUO.js} +7 -7
  153. package/node_modules/pi-lens/dist/{chunk-AGEQRJ5A.js → chunk-NHA5K226.js} +1 -1
  154. package/node_modules/pi-lens/dist/{chunk-YLW26OHX.js → chunk-NNEQOC3U.js} +31 -59
  155. package/node_modules/pi-lens/dist/{chunk-ZWZD4TJ5.js → chunk-O2MHF7QM.js} +35 -36
  156. package/node_modules/pi-lens/dist/{chunk-PTJXMYRY.js → chunk-OLWGYBYT.js} +15 -16
  157. package/node_modules/pi-lens/dist/{chunk-JKAVKTMY.js → chunk-OZQQ3AIR.js} +17 -20
  158. package/node_modules/pi-lens/dist/{chunk-6JLNZ6DP.js → chunk-P5MSLVUW.js} +10 -10
  159. package/node_modules/pi-lens/dist/{chunk-OF2YGDUE.js → chunk-PFJLYRO3.js} +37 -38
  160. package/node_modules/pi-lens/dist/chunk-PKWEBMCA.js +2957 -0
  161. package/node_modules/pi-lens/dist/{chunk-JLMS7EMD.js → chunk-PPQHMSPH.js} +16 -15
  162. package/node_modules/pi-lens/dist/{chunk-6EIV3H7O.js → chunk-PQF6YGYB.js} +12 -5
  163. package/node_modules/pi-lens/dist/{chunk-VU2PRGRI.js → chunk-PQXUZYTQ.js} +4 -4
  164. package/node_modules/pi-lens/dist/{chunk-MV6ST2KT.js → chunk-Q7J3JYJ2.js} +13 -12
  165. package/node_modules/pi-lens/dist/{chunk-BMMRLJA4.js → chunk-QE5DJ7MX.js} +27 -10
  166. package/node_modules/pi-lens/dist/{chunk-IZ36G463.js → chunk-QE7BJQ6K.js} +7 -7
  167. package/node_modules/pi-lens/dist/{chunk-E5SSUV2A.js → chunk-QMWKSYWB.js} +4 -4
  168. package/node_modules/pi-lens/dist/{chunk-QJ4T73J5.js → chunk-QV3JPCMK.js} +1 -1
  169. package/node_modules/pi-lens/dist/{chunk-3PMLYGJN.js → chunk-R4L7KZ7R.js} +5 -5
  170. package/node_modules/pi-lens/dist/{chunk-7ZVEFWOE.js → chunk-RIH3UBK4.js} +10 -10
  171. package/node_modules/pi-lens/dist/{chunk-T5EGSBM2.js → chunk-RJ3APNIP.js} +3 -3
  172. package/node_modules/pi-lens/dist/{chunk-AAIVSSUU.js → chunk-S6MCMD27.js} +35 -12
  173. package/node_modules/pi-lens/dist/{chunk-SF7KSXB5.js → chunk-SCU62JLX.js} +6 -6
  174. package/node_modules/pi-lens/dist/{chunk-FDLGJFAE.js → chunk-SDYLT45T.js} +3 -3
  175. package/node_modules/pi-lens/dist/chunk-TFKN5EIR.js +27 -0
  176. package/node_modules/pi-lens/dist/{chunk-Y7XMKBFP.js → chunk-TKOFTLGB.js} +34 -26
  177. package/node_modules/pi-lens/dist/chunk-TQWRH25U.js +35 -0
  178. package/node_modules/pi-lens/dist/{chunk-DZSQXG66.js → chunk-TWEOJE3D.js} +277 -62
  179. package/node_modules/pi-lens/dist/{chunk-R67WQ5RY.js → chunk-UN72ZAJ5.js} +8 -8
  180. package/node_modules/pi-lens/dist/{chunk-AD7JDEI6.js → chunk-UNP6Y4JV.js} +16 -16
  181. package/node_modules/pi-lens/dist/{chunk-D6ANA6YU.js → chunk-VGRGW4UL.js} +63 -55
  182. package/node_modules/pi-lens/dist/{chunk-DFAY7JUN.js → chunk-VSQT6IHZ.js} +2 -2
  183. package/node_modules/pi-lens/dist/{chunk-7T64QA5D.js → chunk-VWEBZ2JV.js} +39 -38
  184. package/node_modules/pi-lens/dist/{chunk-HRQTYU2T.js → chunk-W26QZ3OM.js} +1 -1
  185. package/node_modules/pi-lens/dist/{chunk-2HWVG3IM.js → chunk-XDNWR7SG.js} +2 -2
  186. package/node_modules/pi-lens/dist/{chunk-75TVYCQW.js → chunk-XSC3BCN3.js} +5 -5
  187. package/node_modules/pi-lens/dist/{chunk-ME6MF2N2.js → chunk-YCR6ZYTE.js} +1 -1
  188. package/node_modules/pi-lens/dist/{chunk-LD7SXICE.js → chunk-ZI7YHV6I.js} +5 -5
  189. package/node_modules/pi-lens/dist/{chunk-E3PNZDPH.js → chunk-ZQSSO7LO.js} +33 -1
  190. package/node_modules/pi-lens/dist/{chunk-T6PPK3T6.js → chunk-ZULZS2I6.js} +385 -407
  191. package/node_modules/pi-lens/dist/index.js +6508 -5413
  192. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +9 -9
  193. package/node_modules/pi-lens/dist/mcp/cli.js +39 -38
  194. package/node_modules/pi-lens/dist/mcp/server.js +602 -345
  195. package/node_modules/pi-lens/dist/mcp/worker.js +57 -58
  196. package/node_modules/pi-lens/dist/probes/installer.js +19 -17
  197. package/node_modules/pi-lens/docs/architecture.md +113 -0
  198. package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +2 -2
  199. package/node_modules/pi-lens/docs/ci.md +18 -4
  200. package/node_modules/pi-lens/docs/defect-shapes.md +41 -3
  201. package/node_modules/pi-lens/docs/dependencies.md +10 -10
  202. package/node_modules/pi-lens/docs/features.md +3 -3
  203. package/node_modules/pi-lens/docs/invariants/dispatch-runners.md +13 -1
  204. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +19 -0
  205. package/node_modules/pi-lens/docs/language-coverage.md +39 -0
  206. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +10 -4
  207. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +1 -1
  208. package/node_modules/pi-lens/docs/pi-lens-fixer.md +4 -0
  209. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +1 -1
  210. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +4 -5
  211. package/node_modules/pi-lens/docs/pi-lens-subagent.md +5 -2
  212. package/node_modules/pi-lens/docs/prose-standard.md +112 -0
  213. package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
  214. package/node_modules/pi-lens/docs/usage.md +50 -0
  215. package/node_modules/pi-lens/package.json +1 -1
  216. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/array-callback-return-js-test.yml +23 -0
  217. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/array-callback-return-test.yml +23 -0
  218. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-js-test.yml +8 -0
  219. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-test.yml +8 -0
  220. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-js-test.yml +16 -0
  221. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-test.yml +16 -0
  222. package/node_modules/pi-lens/rules/ast-grep-rules/rules/array-callback-return-js.yml +8 -0
  223. package/node_modules/pi-lens/rules/ast-grep-rules/rules/array-callback-return.yml +8 -0
  224. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check-js.yml +17 -5
  225. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-negation-in-equality-check.yml +17 -5
  226. package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-throwing-call-js.yml +8 -1
  227. package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-throwing-call.yml +8 -1
  228. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/ts-react-antipatterns.yml +8 -0
  229. package/node_modules/pi-web-access/CHANGELOG.md +29 -0
  230. package/node_modules/pi-web-access/README.md +35 -15
  231. package/node_modules/pi-web-access/anysearch.ts +7 -3
  232. package/node_modules/pi-web-access/autom.ts +196 -0
  233. package/node_modules/pi-web-access/cloro.ts +254 -0
  234. package/node_modules/pi-web-access/curator-page.ts +7 -1
  235. package/node_modules/pi-web-access/curator-server.ts +3 -0
  236. package/node_modules/pi-web-access/dist/index.js +12931 -12111
  237. package/node_modules/pi-web-access/dist/mcp-cli.js +1188 -416
  238. package/node_modules/pi-web-access/domain-filter-normalization.ts +30 -0
  239. package/node_modules/pi-web-access/duckduckgo-rate-limit.ts +144 -34
  240. package/node_modules/pi-web-access/duckduckgo.ts +11 -3
  241. package/node_modules/pi-web-access/extract.ts +60 -4
  242. package/node_modules/pi-web-access/gemini-search.ts +25 -5
  243. package/node_modules/pi-web-access/index.ts +9 -1
  244. package/node_modules/pi-web-access/package.json +2 -2
  245. package/node_modules/pi-web-access/page-query.ts +12 -3
  246. package/node_modules/pi-web-access/specstream.ts +276 -0
  247. package/node_modules/pi-web-access/tool-activation.ts +21 -6
  248. package/node_modules/pi-web-access/utils.ts +4 -0
  249. package/node_modules/pi-web-access/video-extract.ts +2 -2
  250. package/node_modules/pi-web-access/web-tool-core.ts +24 -5
  251. package/node_modules/pi-web-access/youtube-extract.ts +2 -2
  252. package/package.json +13 -7
  253. package/node_modules/pi-lens/dist/chunk-3VWEZ6H2.js +0 -72
  254. package/node_modules/pi-lens/dist/chunk-7KWI5UHL.js +0 -28
  255. package/node_modules/pi-lens/dist/chunk-7M64NTAK.js +0 -38
  256. package/node_modules/pi-lens/dist/chunk-BEIPWPVR.js +0 -1037
  257. package/node_modules/pi-lens/dist/chunk-D7OEGXDX.js +0 -2417
  258. package/node_modules/pi-lens/dist/chunk-KUDUKKQE.js +0 -89
  259. package/node_modules/pi-lens/dist/chunk-TM3A3K7T.js +0 -28
  260. package/node_modules/pi-lens/dist/chunk-VD7MQFEV.js +0 -56
  261. package/node_modules/pi-lens/dist/chunk-YLHJWAQS.js +0 -256
  262. package/node_modules/pi-lens/dist/chunk-YULIERZW.js +0 -27
@@ -7,18 +7,18 @@ import {
7
7
  deadCodeIssues,
8
8
  formatDeadCodeDelta,
9
9
  stableFindingKey
10
- } from "../chunk-JKAVKTMY.js";
10
+ } from "../chunk-OZQQ3AIR.js";
11
11
  import {
12
12
  clearFormatterCache
13
- } from "../chunk-AZXTLZHE.js";
13
+ } from "../chunk-K4Z7MK6T.js";
14
14
  import {
15
15
  findNearestProjectRoot,
16
16
  isStartupScanVerdictFresh,
17
17
  resolveStartupScanContext
18
- } from "../chunk-S6ZQFPOX.js";
18
+ } from "../chunk-KNJH6WJQ.js";
19
19
  import {
20
20
  loadCallGraph
21
- } from "../chunk-7BEADGAZ.js";
21
+ } from "../chunk-7U36VQL6.js";
22
22
  import {
23
23
  isHardFailureSummary
24
24
  } from "../chunk-7U2IDNXN.js";
@@ -28,15 +28,15 @@ import {
28
28
  isCompletedPassResult,
29
29
  isExcludedTestTarget,
30
30
  isRunnerErrorResult
31
- } from "../chunk-DIIDMDZU.js";
31
+ } from "../chunk-DCA2MXVQ.js";
32
32
  import {
33
33
  GovulncheckClient
34
- } from "../chunk-OEPWTSUG.js";
34
+ } from "../chunk-3PAS2ERX.js";
35
35
  import {
36
36
  GitleaksClient,
37
37
  classifyAndFilterFindings
38
- } from "../chunk-G3LR6V6N.js";
39
- import "../chunk-ORYQGVC3.js";
38
+ } from "../chunk-L6BDRYUK.js";
39
+ import "../chunk-B42AIWPJ.js";
40
40
  import {
41
41
  resetManagedToolRefreshSession
42
42
  } from "../chunk-UXVNL3D7.js";
@@ -46,6 +46,7 @@ import {
46
46
  acknowledgeTurnEndFindings,
47
47
  advisoryPathKey,
48
48
  blockerRepeatContent,
49
+ cappedBlockerLine,
49
50
  consumeSessionStartGuidance,
50
51
  consumeTestFindings,
51
52
  consumeTurnEndFindings,
@@ -55,7 +56,7 @@ import {
55
56
  peekTurnEndFindings,
56
57
  snapshotAdvisoryProvenance,
57
58
  validateAdvisoryProvenance
58
- } from "../chunk-BMMRLJA4.js";
59
+ } from "../chunk-QE5DJ7MX.js";
59
60
  import {
60
61
  CacheManager,
61
62
  DEFAULT_MAX_AGE_MS,
@@ -112,53 +113,50 @@ import {
112
113
  requeueRunnerFindings,
113
114
  resetCascadeTierSessionState,
114
115
  resetDispatchBaselines,
115
- resetObservedRunnerLatency,
116
116
  resetPendingRunnerFindings,
117
117
  resetPsScriptAnalyzerAvailability,
118
118
  runProviders,
119
119
  stampLineHashes
120
- } from "../chunk-T6PPK3T6.js";
120
+ } from "../chunk-ZULZS2I6.js";
121
121
  import {
122
- resetLazyInstallAttempts
123
- } from "../chunk-6EXGCXM5.js";
122
+ resetLazyInstallAttempts,
123
+ resetObservedRunnerLatency
124
+ } from "../chunk-G53LBDNU.js";
124
125
  import {
125
126
  isTestRoleCollateral
126
- } from "../chunk-ME6MF2N2.js";
127
- import "../chunk-JRSS6KM4.js";
127
+ } from "../chunk-YCR6ZYTE.js";
128
+ import "../chunk-HIJ4CHFF.js";
128
129
  import {
129
130
  resetGoAvailability
130
- } from "../chunk-MOEWCPMC.js";
131
+ } from "../chunk-7DPXUPRF.js";
131
132
  import {
132
133
  TrivyClient,
133
134
  trivyEvidenceFiles
134
- } from "../chunk-HYR25MV3.js";
135
- import "../chunk-AAIVSSUU.js";
136
- import "../chunk-LD7SXICE.js";
137
- import "../chunk-NZINZCHB.js";
138
- import "../chunk-FDLGJFAE.js";
135
+ } from "../chunk-CZJGAOKL.js";
136
+ import "../chunk-S6MCMD27.js";
137
+ import "../chunk-ZI7YHV6I.js";
138
+ import "../chunk-INBK3HIT.js";
139
+ import "../chunk-SDYLT45T.js";
139
140
  import {
140
141
  resetRustAvailability
141
- } from "../chunk-2HWVG3IM.js";
142
- import "../chunk-E5SSUV2A.js";
143
- import "../chunk-IZ36G463.js";
142
+ } from "../chunk-XDNWR7SG.js";
143
+ import "../chunk-QMWKSYWB.js";
144
+ import "../chunk-QE7BJQ6K.js";
144
145
  import {
145
146
  resetDispatchAvailabilityState,
146
147
  resolveManagedToolClient
147
- } from "../chunk-BEIPWPVR.js";
148
- import {
149
- readFileContent
150
- } from "../chunk-D7OEGXDX.js";
151
- import "../chunk-3MHY4BQY.js";
152
- import "../chunk-VU2PRGRI.js";
153
- import "../chunk-D2ZYRI7M.js";
154
- import "../chunk-OHEUOWYT.js";
148
+ } from "../chunk-PKWEBMCA.js";
149
+ import "../chunk-HIRBC72R.js";
150
+ import "../chunk-PQXUZYTQ.js";
151
+ import "../chunk-C5PLBTNR.js";
152
+ import "../chunk-KZ732ZVW.js";
155
153
  import {
156
154
  SYMBOL_KIND_NAMES,
157
155
  captureReviewGraphStructuralIr,
158
156
  formatReviewGraphRevisionDriftNote,
159
157
  publishReviewGraphFileIr,
160
158
  reviewGraphIrContentHash
161
- } from "../chunk-QY6J2FTK.js";
159
+ } from "../chunk-4DAHGU3V.js";
162
160
  import {
163
161
  buildSymbolId
164
162
  } from "../chunk-3MED75HT.js";
@@ -274,7 +272,7 @@ import {
274
272
  widgetDiagnosticUri,
275
273
  writeOrderToken,
276
274
  writeSourceFile
277
- } from "../chunk-DZSQXG66.js";
275
+ } from "../chunk-TWEOJE3D.js";
278
276
  import {
279
277
  ANY_POSITION,
280
278
  foldedFindingIdentity,
@@ -284,7 +282,7 @@ import {
284
282
  resetMutationAttribution,
285
283
  retainRecordedFindings,
286
284
  stableFindingId
287
- } from "../chunk-DFAY7JUN.js";
285
+ } from "../chunk-VSQT6IHZ.js";
288
286
  import {
289
287
  mapWithConcurrency
290
288
  } from "../chunk-XIMYZ3JA.js";
@@ -310,8 +308,8 @@ import {
310
308
  resetLSPCaseSensitivityState,
311
309
  resolveLspCwdForFile,
312
310
  shouldInitializeSessionRoot
313
- } from "../chunk-Z6WTLVUL.js";
314
- import "../chunk-PPYUBO6Y.js";
311
+ } from "../chunk-AXAR5ZW2.js";
312
+ import "../chunk-7WKVCZI4.js";
315
313
  import {
316
314
  PROJECT_VENV_DIR_NAMES,
317
315
  PYTHON_DECLARATION_CONCURRENCY,
@@ -323,10 +321,10 @@ import {
323
321
  partitionOutrankedPythonCompileVerdicts,
324
322
  recordPythonCompileVerdictDrop,
325
323
  resetBoundedTelemetry
326
- } from "../chunk-5EEWCJG7.js";
324
+ } from "../chunk-2H5GHZKC.js";
327
325
  import {
328
326
  scannerReportParentDir
329
- } from "../chunk-QJ4T73J5.js";
327
+ } from "../chunk-QV3JPCMK.js";
330
328
  import {
331
329
  PROJECT_SNAPSHOT_VERSION,
332
330
  getProjectSnapshotLegacyPath,
@@ -338,16 +336,15 @@ import {
338
336
  loadProjectSnapshot,
339
337
  loadProjectSnapshotExportsAndRules,
340
338
  loadProjectSnapshotWithoutWordIndex,
341
- readJsonCache,
342
339
  readProjectSnapshotMeta,
343
340
  saveRuntimeProjectSnapshot
344
- } from "../chunk-YLW26OHX.js";
341
+ } from "../chunk-NNEQOC3U.js";
345
342
  import {
346
343
  SWEEP_IDLE_SAFETY_MARGIN_MS,
347
344
  getFullScanWallClockMs,
348
345
  isWorkspaceSweepActive,
349
346
  runWhenWorkspaceSweepIdle
350
- } from "../chunk-HGEE5LDW.js";
347
+ } from "../chunk-LQQNFCQJ.js";
351
348
  import "../chunk-5W3R6LFT.js";
352
349
  import {
353
350
  DEPENDENCY_DRIFT_MAX_DELIVERIES,
@@ -359,10 +356,9 @@ import {
359
356
  resolveImportToFiles,
360
357
  sweepInlineBlockerFreshness,
361
358
  symbolExtractionGrammar
362
- } from "../chunk-NCDH2JB7.js";
363
- import "../chunk-HYDJUVOE.js";
364
- import "../chunk-7424ANRU.js";
365
- import "../chunk-SUIZOCSY.js";
359
+ } from "../chunk-ARTYCUGF.js";
360
+ import "../chunk-JGUDT5KD.js";
361
+ import "../chunk-CXQYK4YT.js";
366
362
  import {
367
363
  EXT_TO_LANG,
368
364
  classifyTreeSitterWasmError,
@@ -375,17 +371,15 @@ import {
375
371
  queryLoader,
376
372
  reportBundledResourceDirHealth,
377
373
  resolveTreeSitterLanguage
378
- } from "../chunk-6GWCYEP7.js";
374
+ } from "../chunk-37IDWT6O.js";
379
375
  import "../chunk-Z54ZSOBZ.js";
380
- import {
381
- getUserRuleRoot
382
- } from "../chunk-7M64NTAK.js";
383
376
  import {
384
377
  dump,
378
+ getUserRuleRoot,
385
379
  resolvePackagePath
386
- } from "../chunk-E3PNZDPH.js";
380
+ } from "../chunk-ZQSSO7LO.js";
387
381
  import "../chunk-6HWVI6MI.js";
388
- import "../chunk-PK3GDU4M.js";
382
+ import "../chunk-AZG5UJYY.js";
389
383
  import {
390
384
  centralityFromReverseDeps,
391
385
  getWordIndexBuildStatus,
@@ -394,31 +388,35 @@ import {
394
388
  parseWordIndexQuery,
395
389
  searchWordIndex,
396
390
  triggerBackgroundWordIndexBuild
397
- } from "../chunk-6JLNZ6DP.js";
391
+ } from "../chunk-P5MSLVUW.js";
398
392
  import {
399
393
  getProjectDiagnosticsScannerMaxFiles
400
- } from "../chunk-IT7MFVGP.js";
394
+ } from "../chunk-ADYQRETD.js";
401
395
  import {
402
396
  SCAN_LANGUAGE_PRIORITY,
403
397
  extensionsForLanguage,
404
398
  resolveLanguage,
405
399
  resolveLanguageScope
406
- } from "../chunk-AYDE7RFV.js";
407
- import {
408
- NO_SERVER_REASON,
409
- findingsResult,
410
- hasUsableResult,
411
- reachedNoVerdict,
412
- verdictUncheckedReason
413
- } from "../chunk-W6VLB6LL.js";
400
+ } from "../chunk-DI4AZZNY.js";
414
401
  import {
415
402
  WARM_TURN_END_SCHEMA_VERSION,
403
+ boundUnixSocketKeepsIdentity,
404
+ boundUnixSocketPath,
416
405
  createWarmIpcLineReader,
417
406
  createWarmIpcRequestQueue,
418
407
  ipcPathForCwd,
419
408
  readTurnEndStatus,
420
409
  unlinkStaleUnixSocket
421
- } from "../chunk-HWMNTQBJ.js";
410
+ } from "../chunk-3TSMQZG6.js";
411
+ import {
412
+ NO_SERVER_REASON,
413
+ cleanVerdict,
414
+ findingsResult,
415
+ hasUsableResult,
416
+ reachedNoVerdict,
417
+ semanticFor,
418
+ verdictUncheckedReason
419
+ } from "../chunk-2APSZHHI.js";
422
420
  import {
423
421
  resolveRunnerPath,
424
422
  toRunnerDisplayPath
@@ -429,22 +427,27 @@ import {
429
427
  commitDurableStore,
430
428
  resetResolvedPathCache,
431
429
  resetZizmorTokenAvailability
432
- } from "../chunk-NRVWLTOY.js";
430
+ } from "../chunk-B2OXE4AH.js";
433
431
  import {
432
+ readFileContent,
434
433
  resolveToolCwd
435
- } from "../chunk-YLHJWAQS.js";
434
+ } from "../chunk-LVLPA32Q.js";
436
435
  import {
437
436
  _resetPackageManagerCache,
438
437
  findGlobalBinary,
439
438
  pmBinary,
440
439
  resolveNodePackageManager,
441
440
  runScriptArgs
442
- } from "../chunk-OVPR3GQ6.js";
441
+ } from "../chunk-LGH2HHZG.js";
443
442
  import {
444
443
  getIsolatedNpxSpawnOptions,
445
444
  probeToolAsync
446
- } from "../chunk-3QMLB4TI.js";
445
+ } from "../chunk-KXGTLAUW.js";
446
+ import {
447
+ readJsonCache
448
+ } from "../chunk-TQWRH25U.js";
447
449
  import "../chunk-UYXV5NIS.js";
450
+ import "../chunk-KNSOA43J.js";
448
451
  import {
449
452
  classifyProbeFailure,
450
453
  createAvailabilityLatch,
@@ -452,24 +455,24 @@ import {
452
455
  logAvailabilityDecision,
453
456
  resetInstallRetryLatches,
454
457
  startHostStallSampler
455
- } from "../chunk-AVBEPUCD.js";
458
+ } from "../chunk-6GLMMGCX.js";
456
459
  import {
457
460
  canRunStartupHeavyScans,
458
461
  detectProjectLanguageProfile,
459
462
  getDefaultStartupTools
460
- } from "../chunk-75TVYCQW.js";
461
- import "../chunk-KXDQD34C.js";
463
+ } from "../chunk-XSC3BCN3.js";
464
+ import "../chunk-27JQHK7Y.js";
462
465
  import {
463
466
  DEFAULT_MAX_SCAN_ENTRIES,
464
467
  collectSourceFilesWithBudgetAsync,
465
468
  getSlowFsVerdict,
466
469
  isSlowFs,
467
470
  slowFsDegradationNotice
468
- } from "../chunk-3PMLYGJN.js";
471
+ } from "../chunk-R4L7KZ7R.js";
469
472
  import {
470
473
  shouldRecurseIntoDir,
471
474
  walkTreeStackAsync
472
- } from "../chunk-YTXFNCVN.js";
475
+ } from "../chunk-74AMPWNC.js";
473
476
  import {
474
477
  displayProjectDataPath,
475
478
  drainProjectDataDirMigrations,
@@ -499,10 +502,10 @@ import {
499
502
  sweepDeadEphemeralDataDirs,
500
503
  updateHeartbeat,
501
504
  withGenerationLockSync
502
- } from "../chunk-ET3DSSFZ.js";
505
+ } from "../chunk-3PO4YYOX.js";
503
506
  import {
504
507
  createSingleFlight
505
- } from "../chunk-B4FAFEBP.js";
508
+ } from "../chunk-5JB4WENL.js";
506
509
  import {
507
510
  createDeadline,
508
511
  yieldIfOverBudget
@@ -510,7 +513,7 @@ import {
510
513
  import {
511
514
  detectFileKind,
512
515
  isJstsFactFile
513
- } from "../chunk-SRXYSLMW.js";
516
+ } from "../chunk-CQY2HEH7.js";
514
517
  import {
515
518
  PathKeyedMap,
516
519
  compareKeys,
@@ -521,12 +524,12 @@ import {
521
524
  provenanceView,
522
525
  resolvePiLensConfig,
523
526
  summarizeConfigResolution
524
- } from "../chunk-6EIV3H7O.js";
527
+ } from "../chunk-PQF6YGYB.js";
525
528
  import {
526
529
  LSP_NAMESPACE_KEY,
527
530
  getPiLensGlobalConfigPath,
528
531
  resetWorkspaceTopology
529
- } from "../chunk-3R3Z54J7.js";
532
+ } from "../chunk-LOEJFTF2.js";
530
533
  import {
531
534
  hashContentBytes,
532
535
  hashFileBytes
@@ -546,7 +549,7 @@ import {
546
549
  withBudget,
547
550
  withDeadline,
548
551
  writeFileAtomic
549
- } from "../chunk-HRQTYU2T.js";
552
+ } from "../chunk-W26QZ3OM.js";
550
553
  import {
551
554
  LENS_TOOL_NAMES,
552
555
  TOOL_REGISTRY,
@@ -565,7 +568,7 @@ import {
565
568
  resolveLensToolName,
566
569
  toolRegistryEntryForMcp,
567
570
  translateGuidanceToolNames
568
- } from "../chunk-AGEQRJ5A.js";
571
+ } from "../chunk-NHA5K226.js";
569
572
  import {
570
573
  freshnessFromMtime
571
574
  } from "../chunk-S26LC76R.js";
@@ -580,7 +583,7 @@ import {
580
583
  nonNegativeIntEnv,
581
584
  runLogCleanup,
582
585
  setTurnContextSession
583
- } from "../chunk-K2GV34T2.js";
586
+ } from "../chunk-7CLWC2UH.js";
584
587
  import "../chunk-LJDODBBZ.js";
585
588
  import {
586
589
  FactStore
@@ -589,6 +592,7 @@ import {
589
592
  BoundedFifoMap,
590
593
  BoundedLruCache,
591
594
  createProjectRelativePathResolver,
595
+ findNearestContaining,
592
596
  homeRelativePath,
593
597
  isAtOrAboveHomeDir,
594
598
  isUnderDir,
@@ -596,6 +600,7 @@ import {
596
600
  minimatch,
597
601
  normalizeEphemeralMapKey,
598
602
  normalizeFilePath,
603
+ normalizeHostToolPath,
599
604
  normalizeMapKey,
600
605
  pathsEqual,
601
606
  realpathOrResolve,
@@ -612,7 +617,7 @@ import "../chunk-NXL4FFQQ.js";
612
617
  // dist/mcp/server.js
613
618
  import * as fs25 from "node:fs";
614
619
  import * as net from "node:net";
615
- import * as path43 from "node:path";
620
+ import * as path42 from "node:path";
616
621
  import { fileURLToPath as fileURLToPath3 } from "node:url";
617
622
 
618
623
  // dist/tools/render-compact.js
@@ -1109,6 +1114,12 @@ function tryParseNonZeroSgMatches(result) {
1109
1114
  return null;
1110
1115
  return tryParseSgMatches(result.stdout.trim());
1111
1116
  }
1117
+ function sgMatchesAtScanRoot(matches, scanCwd) {
1118
+ return matches.map((match) => ({
1119
+ ...match,
1120
+ file: path3.resolve(scanCwd, match.file)
1121
+ }));
1122
+ }
1112
1123
  var SgRunner = class {
1113
1124
  log;
1114
1125
  sgPath = null;
@@ -1633,7 +1644,30 @@ Original error: ${stderr}`;
1633
1644
  this.log(`Cleanup failed: ${err.message}`);
1634
1645
  }
1635
1646
  }
1636
- interpretScanResult(result, args) {
1647
+ /** The scan anchor for one `dir` argument; see {@link SgScanAnchor}. */
1648
+ sgScanAnchor(dir) {
1649
+ const absolute = path3.resolve(dir);
1650
+ const isDirectory = fs3.existsSync(absolute) && fs3.statSync(absolute).isDirectory();
1651
+ let treeRoot = isDirectory ? absolute : path3.dirname(absolute);
1652
+ if (!fs3.existsSync(treeRoot)) {
1653
+ treeRoot = [...walkUpDirs(treeRoot)].find((dir2) => fs3.existsSync(dir2)) ?? treeRoot;
1654
+ }
1655
+ const isolationCwd = this.sgSpawnOptions?.cwd;
1656
+ if (isolationCwd !== void 0) {
1657
+ return {
1658
+ cwd: isolationCwd,
1659
+ scanArg: absolute,
1660
+ excludeArgs: findNearestContaining(treeRoot, [".git"]) ? [] : sgExcludeArgsForProject(absolute)
1661
+ };
1662
+ }
1663
+ const relative9 = path3.relative(treeRoot, absolute) || ".";
1664
+ return {
1665
+ cwd: treeRoot,
1666
+ scanArg: relative9,
1667
+ excludeArgs: sgExcludeArgsForProject(absolute)
1668
+ };
1669
+ }
1670
+ interpretScanResult(result, args, scanCwd) {
1637
1671
  if (truncatedByOutputCap(result)) {
1638
1672
  return {
1639
1673
  matches: [],
@@ -1657,7 +1691,10 @@ Original error: ${stderr}`;
1657
1691
  if (result.status === 1 && stdout) {
1658
1692
  const matches = tryParseNonZeroSgMatches(result);
1659
1693
  if (matches) {
1660
- return { matches, status: result.status };
1694
+ return {
1695
+ matches: sgMatchesAtScanRoot(matches, scanCwd),
1696
+ status: result.status
1697
+ };
1661
1698
  }
1662
1699
  }
1663
1700
  if (result.status === 1 && !stdout && !stderr) {
@@ -1675,7 +1712,10 @@ Original error: ${stderr}`;
1675
1712
  {
1676
1713
  const matches = tryParseSgMatches(result.stdout);
1677
1714
  if (matches) {
1678
- return { matches, status: result.status };
1715
+ return {
1716
+ matches: sgMatchesAtScanRoot(matches, scanCwd),
1717
+ status: result.status
1718
+ };
1679
1719
  }
1680
1720
  return {
1681
1721
  matches: [],
@@ -1690,20 +1730,22 @@ Original error: ${stderr}`;
1690
1730
  try {
1691
1731
  ({ sessionDir } = this.prepareTempScan(ruleId, ruleYaml));
1692
1732
  const configFile = path3.join(sessionDir, ".sgconfig.yml");
1733
+ const anchor = this.sgScanAnchor(dir);
1693
1734
  const result = await this.spawnResolved(this.getSgCommand(), [
1694
1735
  "scan",
1695
1736
  "--config",
1696
1737
  configFile,
1697
1738
  "--json",
1698
- ...sgExcludeArgsForProject(dir),
1699
- dir
1739
+ ...anchor.excludeArgs,
1740
+ anchor.scanArg
1700
1741
  ], {
1701
1742
  timeout,
1702
1743
  deadlineAt: options.deadlineAt,
1703
1744
  signal: options.signal,
1704
- maxOutputBytes: MAX_SG_OUTPUT_BYTES
1745
+ maxOutputBytes: MAX_SG_OUTPUT_BYTES,
1746
+ cwd: anchor.cwd
1705
1747
  });
1706
- return this.interpretScanResult(result, ["scan"]);
1748
+ return this.interpretScanResult(result, ["scan"], anchor.cwd);
1707
1749
  } finally {
1708
1750
  if (sessionDir)
1709
1751
  this.cleanupTempScan(sessionDir);
@@ -1725,23 +1767,25 @@ Original error: ${stderr}`;
1725
1767
  ({ sessionDir } = this.prepareTempScan(ruleId, ruleYaml));
1726
1768
  const configFile = path3.join(sessionDir, ".sgconfig.yml");
1727
1769
  const command = this.getSgCommand();
1770
+ const anchor = this.sgScanAnchor(dir);
1728
1771
  const scanArgs = [
1729
1772
  "scan",
1730
1773
  "--config",
1731
1774
  configFile,
1732
1775
  "--json",
1733
- ...sgExcludeArgsForProject(dir),
1734
- dir
1776
+ ...anchor.excludeArgs,
1777
+ anchor.scanArg
1735
1778
  ];
1736
1779
  const spawnOptions = {
1737
1780
  timeout,
1738
1781
  deadlineAt: options.deadlineAt,
1739
1782
  signal: options.signal,
1740
- maxOutputBytes: MAX_SG_OUTPUT_BYTES
1783
+ maxOutputBytes: MAX_SG_OUTPUT_BYTES,
1784
+ cwd: anchor.cwd
1741
1785
  };
1742
1786
  if (!applyFixes) {
1743
1787
  const result = await this.spawnResolved(command, scanArgs, spawnOptions);
1744
- const scan2 = this.interpretScanResult(result, ["scan"]);
1788
+ const scan2 = this.interpretScanResult(result, ["scan"], anchor.cwd);
1745
1789
  return scan2.failure || scan2.error ? {
1746
1790
  matches: [],
1747
1791
  error: scan2.error,
@@ -1749,7 +1793,7 @@ Original error: ${stderr}`;
1749
1793
  } : { matches: scan2.matches };
1750
1794
  }
1751
1795
  const jsonResult = await this.spawnResolved(command, scanArgs, spawnOptions);
1752
- const scan = this.interpretScanResult(jsonResult, ["scan"]);
1796
+ const scan = this.interpretScanResult(jsonResult, ["scan"], anchor.cwd);
1753
1797
  if (scan.failure || scan.error) {
1754
1798
  return {
1755
1799
  matches: [],
@@ -1765,8 +1809,8 @@ Original error: ${stderr}`;
1765
1809
  "--config",
1766
1810
  configFile,
1767
1811
  "--update-all",
1768
- ...sgExcludeArgsForProject(dir),
1769
- dir
1812
+ ...anchor.excludeArgs,
1813
+ anchor.scanArg
1770
1814
  ], { ...spawnOptions, signal: void 0, ignoreAmbientSignal: true });
1771
1815
  if (applyResult.error || applyResult.failure || applyResult.status !== 0) {
1772
1816
  return {
@@ -2076,7 +2120,7 @@ var AstGrepClient = class {
2076
2120
  for (const scanPath of paths) {
2077
2121
  let previewed = [];
2078
2122
  if (apply) {
2079
- const preCheck = await this.tempScanDetailed(scanPath, ruleYaml);
2123
+ const preCheck = await this.tempScanDetailed(scanPath, ruleYaml, sg);
2080
2124
  if (preCheck.failure || preCheck.error) {
2081
2125
  return {
2082
2126
  matches: allMatches,
@@ -2548,7 +2592,7 @@ message: found
2548
2592
  };
2549
2593
 
2550
2594
  // dist/clients/lens-engine.js
2551
- import * as path29 from "node:path";
2595
+ import * as path28 from "node:path";
2552
2596
 
2553
2597
  // dist/clients/project-diagnostics/scanner.js
2554
2598
  import * as fs6 from "node:fs";
@@ -2845,7 +2889,7 @@ async function scanFileMajorRules(cwd, files, signal) {
2845
2889
  } finally {
2846
2890
  facts.dropFileFacts(filePath);
2847
2891
  }
2848
- await new Promise((resolve34) => setImmediate(resolve34));
2892
+ await new Promise((resolve33) => setImmediate(resolve33));
2849
2893
  }
2850
2894
  if (wasmAborted) {
2851
2895
  astGrep.length = 0;
@@ -2989,7 +3033,7 @@ function resolveRebuildScript(serverFilePath) {
2989
3033
  return toPosix(serverFilePath).includes("/dist/") ? "build:dist" : "build";
2990
3034
  }
2991
3035
  function analyzeFileFresh(workerPath, file, cwd, options = {}, timeoutMs = 12e4) {
2992
- return new Promise((resolve34) => {
3036
+ return new Promise((resolve33) => {
2993
3037
  const args = [workerPath, `--file=${file}`, `--cwd=${cwd}`];
2994
3038
  if (options.flags)
2995
3039
  args.push(`--flags=${JSON.stringify(options.flags)}`);
@@ -2999,7 +3043,7 @@ function analyzeFileFresh(workerPath, file, cwd, options = {}, timeoutMs = 12e4)
2999
3043
  stdio: ["ignore", "pipe", "pipe"]
3000
3044
  });
3001
3045
  } catch (err) {
3002
- resolve34({
3046
+ resolve33({
3003
3047
  error: `failed to fork worker: ${err instanceof Error ? err.message : String(err)}`
3004
3048
  });
3005
3049
  return;
@@ -3012,7 +3056,7 @@ function analyzeFileFresh(workerPath, file, cwd, options = {}, timeoutMs = 12e4)
3012
3056
  return;
3013
3057
  settled = true;
3014
3058
  clearTimeout(timer);
3015
- resolve34(outcome);
3059
+ resolve33(outcome);
3016
3060
  };
3017
3061
  const timer = setTimeout(() => {
3018
3062
  child.kill();
@@ -3120,7 +3164,6 @@ function summarizeScan(diagnostics) {
3120
3164
  // dist/clients/mcp/session.js
3121
3165
  import * as crypto from "node:crypto";
3122
3166
  import * as fs17 from "node:fs";
3123
- import * as path25 from "node:path";
3124
3167
 
3125
3168
  // dist/clients/bootstrap.js
3126
3169
  var residentClients = null;
@@ -3177,28 +3220,28 @@ async function buildBootstrapClients() {
3177
3220
  }
3178
3221
  }
3179
3222
  const [ruffClient, biomeClient, knipClient, todoScanner, jscpdClient, depChecker, testRunnerClient, complexityClient, goClient, govulncheckClient, gitleaksClient, trivyClient, opengrepClient, rustClient, agentBehaviorClient2, deadCodeClients] = await Promise.all([
3180
- load("ruff", async () => new (await import("../chunk-D6ANA6YU.js")).RuffClient()),
3181
- load("biome", async () => new (await import("../chunk-PCREZ4HJ.js")).BiomeClient()),
3182
- load("knip", async () => new (await import("../chunk-OF2YGDUE.js")).KnipClient()),
3183
- load("todo", async () => new (await import("../chunk-5FDUKJZO.js")).TodoScanner()),
3184
- load("jscpd", async () => new (await import("../chunk-ZWZD4TJ5.js")).JscpdClient()),
3185
- load("dependency-checker", async () => new (await import("../chunk-VD7MQFEV.js")).DependencyChecker()),
3186
- load("test-runner", async () => new (await import("../chunk-FVQKX5KI.js")).TestRunnerClient()),
3187
- load("complexity", async () => new (await import("../chunk-IC4L65U7.js")).ComplexityClient()),
3223
+ load("ruff", async () => new (await import("../chunk-VGRGW4UL.js")).RuffClient()),
3224
+ load("biome", async () => new (await import("../chunk-4IZZEN63.js")).BiomeClient()),
3225
+ load("knip", async () => new (await import("../chunk-PFJLYRO3.js")).KnipClient()),
3226
+ load("todo", async () => new (await import("../chunk-I3NZVAMN.js")).TodoScanner()),
3227
+ load("jscpd", async () => new (await import("../chunk-O2MHF7QM.js")).JscpdClient()),
3228
+ load("dependency-checker", async () => new (await import("../chunk-5YJXF2IS.js")).DependencyChecker()),
3229
+ load("test-runner", async () => new (await import("../chunk-6E5QLMWI.js")).TestRunnerClient()),
3230
+ load("complexity", async () => new (await import("../chunk-BBSDJTOV.js")).ComplexityClient()),
3188
3231
  // The process-wide singleton, NOT a fresh instance (#2455 fix round 4,
3189
3232
  // F2). `handleSessionStart` reads this object for its "Active tools"
3190
3233
  // line while `resetGoAvailability` re-arms the singleton's latch; a
3191
3234
  // second instance here meant the reset never reached the surface a
3192
3235
  // user actually sees.
3193
- load("go", async () => (await import("../chunk-TS5EIWEF.js")).goClient),
3194
- load("govulncheck", async () => new (await import("../chunk-YULIERZW.js")).GovulncheckClient()),
3195
- load("gitleaks", async () => new (await import("../chunk-AD7JDEI6.js")).GitleaksClient()),
3196
- load("trivy", async () => new (await import("../chunk-HJWF7CGW.js")).TrivyClient()),
3197
- load("opengrep", async () => new (await import("../chunk-GHATCG2A.js")).OpengrepClient()),
3236
+ load("go", async () => (await import("../chunk-2H7NFZ4Q.js")).goClient),
3237
+ load("govulncheck", async () => new (await import("../chunk-GCSDF5IE.js")).GovulncheckClient()),
3238
+ load("gitleaks", async () => new (await import("../chunk-UNP6Y4JV.js")).GitleaksClient()),
3239
+ load("trivy", async () => new (await import("../chunk-BKWFDWYM.js")).TrivyClient()),
3240
+ load("opengrep", async () => new (await import("../chunk-6CFSDLHE.js")).OpengrepClient()),
3198
3241
  // The process-wide singleton, for the same reason as "go" above.
3199
- load("rust", async () => (await import("../chunk-Z2W5YJBW.js")).rustClient),
3200
- load("agent-behavior", async () => (await import("../chunk-F7AMFFVK.js")).agentBehaviorClient),
3201
- loadList("dead-code", async () => (await import("../chunk-JLMS7EMD.js")).getDeadCodeClients())
3242
+ load("rust", async () => (await import("../chunk-MJRGPEQ5.js")).rustClient),
3243
+ load("agent-behavior", async () => (await import("../chunk-HRLF35WL.js")).agentBehaviorClient),
3244
+ loadList("dead-code", async () => (await import("../chunk-PPQHMSPH.js")).getDeadCodeClients())
3202
3245
  ]);
3203
3246
  if (failures.length > 0)
3204
3247
  await logBootstrapFailures(failures);
@@ -3284,7 +3327,7 @@ function resetAnalyzerBootstrapSessionState() {
3284
3327
  }
3285
3328
 
3286
3329
  // dist/clients/formatters-lazy.js
3287
- var lazyFormatters = createLazyImport(() => import("../chunk-Y7XMKBFP.js"));
3330
+ var lazyFormatters = createLazyImport(() => import("../chunk-TKOFTLGB.js"));
3288
3331
  function warmFormatters() {
3289
3332
  return lazyFormatters.get();
3290
3333
  }
@@ -3592,6 +3635,7 @@ var MAX_RESOLVED_BLOCKER_FILES = 10;
3592
3635
  var MAX_OWED_ANCHORS = 16;
3593
3636
  var TOOL_CALL_ATTRIBUTION_CAPACITY = 256;
3594
3637
  var TOOL_CALL_ATTRIBUTION_TTL_MS = 5 * 6e4;
3638
+ var BLOCKER_FULL_DELIVERY_CAP = 3;
3595
3639
  function narrowedRecord(existing, kept) {
3596
3640
  return {
3597
3641
  ...existing,
@@ -4515,8 +4559,8 @@ var RuntimeCoordinator = class {
4515
4559
  });
4516
4560
  return entry;
4517
4561
  });
4518
- const timeout = new Promise((resolve34) => {
4519
- setTimeout(resolve34, maxWaitMs).unref?.();
4562
+ const timeout = new Promise((resolve33) => {
4563
+ setTimeout(resolve33, maxWaitMs).unref?.();
4520
4564
  });
4521
4565
  await Promise.race([
4522
4566
  Promise.allSettled(tracked.map((t) => t.promise)),
@@ -4674,7 +4718,10 @@ var RuntimeCoordinator = class {
4674
4718
  ],
4675
4719
  // The turn-end policy verdict was about the OLD set; the added findings
4676
4720
  // passed the policy already and the next turn end re-derives the rest.
4677
- policySuppressed: false
4721
+ policySuppressed: false,
4722
+ // #5532: new findings are changed content, so the count restarts.
4723
+ fullDeliveryCount: 0,
4724
+ capRowWritten: false
4678
4725
  });
4679
4726
  return added.length;
4680
4727
  }
@@ -5008,6 +5055,48 @@ var RuntimeCoordinator = class {
5008
5055
  });
5009
5056
  return next;
5010
5057
  }
5058
+ /**
5059
+ * #5532: whether this live blocker has had its full section delivered
5060
+ * `BLOCKER_FULL_DELIVERY_CAP` times, so the next delivery renders the one-line
5061
+ * pointer instead. A peek: the delivery that renders it commits through
5062
+ * {@link recordBlockerDelivery} once the message is known to reach the model.
5063
+ * The count is this record's own, so another blocker joining, leaving or
5064
+ * being fixed never moves it.
5065
+ */
5066
+ blockerFullDeliveryCapped(filePath) {
5067
+ return (this._pendingInlineBlockers.get(filePath)?.fullDeliveryCount ?? 0) >= BLOCKER_FULL_DELIVERY_CAP;
5068
+ }
5069
+ /**
5070
+ * #5532: a delivery that reached the model rendered this blocker `shown`. A
5071
+ * full one counts toward the cap. The first collapsed one is the moment the
5072
+ * cap retires a full delivery, so it writes the blocker's one counted
5073
+ * `blocker-repeat-capped` row; later ones write nothing. The blocker stays in
5074
+ * the store, `lens_diagnostics` and the commit gate either way. A record that
5075
+ * is gone (fixed, marked, deleted) is a no-op.
5076
+ */
5077
+ recordBlockerDelivery(filePath, shown2, displayPath) {
5078
+ const existing = this._pendingInlineBlockers.get(filePath);
5079
+ if (!existing)
5080
+ return;
5081
+ if (shown2 === "full") {
5082
+ this._pendingInlineBlockers.set(filePath, {
5083
+ ...existing,
5084
+ fullDeliveryCount: (existing.fullDeliveryCount ?? 0) + 1
5085
+ });
5086
+ return;
5087
+ }
5088
+ if (existing.capRowWritten === true)
5089
+ return;
5090
+ this._pendingInlineBlockers.set(filePath, {
5091
+ ...existing,
5092
+ capRowWritten: true
5093
+ });
5094
+ incrementDegradationCount({
5095
+ kind: "blocker-repeat-capped",
5096
+ subject: `inline-blocker-repeat:${displayPath}`,
5097
+ reason: `delivered in full ${BLOCKER_FULL_DELIVERY_CAP} times with no fix; later deliveries get a one-line pointer, the blocker stays in lens_diagnostics and the commit gate`
5098
+ });
5099
+ }
5011
5100
  /**
5012
5101
  * #1950/#4990: retire a drift demotion once it has been delivered its axis's
5013
5102
  * cap with no re-run confirming or clearing it.
@@ -5516,6 +5605,7 @@ var RuntimeCoordinator = class {
5516
5605
  existing.queuedTurnId = `${this._telemetrySessionId}:${this._turnIndex}`;
5517
5606
  existing.ownerSessionId = ownerSessionId;
5518
5607
  existing.originCwd = resolvedOriginCwd;
5608
+ delete existing.formatRequeueAttempts;
5519
5609
  return addedKind;
5520
5610
  }
5521
5611
  this._pendingDeferredMutations.set(key, {
@@ -5631,8 +5721,17 @@ var RuntimeCoordinator = class {
5631
5721
  return { claimed, staleClaimed, deferredToOwner, droppedOrphans };
5632
5722
  }
5633
5723
  /** Return claimed records that were never started by an aborted drain. */
5634
- requeueDeferredFormatFiles(records2) {
5724
+ requeueDeferredFormatFiles(records2, capFormatFailures = true) {
5635
5725
  for (const record of records2) {
5726
+ const formatRequeueAttempts = record.formatRequeueAttempts ?? 0;
5727
+ if (capFormatFailures && formatRequeueAttempts >= 1) {
5728
+ recordDegradationOnce({
5729
+ kind: "formatter-requeue-dropped",
5730
+ subject: record.filePath,
5731
+ reason: "deferred formatter failure retry cap reached"
5732
+ });
5733
+ continue;
5734
+ }
5636
5735
  const key = record.filePath;
5637
5736
  const existing = this._pendingDeferredMutations.get(key);
5638
5737
  if (existing) {
@@ -5641,10 +5740,14 @@ var RuntimeCoordinator = class {
5641
5740
  for (const toolName of record.toolNames)
5642
5741
  existing.toolNames.add(toolName);
5643
5742
  existing.readGuardBranchEpoch = Math.max(existing.readGuardBranchEpoch, record.readGuardBranchEpoch);
5743
+ existing.formatRequeueAttempts = capFormatFailures ? Math.max(existing.formatRequeueAttempts ?? 0, formatRequeueAttempts + 1) : existing.formatRequeueAttempts;
5644
5744
  continue;
5645
5745
  }
5646
5746
  this._pendingDeferredMutations.set(key, {
5647
5747
  ...record,
5748
+ ...capFormatFailures && {
5749
+ formatRequeueAttempts: formatRequeueAttempts + 1
5750
+ },
5648
5751
  kinds: new Set(record.kinds),
5649
5752
  toolNames: new Set(record.toolNames)
5650
5753
  });
@@ -5653,8 +5756,8 @@ var RuntimeCoordinator = class {
5653
5756
  claimDeferredMutations(currentSessionId, now, staleAfterMs, currentOriginCwd, ownedOnly = false) {
5654
5757
  return this.claimDeferredFormatFiles(currentSessionId, now, staleAfterMs, currentOriginCwd, ownedOnly);
5655
5758
  }
5656
- requeueDeferredMutations(records2) {
5657
- this.requeueDeferredFormatFiles(records2);
5759
+ requeueDeferredMutations(records2, capFormatFailures = false) {
5760
+ this.requeueDeferredFormatFiles(records2, capFormatFailures);
5658
5761
  }
5659
5762
  shouldWarmLspOnRead(filePath, maxAgeMs = 12e4) {
5660
5763
  const state = this._lspReadWarmState.get(path8.resolve(filePath));
@@ -6339,8 +6442,8 @@ async function igniteDominantLanguageWarm(cwd, runtime, sessionGeneration, dbg)
6339
6442
  if (!runtime.isCurrentSession(sessionGeneration))
6340
6443
  return;
6341
6444
  const lspService = (await loadLspService()).getLSPService();
6342
- const { collectSourceFilesAsync } = await import("../chunk-K2LD6YNH.js");
6343
- const { CODE_KINDS, detectFileKind: detectFileKind2 } = await import("../chunk-T5EGSBM2.js");
6445
+ const { collectSourceFilesAsync } = await import("../chunk-DFKOA74L.js");
6446
+ const { CODE_KINDS, detectFileKind: detectFileKind2 } = await import("../chunk-RJ3APNIP.js");
6344
6447
  const files = await collectSourceFilesAsync(cwd, {
6345
6448
  inspectGeneratedHeaders: false
6346
6449
  });
@@ -6414,7 +6517,7 @@ function scheduleManagedToolRefresh(dbg, rulePack) {
6414
6517
  managedToolRefreshTimer = void 0;
6415
6518
  void (async () => {
6416
6519
  try {
6417
- const refresh = await import("../chunk-PXGVB2CY.js");
6520
+ const refresh = await import("../chunk-J2ZB5MDS.js");
6418
6521
  const outcome = await refresh.runManagedToolRefresh(void 0, {
6419
6522
  rulePack
6420
6523
  });
@@ -6464,7 +6567,7 @@ function scanOneTodoFile(scanner, filePath, items) {
6464
6567
  async function collectTodoBaselineItems(scanner, analysisRoot, stillCurrent) {
6465
6568
  const items = [];
6466
6569
  try {
6467
- const { getSourceFilesAsync } = await import("../chunk-3EIZMRXI.js");
6570
+ const { getSourceFilesAsync } = await import("../chunk-MOAVEPC4.js");
6468
6571
  const files = await getSourceFilesAsync(analysisRoot, true);
6469
6572
  if (!stillCurrent())
6470
6573
  return items;
@@ -6493,7 +6596,7 @@ async function buildOrRefreshWordIndex(args) {
6493
6596
  const snapshot = loadProjectSnapshot(snapshotRoot);
6494
6597
  const snapshotLoadMs = Date.now() - snapshotLoadStartMs;
6495
6598
  if (snapshot?.wordIndex) {
6496
- const { deserializeWordIndex, refreshWordIndexIncrementally, countWordIndexPostingEntries: countWordIndexPostingEntries2, estimateWordIndexResidentBytes: estimateWordIndexResidentBytes2, notifyWordIndexPublished: notifyWordIndexPublished2 } = await import("../chunk-HSTN27NR.js");
6599
+ const { deserializeWordIndex, refreshWordIndexIncrementally, countWordIndexPostingEntries: countWordIndexPostingEntries2, estimateWordIndexResidentBytes: estimateWordIndexResidentBytes2, notifyWordIndexPublished: notifyWordIndexPublished2 } = await import("../chunk-I2FYOZNW.js");
6497
6600
  const deserializeStartMs = Date.now();
6498
6601
  const index = deserializeWordIndex(snapshot.wordIndex);
6499
6602
  const deserializeMs = Date.now() - deserializeStartMs;
@@ -6566,7 +6669,7 @@ async function buildOrRefreshWordIndex(args) {
6566
6669
  }
6567
6670
  }
6568
6671
  }
6569
- const { buildWordIndexAsync, collectWordIndexDocs, countWordIndexPostingEntries, estimateWordIndexResidentBytes, notifyWordIndexPublished } = await import("../chunk-HSTN27NR.js");
6672
+ const { buildWordIndexAsync, collectWordIndexDocs, countWordIndexPostingEntries, estimateWordIndexResidentBytes, notifyWordIndexPublished } = await import("../chunk-I2FYOZNW.js");
6570
6673
  const docs = await collectWordIndexDocs(analysisRoot, () => runtime.isCurrentSession(sessionGeneration), rebuildPreflightFiles);
6571
6674
  if (!runtime.isCurrentSession(sessionGeneration))
6572
6675
  return;
@@ -6651,7 +6754,7 @@ function scheduleStartupScansWithClients(deps, runtime, sessionGeneration, analy
6651
6754
  const delay = STARTUP_TASK_DEFER_MS[name] ?? 0;
6652
6755
  dbg(`session_start task ${name}: scheduled deferMs=${delay}`);
6653
6756
  runtime.markStartupScanInFlight(name, sessionGeneration);
6654
- const completion = new Promise((resolve34) => {
6757
+ const completion = new Promise((resolve33) => {
6655
6758
  const fire = () => {
6656
6759
  const startedAt = Date.now();
6657
6760
  dbg(`session_start task ${name}: start queuedMs=${startedAt - queuedAt}`);
@@ -6663,7 +6766,7 @@ function scheduleStartupScansWithClients(deps, runtime, sessionGeneration, analy
6663
6766
  }).finally(() => {
6664
6767
  runtime.clearStartupScanInFlight(name, sessionGeneration);
6665
6768
  dbg(`session_start task ${name}: end`);
6666
- resolve34();
6769
+ resolve33();
6667
6770
  });
6668
6771
  };
6669
6772
  if (delay > 0) {
@@ -6946,8 +7049,8 @@ function scheduleStartupScansWithClients(deps, runtime, sessionGeneration, analy
6946
7049
  let callGraphIdentity;
6947
7050
  const callGraphTask = runTask("call-graph", async () => {
6948
7051
  const { FactStore: FactStore2 } = await import("../chunk-X33QECRJ.js");
6949
- const { buildOrUpdateGraph, extractSymbolsAndRefsFromGraph, getReviewGraphCacheIdentity } = await import("../chunk-7T64QA5D.js");
6950
- const { buildCallGraph, saveCallGraph, loadCallGraph: loadCallGraph2 } = await import("../chunk-TOOXNL6M.js");
7052
+ const { buildOrUpdateGraph, extractSymbolsAndRefsFromGraph, getReviewGraphCacheIdentity } = await import("../chunk-VWEBZ2JV.js");
7053
+ const { buildCallGraph, saveCallGraph, loadCallGraph: loadCallGraph2 } = await import("../chunk-NGNBJIUO.js");
6951
7054
  if (!runtime.isCurrentSession(sessionGeneration))
6952
7055
  return;
6953
7056
  const startMs = Date.now();
@@ -6988,7 +7091,7 @@ function scheduleStartupScansWithClients(deps, runtime, sessionGeneration, analy
6988
7091
  return;
6989
7092
  if (!runtime.callGraph)
6990
7093
  return;
6991
- const { buildCodebaseModel, saveCodebaseModel, DEFAULT_CODEBASE_MODEL_TOKEN_BUDGET } = await import("../chunk-7ZVEFWOE.js");
7094
+ const { buildCodebaseModel, saveCodebaseModel, DEFAULT_CODEBASE_MODEL_TOKEN_BUDGET } = await import("../chunk-RIH3UBK4.js");
6992
7095
  if (!callGraphIdentity)
6993
7096
  return;
6994
7097
  const model = buildCodebaseModel(runtime.callGraph, analysisRoot, DEFAULT_CODEBASE_MODEL_TOKEN_BUDGET, callGraphIdentity);
@@ -7197,8 +7300,8 @@ async function handleSessionStart(deps) {
7197
7300
  try {
7198
7301
  warmupDbg("warmup: starting background warmup");
7199
7302
  const scanContextStartedAt = Date.now();
7200
- const startupScanModule = await import("../chunk-ILC2B7IJ.js");
7201
- const languageProfileModule = await import("../chunk-C6V2DSZZ.js");
7303
+ const startupScanModule = await import("../chunk-7ZVTFLCC.js");
7304
+ const languageProfileModule = await import("../chunk-3QXFUP6T.js");
7202
7305
  const warmupSnapshotRoot = resolveSnapshotRoot(warmupCwd);
7203
7306
  const cachedSnapshot = loadProjectSnapshot(warmupSnapshotRoot);
7204
7307
  warmupOwnSnapshotRead = cachedSnapshot ? {
@@ -8098,7 +8201,7 @@ async function buildActionableWarningsReport(args) {
8098
8201
  }
8099
8202
  };
8100
8203
  const deferredWork = (async () => {
8101
- await new Promise((resolve34) => setTimeout(resolve34, 0));
8204
+ await new Promise((resolve33) => setTimeout(resolve33, 0));
8102
8205
  const deferredRecords = [...carried];
8103
8206
  const deferredDeadline = Date.now() + ACTIONABLE_WARNINGS_DEFERRED_BUDGET_MS;
8104
8207
  deferredDeps.deadlineAt = deferredDeadline;
@@ -8234,7 +8337,9 @@ async function enrichFileFromLsp(cwd, args, target, deps) {
8234
8337
  let budgetStopped = 0;
8235
8338
  for (const diag of diagsWarning) {
8236
8339
  if (deps.deadlineAt !== void 0 && Date.now() >= deps.deadlineAt) {
8237
- budgetStopped = diagsWarning.length - diagsWarning.indexOf(diag);
8340
+ const stoppedAt = diagsWarning.indexOf(diag);
8341
+ budgetStopped = diagsWarning.length - stoppedAt;
8342
+ deps.unanswered?.push(...diagsWarning.slice(stoppedAt).map((left) => recordFromLspDiagnostic(left, filePath, cwd)));
8238
8343
  break;
8239
8344
  }
8240
8345
  const line = diag.range.start.line + 1;
@@ -8244,14 +8349,18 @@ async function enrichFileFromLsp(cwd, args, target, deps) {
8244
8349
  }
8245
8350
  if (actionPulls >= ACTIONABLE_WARNINGS_MAX_CODE_ACTIONS_PER_FILE) {
8246
8351
  actionCapped++;
8352
+ deps.unanswered?.push(recordFromLspDiagnostic(diag, filePath, cwd));
8247
8353
  continue;
8248
8354
  }
8249
8355
  actionPulls++;
8250
8356
  const record = recordFromLspDiagnostic(diag, filePath, cwd);
8251
8357
  try {
8252
8358
  const actions = await boundedLspCall(() => lspService.codeAction(filePath, diag.range.start.line, diag.range.start.character, diag.range.end.line, diag.range.end.character), deps);
8359
+ if (actions === void 0)
8360
+ deps.unanswered?.push(record);
8253
8361
  record.actions = (actions ?? []).map(serializeAction).slice(0, 5);
8254
8362
  } catch (err) {
8363
+ deps.unanswered?.push(record);
8255
8364
  args.dbg?.(`actionable_warnings: LSP codeAction failed for ${filePath}: ${err}`);
8256
8365
  }
8257
8366
  if (record.actions.length > 0) {
@@ -8754,7 +8863,7 @@ import * as path17 from "node:path";
8754
8863
 
8755
8864
  // dist/clients/deferred-runner-blockers.js
8756
8865
  import * as fs13 from "node:fs";
8757
- import { resolve as resolve9 } from "node:path";
8866
+ import { resolve as resolve10 } from "node:path";
8758
8867
  function judgeDeferredRunnerFindings(pending2, cwd, options = {}) {
8759
8868
  const findings = (pending2.result?.diagnostics ?? []).flatMap((d) => d.runnerFault === true ? [] : [d]);
8760
8869
  if (findings.length === 0) {
@@ -8795,7 +8904,7 @@ function judgeDeferredRunnerFindings(pending2, cwd, options = {}) {
8795
8904
  };
8796
8905
  }
8797
8906
  function recordDeferredRunnerBlockers(runtime, pending2, survivors, bytes) {
8798
- const blocking = stampLineHashes(withoutLaneCopies(runtime, pending2, survivors).flatMap((d) => d.semantic === "blocking" ? [{ ...d, runnerId: d.runnerId ?? pending2.runnerId }] : []), bytes?.toString("utf-8"), (d) => !d.filePath || resolve9(d.filePath) === resolve9(pending2.filePath));
8907
+ const blocking = stampLineHashes(withoutLaneCopies(runtime, pending2, survivors).flatMap((d) => d.semantic === "blocking" ? [{ ...d, runnerId: d.runnerId ?? pending2.runnerId }] : []), bytes?.toString("utf-8"), (d) => !d.filePath || resolve10(d.filePath) === resolve10(pending2.filePath));
8799
8908
  if (blocking.length === 0)
8800
8909
  return 0;
8801
8910
  const recorded = runtime.recordDeferredInlineBlockers(
@@ -9424,13 +9533,16 @@ function clearGitGuardTestFailure(cacheManager2, cwd, runtime, passedFiles = [])
9424
9533
  }
9425
9534
 
9426
9535
  // dist/clients/secret-findings.js
9536
+ import { isAbsolute as isAbsolute3 } from "node:path";
9427
9537
  var SECRET_RULE_PATTERN = /hardcoded|secret|password|credential/i;
9428
9538
  function isSecretWarning(warning) {
9429
9539
  const id = `${warning.rule ?? ""} ${warning.code ?? ""}`;
9430
9540
  return SECRET_RULE_PATTERN.test(id);
9431
9541
  }
9432
- function secretLocationKey(file, line) {
9433
- return `${normalizeFilePath(file)}:${line}`;
9542
+ function secretLocationKey(file, line, cwd) {
9543
+ const spelled = normalizeHostToolPath(file);
9544
+ const identity = isAbsolute3(spelled) ? spelled : `${cwd}/${spelled}`;
9545
+ return `${normalizeMapKey(identity)}:${line}`;
9434
9546
  }
9435
9547
  function fromGitleaks(findings) {
9436
9548
  return findings.map((f) => ({
@@ -9473,10 +9585,10 @@ var SOURCE_PRIORITY = {
9473
9585
  function sortSources(sources) {
9474
9586
  return [...new Set(sources)].sort((a, b) => SOURCE_PRIORITY[a] - SOURCE_PRIORITY[b]);
9475
9587
  }
9476
- function dedupeSecretFindings(findings) {
9588
+ function dedupeSecretFindings(findings, cwd) {
9477
9589
  const byKey = /* @__PURE__ */ new Map();
9478
9590
  for (const f of findings) {
9479
- const key = secretLocationKey(f.file, f.line);
9591
+ const key = secretLocationKey(f.file, f.line, cwd);
9480
9592
  const incoming = sortSources(f.sources);
9481
9593
  const existed = byKey.get(key);
9482
9594
  if (!existed) {
@@ -9704,17 +9816,14 @@ function gate2(gates, ctx) {
9704
9816
  };
9705
9817
  }
9706
9818
  function render2(kept, ctx) {
9707
- const sessionSecrets = dedupeSecretFindings([
9708
- ...fromGitleaks(kept.gitleaksLive),
9709
- ...fromTrivySecrets(kept.trivyLive)
9710
- ]);
9711
- const deliveredLocationKeys = new Set(sessionSecrets.map((f) => secretLocationKey(f.file, f.line)));
9819
+ const sessionSecrets = dedupeSecretFindings([...fromGitleaks(kept.gitleaksLive), ...fromTrivySecrets(kept.trivyLive)], ctx.cwd);
9820
+ const deliveredLocationKeys = new Set(sessionSecrets.map((f) => secretLocationKey(f.file, f.line, ctx.cwd)));
9712
9821
  const blockerSections = [];
9713
9822
  if (sessionSecrets.length) {
9714
9823
  const enriched = dedupeSecretFindings([
9715
9824
  ...sessionSecrets,
9716
- ...fromAstGrepWarnings(ctx.peekActionableWarnings().filter(isSecretWarning)).filter((a) => deliveredLocationKeys.has(secretLocationKey(a.file, a.line)))
9717
- ]);
9825
+ ...fromAstGrepWarnings(ctx.peekActionableWarnings().filter(isSecretWarning)).filter((a) => deliveredLocationKeys.has(secretLocationKey(a.file, a.line, ctx.cwd)))
9826
+ ], ctx.cwd);
9718
9827
  const shown2 = enriched.slice(0, 5);
9719
9828
  let report = "\u{1F534} STOP \u2014 hardcoded secrets detected. Rotate the credentials and remove them from source:\n";
9720
9829
  for (const f of shown2) {
@@ -9843,7 +9952,7 @@ function stillReportedParked(parked, current, keyOf, offeredKeys) {
9843
9952
  }
9844
9953
 
9845
9954
  // dist/clients/knip-scan-roots.js
9846
- import { resolve as resolve14 } from "node:path";
9955
+ import { resolve as resolve15 } from "node:path";
9847
9956
  var MAX_KNIP_ROOTS_PER_TURN = 3;
9848
9957
  function resolveKnipScanRoots(sessionCwd, modifiedFiles) {
9849
9958
  const session = resolveGitCheckout(sessionCwd);
@@ -9853,7 +9962,7 @@ function resolveKnipScanRoots(sessionCwd, modifiedFiles) {
9853
9962
  let sessionOwnsEdit = false;
9854
9963
  const linked = [];
9855
9964
  for (const file of modifiedFiles) {
9856
- const owner = resolveLinkedWorktreeOwner(session, resolve14(sessionCwd, file));
9965
+ const owner = resolveLinkedWorktreeOwner(session, resolve15(sessionCwd, file));
9857
9966
  if (owner === null) {
9858
9967
  sessionOwnsEdit = true;
9859
9968
  } else if (!linked.some((known) => pathsEqual(known.root, owner.root))) {
@@ -10001,14 +10110,14 @@ function emitLensTurnFindings(payload) {
10001
10110
  }
10002
10111
 
10003
10112
  // dist/clients/test-target-roots.js
10004
- import { dirname as dirname6 } from "node:path";
10113
+ import { dirname as dirname7 } from "node:path";
10005
10114
  function createTurnEndTestRoots(sessionCwd) {
10006
10115
  const session = resolveGitCheckout(sessionCwd);
10007
10116
  const ownerByDir = /* @__PURE__ */ new Map();
10008
10117
  return (absoluteFile) => {
10009
10118
  if (session === null)
10010
10119
  return sessionCwd;
10011
- const dir = dirname6(absoluteFile);
10120
+ const dir = dirname7(absoluteFile);
10012
10121
  let owner = ownerByDir.get(dir);
10013
10122
  if (owner === void 0) {
10014
10123
  owner = resolveLinkedWorktreeOwner(session, absoluteFile);
@@ -10172,27 +10281,37 @@ async function runPersistentReverify(args) {
10172
10281
  continue;
10173
10282
  }
10174
10283
  touched += 1;
10175
- const freshRecords = await bounded(enrichFileFromLsp(args.cwd, buildArgs, { filePath: entry.filePath, cached: touchedResult.diags }, {
10284
+ const unanswered = [];
10285
+ const enriched = await bounded(enrichFileFromLsp(args.cwd, buildArgs, { filePath: entry.filePath, cached: touchedResult.diags }, {
10176
10286
  lspService: args.lspService,
10177
10287
  pullTimeoutMs: 2e3,
10178
10288
  deadlineAt,
10179
10289
  ...args.signal !== void 0 ? { signal: args.signal } : {},
10180
- site: { hook: "turn_end", label: "persistent_reverify" }
10290
+ site: { hook: "turn_end", label: "persistent_reverify" },
10291
+ unanswered
10181
10292
  }), {
10182
10293
  ms: Math.max(250, deadlineAt - Date.now()),
10183
10294
  signal: args.signal,
10184
10295
  hook: "turn_end",
10185
10296
  label: "persistent_reverify_enrich"
10186
- }) ?? [];
10187
- let dropped = 0;
10188
- let kept = 0;
10189
- for (const warning of entry.warnings) {
10190
- const stillThere = freshRecords.some((record) => record.rule === warning.rule && record.message === warning.message);
10191
- if (stillThere)
10192
- kept += 1;
10193
- else
10194
- dropped += 1;
10297
+ });
10298
+ const sameWarning = (a, b) => a.rule === b.rule && a.message === b.message;
10299
+ const carriedUnanswered = enriched === void 0 ? entry.warnings : entry.warnings.filter((carried) => !enriched.some((fresh) => sameWarning(fresh, carried)) && unanswered.some((open) => sameWarning(open, carried)));
10300
+ const retirable = enriched === void 0 ? 0 : entry.warnings.filter((carried) => !enriched.some((fresh) => sameWarning(fresh, carried)) && !carriedUnanswered.includes(carried)).length;
10301
+ if (enriched === void 0 || carriedUnanswered.length > 0 && retirable === 0) {
10302
+ outcomes.push({
10303
+ filePath: entry.filePath,
10304
+ displayPath: entry.displayPath,
10305
+ outcome: "unconfirmed",
10306
+ dropped: 0,
10307
+ kept: entry.warnings.length
10308
+ });
10309
+ replacementFiles.push({ ...entry, reVerifyIncomplete: true });
10310
+ continue;
10195
10311
  }
10312
+ const freshRecords = [...enriched, ...carriedUnanswered];
10313
+ const dropped = retirable;
10314
+ const kept = entry.warnings.length - dropped;
10196
10315
  const outcome = freshRecords.length === 0 ? "clean" : dropped === 0 ? "reconfirmed" : "mixed";
10197
10316
  outcomes.push({
10198
10317
  filePath: entry.filePath,
@@ -10206,7 +10325,8 @@ async function runPersistentReverify(args) {
10206
10325
  ...entryWithoutIncomplete,
10207
10326
  warnings: freshRecords,
10208
10327
  reVerified: true,
10209
- generatedAt: new Date(nowMs).toISOString()
10328
+ generatedAt: new Date(nowMs).toISOString(),
10329
+ ...carriedUnanswered.length > 0 ? { reVerifyIncomplete: true } : {}
10210
10330
  });
10211
10331
  }
10212
10332
  logLatency({
@@ -10439,7 +10559,7 @@ async function runTestTargetsBounded(args) {
10439
10559
  });
10440
10560
  void pool.catch(() => {
10441
10561
  });
10442
- await new Promise((resolve34) => {
10562
+ await new Promise((resolve33) => {
10443
10563
  let settled = false;
10444
10564
  const finish = (reason) => {
10445
10565
  if (settled)
@@ -10451,7 +10571,7 @@ async function runTestTargetsBounded(args) {
10451
10571
  batchAbort.abort();
10452
10572
  clearTimeout(timer);
10453
10573
  args.signal?.removeEventListener("abort", onAbort);
10454
- resolve34();
10574
+ resolve33();
10455
10575
  };
10456
10576
  const onAbort = () => finish("abort");
10457
10577
  const timer = setTimeout(() => finish("budget"), budgetMs);
@@ -10854,6 +10974,8 @@ async function handleTurnEnd(deps) {
10854
10974
  }
10855
10975
  const turnEndStart = Date.now();
10856
10976
  const blockerParts = [];
10977
+ const replayedBlockers = /* @__PURE__ */ new Map();
10978
+ const cappedBlockerText = /* @__PURE__ */ new Map();
10857
10979
  const staleSecretParts = [];
10858
10980
  const advisoryParts = [];
10859
10981
  const provenanceCitations = /* @__PURE__ */ new Map();
@@ -11148,6 +11270,9 @@ ${retirementNote}` : "");
11148
11270
  ${policy.body}`;
11149
11271
  blockerParts.push(replayPart);
11150
11272
  citePart(replayPart, [bPath]);
11273
+ replayedBlockers.set(replayPart, { filePath: bPath, displayPath });
11274
+ if (runtime.blockerFullDeliveryCapped(bPath))
11275
+ cappedBlockerText.set(replayPart, cappedBlockerLine(displayPath));
11151
11276
  }
11152
11277
  }
11153
11278
  const guardLatchBefore = runtime.gitGuardHasBlockers;
@@ -12915,8 +13040,8 @@ ${lines.join("\n")}`;
12915
13040
  } else {
12916
13041
  const callGraphStart = Date.now();
12917
13042
  try {
12918
- const { impact, formatImpact, parseSymbolKey } = await import("../chunk-TOOXNL6M.js");
12919
- const { callGraphImpactToProjectDiagnostics } = await import("../chunk-R67WQ5RY.js");
13043
+ const { impact, formatImpact, parseSymbolKey } = await import("../chunk-NGNBJIUO.js");
13044
+ const { callGraphImpactToProjectDiagnostics } = await import("../chunk-UN72ZAJ5.js");
12920
13045
  const impactLines = [];
12921
13046
  let callGraphDispositionSuppressed = 0;
12922
13047
  const impactFindings = [];
@@ -13114,7 +13239,7 @@ ${impactLines.join("\n")}`;
13114
13239
  };
13115
13240
  });
13116
13241
  dispositionSuppressed += policy.suppressed;
13117
- const kept = policy.kept.filter((warning) => !(isSecretWarning(warning) && typeof warning.line === "number" && secretBlockedLocations.has(secretLocationKey(warning.filePath, warning.line))));
13242
+ const kept = policy.kept.filter((warning) => !(isSecretWarning(warning) && typeof warning.line === "number" && secretBlockedLocations.has(secretLocationKey(warning.filePath, warning.line, cwd))));
13118
13243
  return kept.length > 0 ? { ...file, warnings: kept } : void 0;
13119
13244
  }).filter((file) => file !== void 0);
13120
13245
  recordDispositionSuppressed("actionable-warnings", dispositionSuppressed);
@@ -13550,7 +13675,10 @@ ${lines.join("\n")}`;
13550
13675
  // so an otherwise empty turn still delivers them ONCE (the coordinator
13551
13676
  // consumed them).
13552
13677
  ...resolvedParts.map(asIs),
13553
- ...blockerParts.map(asIs),
13678
+ ...blockerParts.map((raw) => ({
13679
+ raw,
13680
+ text: cappedBlockerText.get(raw) ?? raw
13681
+ })),
13554
13682
  ...staleSecretParts.map(asIs),
13555
13683
  // #3814: a blocking late-runner finding never reaches `advisoryParts`; it
13556
13684
  // rides the blocker replay, so every advisory part gets the label.
@@ -13649,7 +13777,7 @@ ${raw}`
13649
13777
  };
13650
13778
  const content = capTurnEndMessage(joined, holdPlan.heldCount);
13651
13779
  const countDrivenFileSet = deliveryHolds.some((hold) => hold.skipOnSuppressed === true && holdPlan.reachedParts.some((part) => part.raw === hold.part)) ? files.slice().sort((a, b) => compareOrdinal(a, b)).join("|") : "";
13652
- const signature = `${countDrivenFileSet}::${content}`;
13780
+ const signature = `${countDrivenFileSet}::${cappedBlockerText.size === 0 ? content : capTurnEndMessage(composedParts.map((part) => cappedBlockerText.has(part.raw) ? part.raw : part.text).join("\n\n"), holdPlan.heldCount)}`;
13653
13781
  const last = readLastDelivery(cacheManager2, cwd);
13654
13782
  const duplicate = last?.signature === signature && last?.sessionId === deliverySessionId && // #3813: a retirement is an event, not a persisting finding. The
13655
13783
  // coordinator already consumed these entries, so an identical
@@ -13657,7 +13785,15 @@ ${raw}`
13657
13785
  // ordinal) would be consumed and never shown (#3776 verify r3 F6).
13658
13786
  resolvedBlockerFileList.length === 0;
13659
13787
  const waiting = duplicate ? readTurnEndGuardRecord(cacheManager2, runtime, cwd, sessionId).stored : void 0;
13660
- const repeatContent = duplicate && blockerParts.length > 0 && deps.deliveryAddress === void 0 && !(waiting && waiting.consumed !== true && waiting.repeat !== true) ? blockerRepeatContent(capTurnEndMessage(blockerParts.join("\n\n"))) : void 0;
13788
+ const repeatParts = [
13789
+ ...blockerParts.flatMap((part) => cappedBlockerText.has(part) ? [] : [part]),
13790
+ ...blockerParts.flatMap((part) => cappedBlockerText.has(part) ? [part] : [])
13791
+ ].map((raw) => ({ raw, text: cappedBlockerText.get(raw) ?? raw }));
13792
+ const pointerOnly = repeatParts.every((part) => part.raw !== part.text);
13793
+ const repeatSeparator = pointerOnly ? "\n" : "\n\n";
13794
+ const repeatJoined = repeatParts.map((part) => part.text).join(repeatSeparator);
13795
+ const repeatContent = duplicate && blockerParts.length > 0 && deps.deliveryAddress === void 0 && !(waiting && waiting.consumed !== true && waiting.repeat !== true) ? blockerRepeatContent(capTurnEndMessage(repeatJoined), pointerOnly) : void 0;
13796
+ const repeatBodies = repeatContent === void 0 ? void 0 : blockerParts;
13661
13797
  if (duplicate && repeatContent === void 0) {
13662
13798
  dbg("turn_end: duplicate findings detected (same session), suppressing re-prompt");
13663
13799
  if (getFlag("lens-guard")) {
@@ -13704,6 +13840,21 @@ ${raw}`
13704
13840
  return;
13705
13841
  }
13706
13842
  settleHolds(repeatContent !== void 0);
13843
+ const reachedParts = repeatContent === void 0 ? holdPlan.reachedParts : planDeliveryHolds({
13844
+ holds: [],
13845
+ parts: repeatParts,
13846
+ keptChars: turnEndKeptChars(repeatJoined),
13847
+ separatorLength: repeatSeparator.length
13848
+ }).reachedParts;
13849
+ const blockerDeliveries = deps.deliveryAddress === void 0 ? reachedParts.flatMap((part) => {
13850
+ const replayed = replayedBlockers.get(part.raw);
13851
+ return replayed === void 0 ? [] : [
13852
+ {
13853
+ ...replayed,
13854
+ shown: cappedBlockerText.has(part.raw) ? "collapsed" : "full"
13855
+ }
13856
+ ];
13857
+ }) : void 0;
13707
13858
  const stagedContent = repeatContent ?? content;
13708
13859
  repeatStaged = repeatContent !== void 0;
13709
13860
  const fileSeqByPath2 = {};
@@ -13774,7 +13925,8 @@ ${raw}`
13774
13925
  fileSeqByPath: fileSeqByPath2,
13775
13926
  fileContentHashes: {},
13776
13927
  consumed: false,
13777
- ...repeatContent === void 0 ? {} : { repeat: true },
13928
+ ...repeatContent === void 0 ? {} : { repeat: true, repeatBodies },
13929
+ ...blockerDeliveries === void 0 ? {} : { blockerDeliveries },
13778
13930
  testFailures: existingGuard?.testFailures,
13779
13931
  testFailureContent: existingGuard?.testFailureContent,
13780
13932
  testFailureFiles: existingGuard?.testFailureFiles
@@ -13788,7 +13940,8 @@ ${raw}`
13788
13940
  const affectedFilesTruncated = new Set(allAffectedFiles).size > affectedFiles.length;
13789
13941
  cacheManager2.writeCache("turn-end-findings", {
13790
13942
  content: stagedContent,
13791
- ...repeatContent === void 0 ? {} : { repeat: true },
13943
+ ...repeatContent === void 0 ? {} : { repeat: true, repeatBodies },
13944
+ ...blockerDeliveries === void 0 ? {} : { blockerDeliveries },
13792
13945
  affectedFiles,
13793
13946
  affectedFilesTruncated,
13794
13947
  provenance: stampProvenance(affectedFiles, affectedFilesTruncated),
@@ -13935,10 +14088,10 @@ var TurnEndQueue = class {
13935
14088
  if (this.pending.length >= 1) {
13936
14089
  return Promise.reject(new Error("turn_end queue is busy"));
13937
14090
  }
13938
- return new Promise((resolve34, reject) => {
14091
+ return new Promise((resolve33, reject) => {
13939
14092
  const item = {
13940
14093
  work,
13941
- resolve: resolve34,
14094
+ resolve: resolve33,
13942
14095
  reject,
13943
14096
  timer: setTimeout(() => {
13944
14097
  const index = this.pending.indexOf(item);
@@ -13982,15 +14135,16 @@ async function runTurnEndNowImpl(cwd, files = [], deferredDelivery = false) {
13982
14135
  const host = createMcpHost(void 0, cwd);
13983
14136
  let registered2 = 0;
13984
14137
  for (const file of files) {
13985
- const abs = path25.isAbsolute(file) ? file : path25.resolve(cwd, file);
14138
+ const abs = resolveHostToolPath(file, cwd);
13986
14139
  let lineCount3 = 1;
13987
14140
  try {
13988
14141
  lineCount3 = fs17.readFileSync(abs, "utf8").split("\n").length;
13989
14142
  } catch {
13990
14143
  continue;
13991
14144
  }
13992
- ctx.cacheManager.addModifiedRange(abs, { start: 1, end: lineCount3 }, true, cwd, MCP_TURN_STATE_OWNER_ID, "mcp");
13993
- registered2++;
14145
+ const worklist = ctx.cacheManager.addModifiedRange(abs, { start: 1, end: lineCount3 }, true, cwd, MCP_TURN_STATE_OWNER_ID, "mcp");
14146
+ if (worklist.files[ctx.cacheManager.toTurnStateKey(abs, cwd)])
14147
+ registered2++;
13994
14148
  }
13995
14149
  const owner = {
13996
14150
  kind: "mcp",
@@ -14123,7 +14277,7 @@ function acknowledgeTurnEnd(cwd, deliveryId) {
14123
14277
 
14124
14278
  // dist/clients/module-report.js
14125
14279
  import * as fs18 from "node:fs";
14126
- import * as path26 from "node:path";
14280
+ import * as path25 from "node:path";
14127
14281
 
14128
14282
  // dist/clients/middle-man-analysis.js
14129
14283
  var SELF_TOKEN = {
@@ -14698,7 +14852,7 @@ function blastReadArgs(graph, normalizedFile) {
14698
14852
  return { path: normalizedFile, offset: 1, limit };
14699
14853
  }
14700
14854
  async function computeBlastRadius(graph, normalizedPath, projectRoot, maxDepth) {
14701
- const { computeTransitiveImpact } = await import("../chunk-WTSQKJAR.js");
14855
+ const { computeTransitiveImpact } = await import("../chunk-K7O6AHSJ.js");
14702
14856
  const result = computeTransitiveImpact(graph, normalizedPath, { maxDepth });
14703
14857
  const byFile = /* @__PURE__ */ new Map();
14704
14858
  for (const hit of result.hits) {
@@ -15288,7 +15442,7 @@ async function moduleReport(file, cwd, options) {
15288
15442
  const startedAt = Date.now();
15289
15443
  const maxRefs = normalizeMaxRefsPerSymbol(options?.maxRefsPerSymbol);
15290
15444
  const maxCallGraphEntries = Math.min(CALL_GRAPH_MAX_ENTRY_CAP, Math.max(1, Math.floor(options?.maxCallGraphEntries ?? CALL_GRAPH_DEFAULT_ENTRY_CAP)));
15291
- const absPath = path26.resolve(cwd, file);
15445
+ const absPath = path25.resolve(cwd, file);
15292
15446
  const normalizedPath = normalizeMapKey(absPath);
15293
15447
  let content;
15294
15448
  try {
@@ -15315,7 +15469,7 @@ async function moduleReport(file, cwd, options) {
15315
15469
  let callGraphIdentity;
15316
15470
  let revisionDriftNote;
15317
15471
  try {
15318
- const { getCachedReviewGraph, getReviewGraphCacheIdentity, getReviewGraphSizeSkipVerdict, getReviewGraphRevisionDrift, formatReviewGraphRevisionDriftNote: formatReviewGraphRevisionDriftNote2 } = await import("../chunk-7T64QA5D.js");
15472
+ const { getCachedReviewGraph, getReviewGraphCacheIdentity, getReviewGraphSizeSkipVerdict, getReviewGraphRevisionDrift, formatReviewGraphRevisionDriftNote: formatReviewGraphRevisionDriftNote2 } = await import("../chunk-VWEBZ2JV.js");
15319
15473
  graph = getCachedReviewGraph(cwd);
15320
15474
  graphFileCap = getReviewGraphSizeSkipVerdict(cwd)?.maxFileCount;
15321
15475
  const drift = graph ? getReviewGraphRevisionDrift(cwd) : void 0;
@@ -15698,7 +15852,7 @@ function suggestSimilarNames(candidates, target) {
15698
15852
  async function readSymbol(file, symbolName, cwd, options = {}) {
15699
15853
  const { kind: symbolKindFilter } = options;
15700
15854
  const startedAt = Date.now();
15701
- const absPath = path26.resolve(cwd, file);
15855
+ const absPath = path25.resolve(cwd, file);
15702
15856
  const log = (found) => {
15703
15857
  logLatency({
15704
15858
  type: "phase",
@@ -15902,7 +16056,7 @@ function enclosingOutline(selected, symbols, callbacks, filters, filePath) {
15902
16056
  }
15903
16057
  async function readEnclosing(file, line, cwd, options) {
15904
16058
  const startedAt = Date.now();
15905
- const absPath = path26.resolve(cwd, file);
16059
+ const absPath = path25.resolve(cwd, file);
15906
16060
  const targetLine = Math.max(1, Math.floor(line));
15907
16061
  const maxLines = options?.maxLines !== void 0 && Number.isFinite(options.maxLines) ? Math.max(1, Math.floor(options.maxLines)) : void 0;
15908
16062
  const aroundLine = options?.aroundLine !== void 0 && Number.isFinite(options.aroundLine) ? options.aroundLine : void 0;
@@ -16080,7 +16234,7 @@ async function readEnclosing(file, line, cwd, options) {
16080
16234
  }
16081
16235
 
16082
16236
  // dist/clients/project-report.js
16083
- import * as path27 from "node:path";
16237
+ import * as path26 from "node:path";
16084
16238
  var DEFAULT_LIMIT = 10;
16085
16239
  var STALE_THRESHOLD_MS = 15 * 6e4;
16086
16240
  var LOW_COVERAGE_THRESHOLD = 0.8;
@@ -16226,7 +16380,7 @@ function roleFor(graph, filePath) {
16226
16380
  return top.length > 0 ? top.map((s) => s.name).join(", ") : void 0;
16227
16381
  }
16228
16382
  async function computeHubs(graph, degrees, cwd, limit, focusTerms) {
16229
- const { computeTransitiveImpact } = await import("../chunk-WTSQKJAR.js");
16383
+ const { computeTransitiveImpact } = await import("../chunk-K7O6AHSJ.js");
16230
16384
  const ranked = [...graph.fileNodes.entries()].map(([filePath, fileNodeId]) => ({
16231
16385
  filePath,
16232
16386
  fileNodeId,
@@ -16464,7 +16618,7 @@ function computeDeadWeight(graph, degrees, entryPointFiles, cwd, limit) {
16464
16618
  }
16465
16619
  var inFlightGraphBuilds = /* @__PURE__ */ new Set();
16466
16620
  function triggerBackgroundGraphBuild(cwd, deps) {
16467
- const key = normalizeMapKey(path27.resolve(cwd));
16621
+ const key = normalizeMapKey(path26.resolve(cwd));
16468
16622
  if (inFlightGraphBuilds.has(key))
16469
16623
  return "already_running";
16470
16624
  const deduped = deps.isGraphBuildInFlight(key, []);
@@ -16477,7 +16631,7 @@ function triggerBackgroundGraphBuild(cwd, deps) {
16477
16631
  async function projectReport(cwd, options) {
16478
16632
  const limit = clampLimit(options?.limit);
16479
16633
  const focusTerms = normalizeFocus2(options?.focus);
16480
- const { getCachedReviewGraph, getReviewGraphSizeSkipVerdict, getLastReviewGraphBuildAttempt, buildOrUpdateGraph, isGraphBuildInFlight, getReviewGraphRevisionDrift } = await import("../chunk-7T64QA5D.js");
16634
+ const { getCachedReviewGraph, getReviewGraphSizeSkipVerdict, getLastReviewGraphBuildAttempt, buildOrUpdateGraph, isGraphBuildInFlight, getReviewGraphRevisionDrift } = await import("../chunk-VWEBZ2JV.js");
16481
16635
  let graph;
16482
16636
  try {
16483
16637
  graph = getCachedReviewGraph(cwd);
@@ -16691,7 +16845,7 @@ function fmtPct(n) {
16691
16845
 
16692
16846
  // dist/clients/effective-config.js
16693
16847
  import * as os3 from "node:os";
16694
- import * as path28 from "node:path";
16848
+ import * as path27 from "node:path";
16695
16849
  function isEffectiveFileViewError(file) {
16696
16850
  return "error" in file;
16697
16851
  }
@@ -16771,10 +16925,10 @@ async function effectiveConfig(options = {}) {
16771
16925
  globalConfigPath: getPiLensGlobalConfigPath(),
16772
16926
  homeDir
16773
16927
  });
16774
- const requestedFile = options.file === void 0 ? void 0 : path28.resolve(cwd, options.file);
16928
+ const requestedFile = options.file === void 0 ? void 0 : resolveHostToolPath(options.file, cwd);
16775
16929
  const fileOutsideCwd = requestedFile !== void 0 && !isSameOrWithin(cwd, requestedFile);
16776
16930
  const absolute = fileOutsideCwd ? void 0 : requestedFile;
16777
- const resolution = resolveAt(absolute === void 0 ? cwd : path28.dirname(absolute));
16931
+ const resolution = resolveAt(absolute === void 0 ? cwd : path27.dirname(absolute));
16778
16932
  const resolved = {
16779
16933
  value: resolution.value,
16780
16934
  provenance: resolution.provenance
@@ -16981,10 +17135,10 @@ function buildSymbolSearchFileFilter(cwd, options) {
16981
17135
  };
16982
17136
  }
16983
17137
  function scopeEntryKeys(cwd, paths) {
16984
- return new Set(paths.map((entry) => normalizeEphemeralMapKey(path29.resolve(cwd, entry))));
17138
+ return new Set(paths.map((entry) => normalizeEphemeralMapKey(path28.resolve(cwd, entry))));
16985
17139
  }
16986
17140
  function fileIsInScope(file, scope) {
16987
- let key = normalizeEphemeralMapKey(path29.resolve(file));
17141
+ let key = normalizeEphemeralMapKey(path28.resolve(file));
16988
17142
  for (; ; ) {
16989
17143
  if (scope.has(key))
16990
17144
  return true;
@@ -17011,7 +17165,7 @@ function unknownLangRefusal(query, lang) {
17011
17165
  }
17012
17166
  function annotateSymbolSearchHitsWithGraph(hits, centrality, graph) {
17013
17167
  for (const hit of hits) {
17014
- const normalized = normalizeMapKey(path29.resolve(hit.file));
17168
+ const normalized = normalizeMapKey(path28.resolve(hit.file));
17015
17169
  const fanIn = centrality.get(hit.file) ?? 0;
17016
17170
  let complexity;
17017
17171
  for (const symbolId of graph.symbolNodesByFile.get(normalized) ?? []) {
@@ -17075,7 +17229,7 @@ async function symbolSearch(query, cwd, limit = 20, options = {}) {
17075
17229
  let centrality;
17076
17230
  let results;
17077
17231
  try {
17078
- centrality = centralityFromReverseDeps(index, snapshot?.reverseDeps, (file) => normalizeMapKey(path29.resolve(file)));
17232
+ centrality = centralityFromReverseDeps(index, snapshot?.reverseDeps, (file) => normalizeMapKey(path28.resolve(file)));
17079
17233
  const fileFilter = buildSymbolSearchFileFilter(cwd, options);
17080
17234
  results = searchWordIndex(index, query, {
17081
17235
  limit: effectiveLimit,
@@ -17086,7 +17240,7 @@ async function symbolSearch(query, cwd, limit = 20, options = {}) {
17086
17240
  warmLease.release();
17087
17241
  }
17088
17242
  const hits = results.map(toSymbolSearchHit);
17089
- const { getCachedReviewGraph } = await import("../chunk-7T64QA5D.js");
17243
+ const { getCachedReviewGraph } = await import("../chunk-VWEBZ2JV.js");
17090
17244
  const graph = getCachedReviewGraph(cwd);
17091
17245
  if (graph)
17092
17246
  annotateSymbolSearchHitsWithGraph(hits, centrality, graph);
@@ -17104,7 +17258,7 @@ function coverageLine(coverage) {
17104
17258
  return `Index covers ${coverage.files} files${coverage.truncated ? " (capped \u2014 results may be incomplete)" : ""}.`;
17105
17259
  }
17106
17260
  function formatSymbolSearchRow(hit, position, cwd) {
17107
- const file = path29.relative(cwd, hit.file);
17261
+ const file = path28.relative(cwd, hit.file);
17108
17262
  if (hit.kind === "file")
17109
17263
  return ` ${position}. ${file}`;
17110
17264
  const annotations = hit.annotations;
@@ -17132,7 +17286,7 @@ function renderCompactSymbolSearch(result, options) {
17132
17286
  footer.push(options.stalenessNote);
17133
17287
  const top = hits[0];
17134
17288
  if (top) {
17135
- footer.push(`Next: ${options.reportTool ?? "module_report"} ${path29.relative(options.cwd, top.file)}`);
17289
+ footer.push(`Next: ${options.reportTool ?? "module_report"} ${path28.relative(options.cwd, top.file)}`);
17136
17290
  }
17137
17291
  if (footer.length > 0)
17138
17292
  sections.push(footer.join("\n"));
@@ -17140,16 +17294,16 @@ function renderCompactSymbolSearch(result, options) {
17140
17294
  }
17141
17295
 
17142
17296
  // dist/tools/ast-grep-replace.js
17143
- import * as path33 from "node:path";
17297
+ import * as path32 from "node:path";
17144
17298
 
17145
17299
  // dist/clients/deps/typebox.js
17146
17300
  import { Type } from "typebox";
17147
17301
 
17148
17302
  // dist/clients/ast-grep-tool-logger.js
17149
- import * as path30 from "node:path";
17303
+ import * as path29 from "node:path";
17150
17304
  var AG_LOG_DIR = getGlobalPiLensLogDir();
17151
- var AG_LOG_FILE = path30.join(AG_LOG_DIR, "ast-grep-tools.log");
17152
- var AG_LOG_BACKUP_FILE = path30.join(AG_LOG_DIR, "ast-grep-tools.log.1");
17305
+ var AG_LOG_FILE = path29.join(AG_LOG_DIR, "ast-grep-tools.log");
17306
+ var AG_LOG_BACKUP_FILE = path29.join(AG_LOG_DIR, "ast-grep-tools.log.1");
17153
17307
  var MAX_LOG_BYTES3 = Math.max(128 * 1024, Number.parseInt(process.env.PI_LENS_AST_GREP_LOG_MAX_BYTES ?? "1048576", 10) || 1048576);
17154
17308
  var writer3 = createNdjsonLogger({
17155
17309
  filePath: AG_LOG_FILE,
@@ -17328,18 +17482,18 @@ function canonicalLanguage(lang) {
17328
17482
 
17329
17483
  // dist/tools/shared.js
17330
17484
  import * as os4 from "node:os";
17331
- import * as path32 from "node:path";
17485
+ import * as path31 from "node:path";
17332
17486
 
17333
17487
  // dist/clients/path-globs.js
17334
17488
  import * as fs19 from "node:fs";
17335
- import * as path31 from "node:path";
17489
+ import * as path30 from "node:path";
17336
17490
  function fileMatchesPathGlobs(file, cwd, globs) {
17337
- const rel = path31.relative(cwd, file).split(path31.sep).join("/");
17338
- const abs = path31.resolve(file).split(path31.sep).join("/");
17491
+ const rel = path30.relative(cwd, file).split(path30.sep).join("/");
17492
+ const abs = path30.resolve(file).split(path30.sep).join("/");
17339
17493
  const options = { dot: true, nocase: process.platform === "win32" };
17340
17494
  const matches = (candidate, pattern) => minimatch(candidate, pattern, options) || minimatch(candidate, `${pattern}/**`, options);
17341
17495
  return globs.some((raw) => {
17342
- const within = path31.isAbsolute(raw) ? relativeInside(cwd, raw) : void 0;
17496
+ const within = path30.isAbsolute(raw) ? relativeInside(cwd, raw) : void 0;
17343
17497
  if (within !== void 0)
17344
17498
  return matches(rel, toPosix(within) || "**");
17345
17499
  const pattern = toPosix(raw);
@@ -17350,32 +17504,32 @@ function hasGlobMagic(text) {
17350
17504
  return /[*?[{]/.test(text);
17351
17505
  }
17352
17506
  async function isGlobEntry(resolved, cwd) {
17353
- const spelled = relativeInside(path31.resolve(cwd), resolved) ?? resolved;
17507
+ const spelled = relativeInside(path30.resolve(cwd), resolved) ?? resolved;
17354
17508
  if (!hasGlobMagic(spelled))
17355
17509
  return false;
17356
17510
  return fs19.promises.lstat(resolved).then(() => false, (refusal) => {
17357
17511
  return refusal.code === "ENOENT" || refusal.code === "ENOTDIR";
17358
17512
  });
17359
17513
  }
17360
- function literalRoot(cwd, relative8) {
17514
+ function literalRoot(cwd, relative9) {
17361
17515
  let root = cwd;
17362
- for (const segment of relative8.split("/")) {
17516
+ for (const segment of relative9.split("/")) {
17363
17517
  if (hasGlobMagic(segment))
17364
17518
  break;
17365
- root = path31.join(root, segment);
17519
+ root = path30.join(root, segment);
17366
17520
  }
17367
17521
  return root;
17368
17522
  }
17369
17523
  async function expandPathsEntry(entry, cwd, budget, options = {}) {
17370
- const cwdAbsolute = path31.resolve(cwd);
17371
- const absolute = path31.resolve(cwdAbsolute, entry);
17524
+ const cwdAbsolute = path30.resolve(cwd);
17525
+ const absolute = path30.resolve(cwdAbsolute, entry);
17372
17526
  if (!await isGlobEntry(absolute, cwdAbsolute))
17373
17527
  return { entries: [absolute], root: cwdAbsolute };
17374
- const relative8 = relativeInside(cwdAbsolute, absolute);
17375
- if (relative8 === void 0) {
17528
+ const relative9 = relativeInside(cwdAbsolute, absolute);
17529
+ if (relative9 === void 0) {
17376
17530
  return { entries: [], refusal: "outside", root: cwdAbsolute };
17377
17531
  }
17378
- const root = literalRoot(cwdAbsolute, relative8);
17532
+ const root = literalRoot(cwdAbsolute, relative9);
17379
17533
  const { signal } = options;
17380
17534
  const matcher = getProjectIgnoreMatcher(cwdAbsolute);
17381
17535
  const policy = { ignoreMatcher: matcher };
@@ -17423,7 +17577,6 @@ async function expandPathsEntry(entry, cwd, budget, options = {}) {
17423
17577
  // dist/tools/shared.js
17424
17578
  var MAX_PATHS_ENTRIES = 100;
17425
17579
  var FILE_PATH_KEYS = ["path", "file", "filePath"];
17426
- var CONSTRAINED_JSON_SCHEMA_SAMPLING = { type: "json_schema", strict: "prefer" };
17427
17580
  function readFilePath(params) {
17428
17581
  const sent = [];
17429
17582
  const blanks = [];
@@ -17471,7 +17624,7 @@ async function readPathsArgument(raw, options) {
17471
17624
  const base = options.cwd || ".";
17472
17625
  const absent = options.absent ?? "none";
17473
17626
  if (raw === void 0 || raw === null) {
17474
- return { entries: absent === "cwd" ? [path32.resolve(base)] : [] };
17627
+ return { entries: absent === "cwd" ? [path31.resolve(base)] : [] };
17475
17628
  }
17476
17629
  if (!Array.isArray(raw))
17477
17630
  return { entries: [], refusal: "paths must be an array of strings" };
@@ -17737,7 +17890,7 @@ function createAstGrepReplaceTool(astGrepClient2, captureLineage, getFlag) {
17737
17890
  };
17738
17891
  }
17739
17892
  const searchPaths = pathsRead.entries;
17740
- const sessionRoot = path33.resolve(ctx.cwd ?? process.cwd());
17893
+ const sessionRoot = path32.resolve(ctx.cwd ?? process.cwd());
17741
17894
  if (applyFlag && getFlag?.("no-autofix", sessionRoot)) {
17742
17895
  const reason = "ast_grep_replace refused: apply is disabled by the no-autofix flag (autofix.enabled=false); a preview with apply: false is still allowed";
17743
17896
  logOutcome("error", { errorRaw: reason });
@@ -18575,7 +18728,7 @@ ${hint}` : `${output}${paginationNote}`;
18575
18728
  import { promises as fs23 } from "node:fs";
18576
18729
  import * as fsSync from "node:fs";
18577
18730
  import * as os7 from "node:os";
18578
- import * as path40 from "node:path";
18731
+ import * as path39 from "node:path";
18579
18732
 
18580
18733
  // dist/clients/project-diagnostics/extractors.js
18581
18734
  var WARM_TRIGGER = {
@@ -18635,12 +18788,12 @@ function reasonFromAvailabilityVerdict(tool, verdict) {
18635
18788
  // dist/clients/project-diagnostics/fresh-fetch.js
18636
18789
  import * as fs21 from "node:fs";
18637
18790
  import * as os5 from "node:os";
18638
- import * as path38 from "node:path";
18791
+ import * as path37 from "node:path";
18639
18792
 
18640
18793
  // dist/clients/project-diagnostics/runner-adapters/jscpd.js
18641
- import * as path34 from "node:path";
18794
+ import * as path33 from "node:path";
18642
18795
  function resolveClonePath(cwd, file) {
18643
- return path34.isAbsolute(file) ? file : path34.resolve(cwd, file);
18796
+ return path33.isAbsolute(file) ? file : path33.resolve(cwd, file);
18644
18797
  }
18645
18798
  function jscpdCloneToProjectDiagnostics(cwd, clone) {
18646
18799
  const a = resolveClonePath(cwd, clone.fileA);
@@ -18653,7 +18806,7 @@ function jscpdCloneToProjectDiagnostics(cwd, clone) {
18653
18806
  tool: "jscpd",
18654
18807
  runner: "jscpd",
18655
18808
  rule: "jscpd:duplicate",
18656
- message: `Duplicate code (${clone.lines} lines) \u2014 also at ${path34.relative(cwd, otherFile)}:${otherLine}`,
18809
+ message: `Duplicate code (${clone.lines} lines) \u2014 also at ${path33.relative(cwd, otherFile)}:${otherLine}`,
18657
18810
  source: "project-scan"
18658
18811
  });
18659
18812
  return [
@@ -18668,16 +18821,16 @@ function jscpdResultToProjectDiagnostics(cwd, result) {
18668
18821
  }
18669
18822
 
18670
18823
  // dist/clients/project-diagnostics/runner-adapters/madge.js
18671
- import * as path35 from "node:path";
18824
+ import * as path34 from "node:path";
18672
18825
  function resolveCyclePath(cwd, file) {
18673
- return path35.isAbsolute(file) ? file : path35.resolve(cwd, file);
18826
+ return path34.isAbsolute(file) ? file : path34.resolve(cwd, file);
18674
18827
  }
18675
18828
  function cycleMembers(dep) {
18676
18829
  return dep.path.length > 0 ? dep.path : [dep.file];
18677
18830
  }
18678
18831
  function circularDepToProjectDiagnostics(cwd, dep) {
18679
18832
  const members = cycleMembers(dep);
18680
- const rendered = `${members.map((f) => path35.basename(f)).join(" \u2192 ")} \u2192 ${path35.basename(members[0] ?? "")}`;
18833
+ const rendered = `${members.map((f) => path34.basename(f)).join(" \u2192 ")} \u2192 ${path34.basename(members[0] ?? "")}`;
18681
18834
  return members.map((file) => ({
18682
18835
  filePath: resolveCyclePath(cwd, file),
18683
18836
  severity: "warning",
@@ -18703,7 +18856,7 @@ function circularDepsToProjectDiagnostics(cwd, circular) {
18703
18856
  }
18704
18857
 
18705
18858
  // dist/clients/project-diagnostics/runner-adapters/opengrep.js
18706
- import * as path36 from "node:path";
18859
+ import * as path35 from "node:path";
18707
18860
  function severityFor(raw) {
18708
18861
  switch (raw.toUpperCase()) {
18709
18862
  case "ERROR":
@@ -18718,7 +18871,7 @@ function opengrepFindingToProjectDiagnostic(cwd, finding) {
18718
18871
  const { severity, blocking } = severityFor(finding.severity);
18719
18872
  const cweSuffix = finding.cwe?.length ? ` (${finding.cwe[0]})` : "";
18720
18873
  return {
18721
- filePath: path36.isAbsolute(finding.path) ? finding.path : path36.resolve(cwd, finding.path),
18874
+ filePath: path35.isAbsolute(finding.path) ? finding.path : path35.resolve(cwd, finding.path),
18722
18875
  line: finding.startLine,
18723
18876
  column: finding.startCol,
18724
18877
  severity,
@@ -18738,7 +18891,7 @@ function opengrepResultToProjectDiagnostics(cwd, result) {
18738
18891
 
18739
18892
  // dist/clients/project-diagnostics/runner-adapters/runner-findings.js
18740
18893
  import * as fs20 from "node:fs";
18741
- import * as path37 from "node:path";
18894
+ import * as path36 from "node:path";
18742
18895
  function failureMessage(failure) {
18743
18896
  const firstLine2 = failure.message.split("\n")[0]?.slice(0, 300) ?? "";
18744
18897
  return firstLine2 ? `${failure.name}: ${firstLine2}` : failure.name;
@@ -18804,7 +18957,7 @@ function testRunnerFindingsToProjectDiagnostics(cache, cwd, runtime) {
18804
18957
  return [];
18805
18958
  const validation = cwd ? validateAdvisoryProvenance(cache, cwd, runtime) : { status: "unknown", reasons: ["validation-context-missing"] };
18806
18959
  const root = cwd ?? process.cwd();
18807
- const missingKeys = new Set((cache.provenance?.files ?? []).filter((file) => !fs20.existsSync(path37.resolve(root, file.path))).map((file) => advisoryPathKey(file.path, root)));
18960
+ const missingKeys = new Set((cache.provenance?.files ?? []).filter((file) => !fs20.existsSync(path36.resolve(root, file.path))).map((file) => advisoryPathKey(file.path, root)));
18808
18961
  const historical = cache.superseded === true || cache.stale === true || validation.status !== "current";
18809
18962
  return cache.results.filter((result) => !missingKeys.has(advisoryPathKey(result.file, root))).flatMap((result) => testResultToProjectDiagnostics(result, historical)).map((diagnostic) => historical ? {
18810
18963
  ...diagnostic,
@@ -18834,7 +18987,7 @@ function laneObservedAtMs(scannedAt, startedAtMs) {
18834
18987
  return parseScannedAtMs(scannedAt) ?? startedAtMs;
18835
18988
  }
18836
18989
  async function fetchFreshProjectDiagnostics(cacheManager2, cwd, clients, signal, options = {}) {
18837
- const requestedRoot = options.analysisRoot === void 0 ? cwd : path38.resolve(cwd, options.analysisRoot);
18990
+ const requestedRoot = options.analysisRoot === void 0 ? cwd : path37.resolve(cwd, options.analysisRoot);
18838
18991
  let analysisRoot;
18839
18992
  let analysisRootValidation;
18840
18993
  if (options.analysisRoot !== void 0) {
@@ -18842,7 +18995,7 @@ async function fetchFreshProjectDiagnostics(cacheManager2, cwd, clients, signal,
18842
18995
  if (!fs21.statSync(requestedRoot).isDirectory()) {
18843
18996
  throw new Error("is not a directory");
18844
18997
  }
18845
- analysisRoot = fs21.realpathSync(requestedRoot);
18998
+ analysisRoot = realpathOrResolve(requestedRoot);
18846
18999
  } catch (error) {
18847
19000
  const detail = error instanceof Error ? error.message : String(error);
18848
19001
  const reason = `the explicit analysis root ${requestedRoot} is unavailable or ${detail}`;
@@ -19001,7 +19154,7 @@ async function fetchFreshProjectDiagnostics(cacheManager2, cwd, clients, signal,
19001
19154
  markCold("jscpd", reasonFromAvailabilityVerdict("jscpd", clients.jscpdClient.getAvailabilityVerdict?.()));
19002
19155
  return;
19003
19156
  }
19004
- const isTsProject = fs21.existsSync(path38.join(analysisRoot, "tsconfig.json"));
19157
+ const isTsProject = fs21.existsSync(path37.join(analysisRoot, "tsconfig.json"));
19005
19158
  const scannerKey = isTsProject ? "jscpd-ts" : "jscpd";
19006
19159
  const startMs = Date.now();
19007
19160
  const result = await clients.jscpdClient.scan(analysisRoot, void 0, void 0, isTsProject);
@@ -19309,7 +19462,7 @@ function makeProgressReporter(onUpdate, label, throttleMs = 250) {
19309
19462
 
19310
19463
  // dist/tools/lsp-diagnostics.js
19311
19464
  import * as fs22 from "node:fs";
19312
- import * as path39 from "node:path";
19465
+ import * as path38 from "node:path";
19313
19466
 
19314
19467
  // dist/clients/out-of-band-changes.js
19315
19468
  import { promises as fsp } from "node:fs";
@@ -20114,11 +20267,11 @@ async function collectFiles(dir, extensions, maxFiles, isIgnored = () => false)
20114
20267
  return;
20115
20268
  if (entry.isSymbolicLink())
20116
20269
  continue;
20117
- const full = path39.join(current, entry.name);
20270
+ const full = path38.join(current, entry.name);
20118
20271
  if (entry.isDirectory()) {
20119
20272
  if (!isExcludedDirName(entry.name) && !isIgnored(full, true))
20120
20273
  await walk(full);
20121
- } else if (entry.isFile() && extensions.includes(path39.extname(full))) {
20274
+ } else if (entry.isFile() && extensions.includes(path38.extname(full))) {
20122
20275
  if (isIgnored(full, false))
20123
20276
  continue;
20124
20277
  files.push(full);
@@ -20261,8 +20414,28 @@ function createLspDiagnosticsTool(nextWriteIndex, onConfirmedNoBlockers, getServ
20261
20414
  }
20262
20415
  };
20263
20416
  }
20417
+ function serverNotReadyOf(touched) {
20418
+ const reason = touched?.inconclusiveReason;
20419
+ if (reason !== "server-loading" && reason !== "server-load-failed") {
20420
+ return void 0;
20421
+ }
20422
+ return {
20423
+ reason,
20424
+ ...touched?.inconclusiveDetail !== void 0 && {
20425
+ detail: touched.inconclusiveDetail
20426
+ }
20427
+ };
20428
+ }
20429
+ function serverNotReadyText(notReady) {
20430
+ if (notReady.reason === "server-loading") {
20431
+ return "server still loading the workspace; retry shortly";
20432
+ }
20433
+ const detail = notReady.detail;
20434
+ return `workspace failed to load${detail ? ` (${detail})` : ""}; fix the project manifest`;
20435
+ }
20264
20436
  async function collectDiagnosticsForFile(absPath, lspService, scanRoot, waitMs, serverScope = "all", excludeServerIds, explicitQuery = false) {
20265
20437
  let timedOut = false;
20438
+ let serverNotReady;
20266
20439
  let content;
20267
20440
  let touched;
20268
20441
  try {
@@ -20344,6 +20517,7 @@ async function collectDiagnosticsForFile(absPath, lspService, scanRoot, waitMs,
20344
20517
  saved: true
20345
20518
  });
20346
20519
  timedOut = touched?.inconclusive === true && touched.inconclusiveReason !== "primary-unavailable";
20520
+ serverNotReady = serverNotReadyOf(touched);
20347
20521
  } catch {
20348
20522
  }
20349
20523
  const diagnostics = touched !== void 0 ? touched.diags : await lspService.getDiagnostics(absPath, waitMs !== void 0 ? "document" : "full", excludeServerIds);
@@ -20360,6 +20534,7 @@ async function collectDiagnosticsForFile(absPath, lspService, scanRoot, waitMs,
20360
20534
  return {
20361
20535
  diagnostics: filtered,
20362
20536
  timedOut,
20537
+ ...serverNotReady !== void 0 && { serverNotReady },
20363
20538
  skipReason: touched?.skipReason,
20364
20539
  confirmedByTouch,
20365
20540
  ...noClientAnswered && { noClientAnswered: true },
@@ -20589,7 +20764,7 @@ async function collectFileDiagnosticResult(file, severity, lspService, waitMs, n
20589
20764
  };
20590
20765
  }
20591
20766
  }
20592
- const { diagnostics: rawDiags, timedOut, confirmedByTouch, unconfirmedServerIds, diagnosticsUnsupportedServerIds, content: collectedContent, binding, tooLargeReason, skipReason, primaryUnavailable, primaryUnavailableCause: primaryUnavailableCause2, noClientAnswered, projectIdentity } = await collectDiagnosticsForFile(file, lspService, cwd, waitMs, serverScope, excludeServerIds);
20767
+ const { diagnostics: rawDiags, timedOut, serverNotReady, confirmedByTouch, unconfirmedServerIds, diagnosticsUnsupportedServerIds, content: collectedContent, binding, tooLargeReason, skipReason, primaryUnavailable, primaryUnavailableCause: primaryUnavailableCause2, noClientAnswered, projectIdentity } = await collectDiagnosticsForFile(file, lspService, cwd, waitMs, serverScope, excludeServerIds);
20593
20768
  if (tooLargeReason !== void 0) {
20594
20769
  return { file, diagnostics: [], outcome: "too_large", tooLargeReason };
20595
20770
  }
@@ -20673,6 +20848,11 @@ async function collectFileDiagnosticResult(file, severity, lspService, waitMs, n
20673
20848
  unavailable: lspUnavailableMessage(file, health),
20674
20849
  confirmation,
20675
20850
  timedOut: confirmation === "unconfirmed" ? timedOut : void 0,
20851
+ // #5487: the per-file `reason` (`batchOutcomeReason`) names it too.
20852
+ ...confirmation === "unconfirmed" && timedOut && serverNotReady !== void 0 && {
20853
+ serverNotReady,
20854
+ inconclusiveReason: serverNotReadyText(serverNotReady)
20855
+ },
20676
20856
  ...rootFallback && { rootFallback },
20677
20857
  ...skipReason !== void 0 && { skipReason },
20678
20858
  ...primaryUnavailable !== void 0 && {
@@ -20694,7 +20874,7 @@ async function runFileDiagnostics(absPath, severity, lspService, waitMs, nextWri
20694
20874
  const pythonCompileTarget = await detectPythonTargetVersion(absPath);
20695
20875
  lspService.announceCreatedFiles(goPackageFilesToAnnounce([absPath]), await importTargetsToAnnounce(cwd, [absPath]));
20696
20876
  const observedAt = Date.now();
20697
- const { diagnostics: rawDiags, timedOut, confirmedByTouch, unconfirmedServerIds, diagnosticsUnsupportedServerIds, content: collectedContent, binding, tooLargeReason, skipReason, primaryUnavailable, projectIdentity } = await collectDiagnosticsForFile(absPath, lspService, cwd, waitMs, serverScope, excludeServerIds, true);
20877
+ const { diagnostics: rawDiags, timedOut, serverNotReady, confirmedByTouch, unconfirmedServerIds, diagnosticsUnsupportedServerIds, content: collectedContent, binding, tooLargeReason, skipReason, primaryUnavailable, projectIdentity } = await collectDiagnosticsForFile(absPath, lspService, cwd, waitMs, serverScope, excludeServerIds, true);
20698
20878
  if (tooLargeReason !== void 0) {
20699
20879
  return {
20700
20880
  content: [{ type: "text", text: tooLargeReason }],
@@ -20774,6 +20954,9 @@ async function runFileDiagnostics(absPath, severity, lspService, waitMs, nextWri
20774
20954
  if (diagnosticsUnsupportedServerIds.length > 0) {
20775
20955
  return `Primary LSP${primaryId ? ` (${primaryId})` : ""}: unconfirmed \u2014 a custom server with no pull provider has not published diagnostics yet. NOT the same as 0 diagnostics; it is checked again once the server publishes.`;
20776
20956
  }
20957
+ if (timedOut && serverNotReady !== void 0) {
20958
+ return `Primary LSP${primaryId ? ` (${primaryId})` : ""}: unconfirmed \u2014 ${serverNotReadyText(serverNotReady)}. NOT the same as 0 diagnostics.`;
20959
+ }
20777
20960
  if (timedOut) {
20778
20961
  return `Primary LSP: check timed out \u2014 NOT the same as 0 diagnostics; the file may still have errors that just hadn't been reported yet. Re-check after the server settles, or pass a larger waitMs (this single-file query honours it up to ${RUNTIME_CONFIG.pipeline.lspExplicitQueryMaxWaitMs} ms).`;
20779
20962
  }
@@ -20876,6 +21059,7 @@ function tallyConfirmation(results) {
20876
21059
  let clean = 0;
20877
21060
  let unconfirmed = 0;
20878
21061
  let timedOut = 0;
21062
+ const serverNotReady = [];
20879
21063
  let primaryUnavailable = 0;
20880
21064
  const primaryUnavailableCauses = [];
20881
21065
  const primaryUnavailableRootReasons = /* @__PURE__ */ new Set();
@@ -20890,7 +21074,9 @@ function tallyConfirmation(results) {
20890
21074
  continue;
20891
21075
  if (result.confirmation === "unconfirmed") {
20892
21076
  unconfirmed += 1;
20893
- if (result.timedOut)
21077
+ if (result.serverNotReady)
21078
+ serverNotReady.push(result.serverNotReady);
21079
+ else if (result.timedOut)
20894
21080
  timedOut += 1;
20895
21081
  if (result.primaryUnavailable !== void 0) {
20896
21082
  primaryUnavailable += 1;
@@ -20912,6 +21098,7 @@ function tallyConfirmation(results) {
20912
21098
  clean,
20913
21099
  unconfirmed,
20914
21100
  timedOut,
21101
+ serverNotReady,
20915
21102
  primaryUnavailable: {
20916
21103
  count: primaryUnavailable,
20917
21104
  cause: combinePrimaryUnavailableCauses(primaryUnavailableCauses),
@@ -20967,11 +21154,21 @@ function unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons = []
20967
21154
  count: 0,
20968
21155
  cause: void 0,
20969
21156
  rootFallbackReasons: []
20970
- }) {
21157
+ }, serverNotReady = []) {
20971
21158
  if (primaryUnavailable.count > 0) {
20972
21159
  const head = `${primaryUnavailable.count} with no primary language server answer (${PRIMARY_UNAVAILABLE_CAUSE[primaryUnavailable.cause ?? "unstarted"]})` + (primaryUnavailable.rootFallbackReasons.length > 0 ? `: ${primaryUnavailable.rootFallbackReasons.join("; ")}` : "");
20973
21160
  const rest = unconfirmed - primaryUnavailable.count;
20974
- return rest > 0 ? `${head}; the other ${rest}: ${unconfirmedReasonClause(rest, timedOut, rootFallbackReasons)}` : `${head}.`;
21161
+ return rest > 0 ? `${head}; the other ${rest}: ${unconfirmedReasonClause(rest, timedOut, rootFallbackReasons, void 0, serverNotReady)}` : `${head}.`;
21162
+ }
21163
+ if (serverNotReady.length > 0) {
21164
+ const counts = /* @__PURE__ */ new Map();
21165
+ for (const notReady of serverNotReady) {
21166
+ const text = serverNotReadyText(notReady);
21167
+ counts.set(text, (counts.get(text) ?? 0) + 1);
21168
+ }
21169
+ const head = [...counts].map(([text, count]) => `${count} not checked: ${text}.`).join(" ");
21170
+ const rest = unconfirmed - serverNotReady.length;
21171
+ return rest > 0 ? `${head} The other ${rest}: ${unconfirmedReasonClause(rest, timedOut, rootFallbackReasons)}` : head;
20975
21172
  }
20976
21173
  if (rootFallbackReasons.length > 0) {
20977
21174
  return `${rootFallbackReasons.join("; ")} (${unconfirmed} unconfirmed in all).`;
@@ -21046,7 +21243,7 @@ async function collectBatchDiagnostics(files, severity, lspService, options) {
21046
21243
  const total = allDiags.length;
21047
21244
  const truncated = total > MAX_DIAGNOSTICS;
21048
21245
  const display = truncated ? allDiags.slice(0, MAX_DIAGNOSTICS) : allDiags;
21049
- const { clean, unconfirmed, timedOut, primaryUnavailable, rootFallbackReasons } = tallyConfirmation(results);
21246
+ const { clean, unconfirmed, timedOut, serverNotReady, primaryUnavailable, rootFallbackReasons } = tallyConfirmation(results);
21050
21247
  for (const result of results) {
21051
21248
  result.outcome = classifyBatchFileOutcome(result);
21052
21249
  }
@@ -21077,6 +21274,7 @@ async function collectBatchDiagnostics(files, severity, lspService, options) {
21077
21274
  clean,
21078
21275
  unconfirmed,
21079
21276
  timedOut,
21277
+ serverNotReady,
21080
21278
  rootFallbackReasons,
21081
21279
  primaryUnavailable,
21082
21280
  outcomeCounts,
@@ -21133,7 +21331,7 @@ async function runBatchFileDiagnostics(absPaths, severity, lspService, options,
21133
21331
  details: { mode: "batch", severity, filesChecked: 0 }
21134
21332
  };
21135
21333
  }
21136
- const { results, fileErrors, lspHealthWarnings, total, truncated, display, primaryDisplay, auxiliaryDisplay, clean, unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable, outcomeCounts, incompleteFiles } = await collectBatchDiagnostics(absPaths, severity, lspService, options);
21334
+ const { results, fileErrors, lspHealthWarnings, total, truncated, display, primaryDisplay, auxiliaryDisplay, clean, unconfirmed, timedOut, serverNotReady, rootFallbackReasons, primaryUnavailable, outcomeCounts, incompleteFiles } = await collectBatchDiagnostics(absPaths, severity, lspService, options);
21137
21335
  const dispositionSuppressed = results.reduce((sum, result) => sum + (result.dispositionSuppressed ?? 0), 0);
21138
21336
  const lines = [
21139
21337
  `Files checked: ${results.length}${capped ? ` (capped at ${MAX_FILES})` : ""}`,
@@ -21168,7 +21366,7 @@ async function runBatchFileDiagnostics(absPaths, severity, lspService, options,
21168
21366
  lines.push("", "LSP health warnings:", ...lspHealthWarnings.slice(0, 10));
21169
21367
  }
21170
21368
  if (unconfirmed > 0) {
21171
- lines.push("", `${clean} file${clean === 1 ? "" : "s"} confirmed clean, ${unconfirmed} unconfirmed: ${unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable)} NOT the same as 0 diagnostics.`);
21369
+ lines.push("", `${clean} file${clean === 1 ? "" : "s"} confirmed clean, ${unconfirmed} unconfirmed: ${unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable, serverNotReady)} NOT the same as 0 diagnostics.`);
21172
21370
  }
21173
21371
  const auxiliaryOnlyLine = auxiliaryOnlyFindingsLine(results);
21174
21372
  if (auxiliaryOnlyLine)
@@ -21290,7 +21488,7 @@ async function runDirectoryDiagnostics(absPath, severity, lspService, options) {
21290
21488
  }
21291
21489
  };
21292
21490
  }
21293
- const { results, fileErrors, lspHealthWarnings, total, truncated, display, primaryDisplay, auxiliaryDisplay, clean, unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable, outcomeCounts } = await collectBatchDiagnostics(filesToProcess, severity, lspService, options);
21491
+ const { results, fileErrors, lspHealthWarnings, total, truncated, display, primaryDisplay, auxiliaryDisplay, clean, unconfirmed, timedOut, serverNotReady, rootFallbackReasons, primaryUnavailable, outcomeCounts } = await collectBatchDiagnostics(filesToProcess, severity, lspService, options);
21294
21492
  const dispositionSuppressed = results.reduce((sum, result) => sum + (result.dispositionSuppressed ?? 0), 0);
21295
21493
  const suppressedLine = dispositionSuppressedLine(dispositionSuppressed);
21296
21494
  const outcomeDetails = results.map((result) => ({
@@ -21299,12 +21497,12 @@ async function runDirectoryDiagnostics(absPath, severity, lspService, options) {
21299
21497
  reason: batchOutcomeReason(result)
21300
21498
  }));
21301
21499
  const auxiliaryOnlyLine = auxiliaryOnlyFindingsLine(results);
21302
- const tooLargeLines = renderBatchOutcomeLines(outcomeDetails, (file) => path39.relative(absPath, file));
21500
+ const tooLargeLines = renderBatchOutcomeLines(outcomeDetails, (file) => path38.relative(absPath, file));
21303
21501
  const withheldDirectory = mergeWithheld(results.map((r) => r.withheldCompile));
21304
21502
  const withheldDisclosure = withheldCompileNote(withheldDirectory);
21305
21503
  let text;
21306
21504
  if (total === 0) {
21307
- const cleanLine = unconfirmed > 0 ? `${clean} clean \xB7 ${unconfirmed} unconfirmed: ${unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable)} NOT the same as 0 diagnostics.` : withheldDisclosure ? `No diagnostics found. ${withheldDisclosure}` : "No diagnostics found.";
21505
+ const cleanLine = unconfirmed > 0 ? `${clean} clean \xB7 ${unconfirmed} unconfirmed: ${unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable, serverNotReady)} NOT the same as 0 diagnostics.` : withheldDisclosure ? `No diagnostics found. ${withheldDisclosure}` : "No diagnostics found.";
21308
21506
  const cleanLineShown = unconfirmed > 0 || lspHealthWarnings.length === 0 && outcomeCounts.clean === filesToProcess.length;
21309
21507
  text = [
21310
21508
  `Directory: ${absPath}`,
@@ -21334,14 +21532,14 @@ async function runDirectoryDiagnostics(absPath, severity, lspService, options) {
21334
21532
  // whole found diagnostics elsewhere.
21335
21533
  ...unconfirmed > 0 ? [
21336
21534
  "",
21337
- `${clean} other file${clean === 1 ? "" : "s"} confirmed clean, ${unconfirmed} unconfirmed: ` + unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable)
21535
+ `${clean} other file${clean === 1 ? "" : "s"} confirmed clean, ${unconfirmed} unconfirmed: ` + unconfirmedReasonClause(unconfirmed, timedOut, rootFallbackReasons, primaryUnavailable, serverNotReady)
21338
21536
  ] : [],
21339
21537
  ...auxiliaryOnlyLine ? ["", auxiliaryOnlyLine] : [],
21340
21538
  ""
21341
21539
  ];
21342
21540
  const toRelative = (d) => ({
21343
21541
  ...d,
21344
- file: path39.relative(absPath, d.file)
21542
+ file: path38.relative(absPath, d.file)
21345
21543
  });
21346
21544
  if (primaryDisplay.length > 0) {
21347
21545
  lines.push(`Primary findings (${primaryDisplay.length}):`);
@@ -21374,7 +21572,7 @@ async function runDirectoryDiagnostics(absPath, severity, lspService, options) {
21374
21572
  filesScanned: filesToProcess.length,
21375
21573
  capped: wasCapped,
21376
21574
  diagnostics: display.map((d) => ({
21377
- file: path39.relative(absPath, d.file),
21575
+ file: path38.relative(absPath, d.file),
21378
21576
  line: d.line,
21379
21577
  character: d.character,
21380
21578
  severity: d.severity,
@@ -21459,7 +21657,7 @@ async function findFullScanBindingMismatches(results) {
21459
21657
  sinceYield += 1;
21460
21658
  if (sinceYield >= FULL_SCAN_BINDING_YIELD_EVERY) {
21461
21659
  sinceYield = 0;
21462
- await new Promise((resolve34) => setImmediate(resolve34));
21660
+ await new Promise((resolve33) => setImmediate(resolve33));
21463
21661
  }
21464
21662
  }
21465
21663
  return mismatched;
@@ -21509,7 +21707,7 @@ function createLensDiagnosticsTool(cacheManager2, getCwd, getLspService = getLSP
21509
21707
  const files2 = details.filesChecked ?? details.filesScanned ?? 0;
21510
21708
  const noun = count === 1 ? "diagnostic" : "diagnostics";
21511
21709
  const filePath = typeof details?.filePath === "string" ? details.filePath : Array.isArray(args?.paths) && args.paths.length === 1 && typeof args.paths[0] === "string" ? args.paths[0] : void 0;
21512
- const singleFile = (details?.mode === "file" || files2 === 1) && typeof filePath === "string" ? ` ${path40.basename(filePath)}` : "";
21710
+ const singleFile = (details?.mode === "file" || files2 === 1) && typeof filePath === "string" ? ` ${path39.basename(filePath)}` : "";
21513
21711
  const scope = files2 > 1 ? ` across ${files2} files` : singleFile;
21514
21712
  if (isError)
21515
21713
  return `lens_diagnostics lsp \u2014 ${text.split("\n")[0] ?? "error"}`;
@@ -21546,7 +21744,7 @@ function createLensDiagnosticsTool(cacheManager2, getCwd, getLspService = getLSP
21546
21744
  const pd = details?.projectDiagnostics ?? 0;
21547
21745
  if (aw + cq + pd === 0) {
21548
21746
  const uncheckedDelta = details?.uncheckedFileCount ?? 0;
21549
- return `lens_diagnostics delta \u2014 clean${uncheckedDelta > 0 ? ` \xB7 ${uncheckedDelta} unchecked` : ""}${coldSuffix}${failedSuffix}`;
21747
+ return `lens_diagnostics delta \u2014 no new findings${uncheckedDelta > 0 ? ` \xB7 ${uncheckedDelta} unchecked` : ""}${coldSuffix}${failedSuffix}`;
21550
21748
  }
21551
21749
  return `lens_diagnostics delta \u2014 ${aw} actionable \xB7 ${cq} quality \xB7 ${pd} project${coldSuffix}${failedSuffix}`;
21552
21750
  }
@@ -21562,7 +21760,8 @@ function createLensDiagnosticsTool(cacheManager2, getCwd, getLspService = getLSP
21562
21760
  const advisorySuffix = adv > 0 ? `, ${adv} hint${adv === 1 ? "" : "s"}` : "";
21563
21761
  if (cacheVerdict === void 0 && unchecked > 0 && unchecked >= (details?.filesChecked ?? files))
21564
21762
  return `lens_diagnostics ${mode} \u2014 unchecked${advisorySuffix} (${files} files)${coldSuffix}${failedSuffix}`;
21565
- return `lens_diagnostics ${mode} \u2014 ${cacheVerdict ?? "clean"}${advisorySuffix}${uncheckedSuffix} (${files} files)${coldSuffix}${failedSuffix}`;
21763
+ const proven = details?.clean === true;
21764
+ return `lens_diagnostics ${mode} \u2014 ${cacheVerdict ?? (proven ? "clean" : "unconfirmed")}${advisorySuffix}${uncheckedSuffix} (${proven ? details?.provenFiles ?? files : files} files)${coldSuffix}${failedSuffix}`;
21566
21765
  }
21567
21766
  const parts = [`${b} blocking`];
21568
21767
  if (b === 0 && e > 0)
@@ -21806,7 +22005,7 @@ function appendProjectDiagnosticsDeltaLines(groups, cwd, report, severity, inclu
21806
22005
  const diagnostics = [...gated.live, ...gated.stale];
21807
22006
  const byFile = /* @__PURE__ */ new Map();
21808
22007
  for (const diagnostic of diagnostics) {
21809
- const filePath = path40.resolve(diagnostic.filePath);
22008
+ const filePath = path39.resolve(diagnostic.filePath);
21810
22009
  const bucket = byFile.get(filePath) ?? [];
21811
22010
  bucket.push(diagnostic);
21812
22011
  byFile.set(filePath, bucket);
@@ -22059,7 +22258,7 @@ function formatDeltaMode(cacheManager2, cwd, severity, pathsScope) {
22059
22258
  const aw = selectedActionableFiles.reduce((count, file) => count + file.warnings.length, 0);
22060
22259
  const cq = selectedQualityFiles.reduce((count, file) => count + file.warnings.length, 0);
22061
22260
  if (lines.length === 0) {
22062
- let text = `No ${severity === "all" ? "" : severity + " "}issues in the current turn delta.`;
22261
+ let text = `No new ${severity === "all" ? "" : severity + " "}findings in the current turn delta.`;
22063
22262
  const carried = getFileDiagnosticSummaries().filter((f) => includeFile(f.filePath)).map((f) => ({
22064
22263
  ...f,
22065
22264
  diagnostics: applyRulePolicy(applyCachedDispositions(f.diagnostics, cwd, f.filePath), policyMap, { root: cwd, filePath: f.filePath })
@@ -22101,7 +22300,7 @@ Summary (turn delta): ${aw} actionable warning${aw === 1 ? "" : "s"} \xB7 ${cq}
22101
22300
  function createCurrentIgnoreFilter(cwd) {
22102
22301
  try {
22103
22302
  const matcher = getProjectIgnoreMatcher(cwd);
22104
- return (filePath) => !matcher.isIgnored(path40.resolve(filePath), false);
22303
+ return (filePath) => !matcher.isIgnored(path39.resolve(filePath), false);
22105
22304
  } catch {
22106
22305
  return () => true;
22107
22306
  }
@@ -22131,9 +22330,9 @@ function resolvePathsScope(entries) {
22131
22330
  }
22132
22331
  const fileKeys = new Set(fileEntries.map((f) => normalizeFilePath(f)));
22133
22332
  const dirPrefixes = dirEntries.map((d) => normalizeFilePath(d));
22134
- const includeExplicitFile = (filePath) => fileKeys.has(normalizeFilePath(path40.resolve(filePath)));
22333
+ const includeExplicitFile = (filePath) => fileKeys.has(normalizeFilePath(path39.resolve(filePath)));
22135
22334
  const includeFile = (filePath) => {
22136
- const key = normalizeFilePath(path40.resolve(filePath));
22335
+ const key = normalizeFilePath(path39.resolve(filePath));
22137
22336
  if (fileKeys.has(key))
22138
22337
  return true;
22139
22338
  return dirPrefixes.some((prefix) => isWithinForm(key, prefix));
@@ -22154,7 +22353,7 @@ function pathsScopeCacheOnlyNote(scope) {
22154
22353
  function pathsScopeMissingNote(scope) {
22155
22354
  if (!scope || scope.missing.length === 0)
22156
22355
  return "";
22157
- const shown2 = scope.missing.slice(0, 10).map((p) => path40.basename(p));
22356
+ const shown2 = scope.missing.slice(0, 10).map((p) => path39.basename(p));
22158
22357
  const more = scope.missing.length > shown2.length ? ` (+${scope.missing.length - shown2.length} more)` : "";
22159
22358
  return `
22160
22359
 
@@ -22250,7 +22449,7 @@ function lspDiagnosticToWidget(diagnostic) {
22250
22449
  const rule = lspRuleId(diagnostic);
22251
22450
  return {
22252
22451
  severity,
22253
- semantic: diagnostic.severity === 1 ? "blocking" : "warning",
22452
+ semantic: semanticFor(severity),
22254
22453
  message: diagnostic.message,
22255
22454
  line: diagnostic.range.start.line + 1,
22256
22455
  col: diagnostic.range.start.character + 1,
@@ -22285,7 +22484,7 @@ function projectDiagnosticToWidget(diagnostic, filePath) {
22285
22484
  }
22286
22485
  function diagnosticDedupKey(fileKey, diagnostic) {
22287
22486
  const ruleId = normalizeRuleId(diagnostic.rule ?? diagnostic.tool ?? "");
22288
- return [fileKey, diagnostic.line ?? "?", ruleId].join(":");
22487
+ return [fileKey, diagnostic.line ?? "?", diagnostic.col ?? "?", ruleId].join(":");
22289
22488
  }
22290
22489
  function runnerIdOf(diagnostic) {
22291
22490
  return diagnostic.tool ?? diagnostic.rule?.split(":", 1)[0] ?? "";
@@ -22445,7 +22644,7 @@ function mergeDiagnosticsWithWidgetSummaries(widgetSummaries, lspResults, projec
22445
22644
  byFile.set(fileKey, summarizeDiagnostics(existing?.filePath ?? filePath, diagnostics, existing?.hasFinalSnapshot ?? true, existing));
22446
22645
  };
22447
22646
  for (const summary of widgetSummaries) {
22448
- const filePath = path40.resolve(summary.filePath);
22647
+ const filePath = path39.resolve(summary.filePath);
22449
22648
  const fileKey = normalizeMapKey(summary.filePath);
22450
22649
  if (authoritativeLspFiles?.has(fileKey))
22451
22650
  continue;
@@ -22474,7 +22673,7 @@ function mergeDiagnosticsWithWidgetSummaries(widgetSummaries, lspResults, projec
22474
22673
  }
22475
22674
  }
22476
22675
  for (const result of lspResults) {
22477
- const filePath = path40.resolve(result.filePath);
22676
+ const filePath = path39.resolve(result.filePath);
22478
22677
  for (const diagnostic of result.diagnostics ?? []) {
22479
22678
  addDiagnostic(filePath, {
22480
22679
  ...lspDiagnosticToWidget(diagnostic),
@@ -22494,12 +22693,12 @@ function mergeDiagnosticsWithWidgetSummaries(widgetSummaries, lspResults, projec
22494
22693
  });
22495
22694
  }
22496
22695
  for (const diagnostic of projectSnapshot?.diagnostics ?? []) {
22497
- addDiagnostic(path40.resolve(diagnostic.filePath), projectDiagnosticToWidget(diagnostic, diagnostic.filePath));
22696
+ addDiagnostic(path39.resolve(diagnostic.filePath), projectDiagnosticToWidget(diagnostic, diagnostic.filePath));
22498
22697
  }
22499
22698
  for (const diagnostic of deltaDiagnostics) {
22500
22699
  const widget = projectDiagnosticToWidget(diagnostic, diagnostic.filePath);
22501
22700
  const observedAt = widget.observedAt ?? deltaObservedAt;
22502
- addDiagnostic(path40.resolve(diagnostic.filePath), {
22701
+ addDiagnostic(path39.resolve(diagnostic.filePath), {
22503
22702
  ...widget,
22504
22703
  ...observedAt !== void 0 && { observedAt }
22505
22704
  });
@@ -22741,7 +22940,7 @@ async function formatFullMode(cwd, severity, lspService, cacheManager2, options
22741
22940
  unreconciledFiles.add(fileKey);
22742
22941
  recordDegradationOnce({
22743
22942
  kind: "diagnostic-retained-unreconciled",
22744
- subject: `${path40.resolve(result2.filePath)}:lsp`,
22943
+ subject: `${path39.resolve(result2.filePath)}:lsp`,
22745
22944
  reason: "confirmed diagnostic result could not replace retained widget state"
22746
22945
  });
22747
22946
  }
@@ -22749,7 +22948,7 @@ async function formatFullMode(cwd, severity, lspService, cacheManager2, options
22749
22948
  unreconciledFiles.add(fileKey);
22750
22949
  recordDegradationOnce({
22751
22950
  kind: "diagnostic-retained-unreconciled",
22752
- subject: `${path40.resolve(result2.filePath)}:lsp`,
22951
+ subject: `${path39.resolve(result2.filePath)}:lsp`,
22753
22952
  reason: "confirmed diagnostic result failed during widget reconciliation"
22754
22953
  });
22755
22954
  }
@@ -22823,33 +23022,56 @@ async function formatFullMode(cwd, severity, lspService, cacheManager2, options
22823
23022
  for (const summary of summaries) {
22824
23023
  reconcileCorrelatedScanDiagnostics(summary.filePath, summary.diagnostics, nextWriteIndex?.(), projectScanObservedAt);
22825
23024
  }
22826
- const formatted = await formatAllMode(cwd, severity, summaries, {
22827
- mode: "full",
22828
- lspFilesChecked: rawLspResults.length,
22829
- partial: aborted,
22830
- projectDiagnostics: projectSnapshot === void 0 ? void 0 : {
22831
- tier: projectSnapshot.tier,
22832
- filesScanned: projectSnapshot.filesScanned,
22833
- diagnostics: projectSnapshot.diagnostics.length,
22834
- runners: projectSnapshot.runners
23025
+ const formatted = await formatAllMode(
23026
+ cwd,
23027
+ severity,
23028
+ summaries,
23029
+ {
23030
+ mode: "full",
23031
+ lspFilesChecked: rawLspResults.length,
23032
+ partial: aborted,
23033
+ projectDiagnostics: projectSnapshot === void 0 ? void 0 : {
23034
+ tier: projectSnapshot.tier,
23035
+ filesScanned: projectSnapshot.filesScanned,
23036
+ diagnostics: projectSnapshot.diagnostics.length,
23037
+ runners: projectSnapshot.runners
23038
+ },
23039
+ projectDiagnosticsDelta: projectDelta === void 0 ? void 0 : {
23040
+ diagnostics: projectDelta.diagnostics.length,
23041
+ sources: projectDelta.sources,
23042
+ turnIndex: projectDelta.turnIndex
23043
+ }
22835
23044
  },
22836
- projectDiagnosticsDelta: projectDelta === void 0 ? void 0 : {
22837
- diagnostics: projectDelta.diagnostics.length,
22838
- sources: projectDelta.sources,
22839
- turnIndex: projectDelta.turnIndex
22840
- }
22841
- }, 0, pathsScope, {
22842
- dropped: dispositionDropped,
22843
- // #1617: the #1616 suppressed-bucket rule applied to the analyzers —
22844
- // a finding marked false-positive/won't-fix drops out of
22845
- // `diagnostics` (fresh-fetch.ts's `record()`), and the drop stays
22846
- // visible as a count. Review-round F4 (#1625): per-lane attribution
22847
- // ("gitleaks 2, knip 1") says WHICH analyzer's marks are doing the
22848
- // suppressing. A lane that's 100% suppressed still won't appear in
22849
- // `runners`/`cold` as distinct from "ran clean" — #1623's territory.
22850
- analyzers: extracted.dispositionSuppressed ?? 0,
22851
- analyzersByLane: extracted.dispositionSuppressedByLane ?? {}
22852
- });
23045
+ 0,
23046
+ pathsScope,
23047
+ {
23048
+ dropped: dispositionDropped,
23049
+ // #1617: the #1616 suppressed-bucket rule applied to the analyzers —
23050
+ // a finding marked false-positive/won't-fix drops out of
23051
+ // `diagnostics` (fresh-fetch.ts's `record()`), and the drop stays
23052
+ // visible as a count. Review-round F4 (#1625): per-lane attribution
23053
+ // ("gitleaks 2, knip 1") says WHICH analyzer's marks are doing the
23054
+ // suppressing. A lane that's 100% suppressed still won't appear in
23055
+ // `runners`/`cold` as distinct from "ran clean" — #1623's territory.
23056
+ analyzers: extracted.dispositionSuppressed ?? 0,
23057
+ analyzersByLane: extracted.dispositionSuppressedByLane ?? {}
23058
+ },
23059
+ void 0,
23060
+ // #5258: the sweep's part of the report's clean claim. A swept file is
23061
+ // proven only by a fully covered row; any other row, and the whole sweep
23062
+ // when the abort or the time budget cut it short, proves nothing.
23063
+ {
23064
+ proven: fullyCoveredLspResults.map((result2) => result2.filePath),
23065
+ swept: lspResults.map((result2) => result2.filePath),
23066
+ stopped: aborted,
23067
+ incompleteLanes: [
23068
+ ...(extracted.failed ?? []).map((item) => item.id),
23069
+ ...extracted.partial ?? [],
23070
+ ...extracted.abortedIds ?? [],
23071
+ ...extracted.aborted ? ["aborted"] : []
23072
+ ]
23073
+ }
23074
+ );
22853
23075
  const withheldText = withheldCompileNote(withheldCompile);
22854
23076
  const result = withheldText ? {
22855
23077
  ...formatted,
@@ -23062,7 +23284,7 @@ function uncheckedFilesLine(summaries, cwd) {
23062
23284
  const more = unchecked.length - named.length;
23063
23285
  return `\u26A0 ${unchecked.length} file${unchecked.length === 1 ? "" : "s"} not checked, so no findings is not a clean result: ${named.join("; ")}${more > 0 ? `; +${more} more` : ""}.`;
23064
23286
  }
23065
- async function formatAllMode(cwd, severity, summaries = getFileDiagnosticSummaries(), detailOverrides = { mode: "all" }, staleDropped = 0, pathsScope, fullModeDisposition = { dropped: [], analyzers: 0, analyzersByLane: {} }, sessionEvidence) {
23287
+ async function formatAllMode(cwd, severity, summaries = getFileDiagnosticSummaries(), detailOverrides = { mode: "all" }, staleDropped = 0, pathsScope, fullModeDisposition = { dropped: [], analyzers: 0, analyzersByLane: {} }, sessionEvidence, fullModeSweep) {
23066
23288
  const isFullMode = detailOverrides.mode === "full";
23067
23289
  const includeFile = createScopedFileFilter(cwd, pathsScope);
23068
23290
  const policyMap = loadProjectRulePolicy(cwd);
@@ -23194,8 +23416,27 @@ Next check: ${nextTool ?? "diagnostics"} source=lsp scope=paths${nextPaths.lengt
23194
23416
  const suppressedNote = suppressedLine ? `
23195
23417
  ${suppressedLine}` : "";
23196
23418
  const suppressedDetails = dispositionSuppressed > 0 ? { dispositionSuppressed } : {};
23419
+ const sweptKeys = new Set((fullModeSweep?.swept ?? []).map(normalizeMapKey));
23420
+ const sweepProvenKeys = new Set((fullModeSweep?.proven ?? []).map(normalizeMapKey));
23421
+ const claimKeys = /* @__PURE__ */ new Set([
23422
+ ...visibleSummaries.filter((s) => s.uncheckedReason === void 0).map((s) => normalizeMapKey(s.filePath)),
23423
+ ...sweptKeys
23424
+ ]);
23425
+ const summaryByKey = new Map(visibleSummaries.map((s) => [normalizeMapKey(s.filePath), s]));
23426
+ const fullModeProven = (key) => {
23427
+ const summary2 = summaryByKey.get(key);
23428
+ if ((summary2?.diagnostics ?? []).some((d) => d.stale))
23429
+ return false;
23430
+ if (sweptKeys.has(key))
23431
+ return sweepProvenKeys.has(key);
23432
+ return summary2?.hasFinalSnapshot === true;
23433
+ };
23434
+ const provenCount = isFullMode ? fullModeSweep?.stopped || (fullModeSweep?.incompleteLanes ?? []).length > 0 ? 0 : [...claimKeys].filter(fullModeProven).length : validationStatus === "findings" || validationStatus === "no-matching-findings" ? claimKeys.size : 0;
23435
+ const cleanEvidence = { scope: claimKeys.size, proven: provenCount };
23436
+ const proofDetails = isFullMode ? { provenFiles: provenCount } : {};
23197
23437
  if (withIssues.length === 0) {
23198
- const text = (visibleSummaries.length === 0 ? "No files diagnosed yet this session.\n" : validationStatus === "inconclusive" || validationStatus === "unverified" || checkedCount === 0 ? "" : `No ${severity === "all" ? "" : severity + " "}issues across ${checkedCount} file${checkedCount === 1 ? "" : "s"} diagnosed this session. \u2713
23438
+ const clean = cleanVerdict({ ...cleanEvidence, findings: 0 });
23439
+ const text = (visibleSummaries.length === 0 ? "No files diagnosed yet this session.\n" : !clean ? "" : `No ${severity === "all" ? "" : severity + " "}issues across ${provenCount} file${provenCount === 1 ? "" : "s"} diagnosed this session. \u2713
23199
23440
  `) + (uncheckedLine ? `${uncheckedLine}
23200
23441
  ` : "") + validationNote + staleNote + suppressedNote + pathsNote;
23201
23442
  return {
@@ -23206,7 +23447,9 @@ ${suppressedLine}` : "";
23206
23447
  filesChecked: visibleSummaries.length,
23207
23448
  staleDropped,
23208
23449
  ...suppressedDetails,
23209
- ...uncheckedDetails
23450
+ ...uncheckedDetails,
23451
+ clean,
23452
+ ...proofDetails
23210
23453
  }
23211
23454
  };
23212
23455
  }
@@ -23286,7 +23529,14 @@ Summary (${visibleSummaries.length} files diagnosed this session):`,
23286
23529
  totalAdvisories,
23287
23530
  staleDropped,
23288
23531
  ...suppressedDetails,
23289
- ...uncheckedDetails
23532
+ ...uncheckedDetails,
23533
+ // #2414: hints alone keep the summary's `clean, N hints`, and only
23534
+ // with the same proof as the line above.
23535
+ clean: cleanVerdict({
23536
+ ...cleanEvidence,
23537
+ findings: totalBlocking + totalErrors + totalWarnings
23538
+ }),
23539
+ ...proofDetails
23290
23540
  }
23291
23541
  };
23292
23542
  }
@@ -23442,7 +23692,7 @@ ${JSON.stringify(view)}`
23442
23692
  }
23443
23693
 
23444
23694
  // dist/tools/module-report.js
23445
- import * as path41 from "node:path";
23695
+ import * as path40 from "node:path";
23446
23696
  function resolveFile(filePath, cwd) {
23447
23697
  return resolveHostToolPath(filePath, cwd || ".");
23448
23698
  }
@@ -23514,7 +23764,7 @@ function createModuleReportTool(getProjectRoot) {
23514
23764
  content: [
23515
23765
  {
23516
23766
  type: "text",
23517
- text: `Module report failed for ${path41.basename(absFile)}: ${errorMessage2(err)}`
23767
+ text: `Module report failed for ${path40.basename(absFile)}: ${errorMessage2(err)}`
23518
23768
  }
23519
23769
  ],
23520
23770
  isError: true,
@@ -23602,7 +23852,7 @@ function createReadSymbolTool(getProjectRoot, recordSymbolRead) {
23602
23852
  content: [
23603
23853
  {
23604
23854
  type: "text",
23605
- text: `Read symbol failed for ${path41.basename(absFile)}: ${errorMessage2(err)}`
23855
+ text: `Read symbol failed for ${path40.basename(absFile)}: ${errorMessage2(err)}`
23606
23856
  }
23607
23857
  ],
23608
23858
  isError: true,
@@ -23612,7 +23862,7 @@ function createReadSymbolTool(getProjectRoot, recordSymbolRead) {
23612
23862
  if (!result.found) {
23613
23863
  const warningSuffix = result.warnings?.length ? ` Warnings: ${result.warnings.join("; ")}` : "";
23614
23864
  const suggestionSuffix = result.suggestions?.length ? ` Did you mean: ${result.suggestions.join(", ")}?` : " Use module_report to list available symbols.";
23615
- const text = result.error ? `Could not inspect ${path41.basename(absFile)}: ${result.error}${warningSuffix}` : `Symbol "${params.symbol}" not found in ${path41.basename(absFile)}.${suggestionSuffix}${warningSuffix}`;
23865
+ const text = result.error ? `Could not inspect ${path40.basename(absFile)}: ${result.error}${warningSuffix}` : `Symbol "${params.symbol}" not found in ${path40.basename(absFile)}.${suggestionSuffix}${warningSuffix}`;
23616
23866
  return {
23617
23867
  content: [{ type: "text", text }],
23618
23868
  isError: true,
@@ -23626,7 +23876,7 @@ function createReadSymbolTool(getProjectRoot, recordSymbolRead) {
23626
23876
  }
23627
23877
  const readRecorded = recordReadCoverage(recordSymbolRead, result, "read_symbol_guard_error", toolCallId, ctx);
23628
23878
  const ambiguityNote = result.ambiguous ? ` (${result.ambiguous.count} matches \u2014 returned the ${result.kind}; pass \`kind\` to disambiguate: ${result.ambiguous.kinds.join(", ")})` : "";
23629
- const header = `${result.kind} ${result.name}${ambiguityNote} ${path41.basename(result.path)}:${result.startLine}-${result.endLine}`;
23879
+ const header = `${result.kind} ${result.name}${ambiguityNote} ${path40.basename(result.path)}:${result.startLine}-${result.endLine}`;
23630
23880
  const guardWarning = readRecorded ? "" : "\n\nWarning: read coverage recording failed; the returned body may not satisfy the edit guard.";
23631
23881
  return {
23632
23882
  content: [
@@ -23702,7 +23952,7 @@ function createReadEnclosingTool(getProjectRoot, recordSymbolRead) {
23702
23952
  content: [
23703
23953
  {
23704
23954
  type: "text",
23705
- text: `Read enclosing failed for ${path41.basename(absFile)}:${params.line}: ${errorMessage2(err)}`
23955
+ text: `Read enclosing failed for ${path40.basename(absFile)}:${params.line}: ${errorMessage2(err)}`
23706
23956
  }
23707
23957
  ],
23708
23958
  isError: true,
@@ -23715,7 +23965,7 @@ function createReadEnclosingTool(getProjectRoot, recordSymbolRead) {
23715
23965
 
23716
23966
  Nested outline:
23717
23967
  ${JSON.stringify(result.outline)}` : "";
23718
- const text = result.error ? `Could not read enclosing range in ${path41.basename(absFile)}:${result.line}: ${result.error}${warningSuffix}${outlineSuffix}` : `No enclosing symbol/callback found in ${path41.basename(absFile)}:${result.line}.${warningSuffix}`;
23968
+ const text = result.error ? `Could not read enclosing range in ${path40.basename(absFile)}:${result.line}: ${result.error}${warningSuffix}${outlineSuffix}` : `No enclosing symbol/callback found in ${path40.basename(absFile)}:${result.line}.${warningSuffix}`;
23719
23969
  return {
23720
23970
  content: [{ type: "text", text }],
23721
23971
  isError: true,
@@ -23737,7 +23987,7 @@ ${JSON.stringify(result.outline)}` : "";
23737
23987
  }
23738
23988
  const readRecorded = recordReadCoverage(recordSymbolRead, result, "read_enclosing_guard_error", toolCallId, ctx);
23739
23989
  const range = result.partial ? `${result.startLine}-${result.endLine} (partial of ${result.enclosingStartLine}-${result.enclosingEndLine})` : `${result.startLine}-${result.endLine}`;
23740
- const header = `${result.kind} ${result.name} ${path41.basename(result.path)}:${range}`;
23990
+ const header = `${result.kind} ${result.name} ${path40.basename(result.path)}:${range}`;
23741
23991
  const guardWarning = readRecorded ? "" : "\n\nWarning: read coverage recording failed; the returned body may not satisfy the edit guard.";
23742
23992
  return {
23743
23993
  content: [
@@ -23872,7 +24122,7 @@ function createSymbolSearchTool(getProjectRoot) {
23872
24122
 
23873
24123
  // dist/tools/lsp-navigation.js
23874
24124
  import * as nodeFs4 from "node:fs";
23875
- import * as path42 from "node:path";
24125
+ import * as path41 from "node:path";
23876
24126
  import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "node:url";
23877
24127
 
23878
24128
  // dist/tools/lsp-structured-output.js
@@ -24599,6 +24849,9 @@ var VALID_OPERATIONS = [
24599
24849
  "workspaceDiagnostics",
24600
24850
  "capabilities"
24601
24851
  ];
24852
+ var LSP_ANY_SCHEMA = Type.Unsafe({
24853
+ type: ["string", "number", "boolean", "object", "array", "null"]
24854
+ });
24602
24855
  var NAVIGABLE_SYMBOL_KINDS = /* @__PURE__ */ new Set([
24603
24856
  5,
24604
24857
  // Class
@@ -24695,7 +24948,7 @@ function noServerAnsweredText(filePath) {
24695
24948
  const { disabledServerIds, fallbackServerIds } = disabledPrimaries(filePath);
24696
24949
  const cause = primaryUnavailableCause([...fallbackServerIds, ...disabledServerIds], disabledServerIds, fallbackServerIds);
24697
24950
  const who = disabledServerIds.length > 0 ? `Primary LSP (${disabledServerIds.join(", ")}) did not answer` : "no language server answered";
24698
- return `No LSP server available for ${path42.basename(filePath)}: ${who} (${PRIMARY_UNAVAILABLE_CAUSE[cause]}).`;
24951
+ return `No LSP server available for ${path41.basename(filePath)}: ${who} (${PRIMARY_UNAVAILABLE_CAUSE[cause]}).`;
24699
24952
  }
24700
24953
  function emptyReasonForOperation(operation) {
24701
24954
  if (operation === "signatureHelp")
@@ -24928,7 +25181,7 @@ function pickLocalSymbolLocation(symbols, token, filePath) {
24928
25181
  return { uri: symbol.location.uri, range: symbol.location.range };
24929
25182
  }
24930
25183
  if (symbol.range) {
24931
- return { uri, range: symbol.range };
25184
+ return { uri, range: symbol.selectionRange ?? symbol.range };
24932
25185
  }
24933
25186
  return void 0;
24934
25187
  }).filter((entry) => Boolean(entry));
@@ -25044,7 +25297,7 @@ function collectSearchReadsForOperation(operation, result, callHierarchyItem) {
25044
25297
  }
25045
25298
  function formatCapabilities(snapshots, filePath) {
25046
25299
  if (snapshots.length === 0) {
25047
- return filePath ? `No active LSP server for ${path42.basename(filePath)}. Open/touch the file first or run another LSP operation to start the server.` : "No active LSP servers in this session.";
25300
+ return filePath ? `No active LSP server for ${path41.basename(filePath)}. Open/touch the file first or run another LSP operation to start the server.` : "No active LSP servers in this session.";
25048
25301
  }
25049
25302
  const rows = [
25050
25303
  ["definition", (s) => !!s.operationSupport.definition],
@@ -25074,7 +25327,7 @@ function formatCapabilities(snapshots, filePath) {
25074
25327
  ];
25075
25328
  const lines = [];
25076
25329
  for (const snapshot of snapshots) {
25077
- const label = filePath ? `${snapshot.serverId} (${path42.basename(filePath)})` : `${snapshot.serverId} (${snapshot.root})`;
25330
+ const label = filePath ? `${snapshot.serverId} (${path41.basename(filePath)})` : `${snapshot.serverId} (${snapshot.root})`;
25078
25331
  lines.push(label);
25079
25332
  for (const [name, supported, note] of rows) {
25080
25333
  const suffix = note ? ` (${note})` : "";
@@ -25139,7 +25392,6 @@ function createLspNavigationTool(getFlag, mutationDeps) {
25139
25392
  }
25140
25393
  return `lsp_navigation ${op} \u2014 ${n} result${n === 1 ? "" : "s"}`;
25141
25394
  }),
25142
- constrainedSampling: CONSTRAINED_JSON_SCHEMA_SAMPLING,
25143
25395
  parameters: Type.Object({
25144
25396
  operation: Type.String({
25145
25397
  enum: [...VALID_OPERATIONS],
@@ -25177,7 +25429,7 @@ function createLspNavigationTool(getFlag, mutationDeps) {
25177
25429
  command: Type.Optional(Type.String({
25178
25430
  description: "Server command identifier."
25179
25431
  })),
25180
- commandArguments: Type.Optional(Type.Array(Type.Unknown(), {
25432
+ commandArguments: Type.Optional(Type.Array(LSP_ANY_SCHEMA, {
25181
25433
  description: "Arguments for the server command."
25182
25434
  })),
25183
25435
  query: Type.Optional(Type.String({
@@ -25443,7 +25695,7 @@ function createLspNavigationTool(getFlag, mutationDeps) {
25443
25695
  content: [
25444
25696
  {
25445
25697
  type: "text",
25446
- text: `No LSP server available for ${path42.basename(filePath)}: ${NO_SERVER_REASON}.`
25698
+ text: `No LSP server available for ${path41.basename(filePath)}: ${NO_SERVER_REASON}.`
25447
25699
  }
25448
25700
  ],
25449
25701
  isError: true
@@ -25608,7 +25860,7 @@ Note: ${snapshotWithheldLine}` : ""}`
25608
25860
  content: [
25609
25861
  {
25610
25862
  type: "text",
25611
- text: disabledPrimaries(filePath).disabledServerIds.length > 0 ? noServerAnsweredText(filePath) : `No LSP server available for ${path42.basename(filePath)}: ${NO_SERVER_REASON}.`
25863
+ text: disabledPrimaries(filePath).disabledServerIds.length > 0 ? noServerAnsweredText(filePath) : `No LSP server available for ${path41.basename(filePath)}: ${NO_SERVER_REASON}.`
25612
25864
  }
25613
25865
  ],
25614
25866
  isError: true
@@ -25628,7 +25880,7 @@ Note: ${snapshotWithheldLine}` : ""}`
25628
25880
  content: [
25629
25881
  {
25630
25882
  type: "text",
25631
- text: `LSP server for ${path42.basename(filePath)} does not advertise support for ${operation}`
25883
+ text: `LSP server for ${path41.basename(filePath)} does not advertise support for ${operation}`
25632
25884
  }
25633
25885
  ],
25634
25886
  isError: true,
@@ -25682,7 +25934,7 @@ Note: ${snapshotWithheldLine}` : ""}`
25682
25934
  const msg = err instanceof Error ? err.message : String(err);
25683
25935
  if (rawPath && /No Project/i.test(msg)) {
25684
25936
  await openFileBestEffort(lspService, filePath);
25685
- await new Promise((resolve34) => setTimeout(resolve34, 120));
25937
+ await new Promise((resolve33) => setTimeout(resolve33, 120));
25686
25938
  const retryRaw = await lspService.workspaceSymbol(query ?? "", filePath);
25687
25939
  const retrySymbols = (Array.isArray(retryRaw) ? retryRaw : [retryRaw]).filter((s) => typeof s === "object" && s !== null);
25688
25940
  return dedupeWorkspaceSymbols(retrySymbols);
@@ -25937,7 +26189,7 @@ Note: ${snapshotWithheldLine}` : ""}`
25937
26189
  isError: true
25938
26190
  }, { operation, filePath, failureKind: "no_server", resultCount: 0 });
25939
26191
  }
25940
- const fileCtx = filePath ? " at " + path42.basename(filePath) : "";
26192
+ const fileCtx = filePath ? " at " + path41.basename(filePath) : "";
25941
26193
  const lineCtx = line ? ":" + line + ":" + character : "";
25942
26194
  let output = isEmpty ? "No results for " + operation + fileCtx + lineCtx : JSON.stringify(result);
25943
26195
  if (isEmpty && operation === "workspaceSymbol" && !rawPath) {
@@ -26234,11 +26486,11 @@ function resolveDefaultCwd() {
26234
26486
  const fromArg = process.argv.find((arg) => arg.startsWith("--cwd="))?.slice("--cwd=".length);
26235
26487
  return fromArg ?? process.env.PI_LENS_MCP_CWD ?? process.cwd();
26236
26488
  }
26237
- var DEFAULT_CWD = path43.resolve(resolveDefaultCwd());
26489
+ var DEFAULT_CWD = path42.resolve(resolveDefaultCwd());
26238
26490
  var lspReadyCwds = /* @__PURE__ */ new Set();
26239
26491
  var SERVER_FILE = fileURLToPath3(import.meta.url);
26240
- var SERVER_DIR = path43.dirname(SERVER_FILE);
26241
- var WORKER_PATH = path43.join(SERVER_DIR, "worker.js");
26492
+ var SERVER_DIR = path42.dirname(SERVER_FILE);
26493
+ var WORKER_PATH = path42.join(SERVER_DIR, "worker.js");
26242
26494
  var REBUILD_SCRIPT = resolveRebuildScript(SERVER_FILE);
26243
26495
  var STALENESS_STAT_PATH = process.env.PI_LENS_MCP_STALENESS_STAT_PATH ?? SERVER_FILE;
26244
26496
  var BUILD_STAMP = computeBuildStamp(STALENESS_STAT_PATH);
@@ -26259,7 +26511,7 @@ function isWarmBuildStale() {
26259
26511
  }
26260
26512
  function findRepoRoot(start) {
26261
26513
  for (const dir of walkUpDirs(start, { maxDepth: 6 })) {
26262
- const pkgPath = path43.join(dir, "package.json");
26514
+ const pkgPath = path42.join(dir, "package.json");
26263
26515
  if (fs25.existsSync(pkgPath)) {
26264
26516
  try {
26265
26517
  const pkg = JSON.parse(fs25.readFileSync(pkgPath, "utf8"));
@@ -26269,11 +26521,11 @@ function findRepoRoot(start) {
26269
26521
  }
26270
26522
  }
26271
26523
  }
26272
- return path43.resolve(start, "..", "..");
26524
+ return path42.resolve(start, "..", "..");
26273
26525
  }
26274
- var REPO_ROOT = process.env.PI_LENS_MCP_REPO_ROOT ? path43.resolve(process.env.PI_LENS_MCP_REPO_ROOT) : findRepoRoot(SERVER_DIR);
26526
+ var REPO_ROOT = process.env.PI_LENS_MCP_REPO_ROOT ? path42.resolve(process.env.PI_LENS_MCP_REPO_ROOT) : findRepoRoot(SERVER_DIR);
26275
26527
  async function ensureReady(cwd) {
26276
- const normalized = path43.resolve(cwd);
26528
+ const normalized = path42.resolve(cwd);
26277
26529
  if (!shouldInitializeSessionRoot(normalized, lspReadyCwds)) {
26278
26530
  return;
26279
26531
  }
@@ -26319,14 +26571,19 @@ function getAutoSessionStatus() {
26319
26571
  }
26320
26572
  var IPC_PATH = ipcPathForCwd(DEFAULT_CWD);
26321
26573
  function rejectForeignTurnCwd(route, cwd) {
26322
- const message = `${route} cwd outside this server's workspace: ${path43.resolve(cwd)} not within ${DEFAULT_CWD}`;
26574
+ const message = `${route} cwd outside this server's workspace: ${path42.resolve(cwd)} not within ${DEFAULT_CWD}`;
26323
26575
  console.error(`[pi-lens-mcp] rejected ${message}`);
26324
26576
  return message;
26325
26577
  }
26326
26578
  function isWithinServerWorkspace(cwd) {
26327
- return isUnderDir(path43.resolve(cwd), DEFAULT_CWD);
26579
+ return isUnderDir(path42.resolve(cwd), DEFAULT_CWD);
26328
26580
  }
26329
26581
  function startIpcServer() {
26582
+ const bound = boundUnixSocketPath(IPC_PATH);
26583
+ if (!boundUnixSocketKeepsIdentity(IPC_PATH)) {
26584
+ console.error(`[pi-lens-mcp] warm side-channel unavailable: socket path exceeds the platform limit; bound name ${bound} no longer identifies this workspace`);
26585
+ return;
26586
+ }
26330
26587
  unlinkStaleUnixSocket(IPC_PATH);
26331
26588
  const requestQueue = createWarmIpcRequestQueue();
26332
26589
  const ipc = net.createServer((socket) => {
@@ -26421,8 +26678,8 @@ function startIpcServer() {
26421
26678
  ipc.on("error", (err) => {
26422
26679
  console.error(`[pi-lens-mcp] IPC listener unavailable: ${err}`);
26423
26680
  });
26424
- ipc.listen(IPC_PATH, () => {
26425
- console.error(`[pi-lens-mcp] warm side-channel listening at ${IPC_PATH}`);
26681
+ ipc.listen(bound, () => {
26682
+ console.error(`[pi-lens-mcp] warm side-channel listening at ${bound}`);
26426
26683
  });
26427
26684
  const cleanup = () => {
26428
26685
  try {
@@ -26677,7 +26934,7 @@ function enabledToolsForCwd(cwd) {
26677
26934
  function formatAnalyze(result, cwd, mode, servedBy) {
26678
26935
  const lspNote = result.lsp ? ` \xB7 lsp ${result.lsp.diagnosticCount} (${result.lsp.status}${result.lsp.failureKind ? `: ${result.lsp.failureKind}` : ""}, ${result.lsp.durationMs}ms)` : "";
26679
26936
  const notChecked = verdictUncheckedReason(result.verdict);
26680
- const summary = `${path43.relative(cwd, result.filePath) || result.filePath} [${mode}] \u2014 ${result.counts.blockers} blocking, ${result.counts.warnings} warning(s), ${result.counts.advisories} advisory(ies), ${result.counts.diagnostics} total` + // #5287: zero counts beside a check that never completed are not a clean
26937
+ const summary = `${path42.relative(cwd, result.filePath) || result.filePath} [${mode}] \u2014 ${result.counts.blockers} blocking, ${result.counts.warnings} warning(s), ${result.counts.advisories} advisory(ies), ${result.counts.diagnostics} total` + // #5287: zero counts beside a check that never completed are not a clean
26681
26938
  // file, so the summary says so beside them.
26682
26939
  // A worker reply from an older build carries no verdict (the facade casts
26683
26940
  // it unvalidated), which the shared reader also treats as unchecked.
@@ -26818,7 +27075,7 @@ ${outcome.output}`, {
26818
27075
  }
26819
27076
  const { deduped, byRule, byFile } = summarizeScan(snapshot.diagnostics);
26820
27077
  const topRules = Object.entries(byRule).sort((a, b) => b[1] - a[1]);
26821
- const topFiles = Object.entries(byFile).sort((a, b) => b[1] - a[1]).slice(0, 15).map(([file, count]) => ({ file: path43.relative(cwd, file), count }));
27078
+ const topFiles = Object.entries(byFile).sort((a, b) => b[1] - a[1]).slice(0, 15).map(([file, count]) => ({ file: path42.relative(cwd, file), count }));
26822
27079
  const summaryLines = [
26823
27080
  `Scanned ${snapshot.filesScanned} file(s) [${snapshot.runners.join(", ")}] \u2192 ${deduped.length} unique diagnostic(s)` + (snapshot.diagnostics.length !== deduped.length ? ` (${snapshot.diagnostics.length} raw, ${snapshot.diagnostics.length - deduped.length} duplicate)` : ""),
26824
27081
  ...topRules.slice(0, 12).map(([rule, count]) => ` ${count}\xD7 ${rule}`)
@@ -26954,7 +27211,7 @@ ${graphStaleness}` : rendered;
26954
27211
  const result = await readSymbol(file, symbol, cwd, { kind });
26955
27212
  if (!result.found && result.error) {
26956
27213
  return {
26957
- ...renderToolText(`Could not inspect ${path43.basename(file)}: ${result.error}`, {
27214
+ ...renderToolText(`Could not inspect ${path42.basename(file)}: ${result.error}`, {
26958
27215
  found: false,
26959
27216
  error: result.error,
26960
27217
  ...result.warnings ? { warnings: result.warnings } : {}
@@ -26965,7 +27222,7 @@ ${graphStaleness}` : rendered;
26965
27222
  if (!result.found) {
26966
27223
  const suggestionSuffix = result.suggestions?.length ? ` Did you mean: ${result.suggestions.join(", ")}?` : " Use pilens_module_report to list symbols.";
26967
27224
  return {
26968
- ...renderToolText(`Symbol "${symbol}" not found in ${path43.basename(file)}.${suggestionSuffix}`, {
27225
+ ...renderToolText(`Symbol "${symbol}" not found in ${path42.basename(file)}.${suggestionSuffix}`, {
26969
27226
  found: false,
26970
27227
  ...result.suggestions ? { suggestions: result.suggestions } : {},
26971
27228
  ...result.warnings ? { warnings: result.warnings } : {}
@@ -26975,7 +27232,7 @@ ${graphStaleness}` : rendered;
26975
27232
  }
26976
27233
  const sigSuffix = result.signature ? ` ${result.signature}` : "";
26977
27234
  const ambiguityNote = result.ambiguous ? ` (${result.ambiguous.count} matches \u2014 returned the ${result.kind}; pass \`kind\` to disambiguate: ${result.ambiguous.kinds.join(", ")})` : "";
26978
- const header = `${result.kind} ${result.name}${ambiguityNote}${sigSuffix} ${path43.relative(cwd, result.path)}:${result.startLine}-${result.endLine}`;
27235
+ const header = `${result.kind} ${result.name}${ambiguityNote}${sigSuffix} ${path42.relative(cwd, result.path)}:${result.startLine}-${result.endLine}`;
26979
27236
  return {
26980
27237
  content: [
26981
27238
  {
@@ -27016,14 +27273,14 @@ ${result.source ?? ""}`
27016
27273
 
27017
27274
  Nested outline:
27018
27275
  ${JSON.stringify(result.outline)}` : "";
27019
- const text = result.error ? `Could not read enclosing range in ${path43.basename(file)}:${result.line}: ${result.error}${warningSuffix}${outlineSuffix}` : `No enclosing symbol/callback found in ${path43.basename(file)}:${result.line}.${warningSuffix}`;
27276
+ const text = result.error ? `Could not read enclosing range in ${path42.basename(file)}:${result.line}: ${result.error}${warningSuffix}${outlineSuffix}` : `No enclosing symbol/callback found in ${path42.basename(file)}:${result.line}.${warningSuffix}`;
27020
27277
  return {
27021
27278
  ...renderToolText(text, { found: false, line: result.line }),
27022
27279
  isError: true
27023
27280
  };
27024
27281
  }
27025
27282
  const range = result.partial ? `${result.startLine}-${result.endLine} (partial of ${result.enclosingStartLine}-${result.enclosingEndLine})` : `${result.startLine}-${result.endLine}`;
27026
- const header = `${result.kind} ${result.name} ${path43.relative(cwd, result.path)}:${range}`;
27283
+ const header = `${result.kind} ${result.name} ${path42.relative(cwd, result.path)}:${range}`;
27027
27284
  return {
27028
27285
  content: [
27029
27286
  {
@@ -27058,7 +27315,7 @@ ${result.source ?? ""}`
27058
27315
  ]),
27059
27316
  ...renderLspBrokenStatusLines(brokenServers),
27060
27317
  ...renderDegradationLines(degradations),
27061
- last ? `Last dispatch: ${path43.basename(last.filePath)} \u2014 ${last.totalDurationMs}ms, ${last.totalDiagnostics} diagnostic(s)` : "Last dispatch: none yet",
27318
+ last ? `Last dispatch: ${path42.basename(last.filePath)} \u2014 ${last.totalDurationMs}ms, ${last.totalDiagnostics} diagnostic(s)` : "Last dispatch: none yet",
27062
27319
  `Diagnostics this session: ${stats.totalShown} shown \xB7 ${stats.totalAutoFixed} auto-fixed \xB7 ${stats.totalUnresolved} unresolved`,
27063
27320
  autoSession ? `Auto session_start: ${autoSession.succeeded ? "succeeded" : autoSession.error ? "FAILED" : autoSession.attempted ? "in progress" : "not yet attempted"}${autoSession.firedAt ? ` (fired ${autoSession.firedAt})` : ""}${autoSession.error ? ` \u2014 ${autoSession.error}` : ""}` : "Auto session_start: disabled (PI_LENS_MCP_AUTO_SESSION not set)",
27064
27321
  turnEnd ? `Stop-hook turn-end: ${turnEnd.ran} ran \xB7 ${turnEnd.skipped} skipped${turnEnd.lastRunAt ? ` (last ran ${turnEnd.lastRunAt})` : ""}${turnEnd.lastSkipReason ? ` \u2014 last skip: ${turnEnd.lastSkipReason}${turnEnd.lastSkipAt ? ` at ${turnEnd.lastSkipAt}` : ""}` : ""}` : "Stop-hook turn-end: no activity recorded (hook not installed, or no Stop yet)",
@@ -27127,7 +27384,7 @@ ${result.source ?? ""}`
27127
27384
  const limit = typeof args.limit === "number" && Number.isFinite(args.limit) ? Math.max(1, Math.floor(args.limit)) : 5;
27128
27385
  const fileFilter = typeof args.file === "string" ? args.file : void 0;
27129
27386
  const recent = recentLatency(limit, fileFilter);
27130
- const summary = recent.length === 0 ? "No dispatch latency reports yet." : recent.map((report) => `${path43.basename(report.filePath)}: ${report.totalDurationMs}ms (${report.totalDiagnostics} diag${report.stoppedEarly ? ", stopped early" : ""})`).join("\n");
27387
+ const summary = recent.length === 0 ? "No dispatch latency reports yet." : recent.map((report) => `${path42.basename(report.filePath)}: ${report.totalDurationMs}ms (${report.totalDiagnostics} diag${report.stoppedEarly ? ", stopped early" : ""})`).join("\n");
27131
27388
  return renderToolText(summary, recent);
27132
27389
  }
27133
27390
  if (name === "pilens_session_start") {