pi-agent-ide 0.8.0 → 0.8.2

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 (508) hide show
  1. package/CHANGELOG.md +70 -40
  2. package/README.md +15 -8
  3. package/dist/{chunk-ICDI27GZ.js → chunk-235QMMVA.js} +1 -1
  4. package/dist/{chunk-N7LMRL64.js → chunk-47SPPIXK.js} +1 -1
  5. package/dist/chunk-4DIUPEDF.js +2 -0
  6. package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
  7. package/dist/{chunk-NULNW6GK.js → chunk-6FGLAVPJ.js} +1 -1
  8. package/dist/{chunk-KL776TGR.js → chunk-6H32W35W.js} +1 -1
  9. package/dist/{chunk-QP2QSQ4U.js → chunk-6OJ565FL.js} +1 -1
  10. package/dist/{chunk-TWWND6NI.js → chunk-6R3Y4AD3.js} +1 -1
  11. package/dist/{chunk-CPZJPGLG.js → chunk-6T7PSDQW.js} +1 -1
  12. package/dist/{chunk-4OYVLXWD.js → chunk-6TJPMBUQ.js} +1 -1
  13. package/dist/{chunk-SBLKPTL3.js → chunk-6XFUICD7.js} +1 -1
  14. package/dist/chunk-7VSVJRRF.js +28 -0
  15. package/dist/{chunk-7JV4VN73.js → chunk-AAC77UD4.js} +1 -1
  16. package/dist/chunk-ANM3Y5FO.js +11 -0
  17. package/dist/chunk-BB4A5UI3.js +5 -0
  18. package/dist/{chunk-7TJ6DWW3.js → chunk-CPELC6JE.js} +1 -1
  19. package/dist/chunk-FTPC44FP.js +33 -0
  20. package/dist/{chunk-SBNR4WZF.js → chunk-GSOYVIQS.js} +1 -1
  21. package/dist/{chunk-Z3PGADVA.js → chunk-HSRH76JN.js} +1 -1
  22. package/dist/{chunk-CSXHCSTH.js → chunk-HSZ4AQ6L.js} +1 -1
  23. package/dist/chunk-I6NPILT5.js +1 -0
  24. package/dist/chunk-K7SRNBIV.js +1 -0
  25. package/dist/{chunk-R5XJSEOE.js → chunk-LCWBVOII.js} +3 -3
  26. package/dist/{chunk-MZXX353D.js → chunk-LEJKDYCK.js} +1 -1
  27. package/dist/{chunk-3G54ZL2L.js → chunk-NJ7C4KMA.js} +1 -1
  28. package/dist/{chunk-CTJV77FR.js → chunk-NUM3YQGK.js} +1 -1
  29. package/dist/chunk-OJEIX7OZ.js +1 -0
  30. package/dist/{chunk-EY65TFHJ.js → chunk-PJL3UVMJ.js} +1 -1
  31. package/dist/{chunk-E4HPRLRB.js → chunk-QT3EAHOG.js} +1 -1
  32. package/dist/{chunk-HCN5W76B.js → chunk-RIJMXO43.js} +1 -1
  33. package/dist/chunk-RMI3NMQY.js +23 -0
  34. package/dist/chunk-RQ7JJ7GV.js +4 -0
  35. package/dist/{chunk-4XPUN4QN.js → chunk-RVU73VKN.js} +1 -1
  36. package/dist/{chunk-OJX3RJ5A.js → chunk-RW2GTYQI.js} +1 -1
  37. package/dist/{chunk-PNP2KNGP.js → chunk-SDAH3ECM.js} +1 -1
  38. package/dist/chunk-SGQWRIRJ.js +10 -0
  39. package/dist/{chunk-IUSLSROY.js → chunk-SMIFCAAX.js} +1 -1
  40. package/dist/chunk-SWBJS3U4.js +1 -0
  41. package/dist/chunk-T7MWQQIF.js +3 -0
  42. package/dist/{chunk-RAZP42IQ.js → chunk-VAXLSPPU.js} +1 -1
  43. package/dist/{chunk-XZDOVPRC.js → chunk-VMTOFEXF.js} +1 -1
  44. package/dist/{chunk-7HDK3NRQ.js → chunk-VXP5BMW7.js} +1 -1
  45. package/dist/{chunk-WE42GBGU.js → chunk-XAHU42FP.js} +3 -3
  46. package/dist/{chunk-UBH6X3D3.js → chunk-XBQR74IK.js} +1 -1
  47. package/dist/{chunk-7NS3QUIE.js → chunk-XG7QNAKW.js} +1 -1
  48. package/dist/{chunk-GW6NZQTQ.js → chunk-XLWCSJMR.js} +1 -1
  49. package/dist/{chunk-2K65BSXS.js → chunk-XXLLY66B.js} +1 -1
  50. package/dist/chunk-YFP4P2FV.js +1 -0
  51. package/dist/{chunk-75SWXD2Z.js → chunk-YIXP2ALP.js} +1 -1
  52. package/dist/{chunk-MOJ5RR35.js → chunk-ZJQRLVVV.js} +1 -1
  53. package/dist/entry-0.js +1 -1
  54. package/dist/entry-1.js +1 -1
  55. package/dist/entry-10.js +1 -1
  56. package/dist/entry-11.js +1 -1
  57. package/dist/entry-12.js +1 -1
  58. package/dist/entry-13.js +1 -1
  59. package/dist/entry-14.js +1 -1
  60. package/dist/entry-15.js +1 -1
  61. package/dist/entry-16.js +1 -1
  62. package/dist/entry-17.js +1 -1
  63. package/dist/entry-18.js +1 -0
  64. package/dist/entry-19.js +1 -1
  65. package/dist/entry-2.js +1 -1
  66. package/dist/entry-20.js +1 -1
  67. package/dist/entry-22.js +1 -1
  68. package/dist/entry-23.js +1 -1
  69. package/dist/entry-24.js +1 -1
  70. package/dist/entry-25.js +1 -1
  71. package/dist/entry-26.js +1 -2
  72. package/dist/entry-27.js +1 -1
  73. package/dist/entry-28.js +1 -4
  74. package/dist/entry-29.js +2 -1
  75. package/dist/entry-3.js +1 -1
  76. package/dist/entry-30.js +1 -1
  77. package/dist/entry-31.js +4 -1
  78. package/dist/entry-32.js +1 -18
  79. package/dist/entry-33.js +1 -1
  80. package/dist/entry-34.js +1 -1
  81. package/dist/entry-35.js +18 -1
  82. package/dist/entry-36.js +1 -1
  83. package/dist/entry-37.js +1 -1
  84. package/dist/entry-38.js +1 -1
  85. package/dist/entry-39.js +1 -1
  86. package/dist/entry-4.js +1 -1
  87. package/dist/entry-40.js +1 -1
  88. package/dist/entry-41.js +1 -1
  89. package/dist/entry-42.js +1 -1
  90. package/dist/entry-43.js +1 -1
  91. package/dist/entry-44.js +1 -1
  92. package/dist/entry-45.js +1 -1
  93. package/dist/entry-46.js +1 -25
  94. package/dist/entry-47.js +1 -1
  95. package/dist/entry-48.js +1 -1
  96. package/dist/entry-49.js +25 -1
  97. package/dist/entry-5.js +1 -1
  98. package/dist/entry-50.js +1 -1
  99. package/dist/entry-51.js +1 -3
  100. package/dist/entry-52.js +1 -13
  101. package/dist/entry-53.js +1 -1
  102. package/dist/entry-54.js +3 -1
  103. package/dist/entry-55.js +13 -1
  104. package/dist/entry-56.js +1 -1
  105. package/dist/entry-57.js +1 -1
  106. package/dist/entry-58.js +1 -1
  107. package/dist/entry-59.js +1 -1
  108. package/dist/entry-6.js +1 -1
  109. package/dist/entry-60.js +1 -1
  110. package/dist/entry-61.js +1 -1
  111. package/dist/entry-62.js +1 -0
  112. package/dist/entry-63.js +1 -1
  113. package/dist/entry-64.js +1 -0
  114. package/dist/entry-65.js +0 -1
  115. package/dist/entry-66.js +1 -1
  116. package/dist/entry-67.js +0 -1
  117. package/dist/entry-68.js +1 -1
  118. package/dist/entry-69.js +1 -1
  119. package/dist/entry-7.js +1 -1
  120. package/dist/entry-70.js +1 -1
  121. package/dist/entry-71.js +1 -1
  122. package/dist/entry-72.js +1 -0
  123. package/dist/entry-73.js +1 -1
  124. package/dist/entry-74.js +1 -0
  125. package/dist/entry-75.js +0 -1
  126. package/dist/entry-76.js +1 -1
  127. package/dist/entry-77.js +0 -1
  128. package/dist/entry-78.js +1 -80
  129. package/dist/entry-79.js +1 -21
  130. package/dist/entry-8.js +1 -1
  131. package/dist/entry-80.js +1 -2
  132. package/dist/entry-81.js +80 -1
  133. package/dist/entry-82.js +22 -1
  134. package/dist/entry-83.js +2 -1
  135. package/dist/entry-84.js +1 -3
  136. package/dist/entry-85.js +1 -1
  137. package/dist/entry-86.js +1 -1
  138. package/dist/entry-87.js +1 -1
  139. package/dist/entry-88.js +3 -0
  140. package/dist/entry-89.js +1 -0
  141. package/dist/entry-9.js +1 -1
  142. package/dist/entry-90.js +1 -0
  143. package/dist/entry-91.js +1 -0
  144. package/dist/pi-agent-ide.js +53 -31
  145. package/docs/agent-guides/debugger.md +2 -0
  146. package/docs/agent-guides/editing.md +3 -3
  147. package/docs/agent-guides/search-code.md +5 -3
  148. package/docs/agent-guides/select-code.md +9 -6
  149. package/docs/agent-guides/ssh.md +1 -1
  150. package/docs/code-review.md +5 -0
  151. package/docs/configuration.md +52 -8
  152. package/docs/development.md +9 -13
  153. package/docs/directory-operations.md +1 -1
  154. package/docs/extensions.md +99 -2
  155. package/docs/releases.md +1 -1
  156. package/docs/settings-help.md +39 -0
  157. package/docs/structured-results.md +11 -6
  158. package/docs/tools.md +1 -0
  159. package/docs/user-hooks.md +4 -2
  160. package/node_modules/pi-agent-doctor/package.json +7 -10
  161. package/node_modules/pi-agent-doctor/runtime/entry-26.js +1 -0
  162. package/node_modules/pi-agent-doctor/runtime/entry-27.js +1 -0
  163. package/node_modules/pi-agent-documentation/package.json +2 -2
  164. package/node_modules/pi-agent-documentation/runtime/entry-28.js +1 -0
  165. package/node_modules/pi-agent-filesystem/package.json +8 -8
  166. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  167. package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
  168. package/node_modules/pi-agent-filesystem-jq/runtime/entry-31.js +2 -0
  169. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  170. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  171. package/node_modules/pi-agent-filesystem-text/runtime/entry-33.js +2 -0
  172. package/node_modules/pi-agent-ide-ast/package.json +15 -41
  173. package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +1 -0
  174. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +6 -5
  175. package/node_modules/pi-agent-ide-changes/package.json +10 -11
  176. package/node_modules/pi-agent-ide-changes/runtime/entry-36.js +1 -0
  177. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -5
  178. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  179. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  180. package/node_modules/pi-agent-ide-languages/runtime/entry-39.js +2 -0
  181. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  182. package/node_modules/pi-agent-ide-lint/runtime/entry-40.js +2 -0
  183. package/node_modules/pi-agent-ide-lsp/package.json +10 -13
  184. package/node_modules/pi-agent-ide-lsp/runtime/entry-41.js +2 -0
  185. package/node_modules/pi-agent-image/package.json +3 -3
  186. package/node_modules/pi-agent-invariant/package.json +2 -2
  187. package/node_modules/pi-agent-pdf/package.json +3 -4
  188. package/node_modules/pi-agent-read/package.json +12 -12
  189. package/node_modules/pi-agent-read/runtime/entry-46.js +0 -1
  190. package/node_modules/pi-agent-read/runtime/entry-49.js +2 -0
  191. package/node_modules/pi-agent-resource/package.json +2 -2
  192. package/node_modules/pi-agent-resource/src/resource-error.ts +11 -0
  193. package/node_modules/pi-agent-resource/src/result-targets.ts +9 -0
  194. package/node_modules/pi-agent-search/package.json +9 -9
  195. package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
  196. package/node_modules/pi-agent-search/runtime/entry-52.js +1 -0
  197. package/node_modules/pi-agent-search/runtime/entry-54.js +2 -0
  198. package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  199. package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
  200. package/node_modules/pi-agent-search/src/api/search-parameters.ts +6 -5
  201. package/node_modules/pi-agent-search/src/api/search.ts +7 -0
  202. package/node_modules/pi-agent-search/src/core/search-core.ts +23 -3
  203. package/node_modules/pi-agent-search-text/index.ts +2 -0
  204. package/node_modules/pi-agent-search-text/package.json +14 -14
  205. package/node_modules/pi-agent-search-text/runtime/entry-55.js +1 -0
  206. package/node_modules/pi-agent-search-text/runtime/entry-57.js +1 -0
  207. package/node_modules/pi-agent-search-text/src/search-backend.ts +18 -10
  208. package/node_modules/pi-agent-search-text/src/search-session.ts +68 -9
  209. package/node_modules/pi-agent-text/package.json +3 -3
  210. package/node_modules/pi-agent-text/runtime/entry-59.js +1 -0
  211. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  212. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +2 -0
  213. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
  214. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-61.js +1 -0
  215. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-62.js +2 -0
  216. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  217. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-64.js +2 -0
  218. package/node_modules/pi-agent-text-editor/index.ts +2 -0
  219. package/node_modules/pi-agent-text-editor/package.json +26 -34
  220. package/node_modules/pi-agent-text-editor/runtime/entry-78.js +0 -1
  221. package/node_modules/pi-agent-text-editor/runtime/entry-79.js +1 -0
  222. package/node_modules/pi-agent-text-editor/runtime/entry-80.js +1 -0
  223. package/node_modules/pi-agent-text-editor/runtime/entry-81.js +2 -0
  224. package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
  225. package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  226. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +5 -0
  227. package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
  228. package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
  229. package/node_modules/pi-agent-text-editor/src/core/extension.ts +4 -1
  230. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +40 -11
  231. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
  232. package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
  233. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +29 -20
  234. package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
  235. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
  236. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
  237. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
  238. package/node_modules/pi-agent-text-editor/src/core/text-edit-origin.ts +38 -0
  239. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +106 -48
  240. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +35 -14
  241. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
  242. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +39 -44
  243. package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +3 -1
  244. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
  245. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +6 -5
  246. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
  247. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +2 -0
  248. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +35 -2
  249. package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +17 -0
  250. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -5
  251. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  252. package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +1 -0
  253. package/node_modules/pi-agent-tool-ui/package.json +6 -2
  254. package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +1 -0
  255. package/node_modules/pi-agent-tool-ui/runtime/entry-86.js +1 -0
  256. package/node_modules/pi-agent-tool-ui/src/operation-approval.ts +271 -0
  257. package/node_modules/pi-agent-web/package.json +8 -11
  258. package/node_modules/pi-agent-web-html/package.json +3 -5
  259. package/node_modules/pi-agent-web-html/runtime/entry-88.js +2 -0
  260. package/node_modules/pi-agent-web-image/package.json +4 -4
  261. package/node_modules/pi-agent-web-image/runtime/entry-89.js +2 -0
  262. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  263. package/node_modules/pi-agent-web-pdf/runtime/entry-90.js +2 -0
  264. package/node_modules/pi-agent-web-text/package.json +4 -4
  265. package/node_modules/pi-agent-web-text/runtime/entry-91.js +2 -0
  266. package/package.json +65 -53
  267. package/skills/configure-agent-ide/SKILL.md +38 -0
  268. package/src/api/approval.ts +5 -0
  269. package/src/api/content.ts +6 -0
  270. package/src/api/settings.ts +198 -0
  271. package/src/api/tips.ts +3 -0
  272. package/src/backend/debugger-registration.ts +5 -1
  273. package/src/code-review/extension.ts +10 -4
  274. package/src/code-review/reviewer.ts +8 -0
  275. package/src/composite/host-version.ts +29 -5
  276. package/src/composite/ide-alias-rendering.ts +97 -0
  277. package/src/composite/nested-tool-rendering.ts +90 -9
  278. package/src/composite/preferences.ts +13 -0
  279. package/src/composite/search-facts.ts +45 -0
  280. package/src/composite/settings-documentation.ts +68 -0
  281. package/src/composite/settings-help.ts +106 -0
  282. package/src/composite/settings-registry.ts +94 -0
  283. package/src/composite/text-results.ts +170 -30
  284. package/src/composite/tool-availability.ts +11 -2
  285. package/src/core/diagnostic-entry.ts +31 -8
  286. package/src/core/diagnostic-store.ts +19 -3
  287. package/src/core/extension.ts +7 -2
  288. package/src/documentation/extension.ts +12 -0
  289. package/src/documentation/registry.ts +10 -2
  290. package/src/documentation/search.ts +166 -0
  291. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
  292. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  293. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -7
  294. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-31.js +2 -0
  295. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  296. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-32.js +2 -0
  297. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  298. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-33.js +2 -0
  299. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +2 -0
  300. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
  301. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
  302. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +2 -0
  303. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  304. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +2 -0
  305. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  306. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-90.js +2 -0
  307. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  308. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-91.js +2 -0
  309. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +2 -0
  310. package/src/extensions/pi-agent-read/package.json +12 -12
  311. package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
  312. package/src/extensions/pi-agent-read/runtime/entry-47.js +1 -0
  313. package/src/extensions/pi-agent-read/runtime/entry-49.js +2 -0
  314. package/src/extensions/pi-agent-search/package.json +9 -9
  315. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +2 -0
  316. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -14
  317. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +1 -0
  318. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
  319. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +1 -0
  320. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +18 -10
  321. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +68 -9
  322. package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
  323. package/src/extensions/pi-agent-search/runtime/entry-52.js +1 -0
  324. package/src/extensions/pi-agent-search/runtime/entry-53.js +1 -0
  325. package/src/extensions/pi-agent-search/runtime/entry-54.js +2 -0
  326. package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  327. package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
  328. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +6 -5
  329. package/src/extensions/pi-agent-search/src/api/search.ts +7 -0
  330. package/src/extensions/pi-agent-search/src/core/search-core.ts +23 -3
  331. package/src/extensions/pi-agent-text-editor/index.ts +2 -0
  332. package/src/extensions/pi-agent-text-editor/package.json +26 -34
  333. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  334. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +2 -0
  335. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -6
  336. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-61.js +1 -0
  337. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-62.js +2 -0
  338. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  339. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-63.js +1 -0
  340. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-64.js +2 -0
  341. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
  342. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +2 -0
  343. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +35 -2
  344. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +17 -0
  345. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -5
  346. package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -1
  347. package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +1 -0
  348. package/src/extensions/pi-agent-text-editor/runtime/entry-80.js +1 -0
  349. package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +2 -0
  350. package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
  351. package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  352. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +5 -0
  353. package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
  354. package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
  355. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +4 -1
  356. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +40 -11
  357. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
  358. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
  359. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +29 -20
  360. package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
  361. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
  362. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
  363. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
  364. package/src/extensions/pi-agent-text-editor/src/core/text-edit-origin.ts +38 -0
  365. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +106 -48
  366. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +35 -14
  367. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
  368. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +39 -44
  369. package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +3 -1
  370. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
  371. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +6 -5
  372. package/src/pi-agent-ide.ts +74 -15
  373. package/src/plugins/pi-agent-ide-ast/package.json +15 -41
  374. package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +1 -0
  375. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +6 -5
  376. package/src/plugins/pi-agent-ide-changes/package.json +10 -11
  377. package/src/plugins/pi-agent-ide-changes/runtime/entry-36.js +1 -0
  378. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -5
  379. package/src/plugins/pi-agent-ide-debugger/index.ts +158 -55
  380. package/src/plugins/pi-agent-ide-debugger/src/debugmcp-client.ts +118 -0
  381. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +47 -0
  382. package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +2 -0
  383. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +146 -1
  384. package/src/plugins/pi-agent-ide-debugger/src/ui.ts +12 -0
  385. package/src/plugins/pi-agent-ide-debugger/src/vscode-backend.ts +497 -0
  386. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  387. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  388. package/src/plugins/pi-agent-ide-languages/runtime/entry-39.js +2 -0
  389. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  390. package/src/plugins/pi-agent-ide-lint/runtime/entry-40.js +2 -0
  391. package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
  392. package/src/plugins/pi-agent-ide-lsp/runtime/entry-41.js +2 -0
  393. package/src/plugins/pi-agent-ide-terminal/index.ts +2 -0
  394. package/src/plugins/pi-agent-ide-terminal/src/origin.ts +30 -0
  395. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +34 -0
  396. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +11 -2
  397. package/src/plugins/pi-agent-ide-terminal/src/types.ts +9 -0
  398. package/src/plugins/pi-agent-ide-terminal/src/ui.ts +72 -26
  399. package/src/tips/core.ts +5 -2
  400. package/src/tips/extension.ts +30 -2
  401. package/src/tips/persistence.ts +29 -27
  402. package/src/tips/setup-hint.ts +19 -0
  403. package/dist/chunk-3ZGDMTMD.js +0 -25
  404. package/dist/chunk-5KFVDYCI.js +0 -1
  405. package/dist/chunk-ABFCAOU5.js +0 -1
  406. package/dist/chunk-BIG45IPN.js +0 -2
  407. package/dist/chunk-BMOJTJJJ.js +0 -3
  408. package/dist/chunk-BQ67M4NC.js +0 -3
  409. package/dist/chunk-IH5NW5JX.js +0 -11
  410. package/dist/chunk-NRZO5KJT.js +0 -9
  411. package/dist/chunk-O36UC74T.js +0 -1
  412. package/dist/chunk-OLI3JPHJ.js +0 -28
  413. package/dist/chunk-SSWUUBIR.js +0 -1
  414. package/dist/chunk-UUJJRXHG.js +0 -29
  415. package/dist/entry-21.js +0 -1
  416. package/docs/research/apply-native-capability-matrix.md +0 -174
  417. package/docs/research/apply-read-latency.md +0 -221
  418. package/docs/research/codemode-write-context.md +0 -56
  419. package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
  420. package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
  421. package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
  422. package/docs/research/native-codemode-batch-decision.md +0 -31
  423. package/docs/research/native-codemode-batching.md +0 -65
  424. package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
  425. package/node_modules/pi-agent-doctor/runtime/entry-20.js +0 -1
  426. package/node_modules/pi-agent-doctor/runtime/entry-21.js +0 -1
  427. package/node_modules/pi-agent-filesystem/runtime/entry-26.js +0 -2
  428. package/node_modules/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
  429. package/node_modules/pi-agent-filesystem-jq/runtime/entry-28.js +0 -2
  430. package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
  431. package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
  432. package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +0 -2
  433. package/node_modules/pi-agent-ide-languages/runtime/entry-36.js +0 -2
  434. package/node_modules/pi-agent-image/runtime/entry-39.js +0 -1
  435. package/node_modules/pi-agent-invariant/runtime/entry-40.js +0 -1
  436. package/node_modules/pi-agent-pdf/runtime/entry-41.js +0 -1
  437. package/node_modules/pi-agent-search/runtime/entry-49.js +0 -1
  438. package/node_modules/pi-agent-search-text/runtime/entry-52.js +0 -2
  439. package/node_modules/pi-agent-search-text/runtime/entry-54.js +0 -1
  440. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
  441. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -2
  442. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
  443. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -2
  444. package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
  445. package/node_modules/pi-agent-text-editor/runtime/entry-64.js +0 -1
  446. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
  447. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  448. package/node_modules/pi-agent-tool-call-interception/runtime/entry-81.js +0 -1
  449. package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +0 -1
  450. package/node_modules/pi-agent-web-html/runtime/entry-84.js +0 -2
  451. package/node_modules/pi-agent-web-image/runtime/entry-85.js +0 -2
  452. package/node_modules/pi-agent-web-pdf/runtime/entry-86.js +0 -2
  453. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
  454. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-28.js +0 -2
  455. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-29.js +0 -2
  456. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +0 -2
  457. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-84.js +0 -2
  458. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-85.js +0 -2
  459. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-86.js +0 -2
  460. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +0 -2
  461. package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
  462. package/src/extensions/pi-agent-read/runtime/entry-43.js +0 -1
  463. package/src/extensions/pi-agent-read/runtime/entry-44.js +0 -1
  464. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -2
  465. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +0 -1
  466. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-54.js +0 -1
  467. package/src/extensions/pi-agent-search/runtime/entry-49.js +0 -1
  468. package/src/extensions/pi-agent-search/runtime/entry-50.js +0 -1
  469. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
  470. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -2
  471. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
  472. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -2
  473. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
  474. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  475. package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
  476. package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +0 -1
  477. package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +0 -1
  478. package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
  479. package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +0 -2
  480. package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
  481. package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +0 -2
  482. package/src/plugins/pi-agent-ide-languages/runtime/entry-36.js +0 -2
  483. /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-25.js +0 -0
  484. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem}/runtime/entry-29.js +0 -0
  485. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-30.js +0 -0
  486. /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-32.js +0 -0
  487. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-35.js +0 -0
  488. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-37.js +0 -0
  489. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-38.js +0 -0
  490. /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-42.js +0 -0
  491. /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-43.js +0 -0
  492. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-44.js +0 -0
  493. /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-47.js +0 -0
  494. /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-48.js +0 -0
  495. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-50.js +0 -0
  496. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-53.js +0 -0
  497. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-56.js +0 -0
  498. /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-58.js +0 -0
  499. /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-63.js +0 -0
  500. /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-83.js +0 -0
  501. /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-87.js +0 -0
  502. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-30.js +0 -0
  503. /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-48.js +0 -0
  504. /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-58.js +0 -0
  505. /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-83.js +0 -0
  506. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-35.js +0 -0
  507. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-37.js +0 -0
  508. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-38.js +0 -0
@@ -1,221 +0,0 @@
1
- # Apply and Read latency research
2
-
3
- This is historical research. Apply was removed in LPT-403; source paths below refer to [the last pre-removal revision](https://github.com/alexshpunt/pi-agent-ide/tree/c4ccbf9e8620976b5130e6f351f2678ce1d1a067).
4
-
5
- This report records the LPT-238 investigation. It describes the current code on `develop` at `bf7f36db` and the retained benchmark evidence available on 17 September 2026. No product behavior was changed.
6
-
7
- ## Summary
8
-
9
- Apply has a confirmed transaction scaling problem. A flush with many same-file selections does not write the final file once. It validates, snapshots, rebuilds, reads, and writes the whole file once per selection. It also retains one full before/after receipt per selection. On an 11,000-line, 407 KB fixture, 300 replacements took 50.7 seconds. A 1,000-replacement run did not finish within 249 seconds after the 300-replacement sample. This is enough to explain Apply calls that cross a 120-second benchmark timeout.
10
-
11
- Apply also does avoidable work after the bytes are correct. Final post-processing is serial by file. Final diffs are built twice, once for model output and once for the TUI. Output limits are applied only after full diffs and full text have been built. These costs explain why a workspace can become exact before the tool call returns.
12
-
13
- The basic Read text pipeline is not responsible for a 26–33 second delay by itself. Parsing, projecting, and bounding an 11,000-line, 407 KB text fixture averaged about 14 ms in a controlled run. The expensive Read candidates are optional views, post-read handlers, and TUI rendering, because they process the full document before compacting it. Retained benchmark trajectories do not contain phase timestamps, so they cannot assign a reported 26–33 second model cycle to the Read tool alone.
14
-
15
- ## Evidence from retained runs
16
-
17
- The benchmark repository was used read-only.
18
-
19
- The reported timeout group contains two different failure modes:
20
-
21
- - Exact before process timeout: `delete-subset-1000-plain`, `insert-subset-1000-plain`, `multi-file-100-unicode`, and `delete-subset-1000-unicode`.
22
- - Partial workspace at timeout: `multi-file-1-plain`, `multi-file-10-plain`, `multi-file-10-unicode`, `replace-all-1000-unicode`, and `insert-subset-1000-unicode`.
23
-
24
- The exact cases prove that correctness and lifecycle completion are separate. The partial cases do not all prove one Apply call was slow. Some trajectories use many calls or touch only part of the requested file set. They must be classified from the trajectory before attributing the timeout to Apply internals.
25
-
26
- A current retained trajectory is useful as a control:
27
-
28
- - `results/local-pi-agent-ide-hard-oracle5-20260917/trials/delete-subset-1000-unicode__r01__pi-agent-ide/rounds/0/`
29
- - It completed in 65.86 seconds with 18 tool calls and 11 model rounds.
30
- - Its first line-range Apply was followed by a corrective Apply, then verification reads.
31
- - The final mismatch was a selection/correctness issue, not proof of one 65-second Apply call.
32
-
33
- The retained `stdout.jsonl` and `tool-calls.json` record order but not tool start/end wall-clock timestamps. They are insufficient for phase-level latency attribution. Future benchmark capture should preserve tool-call duration or tool lifecycle timestamps without changing pass/fail semantics.
34
-
35
- ## Apply lifecycle and costs
36
-
37
- ### 1. Guest execution
38
-
39
- `src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts`
40
-
41
- `executeApplySource()` creates a sandbox and sends every host operation through `ApplyQueue`. The queue is deliberately serial. A flush sends all open snapshot content and every staged selection across the sandbox bridge.
42
-
43
- This serialization is useful for deterministic snapshot semantics. It is not the main same-file 1,000-edit bottleneck, but the growing request and response payloads add cost.
44
-
45
- ### 2. Transaction execution is the primary bottleneck
46
-
47
- `src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts`
48
-
49
- For every replacement, `executeEditorTransaction()` currently does all of the following:
50
-
51
- 1. Scans prior accepted changes for overlap.
52
- 2. Rebuilds expected content from the original snapshot and all prior changes.
53
- 3. Reads the whole current file for stale validation.
54
- 4. Reads and retains the whole current file again for rollback.
55
- 5. Rebuilds the before state.
56
- 6. Rebuilds the after state.
57
- 7. Calls `editor.editTexts()` with a full-file replacement.
58
- 8. Stores a receipt containing full before/after strings and detailed changes.
59
-
60
- The accepted-change list grows after every selection. The overlap scan is quadratic. Repeated sorting and application of the growing list adds at least quadratic-logarithmic CPU work. Whole-file read/write/snapshot work is repeated `E` times for `E` selections. Receipts retain progressively changed full-file strings.
61
-
62
- ### Controlled transaction timing
63
-
64
- Fixture:
65
-
66
- - 11,000 lines
67
- - 407,000 bytes
68
- - non-overlapping replacements of `legacyCheckout` with `stableCheckout`
69
- - real temporary file reads and writes
70
- - the production `executeEditorTransaction()` function
71
- - a minimal editor adapter with no formatter, diagnostics, presenters, or model
72
-
73
- Results:
74
-
75
- | Replacements | Transaction time | Full writes | Full file receipts |
76
- | -----------: | -------------------------------------------: | ---------------------------: | ---------------------------: |
77
- | 10 | 125 ms | 10 | 10 |
78
- | 100 | 5,647 ms | 100 | 100 |
79
- | 300 | 50,726 ms | 300 | 300 |
80
- | 1,000 | did not finish before the 300 s test timeout | more than 300 before timeout | more than 300 before timeout |
81
-
82
- The 1,000 sample started after the first three samples, so it had less than 249 seconds available. It still establishes that the isolated transaction alone can exceed the benchmark's 120-second limit.
83
-
84
- To reproduce, create a focused Vitest next to `apply-transaction.test.ts` that calls `executeEditorTransaction()` with the fixture above and logs elapsed time, write count, and `outcome.files.length`. Run:
85
-
86
- ```bash
87
- pnpm vitest run src/extensions/pi-agent-text-editor/tests/core/<profile-test>.test.ts --reporter=verbose
88
- ```
89
-
90
- Keep this as an explicit local profile, not a timing assertion in the test suite.
91
-
92
- ### 3. Snapshot refresh
93
-
94
- `src/extensions/pi-agent-text-editor/src/core/apply/execution.ts`
95
-
96
- After every `editorApply`, Apply refreshes every requested open snapshot with a full script-mode Read. It does this even for snapshots not changed by that flush. Script-mode Read also enables all registered views. This can add repeated full-document work between flushes.
97
-
98
- ### 4. Post-processing after bytes are correct
99
-
100
- `src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts`
101
-
102
- Intermediate post-processing is correctly deferred, but `finish()` runs one finalizer at a time. For many files, formatting, diagnostics, listeners, and presenters form a serial tail after the workspace has reached its final bytes. Apply also waits behind the editor's global mutation queue.
103
-
104
- This is the clearest lifecycle explanation for `multi-file-100-unicode`: the files can become exact while finalizers continue serially.
105
-
106
- ### 5. Result and preview construction
107
-
108
- `src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts`
109
-
110
- `finalApplyMutations()` scans mutation receipts for every final file and creates a unified diff. It is called independently by:
111
-
112
- - `renderApplyOutput()` for model-facing output;
113
- - `createApplyDisplay()` for TUI details.
114
-
115
- `createUnifiedDiff()` itself runs two line-diff passes: one for the patch and one for statistics.
116
-
117
- `src/extensions/pi-agent-text-editor/src/core/apply/output.ts`
118
-
119
- The 2,000-line/50 KB limit bounds the returned result, not the work. Apply first builds complete sections and final diffs, joins the full text, and only then checks truncation. Oversized output is saved, then reducible sections are reduced serially. A summary is built only after this work.
120
-
121
- The TUI renderer also receives full mutation data and can highlight, wrap, and render more rows than compact mode ultimately shows.
122
-
123
- ## Read lifecycle and costs
124
-
125
- `src/extensions/pi-agent-read/src/core/tools/tool-read.ts`
126
-
127
- Read currently performs these full-source stages before output truncation:
128
-
129
- 1. Read the complete resource.
130
- 2. Build a line document for the complete text.
131
- 3. Run matching read handlers.
132
- 4. Run requested presenters.
133
- 5. Validate and merge every presenter's contribution across every line.
134
- 6. Project and render the requested range.
135
- 7. Run post-read handlers.
136
- 8. Apply the model-facing output limit.
137
-
138
- For script reads, all registered views are requested and model-facing output truncation is bypassed. Apply open and refresh operations use this mode.
139
-
140
- `src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts`
141
-
142
- Compact TUI mode compacts after content rendering. Syntax highlighting, Markdown rendering, normalization, and ANSI wrapping may therefore process the full result even when only 12 rows remain visible.
143
-
144
- ### Controlled core Read timing
145
-
146
- Fixture:
147
-
148
- - the same 11,000-line, 407 KB text;
149
- - 20 iterations;
150
- - production `createReadState()`, `projectReadState()`, and `limitReadOutput()`;
151
- - no optional view, post-read handler, filesystem wait, or TUI.
152
-
153
- Average:
154
-
155
- | Phase | Time |
156
- | ---------------------------- | -------: |
157
- | Build text document | 3.45 ms |
158
- | Project and render all lines | 9.55 ms |
159
- | Apply 2,000-line/50 KB bound | 1.01 ms |
160
- | Total measured core | 14.01 ms |
161
-
162
- To reproduce, create a focused Vitest beside `read-tool.test.ts`, construct the fixture in memory, time the three functions with `performance.now()`, and run:
163
-
164
- ```bash
165
- pnpm vitest run src/extensions/pi-agent-read/tests/core/<profile-test>.test.ts --reporter=verbose
166
- ```
167
-
168
- This result rules out the basic text projection as the source of a 26–33 second delay on this machine. It does not rule out resolver I/O, views, hooks, syntax highlighting, terminal rendering, or the next model response. Those phases need explicit live tracing.
169
-
170
- ## Recommended optimization order
171
-
172
- | Priority | Change | Expected effect | Capability and risk |
173
- | -------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
174
- | 1 | Validate all same-file selections against one snapshot, apply the non-overlapping change set once, snapshot rollback state once, and write once per file. | Removes the confirmed 1,000-edit timeout mechanism and most receipt growth. | Keep per-operation outcomes and atomic rollback semantics. The main risk is preserving partial-failure reporting when one selection is invalid. |
175
- | 2 | Store one net file result plus compact per-operation metadata instead of full before/after content for every selection. | Reduces bridge payload and retained heap from roughly edit-count × file-size. | Preserve operation status, affected resources, undo, and final diff. Do not discard failure attribution. |
176
- | 3 | Reuse one computed final mutation/diff model for model output and TUI output. Compute statistics in the same diff pass. | Removes duplicate final line diffs after bytes are correct. | No capability loss. Ensure model redaction and TUI presentation remain separate projections of the shared data. |
177
- | 4 | Refresh only snapshots changed by a flush, and allow Apply's editable-text refresh to skip presentation views. | Removes repeated full Read/view work between flushes. | Keep canonical text, line metadata needed by selections, and stale-snapshot checks. |
178
- | 5 | Make independent final file post-processing concurrent with an explicit concurrency limit, while preserving notification order where required. | Shortens the exact-workspace lifecycle tail for multi-file edits. | Formatting or tooling that mutates shared project state may require serialization. Classify handlers before parallelizing. |
179
- | 6 | Build bounded model output directly from final mutation metadata; create a full temporary preview lazily only when requested. | Avoids building huge previews merely to summarize them. | Preserve access to full output through a temporary resource. Be careful that lazy generation sees the committed snapshot. |
180
- | 7 | Make compact Read/Apply renderers clip before syntax highlighting and ANSI wrapping. | Reduces synchronous TUI work and event-loop stalls on large results. | Expanded mode must still show the full presentation. Compact output must keep the useful head/tail contract. |
181
- | 8 | Add phase timings to tool lifecycle records. | Separates model, resolver, mutation, post-processing, output, and TUI delays in future benchmark runs. | Metrics must not alter timeout or correctness behavior and should be off or low-cost by default. |
182
-
183
- ## Suggested next measurement
184
-
185
- Before implementing, add temporary spans around these boundaries in a dedicated development branch:
186
-
187
- - Apply sandbox run;
188
- - transaction parse, validation, rollback snapshot, edit/write, and receipt assembly;
189
- - snapshot refresh;
190
- - deferred post-processing per file;
191
- - final mutation/diff creation;
192
- - model output reduction;
193
- - TUI display creation and first render;
194
- - Read resolver, document creation, each handler/view, projection, truncation, and TUI render.
195
-
196
- Run one exact-before-timeout case and one partial case with tool start/end timestamps. This will show which partial cases are Apply latency and which are model/tool-selection trajectories.
197
-
198
- ## Implemented Apply changes
199
-
200
- The implementation following this research now:
201
-
202
- - batches consecutive non-overlapping replacements from one document into one guarded file write;
203
- - keeps one outcome per requested operation and still rejects invalid or overlapping selections independently;
204
- - captures rollback state once for the batch and records one undo transaction;
205
- - retains one net file receipt instead of one progressive full-file receipt per selection;
206
- - refreshes only snapshots whose resources were changed by a flush;
207
- - computes final mutation diffs once and shares them between model-facing output and TUI display.
208
-
209
- The reusable performance check is:
210
-
211
- ```bash
212
- pnpm profile:apply
213
- ```
214
-
215
- It runs the 11,000-line, 1,000-replacement transaction three times, checks byte-level effects and one write, and enforces the accepted five-second ceiling. The first completed implementation run measured 367.4 ms, 348.9 ms, and 342.3 ms. The pre-change transaction did not finish 1,000 replacements in the available 249 seconds.
216
-
217
- ## Conclusion
218
-
219
- The largest confirmed problem was not preview construction. It was per-selection transaction execution: one logical 1,000-selection file edit became 1,000 whole-file validation, snapshot, rebuild, write, and receipt cycles. The implemented batching removes that primary cost. Snapshot refresh and duplicated diff work were also reduced without removing transaction, undo, output, or post-processing behavior.
220
-
221
- Read needs tracing around views and TUI work, but the basic 11,000-line text pipeline is fast in isolation. The benchmark's reported 26–33 second cycles should not be labeled Read latency until tool lifecycle timestamps separate the Read call from model response time.
@@ -1,56 +0,0 @@
1
- # Codemode Write context verification
2
-
3
- [LPT-666](https://linear.app/alexshpunt/issue/LPT-666/verify-codemode-write-results-do-not-duplicate-file-content-in-model)
4
-
5
- ## Finding
6
-
7
- Silent nested Write did duplicate file text into the next provider request. The IDE's native editor-batch hook appended the final Write presentation to Codemode output, even when the script printed nothing. That extra presentation also bypassed Codemode's output limit.
8
-
9
- The deterministic fixture writes 400 distinct marked lines (60,400 bytes). Its baseline includes the same content in script arguments but never calls Write.
10
-
11
- | Following provider result | Before the fix | After the fix |
12
- | -------------------------------------- | ----------------------------------------------- | ------------------------------------------------- |
13
- | Baseline | 47 text characters, no file-body markers | Same |
14
- | Silent Write | 57,776 text characters, 337 file-body markers | 47 script-output characters, no file-body markers |
15
- | Explicit Write output, 1,000-token cap | An extra file fragment appeared outside the cap | Compact receipt only; no file text |
16
-
17
- These are character counts, not billed token measurements. The pre-fix result counts include the attached editing guide. After-fix output-size assertions exclude that separate guide; the saved request keeps it unchanged (6,345 characters in the captured run).
18
-
19
- ## Boundaries
20
-
21
- - Script arguments legitimately contain the file content. The tests check them separately from subsequent tool-result content.
22
- - `providerRequests` captures the exact input to the deterministic provider, not a paid HTTP request. It includes native SDK metadata as well as model-facing content.
23
- - Native `details.calls` keeps a short argument preview. Native `nestedCalls` keeps call identity, status, timing, and bounded arguments or byte counts. These are not display-only IDE panels, and this change does not remove them.
24
- - The inspected OpenAI Responses serializer converts tool results from `msg.content`; it does not send `details` or `nestedCalls` as tool output. Arbitrary custom providers can choose differently. We do not claim that the raw context object contains zero copied argument bytes.
25
- - `ide-nested-results` is a saved custom entry for human-facing panels, not another model message. The fixture checks saved Write presentations and the rendered diff separately.
26
-
27
- The fixtures use the pinned Pi 1.0.0 host. Live worktree verification uses installed Pi 1.1.0. Pi itself is unchanged.
28
-
29
- Final live verification after reload covered direct Write, no-op Write, explicit nested output, silent 400-line Write, a directory-target failure, and Write-result reuse through Read. Direct and explicit Write output contained only status, one path, and the Read reminder; the failure added a short reason. Silent output stayed empty. Only the explicit Read exposed file content. `inspect_tui` captured Herdr `w3Q9:p1`, 105×108 cells, revision 344: the direct Write diff and the large nested diff's final rows/+400 count stayed visible. Existing argument-retention limits were labelled honestly.
30
-
31
- Nineteen focused integration checks and ten capability-route unit checks passed. Final one-path and notice refinements were rechecked with three direct/error/Read cases and two notice/interruption cases. Typecheck, targeted lint, free capability coverage, and configured startup passed. No broad suites or paid inference ran.
32
-
33
- ## Compact Write contract
34
-
35
- A later direct-call probe also returned a `Final text` file fragment. The user expanded the scope: Write must return only a write status, path, and a reminder to Read the file. Problems get a short reason, not file text or detailed diagnostics. Human-facing diffs stay visible.
36
-
37
- Direct Write and explicit `text(result)` / `return result` now share that compact receipt. Small, large, and unchanged files do not produce content previews. Formatter availability, diff counts, source lines, and successful formatting details are not part of the agent receipt.
38
-
39
- Keep full mutation data for the renderer and whole-file source targets. Read still consumes the unchanged Write result, including formatted and no-op snapshots. Explicit Read is the positive control for obtaining content; Codemode still owns that output's truncation and recovery file.
40
-
41
- Silent native Write still does not append a second receipt or file body to the parent result. It keeps short problem notices when processing failed or was interrupted, native editor-batch metadata, and unrelated pending-edit receipts.
42
-
43
- ## Reproduce
44
-
45
- ```sh
46
- pnpm exec pi-test run -- vitest run --config vitest.integration.config.mjs \
47
- tests/integration/native-codemode-write-context.integration.test.ts
48
- pnpm exec vitest run scripts/tool-capability-matrix.test.ts -t 'capability route evidence'
49
- pnpm check:capabilities
50
- ```
51
-
52
- Each context case saves `following-provider-request.json` beside `run.jsonl` under `.tmp/test-runs/tests/integration/native-codemode-write-context.integration.test.ts/`. The test source regenerates these local captures; they are not committed.
53
-
54
- Coverage includes direct small/large/no-op and failed Writes, silent and repeated Writes, explicit compact text/return, Read output truncation, short problem notices, native metadata, persisted panels, and the executable silent-Write capability case. Related Write target, formatting, batch-boundary, and after-save interruption checks protect result reuse and honest recovery.
55
-
56
- The paid matrix declares `codemode.silent-write` and `edit.write-receipt`. It checks both the completed parent's output and the Write child's own content, not just tool names. No paid matrix routes were run; real-model execution remains unverified.
@@ -1,152 +0,0 @@
1
- {
2
- "scope": "file",
3
- "request": {
4
- "query": "generateHintStrings",
5
- "path": "tests/integration/extensions/pi-agent-search/fixtures/fuzzy-vimium/link_hints.js"
6
- },
7
- "node": "v24.20.0",
8
- "baselineRssBytes": 147570688,
9
- "baselineHeapBytes": 52466544,
10
- "peakNodeRssKiB": 156064,
11
- "runs": [
12
- {
13
- "repetition": 0,
14
- "invocation": "first in this process",
15
- "resolveMs": 48.63072999999986,
16
- "registrationMs": 4.892467000000124,
17
- "totalMs": 53.52319699999998,
18
- "ordinaryMs": 6.71617399999991,
19
- "status": "ready",
20
- "candidates": [
21
- {
22
- "identifier": "hintStrings",
23
- "matchCount": 5,
24
- "complete": true
25
- },
26
- {
27
- "identifier": "generateHintString",
28
- "matchCount": 2,
29
- "complete": true
30
- }
31
- ],
32
- "rssBytes": 152731648,
33
- "heapBytes": 43699128
34
- },
35
- {
36
- "repetition": 1,
37
- "invocation": "repeat; fresh name scan",
38
- "resolveMs": 30.852624000000105,
39
- "registrationMs": 2.1712270000000444,
40
- "totalMs": 33.02385100000015,
41
- "ordinaryMs": 7.320789000000104,
42
- "status": "ready",
43
- "candidates": [
44
- {
45
- "identifier": "hintStrings",
46
- "matchCount": 5,
47
- "complete": true
48
- },
49
- {
50
- "identifier": "generateHintString",
51
- "matchCount": 2,
52
- "complete": true
53
- }
54
- ],
55
- "rssBytes": 152862720,
56
- "heapBytes": 49453640
57
- },
58
- {
59
- "repetition": 2,
60
- "invocation": "repeat; fresh name scan",
61
- "resolveMs": 30.69540700000016,
62
- "registrationMs": 1.7809270000000197,
63
- "totalMs": 32.47633400000018,
64
- "ordinaryMs": 7.036112000000003,
65
- "status": "ready",
66
- "candidates": [
67
- {
68
- "identifier": "hintStrings",
69
- "matchCount": 5,
70
- "complete": true
71
- },
72
- {
73
- "identifier": "generateHintString",
74
- "matchCount": 2,
75
- "complete": true
76
- }
77
- ],
78
- "rssBytes": 152862720,
79
- "heapBytes": 53448504
80
- },
81
- {
82
- "repetition": 3,
83
- "invocation": "repeat; fresh name scan",
84
- "resolveMs": 25.92471099999989,
85
- "registrationMs": 1.7080989999999474,
86
- "totalMs": 27.632809999999836,
87
- "ordinaryMs": 6.778381999999965,
88
- "status": "ready",
89
- "candidates": [
90
- {
91
- "identifier": "hintStrings",
92
- "matchCount": 5,
93
- "complete": true
94
- },
95
- {
96
- "identifier": "generateHintString",
97
- "matchCount": 2,
98
- "complete": true
99
- }
100
- ],
101
- "rssBytes": 152862720,
102
- "heapBytes": 57350904
103
- },
104
- {
105
- "repetition": 4,
106
- "invocation": "repeat; fresh name scan",
107
- "resolveMs": 30.013942999999927,
108
- "registrationMs": 2.700010999999904,
109
- "totalMs": 32.71395399999983,
110
- "ordinaryMs": 7.596590999999989,
111
- "status": "ready",
112
- "candidates": [
113
- {
114
- "identifier": "hintStrings",
115
- "matchCount": 5,
116
- "complete": true
117
- },
118
- {
119
- "identifier": "generateHintString",
120
- "matchCount": 2,
121
- "complete": true
122
- }
123
- ],
124
- "rssBytes": 155746304,
125
- "heapBytes": 61306432
126
- },
127
- {
128
- "repetition": 5,
129
- "invocation": "repeat; fresh name scan",
130
- "resolveMs": 30.76448000000005,
131
- "registrationMs": 2.2739610000000994,
132
- "totalMs": 33.03844100000015,
133
- "ordinaryMs": 7.54132699999991,
134
- "status": "ready",
135
- "candidates": [
136
- {
137
- "identifier": "hintStrings",
138
- "matchCount": 5,
139
- "complete": true
140
- },
141
- {
142
- "identifier": "generateHintString",
143
- "matchCount": 2,
144
- "complete": true
145
- }
146
- ],
147
- "rssBytes": 159809536,
148
- "heapBytes": 65303264
149
- }
150
- ],
151
- "note": "First invocation is not a flushed OS cache. Resolve includes ordinary search, name collection and exact verification. Registration includes bounded snapshots. RSS includes imported runtime modules; it is not the vocabulary size and does not include child-process RSS."
152
- }
@@ -1,122 +0,0 @@
1
- {
2
- "scope": "repo",
3
- "request": {
4
- "query": "planSearchPresentations",
5
- "path": "src"
6
- },
7
- "node": "v24.20.0",
8
- "baselineRssBytes": 149012480,
9
- "baselineHeapBytes": 52543264,
10
- "peakNodeRssKiB": 253136,
11
- "runs": [
12
- {
13
- "repetition": 0,
14
- "invocation": "first in this process",
15
- "resolveMs": 197.02866299999994,
16
- "registrationMs": 5.886676999999963,
17
- "totalMs": 202.9153399999999,
18
- "ordinaryMs": 11.027428999999984,
19
- "status": "ready",
20
- "candidates": [
21
- {
22
- "identifier": "planSearchPresentation",
23
- "matchCount": 10,
24
- "complete": true
25
- }
26
- ],
27
- "rssBytes": 192319488,
28
- "heapBytes": 42126184
29
- },
30
- {
31
- "repetition": 1,
32
- "invocation": "repeat; fresh name scan",
33
- "resolveMs": 153.16502000000014,
34
- "registrationMs": 2.6196299999999155,
35
- "totalMs": 155.78465000000006,
36
- "ordinaryMs": 13.262361000000055,
37
- "status": "ready",
38
- "candidates": [
39
- {
40
- "identifier": "planSearchPresentation",
41
- "matchCount": 10,
42
- "complete": true
43
- }
44
- ],
45
- "rssBytes": 193245184,
46
- "heapBytes": 43182040
47
- },
48
- {
49
- "repetition": 2,
50
- "invocation": "repeat; fresh name scan",
51
- "resolveMs": 140.010812,
52
- "registrationMs": 2.463557999999921,
53
- "totalMs": 142.4743699999999,
54
- "ordinaryMs": 13.206528999999819,
55
- "status": "ready",
56
- "candidates": [
57
- {
58
- "identifier": "planSearchPresentation",
59
- "matchCount": 10,
60
- "complete": true
61
- }
62
- ],
63
- "rssBytes": 194007040,
64
- "heapBytes": 44272152
65
- },
66
- {
67
- "repetition": 3,
68
- "invocation": "repeat; fresh name scan",
69
- "resolveMs": 155.73641399999997,
70
- "registrationMs": 2.2927649999999176,
71
- "totalMs": 158.02917899999989,
72
- "ordinaryMs": 13.180634999999938,
73
- "status": "ready",
74
- "candidates": [
75
- {
76
- "identifier": "planSearchPresentation",
77
- "matchCount": 10,
78
- "complete": true
79
- }
80
- ],
81
- "rssBytes": 194613248,
82
- "heapBytes": 45255216
83
- },
84
- {
85
- "repetition": 4,
86
- "invocation": "repeat; fresh name scan",
87
- "resolveMs": 155.2331959999999,
88
- "registrationMs": 2.0157530000001316,
89
- "totalMs": 157.24894900000004,
90
- "ordinaryMs": 12.454251000000113,
91
- "status": "ready",
92
- "candidates": [
93
- {
94
- "identifier": "planSearchPresentation",
95
- "matchCount": 10,
96
- "complete": true
97
- }
98
- ],
99
- "rssBytes": 195268608,
100
- "heapBytes": 46803240
101
- },
102
- {
103
- "repetition": 5,
104
- "invocation": "repeat; fresh name scan",
105
- "resolveMs": 147.09523799999988,
106
- "registrationMs": 2.65529800000013,
107
- "totalMs": 149.750536,
108
- "ordinaryMs": 11.426179999999931,
109
- "status": "ready",
110
- "candidates": [
111
- {
112
- "identifier": "planSearchPresentation",
113
- "matchCount": 10,
114
- "complete": true
115
- }
116
- ],
117
- "rssBytes": 195883008,
118
- "heapBytes": 47151672
119
- }
120
- ],
121
- "note": "First invocation is not a flushed OS cache. Resolve includes ordinary search, name collection and exact verification. Registration includes bounded snapshots. RSS includes imported runtime modules; it is not the vocabulary size and does not include child-process RSS."
122
- }
@@ -1,97 +0,0 @@
1
- # LPT-393: zero-result fuzzy Search verification
2
-
3
- Search can now suggest nearby identifier spellings after a complete zero-result search. This is a spelling fallback, not semantic search. No model, new dependency, service, or persistent index is needed.
4
-
5
- ## How to use it
6
-
7
- Call Search as usual with an unquoted identifier and a useful scope:
8
-
9
- ```js
10
- search({ query: "generateHintStrings", path: "content_scripts/link_hints.js" });
11
- ```
12
-
13
- The original result stays empty. On the pinned Vimium fixture, two separate groups follow:
14
-
15
- - `hintStrings`: remove the leading `generate` component; 5 exact spans.
16
- - `generateHintString`: one character edit; 2 exact spans.
17
-
18
- These counts are occurrences, not implementations. Read the suggested source before deciding which name is relevant. Local groups provide their own Search references. Each all-reference repeats only that exact spelling if the files change, not the fuzzy ranking. Individual references become stale normally.
19
-
20
- Inside native Codemode, the original `data.matches` remains empty. Use `data.fuzzy.candidates`, inspect each `selection.complete`, and read its `selection.all.line` when available. `selection.truncated` only describes the three-location public preview, not capture completeness. URL groups instead provide the requested URL and line ranges, with no editable Search references.
21
-
22
- The fallback applies only to suitable unquoted ASCII identifiers, 5–80 characters long, after the ordinary search completes with zero results. Quoted queries, Boolean queries, explicit protocols, nonzero results, and incomplete searches keep their existing behavior. Ranking puts case/separator normalization first, one missing or extra edge component next, and one character edit last. Digits are not corrected. Suggestions do not claim synonyms or equivalent behavior.
23
-
24
- ## User TUI and agent results are separate
25
-
26
- The local Search card now reports `0 exact · 10 fuzzy matches · 4 files` for the repository typo case. Below it, each candidate has a mechanical reason and a bounded source preview: file, line number and highlighted code. The preview uses at most three captured spans per name, with short context around the first highlighted span of each line. Shared source files count once in the header. Incomplete totals carry `+`; compact panels keep their expansion hint.
27
-
28
- These previews are private renderer metadata, not agent-facing text or structured data. The agent still receives the original zero and separate exact candidate groups with Read references. URL results keep their existing URL/line output; this user-requested card revision changes the native local/repository panel.
29
-
30
- The screenshot that showed only `No matches` came from restoring the older global renderer before merging this branch. That older renderer does not understand the new groups. Live verification uses the branch loader; global deployment still requires acceptance and merge.
31
-
32
- ## Bounds and freshness
33
-
34
- Local collection streams unique names using the ordinary ripgrep scope and ignore/glob rules. It does not retain all occurrences just to build a vocabulary. Every invocation scans fresh names; there is no cache to invalidate after edits or checkout changes.
35
-
36
- - At most 20,000 unique names and 8 MiB of name-stream input.
37
- - At most 5 candidate groups.
38
- - Exact verification captures at most 200 spans and 4 MiB of output per candidate.
39
- - Collection and verification share a two-second deadline. Registration has a separate two-second phase budget and bounded snapshot reads.
40
- - Source-size checks bound candidate snapshots to 8 MiB across the captured sources; registration and refresh also retain byte limits.
41
- - Budget skips and extra-branch failures preserve the original zero and explain why suggestions are unavailable. Parent cancellation still aborts the call.
42
- - Incomplete groups have no complete all-reference. A source race can leave readable locations without stable references; the result explains this.
43
-
44
- URL search reuses the already fetched and converted body, with an 8 MiB content budget. It does not fetch the URL again for each candidate.
45
-
46
- ## Measured file and repository cases
47
-
48
- Measured with Node 24.20.0 on this checkout. Each scope ran once, then five more times with a fresh name scan. Total time includes the ordinary search, vocabulary scan, exact verification, and reference registration. The ordinary backend was measured separately as a baseline.
49
-
50
- | Scope / query | First total | Median of five repeats | Ordinary median | Node RSS before calls | Peak Node RSS |
51
- | -------------------------------------------- | ----------: | ---------------------: | --------------: | --------------------: | ------------: |
52
- | Pinned Vimium file / `generateHintStrings` | 53.52 ms | 32.71 ms | 7.18 ms | 140.73 MiB | 152.41 MiB |
53
- | Repository `src` / `planSearchPresentations` | 202.92 ms | 155.78 ms | 12.82 ms | 142.11 MiB | 247.20 MiB |
54
-
55
- All six file runs returned the same 5/2 groups. All six repository runs returned `planSearchPresentation` with 10 exact spans. This repository case scans `src`, not every file in the repository.
56
-
57
- The first call is not a flushed OS-cache measurement. RSS includes imported Node/runtime modules and process allocations, not just the vocabulary, and excludes child-process RSS. These are two measured cases, not a latency or memory guarantee for arbitrary repositories. Raw measurements: [file](lpt-393-fuzzy-results/file.json) and [repository](lpt-393-fuzzy-results/repo.json).
58
-
59
- ## Verification evidence
60
-
61
- - 18 relevant unit files, 133 tests passed; focused type-aware lint passed.
62
- - Four real-Pi integration files, 11 tests passed, covering fuzzy fallback, ordinary hybrid Search, web Search, and structured results. The two fuzzy integrations were rerun after the last renderer change and passed.
63
- - Contracts cover query guards, scope/ignore rules, edits/removals/checkouts, byte and capture limits, cancellation, source races, bounded refresh, dollar identifier boundaries, typed results, and persisted rendering.
64
- - Native local and URL Search plus native Codemode-to-Read were exercised after reloading the working extension. `hintStrings` Read returned four unique lines containing the five spans, including the method declaration at line 886.
65
- - Actual `inspect_tui` captures of Herdr pane `w3GX:p1`, 123×108 cells, revision 147, live bottom: local groups showed both names, counts, reasons and locations without raw anchors or clipping. The URL compact result showed both names/counts and its expansion hint; remaining detail is available with Ctrl+O.
66
- - After the user requested explicit fuzzy status and highlighted source previews, actual viewport captures of the same pane at revisions 606 and 635 showed the new `0 exact` header, distinct fuzzy/file totals, candidate names, file/line rows and highlighted code. Renderer persistence, bounded previews, partial totals, shared-file counting and isolation from agent output are covered by tests.
67
- - Normal configured startup loaded exactly one IDE extension without errors or warnings, both with the temporary worktree loader and after restoring global loading. No model prompt was sent.
68
- - Full source typecheck, package boundaries, machine-path check, catalog generation/check, public package build, and diff whitespace check passed.
69
- - The effective Read/Search interface was exported and read completely. New workflow guidance lives in `docs:search-code`; callable parameter schemas are unchanged.
70
-
71
- The temporary local settings/loader and local HTTP server were removed after verification. The global runtime was restored. The user explicitly accepted the feature after the live demo and a separate real-Pi recording of the card. Acceptance authorizes the PR into develop; it does not itself deploy the feature.
72
-
73
- ## Repeat the checks
74
-
75
- ```sh
76
- pnpm exec vitest run src/extensions/pi-agent-search \
77
- src/extensions/pi-agent-read/extensions/pi-agent-web/test/search.test.ts
78
- pnpm exec pi-test run -- pnpm exec vitest run --config vitest.integration.config.mjs \
79
- tests/integration/extensions/pi-agent-search/fuzzy-fallback.integration.test.ts
80
- pnpm exec oxnode scripts/dev/check-normal-startup.ts
81
- pnpm typecheck
82
- pnpm check:boundaries
83
- pnpm check:paths
84
- pnpm docs:catalog
85
- pnpm check:catalog
86
- pnpm check:package
87
- ```
88
-
89
- To repeat the measured cases, bundle the tracked profiler into the ignored temporary directory, then run each scope:
90
-
91
- ```sh
92
- pnpm exec esbuild dev/performance/fuzzy-search.ts --bundle --platform=node \
93
- --format=esm --target=node24 --external:@earendil-works/* \
94
- --external:typebox --external:typebox/* --outfile=.tmp/fuzzy-verification/profile.mjs
95
- node .tmp/fuzzy-verification/profile.mjs file
96
- node .tmp/fuzzy-verification/profile.mjs repo
97
- ```