@timurproko/a1 0.1.8-dev.50ebb19 → 0.1.8-dev.512

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 (869) hide show
  1. package/README.md +168 -65
  2. package/bin/activate.js +8 -0
  3. package/bin/cli.js +33 -11
  4. package/bin/guardian.js +16 -6
  5. package/bin/module-identity.js +76 -69
  6. package/bin/module-resolver.js +138 -0
  7. package/bin/pinned-pi-public.d.ts +3 -0
  8. package/bin/pinned-pi-public.js +93 -0
  9. package/bin/release-cleanup.js +8 -0
  10. package/bin/supervisor.js +2 -2
  11. package/bin/sync-pi-tui-proxy.js +7 -0
  12. package/bin/ui.js +67 -22
  13. package/bin/update-recovery.js +343 -0
  14. package/bin/warmup.js +28 -0
  15. package/dist/app/session-shell/clipboard-diagnostics.d.ts +16 -0
  16. package/dist/app/session-shell/clipboard-diagnostics.js +65 -0
  17. package/dist/app/session-shell/clipboard-image.d.ts +11 -0
  18. package/dist/app/session-shell/clipboard-image.js +38 -0
  19. package/dist/app/session-shell/editor-hyperlink-budget.d.ts +9 -0
  20. package/dist/app/session-shell/editor-hyperlink-budget.js +23 -0
  21. package/dist/app/session-shell/helper-pool.d.ts +33 -0
  22. package/dist/app/session-shell/helper-pool.js +98 -0
  23. package/dist/app/session-shell/image-preparation-client.d.ts +20 -0
  24. package/dist/app/session-shell/image-preparation-client.js +145 -0
  25. package/dist/app/session-shell/image-preparation.d.ts +18 -0
  26. package/dist/app/session-shell/image-preparation.js +126 -0
  27. package/dist/app/session-shell/image-source.d.ts +13 -0
  28. package/dist/app/session-shell/image-source.js +171 -0
  29. package/dist/app/session-shell/image-worker.d.ts +17 -0
  30. package/dist/app/session-shell/image-worker.js +23 -0
  31. package/dist/app/session-shell/index.d.ts +7 -0
  32. package/dist/app/session-shell/index.js +4 -0
  33. package/dist/app/session-shell/paste-executor.d.ts +18 -0
  34. package/dist/app/session-shell/paste-executor.js +253 -0
  35. package/dist/app/session-shell/paste-helper.js +173 -0
  36. package/dist/app/session-shell/paste-preparation-client.d.ts +31 -0
  37. package/dist/app/session-shell/paste-preparation-client.js +170 -0
  38. package/dist/app/session-shell/paste-protocol.d.ts +78 -0
  39. package/dist/app/session-shell/paste-protocol.js +18 -0
  40. package/dist/app/session-shell/paste-text-preparation.d.ts +6 -0
  41. package/dist/app/session-shell/paste-text-preparation.js +134 -0
  42. package/dist/app/session-shell/paste-text-worker.js +12 -0
  43. package/dist/app/session-shell/paste-types.d.ts +17 -0
  44. package/dist/app/session-shell/path-chip-presentation.d.ts +7 -0
  45. package/dist/app/session-shell/path-chip-presentation.js +24 -0
  46. package/dist/app/session-shell/prompt-chips.d.ts +76 -0
  47. package/dist/app/session-shell/prompt-chips.js +507 -0
  48. package/dist/app/session-shell/prompt-history-controller.d.ts +36 -0
  49. package/dist/app/session-shell/prompt-history-controller.js +170 -0
  50. package/dist/app/session-shell/prompt-suggestion-controller.d.ts +35 -0
  51. package/dist/app/session-shell/prompt-suggestion-controller.js +207 -0
  52. package/dist/app/session-shell/quit-outro-effects.d.ts +29 -0
  53. package/dist/app/session-shell/quit-outro-effects.js +242 -0
  54. package/dist/app/session-shell/quit-outro.d.ts +38 -0
  55. package/dist/app/session-shell/quit-outro.js +98 -0
  56. package/dist/app/session-shell/response-copy-coordinator.d.ts +27 -0
  57. package/dist/app/session-shell/response-copy-coordinator.js +187 -0
  58. package/dist/app/session-shell/response-copy-helper.js +122 -0
  59. package/dist/app/session-shell/response-copy-protocol.d.ts +56 -0
  60. package/dist/app/session-shell/response-copy-protocol.js +5 -0
  61. package/dist/app/session-shell/response-copy-transport.d.ts +39 -0
  62. package/dist/app/session-shell/response-copy-transport.js +217 -0
  63. package/dist/app/session-shell/session-shell-root.d.ts +265 -0
  64. package/dist/app/session-shell/session-shell-root.js +1366 -0
  65. package/dist/app/session-shell/session-shell.d.ts +59 -0
  66. package/dist/app/session-shell/session-shell.js +1917 -0
  67. package/dist/app/session-shell/session-viewport-controller.d.ts +61 -0
  68. package/dist/app/session-shell/session-viewport-controller.js +597 -0
  69. package/dist/app/session-shell/stream-presentation-coalescer.d.ts +29 -0
  70. package/dist/app/session-shell/stream-presentation-coalescer.js +79 -0
  71. package/dist/app/session-shell/system-clipboard.d.ts +20 -0
  72. package/dist/app/session-shell/system-clipboard.js +159 -0
  73. package/dist/app/session-shell/text-paste.d.ts +5 -0
  74. package/dist/app/session-shell/text-paste.js +16 -0
  75. package/dist/cli/capabilities.d.ts +6 -0
  76. package/dist/cli/capabilities.js +7 -0
  77. package/dist/cli/dispatch.d.ts +46 -0
  78. package/dist/cli/dispatch.js +261 -0
  79. package/dist/cli/index.d.ts +8 -0
  80. package/dist/cli/index.js +4 -0
  81. package/dist/cli/package-messages.d.ts +26 -0
  82. package/dist/cli/package-messages.js +71 -0
  83. package/dist/cli/packages.d.ts +32 -0
  84. package/dist/cli/packages.js +81 -0
  85. package/dist/cli/version-stats.d.ts +22 -0
  86. package/dist/cli/version-stats.js +112 -0
  87. package/dist/composition/index.d.ts +2 -0
  88. package/dist/composition/index.js +2 -0
  89. package/dist/composition/owned-ui.d.ts +37 -0
  90. package/dist/composition/owned-ui.js +136 -0
  91. package/dist/composition/settings-route-host.d.ts +7 -0
  92. package/dist/composition/settings-route-host.js +110 -0
  93. package/dist/contracts/agent-engine/capability-ports.d.ts +95 -0
  94. package/dist/contracts/agent-engine/domain-validation.js +107 -0
  95. package/dist/contracts/agent-engine/domain.d.ts +138 -0
  96. package/dist/contracts/agent-engine/index.d.ts +11 -0
  97. package/dist/contracts/agent-engine/index.js +6 -0
  98. package/dist/contracts/agent-engine/package-ports.d.ts +60 -0
  99. package/dist/contracts/agent-engine/ports.js +1 -0
  100. package/dist/contracts/owned-ui/extension-ui.d.ts +310 -0
  101. package/dist/contracts/owned-ui/image-attachments.d.ts +36 -0
  102. package/dist/contracts/owned-ui/image-attachments.js +67 -0
  103. package/dist/contracts/owned-ui/index.d.ts +12 -0
  104. package/dist/contracts/owned-ui/index.js +8 -0
  105. package/dist/contracts/owned-ui/model.d.ts +378 -0
  106. package/dist/contracts/owned-ui/prompt-history.d.ts +55 -0
  107. package/dist/contracts/owned-ui/prompt-history.js +23 -0
  108. package/dist/contracts/owned-ui/prompt-suggestions.d.ts +3 -0
  109. package/dist/contracts/owned-ui/prompt-suggestions.js +44 -0
  110. package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +22 -0
  111. package/dist/contracts/owned-ui/suggestion-diagnostics.js +9 -0
  112. package/dist/contracts/owned-ui/transcript-lifecycle.d.ts +5 -0
  113. package/dist/contracts/owned-ui/transcript-lifecycle.js +33 -0
  114. package/dist/contracts/owned-ui/validation.d.ts +15 -0
  115. package/dist/contracts/owned-ui/validation.js +523 -0
  116. package/dist/contracts/presentation/index.d.ts +104 -0
  117. package/dist/features/launch/development-launch.js +36 -0
  118. package/dist/features/launch/index.d.ts +12 -0
  119. package/dist/features/launch/index.js +6 -0
  120. package/dist/features/launch/intent.d.ts +12 -0
  121. package/dist/features/launch/intent.js +8 -0
  122. package/dist/features/launch/prepare-launch.d.ts +11 -0
  123. package/dist/features/launch/prepare-launch.js +14 -0
  124. package/dist/features/launch/profile-paths.d.ts +16 -0
  125. package/dist/features/launch/profile-paths.js +36 -0
  126. package/dist/features/launch/runtime-selection.d.ts +16 -0
  127. package/dist/features/launch/runtime-selection.js +13 -0
  128. package/dist/features/owned-ui/index.d.ts +6 -0
  129. package/dist/features/owned-ui/index.js +4 -0
  130. package/dist/features/owned-ui/project-trust-prompt.d.ts +25 -0
  131. package/dist/features/owned-ui/project-trust-prompt.js +149 -0
  132. package/dist/features/owned-ui/run.d.ts +17 -0
  133. package/dist/features/owned-ui/run.js +64 -0
  134. package/dist/features/owned-ui/session-fork-prompt.d.ts +8 -0
  135. package/dist/features/owned-ui/session-fork-prompt.js +34 -0
  136. package/dist/features/owned-ui/settings-app.d.ts +21 -0
  137. package/dist/features/owned-ui/settings-app.js +807 -0
  138. package/dist/features/owned-ui/settings-route.d.ts +2 -0
  139. package/dist/features/owned-ui/settings-route.js +2 -0
  140. package/dist/features/prompt-history/image-sidecar.d.ts +32 -0
  141. package/dist/features/prompt-history/image-sidecar.js +130 -0
  142. package/dist/features/prompt-history/index.d.ts +4 -0
  143. package/dist/features/prompt-history/index.js +3 -0
  144. package/dist/features/prompt-history/paths.d.ts +5 -0
  145. package/dist/features/prompt-history/paths.js +17 -0
  146. package/dist/features/prompt-history/service.d.ts +54 -0
  147. package/dist/features/prompt-history/service.js +425 -0
  148. package/dist/features/prompt-history/store.d.ts +16 -0
  149. package/dist/features/prompt-history/store.js +219 -0
  150. package/dist/features/prompt-history/worker.d.ts +9 -0
  151. package/dist/features/prompt-history/worker.js +45 -0
  152. package/dist/features/prompt-suggestions/diagnostics.d.ts +18 -0
  153. package/dist/features/prompt-suggestions/diagnostics.js +82 -0
  154. package/dist/features/prompt-suggestions/index.d.ts +2 -0
  155. package/dist/features/prompt-suggestions/index.js +1 -0
  156. package/dist/foundation/launch-context/index.d.ts +59 -0
  157. package/dist/foundation/launch-context/index.js +136 -0
  158. package/dist/foundation/launch-guardian/index.d.ts +2 -0
  159. package/dist/foundation/launch-guardian/index.js +1 -0
  160. package/dist/foundation/launch-guardian/main.d.ts +33 -0
  161. package/dist/foundation/launch-guardian/main.js +180 -0
  162. package/dist/foundation/lifecycle/commands.js +1 -0
  163. package/dist/foundation/lifecycle/index.d.ts +11 -0
  164. package/dist/foundation/lifecycle/index.js +5 -0
  165. package/dist/foundation/lifecycle/model.d.ts +64 -0
  166. package/dist/foundation/lifecycle/model.js +40 -0
  167. package/dist/foundation/lifecycle/paths.d.ts +30 -0
  168. package/dist/foundation/lifecycle/paths.js +70 -0
  169. package/dist/foundation/lifecycle/session-selection.d.ts +9 -0
  170. package/dist/foundation/lifecycle/session-selection.js +39 -0
  171. package/dist/foundation/lifecycle/supervisor-startup.d.ts +30 -0
  172. package/dist/foundation/lifecycle/supervisor-startup.js +106 -0
  173. package/dist/foundation/process-containment/darwin-process-inspector.d.ts +5 -0
  174. package/dist/foundation/process-containment/darwin-process-inspector.js +7 -0
  175. package/dist/foundation/process-containment/index.d.ts +8 -0
  176. package/dist/foundation/process-containment/index.js +6 -0
  177. package/dist/foundation/process-containment/linux-process-inspector.d.ts +7 -0
  178. package/dist/foundation/process-containment/linux-process-inspector.js +27 -0
  179. package/dist/foundation/process-containment/native-guardian-containment.d.ts +17 -0
  180. package/dist/foundation/process-containment/native-guardian-containment.js +140 -0
  181. package/dist/foundation/process-containment/windows-process-inspector.d.ts +19 -0
  182. package/dist/foundation/process-containment/windows-process-inspector.js +56 -0
  183. package/dist/foundation/protocol/client.d.ts +18 -0
  184. package/dist/foundation/protocol/client.js +130 -0
  185. package/dist/foundation/protocol/index.d.ts +3 -0
  186. package/dist/foundation/protocol/index.js +2 -0
  187. package/dist/foundation/protocol/messages.d.ts +90 -0
  188. package/dist/foundation/protocol/messages.js +100 -0
  189. package/dist/foundation/release/bootstrap.d.ts +51 -0
  190. package/dist/foundation/release/bootstrap.js +427 -0
  191. package/dist/foundation/release/cohort-state.d.ts +157 -0
  192. package/dist/foundation/release/cohort-state.js +472 -0
  193. package/dist/foundation/release/dependency-certification-retention.d.ts +7 -0
  194. package/dist/foundation/release/dependency-certification-retention.js +88 -0
  195. package/dist/foundation/release/dependency-certification.d.ts +24 -0
  196. package/dist/foundation/release/dependency-certification.js +266 -0
  197. package/dist/foundation/release/dependency-layer.d.ts +78 -0
  198. package/dist/foundation/release/dependency-layer.js +466 -0
  199. package/dist/foundation/release/endpoints.d.ts +24 -0
  200. package/dist/foundation/release/endpoints.js +134 -0
  201. package/dist/foundation/release/immutable-platform.d.ts +6 -0
  202. package/dist/foundation/release/immutable-platform.js +13 -0
  203. package/dist/foundation/release/index.d.ts +32 -0
  204. package/dist/foundation/release/index.js +17 -0
  205. package/dist/foundation/release/release-gc.d.ts +71 -0
  206. package/dist/foundation/release/release-gc.js +764 -0
  207. package/dist/foundation/release/release-store.d.ts +49 -0
  208. package/dist/foundation/release/release-store.js +235 -0
  209. package/dist/foundation/release/release.d.ts +43 -0
  210. package/dist/foundation/release/release.js +215 -0
  211. package/dist/foundation/release/restart-certification.d.ts +68 -0
  212. package/dist/foundation/release/restart-certification.js +227 -0
  213. package/dist/foundation/release/types.d.ts +11 -0
  214. package/dist/foundation/release/types.js +1 -0
  215. package/dist/foundation/release/update-activation.d.ts +72 -0
  216. package/dist/foundation/release/update-activation.js +204 -0
  217. package/dist/foundation/release/update-launch.d.ts +6 -0
  218. package/dist/foundation/release/update-launch.js +17 -0
  219. package/dist/foundation/release/update-recovery.d.ts +76 -0
  220. package/dist/foundation/release/update-recovery.js +356 -0
  221. package/dist/foundation/release/update-transaction.d.ts +42 -0
  222. package/dist/foundation/release/update-transaction.js +101 -0
  223. package/dist/foundation/release/update.d.ts +114 -0
  224. package/dist/foundation/release/update.js +633 -0
  225. package/dist/foundation/release/warmup.d.ts +3 -0
  226. package/dist/foundation/release/warmup.js +47 -0
  227. package/dist/foundation/startup/index.d.ts +4 -0
  228. package/dist/foundation/startup/index.js +2 -0
  229. package/dist/foundation/startup/startup-budget.d.ts +46 -0
  230. package/dist/foundation/startup/startup-budget.js +42 -0
  231. package/dist/foundation/startup/startup-descriptor.js +34 -0
  232. package/dist/foundation/startup/startup-runtime.d.ts +27 -0
  233. package/dist/foundation/startup/startup-runtime.js +128 -0
  234. package/dist/foundation/storage/control-store.d.ts +18 -0
  235. package/dist/foundation/storage/control-store.js +342 -0
  236. package/dist/foundation/storage/index.d.ts +1 -0
  237. package/dist/foundation/storage/index.js +1 -0
  238. package/dist/foundation/supervision/index.d.ts +3 -0
  239. package/dist/foundation/supervision/index.js +3 -0
  240. package/dist/foundation/supervision/main.d.ts +1 -0
  241. package/dist/foundation/supervision/main.js +84 -0
  242. package/dist/foundation/supervision/paths.d.ts +1 -0
  243. package/dist/foundation/supervision/paths.js +1 -0
  244. package/dist/foundation/supervision/server.d.ts +46 -0
  245. package/dist/foundation/supervision/server.js +573 -0
  246. package/dist/foundation/terminal-cleanup/fatal-exit.d.ts +12 -0
  247. package/dist/foundation/terminal-cleanup/fatal-exit.js +87 -0
  248. package/dist/foundation/terminal-cleanup/index.d.ts +3 -0
  249. package/dist/foundation/terminal-cleanup/index.js +2 -0
  250. package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +4 -0
  251. package/dist/foundation/terminal-cleanup/terminal-reset.js +40 -0
  252. package/dist/integrations/pi/components/components.d.ts +4 -0
  253. package/dist/integrations/pi/components/components.js +64 -0
  254. package/dist/integrations/pi/components/conformance.d.ts +18 -0
  255. package/dist/integrations/pi/components/conformance.js +70 -0
  256. package/dist/integrations/pi/components/editor-interaction.d.ts +38 -0
  257. package/dist/integrations/pi/components/editor-interaction.js +1 -0
  258. package/dist/integrations/pi/components/history-editor-loader.d.ts +5 -0
  259. package/dist/integrations/pi/components/history-editor-loader.js +5 -0
  260. package/dist/integrations/pi/components/index.d.ts +21 -0
  261. package/dist/integrations/pi/components/index.js +13 -0
  262. package/dist/integrations/pi/components/owned-editor-ux.d.ts +74 -0
  263. package/dist/integrations/pi/components/owned-editor-ux.js +1094 -0
  264. package/dist/integrations/pi/components/path-word-ranges.d.ts +2 -0
  265. package/dist/integrations/pi/components/path-word-ranges.js +37 -0
  266. package/dist/integrations/pi/components/prompt-input-port.d.ts +18 -0
  267. package/dist/integrations/pi/components/prompt-input-port.js +1 -0
  268. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +167 -0
  269. package/dist/integrations/pi/components/resources/builtin-themes.js +168 -0
  270. package/dist/integrations/pi/components/shell-components.d.ts +7 -0
  271. package/dist/integrations/pi/components/shell-components.js +7 -0
  272. package/dist/integrations/pi/components/shell-editor-autocomplete.js +298 -0
  273. package/dist/integrations/pi/components/shell-extension-ui.d.ts +35 -0
  274. package/dist/integrations/pi/components/shell-extension-ui.js +280 -0
  275. package/dist/integrations/pi/components/shell-footer-status.d.ts +7 -0
  276. package/dist/integrations/pi/components/shell-footer-status.js +248 -0
  277. package/dist/integrations/pi/components/shell-presenters-info.d.ts +43 -0
  278. package/dist/integrations/pi/components/shell-presenters-info.js +114 -0
  279. package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +29 -0
  280. package/dist/integrations/pi/components/shell-presenters-transcript.js +433 -0
  281. package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +123 -0
  282. package/dist/integrations/pi/components/shell-selectors-dialogs.js +242 -0
  283. package/dist/integrations/pi/components/shell-shared-facade.d.ts +217 -0
  284. package/dist/integrations/pi/components/shell-shared-facade.js +92 -0
  285. package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +17 -0
  286. package/dist/integrations/pi/components/submitted-prompt-adapter.js +49 -0
  287. package/dist/integrations/pi/components/tool-image-presentation.d.ts +21 -0
  288. package/dist/integrations/pi/components/tool-image-presentation.js +83 -0
  289. package/dist/integrations/pi/components/tool-result-adapter.d.ts +6 -0
  290. package/dist/integrations/pi/components/tool-result-adapter.js +27 -0
  291. package/dist/integrations/pi/components/transcript-image-resolver.d.ts +7 -0
  292. package/dist/integrations/pi/components/transcript-image-resolver.js +19 -0
  293. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +445 -0
  294. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +370 -0
  295. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +12 -0
  296. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +13 -0
  297. package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +29 -0
  298. package/dist/integrations/pi/components/upstream/components/daxnuts.js +146 -0
  299. package/dist/integrations/pi/components/upstream/components/earendil-announcement.d.ts +4 -0
  300. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +48 -0
  301. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +20 -0
  302. package/dist/integrations/pi/components/upstream/components/extension-editor.js +84 -0
  303. package/dist/integrations/pi/components/upstream/components/mermaid.js +81 -0
  304. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +46 -0
  305. package/dist/integrations/pi/components/upstream/components/owned-editor.js +187 -0
  306. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +59 -0
  307. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +346 -0
  308. package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +11 -0
  309. package/dist/integrations/pi/components/upstream/components/session-footer.js +123 -0
  310. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +161 -0
  311. package/dist/integrations/pi/components/upstream/components/session-selector.d.ts +95 -0
  312. package/dist/integrations/pi/components/upstream/components/session-selector.js +893 -0
  313. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +21 -0
  314. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +46 -0
  315. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +35 -0
  316. package/dist/integrations/pi/components/upstream/components/status-indicator.js +69 -0
  317. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +67 -0
  318. package/dist/integrations/pi/components/upstream/components/tool-execution.js +365 -0
  319. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +101 -0
  320. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1275 -0
  321. package/dist/integrations/pi/components/upstream/components/trust-selector.d.ts +33 -0
  322. package/dist/integrations/pi/components/upstream/components/trust-selector.js +81 -0
  323. package/dist/integrations/pi/components/upstream/external-editor.js +43 -0
  324. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +289 -0
  325. package/dist/integrations/pi/components/upstream/history/editor-core.js +2144 -0
  326. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +35 -0
  327. package/dist/integrations/pi/components/upstream/history/kill-ring.js +51 -0
  328. package/dist/integrations/pi/components/upstream/history/printable-key.d.ts +1 -0
  329. package/dist/integrations/pi/components/upstream/history/printable-key.js +43 -0
  330. package/dist/integrations/pi/components/upstream/history/text-helpers.d.ts +14 -0
  331. package/dist/integrations/pi/components/upstream/history/text-helpers.js +31 -0
  332. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +25 -0
  333. package/dist/integrations/pi/components/upstream/history/undo-stack.js +39 -0
  334. package/dist/integrations/pi/components/upstream/history/word-navigation.d.ts +24 -0
  335. package/dist/integrations/pi/components/upstream/history/word-navigation.js +103 -0
  336. package/dist/integrations/pi/components/upstream/model-search.d.ts +18 -0
  337. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +33 -0
  338. package/dist/integrations/pi/components/upstream/theme/theme-controller.js +114 -0
  339. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +61 -0
  340. package/dist/integrations/pi/components/upstream/theme/theme.js +337 -0
  341. package/dist/integrations/pi/engine/adapter.d.ts +135 -0
  342. package/dist/integrations/pi/engine/adapter.js +648 -0
  343. package/dist/integrations/pi/engine/changelog.d.ts +2 -0
  344. package/dist/integrations/pi/engine/changelog.js +63 -0
  345. package/dist/integrations/pi/engine/command-dispatch.d.ts +41 -0
  346. package/dist/integrations/pi/engine/command-dispatch.js +125 -0
  347. package/dist/integrations/pi/engine/compaction-progress.d.ts +28 -0
  348. package/dist/integrations/pi/engine/compaction-progress.js +96 -0
  349. package/dist/integrations/pi/engine/conformance.d.ts +39 -0
  350. package/dist/integrations/pi/engine/conformance.js +140 -0
  351. package/dist/integrations/pi/engine/event-delivery.d.ts +100 -0
  352. package/dist/integrations/pi/engine/event-delivery.js +184 -0
  353. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +35 -0
  354. package/dist/integrations/pi/engine/extension-ui-binding.js +81 -0
  355. package/dist/integrations/pi/engine/http-dispatcher.d.ts +4 -0
  356. package/dist/integrations/pi/engine/http-dispatcher.js +25 -0
  357. package/dist/integrations/pi/engine/index.d.ts +18 -0
  358. package/dist/integrations/pi/engine/index.js +10 -0
  359. package/dist/integrations/pi/engine/message-values.d.ts +29 -0
  360. package/dist/integrations/pi/engine/message-values.js +168 -0
  361. package/dist/integrations/pi/engine/package-integration.d.ts +13 -0
  362. package/dist/integrations/pi/engine/package-integration.js +118 -0
  363. package/dist/integrations/pi/engine/pending-delivery.d.ts +30 -0
  364. package/dist/integrations/pi/engine/pending-delivery.js +156 -0
  365. package/dist/integrations/pi/engine/pi-settings-metadata.json +385 -0
  366. package/dist/integrations/pi/engine/project-trust-preflight.d.ts +22 -0
  367. package/dist/integrations/pi/engine/project-trust-preflight.js +50 -0
  368. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +30 -0
  369. package/dist/integrations/pi/engine/prompt-suggestions.js +102 -0
  370. package/dist/integrations/pi/engine/provider-authentication.d.ts +34 -0
  371. package/dist/integrations/pi/engine/provider-authentication.js +209 -0
  372. package/dist/integrations/pi/engine/resource-catalog.d.ts +49 -0
  373. package/dist/integrations/pi/engine/resource-catalog.js +289 -0
  374. package/dist/integrations/pi/engine/resources/changelog.json +12 -0
  375. package/dist/integrations/pi/engine/runtime-integration.d.ts +53 -0
  376. package/dist/integrations/pi/engine/runtime-integration.js +118 -0
  377. package/dist/integrations/pi/engine/session-events.d.ts +48 -0
  378. package/dist/integrations/pi/engine/session-events.js +223 -0
  379. package/dist/integrations/pi/engine/session-integration.d.ts +67 -0
  380. package/dist/integrations/pi/engine/session-integration.js +195 -0
  381. package/dist/integrations/pi/engine/session-runtime.d.ts +84 -0
  382. package/dist/integrations/pi/engine/session-runtime.js +249 -0
  383. package/dist/integrations/pi/engine/session-selection.d.ts +28 -0
  384. package/dist/integrations/pi/engine/session-selection.js +90 -0
  385. package/dist/integrations/pi/engine/settings-bridge.d.ts +121 -0
  386. package/dist/integrations/pi/engine/settings-bridge.js +514 -0
  387. package/dist/integrations/pi/engine/settings-metadata.d.ts +31 -0
  388. package/dist/integrations/pi/engine/settings-metadata.js +67 -0
  389. package/dist/integrations/pi/engine/settings-port.d.ts +42 -0
  390. package/dist/integrations/pi/engine/settings-port.js +353 -0
  391. package/dist/integrations/pi/engine/tool-rendering.d.ts +13 -0
  392. package/dist/integrations/pi/engine/tool-rendering.js +145 -0
  393. package/dist/integrations/pi/engine/transcript-image-assets.d.ts +11 -0
  394. package/dist/integrations/pi/engine/transcript-image-assets.js +86 -0
  395. package/dist/integrations/pi/engine/transcript-projection.d.ts +39 -0
  396. package/dist/integrations/pi/engine/transcript-projection.js +405 -0
  397. package/dist/integrations/pi/engine/usage-view.d.ts +4 -0
  398. package/dist/integrations/pi/engine/usage-view.js +56 -0
  399. package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +21 -0
  400. package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +55 -0
  401. package/dist/integrations/pi/engine/workflow-contexts.d.ts +59 -0
  402. package/dist/integrations/pi/engine/workflow-contexts.js +316 -0
  403. package/dist/integrations/pi/engine/workflow-runner.d.ts +60 -0
  404. package/dist/integrations/pi/engine/workflow-runner.js +509 -0
  405. package/dist/integrations/pi/engine/workflow-support.d.ts +33 -0
  406. package/dist/integrations/pi/engine/workflow-support.js +352 -0
  407. package/dist/integrations/pi/engine/workflows.d.ts +251 -0
  408. package/dist/integrations/pi/engine/workflows.js +63 -0
  409. package/dist/integrations/pi/startup-public.d.ts +2 -0
  410. package/dist/integrations/pi/startup-public.js +2223 -0
  411. package/dist/integrations/pi/startup-public.manifest.json +12502 -0
  412. package/dist/integrations/pi/tui-runtime/adapter.d.ts +56 -0
  413. package/dist/integrations/pi/tui-runtime/adapter.js +783 -0
  414. package/dist/integrations/pi/tui-runtime/contracts.d.ts +156 -0
  415. package/dist/integrations/pi/tui-runtime/contracts.js +1 -0
  416. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +88 -0
  417. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +433 -0
  418. package/dist/integrations/pi/tui-runtime/index.d.ts +9 -0
  419. package/dist/integrations/pi/tui-runtime/index.js +5 -0
  420. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +39 -0
  421. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.js +139 -0
  422. package/dist/integrations/pi/tui-runtime/mouse-report-input.d.ts +13 -0
  423. package/dist/integrations/pi/tui-runtime/mouse-report-input.js +57 -0
  424. package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +32 -0
  425. package/dist/integrations/pi/tui-runtime/overlay-geometry.js +158 -0
  426. package/dist/integrations/pi/tui-runtime/presentation-adapter.d.ts +4 -0
  427. package/dist/integrations/pi/tui-runtime/presentation-adapter.js +48 -0
  428. package/dist/native/darwin-arm64/manifest.json +4 -4
  429. package/dist/native/darwin-arm64/process-guardian +0 -0
  430. package/dist/native/linux-x64/manifest.json +3 -3
  431. package/dist/native/linux-x64/process-guardian +0 -0
  432. package/dist/native/win32-x64/manifest.json +3 -3
  433. package/dist/native/win32-x64/process-guardian.exe +0 -0
  434. package/dist/product-identity.d.ts +37 -0
  435. package/dist/product-identity.js +119 -0
  436. package/dist/product-identity.json +85 -0
  437. package/dist/runtime-payload-inventory.json +127148 -0
  438. package/dist/ui/apps/contracts.d.ts +64 -0
  439. package/dist/ui/apps/host.d.ts +42 -0
  440. package/dist/ui/apps/host.js +156 -0
  441. package/dist/ui/apps/index.d.ts +5 -0
  442. package/dist/ui/apps/index.js +3 -0
  443. package/dist/ui/apps/registry.d.ts +12 -0
  444. package/dist/ui/apps/registry.js +33 -0
  445. package/dist/ui/components/dialog-panel.js +49 -0
  446. package/dist/ui/components/frame.d.ts +22 -0
  447. package/dist/ui/components/frame.js +55 -0
  448. package/dist/ui/components/index.d.ts +47 -0
  449. package/dist/ui/components/index.js +25 -0
  450. package/dist/ui/components/line-input.d.ts +68 -0
  451. package/dist/ui/components/line-input.js +224 -0
  452. package/dist/ui/components/list-view.d.ts +60 -0
  453. package/dist/ui/components/list-view.js +82 -0
  454. package/dist/ui/components/mouse.d.ts +25 -0
  455. package/dist/ui/components/mouse.js +70 -0
  456. package/dist/ui/components/progress-status.d.ts +2 -0
  457. package/dist/ui/components/progress-status.js +4 -0
  458. package/dist/ui/components/prompt-input.d.ts +32 -0
  459. package/dist/ui/components/prompt-input.js +51 -0
  460. package/dist/ui/components/scrollbar.d.ts +88 -0
  461. package/dist/ui/components/scrollbar.js +137 -0
  462. package/dist/ui/components/selection-copy.d.ts +24 -0
  463. package/dist/ui/components/selection-copy.js +39 -0
  464. package/dist/ui/components/shortcuts.d.ts +58 -0
  465. package/dist/ui/components/shortcuts.js +82 -0
  466. package/dist/ui/components/spans.d.ts +28 -0
  467. package/dist/ui/components/spans.js +266 -0
  468. package/dist/ui/components/submitted-prompt.d.ts +23 -0
  469. package/dist/ui/components/submitted-prompt.js +50 -0
  470. package/dist/ui/components/surface.d.ts +20 -0
  471. package/dist/ui/components/surface.js +44 -0
  472. package/dist/ui/components/text-selection.d.ts +62 -0
  473. package/dist/ui/components/text-selection.js +210 -0
  474. package/dist/ui/components/text.d.ts +38 -0
  475. package/dist/ui/components/text.js +185 -0
  476. package/dist/ui/components/transcript-viewport.d.ts +173 -0
  477. package/dist/ui/components/transcript-viewport.js +753 -0
  478. package/dist/ui/components/visible-hyperlinks.d.ts +26 -0
  479. package/dist/ui/components/visible-hyperlinks.js +97 -0
  480. package/dist/ui/settings/declarations.d.ts +141 -0
  481. package/dist/ui/settings/declarations.js +135 -0
  482. package/dist/ui/settings/index.d.ts +10 -0
  483. package/dist/ui/settings/index.js +5 -0
  484. package/dist/ui/settings/manager.d.ts +54 -0
  485. package/dist/ui/settings/manager.js +256 -0
  486. package/dist/ui/settings/migrations.d.ts +13 -0
  487. package/dist/ui/settings/migrations.js +74 -0
  488. package/dist/ui/settings/sections.d.ts +52 -0
  489. package/dist/ui/settings/sections.js +112 -0
  490. package/docs/architecture/boundaries.md +17 -13
  491. package/docs/architecture/code-documentation.md +77 -0
  492. package/docs/architecture/history-editor-provenance.md +100 -0
  493. package/docs/architecture/internal-naming.md +93 -0
  494. package/docs/architecture/process-guardian-provenance.md +3 -1
  495. package/docs/architecture/project-structure.md +69 -30
  496. package/docs/architecture/prompt-suggestions.md +68 -0
  497. package/docs/architecture/resource-and-data-policy.md +28 -2
  498. package/docs/architecture/response-copy-delivery.md +85 -0
  499. package/docs/architecture/terminal-host-proof-gate.md +1 -1
  500. package/docs/architecture/terminal-host-spike-evidence.md +1 -1
  501. package/docs/architecture/tool-image-presentation.md +62 -0
  502. package/docs/architecture/toolchain.md +32 -10
  503. package/docs/architecture/ui-reference-provenance.md +60 -6
  504. package/docs/ci-release-runbook.md +256 -79
  505. package/docs/features/launch-profiles.md +24 -17
  506. package/docs/features/modal-content-interaction.md +37 -0
  507. package/docs/features/prompt-history.md +149 -0
  508. package/docs/local-worktree-cleanup.md +212 -0
  509. package/docs/manual-code-streaming-cleanup.md +88 -0
  510. package/docs/manual-ghost-link-baseline.md +89 -0
  511. package/docs/manual-launch-instance-acceptance.md +12 -35
  512. package/docs/manual-owned-ui-checkpoint.md +79 -0
  513. package/docs/manual-pi-boundary-candidate.md +4 -5
  514. package/docs/manual-terminal-colour-check.md +4 -3
  515. package/docs/openspec-archive-automation.md +259 -0
  516. package/docs/repository-governance-live-acceptance.md +77 -0
  517. package/docs/validation.md +100 -0
  518. package/package.json +52 -34
  519. package/dist/src/cli/capabilities.d.ts +0 -15
  520. package/dist/src/cli/capabilities.js +0 -7
  521. package/dist/src/cli/dispatch.d.ts +0 -32
  522. package/dist/src/cli/dispatch.js +0 -142
  523. package/dist/src/cli/index.d.ts +0 -5
  524. package/dist/src/cli/index.js +0 -5
  525. package/dist/src/cli/packages.d.ts +0 -23
  526. package/dist/src/cli/packages.js +0 -84
  527. package/dist/src/cli/version-stats.d.ts +0 -16
  528. package/dist/src/cli/version-stats.js +0 -72
  529. package/dist/src/cli/version.d.ts +0 -2
  530. package/dist/src/cli/version.js +0 -23
  531. package/dist/src/composition/index.d.ts +0 -48
  532. package/dist/src/composition/index.js +0 -258
  533. package/dist/src/features/launch/development-launch.js +0 -28
  534. package/dist/src/features/launch/index.d.ts +0 -7
  535. package/dist/src/features/launch/index.js +0 -7
  536. package/dist/src/features/launch/intent.d.ts +0 -7
  537. package/dist/src/features/launch/intent.js +0 -4
  538. package/dist/src/features/launch/prepare-launch.d.ts +0 -13
  539. package/dist/src/features/launch/prepare-launch.js +0 -21
  540. package/dist/src/features/launch/profile-paths.d.ts +0 -15
  541. package/dist/src/features/launch/profile-paths.js +0 -31
  542. package/dist/src/features/launch/profiles.d.ts +0 -12
  543. package/dist/src/features/launch/profiles.js +0 -26
  544. package/dist/src/features/launch/runtime-selection.d.ts +0 -19
  545. package/dist/src/features/launch/runtime-selection.js +0 -13
  546. package/dist/src/features/owned-ui/customization.d.ts +0 -38
  547. package/dist/src/features/owned-ui/customization.js +0 -108
  548. package/dist/src/features/owned-ui/diagnostics.d.ts +0 -33
  549. package/dist/src/features/owned-ui/diagnostics.js +0 -94
  550. package/dist/src/features/owned-ui/index.d.ts +0 -4
  551. package/dist/src/features/owned-ui/index.js +0 -4
  552. package/dist/src/features/owned-ui/run.d.ts +0 -11
  553. package/dist/src/features/owned-ui/run.js +0 -15
  554. package/dist/src/features/owned-ui/settings-app.d.ts +0 -22
  555. package/dist/src/features/owned-ui/settings-app.js +0 -633
  556. package/dist/src/features/workspace/capabilities.d.ts +0 -31
  557. package/dist/src/features/workspace/capabilities.js +0 -75
  558. package/dist/src/features/workspace/index.d.ts +0 -6
  559. package/dist/src/features/workspace/index.js +0 -6
  560. package/dist/src/features/workspace/presentation.d.ts +0 -30
  561. package/dist/src/features/workspace/presentation.js +0 -70
  562. package/dist/src/features/workspace/reconciliation.d.ts +0 -15
  563. package/dist/src/features/workspace/reconciliation.js +0 -82
  564. package/dist/src/features/workspace/reducer.d.ts +0 -42
  565. package/dist/src/features/workspace/reducer.js +0 -213
  566. package/dist/src/features/workspace/router.d.ts +0 -31
  567. package/dist/src/features/workspace/router.js +0 -124
  568. package/dist/src/features/workspace/store.d.ts +0 -17
  569. package/dist/src/features/workspace/store.js +0 -54
  570. package/dist/src/foundation/agent-engine-contracts/capability-ports.d.ts +0 -95
  571. package/dist/src/foundation/agent-engine-contracts/domain-validation.js +0 -89
  572. package/dist/src/foundation/agent-engine-contracts/domain.d.ts +0 -116
  573. package/dist/src/foundation/agent-engine-contracts/index.d.ts +0 -8
  574. package/dist/src/foundation/agent-engine-contracts/index.js +0 -8
  575. package/dist/src/foundation/agent-engine-contracts/package-ports.d.ts +0 -54
  576. package/dist/src/foundation/launch-guardian/index.d.ts +0 -1
  577. package/dist/src/foundation/launch-guardian/index.js +0 -1
  578. package/dist/src/foundation/launch-guardian/main.d.ts +0 -31
  579. package/dist/src/foundation/launch-guardian/main.js +0 -165
  580. package/dist/src/foundation/lifecycle/index.d.ts +0 -4
  581. package/dist/src/foundation/lifecycle/index.js +0 -4
  582. package/dist/src/foundation/lifecycle/model.d.ts +0 -64
  583. package/dist/src/foundation/lifecycle/model.js +0 -40
  584. package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
  585. package/dist/src/foundation/lifecycle/paths.js +0 -42
  586. package/dist/src/foundation/native-host-protocol/codec.d.ts +0 -11
  587. package/dist/src/foundation/native-host-protocol/codec.js +0 -56
  588. package/dist/src/foundation/native-host-protocol/evidence.d.ts +0 -67
  589. package/dist/src/foundation/native-host-protocol/evidence.js +0 -141
  590. package/dist/src/foundation/native-host-protocol/index.d.ts +0 -4
  591. package/dist/src/foundation/native-host-protocol/index.js +0 -4
  592. package/dist/src/foundation/native-host-protocol/messages.d.ts +0 -56
  593. package/dist/src/foundation/native-host-protocol/messages.js +0 -149
  594. package/dist/src/foundation/native-host-protocol/proof-gate.d.ts +0 -13
  595. package/dist/src/foundation/native-host-protocol/proof-gate.js +0 -33
  596. package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts +0 -302
  597. package/dist/src/foundation/owned-ui-contracts/index.d.ts +0 -3
  598. package/dist/src/foundation/owned-ui-contracts/index.js +0 -3
  599. package/dist/src/foundation/owned-ui-contracts/model.d.ts +0 -241
  600. package/dist/src/foundation/owned-ui-contracts/validation.d.ts +0 -11
  601. package/dist/src/foundation/owned-ui-contracts/validation.js +0 -395
  602. package/dist/src/foundation/owned-ui-settings/declarations.d.ts +0 -13
  603. package/dist/src/foundation/owned-ui-settings/declarations.js +0 -39
  604. package/dist/src/foundation/owned-ui-settings/index.d.ts +0 -6
  605. package/dist/src/foundation/owned-ui-settings/index.js +0 -6
  606. package/dist/src/foundation/owned-ui-settings/migrations.d.ts +0 -13
  607. package/dist/src/foundation/owned-ui-settings/migrations.js +0 -28
  608. package/dist/src/foundation/owned-ui-settings/sections.d.ts +0 -70
  609. package/dist/src/foundation/owned-ui-settings/sections.js +0 -93
  610. package/dist/src/foundation/owned-ui-settings/session.d.ts +0 -44
  611. package/dist/src/foundation/owned-ui-settings/session.js +0 -145
  612. package/dist/src/foundation/owned-ui-settings/store.d.ts +0 -28
  613. package/dist/src/foundation/owned-ui-settings/store.js +0 -90
  614. package/dist/src/foundation/pi-component-adapter/components.d.ts +0 -4
  615. package/dist/src/foundation/pi-component-adapter/components.js +0 -64
  616. package/dist/src/foundation/pi-component-adapter/conformance.d.ts +0 -17
  617. package/dist/src/foundation/pi-component-adapter/conformance.js +0 -69
  618. package/dist/src/foundation/pi-component-adapter/index.d.ts +0 -13
  619. package/dist/src/foundation/pi-component-adapter/index.js +0 -13
  620. package/dist/src/foundation/pi-component-adapter/resources/builtin-themes.d.ts +0 -165
  621. package/dist/src/foundation/pi-component-adapter/resources/builtin-themes.js +0 -166
  622. package/dist/src/foundation/pi-component-adapter/shell-components.d.ts +0 -6
  623. package/dist/src/foundation/pi-component-adapter/shell-components.js +0 -6
  624. package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +0 -162
  625. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts +0 -35
  626. package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js +0 -279
  627. package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts +0 -7
  628. package/dist/src/foundation/pi-component-adapter/shell-footer-status.js +0 -189
  629. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +0 -57
  630. package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js +0 -429
  631. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts +0 -113
  632. package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js +0 -235
  633. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +0 -116
  634. package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js +0 -87
  635. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts +0 -422
  636. package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js +0 -296
  637. package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts +0 -10
  638. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts +0 -17
  639. package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js +0 -51
  640. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts +0 -22
  641. package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js +0 -142
  642. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts +0 -4
  643. package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +0 -19
  644. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts +0 -17
  645. package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js +0 -81
  646. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts +0 -24
  647. package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js +0 -105
  648. package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts +0 -2
  649. package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js +0 -18
  650. package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js +0 -77
  651. package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.d.ts +0 -18
  652. package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.js +0 -55
  653. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts +0 -55
  654. package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js +0 -342
  655. package/dist/src/foundation/pi-component-adapter/upstream/components/session-footer.d.ts +0 -10
  656. package/dist/src/foundation/pi-component-adapter/upstream/components/session-footer.js +0 -120
  657. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js +0 -159
  658. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts +0 -95
  659. package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js +0 -889
  660. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts +0 -19
  661. package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js +0 -44
  662. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts +0 -30
  663. package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js +0 -59
  664. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts +0 -98
  665. package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js +0 -1272
  666. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts +0 -33
  667. package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js +0 -76
  668. package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js +0 -39
  669. package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts +0 -15
  670. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts +0 -25
  671. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js +0 -117
  672. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts +0 -61
  673. package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js +0 -326
  674. package/dist/src/foundation/pi-engine-adapter/adapter.d.ts +0 -164
  675. package/dist/src/foundation/pi-engine-adapter/adapter.js +0 -2367
  676. package/dist/src/foundation/pi-engine-adapter/conformance.d.ts +0 -37
  677. package/dist/src/foundation/pi-engine-adapter/conformance.js +0 -130
  678. package/dist/src/foundation/pi-engine-adapter/index.d.ts +0 -10
  679. package/dist/src/foundation/pi-engine-adapter/index.js +0 -10
  680. package/dist/src/foundation/pi-engine-adapter/model-auth-integration.d.ts +0 -30
  681. package/dist/src/foundation/pi-engine-adapter/model-auth-integration.js +0 -61
  682. package/dist/src/foundation/pi-engine-adapter/package-integration.d.ts +0 -13
  683. package/dist/src/foundation/pi-engine-adapter/package-integration.js +0 -112
  684. package/dist/src/foundation/pi-engine-adapter/pi-settings-metadata.json +0 -374
  685. package/dist/src/foundation/pi-engine-adapter/resource-extension-integration.d.ts +0 -31
  686. package/dist/src/foundation/pi-engine-adapter/resource-extension-integration.js +0 -80
  687. package/dist/src/foundation/pi-engine-adapter/runtime-integration.d.ts +0 -35
  688. package/dist/src/foundation/pi-engine-adapter/runtime-integration.js +0 -67
  689. package/dist/src/foundation/pi-engine-adapter/session-integration.d.ts +0 -43
  690. package/dist/src/foundation/pi-engine-adapter/session-integration.js +0 -97
  691. package/dist/src/foundation/pi-engine-adapter/settings-integration.d.ts +0 -55
  692. package/dist/src/foundation/pi-engine-adapter/settings-integration.js +0 -233
  693. package/dist/src/foundation/pi-engine-adapter/workflow-controllers.d.ts +0 -20
  694. package/dist/src/foundation/pi-engine-adapter/workflow-controllers.js +0 -48
  695. package/dist/src/foundation/pi-engine-adapter/workflows.d.ts +0 -173
  696. package/dist/src/foundation/pi-engine-adapter/workflows.js +0 -60
  697. package/dist/src/foundation/pi-owned-ui-integration/index.d.ts +0 -2
  698. package/dist/src/foundation/pi-owned-ui-integration/index.js +0 -2
  699. package/dist/src/foundation/pi-owned-ui-integration/route-host.d.ts +0 -29
  700. package/dist/src/foundation/pi-owned-ui-integration/session-shell.d.ts +0 -106
  701. package/dist/src/foundation/pi-owned-ui-integration/session-shell.js +0 -1518
  702. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts +0 -39
  703. package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js +0 -493
  704. package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts +0 -18
  705. package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js +0 -145
  706. package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts +0 -120
  707. package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +0 -4
  708. package/dist/src/foundation/pi-tui-runtime-adapter/index.js +0 -4
  709. package/dist/src/foundation/pi-tui-runtime-adapter/presentation-adapter.d.ts +0 -4
  710. package/dist/src/foundation/pi-tui-runtime-adapter/presentation-adapter.js +0 -48
  711. package/dist/src/foundation/presentation-contracts/index.d.ts +0 -96
  712. package/dist/src/foundation/process-containment/index.d.ts +0 -5
  713. package/dist/src/foundation/process-containment/index.js +0 -5
  714. package/dist/src/foundation/process-containment/linux-process-inspector.d.ts +0 -6
  715. package/dist/src/foundation/process-containment/linux-process-inspector.js +0 -26
  716. package/dist/src/foundation/process-containment/native-guardian-containment.d.ts +0 -16
  717. package/dist/src/foundation/process-containment/native-guardian-containment.js +0 -139
  718. package/dist/src/foundation/process-containment/windows-process-inspector.d.ts +0 -17
  719. package/dist/src/foundation/process-containment/windows-process-inspector.js +0 -53
  720. package/dist/src/foundation/protocol/client.d.ts +0 -17
  721. package/dist/src/foundation/protocol/client.js +0 -129
  722. package/dist/src/foundation/protocol/index.d.ts +0 -2
  723. package/dist/src/foundation/protocol/index.js +0 -2
  724. package/dist/src/foundation/protocol/messages.d.ts +0 -89
  725. package/dist/src/foundation/protocol/messages.js +0 -99
  726. package/dist/src/foundation/release/bootstrap.d.ts +0 -29
  727. package/dist/src/foundation/release/bootstrap.js +0 -335
  728. package/dist/src/foundation/release/cohort-state.d.ts +0 -70
  729. package/dist/src/foundation/release/cohort-state.js +0 -202
  730. package/dist/src/foundation/release/index.d.ts +0 -10
  731. package/dist/src/foundation/release/index.js +0 -10
  732. package/dist/src/foundation/release/release-gc.d.ts +0 -5
  733. package/dist/src/foundation/release/release-gc.js +0 -16
  734. package/dist/src/foundation/release/release-store.d.ts +0 -43
  735. package/dist/src/foundation/release/release-store.js +0 -175
  736. package/dist/src/foundation/release/release.d.ts +0 -38
  737. package/dist/src/foundation/release/release.js +0 -204
  738. package/dist/src/foundation/release/update-transaction.d.ts +0 -31
  739. package/dist/src/foundation/release/update-transaction.js +0 -89
  740. package/dist/src/foundation/release/update.d.ts +0 -82
  741. package/dist/src/foundation/release/update.js +0 -527
  742. package/dist/src/foundation/storage/control-store.d.ts +0 -61
  743. package/dist/src/foundation/storage/control-store.js +0 -530
  744. package/dist/src/foundation/storage/index.d.ts +0 -1
  745. package/dist/src/foundation/storage/index.js +0 -1
  746. package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts +0 -46
  747. package/dist/src/foundation/structured-agent-runtime/backpressure.js +0 -118
  748. package/dist/src/foundation/structured-agent-runtime/commands.d.ts +0 -52
  749. package/dist/src/foundation/structured-agent-runtime/commands.js +0 -164
  750. package/dist/src/foundation/structured-agent-runtime/handshake.d.ts +0 -41
  751. package/dist/src/foundation/structured-agent-runtime/handshake.js +0 -151
  752. package/dist/src/foundation/structured-agent-runtime/index.d.ts +0 -5
  753. package/dist/src/foundation/structured-agent-runtime/index.js +0 -5
  754. package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts +0 -37
  755. package/dist/src/foundation/structured-agent-runtime/reconnection.js +0 -129
  756. package/dist/src/foundation/structured-agent-runtime/state.d.ts +0 -56
  757. package/dist/src/foundation/structured-agent-runtime/state.js +0 -118
  758. package/dist/src/foundation/supervision/index.d.ts +0 -3
  759. package/dist/src/foundation/supervision/index.js +0 -3
  760. package/dist/src/foundation/supervision/main.d.ts +0 -1
  761. package/dist/src/foundation/supervision/main.js +0 -41
  762. package/dist/src/foundation/supervision/paths.d.ts +0 -1
  763. package/dist/src/foundation/supervision/paths.js +0 -1
  764. package/dist/src/foundation/supervision/server.d.ts +0 -22
  765. package/dist/src/foundation/supervision/server.js +0 -451
  766. package/dist/src/foundation/ui-apps/contracts.d.ts +0 -42
  767. package/dist/src/foundation/ui-apps/host.d.ts +0 -42
  768. package/dist/src/foundation/ui-apps/host.js +0 -152
  769. package/dist/src/foundation/ui-apps/index.d.ts +0 -3
  770. package/dist/src/foundation/ui-apps/index.js +0 -3
  771. package/dist/src/foundation/ui-apps/registry.d.ts +0 -11
  772. package/dist/src/foundation/ui-apps/registry.js +0 -32
  773. package/dist/src/foundation/ui-components/dialog-panel.js +0 -47
  774. package/dist/src/foundation/ui-components/frame.d.ts +0 -21
  775. package/dist/src/foundation/ui-components/frame.js +0 -54
  776. package/dist/src/foundation/ui-components/index.d.ts +0 -18
  777. package/dist/src/foundation/ui-components/index.js +0 -18
  778. package/dist/src/foundation/ui-components/line-input.d.ts +0 -74
  779. package/dist/src/foundation/ui-components/line-input.js +0 -245
  780. package/dist/src/foundation/ui-components/list-view.d.ts +0 -66
  781. package/dist/src/foundation/ui-components/list-view.js +0 -76
  782. package/dist/src/foundation/ui-components/mouse.d.ts +0 -15
  783. package/dist/src/foundation/ui-components/mouse.js +0 -46
  784. package/dist/src/foundation/ui-components/scrollbar.d.ts +0 -62
  785. package/dist/src/foundation/ui-components/scrollbar.js +0 -102
  786. package/dist/src/foundation/ui-components/shortcuts.d.ts +0 -57
  787. package/dist/src/foundation/ui-components/shortcuts.js +0 -81
  788. package/dist/src/foundation/ui-components/spans.d.ts +0 -7
  789. package/dist/src/foundation/ui-components/spans.js +0 -59
  790. package/dist/src/foundation/ui-components/surface.d.ts +0 -20
  791. package/dist/src/foundation/ui-components/surface.js +0 -38
  792. package/dist/src/foundation/ui-components/text.d.ts +0 -24
  793. package/dist/src/foundation/ui-components/text.js +0 -123
  794. package/dist/src/foundation/workspace-contracts/index.d.ts +0 -2
  795. package/dist/src/foundation/workspace-contracts/index.js +0 -2
  796. package/dist/src/foundation/workspace-contracts/model.d.ts +0 -248
  797. package/dist/src/foundation/workspace-contracts/model.js +0 -2
  798. package/dist/src/foundation/workspace-contracts/validation.d.ts +0 -13
  799. package/dist/src/foundation/workspace-contracts/validation.js +0 -335
  800. package/dist/src/product-identity.d.ts +0 -37
  801. package/dist/src/product-identity.js +0 -150
  802. package/dist/src/product-identity.json +0 -99
  803. package/docs/manual-transparent-checkpoint.md +0 -53
  804. /package/dist/{src/foundation/agent-engine-contracts/domain.js → app/session-shell/paste-helper.d.ts} +0 -0
  805. /package/dist/{src/foundation/agent-engine-contracts/ports.js → app/session-shell/paste-text-worker.d.ts} +0 -0
  806. /package/dist/{src/foundation/lifecycle/commands.js → app/session-shell/paste-types.js} +0 -0
  807. /package/dist/{src/foundation/pi-owned-ui-integration/route-host.js → app/session-shell/response-copy-helper.d.ts} +0 -0
  808. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.js +0 -0
  809. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.d.ts +0 -0
  810. /package/dist/{src/foundation/pi-tui-runtime-adapter/contracts.js → contracts/agent-engine/domain.js} +0 -0
  811. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.d.ts +0 -0
  812. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.js +0 -0
  813. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.js +0 -0
  814. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.d.ts +0 -0
  815. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.d.ts +0 -0
  816. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.js +0 -0
  817. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.d.ts +0 -0
  818. /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.js +0 -0
  819. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.js +0 -0
  820. /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.js +0 -0
  821. /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.js +0 -0
  822. /package/dist/{src/features → features}/launch/development-launch.d.ts +0 -0
  823. /package/dist/{src/features → features}/launch/initialize-profile.d.ts +0 -0
  824. /package/dist/{src/features → features}/launch/initialize-profile.js +0 -0
  825. /package/dist/{src/foundation → foundation}/lifecycle/commands.d.ts +0 -0
  826. /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.d.ts +0 -0
  827. /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.js +0 -0
  828. /package/dist/{src/foundation → foundation}/process-containment/artifact.d.ts +0 -0
  829. /package/dist/{src/foundation → foundation}/process-containment/artifact.js +0 -0
  830. /package/dist/{src/foundation → foundation}/process-containment/contracts.d.ts +0 -0
  831. /package/dist/{src/foundation → foundation}/process-containment/contracts.js +0 -0
  832. /package/dist/{src/foundation → foundation}/release/cohort-selection.d.ts +0 -0
  833. /package/dist/{src/foundation → foundation}/release/cohort-selection.js +0 -0
  834. /package/dist/{src/foundation → foundation}/release/concurrency.d.ts +0 -0
  835. /package/dist/{src/foundation → foundation}/release/concurrency.js +0 -0
  836. /package/dist/{src/foundation → foundation}/release/process-cleanup.d.ts +0 -0
  837. /package/dist/{src/foundation → foundation}/release/process-cleanup.js +0 -0
  838. /package/dist/{src/foundation → foundation}/release/stable-release.d.ts +0 -0
  839. /package/dist/{src/foundation → foundation}/release/stable-release.js +0 -0
  840. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.d.ts +0 -0
  841. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.d.ts +0 -0
  842. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.js +0 -0
  843. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.js +0 -0
  844. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.d.ts +0 -0
  845. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.d.ts +0 -0
  846. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.d.ts +0 -0
  847. /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.js +0 -0
  848. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.d.ts +0 -0
  849. /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.js +0 -0
  850. /package/dist/{src/foundation/ui-apps → ui/apps}/contracts.js +0 -0
  851. /package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.d.ts +0 -0
  852. /package/dist/{src/foundation/ui-components → ui/components}/label.d.ts +0 -0
  853. /package/dist/{src/foundation/ui-components → ui/components}/label.js +0 -0
  854. /package/dist/{src/foundation/ui-components → ui/components}/list-block.d.ts +0 -0
  855. /package/dist/{src/foundation/ui-components → ui/components}/list-block.js +0 -0
  856. /package/dist/{src/foundation/ui-components → ui/components}/pane.d.ts +0 -0
  857. /package/dist/{src/foundation/ui-components → ui/components}/pane.js +0 -0
  858. /package/dist/{src/foundation/ui-components → ui/components}/revision.d.ts +0 -0
  859. /package/dist/{src/foundation/ui-components → ui/components}/revision.js +0 -0
  860. /package/dist/{src/foundation/ui-components → ui/components}/status-line.d.ts +0 -0
  861. /package/dist/{src/foundation/ui-components → ui/components}/status-line.js +0 -0
  862. /package/dist/{src/foundation/ui-components → ui/components}/stepper.d.ts +0 -0
  863. /package/dist/{src/foundation/ui-components → ui/components}/stepper.js +0 -0
  864. /package/dist/{src/foundation/ui-components → ui/components}/theme.d.ts +0 -0
  865. /package/dist/{src/foundation/ui-components → ui/components}/theme.js +0 -0
  866. /package/dist/{src/foundation/ui-components → ui/components}/value-menu.d.ts +0 -0
  867. /package/dist/{src/foundation/ui-components → ui/components}/value-menu.js +0 -0
  868. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.d.ts +0 -0
  869. /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.js +0 -0
@@ -0,0 +1,149 @@
1
+ # Persistent prompt history
2
+
3
+ Bare A1 recalls recent prompts across sessions and projects within the same A1
4
+ profile. It is input recall, not conversation recovery or agent memory. The Pi
5
+ comparison (`a1 pi`) retains its ordinary current-session history.
6
+
7
+ ## Recall
8
+
9
+ Use Up/Down at the editor's normal history boundaries. Up enters older prompts
10
+ with the caret at the end; Down enters newer prompts at the beginning. Moving
11
+ past the newest restores your draft, including its cursor and live pasted text.
12
+ Multiline cursor movement and autocomplete keep their existing priority.
13
+
14
+ The existing editor border shows `History 100/100` for the newest of 100 entries
15
+ and `History 1/100` for the oldest. The label uses the status bar's neutral grey
16
+ (`dim` theme role), independently of the thinking/bash colors on the input bars. Repeated prompts move forward instead of
17
+ creating duplicates. Other instances refresh in the background; the selected
18
+ history and its count stay fixed until you leave that browse cycle. An
19
+ extension-provided custom editor keeps its own behavior; the default editor is
20
+ resynchronized when restored.
21
+
22
+ Ordinary prompts, steering, follow-ups, queued inputs, nonempty bash commands,
23
+ and user-entered skill/template/extension prompt routes are eligible. Opening
24
+ settings or session/workflow screens does not add history. Loading a transcript,
25
+ retrying a dispatch internally, draining a queue, or displaying a suggestion does
26
+ not create another entry. An explicit user submission is retained even if the
27
+ provider later rejects it or the turn is interrupted.
28
+
29
+ Text pastes, URL targets, and file paths remain reusable after restart. History
30
+ keeps the user invocation before template/extension expansion, not the expanded
31
+ request. Image-bearing prompts retain only their text; images are not reattached.
32
+ Image-only prompts do not create saved entries. No v2, Pi, or Claude history is
33
+ imported automatically.
34
+
35
+ ## Storage and privacy
36
+
37
+ | Platform | Default durable location |
38
+ |---|---|
39
+ | Windows | `%USERPROFILE%/.a1/data/history/<profile-id>.sqlite3` |
40
+ | Linux and macOS | `~/.a1/data/history/<profile-id>.sqlite3` |
41
+ | Explicit override | `<A1_DATA_DIR>/history/<profile-id>.sqlite3` |
42
+
43
+ The default uses A1's effective profile home: `A1_PROFILE_HOME` when set, otherwise
44
+ the operating-system home. A custom agent-profile directory changes the history
45
+ identity, not this default root. `A1_DATA_DIR` takes precedence for storage;
46
+ `XDG_DATA_HOME` does not redirect default history. Control metadata, settings,
47
+ agent resources, releases, logs, runtime files, and caches keep their existing
48
+ locations.
49
+
50
+ **The home-based default starts fresh.** Previous versions used
51
+ `%LOCALAPPDATA%/a1/history` on Windows, or `$XDG_DATA_HOME/a1/history` /
52
+ `~/.local/share/a1/history` on Unix. A1 does not probe, import, merge, delete, or
53
+ fall back to those stores. Explicit `A1_DATA_DIR` selections still work normally.
54
+ Old and new releases using different roots do not synchronize history.
55
+
56
+ The profile filename is `a1-` followed by a SHA-256 digest of a versioned tuple
57
+ containing the launch kind and normalized effective agent-profile path. It is
58
+ independent of project, session, checkout, and release. Windows ordinary case and
59
+ separator variants normalize together. Different profile roots use different
60
+ files. Moving a profile, unresolved symlink aliases, or selecting a different
61
+ data root can select a different history; A1 never silently merges or imports it.
62
+
63
+ The database is separate from `control.sqlite3`, agent resources, and disposable
64
+ caches. Upgrades, ordinary npm uninstall/reinstall, release rollback, cache cleanup,
65
+ and conversation deletion do not clear it. Reusing saved history requires the
66
+ same profile and history root; explicitly deleting user data still removes it.
67
+ SQLite may keep `-wal` and `-shm` sidecars beside the database.
68
+
69
+ **History is unencrypted potentially sensitive user text.** Owner permissions
70
+ are restricted where supported; Windows uses inherited ACLs at the selected
71
+ history directory. Review parent-directory permissions if you customize your home
72
+ or override root. These protections do not make it safe to submit secrets.
73
+ Credential files, image data, arbitrary environment values, assistant/tool output, and terminal
74
+ streams are not copied into this store. Prompt content and private provenance
75
+ must not appear in history diagnostics or test evidence.
76
+
77
+ ## Settings and limits
78
+
79
+ The History section in `/settings` provides:
80
+
81
+ - **Persistent history:** on by default; applies on the next start. Off disables
82
+ storage and cross-session recall for subsequent launches, not current-session
83
+ recovery. Existing enabled instances keep running until closed.
84
+ - **History limit:** 10-100 in increments of 10, default 100; applies when a new
85
+ enabled instance starts. All writers then use that profile store's updated
86
+ retention limit. Raising the limit cannot restore pruned entries.
87
+
88
+ The settings use A1's existing settings document, not Pi's settings or a separate
89
+ history configuration file. Disabling persistence does not delete saved data;
90
+ re-enabling makes compatible retained entries available again.
91
+
92
+ Additional bounds protect memory and disk:
93
+
94
+ - At most 1 MiB UTF-8 per persisted prompt, never silently truncated.
95
+ - At most 8 MiB retained canonical text, evicting oldest entries even below the
96
+ configured count.
97
+ - At most 32 queued/in-flight writes and 8 MiB queued text per instance.
98
+ - Provenance: up to 8 KiB cwd and 256 bytes session identity; oversized optional
99
+ provenance is omitted.
100
+ - Short off-thread transactions, a one-second lock retry window, and coalesced
101
+ refresh with at most one read in flight.
102
+ - SQLite page/journal limits and a 64 MiB database/sidecar maintenance threshold;
103
+ text limits exclude transient SQLite overhead.
104
+
105
+ Persistence failure leaves prompt execution and local recall usable. A corrupt,
106
+ wrong-profile, or newer-schema database is preserved, not silently recreated.
107
+ A committed entry survives restart. A hard kill before asynchronous commit can
108
+ lose the newest queued entries. Graceful exit attempts to drain writes within
109
+ two seconds and reports an incomplete flush without preventing exit.
110
+
111
+ ## Remove saved history
112
+
113
+ First close **every instance using the selected profile**. Then remove only that
114
+ profile's `.sqlite3` file and its matching `-wal` and `-shm` sidecars, if present.
115
+ Do not delete an open database, the whole `.a1` directory, or the whole
116
+ application-data root. Disabling the setting alone is not an erase operation.
117
+ There is no interactive clear/export command in this release.
118
+
119
+ Removing a former default store is likewise a one-time manual cleanup, not an
120
+ application feature. Wait until you have switched to the new version and closed
121
+ all instances using the old store; an older running version can otherwise keep
122
+ using or recreate it. Remove only the identified old profile database and matching
123
+ sidecars, not other profiles or either application's caches.
124
+
125
+ ## Manual acceptance
126
+
127
+ Build the checkout, then launch it through `./scripts/dev`. Use an isolated
128
+ `A1_DATA_DIR` for disposable history checks; keep that same directory on each
129
+ restart and in both concurrent terminals. The development launcher always sets
130
+ an isolated `A1_DATA_DIR`; to try the home-based location in that launcher,
131
+ explicitly select `A1_DATA_DIR=<effective-home>/.a1/data` and keep
132
+ `A1_DATABASE_PATH` in a separate disposable directory so control metadata is not
133
+ placed beside history. For a history-only review, `NODE_DISABLE_COMPILE_CACHE=1`
134
+ also avoids creating compile-cache files under that explicitly overridden root.
135
+ The focused path/composition tests cover normal no-override selection. Test:
136
+
137
+ 1. Submit two text prompts and one repeated prompt; start `/new`, then restart.
138
+ The latest unique prompts remain recallable.
139
+ 2. Browse multiline input with a draft present. Check v2 caret placement,
140
+ newest/oldest numbering, and draft restoration.
141
+ 3. Submit from a second instance while the first browses. The first selection
142
+ stays fixed; the update appears on a later safe browse cycle.
143
+ 4. Recall pasted text after restart; image tokens must not promise reattachment.
144
+ 5. Save both History settings, restart, and verify effective values and opt-out.
145
+ 6. Use a second isolated effective profile and verify no sharing. Run
146
+ `./scripts/dev pi` and verify its ordinary history/editor remain unchanged.
147
+
148
+ Source ownership and differential editor evidence are described in
149
+ [history-editor-provenance.md](../architecture/history-editor-provenance.md).
@@ -0,0 +1,212 @@
1
+ # Local worktree cleanup after verified delivery
2
+
3
+ Local cleanup completes the delivery order in [the archive runbook](openspec-archive-automation.md). For version 3 that is one authorized manual implementation/acceptance/archive merge, read-only verification, remote topic-ref deletion, then safe local cleanup. Legacy versions still require their applicable acceptance-record and automatic archive merges. GitHub Actions never reaches into a developer machine. Local cleanup never publishes archives or merges PRs; `complete`, preview, and queue/watch do not delete remote refs, while explicitly confirmed closed-unmerged `discard` owns only its exact expected-SHA topic-ref deletion.
4
+
5
+ The implementation is repository tooling, not part of the installed A1 product. It requires Node, Git, and GitHub read access; the explicit closed-unmerged discard operation additionally requires authenticated permission to delete its exact remote topic ref. No product build, dependency installation, interactive UI, or OS-service provisioning is needed. It supports this repository's `origin` on github.com, via HTTPS or SSH.
6
+
7
+ ## Hand-off and sweep: the ordinary agent path
8
+
9
+ The delivering agent's session usually ends before the maintainer merges, so cleanup is split into two commands that never need the same session. When the validated PR is handed to the maintainer, and again after any repair push, the owning agent parks the worktree from the primary checkout:
10
+
11
+ ```bash
12
+ node scripts/governance/local-worktree-cleanup.mjs handoff --repo D:/Git/a1 --path D:/Git/a1/.worktrees/example-task --change example-change --pr 123
13
+ ```
14
+
15
+ `handoff` registers the exact worktree if it is not registered yet (or reclaims the existing released entry), records its current HEAD and branch, applies the central disposable policy, and releases it. It evaluates nothing, deletes nothing, and does not enable the queue. That release is the candidate-scoped cleanup authorization for this worktree and its topic ref, exercised only once the merge, archive, validation, and remote-ref gates verify later; it never becomes discard authority for a PR that is later closed unmerged. It is idempotent per worktree: repeating it updates the recorded head instead of adding a second registration. Tracked, staged, unstaged, or untracked content outside the disposable roots blocks with `worktree-content` and the affected paths, because such content means unpushed work; unknown ignored content is judged at removal time, as it is for `complete`. A primary, foreign, replaced, or branch-changed path blocks with a named reason. A worktree that a session registered with the low-level `register` command and still owns is released by `handoff` (or `complete`) when `LOCAL_CLEANUP_OWNER_TOKEN` holds that registration's token; without it both block with `owned-worktree`, and a separate `release` is needed.
16
+
17
+ Every delivery session then starts, before it creates a worktree, with one bounded sweep from the primary checkout, and runs it again when it verifies or is told of a merge:
18
+
19
+ ```bash
20
+ node scripts/governance/local-worktree-cleanup.mjs sweep --repo D:/Git/a1
21
+ ```
22
+
23
+ `sweep` evaluates every released registration in one pass under the queue limits (100 registrations, 500 remote requests, a durable round-robin cursor) with a 180-second elapsed budget, since each merged candidate costs three evidence loads, and completes each candidate whose PR is verified merged using exactly the `complete` safeguards. It needs no `enable` and starts no process: its authority is each candidate's release. A candidate whose PR is open, draft, or not yet finalized reports `pending`; a candidate whose PR closed without merge reports `awaiting-discard` and is never touched; blockers report their exact reason. An old stop sentinel does not prevent a sweep, but `disable` run while a sweep is executing stops it before its next destructive step. If another session holds the mutation lock the sweep reports `mutation-busy` and the agent relays it as deferred rather than waiting. The JSON report carries a `lines` array with one relayable line per candidate and pruned branch, for example `#458 close-absent-and-skewed-cleanup: removed [worktree-removed, local-ref-removed]`. Pending or blocked results never delay the new delivery.
24
+
25
+ ### Nothing left to remove
26
+
27
+ A released entry whose evidence can never verify (for example `delivery-content-drift` after a stale-base merge, or `source-association` for a PR without an `openspec-implementation` fence) would otherwise be re-verified and reported `blocked` on every sweep. When such an entry's worktree path is gone, Git holds no live row for it (its own dangling row is retired), and its local topic ref is absent, the sweep and `complete` ask GitHub only whether the pull request merged into `develop` in this repository and then mark the journal `done` with `retired-nothing-left` and the original evidence reason. Nothing is deleted; a present path, row, or ref keeps the entry blocked, an unmerged PR keeps it `pending` or `awaiting-discard`, a deferred failure such as `remote-budget` is never treated as unverifiable, and preview retires nothing. For an all-absent entry whose PR is not merged, the maintainer runs the explicit form, which reads nothing from GitHub and deletes nothing:
28
+
29
+ ```bash
30
+ node scripts/governance/local-worktree-cleanup.mjs forget --repo D:/Git/a1 --id REGISTRATION_ID --confirm-nothing-left
31
+ ```
32
+
33
+ `forget` refuses without the flag, for an owned or deleting entry, and while the path, a live Git row, or the ref still exists (`something-remains`). `status` shows both notes under `completion`.
34
+
35
+ ### Keep the base current before merge
36
+
37
+ The `develop` ruleset requires the pull request head to be up to date with `develop`. When another delivery merges first, the PR shows `BEHIND`: merge `origin/develop` into the branch (or use "Update branch"), push, let the `OpenSpec finalization` workflow re-finalize with digests of the merged bytes, wait for validation, and hand off again. Merging a stale finalized head is what produced `delivery-content-drift` for #461; with the strict policy GitHub refuses that merge.
38
+
39
+ ### Accepted ancestry
40
+
41
+ Since the `OpenSpec finalization` workflow pushes its commit onto the PR branch after the agent's last push, the registered head is normally one commit behind the merged head. Cleanup therefore accepts a registered head, live worktree HEAD, or local topic-ref tip that equals the merged PR head or is one of its ancestors on GitHub, verified with the compare API: every commit reachable from such a tip is reachable from a head the maintainer accepted, so nothing is lost. A tip that holds a commit outside the merged head, or a commit GitHub does not know, still blocks with `candidate-head-association`, `worktree-identity-changed`, or `local-ref-advanced`, and the branch attachment must still be the registered one. Ref deletion reads the tip immediately before deleting, requires it to be accepted, and uses it as the compare-and-delete expectation. Ancestry of `develop` is never used, because the repository squash-merges.
42
+
43
+ ### Merged branch pruning
44
+
45
+ The sweep also prunes local topic branches that have no live registration, such as the branch left behind when a worktree was deleted by hand. A branch is deleted only when all of these hold: its name follows `type/short-description` and is not `develop` or another protected or reserved name; no worktree has it checked out; the same-repository pull-request lookup by that head ref name returns at least one PR merged into `develop` and no open PR; the tip equals or is an ancestor of the most recent such merged PR's head; and `origin` no longer has the ref. Deletion is compare-and-delete against the tip reread immediately before. Everything else is reported and kept with `branch-no-pull-request`, `branch-open-pull-request`, `branch-closed-pull-request`, `branch-unmerged-commits`, `branch-checked-out`, or `branch-remote-present`. Branch pruning never deletes remote refs, worktrees, or registrations, and a preview never prunes.
46
+
47
+ ## Standard completed-delivery command
48
+
49
+ The exact-candidate form remains for a session that is still alive at merge time or wants to finish one candidate by name. After authorized merge, accepted/archive verification, and remote topic-ref removal, the owning agent runs one command from the primary checkout:
50
+
51
+ ```bash
52
+ node scripts/governance/local-worktree-cleanup.mjs complete \
53
+ --repo D:/Git/a1 \
54
+ --path D:/Git/a1/.worktrees/example-task \
55
+ --change example-change \
56
+ --pr 123
57
+ ```
58
+
59
+ `complete` is explicit cleanup authorization for that exact candidate. It creates and releases an exact registration when needed, applies the repository-owned generated-path policy, verifies live merge/archive/CI/ref evidence, evaluates only that candidate, uses journaled non-force Git removal, deletes only the unchanged local topic ref, and leaves persistent watcher authority unchanged. Repeating it reports the completed candidate as already absent. Existing conflicting ownership, identity drift, unavailable evidence, or unknown content remains blocking.
60
+
61
+ The central disposable policy is `node_modules`, `dist`, `.builds`, `.artifacts`, `native/process-guardian/target`, and `native/terminal-host/target`. The `.artifacts` root is the repository's ignored generated-artifact root (finalization and validation reports, packed candidates, agent-written logs and diffs); the two native roots contain repository-generated Cargo output. Registrations that still name `.artifacts/openspec-archive` or `.artifacts/validation` stay valid and are widened to the root on the next `complete`. Each encountered path must be ignored and stay inside the exact worktree with no link, special file, or nested repository boundary. Authority is component-exact: near matches such as `.artifacts-user` or `artifacts`, arbitrary `target` directories, and sibling native projects remain blocking. Tracked/staged/unstaged/untracked content and every unknown ignored path still block. A tracked regular `.gitmodules` file alone is ordinary content; actual nested `.git` metadata, gitlinks, configured submodules, and submodule changes block. Ordinary content and these approved generated roots are traversed under separate finite entry allowances, so a normal dependency installation does not consume the ordinary source-tree allowance; both allowances retain the same deadline and content-boundary checks. Once those checks pass, cleanup deletes the declared disposable roots itself with a bounded retry for transient Windows sharing violations before handing the worktree to Git, so non-force Git removal only has to delete tracked content. A root that stays locked after the retry budget reports `blocked` with `disposable-path-locked` and the root's path; the worktree, its `.git` pointer, and its journal are untouched, so stop the process holding the handle and rerun the same command.
62
+
63
+ Agents do not manually remove generated content, call `git worktree remove`, or delete the local branch after delivery. The JSON result is authoritative: report success only for `removed` or verified `already-absent`; otherwise retain the worktree and report the exact blocker. A handed-off entry whose worktree was deleted by hand completes through its journal, and its branch is deleted under the accepted-ancestry rule. Legacy roles can supply separate `--source-pr`, `--candidate-pr`, and `--role` values.
64
+
65
+ ## Explicit closed-unmerged discard
66
+
67
+ Closing a PR does not itself authorize deletion. After the maintainer explicitly rejects one exact PR and separately confirms remote deletion, run the candidate-scoped command from the primary checkout:
68
+
69
+ ```bash
70
+ node scripts/governance/local-worktree-cleanup.mjs discard \
71
+ --repo D:/Git/a1 \
72
+ --path D:/Git/a1/.worktrees/rejected-task \
73
+ --change rejected-change \
74
+ --pr 123 \
75
+ --confirm-closed-unmerged
76
+ ```
77
+
78
+ `discard` requires the named PR to remain closed without merge, target `develop`, belong to this repository, and identify the exact registered worktree HEAD and branch. It first applies the same clean-content and generated-root inspection used by `complete`. It then verifies the remote topic branch is unprotected, non-reserved, and still equals the PR head; deletes only that ref with an expected-SHA lease; verifies remote absence; rechecks the local candidate; removes the worktree non-forcibly; and atomically deletes only the unchanged local branch.
79
+
80
+ An open, merged, reopened, forked, protected, reserved, advanced, dirty, active, linked, nested, replaced, current, or unverifiable candidate remains blocking. Remote deletion followed by a Windows lock or later local blocker is reported as `partial`; the journal preserves the remaining worktree/local ref for the same exact confirmed command to inspect and resume. The command never scans by age or name, adopts another session's checkout, enables queue/watch, or turns PR close events into automatic discard authority.
81
+
82
+ ## Preview first
83
+
84
+ From a checkout containing the reviewed tooling:
85
+
86
+ ```bash
87
+ node scripts/governance/local-worktree-cleanup.mjs preview --repo D:/Git/a1
88
+ node scripts/governance/local-worktree-cleanup.mjs status --repo D:/Git/a1
89
+ ```
90
+
91
+ `--repo` is the **primary** worktree, not a task worktree. Preview reads live evidence but changes no worktrees, refs, ownership state, or retry checkpoints. Status is local-only. Existing folders are reported `unmanaged` and are never adopted by their name, missing upstream, or ancestry; preview reports a folder that an execution pass would remove as an empty leftover with `empty-directory` (see below) but deletes nothing. Neither command enables cleanup.
92
+
93
+ Remote reads use `GH_TOKEN`/`GITHUB_TOKEN`, otherwise existing `gh auth token --hostname github.com` authentication. Do not put tokens in command arguments, source files, reports, or PR comments. Missing/expired private-repository authentication blocks evidence checks.
94
+
95
+ ## Explicit queue/watch enablement
96
+
97
+ Neither `handoff`, `sweep`, nor the exact-candidate `complete` command enables the persistent queue; `sweep` scans released registrations under its own authority, while `once`/`watch` remain the separately enabled background route. Only after the maintainer separately authorizes queue/watch activation, use the reviewed tool in the primary/stable checkout outside `.worktrees/`:
98
+
99
+ ```bash
100
+ node scripts/governance/local-worktree-cleanup.mjs enable --repo D:/Git/a1
101
+ node scripts/governance/local-worktree-cleanup.mjs once --repo D:/Git/a1
102
+ ```
103
+
104
+ `enable` only records permission; it does not start a process or remove anything. `once` evaluates at most one bounded pass. Mutation commands `once` and `watch` refuse tooling loaded from inside the target repository's removable root. For pre-merge isolated tests, the test repository is a separate disposable temporary repository, not the working repository itself.
105
+
106
+ For eventual cleanup after asynchronous archive integration, run watch mode in a separate terminal or an explicitly managed local process:
107
+
108
+ ```bash
109
+ node scripts/governance/local-worktree-cleanup.mjs watch --repo D:/Git/a1
110
+ ```
111
+
112
+ It runs one immediate pass and retries at five-minute intervals, with rate-limit backoff and no overlapping mutations. Each pass is bounded to 100 registration evaluations, 500 remote requests, and 60 seconds; individual subprocess/remote calls have a 10-second deadline. Local content traversal is additionally bounded to 20,000 ordinary entries plus 100,000 entries beneath exact approved generated roots; exhausting either allowance never grants deletion authority. Reports identify incomplete coverage. A durable round-robin cursor lets later pending candidates run on subsequent passes.
113
+
114
+ When the process is stopped or the machine is offline, GitHub cannot remove local folders. The next enabled invocation rechecks the queue and live evidence. No implicit service, scheduled task, or A1/Pi startup hook is installed.
115
+
116
+ ## Register and release only work you own
117
+
118
+ Keep an owner token private for the delivery session. For example, in Git Bash:
119
+
120
+ ```bash
121
+ export LOCAL_CLEANUP_OWNER_TOKEN="$(node -e 'process.stdout.write(require("node:crypto").randomBytes(32).toString("hex"))')"
122
+ ```
123
+
124
+ Register after the draft PR number is known, using actual PR numbers and canonical paths. The following example deliberately requires replacing `123` and `example-task`:
125
+
126
+ ```bash
127
+ node scripts/governance/local-worktree-cleanup.mjs register --repo D:/Git/a1 --path D:/Git/a1/.worktrees/example-task --change example-change --source-pr 123 --candidate-pr 123 --role implementation
128
+ ```
129
+
130
+ Registration binds the repository, exact directory/filesystem identity, candidate PR, HEAD/ref, role, and generation. It returns an ID and generation, not the owner token. The worktree stays `owned`: registration alone never authorizes removal. Supported roles:
131
+
132
+ - `implementation`: exact merged implementation PR head; candidate PR equals source PR. This is the only version-3 role because the same PR contains implementation, acceptance manifest, synchronized specs, and archive.
133
+ - `acceptance`: legacy exact verified implementation merge commit; candidate PR equals source PR.
134
+ - `archive`: legacy exact merged generated archive PR head; candidate PR is the archive PR and source PR is the implementation PR.
135
+
136
+ A CI/base/older-ancestor checkout does not qualify automatically. Version 3 has no local acceptance/archive checkout to register. No local archive checkout is required when a legacy archive was generated entirely on GitHub. Legacy version-1/version-2 linkage remains supported, but individually reviewing and registering a legacy checkout is explicit adoption, not a bulk sweep.
137
+
138
+ Low-level `register` keeps an explicit disposable allowlist for legacy and diagnostic use. The standard `complete` command supplies the central repository policy automatically; agents do not choose flags for normal completed-delivery cleanup. Neither route permits discarding tracked, staged, unstaged, untracked, unknown ignored, linked, special, or actual nested repository/submodule content. Declaring or centrally recognizing a generated directory does not bypass ignored-path, identity, type, or traversal checks.
139
+
140
+ Before handing a completed checkout to cleanup, stop its development processes, leave its directory, and release it using the returned ID and current generation:
141
+
142
+ ```bash
143
+ node scripts/governance/local-worktree-cleanup.mjs release --repo D:/Git/a1 --id REGISTRATION_ID --generation CURRENT_GENERATION
144
+ ```
145
+
146
+ Release verifies ownership and the original directory, records the owner's current final HEAD/ref, and returns a new generation. It does not declare acceptance or archival. For version 3 the worker verifies the exact authorized human manual source merge, required CI, conditional manifest, synchronized specs/archive on current `develop`, and absence of the source topic ref. For legacy versions it still verifies the exact comment or human-manually-merged acceptance receipt, generated archive marker/merge/CI, archive contents, and all applicable topic refs. A bot/automatic/merge-queue acceptance, stale record, missing required CI, unmatched archive, or open/closed-unmerged PR blocks cleanup.
147
+
148
+ After a low-level release, request a pass from the stable checkout if queue cleanup is enabled. A running watcher will also pick it up. Normal completed delivery instead uses `complete`. Never release another session's worktree or use a clean status/dead PID as a substitute for ownership.
149
+
150
+ ## Resume or recover ownership
151
+
152
+ Before resuming a released worktree, acquire it:
153
+
154
+ ```bash
155
+ node scripts/governance/local-worktree-cleanup.mjs claim --repo D:/Git/a1 --id REGISTRATION_ID --generation CURRENT_GENERATION
156
+ ```
157
+
158
+ Use a private token for the new session. Claim, release, and cleanup share a per-repository lock. A successful claim prevents deletion until the new owner releases it. A deleting or completed candidate cannot be claimed. A path reused after completed cleanup requires a new explicit `register` operation.
159
+
160
+ A session crash does not release ownership. After separately confirming that the owner and all related processes have stopped, an explicit recovery claims it for review:
161
+
162
+ ```bash
163
+ node scripts/governance/local-worktree-cleanup.mjs recover --repo D:/Git/a1 --id REGISTRATION_ID --generation CURRENT_GENERATION --confirm-stopped
164
+ ```
165
+
166
+ Recovery never releases or deletes. The generation must still match. A Git worktree lock remains a veto. A leftover `mutation.lock` from a killed cleanup process is evicted only on proof: the holder writes its PID and refreshes a heartbeat in the lock every five seconds, and a later `handoff`, `sweep`, `complete`, `discard`, claim, or queue pass evicts the lock only when that heartbeat (or, for an old lock without one, the file's modification time) is more than two minutes old and the PID no longer exists. A live, unprobeable, or own PID keeps the lock, as does a fresh or unreadable-but-fresh file, and the operation reports `mutation-busy`. Each eviction is journaled as `lock-evicted-<time>-<id>.json` beside `state.json` with the evicted record; it releases no ownership and advances no journal step. A lock that stays `mutation-busy` therefore has a live holder: wait for it or stop that process first.
167
+
168
+ ## Outcomes and interruption handling
169
+
170
+ State, journals, stop controls, and execution reports live in `<git-common-dir>/local-worktree-cleanup/`, outside removable checkouts. `status` omits owner-token hashes. Reports contain identities, local blockers, performed steps, and coverage, never file contents or credentials. Completed reports are retained for 30 days subject to a 10 MiB cap; unresolved queue/journal records are not evicted.
171
+
172
+ - `eligible`: preview passed the gates; nothing was removed.
173
+ - `pending`: archive/ref prerequisites have not finished, or the handed-off PR is still open.
174
+ - `awaiting-discard`: the handed-off PR closed without merge; only the explicit `discard` command may act.
175
+ - `blocked`: ownership, content, path, provenance, authentication, or identity needs attention.
176
+ - `unmanaged`: no local registration; no automatic adoption. Reason `empty-directory-recent` marks an all-empty folder still inside its ten-minute grace, and in preview `empty-directory` marks one an execution pass would remove.
177
+ - `removed`: worktree and eligible local-ref operations were verified.
178
+ - `already-absent`: a completed journal's path/ref are still absent.
179
+ - `retired`: evidence was unverifiable but nothing remained to delete and the PR is merged; the journal is complete with `retired-nothing-left`.
180
+ - `forgotten`: the maintainer explicitly closed an all-absent entry with `forget`.
181
+ - `partial`: a destructive step began but all cleanup could not be verified; the same command resumes it.
182
+ - `deferred`: a bounded pass or concurrent mutation owner prevented evaluation.
183
+
184
+ Empty leftovers under `.worktrees/` are the one unregistered shape a pass removes. Git's own `worktree remove` deletes the checkout's files and then its administrative directory even when the final directory removal failed because a shell, editor, or indexer still held the folder open, so an empty top-level folder with no Git row, branch, or registration can outlive its worktree. Every execution pass (`sweep`, `complete`, `discard`, `once`, `watch`) scans the root and removes such a folder only when it is a real directory rather than a link, Git lists no worktree row for its path, its whole subtree holds nothing but directories (no file, link, special entry, or `.git` at any depth), and its modification time is at least ten minutes old so an in-progress `git worktree add` or removal is never raced. Removal is bottom-up with the non-recursive directory primitive only, which cannot delete a file that appeared after verification; it is reported `removed (empty-directory)` with step `empty-directory-removed` and named in the sweep lines. A folder still held open reports `blocked (empty-directory-locked)` and is retried on the next pass; anything containing content stays `unmanaged` and is never touched.
185
+
186
+ Non-force Git removal is the only operation that deletes tracked content from an intact worktree. Local topic-ref deletion then compares the tip read immediately before, which must be the journaled head or an accepted ancestor of the merged head, and refuses refs checked out elsewhere. `develop`, primary/current directories, changed heads, and active sessions are protected. Normal removal retires its own Git worktree registration; unrelated stale/missing registrations are never globally pruned.
187
+
188
+ A released worktree whose directory was deleted by hand before cleanup ran is finished through its journal rather than failing on the missing directory: the same merge/archive evidence is verified, Git may hold no registration for the path or only this candidate's own dangling one, that registration is retired, the step is recorded as `worktree-already-absent`, and the unchanged local topic ref is deleted under the usual compare-and-delete rule. A `complete` invocation for an absent path that was never registered blocks with `worktree-absent-unregistered`, because there is no journaled head to compare the ref against.
189
+
190
+ Post-merge provenance accepts a `merged` timeline event whose time is within five seconds of the pull request's `merged_at`; GitHub stamps the two from different services and has reported them one second apart. The single-event, human-actor, no-App, and same-commit checks are unchanged.
191
+
192
+ Windows file locks can interrupt Git after it has already unlinked the `.git` pointer and part of the tree. That pass reports `partial` with `git-operation-failed` and keeps the journal at `remove-intent`; rerunning the same command resumes it. If the exact registered worktree is still intact, the retry re-inspects it and repeats non-force Git removal. Otherwise the retry verifies the residue: Git must no longer list the path as a valid worktree, the residue may contain no `.git` entry, link, special file, or nested repository, and every remaining regular file must either sit below a declared disposable root or match the exact tracked path and blob hash of the journaled head (`git hash-object` with the repository's filters). Only residue verified that way is removed, with the same bounded retry, after which this candidate's own dangling Git registration is retired and ref cleanup continues. A residue with any unknown, changed, or boundary-violating path reports `residual-content` and lists the offending paths for manual review; a residue that is still locked reports `residual-locked` and is retried on a later pass. `git worktree prune` is never run. A recreated or foreign worktree at the path reports `residual-or-reused-path` and needs a new registration. If a prior run fully removed the worktree and only ref cleanup remains, a subsequent pass rechecks evidence and safely resumes the branch-only step.
193
+
194
+ Ownership is cooperative: managed sessions must claim before use. It cannot police arbitrary external editors. Remote ref checks and local deletion also are not one distributed transaction; refs are read immediately before destructive steps, and uncertain identities always block.
195
+
196
+ ## Disable and test
197
+
198
+ Stop watch with Ctrl+C, or request immediate stop authority from another terminal:
199
+
200
+ ```bash
201
+ node scripts/governance/local-worktree-cleanup.mjs disable --repo D:/Git/a1
202
+ ```
203
+
204
+ Disable writes a stop sentinel without waiting for a busy mutation lock. The worker checks it before each destructive step; an already executing Git operation cannot be undone. No later deletion starts while disabled. State and partial journals remain available for review and future explicit enablement.
205
+
206
+ Dependency-free focused fixtures (temporary repositories only, no live PR mutation or watcher activation):
207
+
208
+ ```bash
209
+ node --test test/repository-governance/local-cleanup.node.mjs test/repository-governance/local-cleanup-evidence.node.mjs test/repository-governance/local-cleanup-watch.node.mjs
210
+ ```
211
+
212
+ The Vitest bridge includes these fixtures in ordinary fast CI, whose runner is Windows. On Windows the suite exercises an actual exclusive file handle and a junction; a non-Windows run explicitly skips the Windows-only handle case rather than claiming it passed. The handle fixture starts one throwaway `powershell.exe` when the file loads so the hosted runner's interpreter cold start overlaps the earlier tests instead of the fixture's timed hold; its bounds and release protocol are unchanged. Required current-head CI and a separately authorized live archive lifecycle remain necessary before acceptance; fixtures and preview do not replace those gates.
@@ -0,0 +1,88 @@
1
+ # Bounded code-streaming and hyperlink cleanup review
2
+
3
+ This candidate finishes the hyperlink portion of `eliminate-code-block-streaming-flicker`
4
+ (specification PR #318), following the partial implementation in #321. It is a prerequisite
5
+ for `keep-streaming-ui-responsive-during-selection` (#325), not that larger change's completed
6
+ selection/wheel performance fix.
7
+
8
+ ## What changed
9
+
10
+ - Candidate-looking text (paths, dotted identifiers) no longer vetoes a proven followed shift.
11
+ Real OSC 8 links, unsafe escapes, images, overlays, and selections retain their conservative
12
+ movement rules.
13
+ - Ordinary streamed text changes no longer request hyperlink cleanup.
14
+ - Pointer transitions identify the former hovered row. Editor link deletion and discarded
15
+ presentation state retain explicit cleanup requests, including when replacement content
16
+ has no links. Unscoped cleanup considers every previously linked row; a missing pointer
17
+ report is not treated as proof that no host decoration exists.
18
+ - Cleanup paints affected and changed rows without manufacturing an erase-display. After
19
+ unknown paint or lost geometry, it waits for a complete safe frame instead of guessing.
20
+ - Same-geometry forced frames preserve current cells without repainting unchanged rows.
21
+ Structural entry, resize, and unsafe-protocol fallbacks are still conservative.
22
+
23
+ ## Automated evidence
24
+
25
+ `test/fixtures/rendering/baseline-code-streaming.json` is the pre-production-change capture
26
+ from `6c5af810`, repeated twice with no production diff. Its synthetic content and cell hashes
27
+ contain no private session input. The fixture predates the added dual-synchronization summary
28
+ field; it remains a historical baseline rather than a regenerated candidate result.
29
+
30
+ | Bare-A1 fullscreen workload | Baseline post-startup clears | Candidate post-startup clears |
31
+ | --- | ---: | ---: |
32
+ | Streamed fenced code | 3 | 0 |
33
+ | Path-bearing prose | 3 | 0 |
34
+ | Tall live tail | 0 | 0 |
35
+
36
+ The deterministic producers use a shared scripted clock so cold imports do not advance spinner
37
+ or presentation timers unpredictably. Independent comparison processes remain outside the owned
38
+ damage adapter. Current budgets also fail candidate-only fallback, repaint of settled rows,
39
+ stale final content, or divergent final cells with synchronization honored versus ignored.
40
+ The dual-model replay reuses producer bytes rather than launching duplicate producers.
41
+
42
+ Generate current evidence (non-interactive; writes only the named report):
43
+
44
+ ```sh
45
+ cd D:/Git/a1/.worktrees/finish-bounded-link-cleanup && node --import tsx scripts/pi/report-code-streaming.ts --phase current --repeat 2 --output .artifacts/rendering/code-streaming-current.json
46
+ ```
47
+
48
+ The baseline mode rejects dirty production sources. Do not replace the committed baseline with
49
+ post-fix results. Repeated reports compare cells, row damage, decisions, and budgets, not elapsed
50
+ machine timings. This is a paint regression check, not a CPU or input-latency benchmark.
51
+
52
+ ## Physical Windows Terminal review
53
+
54
+ Use the candidate branch `fix/bounded-hyperlink-cleanup` and record its exact `git rev-parse HEAD`.
55
+ Build and start the owned UI through the color-preserving shell entry:
56
+
57
+ ```sh
58
+ cd D:/Git/a1/.worktrees/finish-bounded-link-cleanup && npm run build && ./scripts/dev
59
+ ```
60
+
61
+ 1. Ask the agent, without writing files, to produce a long fenced TypeScript example containing
62
+ `obj.method`, `package.json`, and `./src/index.ts`, followed by a short explanation and a real
63
+ Markdown hyperlink. Check that ordinary code/path streaming no longer blanks the screen.
64
+ 2. Hover a real hyperlink, then scroll it away without moving the pointer. Repeat with a
65
+ terminal-detected URL and file-like text inside code. Try both short and wrapped links,
66
+ duplicate targets, blank rows replacing links, and a smaller terminal.
67
+ 3. Move off a hovered link, select linked text, wheel/auto-scroll during selection, release,
68
+ and copy. Check exact copied text, normal link colors/activation, and no leftover solid
69
+ underlines on unrelated text, padding, or controls.
70
+ 4. Paste a URL chip into the editor and delete it. Open and close a covering overlay, and resize
71
+ while a link is visible. Check that obsolete targets/underlines are removed and restored
72
+ links have their correct targets.
73
+ 5. Verify that the dock stays intact and terminal mouse/cursor behavior is restored on exit.
74
+
75
+ Use the same geometry for the independent comparison profile:
76
+
77
+ ```sh
78
+ cd D:/Git/a1/.worktrees/finish-bounded-link-cleanup && npm run build && ./scripts/dev pi
79
+ ```
80
+
81
+ Record terminal/version, geometry, synchronized-update support, explicit versus auto-detected
82
+ link case, commit, and pass/fail. Test both before and after any pointer report: lack of a report
83
+ must not be interpreted as evidence of an absent pointer.
84
+
85
+ **Known gaps:** native Windows Terminal hover rasterization cannot be certified by headless cell
86
+ replay. Visual acceptance and merge authorization are pending. The broader selection/wheel
87
+ scheduling and collapsed-tool preparation optimizations have not been implemented in this PR.
88
+ Do not merge on automated results alone; a ghost-underline or flicker regression blocks acceptance.
@@ -0,0 +1,89 @@
1
+ # Ghost hyperlink underline baseline
2
+
3
+ ## Status and scope
4
+
5
+ This is the diagnostic stage of `fix-ghost-link-underlines`, accepted in specification PR #237. It does **not** repair production rendering or claim the screenshot's root cause is proven.
6
+
7
+ Two executable regressions reproduce the code gaps: the damage adapter removes a requested full clear when the last visible link disappears; the viewport controller does not request cleanup when a hovered link changes bounds on the same row with the same target. Both were run as ordinary tests and failed at those exact assertions, with the other 22 controller/adapter tests passing. During baseline review they use Vitest's `it.fails`, not a skip: the known failure must still occur, and an unexpected pass fails the suite. The repair must remove those markers in tasks 2.2 and 3.2.
8
+
9
+ The standalone protocol fixture drives the **real A1 damage adapter** with the pinned complete-row write grammar. It does not launch A1, Pi, or an agent and does not simulate their complete rendering/input pipeline. In particular it cannot establish shell overlay, selection, or streaming acceptance. It separates emitted-byte evidence from the host's native-hover decoration so those later tests do not mistake a passing controller assertion for a fixed visual bug.
10
+
11
+ ## Confirmed physical baseline
12
+
13
+ The user reports that in **mode 2 (auto-detected)**, wheel scrolling moves the hovered link upward while its underline remains under the stationary pointer briefly, then disappears. That transient trail is a failure, not successful cleanup.
14
+
15
+ The clean `f3613bb` run at 123 columns by 29 rows (`run-smbQ70/trace.jsonl`) records `ghost: true` in auto-detected mode after a downward wheel scroll at scroll position 9. The immediately preceding frame, 214, contains no explicit OSC 8 target opens, and the adapter reports `suppressed-redundant-clear`; its forwarded write has no full-screen clear. This confirms an auto-detection reproduction but does not prove that restoring the clear will fix it. The recorded one-shot `f` comparisons were in explicit mode, with no observation establishing their effect on the auto-detected case. Terminal version and the precise host detection setting remain unrecorded.
16
+
17
+ The persistent-clear comparison below avoids asking the user to press `f` before the short-lived artifact disappears. It changes the diagnostic write path only; production behavior and terminal settings remain unchanged. The user reports that **CLEAR:ON helps** for the confirmed mode-2 case. This supports preserving the complete clear in the production repair, but does not by itself prove the artifact is completely absent in the built A1 candidate.
18
+
19
+ The test host is Windows Terminal `1.24.2607.10001`, determined from the running executable after the comparison. Its settings file contains no explicit global, profile-default, or per-profile `experimental.detectURLs` override; therefore the effective host default applies. The fixture geometry was 123 by 29. Explicit-mode reproduction remains unconfirmed and is recorded as unknown rather than assumed clean.
20
+
21
+ ## Run in Windows Terminal / Git Bash
22
+
23
+ From the implementation checkout, with dependencies installed:
24
+
25
+ ```sh
26
+ ./scripts/pi/reproduce-ghost-link-underlines
27
+ ```
28
+
29
+ This shell entry preserves VT color. It uses `tsx` directly, so no application build is needed for this standalone probe. It is not a substitute for the eventual built-candidate `./scripts/dev` acceptance run.
30
+
31
+ Optional host facts can be recorded explicitly; use the actual version from Windows Terminal's About page and the actual automatic URL-detection setting, without changing either:
32
+
33
+ ```sh
34
+ ./scripts/pi/reproduce-ghost-link-underlines --terminal-version YOUR_VERSION --url-detection enabled
35
+ ```
36
+
37
+ Missing facts are recorded as `unknown`, not inferred. Use a terminal wide enough to display the controls (192 columns by 54 rows is a useful comparison geometry).
38
+
39
+ ## Persistent clear comparison for the confirmed auto-detection case
40
+
41
+ ```sh
42
+ ./scripts/pi/reproduce-ghost-link-underlines --auto --preserve-clears
43
+ ```
44
+
45
+ This starts directly in mode 2 with **CLEAR:ON**. Every frame, including every wheel-scroll frame, sends the requested complete synchronized clear-and-repaint directly to the terminal. It is a labelled control experiment, not an implemented A1 fix.
46
+
47
+ Hover a link and scroll with the wheel while keeping the pointer stationary. Record **y** if any underline trail remains, even if it disappears shortly afterward; record **n** only if this case stays clean. Press **p** to switch to **CLEAR:OFF**, restore the same content position with **r**, and compare the same gesture through the existing adapter. **p** persists across subsequent scrolls, mode changes, and resets. The status row always shows its state. Press **q** to exit.
48
+
49
+ Trace format 2 records `preserveClears` and actual `bypass` state separately on frames and observations. If the trail survives CLEAR:ON, merely preserving the full clear is insufficient for this reproduced host behavior; further diagnosis is required before choosing the production cleanup strategy.
50
+
51
+ ## Observe and record
52
+
53
+ 1. Press **1** for explicit OSC 8 links. Hover the long label, a file label, or a wrapped URL. Keep the pointer stationary and press **x** to replace the content with blank green rows. Also inspect those former cells by hovering them again.
54
+ 2. Press **y** if a ghost underline is visible or **n** if the current case is clean. These keys record a **human** observation of the preceding action; capture a screenshot before pressing them because feedback itself repaints.
55
+ 3. If a ghost is visible, press **f**. This sends the complete clear directly to the terminal, bypassing the optimizer for this one control experiment. Record **y** or **n** again. The trace labels bypass writes so they cannot be mistaken for production output.
56
+ 4. Press **r** to restore the current mode. Hover the long label at its left side and press **b** to shorten/reposition it. Record the result. This visual fixture does not exercise the controller's hover-key logic; the controller regression covers that independently.
57
+ 5. Restore with **r** and use the wheel or **j/k** to scroll while the pointer remains stationary. Scroll until all links are above the screen, then hover plain text and blank rows. Record the result, including cases that do **not** reproduce.
58
+ 6. Press **2** for the same labels without explicit OSC 8 targets; repeat blanking, scrolling, and the forced-clear comparison. Whether these labels become links is controlled by Windows Terminal's own detection. The file-like tool rows are deliberately not wrapped in OSC 8 in either mode.
59
+ 7. Press **q** or Ctrl+C to restore the terminal. Report the terminal version, automatic URL-detection setting, observations, and screenshot if the symptom occurs.
60
+
61
+ The fixture does not implement link activation. The host may still handle its normal hyperlink gestures; the explicit file target is this checkout's `package.json`, and web targets use the reserved `example.invalid` domain.
62
+
63
+ ## Built A1 candidate
64
+
65
+ The implementation branch `fix/ghost-link-underlines` now carries the production repair. Build it, launch the color-preserving repository entry, produce output containing web URLs, file paths, and linked file labels, and test all of the following while leaving the pointer stationary over a link:
66
+
67
+ - wheel-scroll the link upward and downward;
68
+ - use Home/End, Shift+Up/Down, the scrollbar, and followed streaming output;
69
+ - resize or reflow the terminal so the link changes row or width;
70
+ - select linked content, edge-auto-scroll, release, and copy;
71
+ - let linked content leave the viewport and hover the resulting plain and blank cells.
72
+
73
+ Expected: the underline moves with current link cells and never remains under the pointer, even briefly; current links remain clickable and retain their colors; copied text is unchanged; no blank intermediate screen is visible. The implementation limits complete cleanup frames to transitions involving visible explicit or conservative host-detected link candidates. Stable dock typing and motion within one unchanged link retain bounded differential paint.
74
+
75
+ Known gaps before acceptance: the exact built candidate still needs physical Windows Terminal review; explicit-mode baseline behavior was not confirmed; required code CI has not yet been recorded; and user acceptance remains open.
76
+
77
+ ## Evidence and limitations
78
+
79
+ Each run creates its own ignored `.artifacts/ghost-link-baseline/run-*/trace.jsonl`. It records checkout commit and dirty status, supplied host facts, geometry, requested writes, actual forwarded writes, adapter decisions, probe input, and explicit human observations. It captures only the synthetic fixture, not an agent conversation. Review local file targets before sharing the trace.
80
+
81
+ For noninteractive protocol evidence:
82
+
83
+ ```sh
84
+ ./scripts/pi/reproduce-ghost-link-underlines --capture
85
+ ```
86
+
87
+ Capture mode always records `physical-result: not-observed`. Final text, closed OSC 8 sequences, and a preserved clear cannot prove that Windows Terminal discarded its hover overlay. A clean probe also does not disprove the original A1 screenshot: the complete UI pipeline still needs review.
88
+
89
+ Baseline task 1.2 remains incomplete: the mode-2 failure, host facts, and a helpful persistent-clear comparison are recorded, but explicit-mode and fully-clean control outcomes have not been confirmed. The remaining production repair and exact-candidate acceptance tasks remain open. If the preserved-clear control still ghosts, that is evidence to investigate before assuming clear preservation alone is sufficient.