@timurproko/a1 0.2.6 → 0.2.7-dev.1221

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 (410) hide show
  1. package/README.md +41 -3
  2. package/bin/automatic-update.js +7 -0
  3. package/bin/cli.js +4 -0
  4. package/bin/guardian.js +5 -0
  5. package/bin/tab-launch-context.d.ts +27 -0
  6. package/bin/tab-launch-context.js +94 -0
  7. package/bin/ui.js +107 -59
  8. package/dist/app/session-shell/clipboard-diagnostics.js +1 -1
  9. package/dist/app/session-shell/dialog-coordinator.d.ts +42 -0
  10. package/dist/app/session-shell/dialog-coordinator.js +133 -0
  11. package/dist/app/session-shell/dock-chrome.d.ts +34 -0
  12. package/dist/app/session-shell/dock-chrome.js +109 -0
  13. package/dist/app/session-shell/exit-notice.d.ts +1 -1
  14. package/dist/app/session-shell/exit-notice.js +1 -1
  15. package/dist/app/session-shell/extension-surface.d.ts +30 -0
  16. package/dist/app/session-shell/extension-surface.js +105 -0
  17. package/dist/app/session-shell/helper-pool.d.ts +3 -5
  18. package/dist/app/session-shell/helper-pool.js +3 -5
  19. package/dist/app/session-shell/input-surface-switch.d.ts +36 -0
  20. package/dist/app/session-shell/input-surface-switch.js +85 -0
  21. package/dist/app/session-shell/login-interaction.d.ts +27 -0
  22. package/dist/app/session-shell/login-interaction.js +91 -0
  23. package/dist/app/session-shell/prompt-submission.d.ts +48 -0
  24. package/dist/app/session-shell/prompt-submission.js +276 -0
  25. package/dist/app/session-shell/resident-tab-coordinator.d.ts +38 -0
  26. package/dist/app/session-shell/resident-tab-coordinator.js +77 -0
  27. package/dist/app/session-shell/response-copy-helper.js +21 -6
  28. package/dist/app/session-shell/response-copy-protocol.d.ts +1 -1
  29. package/dist/app/session-shell/response-copy-transport.d.ts +16 -6
  30. package/dist/app/session-shell/response-copy-transport.js +69 -17
  31. package/dist/app/session-shell/session-concern.d.ts +22 -0
  32. package/dist/app/session-shell/session-concern.js +29 -0
  33. package/dist/app/session-shell/session-lifecycle.d.ts +29 -0
  34. package/dist/app/session-shell/session-lifecycle.js +49 -0
  35. package/dist/app/session-shell/session-shell-root.d.ts +42 -6
  36. package/dist/app/session-shell/session-shell-root.js +196 -908
  37. package/dist/app/session-shell/session-shell.d.ts +3 -8
  38. package/dist/app/session-shell/session-shell.js +324 -835
  39. package/dist/app/session-shell/session-viewport-controller.d.ts +2 -2
  40. package/dist/app/session-shell/session-viewport-controller.js +29 -15
  41. package/dist/app/session-shell/settings-bindings.d.ts +17 -0
  42. package/dist/app/session-shell/settings-bindings.js +91 -0
  43. package/dist/app/session-shell/shell-editor-factory.d.ts +27 -0
  44. package/dist/app/session-shell/shell-editor-factory.js +102 -0
  45. package/dist/app/session-shell/shell-host.d.ts +6 -0
  46. package/dist/app/session-shell/shell-host.js +34 -7
  47. package/dist/app/session-shell/shell-layout.d.ts +64 -0
  48. package/dist/app/session-shell/shell-layout.js +18 -0
  49. package/dist/app/session-shell/suggestion-surface.d.ts +25 -0
  50. package/dist/app/session-shell/suggestion-surface.js +63 -0
  51. package/dist/app/session-shell/transcript-document.d.ts +78 -0
  52. package/dist/app/session-shell/transcript-document.js +365 -0
  53. package/dist/app/session-shell/viewport-layout.d.ts +31 -0
  54. package/dist/app/session-shell/viewport-layout.js +160 -0
  55. package/dist/app/session-shell/workflow-output.d.ts +33 -0
  56. package/dist/app/session-shell/workflow-output.js +174 -0
  57. package/dist/app/session-shell/workflow-router.d.ts +25 -0
  58. package/dist/app/session-shell/workflow-router.js +39 -0
  59. package/dist/cli/dispatch.d.ts +11 -1
  60. package/dist/cli/dispatch.js +79 -5
  61. package/dist/cli/tabs-request.d.ts +7 -0
  62. package/dist/cli/tabs-request.js +1 -0
  63. package/dist/cli/tabs.d.ts +14 -0
  64. package/dist/cli/tabs.js +151 -0
  65. package/dist/cli/version-stats.js +38 -3
  66. package/dist/composition/owned-settings.d.ts +12 -0
  67. package/dist/composition/owned-settings.js +36 -0
  68. package/dist/composition/owned-ui.d.ts +27 -28
  69. package/dist/composition/owned-ui.js +205 -153
  70. package/dist/composition/resident-tab-bridge.d.ts +25 -0
  71. package/dist/composition/resident-tab-bridge.js +180 -0
  72. package/dist/composition/session-backend.d.ts +19 -0
  73. package/dist/composition/session-backend.js +1 -0
  74. package/dist/composition/session-runtime-registry.d.ts +20 -0
  75. package/dist/composition/session-runtime-registry.js +85 -0
  76. package/dist/composition/settings-route-host.d.ts +16 -1
  77. package/dist/composition/settings-route-host.js +29 -10
  78. package/dist/composition/settings-search-input.d.ts +9 -0
  79. package/dist/composition/settings-search-input.js +58 -0
  80. package/dist/composition/startup-route.d.ts +32 -0
  81. package/dist/composition/startup-route.js +72 -0
  82. package/dist/composition/utility-tab.d.ts +28 -0
  83. package/dist/composition/utility-tab.js +242 -0
  84. package/dist/contracts/owned-ui/index.d.ts +1 -1
  85. package/dist/contracts/owned-ui/model.d.ts +3 -0
  86. package/dist/contracts/owned-ui/session-backend.d.ts +3 -0
  87. package/dist/contracts/owned-ui/session-workflows.d.ts +11 -4
  88. package/dist/contracts/presentation/index.d.ts +11 -0
  89. package/dist/contracts/presentation/index.js +12 -0
  90. package/dist/features/launch/development-launch.js +6 -0
  91. package/dist/features/launch/index.d.ts +1 -1
  92. package/dist/features/launch/intent.d.ts +3 -1
  93. package/dist/features/launch/intent.js +7 -4
  94. package/dist/features/launch/profile-paths.js +4 -0
  95. package/dist/features/owned-ui/plus-menu-dialog.d.ts +22 -0
  96. package/dist/features/owned-ui/plus-menu-dialog.js +76 -0
  97. package/dist/features/owned-ui/project-trust-dialog.d.ts +1 -1
  98. package/dist/features/owned-ui/project-trust-dialog.js +6 -8
  99. package/dist/features/owned-ui/project-trust-prompt.d.ts +1 -0
  100. package/dist/features/owned-ui/project-trust-prompt.js +7 -3
  101. package/dist/features/owned-ui/reference-screen-app.d.ts +2 -0
  102. package/dist/features/owned-ui/reference-screen-app.js +12 -2
  103. package/dist/features/owned-ui/settings-app.d.ts +12 -2
  104. package/dist/features/owned-ui/settings-app.js +116 -81
  105. package/dist/features/owned-ui/settings-search-input.d.ts +29 -0
  106. package/dist/features/owned-ui/settings-search-input.js +1 -0
  107. package/dist/features/prompt-history/index.d.ts +1 -1
  108. package/dist/features/prompt-history/paths.d.ts +2 -1
  109. package/dist/features/prompt-history/paths.js +10 -2
  110. package/dist/features/prompt-history/service.d.ts +5 -0
  111. package/dist/features/prompt-history/service.js +1 -1
  112. package/dist/features/resident-tab/auto-name.d.ts +11 -0
  113. package/dist/features/resident-tab/auto-name.js +44 -0
  114. package/dist/features/resident-tab/index.d.ts +5 -0
  115. package/dist/features/resident-tab/index.js +7 -0
  116. package/dist/features/resident-tab/shortcut-bindings-file.d.ts +8 -0
  117. package/dist/features/resident-tab/shortcut-bindings-file.js +40 -0
  118. package/dist/features/resident-tab/shortcut-declarations.d.ts +13 -0
  119. package/dist/features/resident-tab/shortcut-declarations.js +26 -0
  120. package/dist/features/resident-tab/shortcut-projection.d.ts +29 -0
  121. package/dist/features/resident-tab/shortcut-projection.js +64 -0
  122. package/dist/features/resident-tab/status-deriver.d.ts +10 -0
  123. package/dist/features/resident-tab/status-deriver.js +12 -0
  124. package/dist/foundation/launch-context/index.d.ts +12 -0
  125. package/dist/foundation/launch-context/index.js +26 -0
  126. package/dist/foundation/launch-guardian/exit-watcher.d.ts +14 -0
  127. package/dist/foundation/launch-guardian/exit-watcher.js +94 -0
  128. package/dist/foundation/launch-guardian/main.d.ts +7 -1
  129. package/dist/foundation/launch-guardian/main.js +60 -7
  130. package/dist/foundation/lifecycle/session-repository-context.js +16 -2
  131. package/dist/foundation/process-containment/{native-guardian-containment.d.ts → addon-containment.d.ts} +7 -5
  132. package/dist/foundation/process-containment/addon-containment.js +139 -0
  133. package/dist/foundation/process-containment/addon-process-inspector.d.ts +11 -0
  134. package/dist/foundation/process-containment/addon-process-inspector.js +36 -0
  135. package/dist/foundation/process-containment/addon.d.ts +42 -0
  136. package/dist/foundation/process-containment/addon.js +57 -0
  137. package/dist/foundation/process-containment/artifact.d.ts +1 -1
  138. package/dist/foundation/process-containment/artifact.js +6 -5
  139. package/dist/foundation/process-containment/contracts.d.ts +2 -0
  140. package/dist/foundation/process-containment/index.d.ts +4 -4
  141. package/dist/foundation/process-containment/index.js +3 -3
  142. package/dist/foundation/process-containment/native-process-inspector.d.ts +2 -1
  143. package/dist/foundation/process-containment/native-process-inspector.js +10 -10
  144. package/dist/foundation/release/automatic-update.d.ts +37 -0
  145. package/dist/foundation/release/automatic-update.js +265 -0
  146. package/dist/foundation/release/bootstrap.d.ts +7 -9
  147. package/dist/foundation/release/bootstrap.js +107 -24
  148. package/dist/foundation/release/cohort-state.d.ts +1 -1
  149. package/dist/foundation/release/cohort-state.js +1 -1
  150. package/dist/foundation/release/dependency-certification.js +54 -19
  151. package/dist/foundation/release/early-accent.d.ts +12 -0
  152. package/dist/foundation/release/early-accent.js +59 -0
  153. package/dist/foundation/release/index.d.ts +2 -2
  154. package/dist/foundation/release/index.js +2 -2
  155. package/dist/foundation/release/latest-release.d.ts +24 -2
  156. package/dist/foundation/release/latest-release.js +51 -1
  157. package/dist/foundation/release/progress-palette.generated.d.ts +137 -3
  158. package/dist/foundation/release/progress-palette.generated.js +137 -3
  159. package/dist/foundation/release/release-gc.d.ts +3 -0
  160. package/dist/foundation/release/release-gc.js +59 -8
  161. package/dist/foundation/release/release-store.d.ts +12 -0
  162. package/dist/foundation/release/release-store.js +124 -2
  163. package/dist/foundation/release/update-execution-lease.d.ts +48 -0
  164. package/dist/foundation/release/update-execution-lease.js +161 -0
  165. package/dist/foundation/release/update.d.ts +12 -7
  166. package/dist/foundation/release/update.js +281 -196
  167. package/dist/foundation/resident-tabs/bounded-host-command.d.ts +18 -0
  168. package/dist/foundation/resident-tabs/bounded-host-command.js +39 -0
  169. package/dist/foundation/resident-tabs/bridge-client.d.ts +70 -0
  170. package/dist/foundation/resident-tabs/bridge-client.js +321 -0
  171. package/dist/foundation/resident-tabs/doctor.d.ts +28 -0
  172. package/dist/foundation/resident-tabs/doctor.js +166 -0
  173. package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +27 -0
  174. package/dist/foundation/resident-tabs/draft-checkpoint.js +145 -0
  175. package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +36 -0
  176. package/dist/foundation/resident-tabs/ensure-terminal-host.js +151 -0
  177. package/dist/foundation/resident-tabs/fault-injection.d.ts +8 -0
  178. package/dist/foundation/resident-tabs/fault-injection.js +26 -0
  179. package/dist/foundation/resident-tabs/fixture-control.d.ts +7 -0
  180. package/dist/foundation/resident-tabs/fixture-control.js +35 -0
  181. package/dist/foundation/resident-tabs/host-entry.d.ts +1 -0
  182. package/dist/foundation/resident-tabs/host-entry.js +17 -0
  183. package/dist/foundation/resident-tabs/index.d.ts +12 -0
  184. package/dist/foundation/resident-tabs/index.js +6 -0
  185. package/dist/foundation/resident-tabs/maintenance.d.ts +39 -0
  186. package/dist/foundation/resident-tabs/maintenance.js +75 -0
  187. package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +34 -0
  188. package/dist/foundation/resident-tabs/progress-observation-schema.js +1 -0
  189. package/dist/foundation/resident-tabs/progress-observation.d.ts +4 -0
  190. package/dist/foundation/resident-tabs/progress-observation.js +150 -0
  191. package/dist/foundation/resident-tabs/prompt-journal.d.ts +63 -0
  192. package/dist/foundation/resident-tabs/prompt-journal.js +213 -0
  193. package/dist/foundation/resident-tabs/protocol.d.ts +12 -0
  194. package/dist/foundation/resident-tabs/protocol.js +195 -0
  195. package/dist/foundation/resident-tabs/recovery.d.ts +26 -0
  196. package/dist/foundation/resident-tabs/recovery.js +205 -0
  197. package/dist/foundation/resident-tabs/release-holds.d.ts +28 -0
  198. package/dist/foundation/resident-tabs/release-holds.js +75 -0
  199. package/dist/foundation/resident-tabs/routes.d.ts +5 -0
  200. package/dist/foundation/resident-tabs/routes.js +5 -0
  201. package/dist/foundation/resident-tabs/routing.d.ts +11 -0
  202. package/dist/foundation/resident-tabs/routing.js +10 -0
  203. package/dist/foundation/resident-tabs/session-sync.d.ts +14 -0
  204. package/dist/foundation/resident-tabs/session-sync.js +37 -0
  205. package/dist/foundation/resident-tabs/settings.d.ts +12 -0
  206. package/dist/foundation/resident-tabs/settings.js +58 -0
  207. package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +14 -0
  208. package/dist/foundation/resident-tabs/terminal-host-artifact.js +78 -0
  209. package/dist/foundation/resident-tabs/zip-archive.d.ts +9 -0
  210. package/dist/foundation/resident-tabs/zip-archive.js +56 -0
  211. package/dist/foundation/session-writer-lock/index.d.ts +30 -0
  212. package/dist/foundation/session-writer-lock/index.js +203 -0
  213. package/dist/foundation/startup/startup-descriptor.js +2 -2
  214. package/dist/foundation/terminal-cleanup/index.d.ts +1 -1
  215. package/dist/foundation/terminal-cleanup/index.js +1 -1
  216. package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +6 -0
  217. package/dist/foundation/terminal-cleanup/terminal-reset.js +6 -0
  218. package/dist/integrations/pi/components/editor-interaction.d.ts +2 -0
  219. package/dist/integrations/pi/components/modal-frame.d.ts +17 -1
  220. package/dist/integrations/pi/components/modal-frame.js +48 -9
  221. package/dist/integrations/pi/components/models-dialog.js +4 -52
  222. package/dist/integrations/pi/components/owned-editor-ux.d.ts +6 -1
  223. package/dist/integrations/pi/components/owned-editor-ux.js +90 -6
  224. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +4 -4
  225. package/dist/integrations/pi/components/resources/builtin-themes.js +4 -4
  226. package/dist/integrations/pi/components/share-operation-dialog.d.ts +2 -0
  227. package/dist/integrations/pi/components/share-operation-dialog.js +2 -1
  228. package/dist/integrations/pi/components/shell-editor-autocomplete.js +58 -36
  229. package/dist/integrations/pi/components/shell-extension-ui.js +79 -60
  230. package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
  231. package/dist/integrations/pi/components/shell-footer-status.js +21 -5
  232. package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
  233. package/dist/integrations/pi/components/shell-presenters-info.d.ts +5 -2
  234. package/dist/integrations/pi/components/shell-presenters-info.js +18 -4
  235. package/dist/integrations/pi/components/shell-presenters-transcript.js +4 -1
  236. package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -1
  237. package/dist/integrations/pi/components/shell-shared-facade.d.ts +12 -1
  238. package/dist/integrations/pi/components/skills-dialog.js +2 -2
  239. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  240. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +17 -4
  241. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  242. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  243. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  244. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  245. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  246. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  247. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  248. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  249. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +8 -6
  250. package/dist/integrations/pi/components/upstream/components/owned-editor.js +16 -9
  251. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  252. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +4 -4
  253. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +2 -2
  254. package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +2 -1
  255. package/dist/integrations/pi/components/upstream/components/session-footer.js +31 -25
  256. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  257. package/dist/integrations/pi/components/upstream/components/session-selector.js +8 -7
  258. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  259. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  260. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +2 -2
  261. package/dist/integrations/pi/components/upstream/components/status-indicator.js +3 -3
  262. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  263. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  264. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +8 -7
  265. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +10 -9
  266. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +2 -6
  267. package/dist/integrations/pi/components/upstream/components/tool-execution.js +103 -101
  268. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +9 -9
  269. package/dist/integrations/pi/components/upstream/components/tree-selector.js +13 -21
  270. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  271. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  272. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +2 -2
  273. package/dist/integrations/pi/components/upstream/history/editor-core.js +7 -5
  274. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  275. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  276. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  277. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  278. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  279. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  280. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  281. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  282. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
  283. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  284. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +5 -0
  285. package/dist/integrations/pi/components/upstream/theme/theme.js +29 -2
  286. package/dist/integrations/pi/engine/adapter.d.ts +5 -77
  287. package/dist/integrations/pi/engine/adapter.js +95 -394
  288. package/dist/integrations/pi/engine/command-dispatch.d.ts +13 -0
  289. package/dist/integrations/pi/engine/command-dispatch.js +57 -0
  290. package/dist/integrations/pi/engine/host.js +2 -2
  291. package/dist/integrations/pi/engine/offline-settings-port.d.ts +23 -0
  292. package/dist/integrations/pi/engine/offline-settings-port.js +53 -0
  293. package/dist/integrations/pi/engine/pi-settings-metadata.json +14 -2
  294. package/dist/integrations/pi/engine/ports.d.ts +56 -0
  295. package/dist/integrations/pi/engine/ports.js +93 -0
  296. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +1 -0
  297. package/dist/integrations/pi/engine/prompt-suggestions.js +40 -0
  298. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  299. package/dist/integrations/pi/engine/runtime-integration.js +102 -29
  300. package/dist/integrations/pi/engine/session-runtime.d.ts +0 -6
  301. package/dist/integrations/pi/engine/session-runtime.js +13 -5
  302. package/dist/integrations/pi/engine/session-selection.d.ts +3 -0
  303. package/dist/integrations/pi/engine/session-selection.js +45 -9
  304. package/dist/integrations/pi/engine/settings-bridge.d.ts +5 -0
  305. package/dist/integrations/pi/engine/settings-bridge.js +15 -0
  306. package/dist/integrations/pi/engine/settings-port.js +11 -15
  307. package/dist/integrations/pi/engine/view-state.d.ts +42 -0
  308. package/dist/integrations/pi/engine/view-state.js +126 -0
  309. package/dist/integrations/pi/engine/workflow-contexts.js +10 -1
  310. package/dist/integrations/pi/engine/workflow-runner.js +73 -4
  311. package/dist/integrations/pi/engine/workflow-support.d.ts +12 -0
  312. package/dist/integrations/pi/engine/workflow-support.js +36 -0
  313. package/dist/integrations/pi/engine/workflows.d.ts +3 -1
  314. package/dist/integrations/pi/engine/workflows.js +1 -0
  315. package/dist/integrations/pi/startup-public.js +257 -310
  316. package/dist/integrations/pi/startup-public.manifest.json +564 -440
  317. package/dist/integrations/pi/tui-runtime/adapter.d.ts +6 -0
  318. package/dist/integrations/pi/tui-runtime/adapter.js +32 -1
  319. package/dist/integrations/pi/tui-runtime/contracts.d.ts +5 -0
  320. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +12 -1
  321. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +31 -2
  322. package/dist/native/darwin-arm64/manifest.json +10 -7
  323. package/dist/native/darwin-arm64/process-guardian.node +0 -0
  324. package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +10500 -0
  325. package/dist/native/darwin-arm64/terminal-host.manifest.json +46 -0
  326. package/dist/native/darwin-arm64/terminal-host.node +0 -0
  327. package/dist/native/darwin-x64/manifest.json +23 -0
  328. package/dist/native/darwin-x64/process-guardian.node +0 -0
  329. package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +10737 -0
  330. package/dist/native/darwin-x64/terminal-host.manifest.json +46 -0
  331. package/dist/native/darwin-x64/terminal-host.node +0 -0
  332. package/dist/native/linux-x64/manifest.json +10 -7
  333. package/dist/native/linux-x64/process-guardian.node +0 -0
  334. package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +11226 -0
  335. package/dist/native/linux-x64/terminal-host.manifest.json +46 -0
  336. package/dist/native/linux-x64/terminal-host.node +0 -0
  337. package/dist/native/win32-x64/manifest.json +10 -7
  338. package/dist/native/win32-x64/process-guardian.node +0 -0
  339. package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +10757 -0
  340. package/dist/native/win32-x64/terminal-host.manifest.json +46 -0
  341. package/dist/native/win32-x64/terminal-host.node +0 -0
  342. package/dist/product-identity.d.ts +3 -3
  343. package/dist/product-identity.js +4 -4
  344. package/dist/product-identity.json +16 -2
  345. package/dist/runtime-payload-inventory.json +6330 -6677
  346. package/dist/ui/apps/host.d.ts +2 -0
  347. package/dist/ui/apps/host.js +7 -1
  348. package/dist/ui/components/dialog-panel.js +35 -30
  349. package/dist/ui/components/index.d.ts +2 -2
  350. package/dist/ui/components/index.js +1 -1
  351. package/dist/ui/components/line-input.d.ts +4 -1
  352. package/dist/ui/components/line-input.js +3 -1
  353. package/dist/ui/components/prompt-input.d.ts +11 -8
  354. package/dist/ui/components/prompt-input.js +15 -13
  355. package/dist/ui/components/selection-copy.d.ts +2 -0
  356. package/dist/ui/components/selection-copy.js +13 -0
  357. package/dist/ui/components/spans.js +2 -2
  358. package/dist/ui/components/submitted-prompt.d.ts +9 -6
  359. package/dist/ui/components/submitted-prompt.js +20 -12
  360. package/dist/ui/components/surface.js +4 -2
  361. package/dist/ui/components/text.d.ts +3 -6
  362. package/dist/ui/components/text.js +6 -8
  363. package/dist/ui/components/transcript-viewport.d.ts +9 -2
  364. package/dist/ui/components/transcript-viewport.js +176 -55
  365. package/dist/ui/settings/declarations.d.ts +90 -16
  366. package/dist/ui/settings/declarations.js +67 -14
  367. package/dist/ui/settings/early-accent.d.ts +81 -0
  368. package/dist/ui/settings/early-accent.js +50 -0
  369. package/dist/ui/settings/index.d.ts +4 -2
  370. package/dist/ui/settings/index.js +2 -1
  371. package/dist/ui/settings/manager.d.ts +16 -3
  372. package/dist/ui/settings/manager.js +122 -33
  373. package/dist/ui/settings/migrations.d.ts +6 -0
  374. package/dist/ui/settings/migrations.js +73 -0
  375. package/dist/ui/settings/profile-document.d.ts +26 -0
  376. package/dist/ui/settings/profile-document.js +164 -0
  377. package/dist/ui/settings/progress-palette.generated.d.ts +139 -0
  378. package/dist/ui/settings/progress-palette.generated.js +139 -0
  379. package/dist/ui/settings/sections.d.ts +4 -0
  380. package/dist/ui/settings/sections.js +9 -3
  381. package/docs/architecture/boundaries.md +24 -9
  382. package/docs/architecture/evidence/resident-tabs/linux-x64.md +37 -0
  383. package/docs/architecture/evidence/resident-tabs/macos-arm64.md +36 -0
  384. package/docs/architecture/evidence/resident-tabs/macos-x64.md +35 -0
  385. package/docs/architecture/evidence/resident-tabs/windows-x64.md +36 -0
  386. package/docs/architecture/internal-naming.md +3 -1
  387. package/docs/architecture/process-guardian-provenance.md +18 -10
  388. package/docs/architecture/project-structure.md +8 -0
  389. package/docs/architecture/resident-tabs-requirements.md +18 -0
  390. package/docs/architecture/resident-tabs.md +648 -0
  391. package/docs/architecture/response-copy-delivery.md +1 -1
  392. package/docs/architecture/terminal-host-proof-gate.md +2 -0
  393. package/docs/architecture/terminal-host-provenance.md +16 -4
  394. package/docs/architecture/tool-image-presentation.md +2 -1
  395. package/docs/architecture/toolchain.md +11 -9
  396. package/docs/ci-release-runbook.md +14 -7
  397. package/docs/features/launch-profiles.md +11 -8
  398. package/docs/features/prompt-history.md +41 -20
  399. package/docs/manual-resident-tabs-acceptance.md +51 -0
  400. package/docs/openspec-archive-automation.md +49 -22
  401. package/docs/validation.md +49 -9
  402. package/package.json +19 -6
  403. package/dist/foundation/process-containment/darwin-process-inspector.d.ts +0 -5
  404. package/dist/foundation/process-containment/darwin-process-inspector.js +0 -7
  405. package/dist/foundation/process-containment/native-guardian-containment.js +0 -152
  406. package/dist/foundation/process-containment/windows-process-inspector.d.ts +0 -19
  407. package/dist/foundation/process-containment/windows-process-inspector.js +0 -56
  408. package/dist/native/darwin-arm64/process-guardian +0 -0
  409. package/dist/native/linux-x64/process-guardian +0 -0
  410. package/dist/native/win32-x64/process-guardian.exe +0 -0
@@ -1,6 +1,6 @@
1
1
  # Atomic OpenSpec delivery and legacy archival
2
2
 
3
- New OpenSpec deliveries use one ordinary development pull request from draft planning through implementation, validation, acceptance, specification synchronization, and archival. An authorized maintainer chooses integration by manually merging the exact validated head or personally enabling GitHub native auto-merge for that unchanged head. Agents, Apps, bots, merge queue, and repository automation never arm or invoke implementation integration and never create a version-3 acceptance or archive follow-up PR.
3
+ New OpenSpec deliveries use one ordinary development pull request from draft planning through implementation, validation, acceptance, specification synchronization, and archival. An authorized maintainer chooses integration by manually merging the exact validated head, personally enabling GitHub native auto-merge for that unchanged head, or explicitly asking the active agent to merge the identified currently eligible head. Agents never infer or independently choose integration; Apps, bots, merge queue, workflows, and repository automation receive no implementation authority, and no version-3 acceptance or archive follow-up PR is created.
4
4
 
5
5
  Unrelated standalone documentation remains separate: a non-draft unassociated PR changing only `openspec/**`, `docs/**`, and/or root `README.md` retains the existing CI-gated automatic route. A new active change, implementation association, malformed lifecycle data, or mixed path remains outside documentation-owned integration. Before finalization or without valid human provenance, any arm is disabled; a finalized version-3 human arm remains a separate maintainer-owned route.
6
6
 
@@ -8,18 +8,32 @@ Version-1 and version-2 deliveries and their existing comments, acceptance PRs,
8
8
 
9
9
  ## Version-3 lifecycle
10
10
 
11
- 1. **Draft plan:** create one normally named branch/PR such as `feature/...`, `fix/...`, or `chore/...`. Start the body with `## Proposal`, use it for one or two sentences of intent, follow it with `## Implementation` for the concrete planned work, omit quoted phase lines and routine validation command lists, and keep machine linkage under final collapsed `Automation`. Keep it draft and include only planning artifacts until the maintainer approves the plan and explicitly requests implementation.
12
- 2. **Same-PR implementation:** continue after explicit approval in the same worktree, branch, history, draft PR, and phase-free body. Reconcile approved refinements in proposal, design, deltas, and tasks before corresponding code edits.
13
- 3. **Complete evidence:** finish implementation, required tests/evidence, substantive tasks, and explicit known-gap disposition. CI success is objective evidence, not acceptance.
14
- 4. **Plain acceptance list:** keep the body phase-free and add final `## Acceptance` with one to ten concise implementation-specific behavior-and-result bullets. Do not use checkboxes, generic review/CI/approval/archive statements, URLs, mentions, or automated-test inventory.
15
- 5. **Ready and automated finalization:** mark the PR ready. The trusted `OpenSpec finalization` workflow reconciles current `develop`, conservatively synchronizes all deltas, moves the active change into its dated archive, stages the conditional acceptance manifest, commits that to the same branch with the archive App identity, and writes the emitted paths into the body's implementation fence. Running the [finalization command](#finalization-command) locally first is optional and yields the same bytes.
11
+ 1. **Draft plan:** create one normally named branch/PR such as `feature/...`, `fix/...`, or `chore/...`. Start the body with `## Proposal`, use it for one or two sentences of intent, and follow it with one or more unchecked, outcome-sized task items under `## Implementation`, with no fixed maximum. Each item names a delivered code outcome. Omit generic process tasks; run, verify, validate, evidence, or manual-test items; quoted phase lines; and routine validation command lists, and keep machine linkage under final collapsed `Automation`. Keep it draft and include only planning artifacts until the maintainer approves the plan and explicitly requests implementation.
12
+ 2. **Same-PR implementation:** continue after explicit approval in the same worktree, branch, history, draft PR, and phase-free body. Check an Implementation item as soon as its associated code and tests are written and its detailed task bookkeeping is complete; an ordinary progress edit changes only `[ ]` to `[x]` and is not deferred until handoff. Adding, removing, reordering, or rewriting an item is a scope refinement requiring explicit approval and coherent planning updates, with affected scope left unchecked. Reconcile approved refinements before corresponding code edits.
13
+ 3. **Complete implementation:** finish the code and its tests, substantive tasks, and explicit known-gap disposition. CI runs those tests after readiness; its success is objective evidence, not acceptance, and GitHub check counts are not Implementation task progress. Manual validation is the maintainer's optional choice before integrating and never blocks a checkbox, finalization, or merge.
14
+ 4. **Plain acceptance list:** before checking the final item, keep the body phase-free and add final `## Acceptance` with one to ten concise implementation-specific behavior-and-result bullets. Do not use checkboxes, generic review/CI/approval/archive statements, angle-bracket placeholders or HTML, URLs, mentions, or automated-test inventory.
15
+ 5. **Automatic readiness and finalization:** reconcile and push current `origin/develop`, run the [delivery body check](#delivery-body-check) on the intended final body, then check the final item. That checkbox update completes the agent-owned implementation job; agents never mark implementation PRs ready themselves. Trusted automation revalidates the exact fully complete version-3 task-list snapshot and all pre-finalization inputs, marks the PR ready, and then conservatively synchronizes all deltas, moves the active change into its dated archive, stages the conditional acceptance manifest, commits that to the same branch with the archive App identity, and writes the emitted paths into the body's implementation fence. It never checks tasks or infers completion. Running the [finalization command](#finalization-command) locally first is optional and yields the same bytes.
16
16
  6. **Validate:** one normal exact-head workflow validates the finalized head: implementation, synchronized specs, archive, manifest, tasks/evidence, exact PR-body list, and every selected product/governance scope before emitting the stable protected aggregate. A new commit or acceptance-list change re-finalizes automatically when needed and requires full renewed validation; no lifecycle body edit or second workflow run is required.
17
- 7. **Maintainer integration accepts:** after reviewing the finalized candidate, an authorized human either manually merges the exact validated head after the stable protected aggregate succeeds or personally enables GitHub native auto-merge for that unchanged head so protected integration waits for the aggregate. That human action means the listed scenarios are accepted. Agents, Apps, bots, merge queue, automation-owned implementation arms, and documentation integration remain forbidden. A changed head, acceptance list, or finalization invalidates the earlier arm and requires the maintainer to choose again.
17
+ 7. **Maintainer integration accepts:** after reviewing the finalized candidate, an authorized human manually merges the exact validated head, personally enables GitHub native auto-merge for that unchanged head, or explicitly asks the active agent to merge that identified head while it is currently eligible. The agent route re-reads authoritative state, requires the exact finalized head and acceptance list, current `develop`, successful `Development validation required`, positive mergeability, and the maintainer's authenticated human `User`, then issues one protected squash merge with expected-head enforcement. It never waits, arms auto-merge, retries later, uses automation credentials or merge queue, or bypasses protection. Each route means the listed scenarios are accepted. A candidate change invalidates the decision and requires the maintainer to choose again.
18
18
  8. **Verify and clean:** trusted post-merge policy derives `Archived` and reports `accepted-and-archived` from committed bytes and immutable GitHub provenance without editing the accepted PR body. It publishes no lifecycle branch or PR. Shared exact-head remote cleanup may delete the unchanged topic ref; local cleanup remains separately ownership-controlled: the agent parks the worktree with `handoff` at step 7, and the next session's `sweep` removes it once the merge, archive, and remote-ref evidence verify (see [local cleanup](local-worktree-cleanup.md)).
19
19
 
20
+ ### Maintainer-requested agent merge
21
+
22
+ The permission is one-shot and candidate-bound. A same-session instruction such as “merge it” is sufficient only when the conversation identifies one handed-off PR and head unambiguously; implementation approval, green CI, an earlier request, or a standing preference is not merge authority. If the PR is not currently eligible, report the blocker and stop. Do not poll, watch, arm native auto-merge, or retain the instruction for later.
23
+
24
+ Immediately before mutation, refresh the PR and authenticated principal. Require an open non-draft same-repository PR into `develop`, the requested exact finalized head and acceptance list, `MERGEABLE`/`CLEAN` state, successful `Development validation required` for that head, and a human `User` with write, maintain, or admin repository permission. Then use the ordinary protected route with no `--admin` or `--auto`:
25
+
26
+ ```bash
27
+ gh pr merge <pr> --repo <owner>/<repository> --squash --match-head-commit <exact-head-sha>
28
+ ```
29
+
30
+ GitHub branch protection remains authoritative. A refusal, changed head, advanced target, stale finalization, failed or pending check, ambiguous identity, or unavailable read ends the attempt and needs a fresh maintainer request. After success, use the ordinary read-only accepted/archive verification and cleanup path.
31
+
32
+ The policy PR introducing this route must integrate through the previously deployed maintainer-owned route. Only a later candidate may use a requested agent merge after this policy is present on `develop`.
33
+
20
34
  ### Complete-regression evidence ordering
21
35
 
22
- PR-attached Full regression is selected only for a repair that the trusted triage created from a failed Full regression: base policy verifies the immutable `openspec-ci` App author, generated candidate identity, and `regression-provenance.json`. Human-authored lookalikes, publishing or validation-authority changes, labels, Publish-only repairs, and successful-run persistent-overrun candidates retain bounded ordinary validation. Generated repair drafts run no Development test suites, including after implementation begins. Finish substantive implementation tasks, focused local evidence, pre-finalization observations, and known-gap disposition before marking ready. The ready active head defers testing while trusted finalization publishes the candidate; the finalized head then receives all four native lanes as new full evidence, required by `Development validation required` alongside the existing gates.
36
+ PR-attached Full regression is selected only for a repair that the trusted triage created from a failed Full regression: base policy verifies the immutable `openspec-ci` App author, generated candidate identity, and `regression-provenance.json`. Human-authored lookalikes, publishing or validation-authority changes, labels, Publish-only repairs, and successful-run persistent-overrun candidates retain bounded ordinary validation. Generated repair drafts run no Development test suites, including after implementation begins. Finish substantive implementation tasks, focused local evidence, pre-finalization observations, and known-gap disposition before checking the final Implementation item. The ready active head defers testing while trusted finalization publishes the candidate; the finalized head then receives all four native lanes as new full evidence, required by `Development validation required` alongside the existing gates.
23
37
 
24
38
  The final exact-head run is a handoff gate, not a task requiring a future run ID in committed `design.md`. Keep final head/run/selection identity in Actions outcomes and the maintainer handoff; do not invalidate successful evidence with an extra recording commit. Changed code, acceptance/body metadata, selection labels, or target baseline requires fresh evidence. A selected PR success removes the additional mandatory Full regression dispatch, but a standalone/manual run never substitutes for selected PR checks. Before deployment, existing separate-dispatch obligations remain. Neither PR validation nor manual regression proves numbered-package nightly publication recovery.
25
39
 
@@ -27,7 +41,7 @@ The implementation, synchronized canonical specs, conditional acceptance record,
27
41
 
28
42
  ## Draft PR body
29
43
 
30
- The first screen should separate purpose from delivery detail, not foreground CI mechanics. Distill `Proposal` into one or two sentences answering why the PR exists, then put two to five concrete points under `Implementation` answering what it will deliver:
44
+ The first screen should separate purpose from delivery detail, not foreground CI mechanics. Distill `Proposal` into one or two sentences answering why the PR exists, then put one or more unchecked, implementation-specific outcomes under `Implementation`, with no fixed maximum. They are a coarse progress summary, not a copy of the detailed OpenSpec task ledger:
31
45
 
32
46
  ```markdown
33
47
  ## Proposal
@@ -36,9 +50,9 @@ Replace the multi-PR OpenSpec handoff with one manually merged development PR wh
36
50
 
37
51
  ## Implementation
38
52
 
39
- - Keep planning and implementation in the same draft PR.
40
- - Integrate implementation, synchronized specs, acceptance, and archive atomically.
41
- - Preserve standalone documentation auto-merge while forbidding automation-owned implementation auto-merge.
53
+ - [ ] Keep planning and implementation in the same draft PR.
54
+ - [ ] Integrate implementation, synchronized specs, acceptance, and archive atomically.
55
+ - [ ] Preserve standalone documentation auto-merge while forbidding automation-owned implementation auto-merge.
42
56
 
43
57
  ## Automation
44
58
 
@@ -50,7 +64,7 @@ Replace the multi-PR OpenSpec handoff with one manually merged development PR wh
50
64
  </details>
51
65
  ```
52
66
 
53
- Do not add a quoted phase line or a routine `Validation` section listing commands to an initial draft. Actual validation results belong in CI and the eventual implementation handoff. Continue with the same phase-free body after approval. When implementation is complete and ready for required tests, use this visible order:
67
+ Do not add a quoted phase line, generic CI/review/acceptance/merge/archive tasks, run/verify/validate/evidence/manual-test items, or a routine `Validation` section listing commands to an initial draft. Actual validation results belong in CI and the eventual implementation handoff. Continue with the same phase-free body after approval. Toggle only the exact marker when ordinary work completes; body history must not hide a scope change as progress. Historical version-3 bodies with only plain Implementation bullets remain readable, but new bodies use the task-list form. When implementation is complete and ready for required tests, use this visible order:
54
68
 
55
69
  ```markdown
56
70
  ## Proposal
@@ -59,7 +73,8 @@ Do not add a quoted phase line or a routine `Validation` section listing command
59
73
 
60
74
  ## Implementation
61
75
 
62
- <!-- concrete implementation bullets -->
76
+ - [x] <!-- completed implementation outcome -->
77
+ - [x] <!-- completed implementation outcome -->
63
78
 
64
79
  ## Acceptance
65
80
 
@@ -75,7 +90,7 @@ Do not add a quoted phase line or a routine `Validation` section listing command
75
90
  </details>
76
91
  ```
77
92
 
78
- Keep acceptance absent during proposal review so unfinished intent is not mistaken for final acceptance criteria. The finalization workflow rewrites only the implementation fence; keep the rest of the phase-free body unchanged through exact-head validation, maintainer review, and authorized integration. The same workflow run validates its finalized delivery record and applicable product/governance scopes before the stable protected aggregate succeeds. Do not add a lifecycle body edit or start a second validation run. After integration, trusted verification derives `Archived`; do not rewrite the accepted body.
93
+ Keep acceptance absent during proposal review so unfinished intent is not mistaken for final acceptance criteria. Every Implementation item must be checked before ready/finalization; those markers report implementation progress and never human acceptance. The finalization workflow rewrites only the implementation fence; keep the rest of the phase-free body unchanged through exact-head validation, maintainer review, and authorized integration. The same workflow run validates its finalized delivery record and applicable product/governance scopes before the stable protected aggregate succeeds. Do not add a lifecycle body edit or start a second validation run. After integration, trusted verification derives `Archived`; do not rewrite the accepted body.
79
94
 
80
95
  ## Agent scratch files
81
96
 
@@ -140,13 +155,25 @@ Use plain bullets:
140
155
  - Finalized specs and archive match the implementation.
141
156
  ```
142
157
 
143
- The committed conditional manifest contains the same ordered text. Trusted policy validates membership but never checks or edits it and never claims that the scenarios passed. The authorized maintainer's manual merge or personal native auto-merge arm for the unchanged exact head is the acceptance decision; no acceptance comment, checkbox edit, review-approval requirement, JSON edit, acceptance PR, archive PR, or later command is needed.
158
+ Each Implementation and Acceptance item is one line of 20 to 300 bytes. Draft promotion and the delivery body check reject an Implementation item that starts with `Manually`, `Validate`, `Verify`, `Confirm`, `Prove`, `Run`, or `Test`, mentions manual testing, records or captures evidence, or delivers work "with" coverage, evidence, or validation (`implementation-progress-validation`); merged bodies keep their earlier wording. It must not contain angle-bracket text such as `<job>` or other HTML, URLs, or `@` mentions, and Acceptance items must not be checkboxes. Write a concrete example instead of a placeholder, such as `Develop / Build process guardian`.
159
+
160
+ ### Delivery body check
161
+
162
+ Before checking the final Implementation item, write the intended final body to an ignored artifact file and run the same body validators that trusted promotion uses:
163
+
164
+ ```bash
165
+ node scripts/governance/check-delivery-body.mjs --body-file .artifacts/agent/pr-body.md --final
166
+ ```
167
+
168
+ `--final` validates the body as if every Implementation item were checked, so it can run before the last marker changes. `--pr <n>` reads the current pull request body instead. A defect exits 1 and prints the same `draft-<code>` reason the finalization run would report. The check covers association, Implementation, layout, and Acceptance only; detailed tasks, evidence, and target state remain covered by the [finalization command](#finalization-command) inspection mode.
169
+
170
+ The committed conditional manifest contains the same ordered text. Trusted policy validates membership but never checks or edits it and never claims that the scenarios passed. The authorized maintainer's direct merge, personal native auto-merge arm, or explicit request for the active agent to merge the unchanged currently eligible exact head is the acceptance decision; no acceptance comment, checkbox edit, review-approval requirement, JSON edit, acceptance PR, archive PR, or later command is needed.
144
171
 
145
172
  If the body list changes, candidate validation reruns and compares it with the committed manifest. If the head changes, all prior exact-head CI is stale. If only the body changes to disagree with the manifest, integration remains blocked until the list and committed candidate agree again. No lifecycle body edit is needed after green CI.
146
173
 
147
174
  ## Automated finalization
148
175
 
149
- The `OpenSpec finalization` workflow (`.github/workflows/openspec-finalization.yml`) runs on `pull_request_target` for `synchronize`, `ready_for_review`, `reopened`, and `edited` events of every non-draft PR targeting `develop`, one event at a time per PR. It checks out default-branch policy, installs the pinned tooling without hooks, and runs `scripts/governance/publish-openspec-finalization.mjs --pr <n>`; the PR head enters that process only as the `openspec/` tree the pinned OpenSpec engine reads. Drafts, closed, legacy, and unassociated PRs are skipped. For a version-3 candidate it reconciles the head to its finalized form:
176
+ The `OpenSpec finalization` workflow (`.github/workflows/openspec-finalization.yml`) runs on `pull_request_target` for `opened`, `synchronize`, `ready_for_review`, `converted_to_draft`, `reopened`, and `edited` events targeting `develop`, one event at a time per PR. It checks out default-branch policy, installs the pinned tooling without hooks, and runs `scripts/governance/publish-openspec-finalization.mjs --pr <n>`; the PR head enters that process only as the `openspec/` tree the pinned OpenSpec engine reads. An all-checked version-3 task-list draft with valid Acceptance and complete detailed pre-finalization inputs is re-read as one exact snapshot and marked ready; no content is changed, and incomplete, malformed, legacy, unassociated, forked, or raced drafts remain draft with a stable reason. A draft with any unchecked item is skipped quietly. A finalized PR returned to draft is promoted again when its body still has every item checked, its fence names the exact head as finalized, and the tree holds exactly that archive with no active change; otherwise it stays draft with `draft-finalization-redraft-form`. A draft whose every task-list item is checked but whose promotion is refused for a body, task, evidence, or other content defect fails the run with an `OpenSpec finalization` error annotation naming the `draft-<code>` reason, so the stall shows as a red check instead of a green skip. Closed PRs are skipped. For a ready version-3 candidate the workflow reconciles the head to its finalized form:
150
177
 
151
178
  - **Active and current:** ordinary finalization with today's UTC date; one `docs(openspec): finalize <change>` commit.
152
179
  - **Finalized, valid, and current:** nothing is pushed; the run reports `already-finalized`.
@@ -155,7 +182,7 @@ The `OpenSpec finalization` workflow (`.github/workflows/openspec-finalization.y
155
182
 
156
183
  The commit is pushed with a lease on the head the run read, so a developer push in between makes the run report `retry` and the next event finishes the work. Only after the push does the workflow `PATCH` the body fence with `finalizedHead` equal to that exact commit, and only when both the body and PR head still match the operation's expected values. The guaranteed head-binding change triggers native `pull_request: edited` validation even when a re-finalization reuses the same archive paths. The workflow's own body edit triggers further runs that report `already-finalized`; an intermediate run with a missing or stale binding defers before product suites and emits no protected aggregate. Every pushed commit is either a merge of the exact `develop` tip or confined to the change's active path, its archive path, and its declared canonical specs.
157
184
 
158
- Because the branch gains commits from the archive App, pull before pushing. A rebase that drops them is harmless: the next push is reconciled from whatever the head contains. Do not revert a finalization commit to make a fix; push the fix and let the workflow re-finalize. When the workflow fails, its summary names the finalization code (`tasks-incomplete`, `acceptance-*`, `delivery-known-gaps`, `openspec-operation`, `finalization-merge-conflict`, ...), nothing is pushed, and `Finalized delivery validation` on the unfinalized head reports that automated finalization is pending.
185
+ Because the branch gains commits from the archive App, pull before pushing. A rebase that drops them is harmless: the next push is reconciled from whatever the head contains. Do not revert a finalization commit to make a fix; push the fix and let the workflow re-finalize. When the workflow fails, its summary names the finalization code (`tasks-incomplete`, `implementation-progress-*`, `acceptance-*`, `delivery-known-gaps`, `openspec-operation`, `finalization-merge-conflict`, ...), nothing is pushed, and `Finalized delivery validation` on the unfinalized head reports that automated finalization is pending.
159
186
 
160
187
  A missing fence is not an ordinary ready PR when immutable base/head evidence shows that the candidate introduces or restores an active change, or mixes active-change edits with code or operational paths. Base-controlled readiness and finalization both fail with `missing-implementation-association`; deleting editable body metadata cannot bypass finalization. Existing active-change documentation-only revisions and ordinary code PRs without active delivery paths retain their established routes.
161
188
 
@@ -163,7 +190,7 @@ If an unassociated implementation has already integrated, do not edit its merged
163
190
 
164
191
  ## Finalization command
165
192
 
166
- The local command remains available for inspection or when a developer prefers to finalize before marking the PR ready; the workflow then verifies the head and pushes nothing. It has inspection mode by default and an explicit `--write` mode. It never commits, pushes, edits GitHub, marks a PR ready, or merges. Run from the linked worktree and use an ignored artifact body file so the operation can update exact version-3 paths without mutating remote PR state:
193
+ The local command remains available for inspection or when a developer prefers to finalize before the automatic ready transition; the workflow then verifies the head and pushes nothing. It has inspection mode by default and an explicit `--write` mode. It never commits, pushes, edits GitHub, marks a PR ready, or merges. Run from the linked worktree and use an ignored artifact body file so the operation can update exact version-3 paths without mutating remote PR state:
167
194
 
168
195
  ```bash
169
196
  git fetch origin develop
@@ -201,7 +228,7 @@ Before a first finalization, canonical specs must still equal the selected targe
201
228
 
202
229
  ## Conditional acceptance and derived receipt
203
230
 
204
- `acceptance.md` truthfully says its verdict activates only when an authorized human manually merges the containing exact head after required current-head checks or personally arms native auto-merge for that unchanged head and GitHub integrates it after those checks. Its `openspec-delivery` block records stable pre-merge facts:
231
+ `acceptance.md` truthfully says its verdict activates only when an authorized human directly merges the containing exact head after required current-head checks, explicitly asks the active agent to execute that protected exact-head merge while it is eligible, or personally arms native auto-merge for the unchanged head and GitHub integrates it after those checks. Its `openspec-delivery` block records stable pre-merge facts:
205
232
 
206
233
  - schema version, repository, change, and source PR;
207
234
  - archive and manifest paths and finalization date;
@@ -210,7 +237,7 @@ Before a first finalization, canonical specs must still equal the selected targe
210
237
  - archive, canonical-spec, task, and evidence digests; and
211
238
  - explicit known-gap dispositions.
212
239
 
213
- It does not predict source head, merge commit, merger, or merge time. The PR head contains the manifest, so required CI binds those bytes without a recursive self-hash. After merge, the shared reader combines the manifest with immutable GitHub source head, successful required run, authorized human actor and permission, integration route, merge commit/time, and `develop` ancestry. Direct manual integration requires no active automatic authority. Human-enabled native auto-merge additionally requires a matching final-head enable event and `auto_merge.enabled_by`, with no later candidate commit or disable event. Queue, App/Bot, automation-owned, stale, malformed, or differently authored authority remains invalid. A human enable followed by disable before a valid manual merge is an abandoned attempt, not contradictory provenance. That shared result is the durable version-3 receipt used by audit and cleanup.
240
+ It does not predict source head, merge commit, merger, or merge time. The PR head contains the manifest, so required CI binds those bytes without a recursive self-hash. After merge, the shared reader combines the manifest with immutable GitHub source head, successful required run, authorized human actor and permission, integration route, merge commit/time, and `develop` ancestry. Direct integration, including an explicitly requested agent invocation through the maintainer's credential, requires no active automatic authority and retains the same authenticated-human merge provenance. Human-enabled native auto-merge additionally requires a matching final-head enable event and `auto_merge.enabled_by`, with no later candidate commit or disable event. Queue, App/Bot, automation-owned, stale, malformed, or differently authored authority remains invalid. A human enable followed by disable before a valid direct merge is an abandoned attempt, not contradictory provenance. That shared result is the durable version-3 receipt used by audit and cleanup.
214
241
 
215
242
  Unavailable, stale, automatic, unauthorized, conflicting, or contradictory provenance produces `invalid-provenance`/`blocked`, not acceptance. Post-merge code does not repair it by pushing `develop` or publishing another PR.
216
243
 
@@ -264,7 +291,7 @@ This bootstrap policy itself finishes under deployed version-2 authority. The fi
264
291
  - draft planning remaining unmerged;
265
292
  - explicit plan approval and same-PR implementation;
266
293
  - automated current-target finalization and exact-head CI;
267
- - authorized human integration, including manual merge and personally enabled exact-head native auto-merge, with plain acceptance scenarios;
294
+ - authorized human integration, including direct merge, an explicit exact-head agent-merge request, and personally enabled exact-head native auto-merge, with plain acceptance scenarios;
268
295
  - integrated canonical specs/archive and no generated acceptance/archive PR;
269
296
  - read-only `accepted-and-archived` verification and exact-head branch cleanup;
270
297
  - stale head/body/base/arm, incomplete tasks/evidence, malformed manifest, and automated or unauthorized auto-merge refusal fixtures; and
@@ -6,11 +6,13 @@ Development validation computes one exact base/head selection with:
6
6
  npm run select:validation-impact -- --base <full-base-sha> --head <full-head-sha> --output .artifacts/validation/impact.json
7
7
  ```
8
8
 
9
- The versioned `config/validation-ownership.json` registry maps stable product and test path groups to a mandatory PR core, affected unit tests, resource-sensitive tests, and integration owners. The initial coarse owners are UI/rendering, launch/startup, release/package/update, Pi, native containment, image/history, governance, and shared product inputs. Each integration owner in `config/integration-owners.json` declares `pull-request` or `exhaustive` cadence. A changed pull-request test selects its owner; a changed exhaustive test selects focused deterministic contracts and records the exhaustive owner as cadence-deferred. Shared support selects every declared PR consumer and records affected exhaustive consumers; copies, renames, and deletions inspect both identities. Reasons and changed paths are recorded in `impact.json`.
9
+ The versioned `config/validation-ownership.json` registry maps stable product and test path groups to a mandatory PR core, an explicit critical floor per owner, changed and bounded transitive consumers, resource-sensitive tests, and integration owners. The coarse owners are UI/rendering, launch/startup, release/package/update, Pi, native containment, image/history, governance, and shared product inputs. Each integration owner in `config/integration-owners.json` declares `pull-request`, `direct-impact`, or `exhaustive` cadence. A changed pull-request test selects its owner; a changed exhaustive test selects focused deterministic contracts and records the exhaustive owner as cadence-deferred. Shared support selects every declared PR consumer and records affected exhaustive consumers; copies, renames, and deletions inspect both identities. Reasons and changed paths are recorded in `impact.json`.
10
10
 
11
- Unknown operational inputs, unavailable comparison history, workflow/selector/suite/aggregate changes, and manual Development dispatch select every pull-request owner. Missing, malformed, or unknown cadence blocks instead of guessing. Documentation-only and version-only changes retain explicit exemptions. An implementation-bound association (an `openspec-implementation` link in the PR body) only disables those two exemptions: the PR core still runs, and owners are still selected by impact rather than forced to conservative coverage. Selection does not require whole-repository source parsing.
11
+ Reviewed `refinements` can narrow a coarse owner's tests and integration links for known subareas: scrollbar/settings, clipboard/editor/repository commands, documentation/cleanup/delivery governance, and development-environment tooling. Each rule keeps an explicit minimum test set; a bounded relative-import graph across `test/`, `src/`, `scripts/`, and `bin/` adds at most 24 sorted transitive consumers per changed path, including consumers outside the coarse owner, and integration owners of those retained consumers. The graph is supplemental, not sole coverage authority. Unreviewed or absent source identities and an unavailable graph retain the coarse owner. Changed tests, shared support, and mixed source/support changes retain their coarse contracts; rename and deletion classification still includes both identities. Some UI changes deliberately select more tests than before because the graph exposes formerly missed shell consumers.
12
12
 
13
- The `changes` job then derives the modular job matrix from that same selection through `scripts/release/validation-matrix.mjs`, which declares every Development modular job and returns only the entries the selection activates; GitHub never schedules an inactive entry, so an ordinary PR does not spend runner minutes on jobs that would resolve to nothing. Each scheduled job still resolves its own owners from the uploaded impact artifact, and the aggregate still requires evidence for every selected owner, so an entry that should have run and did not fails the run.
13
+ Unknown operational inputs, unavailable comparison history, workflow/selector/suite/aggregate changes, and manual Development dispatch select every coarse owner's critical floor and only integration owners with `pull-request` cadence. Direct-impact owners require a changed declared test, support, or production surface; exhaustive owners remain deferred. Missing, malformed, or unknown cadence blocks instead of guessing. Documentation-only and version-only changes retain explicit exemptions. An implementation-bound association (an `openspec-implementation` link in the PR body) only disables those two exemptions: the PR core still runs, and owners are still selected by impact rather than forced to conservative coverage. Selection does not require whole-repository source parsing.
14
+
15
+ The `changes` job then derives the modular job matrix from that same selection through `scripts/release/validation-matrix.mjs`, which declares every Development modular job and returns only the entries the selection activates; GitHub never schedules an inactive entry, so an ordinary PR does not spend runner minutes on jobs that would resolve to nothing. The matrix uses fail-fast cancellation, so a decisive failure stops remaining cells while missing or cancelled selected evidence still blocks the aggregate. Each scheduled job still resolves its own owners from the uploaded impact artifact, and the aggregate still requires evidence for every selected owner, so an entry that should have run and did not fails the run.
14
16
 
15
17
  ## Commands and coverage levels
16
18
 
@@ -24,22 +26,60 @@ npm run test:full # complete deduplicated local composition
24
26
  npm run test:release # release gates; publication authority is unchanged
25
27
  ```
26
28
 
29
+ Before a push, run only quick targeted checks of what changed; CI after the pull request becomes ready is the validation authority:
30
+
31
+ ```bash
32
+ npm run typecheck # type check
33
+ npx vitest run <changed test files...> # tests covering the changed code
34
+ npx openspec validate <change> --strict # the OpenSpec change
35
+ ```
36
+
37
+ Do not run preflight, `test:fast`, `test:full`, `test:release`, or directory-wide test runs before pushing. They are for reproducing a failure CI reported, or when the maintainer asks. Preflight is the optional tool for reproducing a fast-gate failure:
38
+
39
+ ```bash
40
+ npm run preflight # pull-request validation's fast gates on the committed head
41
+ ```
42
+
43
+ Preflight selects the committed merge-base diff with `origin/develop` exactly as validation does (uncommitted paths are reported, not checked), writes it to `.artifacts/validation/local-impact.json`, and stops at the first failure. It runs the core job's install build and receipt, `typecheck`, `check:architecture`, changed-file code documentation, release documentation, changed-file naming, docs governance, strict OpenSpec validation with the workflow's pinned validator, the delivery-guidance test, and the core job's `pr-core-tests` and `pr-selected-tests` scopes. Each step invokes the script and arguments its workflow job runs, so a failure reports the same rule identifier and path. It never builds the native host, does not run resource-sensitive or integration owners, and CI remains the authority.
44
+
27
45
  `test:pr-core` is not a replacement for `test:fast`: CI combines it with directly changed and coarse-owner tests from the exact impact selection. Selected resource-sensitive tests run independently on an isolated Windows runner. Selected package, startup, rendering, Pi, compatibility, and platform owners also run independently after their actual prerequisites.
28
46
 
29
- Conservative Development retains every pull-request owner but does not schedule exhaustive owners. The complete regression implementation runs inside a PR only when base policy verifies an `openspec-ci` App-created repair, its generated candidate identity, and a failed Full regression source in `regression-provenance.json`. Publishing/prerequisite/validation-authority impact, shared inputs, unknown paths, labels, Publish-only repairs, and successful-run persistent-overrun candidates retain bounded ordinary validation. Planning-only generated repair drafts stay exempt; eligible implementation drafts get feedback without integration authority. The selected exact-head evidence must include Windows Node 22/24, Linux Node 24, and macOS Node 24. Full regression and nightly/stable release retain both cadence classes and the same coverage through the shared implementation. The real three-release `update-predecessor` exact-package oracle is exhaustive; deterministic predecessor command, fixture, materialization, warmup, package, and update contracts remain PR-eligible. Preview and release continue to consume exact candidate bytes under their channel-specific contracts. A standalone manual Full regression remains useful for diagnosis or an unselected candidate, but never replaces automatically selected current-PR evidence. The generated ownership ledger command is:
47
+ Conservative Development retains every critical owner floor and the small set of `pull-request` integration owners, while scheduling only directly affected `direct-impact` owners and deferring all exhaustive owners. The complete regression implementation runs inside a PR only when base policy verifies an `openspec-ci` App-created repair, its generated candidate identity, and a failed Full regression source in `regression-provenance.json`. Publishing/prerequisite/validation-authority impact, shared inputs, unknown paths, labels, Publish-only repairs, and successful-run persistent-overrun candidates retain bounded ordinary validation. Planning-only generated repair drafts stay exempt; eligible implementation drafts get feedback without integration authority. The selected exact-head evidence must include Windows Node 22/24, Linux Node 24, and macOS Node 24. Full regression and nightly/stable release retain both cadence classes and the same coverage through the shared implementation. The real three-release `update-predecessor` exact-package oracle is exhaustive; deterministic predecessor command, fixture, materialization, warmup, package, and update contracts remain PR-eligible. Preview and release continue to consume exact candidate bytes under their channel-specific contracts. A standalone manual Full regression remains useful for diagnosis or an unselected candidate, but never replaces automatically selected current-PR evidence. The generated ownership ledger command is:
30
48
 
31
49
  ```bash
32
50
  node scripts/release/generate-validation-ownership-ledger.mjs --output .artifacts/validation/ownership-ledger.json
33
51
  ```
34
52
 
35
- The `terminal-host` owner is CI-only. A change under `native/terminal-host/` or to its run scripts selects the Windows x64 **Native terminal host (Windows)** job, which builds the crate with pinned Rust and Zig 0.15.2, runs `npm run test:terminal-host`, and uploads the debug executable. Local Windows builds fail in `build.rs` unless `TERMINAL_HOST_LOCAL_BUILD=1` is set, because Zig's package fetch unpacks test data that workstation antivirus quarantines along with the installed process guardian. See [`native/terminal-host/README.md`](../native/terminal-host/README.md).
53
+ Containment-selected modular jobs build and test the debug `process-guardian.node` addon for their exact platform, export `A1_PROCESS_GUARDIAN_PATH` to that file, and run the launch-owner integration fixtures as Node processes. The tests exercise the real addon-held Windows job or Unix process group, addon-backed identity and terminal operations, and the Node exit watcher; no fixture invokes a process-guardian executable. The Windows startup lane keeps Defender real-time protection enabled while packaged startup loads the release addon.
54
+
55
+ The `terminal-host` owner is CI-only. A change under `native/terminal-host/` or to its run scripts selects, per platform (Windows x64, Linux x64, macOS arm64), one **Native terminal host** job and three **Native terminal host tests** partition jobs. The partition jobs each build the test profile and run one third of the serialized `role_integration` suite (`run-terminal-host-probe.mjs --partition <i>/3`, partitioned by sorted test name read from the suite's source); the feature-gated `role-host` binary stands in only for the fixed role grammar inside Rust integration tests and is never packaged. The build-and-probe job runs `npm run test:terminal-host` with the role suite skipped (`TERMINAL_HOST_PARTITION=none`), building `terminal-host.node` with Rust, Node-API 9, and Zig 0.15.2 for the lane's exact target and baseline CPU model. It loads the addon for its version and non-interactive probes, verifies the shared session-writer lock export, and uploads the debug addon and frozen protocol manifest; Linux also runs bounded decoder fuzzing.
56
+
57
+ The protected aggregate requires every partition of every selected platform, keyed by `partition` in the outcome authority and job envelope. Because the role suite no longer warms the resident launch paths in the build-and-probe job, its certification step runs one unmeasured `measure-resident-tabs.mjs` pass before the measured pass whose budgets are unchanged. Fidelity, latency, chaos, and certification start roles as `process.execPath dist/foundation/resident-tabs/host-entry.js` with `A1_TERMINAL_HOST_PATH` naming the addon. Windows cleanup identifies those Node-hosted residents by command line; it never kills every `node.exe` by image name. Locally, `npm run test:terminal-host` without a partition is unchanged and runs everything in one process. Local Windows builds fail in `build.rs` unless `TERMINAL_HOST_LOCAL_BUILD=1` is set, because Zig's package fetch unpacks test data that workstation antivirus quarantines. Native lanes also publish the terminal library they linked; a local build can link it instead of running Zig (see Local native iteration in [`architecture/resident-tabs.md`](architecture/resident-tabs.md)), which is development evidence only and never replaces selected CI. `TERMINAL_HOST_CONTRACTS_ONLY=1` is a library-only diagnostic and cannot substitute for selected CI. See [`native/terminal-host/README.md`](../native/terminal-host/README.md).
58
+
59
+ ## Coverage-preserving efficiency
60
+
61
+ Complete regression selects the full rendering scope instead of also executing its superseded smoke files. Full captures call the same smoke assertions, including independent producer identity, readiness, semantic parity, synchronization, and bounded paint checks. Smoke-only corrupted-evidence controls live in an ordinary deterministic test. Scheduled content runs once in each gate through the same owned-versus-pinned helper. The retained full matrix has 11 streaming workloads across three producers and two modes, two scheduled-content workloads across two producers, and six input workloads batched across three producers: 73 matrix launches plus 10 protocol-failure launches. Standalone smoke retains 19 launches. Full regression avoids the additional 19 smoke launches; it does not remove a workload or platform lane.
62
+
63
+ The coverage ledger test reconstructs every full-plan invocation and requires each retained file exactly once, except the two smoke files whose executed replacement contracts it names explicitly. Unit, shell integration, source/emitted entries, independent pinned parity, security/race controls, and runtime-specific tests are not interchangeable merely because they touch the same module.
64
+
65
+ The package-command transcript fixture uses four file-owned producer processes (owned/pinned times color 0/1), rather than starting 22 equivalent loaders. Every request still runs the real command with its independent home/settings and fresh transcript; failed producers are never restarted. Fresh-home isolation and process disposal are tested. Cold-entry contracts elsewhere retain their cold process boundary. Git cleanup scenarios still initialize their own real repository/worktree, but write private Git configuration once instead of launching four config/remote commands. Release fixtures create baseline refs in one real atomic ref transaction. Setup remains inside the owning scenario and no mutable fixture repository is shared.
66
+
67
+ Exact-package identity walks hash each payload as it is read, retain only file digests, and parse the manifest from that same walk. They keep the original digest contract, all pre/post consumer verifications, fresh prefixes, and separate shard installations. This removes duplicate manifest reads and full-payload buffering; it does not cache verification results or promise a material improvement to npm installation time.
68
+
69
+ Generate a content-free per-file inventory and optional observed timing report from an existing Actions run and log:
70
+
71
+ ```bash
72
+ node scripts/release/validation-cost-report.mjs --run .artifacts/agent/completed-run.json --log .artifacts/agent/job.log --output .artifacts/validation/cost-report.json
73
+ ```
74
+
75
+ The run JSON is the output of `gh run view RUN --json jobs,headSha,createdAt,updatedAt`; the log is from that same run's chosen job. Omit both inputs for inventory only. Reports are observational, never validation receipts. They identify source drift, each retained file's coarse owner/execution class, job and step duration, total runner time, longest job, workflow elapsed time, and runner span. Queue and DAG critical-path timing remain unavailable rather than guessed. File timings preserve repeated observations; never add concurrent job/file durations and call the result elapsed savings. Compare comparable completed runs before claiming a hosted speedup. No passing outcomes, installed trees, or mutable fixture state may be cached by these optimizations.
36
76
 
37
77
  ## Windows Full regression shards
38
78
 
39
- Standalone and PR-attached Full regression run each Windows runtime (Node 22 and Node 24) as four hosted-runner shards derived from the one canonical `full-release` plan: `core` (command gates and the bounded-parallel ordinary remainder), `resource` (the serial resource-sensitive invocation with its unchanged explicit bound), `rendering` (the serial isolated rendering invocation), and `package` (packing, the shared exact-package installation, Defender-backed first-attempt startup before package contracts, package smoke, update timing, and the exhaustive published-predecessor invocation). Each shard checks out, installs, builds, and records its own build receipt; only the package shard packs and installs the candidate. Linux, macOS, local `npm run test:full`, and publication validation keep one sequential complete plan.
79
+ Standalone and PR-attached Full regression run each Windows runtime (Node 22 and Node 24) as five hosted-runner shards derived from the one canonical `full-release` plan: `core` (command gates and the bounded-parallel ordinary remainder), `resource` (the serial resource-sensitive invocation with its unchanged explicit bound), `rendering` (the serial isolated rendering invocation), `package` (packing, its own exact-package installation, Defender-backed first-attempt startup before package contracts, package smoke, and update timing), and `predecessor` (packing, its own exact-package installation, and the exhaustive published-predecessor invocation, which took 11 to 12 minutes of the former package shard on Windows). Each shard checks out, installs, builds, and records its own build receipt; the package and predecessor shards each pack and install their own candidate, and no installed state crosses shards. Linux, macOS, local `npm run test:full`, and the sequential publication lanes keep one complete plan with one shared installation.
40
80
 
41
81
  ```
42
- node scripts/release/run-validation-tier.mjs --full-shard <core|resource|rendering|package> --result <path>
82
+ node scripts/release/run-validation-tier.mjs --full-shard <core|resource|rendering|package|predecessor> --result <path>
43
83
  ```
44
84
 
45
85
  `partitionFullRegressionPlan` assigns every canonical command and Vitest invocation to exactly one shard and rejects unknown or duplicate work; the build is the only per-shard prerequisite. Each shard result carries its shard identity, assigned work, and the canonical-plan digest. A per-runtime collector job reconstructs one ordinary `a1-validation-outcomes-v1` result only when all four current-run shards for the exact source, runtime, run, attempt, and plan passed and each reported exactly its assigned work; the reconstructed result then binds the unchanged `windows-2025-node22` or `windows-2025-node24` lane, and the required aggregate still demands exactly four lanes. The collector's summary reports each shard's time and the elapsed span across overlapping shards. Nightly triage maps a failed shard's owners to the canonical Windows lane and names the shard job, and it rejects more than one startup evidence file for a lane.
@@ -106,10 +146,10 @@ Download these artifacts from the exact workflow run:
106
146
 
107
147
  For selected implementation candidates, record focused and pre-finalization full observations before finalization. Keep final head/run/selection identity in Actions and handoff rather than adding a post-success commit that invalidates that evidence. A successful selected PR run replaces an additional mandatory dispatch; standalone runs remain diagnostic, and numbered-package nightly recovery remains independent.
108
148
 
109
- Draft pull requests run no Development test suites. A ready version-3 PR whose body still identifies an active change defers testing and emits no protected aggregate while `OpenSpec finalization` publishes the candidate. A ready unassociated PR also fails closed when immutable base/head evidence shows that it introduces or restores active delivery content, or combines active-change edits with code or operational paths; it does not fall through to ordinary validation merely because its body fence is absent. Existing active-change documentation-only revisions and ordinary code PRs without active delivery paths retain their established routes. After finalization records the archive and acceptance manifest, the ordinary exact-head workflow runs selected product/governance lanes and `Finalized delivery validation` in parallel, then emits the stable protected `Development validation required` aggregate only when both authorities succeed. Green CI enables maintainer review and manual merge but does not claim human acceptance or merge automatically. The finalization fence update is the validation trigger, so no pre-finalization test run or later lifecycle body edit is required. Any subsequent eligible implementation commit changes the head and reruns applicable validation; any body change reruns readiness and finalized-record validation and must continue to match the committed manifest. Legacy acceptance-record-only PRs retain their separate trusted `Acceptance record validation` route. Queue availability remains explicitly unavailable inside a runner and is calculated from the Actions API during final run analysis rather than guessed.
149
+ Draft pull requests run no Development test suites. A ready version-3 PR whose body still identifies an active change defers testing and emits no protected aggregate while `OpenSpec finalization` publishes the candidate. A ready unassociated PR also fails closed when immutable base/head evidence shows that it introduces or restores active delivery content, or combines active-change edits with code or operational paths; it does not fall through to ordinary validation merely because its body fence is absent. Existing active-change documentation-only revisions and ordinary code PRs without active delivery paths retain their established routes. After finalization records the archive and acceptance manifest, the ordinary exact-head workflow runs selected product/governance lanes and `Finalized delivery validation` in parallel, then emits the stable protected `Development validation required` aggregate only when both authorities succeed. Green CI enables maintainer review and an explicit integration decision but does not claim human acceptance or merge automatically. After green exact-head validation, the maintainer may directly merge, personally arm native auto-merge, or explicitly ask the active agent to perform one expected-head protected squash merge for that currently eligible candidate. The finalization fence update is the validation trigger, so no pre-finalization test run or later lifecycle body edit is required. Any subsequent eligible implementation commit changes the head and reruns applicable validation; any body change reruns readiness and finalized-record validation and must continue to match the committed manifest. Legacy acceptance-record-only PRs retain their separate trusted `Acceptance record validation` route. Queue availability remains explicitly unavailable inside a runner and is calculated from the Actions API during final run analysis rather than guessed.
110
150
 
111
151
  ## Rollback
112
152
 
113
153
  To disable selective execution without reducing PR coverage, use manual Development dispatch or force conservative ownership selection. To restore the historical predecessor oracle to every applicable PR, change its cadence from `exhaustive` to `pull-request`; do not delete it from Full/nightly/release. To disable prior-attempt reuse, require all accepted attempts to equal the aggregate attempt; this must not remove attempt-qualified artifacts or failure visibility. To disable prerequisite reuse, unset readiness/tarball variables and receipt paths so tier orchestration rebuilds and repacks.
114
154
 
115
- Rollback must retain every test, startup budget, zero automatic retry policy, platform/runtime lane, exact-package identity, resource isolation, complete fast/full/release compositions, and the single stable protected-branch aggregate.
155
+ Rollback must retain complete Full/nightly/release test coverage, startup budgets, zero automatic retry policy, required release platform/runtime lanes, exact-package identity, resource isolation, and the single stable protected-branch aggregate. It must not restore owner-wide or unrelated exhaustive execution to ordinary pull requests.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timurproko/a1",
3
- "version": "0.2.6",
3
+ "version": "0.2.7-dev.1221",
4
4
  "description": "Standalone terminal workspace for supervised native and managed agents",
5
5
  "type": "module",
6
6
  "privateLaunchContract": "neutral-launch-v1",
@@ -23,10 +23,14 @@
23
23
  },
24
24
  "scripts": {
25
25
  "clean": "node scripts/clean.mjs",
26
- "build": "node scripts/development/check-environment.mjs && npm run clean && tsc -p tsconfig.build.json && node scripts/release/generate-release-notes-resource.mjs && node scripts/pi/build-pi-settings-metadata.mjs && node scripts/pi/build-startup-public.mjs && node scripts/development/build-process-guardian.mjs && node scripts/release/generate-runtime-payload-inventory.mjs",
26
+ "build": "node scripts/development/run-build.mjs",
27
+ "build:core": "node scripts/development/run-build.mjs --core",
28
+ "build:managed": "npm run clean && tsc -p tsconfig.build.json && node scripts/release/generate-release-notes-resource.mjs && node scripts/pi/build-pi-settings-metadata.mjs && node scripts/pi/build-startup-public.mjs && node scripts/development/build-process-guardian.mjs",
27
29
  "build:process-guardian": "node scripts/development/build-process-guardian.mjs",
30
+ "build:terminal-host": "node scripts/development/build-terminal-host.mjs",
28
31
  "typecheck": "tsgo -p tsconfig.json --noEmit && tsgo -p tsconfig.bin.json",
29
- "check:architecture": "node scripts/governance/check-architecture.mjs && node scripts/governance/check-product-identity-boundaries.mjs && node scripts/governance/check-package-identity.mjs && node scripts/governance/check-pinned-pi-source-ledger.mjs && node scripts/governance/check-terminal-host-provenance.mjs",
32
+ "check:architecture": "node scripts/governance/check-architecture.mjs && node scripts/governance/check-session-writer-guard.mjs && node scripts/governance/check-product-identity-boundaries.mjs && node scripts/governance/check-package-identity.mjs && node scripts/governance/check-pinned-pi-source-ledger.mjs && node scripts/governance/check-terminal-host-provenance.mjs",
33
+ "preflight": "node scripts/development/run-preflight.mjs",
30
34
  "check:names": "node scripts/governance/product-identifier-policy.mjs --check",
31
35
  "check:names:changed": "node scripts/governance/product-identifier-policy.mjs --check --selection .artifacts/validation/impact.json",
32
36
  "check:code-documentation": "node scripts/governance/check-code-documentation.mjs --mode full",
@@ -49,6 +53,8 @@
49
53
  "test:full": "node scripts/release/run-validation-tier.mjs full-release",
50
54
  "test:release": "node scripts/release/run-release-gates.mjs",
51
55
  "test:terminal-host": "node scripts/development/run-terminal-host-probe.mjs",
56
+ "test:resident-parallel-progress": "node scripts/development/verify-resident-parallel-progress.mjs",
57
+ "test:resident-chaos": "node scripts/development/run-resident-chaos.mjs --build",
52
58
  "test:pi-engine-conformance": "vitest run test/integrations/pi/engine/conformance.test.ts test/integrations/pi/engine/runtime-integration.test.ts test/integrations/pi/engine/session-integration.test.ts",
53
59
  "report:pi-engine-conformance": "npm run build --silent && node scripts/pi/run-pi-engine-conformance.mjs",
54
60
  "report:rendering-stability": "tsx scripts/pi/report-rendering-stability.ts",
@@ -57,20 +63,22 @@
57
63
  "update:pi-component-parity": "tsx scripts/pi/update-pi-component-parity.ts",
58
64
  "update:pi-event-frame-parity": "tsx scripts/pi/update-pi-event-frame-parity.ts",
59
65
  "proof:terminal-host": "node scripts/development/run-terminal-host.mjs",
66
+ "proof:terminal-host:ci": "node scripts/development/certify-ci-terminal-host.mjs",
60
67
  "start": "npm run build && node scripts/development/dev-launch.mjs",
61
68
  "start:pi": "npm run build && node scripts/development/dev-launch.mjs pi",
62
69
  "prepack": "node scripts/release/validate-packaged-release-note.mjs && node scripts/release/prepack-gate.mjs",
63
70
  "prepublishOnly": "npm run test:release",
64
- "prepare": "npm run build",
71
+ "prepare": "npm run build:core",
65
72
  "typecheck:bin": "tsgo -p tsconfig.bin.json"
66
73
  },
67
74
  "dependencies": {
68
- "@earendil-works/pi-coding-agent": "1.1.0",
69
- "@earendil-works/pi-tui": "1.1.0",
75
+ "@earendil-works/pi-coding-agent": "1.4.0",
76
+ "@earendil-works/pi-tui": "1.4.0",
70
77
  "@silvia-odwyer/photon-node": "0.3.4",
71
78
  "chalk": "5.6.2",
72
79
  "cross-spawn": "7.0.6",
73
80
  "grok-mermaid": "0.2.2",
81
+ "proper-lockfile": "4.1.2",
74
82
  "semver": "7.8.5",
75
83
  "undici": "8.9.0"
76
84
  },
@@ -79,6 +87,7 @@
79
87
  "@lezer/python": "1.1.19",
80
88
  "@types/cross-spawn": "6.0.6",
81
89
  "@types/node": "24.2.1",
90
+ "@types/proper-lockfile": "4.1.4",
82
91
  "@types/semver": "7.8.0",
83
92
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
84
93
  "@xterm/headless": "6.0.0",
@@ -107,5 +116,9 @@
107
116
  },
108
117
  "optionalDependencies": {
109
118
  "@mariozechner/clipboard": "^0.3.9"
119
+ },
120
+ "publication": {
121
+ "source": "81d81ade9416f501305300eafaafd2972b0efafb",
122
+ "pullRequest": 846
110
123
  }
111
124
  }
@@ -1,5 +0,0 @@
1
- import { WindowsNativeProcessInspector, type InspectorCommandRunner } from "./windows-process-inspector.js";
2
- /** Verifies Darwin process identity through the bounded native guardian inspection command. */
3
- export declare class DarwinNativeProcessInspector extends WindowsNativeProcessInspector {
4
- constructor(helperPath: string, runner?: InspectorCommandRunner);
5
- }
@@ -1,7 +0,0 @@
1
- import { WindowsNativeProcessInspector } from "./windows-process-inspector.js";
2
- /** Verifies Darwin process identity through the bounded native guardian inspection command. */
3
- export class DarwinNativeProcessInspector extends WindowsNativeProcessInspector {
4
- constructor(helperPath, runner) {
5
- super(helperPath, runner, "darwin-proc-start:");
6
- }
7
- }
@@ -1,152 +0,0 @@
1
- import { spawn } from "node:child_process";
2
- import { mkdir, readFile, rm } from "node:fs/promises";
3
- import { dirname, resolve } from "node:path";
4
- import { PRODUCT_IDENTITY } from "../../product-identity.js";
5
- /** Delegates one root runtime to the native guardian and exposes its verified containment identity. */
6
- export class NativeGuardianContainment {
7
- #identity;
8
- #helper = null;
9
- #rootIdentity = null;
10
- #outcome = null;
11
- instanceId;
12
- helperPath;
13
- statusPath;
14
- exitNoticePath;
15
- constructor(instanceId, helperPath, statusPath, exitNoticePath = null) {
16
- this.instanceId = instanceId;
17
- this.helperPath = helperPath;
18
- this.statusPath = statusPath;
19
- this.exitNoticePath = exitNoticePath;
20
- this.#identity = { provider: "native-guardian-pending", token: instanceId };
21
- }
22
- get identity() {
23
- return this.#identity;
24
- }
25
- async spawn(executable, arguments_, options) {
26
- if (this.#helper)
27
- throw new Error("process containment already has a root runtime");
28
- await mkdir(dirname(this.statusPath), { recursive: true, mode: 0o700 });
29
- await rm(this.statusPath, { force: true });
30
- if (this.exitNoticePath)
31
- await rm(this.exitNoticePath, { force: true });
32
- const helper = spawn(this.helperPath, [
33
- "--parent-pid", String(process.pid),
34
- "--instance", this.instanceId,
35
- "--status-file", this.statusPath,
36
- ...(this.exitNoticePath ? ["--exit-notice", this.exitNoticePath] : []),
37
- "--", executable, ...arguments_,
38
- ], {
39
- cwd: options.cwd,
40
- env: {
41
- ...options.environment,
42
- ...(options.terminalType ? { TERM: options.terminalType } : {}),
43
- // Protocol: the runtime arms this notice and the guardian prints it if the runtime dies unclean.
44
- ...(this.exitNoticePath ? { [PRODUCT_IDENTITY.environment.exitNoticePath]: this.exitNoticePath } : {}),
45
- },
46
- shell: false,
47
- stdio: "inherit",
48
- windowsHide: false,
49
- });
50
- this.#helper = helper;
51
- this.#outcome = helperOutcome(helper);
52
- const status = await waitForReadyStatus(this.statusPath, this.#outcome, 5_000);
53
- this.#rootIdentity = { pid: status.pid, startIdentity: status.startIdentity };
54
- this.#identity = { provider: status.containmentProvider, token: status.containmentToken };
55
- return { identity: this.#rootIdentity, outcome: this.#outcome };
56
- }
57
- async contains(identity) {
58
- return this.#rootIdentity !== null
59
- && identity.pid === this.#rootIdentity.pid
60
- && identity.startIdentity === this.#rootIdentity.startIdentity;
61
- }
62
- async stop(force) {
63
- const root = this.#rootIdentity;
64
- if (!root)
65
- return;
66
- try {
67
- process.kill(root.pid, force ? "SIGKILL" : "SIGTERM");
68
- }
69
- catch { }
70
- }
71
- async waitForEmpty(timeoutMs) {
72
- if (!this.#helper || this.#helper.exitCode !== null || this.#helper.signalCode !== null)
73
- return true;
74
- return await new Promise(resolvePromise => {
75
- const timer = setTimeout(() => finish(false), timeoutMs);
76
- timer.unref();
77
- const finish = (empty) => {
78
- clearTimeout(timer);
79
- this.#helper?.off("close", onClose);
80
- resolvePromise(empty);
81
- };
82
- const onClose = () => finish(true);
83
- this.#helper?.once("close", onClose);
84
- });
85
- }
86
- async close() {
87
- const helper = this.#helper;
88
- if (helper && helper.exitCode === null && helper.signalCode === null)
89
- helper.kill("SIGKILL");
90
- await this.waitForEmpty(1_500);
91
- await rm(this.statusPath, { force: true });
92
- if (this.exitNoticePath)
93
- await rm(this.exitNoticePath, { force: true });
94
- }
95
- }
96
- export function resolveProcessGuardianPath(releaseRoot, environment = process.env, platform = process.platform, architecture = process.arch) {
97
- const override = environment[PRODUCT_IDENTITY.environment.processGuardianPath]?.trim();
98
- if (override)
99
- return resolve(override);
100
- const executable = platform === "win32"
101
- ? `${PRODUCT_IDENTITY.artifacts.processGuardianExecutable}.exe`
102
- : PRODUCT_IDENTITY.artifacts.processGuardianExecutable;
103
- return resolve(releaseRoot, "dist", "native", `${platform}-${architecture}`, executable);
104
- }
105
- function helperOutcome(helper) {
106
- return new Promise(resolvePromise => {
107
- let settled = false;
108
- const settle = (outcome) => {
109
- if (settled)
110
- return;
111
- settled = true;
112
- resolvePromise(outcome);
113
- };
114
- helper.once("error", error => settle({ kind: "guardian-error", message: error.message, code: errorCode(error) }));
115
- helper.once("close", (code, signal) => {
116
- if (signal)
117
- settle({ kind: "signaled", signal });
118
- else
119
- settle({ kind: "exited", exitCode: code ?? 1 });
120
- });
121
- });
122
- }
123
- async function waitForReadyStatus(path, outcome, timeoutMs) {
124
- const deadline = Date.now() + timeoutMs;
125
- let terminalOutcome = null;
126
- void outcome.then(value => { terminalOutcome = value; });
127
- while (Date.now() < deadline) {
128
- try {
129
- const value = JSON.parse(await readFile(path, "utf8"));
130
- if (isReadyStatus(value))
131
- return value;
132
- throw new Error("process guardian published invalid ready status");
133
- }
134
- catch (error) {
135
- if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
136
- throw error;
137
- }
138
- if (terminalOutcome)
139
- throw new Error(`process guardian exited before readiness: ${JSON.stringify(terminalOutcome)}`);
140
- await new Promise(resolvePromise => setTimeout(resolvePromise, 20));
141
- }
142
- throw new Error(`process guardian did not publish readiness within ${timeoutMs}ms`);
143
- }
144
- function isReadyStatus(value) {
145
- return Number.isSafeInteger(value.pid) && Number(value.pid) > 0
146
- && typeof value.startIdentity === "string" && value.startIdentity.length > 0
147
- && typeof value.containmentProvider === "string" && value.containmentProvider.length > 0
148
- && typeof value.containmentToken === "string" && value.containmentToken.length > 0;
149
- }
150
- function errorCode(error) {
151
- return "code" in error && typeof error.code === "string" ? error.code : null;
152
- }