pi-agent-ide 0.6.4 → 0.7.1

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 (431) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +2 -2
  3. package/dist/{chunk-AWXVJ5AC.js → chunk-2RTCSZB3.js} +1 -1
  4. package/dist/chunk-2TRHFMCZ.js +11 -0
  5. package/dist/{chunk-WJTHY6AG.js → chunk-4GCWGE2C.js} +1 -1
  6. package/dist/chunk-4XMY4H4V.js +1 -0
  7. package/dist/{chunk-BSICWXMH.js → chunk-64M3SQPG.js} +1 -1
  8. package/dist/{chunk-QEJGED4V.js → chunk-76ZK5ODR.js} +2 -2
  9. package/dist/{chunk-3BBJZSMS.js → chunk-7LD2OQH3.js} +1 -1
  10. package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
  11. package/dist/chunk-CWD4O5PM.js +3 -0
  12. package/dist/chunk-D3WTDA6V.js +2 -0
  13. package/dist/chunk-EAZGN5ND.js +7 -0
  14. package/dist/chunk-GXEGY7GV.js +1 -0
  15. package/dist/chunk-HZEY4GT4.js +2 -0
  16. package/dist/chunk-LEEQIQ7D.js +28 -0
  17. package/dist/chunk-NRZO5KJT.js +9 -0
  18. package/dist/chunk-OMVRLWMX.js +5 -0
  19. package/dist/{chunk-VBICI5YA.js → chunk-PGIVHICI.js} +1 -1
  20. package/dist/{chunk-FBOW7XOV.js → chunk-PKKDDIWW.js} +1 -1
  21. package/dist/chunk-PNU3E7IO.js +3 -0
  22. package/dist/chunk-PS2B6THP.js +3 -0
  23. package/dist/{chunk-FUG2TEKI.js → chunk-QFTBY67N.js} +2 -2
  24. package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
  25. package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
  26. package/dist/chunk-VMTR74FF.js +2 -0
  27. package/dist/{chunk-HPUAIWIH.js → chunk-WMO6RNE2.js} +1 -1
  28. package/dist/chunk-WU6ZK6YD.js +1 -0
  29. package/dist/{chunk-GIRAEVUJ.js → chunk-XH5WN5XA.js} +1 -1
  30. package/dist/chunk-XYS4FSCC.js +12 -0
  31. package/dist/chunk-YP46DVVP.js +2 -0
  32. package/dist/entry-11.js +1 -1
  33. package/dist/entry-13.js +1 -1
  34. package/dist/entry-14.js +1 -1
  35. package/dist/entry-15.js +1 -1
  36. package/dist/entry-17.js +1 -1
  37. package/dist/entry-25.js +2 -2
  38. package/dist/entry-26.js +1 -1
  39. package/dist/entry-27.js +2 -2
  40. package/dist/entry-28.js +1 -1
  41. package/dist/entry-29.js +1 -1
  42. package/dist/entry-30.js +1 -1
  43. package/dist/entry-31.js +12 -9
  44. package/dist/entry-33.js +1 -1
  45. package/dist/entry-37.js +6 -6
  46. package/dist/entry-41.js +1 -1
  47. package/dist/entry-42.js +1 -1
  48. package/dist/entry-43.js +1 -1
  49. package/dist/entry-44.js +1 -1
  50. package/dist/entry-45.js +13 -14
  51. package/dist/entry-46.js +1 -1
  52. package/dist/entry-49.js +1 -1
  53. package/dist/entry-50.js +3 -6
  54. package/dist/entry-51.js +11 -9
  55. package/dist/entry-52.js +1 -1
  56. package/dist/entry-53.js +1 -1
  57. package/dist/entry-54.js +1 -1
  58. package/dist/entry-56.js +1 -1
  59. package/dist/entry-57.js +1 -1
  60. package/dist/entry-58.js +1 -1
  61. package/dist/entry-60.js +1 -1
  62. package/dist/entry-61.js +0 -1
  63. package/dist/entry-62.js +1 -0
  64. package/dist/entry-63.js +0 -1
  65. package/dist/entry-64.js +1 -0
  66. package/dist/entry-65.js +1 -1
  67. package/dist/entry-66.js +1 -1
  68. package/dist/entry-67.js +1 -1
  69. package/dist/entry-68.js +1 -1
  70. package/dist/entry-69.js +1 -1
  71. package/dist/entry-70.js +1 -1
  72. package/dist/entry-71.js +0 -1
  73. package/dist/entry-72.js +1 -0
  74. package/dist/entry-73.js +0 -1
  75. package/dist/entry-74.js +1 -0
  76. package/dist/entry-75.js +1 -1
  77. package/dist/entry-76.js +1 -1
  78. package/dist/entry-77.js +66 -1
  79. package/dist/entry-78.js +14 -325
  80. package/dist/entry-79.js +2 -18
  81. package/dist/entry-80.js +1 -2
  82. package/dist/entry-81.js +1 -1
  83. package/dist/entry-82.js +5 -1
  84. package/dist/entry-83.js +3 -5
  85. package/dist/entry-84.js +1 -3
  86. package/dist/entry-85.js +1 -1
  87. package/dist/entry-86.js +1 -1
  88. package/dist/pi-agent-ide.js +14 -9
  89. package/docs/agent-guides/editing.md +38 -33
  90. package/docs/agent-guides/git-changes.md +1 -1
  91. package/docs/agent-guides/read-resources.md +8 -4
  92. package/docs/agent-guides/search-code.md +34 -2
  93. package/docs/agent-guides/select-code.md +115 -0
  94. package/docs/configuration.md +12 -17
  95. package/docs/development.md +2 -1
  96. package/docs/releases.md +1 -1
  97. package/docs/research/apply-native-capability-matrix.md +174 -0
  98. package/docs/research/apply-read-latency.md +2 -0
  99. package/docs/research/lpt-393-fuzzy-results/file.json +152 -0
  100. package/docs/research/lpt-393-fuzzy-results/repo.json +122 -0
  101. package/docs/research/lpt-393-search-fuzzy-fallback.md +97 -0
  102. package/docs/research/native-codemode-batch-decision.md +2 -0
  103. package/docs/research/native-codemode-batching.md +1 -1
  104. package/docs/structured-results.md +30 -38
  105. package/docs/tools.md +11 -11
  106. package/docs/user-hooks.md +1 -1
  107. package/node_modules/pi-agent-doctor/package.json +1 -1
  108. package/node_modules/pi-agent-documentation/package.json +1 -1
  109. package/node_modules/pi-agent-filesystem/index.ts +7 -6
  110. package/node_modules/pi-agent-filesystem/package.json +7 -7
  111. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  112. package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
  113. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  114. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  115. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  116. package/node_modules/pi-agent-ide-ast/package.json +15 -10
  117. package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
  118. package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
  119. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +5 -1
  120. package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +204 -0
  121. package/node_modules/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
  122. package/node_modules/pi-agent-ide-ast/src/extension.ts +10 -5
  123. package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
  124. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +142 -27
  125. package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +104 -0
  126. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +384 -0
  127. package/node_modules/pi-agent-ide-ast/src/selection-region.ts +41 -0
  128. package/node_modules/pi-agent-ide-ast/src/source-text.ts +92 -0
  129. package/node_modules/pi-agent-ide-ast/src/text-selection.ts +214 -0
  130. package/node_modules/pi-agent-ide-ast/src/tool-select.ts +268 -0
  131. package/node_modules/pi-agent-ide-changes/index.ts +6 -21
  132. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  133. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +2 -2
  134. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
  135. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  136. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  137. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  138. package/node_modules/pi-agent-ide-lsp/index.ts +5 -5
  139. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  140. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
  141. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
  142. package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
  143. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
  144. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
  145. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +92 -45
  146. package/node_modules/pi-agent-image/package.json +2 -2
  147. package/node_modules/pi-agent-invariant/package.json +1 -1
  148. package/node_modules/pi-agent-pdf/package.json +2 -2
  149. package/node_modules/pi-agent-read/package.json +7 -7
  150. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  151. package/node_modules/pi-agent-read/src/api/read-parameters.ts +40 -3
  152. package/node_modules/pi-agent-read/src/api/tools/read.ts +11 -1
  153. package/node_modules/pi-agent-read/src/core/extension.ts +18 -1
  154. package/node_modules/pi-agent-read/src/core/read-core.ts +50 -35
  155. package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
  156. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +5 -3
  157. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +17 -3
  158. package/node_modules/pi-agent-resource/package.json +1 -1
  159. package/node_modules/pi-agent-resource/src/index.ts +10 -0
  160. package/node_modules/pi-agent-resource/src/result-targets.ts +407 -0
  161. package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
  162. package/node_modules/pi-agent-search/package.json +5 -5
  163. package/node_modules/pi-agent-search/src/api/fuzzy.ts +208 -0
  164. package/node_modules/pi-agent-search/src/api/presentation.ts +68 -0
  165. package/node_modules/pi-agent-search/src/api/search-parameters.ts +9 -3
  166. package/node_modules/pi-agent-search/src/api/search-scope.ts +22 -0
  167. package/node_modules/pi-agent-search/src/api/search.ts +28 -0
  168. package/node_modules/pi-agent-search/src/api/structured-result.ts +69 -14
  169. package/node_modules/pi-agent-search/src/core/extension.ts +56 -16
  170. package/node_modules/pi-agent-search/src/core/search-core.ts +9 -1
  171. package/node_modules/pi-agent-search-text/index.ts +3 -1
  172. package/node_modules/pi-agent-search-text/package.json +7 -6
  173. package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +164 -0
  174. package/node_modules/pi-agent-search-text/src/resolvers.ts +161 -30
  175. package/node_modules/pi-agent-search-text/src/scoped-search.ts +103 -0
  176. package/node_modules/pi-agent-search-text/src/search-backend.ts +104 -17
  177. package/node_modules/pi-agent-search-text/src/search-renderer.ts +89 -292
  178. package/node_modules/pi-agent-search-text/src/search-result.ts +77 -0
  179. package/node_modules/pi-agent-search-text/src/search-session.ts +96 -11
  180. package/node_modules/pi-agent-text/package.json +2 -2
  181. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  182. package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
  183. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  184. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  185. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
  186. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  187. package/node_modules/pi-agent-text-editor/index.ts +0 -5
  188. package/node_modules/pi-agent-text-editor/package.json +26 -31
  189. package/node_modules/pi-agent-text-editor/runtime/entry-77.js +1 -0
  190. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
  191. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
  192. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
  193. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +4 -23
  194. package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +2 -2
  195. package/node_modules/pi-agent-text-editor/src/core/extension.ts +22 -5
  196. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +29 -4
  197. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +4 -14
  198. package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
  199. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +1 -1
  200. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
  201. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +217 -30
  202. package/node_modules/pi-agent-text-editor/src/core/result-input.ts +22 -0
  203. package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
  204. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
  205. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +86 -154
  206. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +6 -1
  207. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +0 -75
  208. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +238 -244
  209. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  210. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -11
  211. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
  212. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
  213. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
  214. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
  215. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
  216. package/node_modules/pi-agent-text-editor-renderer/index.ts +1 -72
  217. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  218. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +19 -5
  219. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
  220. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  221. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  222. package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +1 -0
  223. package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
  224. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  225. package/node_modules/pi-agent-tool-ui/src/index.ts +7 -0
  226. package/node_modules/pi-agent-tool-ui/src/result-panel.ts +298 -0
  227. package/node_modules/pi-agent-web/index.ts +7 -3
  228. package/node_modules/pi-agent-web/package.json +8 -8
  229. package/node_modules/pi-agent-web/runtime/entry-82.js +2 -0
  230. package/node_modules/pi-agent-web/src/search.ts +111 -2
  231. package/node_modules/pi-agent-web-html/package.json +3 -3
  232. package/node_modules/pi-agent-web-image/package.json +4 -4
  233. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  234. package/node_modules/pi-agent-web-text/package.json +4 -4
  235. package/package.json +35 -36
  236. package/src/composite/module-labels.ts +1 -1
  237. package/src/composite/preferences.ts +0 -5
  238. package/src/composite/text-results.ts +221 -0
  239. package/src/documentation/extension.ts +11 -9
  240. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
  241. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  242. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  243. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
  244. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  245. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  246. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  247. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +7 -3
  248. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
  249. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  250. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +2 -0
  251. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  252. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  253. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  254. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +2 -0
  255. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +111 -2
  256. package/src/extensions/pi-agent-read/package.json +7 -7
  257. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  258. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +40 -3
  259. package/src/extensions/pi-agent-read/src/api/tools/read.ts +11 -1
  260. package/src/extensions/pi-agent-read/src/core/extension.ts +18 -1
  261. package/src/extensions/pi-agent-read/src/core/read-core.ts +50 -35
  262. package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
  263. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +5 -3
  264. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +17 -3
  265. package/src/extensions/pi-agent-search/package.json +5 -5
  266. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +3 -1
  267. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -6
  268. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +164 -0
  269. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +161 -30
  270. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +103 -0
  271. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +104 -17
  272. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +89 -292
  273. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +77 -0
  274. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +96 -11
  275. package/src/extensions/pi-agent-search/src/api/fuzzy.ts +208 -0
  276. package/src/extensions/pi-agent-search/src/api/presentation.ts +68 -0
  277. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +9 -3
  278. package/src/extensions/pi-agent-search/src/api/search-scope.ts +22 -0
  279. package/src/extensions/pi-agent-search/src/api/search.ts +28 -0
  280. package/src/extensions/pi-agent-search/src/api/structured-result.ts +69 -14
  281. package/src/extensions/pi-agent-search/src/core/extension.ts +56 -16
  282. package/src/extensions/pi-agent-search/src/core/search-core.ts +9 -1
  283. package/src/extensions/pi-agent-text-editor/index.ts +0 -5
  284. package/src/extensions/pi-agent-text-editor/package.json +26 -31
  285. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  286. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
  287. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  288. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  289. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
  290. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  291. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +1 -72
  292. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  293. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +2 -0
  294. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +19 -5
  295. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
  296. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  297. package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +1 -0
  298. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
  299. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
  300. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
  301. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +4 -23
  302. package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +2 -2
  303. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +22 -5
  304. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +29 -4
  305. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +4 -14
  306. package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
  307. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +1 -1
  308. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
  309. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +217 -30
  310. package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +22 -0
  311. package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
  312. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
  313. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +86 -154
  314. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +6 -1
  315. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +0 -75
  316. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +238 -244
  317. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  318. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -11
  319. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
  320. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
  321. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
  322. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
  323. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
  324. package/src/pi-agent-ide.ts +4 -7
  325. package/src/plugins/pi-agent-ide-ast/package.json +15 -10
  326. package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
  327. package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
  328. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +5 -1
  329. package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +204 -0
  330. package/src/plugins/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
  331. package/src/plugins/pi-agent-ide-ast/src/extension.ts +10 -5
  332. package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
  333. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +142 -27
  334. package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +104 -0
  335. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +384 -0
  336. package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +41 -0
  337. package/src/plugins/pi-agent-ide-ast/src/source-text.ts +92 -0
  338. package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +214 -0
  339. package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +268 -0
  340. package/src/plugins/pi-agent-ide-changes/index.ts +6 -21
  341. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  342. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +2 -2
  343. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
  344. package/src/plugins/pi-agent-ide-debugger/index.ts +5 -3
  345. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +5 -3
  346. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  347. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  348. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  349. package/src/plugins/pi-agent-ide-lsp/index.ts +5 -5
  350. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  351. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
  352. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
  353. package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
  354. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
  355. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
  356. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +92 -45
  357. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
  358. package/src/plugins/pi-agent-ide-terminal/src/search.ts +10 -36
  359. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -1
  360. package/src/plugins/pi-agent-ide-vision/index.ts +31 -4
  361. package/dist/chunk-2P2OGO3G.js +0 -2
  362. package/dist/chunk-5J43L2RL.js +0 -11
  363. package/dist/chunk-6EYWFBNG.js +0 -0
  364. package/dist/chunk-7AVXUV4A.js +0 -7
  365. package/dist/chunk-7WCZOO5I.js +0 -1
  366. package/dist/chunk-BAYETTZZ.js +0 -16
  367. package/dist/chunk-BVK5A7ED.js +0 -28
  368. package/dist/chunk-F7NVAC4Q.js +0 -0
  369. package/dist/chunk-FZBCKIJJ.js +0 -1
  370. package/dist/chunk-I5JLCFUX.js +0 -1
  371. package/dist/chunk-KUPHNMUK.js +0 -2
  372. package/dist/chunk-MIZAFRDR.js +0 -1
  373. package/dist/chunk-PJPA5EEE.js +0 -2
  374. package/dist/chunk-PXWDDBBC.js +0 -0
  375. package/dist/chunk-SILJ3OL4.js +0 -9
  376. package/dist/chunk-TQZBVOTT.js +0 -5
  377. package/dist/chunk-VWW3RLUX.js +0 -12
  378. package/dist/chunk-YHUTTZC6.js +0 -2
  379. package/dist/chunk-ZODCBFBL.js +0 -2
  380. package/dist/entry-87.js +0 -1
  381. package/docs/agent-guides/apply.md +0 -333
  382. package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
  383. package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -159
  384. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +0 -405
  385. package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
  386. package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
  387. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
  388. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
  389. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +0 -276
  390. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
  391. package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
  392. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
  393. package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +0 -137
  394. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
  395. package/node_modules/pi-agent-text-editor/src/core/apply/structured-result.ts +0 -251
  396. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +0 -168
  397. package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +0 -942
  398. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  399. package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +0 -1
  400. package/node_modules/pi-agent-web-text/runtime/entry-87.js +0 -2
  401. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +0 -2
  402. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +0 -2
  403. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  404. package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -2
  405. package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
  406. package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -159
  407. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +0 -405
  408. package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
  409. package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
  410. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
  411. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
  412. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +0 -276
  413. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
  414. package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
  415. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
  416. package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +0 -137
  417. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
  418. package/src/extensions/pi-agent-text-editor/src/core/apply/structured-result.ts +0 -251
  419. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +0 -168
  420. package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +0 -942
  421. /package/node_modules/{pi-agent-text-editor → pi-agent-text-editor-renderer}/runtime/entry-78.js +0 -0
  422. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-79.js +0 -0
  423. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-81.js +0 -0
  424. /package/node_modules/{pi-agent-web → pi-agent-web-html}/runtime/entry-83.js +0 -0
  425. /package/node_modules/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-84.js +0 -0
  426. /package/node_modules/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-85.js +0 -0
  427. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-86.js +0 -0
  428. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-84.js +0 -0
  429. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-85.js +0 -0
  430. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-86.js +0 -0
  431. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-79.js +0 -0
@@ -0,0 +1,174 @@
1
+ # Can native tools replace Apply?
2
+
3
+ The tables record the pre-removal audit at `c4ccbf9`. LPT-403 then fixed empty-file creation and removed Apply under the approved native contract. Historical differences below are evidence, not current API promises.
4
+
5
+ ## Answer
6
+
7
+ **Native tools replace the agreed practical workflows, not every historical Apply guarantee.** The user chose to retire grouped undo and aggregate transfers, keep native batching semantics, fix empty creation, and remove the duplicate tool.
8
+
9
+ The audit found three major differences. The first two were dropped from the required replacement contract; the third was fixed before removal:
10
+
11
+ 1. Native batches do not produce grouped undo receipts. `undo last` cannot restore an Apply checkpoint containing several files, file creation/deletion, moves, or binary files.
12
+ 2. Native text copy/move pairs ranges. Apply concatenates sources and broadcasts the result. JavaScript can build the same destination text, but that alone does not preserve source guards or a coherent multi-file move.
13
+ 3. Creating a new empty file with native `write` creates the file but reports a failed batch. A tested temporary-file composition avoids that failure and refuses overwriting an existing destination, but adds intermediate effects and is not a transaction.
14
+
15
+ Other differences are intentional or can be handled by composition. In particular, committing accepted edits after an ordinary script error is already the approved [native batching policy](native-codemode-batch-decision.md). It should not be changed silently to imitate Apply.
16
+
17
+ This audit does **not** require preserving every historical Apply behavior. The user chose the native contract and important practical scenarios, not full historical compatibility. The tables below keep the observed differences visible; the approved removal contract at the end says which ones still matter.
18
+
19
+ ## How to read the historical matrix
20
+
21
+ - **Covered**: an existing native mechanism covers the operation. This is not a claim of identical execution guarantees.
22
+ - **Compose**: ordinary tools plus JavaScript can express the operation; the stated caveats still apply.
23
+ - **Different**: both routes exist, but their observable behavior differs.
24
+ - **Gap**: there is no replacement for the stated guarantee in the current native API.
25
+ - **Unproven**: a proposed replacement has not been checked end to end.
26
+
27
+ The public inventory comes from [Apply's runtime bindings][apply-runtime], not just its prompt. `editorOpen`, `editorResolve`, and `editorApply` are private bridges. `__finishApplyScript` is an internal completion hook. There is no public `result()` helper bound by this runtime; Read/Search/Diff results are recorded automatically.
28
+
29
+ ## Public operations
30
+
31
+ | Apply capability | Native route | Status and limits | Evidence |
32
+ | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
33
+ | JavaScript conditions, loops, computed edits | Native Codemode JavaScript calling `tools.*` | Covered. Async tool calls replace synchronous Apply helpers. Do not call Apply from the replacement chain. | [Runtime][apply-runtime]; [native composition suite][composition-tests] |
34
+ | `read(request)` | `await tools.read(request)` | Covered for resource reading. Different result envelopes and clipping rules; see snapshots below. Read still takes a string path, so use a stored target string for a selection. | [Apply execution][apply-execution]; [Read targets][read-targets] |
35
+ | `search(request)` | `await tools.search(request)` | Covered: text, regex, AST, symbols, files, web, terminal and process providers. Use native structured matches/captures, not Apply's adapter fields. | [Structural Search suite][structural-tests]; [composition suite][composition-tests] |
36
+ | `diff({before, after})` | `await tools.diff({before, after})` | Covered by the same comparison implementation. It compares complete resolved text unless explicitly windowed. A diff is not an editable target. | [Diff core][diff-core]; [Diff tests][diff-tests] |
37
+ | `open(path)` / `open({path, views})` | Read a resource; keep its returned target and data | Compose, not a mutable editor handle. Full-file reading and checkpoint refresh differ; see snapshots below. | [Runtime][apply-runtime]; [Read targets][read-targets] |
38
+ | `file.source` | Result item's `source` | Covered. Keep source identity, not a display path or preview. | [Result store][result-store] |
39
+ | `file.content` | Read `lines`, preserving each `lineEnding`, and page as needed | Compose. A bounded Read is not complete file content. Bulk snapshot-equivalent reconstruction is unproven in this audit. | [Read targets][read-targets]; [Apply execution][apply-execution] |
40
+ | `file.lines` | Read structured `lines` | Covered for returned lines. Apply also has snapshot line offsets; native selection coordinates are absolute lines and UTF-16 columns. | [Runtime][apply-runtime]; [text Select][text-select] |
41
+ | `file.find(text)` | Strict literal Search on the original target | Compose. Quote and escape the literal, use `caseSensitive: true`, and check completeness. Ordinary unquoted Search can fall back to separate terms; that is not `find`. Arbitrary multiline literal parity is not newly proven here. | [Search parser][search-query]; [Runtime][apply-runtime] |
42
+ | `file.select(searchMatch)` | Pass a match/capture or its target to Search/Select/edit tools | Covered. No conversion to an Apply SelectionSet is needed. Stored native targets also reject stale, forged and expired inputs. | [Structural Search suite][structural-tests]; [composition suite][composition-tests] |
43
+ | `file.between(start, end, {inside, lines})` with literal markers | Select `between` with `extent: inside/around/lines` | Different. Native refuses an unmatched opening marker; Apply stops without an error. The native refusal is an approved guard. | [Runtime][apply-runtime]; [text Select suite][text-tests] |
44
+ | `file.between(selectionSet, selectionSet)` | Derive endpoints and Select `range` within a common original snapshot | Unproven as a general replacement. Native `between` itself accepts literal markers only. Do not manufacture authority from preview coordinates. | [Runtime][apply-runtime]; [text Select][text-select] |
45
+ | `file.slice(set, start, end)` | JavaScript `items.slice(start, end)`, passed as native inputs | Covered for choosing items, including negative array indexes. This is not Select `sliceText`, which slices text within every item. Preview clipping means the returned `items` array may omit target ranges; do not treat it as complete without checking. | [Runtime][apply-runtime]; [Select tool][select-tool] |
46
+ | `file.union(...sets)` | Combine native inputs; optionally Select `merge` | Different. Apply sorts, deduplicates and refuses overlapping ranges. Native merge explicitly joins overlaps. Add a checked overlap refusal if that old guard is required. | [Runtime][apply-runtime]; [geometry Select][geometry-select] |
47
+ | `file.within(candidates, scopes)` | Select `within` | Covered for non-empty ranges; different point membership. Native uses half-open scopes and excludes a point at a non-empty scope's end. Apply's numeric containment includes that point. | [geometry Select][geometry-select]; [geometry suite][geometry-tests] |
48
+ | `file.linesOf(selection)` | Select `linesOf` | Covered for deriving whole lines. It does not imply Apply's automatic linewise insertion/transfer behavior. | [text Select][text-select]; [text suite][text-tests] |
49
+ | `file.line(first, last)` | Select `lines` from a sufficiently broad original target | Covered, with strict containment. Partial Read authority is never silently widened. | [text suite][text-tests] |
50
+ | `file.start()` / `file.end()` | Select `position: before/after` from a whole-file target | Covered for character positions, including empty files. Unlike Apply's points, these do not carry a linewise insertion flag. | [text suite][text-tests]; paired check P8 |
51
+ | `file.before(selection)` / `file.after(selection)` | Select `position: before/after` | Covered for exact positions. Supply line separators deliberately when using character-point edits or transfers. | [text Select][text-select]; [element suite][element-tests] |
52
+ | SelectionSet `.text` / each selection's `.text` | Read stored target(s), then join returned content | Compose. Read whole-line context is not the exact selection text; clip it to the verified range. A preview is not a full value. Source-guarded bulk concatenation remains unproven. | [Read targets][read-targets]; [transfer core][transfer-core] |
53
+ | SelectionSet identity, generation, provenance | Session-owned result targets, strict snapshots, Select origins and syntax metadata | Covered with a different representation. Targets expire across session/reload and do not silently refresh. | [Result store][result-store]; [Select suites][select-tests] |
54
+ | `file.replace(selection, text)` / global `replace(selection, text)` | `tools.replace({path: selection, text})` | Covered for exact guarded ranges, sparse and multi-file selections. A bare exact string uses the native anchor contract, not a SelectionSet. | [composition suite][composition-tests] |
55
+ | `file.remove(selection)` / global `remove(selection)` | Structured `tools.delete({path: selection})` or empty replacement | Covered. Structured deletion keeps the file and exposes no editable removal target; empty replacement can expose the resulting position. | [composition suite][composition-tests]; [editing guide][editing-guide] |
56
+ | `file.insertBefore/insertAfter` / global variants | Line-based `insert` for anchors; Select position + replace/copy/move for exact character points | Compose. `insert` does not accept arbitrary structured inputs. The EOF CRLF blank-line case is paired and proven; general linewise transfer is not established by that one example. | Paired check P8; [transfer tests][apply-transaction-tests] |
57
+ | `copy(sourceSet, destinationSet)` | Structured native `copy` | Different: native pairs equal counts; Apply concatenates all source text and broadcasts it. | Paired check P4; [transfer core][transfer-core] |
58
+ | `move(sourceSet, destinationSet)` | Structured native `move` | Different for the same aggregation reason. JavaScript copy/replace then delete is not automatically one coherent guarded move. | [Apply transaction][apply-transaction]; [transfer core][transfer-core]; [transfer tests][apply-transaction-tests] |
59
+ | `createFile(path, content)` | `write`, or owned temporary file + non-overwriting whole-file copy | Different. Write overwrites; the tested composition protects an existing destination, including empty creation, but has intermediate effects. | Paired checks P2, P3, P5 |
60
+ | `deleteFile(path)` / `file.delete()` | `tools.delete({path})` with an ordinary path | Covered for regular-file deletion. Native action is a commit boundary, not a queued Apply operation. | [file operations][file-operations]; [composition suite][composition-tests] |
61
+ | `copyFile(path, target, {overwrite})` | Whole-file `tools.copy` with ordinary paths | Covered: same byte-preserving primitive, default refusal to overwrite, regular-file/symlink checks. Outer rollback/undo differs. | [file operations][file-operations]; [Apply transaction][apply-transaction] |
62
+ | `moveFile(path, target, {overwrite})` | Whole-file `tools.move` with ordinary paths | Covered with the same rollback/undo caveat. | [file operations][file-operations]; [composition suite][composition-tests] |
63
+ | Global `flush()` / normal script completion | `tools.flush({})` / native script completion | Covered as a checkpoint mechanism, not receipt or error parity. Inspect final per-call effects, not just pending child results. | Paired checks P1, P6; [native batch][native-batch] |
64
+ | `file.flush()` | Reorder staging, then global native flush | Different. No file-selective native flush exists. Apply skips selective flush when that file participates in a pending cross-file transfer. | Paired check P7; [Runtime][apply-runtime] |
65
+
66
+ ## Execution guarantees
67
+
68
+ | Guarantee | Apply | Native Codemode | Assessment |
69
+ | -------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
70
+ | Pending edits use original coordinates | Immutable document snapshot and SelectionSet generation | Original snapshots within a batch; pending mutation targets can start dependent work | Covered by existing native tests, with explicit boundary rules. |
71
+ | Ordinary uncaught script error | Does not auto-commit still-pending operations | Commits accepted surviving edits, then reports the error | Different, paired P1 and live. Native behavior was already approved. |
72
+ | Abort/deadline | No final pending checkpoint; already committed effects remain | Discards pending batch; already committed effects remain | Comparable intent. Existing native cancellation tests are evidence, not rerun in this audit. |
73
+ | Read/Search after pending edits | Reads snapshot/disk without implicitly committing queued edits | Another tool or pending-result dependency can commit the batch first | Different timing. Native reads see committed, not yet finally formatted text. |
74
+ | Explicit checkpoint | Global or eligible file-selective flush | Global flush plus automatic boundaries | Different, paired P7. Scheduling can express many workflows, not identical pending-state semantics. |
75
+ | Handle after checkpoint | Open document handles refresh; old SelectionSets become stale | Earlier target strings remain strict; obtain or use a confirmed fresh target | Different by design. No silent native refresh. |
76
+ | Independent operation failure | Can keep successful siblings; failures/unknown effects are recorded | Can keep successful siblings; structured domain errors must be inspected | Both are partial-success systems. Neither is all-script atomic. |
77
+ | Failed text write / transfer | Per-operation saved-path rollback plus dependency blocking when outcome is unknown | Shared multi-resource text-write rollback and guarded per-call effects | Source-level overlap, not full failure parity. Newly created paths and whole-file failures need separate adversarial proof. |
78
+ | Whole-file copy/move/delete rollback | Apply adds its saved-before operation journal | Shared file primitive reports an unknown effect if failure occurs after the operation starts | Gap in equivalent restoration guarantees; not newly fault-injected here. |
79
+ | Grouped undo | Checkpoint creates `APPLY#`; preflight guards then restore all touched paths, including binary/absent paths | Can consume an existing Apply receipt, but native flush cannot produce one. `undo last` is per-file text undo | Gap, paired receipt producer P6 plus source inspection. Calling Apply to make a receipt is not a replacement. |
80
+ | Repeated overlapping edits | Checkpoint checks original ranges and records failures | Batch checks original ranges and refuses conflicting changes | Covered in broad mechanism only. Ordering of multiple insertions at the exact same point was not paired here. |
81
+ | Stale source authority | Snapshot checks and selection generation | Expected content/existence, source identity, strict stored targets and completeness | Covered, not permission to replace a guarded source with an unguarded string reconstruction. |
82
+ | Sparse/multi-file selections | Apply SelectionSets belong to one document; global operations compose them | Native results retain separate source/ranges and origins | Covered; native does not match across gaps. |
83
+ | No-op / empty selections | Can record a warning without edits | Successful `not-applied` no-op for eligible text operations | Covered goal, different receipts. Whole-file write/undo do not widen an empty/partial selection. |
84
+ | Formatting and post-edit handlers | Final processing after surviving Apply work, with final snapshots/results | Once per surviving resource at native script end; flush does not format | Covered goal by existing native integration tests. Final processing can stale earlier targets. No formatter success claim for ignored live `.tmp` fixtures. |
85
+ | Script sandbox | Fresh Run guest, fixed private IDE bridge; no shell/import/Node access | Native QuickJS orchestration, registered tool pipeline; no Node filesystem API in guest | Different implementation. Test ordinary tool composition, not a shell script that sidesteps guards. |
86
+ | Concurrency | Guest calls use an ordered host queue; file reservations protect effects | Independent disjoint calls can run concurrently; await dependent same-source calls | Covered with a richer native model, not identical scheduling. |
87
+ | Output and TUI | Recorded read results, operation outcomes, refreshed snapshots and checkpoint receipts | Native child calls, pending receipts, final batch effects and formatting contributions | Covered presentation goal, different envelopes. Live viewport verified ordinary-error effects, not every historical Apply output shape. |
88
+ | Large inputs/outputs | Full opened snapshots, bridge/output budgets and overflow artifacts | Bounded Read/item previews; stored targets can retain more ranges than the preview | Unproven for arbitrary bulk `.content`/`.text` replacement. Do not call clipped data complete. |
89
+
90
+ ### Snapshot-safe composition rules
91
+
92
+ A matching final string is not enough to establish parity:
93
+
94
+ - Check `status`, `effect`, completeness and the parent final batch outcome. Native domain errors can resolve instead of rejecting the JavaScript promise.
95
+ - Use a returned stored target or a filtered array of complete returned items. Read context and preview text do not create new editing authority.
96
+ - Retain original source/snapshot guards when reconstructing text. Replacing only the destination does not check that the source still matches the text you copied.
97
+ - Read's default target is its returned window. A whole-file target can be obtained through Select on the file, but any paged reconstruction must stay tied to that target and preserve line endings. This bulk composition was not executed here.
98
+ - For exact `find`, escape quotes/backslashes inside a quoted Search term rather than relying on JSON's `\n` escape decoding. Check arbitrary multiline cases before replacing Apply's literal scanning.
99
+ - A sequence of successful calls is not an atomic transaction. Compensation code can itself fail and does not replace a preflight-guarded grouped undo receipt.
100
+
101
+ ## Targeted evidence from this audit
102
+
103
+ All checks are in [apply-native-parity.integration.test.ts][paired-tests]. Apply is the reference call; native replacement chains do not invoke Apply. No production code was changed.
104
+
105
+ | ID | Check | Observed result |
106
+ | --- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
107
+ | P1 | Pending replacement, then ordinary throw | Apply file stays `old`; native file becomes `new`. Both report the script error. |
108
+ | P2 | Create an already existing file | Apply refuses and preserves it. Native write replaces it. |
109
+ | P3 | Create a missing empty file | Apply succeeds. Native creates the empty file, but its batch reports `Text changes must change the document.` This is a real observed bug, not the desired contract. |
110
+ | P4 | Two source fragments copied to two destination ranges | Apply produces `ab ab`; native produces `a b`. Protected CRLF neighbors remain unchanged. |
111
+ | P5 | Create-only composition using an owned temporary file and whole-file copy | Existing destination is refused and preserved. A nonempty pending write followed by replacement through its returned target can prepare an empty source; copy creates the empty destination, then cleanup removes the owned temporary file. |
112
+ | P6 | Commit two edited files | Apply publishes a grouped receipt. Native flush confirms two operations but has no `transaction` or `transactions`. |
113
+ | P7 | Stage two files, flush selectively/globally, then throw | Apply commits only the selected file; native global flush commits both. |
114
+ | P8 | Blank-line insertion after an unterminated CRLF file | Both produce exact `😀 first\r\nlast\r\n\r\nNEW`. This proves this composition, not every linewise transfer. |
115
+
116
+ **All eight checks passed across focused runs, not in one uninterrupted eight-test run.** Passing P3 means the audit reproduced the bug; it does not mean empty native creation works correctly.
117
+
118
+ The run history is intentionally kept honest:
119
+
120
+ - First six-check run: no scenario could start because `node-pty` had not been built after the local install with scripts disabled. Building that dependency fixed the environment, without repository source changes.
121
+ - Retry: five passed; one assertion used the wrong Apply result envelope. Correcting it proved P6 in isolation.
122
+ - New creation workaround exposed P3. The first workaround used a literal selector before a pending file creation had committed; the replacement failed and the file contained `seed`. The final version checks child statuses and replaces through the returned pending write target; P5 then passed.
123
+ - Only targeted serial runs were used: `env -u PI_INTEGRATION_TEST_RUNNER pnpm exec vitest run --config vitest.integration.config.mjs --maxWorkers=1 --no-file-parallelism`. No shared runner pool, shards, or full-suite rerun.
124
+
125
+ Run logs remain in `.tmp/lpt-403-paired-integration.log`, `.tmp/lpt-403-paired-integration-retry.log`, `.tmp/lpt-403-paired-followup.log`, `.tmp/lpt-403-create-followup.log` and `.tmp/lpt-403-create-composition-retry.log`. Real-Pi artifacts remain under `.tmp/test-runs/`. These local logs support this audit; the reusable checks and this matrix belong in Git.
126
+
127
+ Live checks separately reproduced P1 and native empty creation. Read-only byte checks confirmed P1's exact CRLF files. Actual Herdr pane `w3HS:p1`, revision 40, showed both script failures and the native `new` diff. No model-facing text was used as a substitute for that viewport check.
128
+
129
+ The existing suites linked above are source evidence and earlier contract coverage. They were **not** all rerun for LPT-403.
130
+
131
+ ## Approved removal contract
132
+
133
+ The user reviewed the matrix and chose:
134
+
135
+ 1. **Drop grouped checkpoint undo.** Do not add a native grouped receipt producer just to preserve Apply. Existing per-file text undo is a separate capability.
136
+ 2. **Keep equal-pair copy/move.** Concatenating sources and broadcasting to all destinations is not a required native operation.
137
+ 3. **Fix empty-file creation separately before removing Apply.** The temporary-file composition is evidence of a workaround, not the chosen permanent API.
138
+ 4. **Keep the native error/checkpoint/target model.** Ordinary errors keep accepted surviving edits; checkpoints are global/automatic; targets never silently refresh. Remove old Apply promises from removal-facing docs and examples.
139
+ 5. **Check the native contract and important practical scenarios.** Do not chase full compatibility with every historical helper or convenience rule. The unproven areas above remain honest limitations, not automatically mandatory new features.
140
+
141
+ ### Removal implementation
142
+
143
+ - Fixed empty native creation. The standalone and Codemode regressions check actual zero-byte content, truthful applied effects and a usable point target. See [empty creation tests](https://github.com/alexshpunt/pi-agent-ide/blob/5c318fd2081a3bc4e187efb06c7e9eeae4a22317/tests/integration/native-empty-write.integration.test.ts).
144
+ - Removed Apply registration, runtime, grouped undo receipts, private plugin APIs, preview settings and dependencies. Ordinary editing, Diff, Git change undo and per-file last undo remain.
145
+ - Migrated practical shared integration scenarios to native tools. The removal checks cover post-edit processing, scoped semantic/AST operations, module settings, user hooks, CRLF insertion, native result schemas, discovery and hidden-tool boundaries, resource scheduling and progressive guides.
146
+ - Kept the native contract: strict snapshots, equal-pair transfers, global checkpoints and final processing once per surviving resource. Ordinary errors keep accepted edits; cancellation discards only pending work. There is no grouped rollback or silent syntax repair.
147
+
148
+ Historical audit checks below were not rerun after removal: they deliberately depend on the old Apply runtime, and P3 reproduces the old empty-write defect. Their source stays in Git history. The original serial removal check passed 58 contracts and failed one outdated hook expectation; targeted retries verify the corrected native Read/error and blocked-commit behavior. Final live and check evidence is recorded in the task Workpad. No full suite was run for this removal.
149
+
150
+ Full historical equivalence remains false by design. That is not the accepted product requirement.
151
+
152
+ [apply-runtime]: https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts
153
+ [apply-execution]: https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts
154
+ [apply-transaction]: https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts
155
+ [apply-transaction-tests]: https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/tests/core/apply-transaction.test.ts
156
+ [native-batch]: ../../src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts
157
+ [file-operations]: ../../src/extensions/pi-agent-text-editor/src/core/file-operations.ts
158
+ [transfer-core]: ../../src/extensions/pi-agent-text-editor/src/core/result-transfer.ts
159
+ [read-targets]: ../../src/extensions/pi-agent-read/src/core/tools/read/result-target.ts
160
+ [result-store]: ../../packages/pi-agent-resource/src/result-targets.ts
161
+ [select-tool]: ../../src/plugins/pi-agent-ide-ast/src/tool-select.ts
162
+ [text-select]: ../../src/plugins/pi-agent-ide-ast/src/text-selection.ts
163
+ [geometry-select]: ../../src/plugins/pi-agent-ide-ast/src/geometry-selection.ts
164
+ [search-query]: ../../src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts
165
+ [diff-core]: ../../src/extensions/pi-agent-text-editor/src/core/diff-tool.ts
166
+ [diff-tests]: ../../src/extensions/pi-agent-text-editor/tests/core/diff-tool.test.ts
167
+ [paired-tests]: https://github.com/alexshpunt/pi-agent-ide/blob/8336931d17056149fe1d4fd3f0340061533438c9/tests/integration/apply-native-parity.integration.test.ts
168
+ [composition-tests]: ../../tests/integration/native-tool-composition.integration.test.ts
169
+ [structural-tests]: ../../tests/integration/native-structural-search.integration.test.ts
170
+ [select-tests]: ../../tests/integration/native-select.integration.test.ts
171
+ [text-tests]: ../../tests/integration/native-text-select.integration.test.ts
172
+ [geometry-tests]: ../../tests/integration/native-geometry-select.integration.test.ts
173
+ [element-tests]: ../../tests/integration/native-element-select.integration.test.ts
174
+ [editing-guide]: ../agent-guides/editing.md
@@ -1,5 +1,7 @@
1
1
  # Apply and Read latency research
2
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
+
3
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.
4
6
 
5
7
  ## Summary
@@ -0,0 +1,152 @@
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
+ }
@@ -0,0 +1,122 @@
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
+ }
@@ -0,0 +1,97 @@
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
+ ```
@@ -1,5 +1,7 @@
1
1
  # Solution decision: accumulate sequential Codemode text edits
2
2
 
3
+ This records the original batching decision. LPT-403 later removed Apply without changing the native batching policy.
4
+
3
5
  ## Question
4
6
 
5
7
  Should sequential editor calls in native Codemode share only original coordinates, or also one combined write, and where should that batch end?
@@ -54,7 +54,7 @@ Not every invocation of an editor-named tool is a text edit. Direct transactions
54
54
 
55
55
  `createPostEditScope()` already collects final processing per resource. Its writes remain immediate, so using it alone would not fix the failing snapshot test. It is a possible reuse point for formatting and notifications after a combined write, not a replacement for the batch planner.
56
56
 
57
- **Evidence:** [`post-edit-scope.ts`](../../src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts), `createPostEditScope`; [`Apply execution`](../../src/extensions/pi-agent-text-editor/src/core/apply/execution.ts), `finish`. This is an internal reuse observation, not a request to make Apply callable from Codemode.
57
+ **Evidence:** [`post-edit-scope.ts`](../../src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts), `createPostEditScope`; [`Apply execution`](https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts), `finish`. This is an internal reuse observation, not a request to make Apply callable from Codemode.
58
58
 
59
59
  ### Some failure boundaries still need proof
60
60