pi-agent-ide 0.8.0 → 0.8.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.
- package/CHANGELOG.md +26 -40
- package/README.md +12 -7
- package/dist/{chunk-MOJ5RR35.js → chunk-246NTPOS.js} +1 -1
- package/dist/{chunk-NULNW6GK.js → chunk-2ITKAXHO.js} +1 -1
- package/dist/{chunk-SBNR4WZF.js → chunk-3WO2NOEQ.js} +1 -1
- package/dist/{chunk-N7LMRL64.js → chunk-47SPPIXK.js} +1 -1
- package/dist/{chunk-EY65TFHJ.js → chunk-4HWKBCBH.js} +1 -1
- package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
- package/dist/{chunk-KL776TGR.js → chunk-7LOVUWNI.js} +1 -1
- package/dist/{chunk-7JV4VN73.js → chunk-A64JRDZK.js} +1 -1
- package/dist/{chunk-Z3PGADVA.js → chunk-AIT3YWR5.js} +1 -1
- package/dist/{chunk-E4HPRLRB.js → chunk-AKNHSDGV.js} +1 -1
- package/dist/{chunk-4XPUN4QN.js → chunk-AUL5FGGK.js} +1 -1
- package/dist/chunk-BB4A5UI3.js +5 -0
- package/dist/{chunk-CTJV77FR.js → chunk-BQAKA3FU.js} +1 -1
- package/dist/{chunk-PNP2KNGP.js → chunk-BR7GRH4A.js} +1 -1
- package/dist/{chunk-4OYVLXWD.js → chunk-D4IA2MTA.js} +1 -1
- package/dist/{chunk-R5XJSEOE.js → chunk-DXONCYWF.js} +3 -3
- package/dist/{chunk-TWWND6NI.js → chunk-E2PHA4SQ.js} +1 -1
- package/dist/{chunk-MZXX353D.js → chunk-EMRJP6EM.js} +1 -1
- package/dist/{chunk-7HDK3NRQ.js → chunk-GEMDU6XW.js} +1 -1
- package/dist/chunk-GNACBJM3.js +1 -0
- package/dist/{chunk-3G54ZL2L.js → chunk-HCK7OIQ3.js} +1 -1
- package/dist/chunk-HFJGCYFO.js +11 -0
- package/dist/{chunk-CSXHCSTH.js → chunk-ID4RJIVZ.js} +1 -1
- package/dist/{chunk-SBLKPTL3.js → chunk-JKMXND6V.js} +1 -1
- package/dist/{chunk-WE42GBGU.js → chunk-LAJQSHEI.js} +1 -1
- package/dist/{chunk-HCN5W76B.js → chunk-LLRUJD62.js} +1 -1
- package/dist/{chunk-2K65BSXS.js → chunk-M4TVRCMZ.js} +1 -1
- package/dist/{chunk-IUSLSROY.js → chunk-N56WAVYA.js} +1 -1
- package/dist/chunk-OI3HBIPK.js +2 -0
- package/dist/{chunk-GW6NZQTQ.js → chunk-PRLIHLCS.js} +1 -1
- package/dist/{chunk-7TJ6DWW3.js → chunk-Q5X6OXNS.js} +1 -1
- package/dist/{chunk-75SWXD2Z.js → chunk-SWA5B5B2.js} +1 -1
- package/dist/chunk-T7MWQQIF.js +3 -0
- package/dist/{chunk-ICDI27GZ.js → chunk-TGC2ZACO.js} +1 -1
- package/dist/{chunk-7NS3QUIE.js → chunk-TXG2H7YQ.js} +1 -1
- package/dist/{chunk-RAZP42IQ.js → chunk-VAXLSPPU.js} +1 -1
- package/dist/chunk-VMGZMXEM.js +10 -0
- package/dist/{chunk-CPZJPGLG.js → chunk-VNTY7BKC.js} +1 -1
- package/dist/chunk-W3YFF6OO.js +1 -0
- package/dist/{chunk-OLI3JPHJ.js → chunk-W7M3V7FR.js} +1 -1
- package/dist/{chunk-UUJJRXHG.js → chunk-WMHSVEIT.js} +1 -1
- package/dist/{chunk-OJX3RJ5A.js → chunk-WPBQ45ZL.js} +1 -1
- package/dist/{chunk-XZDOVPRC.js → chunk-WXGTU2M6.js} +1 -1
- package/dist/{chunk-3ZGDMTMD.js → chunk-XSIKDVAR.js} +1 -1
- package/dist/{chunk-QP2QSQ4U.js → chunk-YHREORHH.js} +1 -1
- package/dist/chunk-YTYLS2UM.js +1 -0
- package/dist/chunk-Z2QGNTGQ.js +1 -0
- package/dist/{chunk-UBH6X3D3.js → chunk-ZV5ETNLQ.js} +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -0
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -2
- package/dist/entry-27.js +2 -1
- package/dist/entry-28.js +1 -4
- package/dist/entry-29.js +4 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -1
- package/dist/entry-32.js +1 -18
- package/dist/entry-33.js +18 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -25
- package/dist/entry-47.js +25 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -3
- package/dist/entry-52.js +3 -13
- package/dist/entry-53.js +13 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +0 -1
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +0 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-78.js +1 -80
- package/dist/entry-79.js +76 -17
- package/dist/entry-80.js +22 -2
- package/dist/entry-81.js +2 -1
- package/dist/entry-82.js +1 -1
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -3
- package/dist/entry-85.js +3 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -0
- package/dist/pi-agent-ide.js +53 -24
- package/docs/agent-guides/search-code.md +3 -1
- package/docs/agent-guides/ssh.md +1 -1
- package/docs/configuration.md +18 -6
- package/docs/development.md +1 -13
- package/docs/extensions.md +1 -1
- package/docs/releases.md +1 -1
- package/docs/settings-help.md +39 -0
- package/docs/tools.md +1 -0
- package/docs/user-hooks.md +3 -1
- package/node_modules/pi-agent-doctor/package.json +7 -10
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -41
- package/node_modules/pi-agent-ide-ast/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-33.js +2 -0
- package/node_modules/pi-agent-ide-changes/package.json +10 -11
- package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lsp/package.json +10 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -4
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-46.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-47.js +2 -0
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/node_modules/pi-agent-search/src/api/search.ts +7 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +23 -3
- package/node_modules/pi-agent-search-text/index.ts +2 -0
- package/node_modules/pi-agent-search-text/package.json +14 -14
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +18 -10
- package/node_modules/pi-agent-search-text/src/search-session.ts +68 -9
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-58.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-60.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -34
- package/node_modules/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +49 -21
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +6 -8
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +22 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-web/package.json +8 -11
- package/node_modules/pi-agent-web-html/package.json +3 -5
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/package.json +43 -39
- package/skills/configure-agent-ide/SKILL.md +38 -0
- package/src/api/content.ts +6 -0
- package/src/api/tips.ts +3 -0
- package/src/composite/nested-tool-rendering.ts +16 -5
- package/src/composite/preferences.ts +13 -0
- package/src/composite/settings-documentation.ts +59 -0
- package/src/composite/settings-help.ts +106 -0
- package/src/composite/text-results.ts +50 -22
- package/src/documentation/extension.ts +12 -0
- package/src/documentation/search.ts +166 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-47.js +2 -0
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -14
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +18 -10
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +68 -9
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/search.ts +7 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +23 -3
- package/src/extensions/pi-agent-text-editor/package.json +26 -34
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-60.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +22 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +49 -21
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +6 -8
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/src/pi-agent-ide.ts +14 -2
- package/src/plugins/pi-agent-ide-ast/package.json +15 -41
- package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-33.js +2 -0
- package/src/plugins/pi-agent-ide-changes/package.json +10 -11
- package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/src/tips/core.ts +5 -2
- package/src/tips/extension.ts +30 -2
- package/src/tips/persistence.ts +29 -27
- package/src/tips/setup-hint.ts +19 -0
- package/dist/chunk-5KFVDYCI.js +0 -1
- package/dist/chunk-ABFCAOU5.js +0 -1
- package/dist/chunk-BIG45IPN.js +0 -2
- package/dist/chunk-BMOJTJJJ.js +0 -3
- package/dist/chunk-BQ67M4NC.js +0 -3
- package/dist/chunk-IH5NW5JX.js +0 -11
- package/dist/chunk-NRZO5KJT.js +0 -9
- package/dist/chunk-O36UC74T.js +0 -1
- package/dist/chunk-SSWUUBIR.js +0 -1
- package/dist/entry-19.js +0 -1
- package/docs/research/apply-native-capability-matrix.md +0 -174
- package/docs/research/apply-read-latency.md +0 -221
- package/docs/research/codemode-write-context.md +0 -56
- package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
- package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
- package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
- package/docs/research/native-codemode-batch-decision.md +0 -31
- package/docs/research/native-codemode-batching.md +0 -65
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-48.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-27.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-56.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-80.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-82.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-30.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-80.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-38.js +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
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,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.
|