@timurproko/a1 0.2.7-dev.1249 → 0.2.7-dev.1252

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 (340) hide show
  1. package/README.md +11 -36
  2. package/bin/cli.js +2 -17
  3. package/bin/ui.js +7 -48
  4. package/dist/app/session-shell/exit-notice.d.ts +2 -2
  5. package/dist/app/session-shell/exit-notice.js +10 -10
  6. package/dist/app/session-shell/prompt-submission.d.ts +2 -4
  7. package/dist/app/session-shell/prompt-submission.js +3 -23
  8. package/dist/app/session-shell/response-copy-transport.js +1 -2
  9. package/dist/app/session-shell/session-lifecycle.d.ts +1 -2
  10. package/dist/app/session-shell/session-lifecycle.js +2 -4
  11. package/dist/app/session-shell/session-shell-root.d.ts +0 -31
  12. package/dist/app/session-shell/session-shell-root.js +3 -4
  13. package/dist/app/session-shell/session-shell.js +6 -47
  14. package/dist/app/session-shell/session-viewport-controller.js +3 -6
  15. package/dist/app/session-shell/shell-host.js +2 -18
  16. package/dist/app/session-shell/transcript-document.d.ts +1 -2
  17. package/dist/app/session-shell/transcript-document.js +3 -28
  18. package/dist/app/session-shell/workflow-output.js +1 -1
  19. package/dist/app/session-shell/workflow-router.d.ts +1 -3
  20. package/dist/app/session-shell/workflow-router.js +1 -4
  21. package/dist/cli/dispatch.d.ts +1 -11
  22. package/dist/cli/dispatch.js +5 -92
  23. package/dist/cli/session-context.js +5 -7
  24. package/dist/cli/uninstall.d.ts +1 -5
  25. package/dist/cli/uninstall.js +6 -35
  26. package/dist/cli/version-stats.js +4 -7
  27. package/dist/composition/owned-settings.d.ts +0 -1
  28. package/dist/composition/owned-settings.js +0 -1
  29. package/dist/composition/owned-ui.d.ts +2 -24
  30. package/dist/composition/owned-ui.js +11 -87
  31. package/dist/composition/release-update-observation.d.ts +4 -4
  32. package/dist/composition/release-update-observation.js +17 -47
  33. package/dist/composition/session-backend.d.ts +0 -1
  34. package/dist/composition/session-runtime-registry.d.ts +3 -3
  35. package/dist/composition/settings-route-host.d.ts +0 -7
  36. package/dist/composition/settings-route-host.js +4 -10
  37. package/dist/composition/startup-route.d.ts +0 -1
  38. package/dist/composition/startup-route.js +0 -1
  39. package/dist/contracts/owned-ui/index.d.ts +1 -1
  40. package/dist/contracts/owned-ui/model.d.ts +0 -3
  41. package/dist/contracts/owned-ui/session-workflows.d.ts +1 -4
  42. package/dist/features/launch/development-launch.js +0 -1
  43. package/dist/features/launch/index.d.ts +1 -1
  44. package/dist/features/launch/intent.d.ts +1 -3
  45. package/dist/features/launch/intent.js +2 -4
  46. package/dist/features/launch/session-context.d.ts +2 -2
  47. package/dist/features/owned-ui/reference-screen-app.d.ts +0 -2
  48. package/dist/features/owned-ui/reference-screen-app.js +2 -9
  49. package/dist/features/owned-ui/settings-app.d.ts +0 -6
  50. package/dist/features/owned-ui/settings-app.js +5 -36
  51. package/dist/foundation/launch-context/index.d.ts +0 -12
  52. package/dist/foundation/launch-context/index.js +0 -26
  53. package/dist/foundation/lifecycle/claim-gate.d.ts +8 -0
  54. package/dist/foundation/lifecycle/claim-gate.js +37 -0
  55. package/dist/foundation/lifecycle/index.d.ts +5 -9
  56. package/dist/foundation/lifecycle/index.js +3 -4
  57. package/dist/foundation/lifecycle/model.d.ts +2 -59
  58. package/dist/foundation/lifecycle/model.js +0 -35
  59. package/dist/foundation/lifecycle/paths.d.ts +0 -24
  60. package/dist/foundation/lifecycle/paths.js +0 -40
  61. package/dist/foundation/lifecycle/process-liveness.d.ts +8 -0
  62. package/dist/foundation/lifecycle/process-liveness.js +18 -0
  63. package/dist/foundation/lifecycle/session-claim-lock.d.ts +1 -1
  64. package/dist/foundation/lifecycle/session-claim-lock.js +2 -2
  65. package/dist/foundation/lifecycle/session-repository-context.d.ts +6 -6
  66. package/dist/foundation/lifecycle/session-repository-context.js +2 -3
  67. package/dist/foundation/release/automatic-update.d.ts +1 -3
  68. package/dist/foundation/release/automatic-update.js +9 -30
  69. package/dist/foundation/release/bootstrap.d.ts +2 -25
  70. package/dist/foundation/release/bootstrap.js +33 -344
  71. package/dist/foundation/release/cohort-state.d.ts +21 -46
  72. package/dist/foundation/release/cohort-state.js +30 -62
  73. package/dist/foundation/release/dependency-certification.d.ts +1 -1
  74. package/dist/foundation/release/index.d.ts +10 -17
  75. package/dist/foundation/release/index.js +7 -11
  76. package/dist/foundation/release/latest-release.d.ts +1 -2
  77. package/dist/foundation/release/latest-release.js +1 -2
  78. package/dist/foundation/release/process-liveness.d.ts +2 -0
  79. package/dist/foundation/release/process-liveness.js +12 -0
  80. package/dist/foundation/release/release-gc.d.ts +12 -9
  81. package/dist/foundation/release/release-gc.js +34 -98
  82. package/dist/foundation/release/release-store.d.ts +2 -2
  83. package/dist/foundation/release/release-store.js +2 -2
  84. package/dist/foundation/release/restart-certification.js +1 -1
  85. package/dist/foundation/release/update-activation.d.ts +2 -9
  86. package/dist/foundation/release/update-activation.js +28 -43
  87. package/dist/foundation/release/update-execution-lease.js +1 -1
  88. package/dist/foundation/release/update-launch.d.ts +0 -2
  89. package/dist/foundation/release/update-launch.js +0 -7
  90. package/dist/foundation/release/update-recovery.js +1 -1
  91. package/dist/foundation/release/update-transaction.d.ts +1 -1
  92. package/dist/foundation/release/update-transaction.js +5 -2
  93. package/dist/foundation/release/update.d.ts +2 -10
  94. package/dist/foundation/release/update.js +23 -200
  95. package/dist/foundation/session-writer-lock/index.d.ts +14 -6
  96. package/dist/foundation/session-writer-lock/index.js +48 -103
  97. package/dist/foundation/startup/startup-runtime.d.ts +1 -1
  98. package/dist/foundation/terminal-cleanup/exit-notice.d.ts +6 -0
  99. package/dist/foundation/terminal-cleanup/exit-notice.js +36 -0
  100. package/dist/foundation/terminal-cleanup/index.d.ts +2 -1
  101. package/dist/foundation/terminal-cleanup/index.js +2 -1
  102. package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +0 -5
  103. package/dist/foundation/terminal-cleanup/terminal-reset.js +0 -5
  104. package/dist/integrations/pi/components/index.d.ts +1 -1
  105. package/dist/integrations/pi/components/index.js +1 -1
  106. package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -4
  107. package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
  108. package/dist/integrations/pi/components/shell-footer-status.js +2 -2
  109. package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
  110. package/dist/integrations/pi/components/shell-presenters-info.d.ts +2 -5
  111. package/dist/integrations/pi/components/shell-presenters-info.js +4 -18
  112. package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +1 -1
  113. package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
  114. package/dist/integrations/pi/components/shell-shared-facade.d.ts +0 -2
  115. package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -5
  116. package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -16
  117. package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -2
  118. package/dist/integrations/pi/components/upstream/components/session-footer.js +6 -8
  119. package/dist/integrations/pi/engine/adapter.d.ts +0 -1
  120. package/dist/integrations/pi/engine/adapter.js +1 -16
  121. package/dist/integrations/pi/engine/diagnostics-state.d.ts +0 -1
  122. package/dist/integrations/pi/engine/diagnostics-state.js +0 -14
  123. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +0 -1
  124. package/dist/integrations/pi/engine/prompt-suggestions.js +0 -40
  125. package/dist/integrations/pi/engine/session-runtime.js +0 -2
  126. package/dist/integrations/pi/engine/workflow-runner.js +1 -1
  127. package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -2
  128. package/dist/integrations/pi/tui-runtime/adapter.js +2 -2
  129. package/dist/product-identity.d.ts +4 -6
  130. package/dist/product-identity.js +6 -11
  131. package/dist/product-identity.json +1 -40
  132. package/dist/runtime-payload-inventory.json +0 -3
  133. package/dist/ui/components/index.d.ts +2 -2
  134. package/dist/ui/components/index.js +1 -1
  135. package/dist/ui/components/submitted-prompt.d.ts +3 -13
  136. package/dist/ui/components/submitted-prompt.js +8 -41
  137. package/dist/ui/components/transcript-viewport.d.ts +1 -3
  138. package/dist/ui/components/transcript-viewport.js +1 -4
  139. package/dist/ui/settings/declarations.d.ts +3 -97
  140. package/dist/ui/settings/declarations.js +3 -78
  141. package/dist/ui/settings/migrations.js +18 -2
  142. package/docs/architecture/boundaries.md +22 -39
  143. package/docs/architecture/code-documentation.md +2 -2
  144. package/docs/architecture/internal-naming.md +9 -17
  145. package/docs/architecture/project-structure.md +9 -14
  146. package/docs/architecture/resource-and-data-policy.md +16 -31
  147. package/docs/architecture/toolchain.md +14 -19
  148. package/docs/architecture/ui-reference-provenance.md +2 -2
  149. package/docs/ci-release-runbook.md +5 -5
  150. package/docs/features/launch-profiles.md +11 -17
  151. package/docs/features/prompt-history.md +10 -11
  152. package/docs/local-worktree-cleanup.md +28 -1
  153. package/docs/manual-owned-ui-checkpoint.md +0 -1
  154. package/docs/validation.md +5 -11
  155. package/docs/worktree-link-recovery.md +6 -6
  156. package/package.json +7 -19
  157. package/bin/guardian.js +0 -42
  158. package/bin/supervisor.js +0 -7
  159. package/bin/tab-launch-context.d.ts +0 -27
  160. package/bin/tab-launch-context.js +0 -94
  161. package/dist/app/session-shell/resident-tab-coordinator.d.ts +0 -38
  162. package/dist/app/session-shell/resident-tab-coordinator.js +0 -77
  163. package/dist/cli/tabs-request.d.ts +0 -7
  164. package/dist/cli/tabs-request.js +0 -1
  165. package/dist/cli/tabs.d.ts +0 -14
  166. package/dist/cli/tabs.js +0 -151
  167. package/dist/composition/resident-tab-bridge.d.ts +0 -41
  168. package/dist/composition/resident-tab-bridge.js +0 -209
  169. package/dist/composition/utility-tab.d.ts +0 -28
  170. package/dist/composition/utility-tab.js +0 -244
  171. package/dist/features/owned-ui/plus-menu-dialog.d.ts +0 -28
  172. package/dist/features/owned-ui/plus-menu-dialog.js +0 -89
  173. package/dist/features/resident-tab/auto-name.d.ts +0 -11
  174. package/dist/features/resident-tab/auto-name.js +0 -44
  175. package/dist/features/resident-tab/index.d.ts +0 -5
  176. package/dist/features/resident-tab/index.js +0 -7
  177. package/dist/features/resident-tab/shortcut-bindings-file.d.ts +0 -8
  178. package/dist/features/resident-tab/shortcut-bindings-file.js +0 -40
  179. package/dist/features/resident-tab/shortcut-declarations.d.ts +0 -13
  180. package/dist/features/resident-tab/shortcut-declarations.js +0 -26
  181. package/dist/features/resident-tab/shortcut-projection.d.ts +0 -29
  182. package/dist/features/resident-tab/shortcut-projection.js +0 -64
  183. package/dist/features/resident-tab/status-deriver.d.ts +0 -10
  184. package/dist/features/resident-tab/status-deriver.js +0 -12
  185. package/dist/foundation/launch-guardian/exit-watcher.d.ts +0 -14
  186. package/dist/foundation/launch-guardian/exit-watcher.js +0 -103
  187. package/dist/foundation/launch-guardian/index.d.ts +0 -2
  188. package/dist/foundation/launch-guardian/index.js +0 -1
  189. package/dist/foundation/launch-guardian/main.d.ts +0 -39
  190. package/dist/foundation/launch-guardian/main.js +0 -232
  191. package/dist/foundation/lifecycle/commands.d.ts +0 -40
  192. package/dist/foundation/lifecycle/commands.js +0 -1
  193. package/dist/foundation/lifecycle/launch-instance.d.ts +0 -46
  194. package/dist/foundation/lifecycle/launch-instance.js +0 -134
  195. package/dist/foundation/lifecycle/native-claim-gate.d.ts +0 -5
  196. package/dist/foundation/lifecycle/native-claim-gate.js +0 -41
  197. package/dist/foundation/lifecycle/supervisor-startup.d.ts +0 -30
  198. package/dist/foundation/lifecycle/supervisor-startup.js +0 -106
  199. package/dist/foundation/process-containment/addon-containment.d.ts +0 -20
  200. package/dist/foundation/process-containment/addon-containment.js +0 -139
  201. package/dist/foundation/process-containment/addon-process-inspector.d.ts +0 -11
  202. package/dist/foundation/process-containment/addon-process-inspector.js +0 -36
  203. package/dist/foundation/process-containment/addon.d.ts +0 -47
  204. package/dist/foundation/process-containment/addon.js +0 -57
  205. package/dist/foundation/process-containment/artifact.d.ts +0 -1
  206. package/dist/foundation/process-containment/artifact.js +0 -35
  207. package/dist/foundation/process-containment/contracts.d.ts +0 -33
  208. package/dist/foundation/process-containment/contracts.js +0 -35
  209. package/dist/foundation/process-containment/index.d.ts +0 -9
  210. package/dist/foundation/process-containment/index.js +0 -7
  211. package/dist/foundation/process-containment/linux-process-inspector.d.ts +0 -7
  212. package/dist/foundation/process-containment/linux-process-inspector.js +0 -27
  213. package/dist/foundation/process-containment/native-process-inspector.d.ts +0 -4
  214. package/dist/foundation/process-containment/native-process-inspector.js +0 -21
  215. package/dist/foundation/protocol/client.d.ts +0 -18
  216. package/dist/foundation/protocol/client.js +0 -130
  217. package/dist/foundation/protocol/index.d.ts +0 -3
  218. package/dist/foundation/protocol/index.js +0 -2
  219. package/dist/foundation/protocol/messages.d.ts +0 -90
  220. package/dist/foundation/protocol/messages.js +0 -100
  221. package/dist/foundation/release/cohort-selection.d.ts +0 -33
  222. package/dist/foundation/release/cohort-selection.js +0 -67
  223. package/dist/foundation/release/endpoint-lock.d.ts +0 -2
  224. package/dist/foundation/release/endpoint-lock.js +0 -37
  225. package/dist/foundation/release/endpoint-recovery.d.ts +0 -10
  226. package/dist/foundation/release/endpoint-recovery.js +0 -45
  227. package/dist/foundation/release/endpoints.d.ts +0 -32
  228. package/dist/foundation/release/endpoints.js +0 -152
  229. package/dist/foundation/release/prepared-update-activation.d.ts +0 -3
  230. package/dist/foundation/release/prepared-update-activation.js +0 -27
  231. package/dist/foundation/release/process-cleanup.d.ts +0 -14
  232. package/dist/foundation/release/process-cleanup.js +0 -76
  233. package/dist/foundation/release/supervisor-identity.d.ts +0 -15
  234. package/dist/foundation/release/supervisor-identity.js +0 -63
  235. package/dist/foundation/resident-tabs/boot-identity.d.ts +0 -6
  236. package/dist/foundation/resident-tabs/boot-identity.js +0 -16
  237. package/dist/foundation/resident-tabs/bounded-host-command.d.ts +0 -20
  238. package/dist/foundation/resident-tabs/bounded-host-command.js +0 -62
  239. package/dist/foundation/resident-tabs/bridge-client.d.ts +0 -73
  240. package/dist/foundation/resident-tabs/bridge-client.js +0 -327
  241. package/dist/foundation/resident-tabs/continuity.d.ts +0 -12
  242. package/dist/foundation/resident-tabs/continuity.js +0 -63
  243. package/dist/foundation/resident-tabs/doctor.d.ts +0 -28
  244. package/dist/foundation/resident-tabs/doctor.js +0 -166
  245. package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +0 -27
  246. package/dist/foundation/resident-tabs/draft-checkpoint.js +0 -145
  247. package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +0 -36
  248. package/dist/foundation/resident-tabs/ensure-terminal-host.js +0 -151
  249. package/dist/foundation/resident-tabs/fault-injection.d.ts +0 -8
  250. package/dist/foundation/resident-tabs/fault-injection.js +0 -26
  251. package/dist/foundation/resident-tabs/fixture-control.d.ts +0 -7
  252. package/dist/foundation/resident-tabs/fixture-control.js +0 -35
  253. package/dist/foundation/resident-tabs/host-entry.d.ts +0 -1
  254. package/dist/foundation/resident-tabs/host-entry.js +0 -17
  255. package/dist/foundation/resident-tabs/index.d.ts +0 -15
  256. package/dist/foundation/resident-tabs/index.js +0 -10
  257. package/dist/foundation/resident-tabs/maintenance.d.ts +0 -39
  258. package/dist/foundation/resident-tabs/maintenance.js +0 -75
  259. package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +0 -34
  260. package/dist/foundation/resident-tabs/progress-observation-schema.js +0 -1
  261. package/dist/foundation/resident-tabs/progress-observation.d.ts +0 -4
  262. package/dist/foundation/resident-tabs/progress-observation.js +0 -150
  263. package/dist/foundation/resident-tabs/prompt-journal.d.ts +0 -63
  264. package/dist/foundation/resident-tabs/prompt-journal.js +0 -213
  265. package/dist/foundation/resident-tabs/protocol.d.ts +0 -12
  266. package/dist/foundation/resident-tabs/protocol.js +0 -195
  267. package/dist/foundation/resident-tabs/recovery.d.ts +0 -26
  268. package/dist/foundation/resident-tabs/recovery.js +0 -205
  269. package/dist/foundation/resident-tabs/release-holds.d.ts +0 -28
  270. package/dist/foundation/resident-tabs/release-holds.js +0 -78
  271. package/dist/foundation/resident-tabs/routes.d.ts +0 -5
  272. package/dist/foundation/resident-tabs/routes.js +0 -5
  273. package/dist/foundation/resident-tabs/routing.d.ts +0 -11
  274. package/dist/foundation/resident-tabs/routing.js +0 -10
  275. package/dist/foundation/resident-tabs/runtime-control.d.ts +0 -38
  276. package/dist/foundation/resident-tabs/runtime-control.js +0 -74
  277. package/dist/foundation/resident-tabs/session-sync.d.ts +0 -14
  278. package/dist/foundation/resident-tabs/session-sync.js +0 -37
  279. package/dist/foundation/resident-tabs/settings.d.ts +0 -16
  280. package/dist/foundation/resident-tabs/settings.js +0 -60
  281. package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +0 -14
  282. package/dist/foundation/resident-tabs/terminal-host-artifact.js +0 -78
  283. package/dist/foundation/resident-tabs/zip-archive.d.ts +0 -9
  284. package/dist/foundation/resident-tabs/zip-archive.js +0 -56
  285. package/dist/foundation/storage/control-store.d.ts +0 -20
  286. package/dist/foundation/storage/control-store.js +0 -331
  287. package/dist/foundation/storage/index.d.ts +0 -1
  288. package/dist/foundation/storage/index.js +0 -1
  289. package/dist/foundation/supervision/index.d.ts +0 -3
  290. package/dist/foundation/supervision/index.js +0 -3
  291. package/dist/foundation/supervision/main.d.ts +0 -1
  292. package/dist/foundation/supervision/main.js +0 -86
  293. package/dist/foundation/supervision/paths.d.ts +0 -1
  294. package/dist/foundation/supervision/paths.js +0 -1
  295. package/dist/foundation/supervision/server.d.ts +0 -46
  296. package/dist/foundation/supervision/server.js +0 -611
  297. package/dist/integrations/pi/engine/offline-settings-port.d.ts +0 -23
  298. package/dist/integrations/pi/engine/offline-settings-port.js +0 -54
  299. package/dist/native/darwin-arm64/manifest.json +0 -23
  300. package/dist/native/darwin-arm64/process-guardian.node +0 -0
  301. package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10500
  302. package/dist/native/darwin-arm64/terminal-host.manifest.json +0 -46
  303. package/dist/native/darwin-arm64/terminal-host.node +0 -0
  304. package/dist/native/darwin-x64/manifest.json +0 -23
  305. package/dist/native/darwin-x64/process-guardian.node +0 -0
  306. package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10737
  307. package/dist/native/darwin-x64/terminal-host.manifest.json +0 -46
  308. package/dist/native/darwin-x64/terminal-host.node +0 -0
  309. package/dist/native/linux-x64/manifest.json +0 -23
  310. package/dist/native/linux-x64/process-guardian.node +0 -0
  311. package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -11226
  312. package/dist/native/linux-x64/terminal-host.manifest.json +0 -46
  313. package/dist/native/linux-x64/terminal-host.node +0 -0
  314. package/dist/native/win32-x64/manifest.json +0 -23
  315. package/dist/native/win32-x64/process-guardian.node +0 -0
  316. package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10757
  317. package/dist/native/win32-x64/terminal-host.manifest.json +0 -46
  318. package/dist/native/win32-x64/terminal-host.node +0 -0
  319. package/docs/architecture/evidence/resident-tabs/linux-x64.md +0 -37
  320. package/docs/architecture/evidence/resident-tabs/macos-arm64.md +0 -36
  321. package/docs/architecture/evidence/resident-tabs/macos-x64.md +0 -35
  322. package/docs/architecture/evidence/resident-tabs/windows-x64.md +0 -36
  323. package/docs/architecture/evidence/terminal-host-spike/manual-one-pane-terminal-host.md +0 -70
  324. package/docs/architecture/evidence/terminal-host-spike/manual-two-by-two-basic-terminal-host.md +0 -32
  325. package/docs/architecture/evidence/terminal-host-spike/milestone-baseline.json +0 -115
  326. package/docs/architecture/evidence/terminal-host-spike/owned-ui-foundation-prerequisite.json +0 -48
  327. package/docs/architecture/evidence/terminal-host-spike/terminal-host-provenance.json +0 -125
  328. package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-1.json +0 -56
  329. package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-3.json +0 -174
  330. package/docs/architecture/evidence/terminal-host-spike/terminal-spike-acceptance-record.json +0 -18
  331. package/docs/architecture/native-fixture-isolation.md +0 -23
  332. package/docs/architecture/process-guardian-provenance.md +0 -36
  333. package/docs/architecture/resident-tabs-requirements.md +0 -18
  334. package/docs/architecture/resident-tabs.md +0 -668
  335. package/docs/architecture/terminal-host-proof-gate.md +0 -34
  336. package/docs/architecture/terminal-host-provenance.md +0 -81
  337. package/docs/architecture/terminal-host-spike-evidence.md +0 -39
  338. package/docs/launch-recovery.md +0 -23
  339. package/docs/manual-launch-instance-acceptance.md +0 -43
  340. package/docs/manual-resident-tabs-acceptance.md +0 -51
@@ -1,56 +1,51 @@
1
1
  # Architecture boundaries
2
2
 
3
- ## Terminal and launch-instance ownership
3
+ ## One process per launch
4
4
 
5
- Every interactive command uses this profile-neutral lifecycle path:
5
+ Every interactive command uses this profile-neutral path:
6
6
 
7
7
  ```text
8
- mutable a1 entry
9
- -> verified immutable release
10
- -> Node launch guardian loading the verified process-guardian addon
11
- -> addon-held per-instance containment and profile-aware runtime selection
8
+ mutable a1 entry (bin/cli.js)
9
+ -> runBootstrap selects the verified approved immutable release
10
+ -> one directly attached child: node <release>/bin/ui.js [session arguments], stdio inherited
12
11
  -> owned Pi-backed composition, with A1 surfaces enabled only for bare a1
13
12
  ```
14
13
 
15
- Launch-instance ownership is plural. The supervisor tracks any number of independently authenticated `a1` and `a1 pi` instances and never uses one product-wide foreground mutex. Closing one instance closes only its verified process tree. Persisted rows alone do not prove liveness, and uncertainty never authorizes terminating an unrelated process.
14
+ The launcher waits for the child and returns its exit code. When the child reports that the active release changed during startup, the launcher re-reads the release store once and starts the newer release. There is no supervisor, launch guardian, control store, control protocol, cohort coordination, or process containment: any number of `a1` and `a1 pi` processes run independently, and only the session writer guard coordinates them. Closing the terminal ends the attached child through the operating system, as upstream Pi behaves; tool subprocesses behave as they do in upstream Pi.
16
15
 
17
- The launch guardian and process-guardian addon do not read ordinary terminal input, parse or relay runtime output, render cells, infer frames, or synthesize terminal responses. Their only terminal output is the bounded reset and sanitized armed exit notice after runtime failure. Both profiles use the same owned rendering and input pipeline. Bare `a1` exposes A1-owned surfaces; `a1 pi` withholds those surfaces and uses Pi's ordinary profile root. The containment boundary carries only bounded identity, readiness, stop, and outcome data.
16
+ The launcher does not read terminal input, parse or relay output, render cells, or synthesize terminal responses. Its only terminal output after an unclean child exit is the bounded terminal reset and the armed exit notice. Both profiles use the same owned rendering and input pipeline. Bare `a1` exposes A1-owned surfaces; `a1 pi` withholds them and uses Pi's ordinary profile root.
18
17
 
19
- A detached Node exit watcher sits outside the launch guardian's containment. It waits for the guardian, performs bounded Unix process-group cleanup, and may deliver the same claimed exit notice. A kill aimed at every Node runtime also kills this watcher; the accepted loss of the notice and Unix fallback cleanup in that case is documented in [`process-guardian-provenance.md`](process-guardian-provenance.md), and A1 starts no native executable to close that gap.
20
-
21
- The owned Pi-backed surface is not an arbitrary-CLI terminal multiplexer. A feature that requires resident arbitrary CLI sessions, internal tabs, terminal-state reconnection, or A1-authoritative scrollback must introduce and certify the separate composed-terminal authority rather than reactivating the retired transparent attachment path.
18
+ The owned Pi-backed surface is one agent per terminal. It is not a terminal multiplexer and has no tabs, resident sessions, reattach, or A1-authoritative scrollback. Any multi-agent or composed-terminal feature needs its own approved change.
22
19
 
23
20
  ## Current module responsibilities
24
21
 
25
- - `lifecycle`: dependency-free launch-instance, process identity, state transition, outcome, and control-command contracts.
26
- - `process-containment`: process-guardian addon loading and artifact verification, OS-verifiable process inspection, in-process containment adapters, and bounded graceful/forced cleanup; it owns no terminal content.
27
- - `launch-guardian`: one profile-neutral Node instance coordinator above runtime selection, plus the fixed Node exit-watcher entry used only for owner-death cleanup and the armed notice.
28
- - `protocol`: additive control handshake, bounded line framing, authenticated launch-instance commands, typed stop intent, snapshots, and command results.
29
- - `launch`: resolves the effective profile home and the history-specific data root. Composition uses its public path resolver to select `~/.a1/data` for history unless `A1_DATA_DIR` is explicit; global control/release/runtime/cache paths stay unchanged.
30
- - `prompt-history`: narrowly typed user-input retention in separate profile-owned databases under `~/.a1/data/history` (or `<A1_DATA_DIR>/history`), with bounded worker queues and no supervisor/control-store payloads. It receives a resolved root rather than importing launch-feature internals; it never probes, imports, or deletes the former platform-default history. The editor's owned history state machine remains inside the Pi component boundary; the session UI only coordinates snapshots and classified submissions.
22
+ - `lifecycle` (`src/foundation/lifecycle`): product paths, session selection, launch-profile identifiers, and the repository-context helpers behind `a1 session worktrees` / `link-worktree` / `unlink-worktree`. Worktree claims are serialized by a `proper-lockfile` claim gate, and runtime liveness is `process.kill(pid, 0)`.
23
+ - `launch-context`: the neutral private environment contract a launcher passes to the release it starts.
24
+ - `session-writer-lock`: one writer per Pi session file through `proper-lockfile`. Lock directories live in one per-user directory, keyed by the session file's canonical identity so aliases contend for one lock; stale locks are reclaimed after a 10-second bound. Every writer route goes through it, which `check-session-writer-guard.mjs` enforces.
25
+ - release/update/bootstrap (`src/foundation/release`): package-derived immutable release identity, certified release manifests, durable update transactions, atomic activation, rollback, age-based retention, and the dependency-light command entry. Before certified fast-path reuse it checks every recorded product file is present; a missing or altered file is replaced only from the matching installed package when its size and digest reproduce the approved release, followed by full verification. Dependency layers keep their separate verification and repair policy.
26
+ - `startup`: startup trace phases and the startup budget evaluator.
27
+ - `terminal-cleanup`: bounded, idempotent emergency restoration, the exit notice, and fatal-exit diagnostics for an explicitly owned terminal. It does not inspect commands, relay terminal input/output, or emulate terminal state. The owned UI installs its fatal boundary before terminal activation; the launcher performs the same bounded reset and delivers the armed notice when the child exits uncleanly. Fatal records retain at most ten 16 KiB records with trusted classifications and code locations, never prompts, attachments, raw input, credentials, or arbitrary exception messages.
28
+ - `launch` (`src/features/launch`): resolves the effective profile home and the history-specific data root. Composition uses its public path resolver to select `~/.a1/data` for history unless `A1_DATA_DIR` is explicit; global release/runtime/cache paths stay unchanged.
29
+ - `prompt-history`: narrowly typed user-input retention in separate profile-owned databases under `~/.a1/data/history` (or `<A1_DATA_DIR>/history`), with bounded worker queues. It receives a resolved root rather than importing launch-feature internals; it never probes, imports, or deletes the former platform-default history. The editor's owned history state machine remains inside the Pi component boundary; the session UI only coordinates snapshots and classified submissions.
31
30
  - `prompt-suggestions`: opt-in bounded diagnostic snapshots of neutral suggestion lifecycle metadata. Composition supplies an explicit local destination; this feature never imports Pi, generates suggestions, stores conversation text, or owns the editor. See [prompt suggestion diagnostics](prompt-suggestions.md).
32
- - `storage`: SQLite migrations, prior-boot reconciliation, and plural launch-instance persistence. Legacy foreground rows are historical migration input and never authorize current ownership.
33
- - `supervisor`: endpoint identity, plural cohort ownership, per-instance reconciliation, and aggregate release shutdown coordination. It owns no terminal surface.
34
- - `pi-engine-adapter`, `pi-component-adapter`, and `pi-tui-runtime-adapter`: isolate pinned Pi engine and presentation knowledge behind neutral contracts; product features do not import them directly. Inside the engine adapter, one process-level engine host owns what is process-wide (the HTTP dispatcher, the theme singletons, the one-time changelog and package-update announcements, the startup trace) and is the only place sessions are created, so every session id is unique per process.
31
+ - `pi-engine-adapter`, `pi-component-adapter`, and `pi-tui-runtime-adapter` (`src/integrations/pi`): isolate pinned Pi engine and presentation knowledge behind neutral contracts; product features do not import them directly. Inside the engine adapter, one process-level engine host owns what is process-wide (the HTTP dispatcher, the theme singletons, the one-time changelog and package-update announcements, the startup trace) and is the only place sessions are created, so every session id is unique per process.
35
32
  - `session-shell` (`src/app/session-shell`): the application layer that composes the feature owners, the UI foundations, and the three Pi adapters into the interactive session; only composition imports it. Its render root assembles semantic document and dock rows, while its focused viewport controller owns follow state, pointer routing, selection, and interaction timers. Owned-app route lifecycle belongs to the neutral `ui-apps` owner and is only hosted by the session shell.
36
- - release/update/bootstrap: package-derived immutable release identity, native-addon integrity, cohort selection, durable update transactions, rollback, and dependency-light command entry. Before certified fast-path reuse it checks every recorded product file is present; a missing or altered file is replaced only from the matching installed package when its size and digest reproduce the approved release, followed by full verification. Dependency layers keep their separate verification and repair policy. After an unsuccessful bare-A1 child exit, the launch owner or its Node watcher restores owned terminal modes and emits only the armed bounded notice.
37
- - `terminal-cleanup`: bounded, idempotent emergency restoration and fatal-exit diagnostics for an explicitly owned terminal. It does not inspect commands, relay terminal input/output, or emulate terminal state. The owned UI installs its fatal boundary before terminal activation; packaged bootstrap and checkout launch provide the surviving-owner fallback. Fatal records retain at most ten 16 KiB records with trusted classifications and code locations, never prompts, attachments, raw input, credentials, or arbitrary exception messages.
38
33
 
39
34
  ## Dependency direction
40
35
 
41
36
  Terminal boundaries are application-agnostic. They may not select behavior from executable names, arguments, CLI-specific environment variables, or visible text. Production code may not import private Pi distribution APIs or use a Pi-specific terminal workaround.
42
37
 
43
- The JavaScript product path has no PTY or terminal-emulator dependency. Reintroducing `node-pty`, xterm state, custom input encoders, mode/query trackers, cadence-derived frame inference, or renderer/projection code requires an approved capability change and cannot become a second terminal authority. The Rust process guardian is a lifecycle-only Node-API addon loaded by the launch guardian and is independent from the terminal-host Node-API addon. No A1-built executable is part of the production process surface.
38
+ The product has no native code and no PTY or terminal-emulator dependency: no module under `src/` may import `node-pty` or a terminal emulator or spawn a pseudoterminal. Reintroducing xterm state, custom input encoders, mode/query trackers, cadence-derived frame inference, or renderer/projection code requires an approved capability change and cannot become a second terminal authority. The published package is pure JavaScript.
44
39
 
45
40
  `scripts/governance/check-architecture.mjs` enforces the structural parts of these boundaries. Cross-cutting rationale belongs here; implementation history belongs in Git and archived OpenSpec changes.
46
41
 
47
42
  ## Session shell composition
48
43
 
49
- The session presenter (`src/app/session-shell/session-shell.ts`) coordinates; it does not own per-concern state. Each concern implements `SessionConcern` (`session-concern.ts`): it resets its own state in `onSessionReplaced` and releases it in `dispose`, and the presenter lists its concerns once, in reset order, in `#createConcerns`. New submission, routing, dialog, login, or resident-tab behavior goes into the concern that owns it, or a new concern added to that list. The render root (`session-shell-root.ts`) likewise picks one `ShellLayout` at construction and delegates transcript caching to `TranscriptDocument`, dock chrome to `DockChrome`, workflow output to `WorkflowOutput`, extension surfaces to `ExtensionSurface`, and the dock's input surface to `InputSurfaceSwitch`. The engine adapter serves the shell through the ports built in `src/integrations/pi/engine/ports.ts`, and the composition root delegates runtime claims, the startup release note, and the resident-tab bridge to their own modules under `src/composition/`.
44
+ The session presenter (`src/app/session-shell/session-shell.ts`) coordinates; it does not own per-concern state. Each concern implements `SessionConcern` (`session-concern.ts`): it resets its own state in `onSessionReplaced` and releases it in `dispose`, and the presenter lists its concerns once, in reset order, in `#createConcerns`. New submission, routing, dialog, or login behavior goes into the concern that owns it, or a new concern added to that list. The render root (`session-shell-root.ts`) likewise picks one `ShellLayout` at construction and delegates transcript caching to `TranscriptDocument`, dock chrome to `DockChrome`, workflow output to `WorkflowOutput`, extension surfaces to `ExtensionSurface`, and the dock's input surface to `InputSurfaceSwitch`. The engine adapter serves the shell through the ports built in `src/integrations/pi/engine/ports.ts`, and the composition root delegates runtime claims and the startup release note to their own modules under `src/composition/`.
50
45
 
51
46
  ## Unit size ratchet
52
47
 
53
- Module boundaries do not stop one class or function inside a module from absorbing every feature. The architecture gate therefore measures every production TypeScript class under `src/` (methods and fields) and every TypeScript or Rust function under `src/` and `native/<crate>/src/` (inclusive lines), excluding vendored sources and Rust `#[cfg(test)]` code. A unit with more than 20 methods, 15 fields, or 100 function lines must be recorded in `config/baselines/size-ratchet.json`, and its recorded counts can only shrink:
48
+ Module boundaries do not stop one class or function inside a module from absorbing every feature. The architecture gate therefore measures every production TypeScript class under `src/` (methods and fields) and every TypeScript function under `src/` (inclusive lines), excluding vendored sources. A unit with more than 20 methods, 15 fields, or 100 function lines must be recorded in `config/baselines/size-ratchet.json`, and its recorded counts can only shrink:
54
49
 
55
50
  - A recorded count that grows fails the gate. Split the unit instead. If growth is truly unavoidable, raise the entry by hand in the same pull request and say why in its description, so the growth is reviewed rather than silent.
56
51
  - An unrecorded unit over a threshold fails the gate; split it before it lands.
@@ -60,25 +55,13 @@ The measurement in `scripts/governance/size-ratchet-policy.mjs` masks strings, c
60
55
 
61
56
  ## Multi-session limits of the pinned engine
62
57
 
63
- The engine host removes A1's own obstacles to several Pi sessions in one process, but three remain in the pinned Pi SDK and must be planned around, not discovered:
58
+ The engine host removes A1's own obstacles to several Pi sessions in one process (session switch, fork, and resume replace the session in place), but three limits remain in the pinned Pi SDK and must be planned around, not discovered:
64
59
 
65
60
  - The extension cache is keyed by one working directory and cleared on reload (`core/extensions/loader.js`), so sessions in different directories reload each other's extensions.
66
61
  - `SettingsManager` writes under a lockfile but never re-reads the file, so a second in-memory copy goes stale after another session writes a setting (`core/settings-manager.js`). The host keeps the one process-wide effect, the HTTP dispatcher, consistent itself.
67
62
  - `AgentSessionRuntime.dispose()` releases the session but not the model runtime or the resource loader it was created with (`core/agent-session-runtime.js`), so a session's services outlive it until the process ends.
68
63
 
69
- ## Planned multi-agent boundaries
70
-
71
- The multi-agent workspace feature, its dependency-free contracts, the structured-agent runtime, and the Node side of the terminal-host protocol were removed from `develop`; their last state is commit `243eb7a7` in `develop` history. That structured-workspace plan was retired on 2026-10-10 in favor of `add-persistent-multi-agent-tabs`, where every tab runs the complete A1 UI under the native terminal host. A future implementation starts from the current codebase rather than from that copy. The boundary rules below remain the design intent for that work.
72
-
73
- The workspace feature may depend on workspace contracts and the structured/terminal-host foundations. Those foundations may depend only on dependency-free workspace contracts, never on product features, launch profiles, or each other unless an approved capability adds the dependency. Launch profiles do not import, initialize, launch, or connect to composed terminal-host infrastructure.
74
-
75
- Default future agents and composed hosts are children of the originating bare-`a1` launch instance and terminate when it closes. A process that survives command closure requires a separately approved explicit resident capability; durable identity or state recovery never implies an implicitly surviving process.
76
-
77
- The structured-agent runtime uses a versioned adapter hello and feature negotiation before readiness. Runtime state must use typed events, commands, snapshots, cancellation, and recovery evidence. It must not infer structured semantics from terminal text, terminal timing, or visual content and must not own pseudoterminals or renderer state.
78
-
79
- The JavaScript-to-native terminal-host boundary carries only the fixed role arguments, host command, return code, session-lock calls, and typed semantic bridge data. `host-entry.js` does not touch Node's stdin/stdout streams; pseudoterminal bytes, per-event child input, rendered cells, cell grids, framebuffers, and screen buffers remain inside the addon's native roles and their bounded native IPC. The verified addon and fixed entry are the packaged production host; no console host executable exists. Replacing libghostty-vt with a lightweight custom parser/renderer is forbidden. A desktop-native window and GPU application shell are postponed and are not required for the terminal-hosted product.
80
-
81
- Resource queues, retained state, evidence, logs, and diagnostics follow `docs/architecture/resource-and-data-policy.md`. Terminal content and authentication material are never control-store records. Unknown data is potentially sensitive by default and must be rejected or redacted before persistence.
64
+ Resource queues, retained state, evidence, logs, and diagnostics follow `docs/architecture/resource-and-data-policy.md`. Terminal content and authentication material are never persisted as diagnostics. Unknown data is potentially sensitive by default and must be rejected or redacted before persistence.
82
65
 
83
66
  ## The rules every surface follows
84
67
 
@@ -9,8 +9,8 @@ Every first-party TypeScript class exposed through a production owner's public e
9
9
  Do not add JSDoc solely because a function, type, constructor, property, or method is exported. Do not document a class by repeating its name or listing its methods. Private and protected members never use JSDoc.
10
10
 
11
11
  ```ts
12
- /** Persists complete workspace views and recovery references through the control-store boundary. */
13
- export class WorkspaceStore {
12
+ /** Persists durable update transaction phases so an interrupted update can resume or roll back. */
13
+ export class UpdateTransactionStore {
14
14
  ```
15
15
 
16
16
  ## Implementation comments
@@ -14,7 +14,7 @@ The nightly publication workflow runs `full-release`, including `naming-full`, a
14
14
  - Parser fixtures: `test/repository-governance/naming-inspection.test.ts`.
15
15
  - Git selection fixtures: `test/repository-governance/naming-selection.test.ts`.
16
16
 
17
- TypeScript/JavaScript and Python use syntax trees. Rust uses a token-aware scanner. Workflow environment maps, embedded Node scripts, JSON environment definitions, and supported shell assignments are inspected. Dependencies, immutable vendor files, generated output, and other worktrees are excluded; owned test helpers and locally adapted source ports are not. Unsupported owned inputs fail explicitly. Python inspection uses a bundled development-only grammar, not an installed Python interpreter.
17
+ TypeScript/JavaScript and Python use syntax trees. Workflow environment maps, embedded Node scripts, JSON environment definitions, and supported shell assignments are inspected. Dependencies, immutable vendor files, generated output, and other worktrees are excluded; owned test helpers and locally adapted source ports are not. Unsupported owned inputs fail explicitly. Python inspection uses a bundled development-only grammar, not an installed Python interpreter.
18
18
 
19
19
  The exact externally branded key/member authority is `config/internal-naming-policy.json`. It records each setting's owner, evidence, exposure, and value semantics. Arbitrary uppercase properties are not public environment settings. No compatibility-alias exposure category is allowed. Test snippets and negative-test input data are not declarations or supported aliases.
20
20
 
@@ -24,14 +24,11 @@ The exact externally branded key/member authority is `config/internal-naming-pol
24
24
 
25
25
  | Keys | Producer / consumer and exposure |
26
26
  | --- | --- |
27
- | `A1_CONFIG_DIR`, `A1_DATA_DIR`, `A1_RUNTIME_DIR`, `A1_DATABASE_PATH`, `A1_ENDPOINT` | User/shell configuration consumed by `src/foundation/lifecycle/paths.ts`; documented public overrides, unchanged. |
27
+ | `A1_CONFIG_DIR`, `A1_DATA_DIR`, `A1_RUNTIME_DIR` | User/shell configuration consumed by `src/foundation/lifecycle/paths.ts`; documented public overrides, unchanged. |
28
28
  | `A1_PROFILE_HOME` | Caller-supplied profile-home override consumed by `src/features/launch/profile-paths.ts`; exact existing exposure-review entry. |
29
29
  | `A1_STARTUP_TRACE` | Caller-supplied diagnostic path and trace context in `src/foundation/startup/startup-runtime.ts`; exact existing exposure-review entry. |
30
30
  | `A1_DEV_INSTANCE_ID`, `A1_DEV_ROOT` | Caller-supplied development overrides consumed by `src/features/launch/development-launch.ts`; exact existing exposure-review entries. |
31
- | `A1_PROCESS_GUARDIAN_PATH` | Explicit executable override in `src/foundation/process-containment/native-guardian-containment.ts`, also configured by CI; exact existing exposure-review entry. |
32
- | `A1_PROBE_TRACE` | Opt-in diagnostics read by native terminal-host code; exact existing exposure-review entry. |
33
31
  | `A1_BUILD_VERBOSE`, `A1_DEV_SHELL` | Developer invocation controls in the build helper and development launcher; exact existing exposure-review entries. |
34
- | `A1_PANE_ID`, `A1_TERMINAL_SESSION_ID` | Reserved compatibility identities retained in the product identity manifest; the resident host does not currently emit them. |
35
32
 
36
33
  Pending review preserves a possible external interface, not an obsolete private alias. Once a setting is established as private, it cannot keep its branded spelling through that category.
37
34
 
@@ -39,19 +36,14 @@ Pending review preserves a possible external interface, not an obsolete private
39
36
 
40
37
  | Keys | Producer / consumer and value semantics |
41
38
  | --- | --- |
42
- | `LAUNCH_CONTEXT_RELEASE_ROOT`, `LAUNCH_CONTEXT_RELEASE_ID`, `LAUNCH_CONTEXT_RELEASE_DIGEST`, `LAUNCH_CONTEXT_RELEASE_LAYERS` | Release bootstrap writes the selected verified immutable identity; supervision, guardian, and startup/cache readers consume it. Layers are comma-separated and can be empty. |
43
- | `LAUNCH_CONTEXT_PROFILE` | Bootstrap or the development launcher writes the selected `a1`/`pi` profile; guardian and UI entries consume it. |
39
+ | `LAUNCH_CONTEXT_RELEASE_ROOT`, `LAUNCH_CONTEXT_RELEASE_ID`, `LAUNCH_CONTEXT_RELEASE_DIGEST`, `LAUNCH_CONTEXT_RELEASE_LAYERS` | Release bootstrap writes the selected verified immutable identity; the UI entry and startup/cache readers consume it. Layers are comma-separated and can be empty. |
40
+ | `LAUNCH_CONTEXT_PROFILE` | Bootstrap or the development launcher writes the selected `a1`/`pi` profile; the UI entry consumes it. |
44
41
  | `LAUNCH_CONTEXT_WARMUP` | Release warmup writes exactly `1`; the private warmup entry requires it together with release context. |
45
42
  | `RELEASE_CLEANUP_HOLDS`, `RELEASE_CLEANUP_RUN_ID` | Cleanup scheduler/worker handoff in `src/foundation/release/release-gc.ts`; serialized holds and a worker run identity. |
46
43
  | `SOURCE_LEDGER_PATH`, `SOURCE_LEDGER_SCAN_ROOT`, `SOURCE_LEDGER_PORT_ROOT` | Source-ledger governance fixture overrides; produced by its tests and consumed by `check-pinned-pi-source-ledger.mjs`. |
47
44
  | `RELEASE_RUNNER_LABEL` | Release/full-regression workflows supply certification-runner provenance to `run-release-gates.mjs`. |
48
- | `TERMINAL_FIXTURE_INPUT`, `TERMINAL_FIXTURE_TOKEN` | Native terminal probe producer/consumer in `native/terminal-host/src/main.rs`; expected input and fixture token. |
49
- | `TERMINAL_HOST_LOCAL_BUILD` | Developer shell sets exactly `1`; `native/terminal-host/build.rs` then permits a Windows build outside CI. |
50
- | `TERMINAL_HOST_EXPORT_VT` | Native validation lanes in `.github/workflows/ci.yml` name a directory; `build.rs` copies the linked terminal library, headers, and manifest there for upload. |
51
- | `TERMINAL_HOST_PREBUILT_VT` | Developer shell names a fetched library directory; with `TERMINAL_HOST_LOCAL_BUILD=1` and no `CI`, `build.rs` verifies its manifest and links it instead of running Zig. |
52
45
  | `DOCS_AUTO_MERGE_POLL_ATTEMPTS`, `DOCS_AUTO_MERGE_POLL_MS` | Documentation automation polling controls, produced by governance tests and consumed by `manage-documentation-auto-merge.mjs`. |
53
46
  | `VALIDATION_JOB_STARTED_MS`, `RENDERING_JOB_STARTED_MS` | CI timing handoffs within `.github/workflows/ci.yml`; epoch milliseconds. |
54
- | `RUN_PROCESS_CONTAINMENT_INTEGRATION` | CI enables the real containment fixture with exactly `1`; platform containment tests consume it. |
55
47
  | `PACKAGE_MESSAGE_SCENARIO` | Package-message worker parent/child JSON scenario handoff. |
56
48
  | `RECOVERY_TEST_CANCEL_AFTER`, `RECOVERY_TEST_REMOVAL_MARKER` | Recovery test parent/fake-npm handoff; mutation index and disposable sentinel path. |
57
49
 
@@ -61,12 +53,12 @@ The private launch contract is `neutral-launch-v1`, declared by the package's `p
61
53
 
62
54
  These names are already neutral; their definitions and consumers remain the authority for their existing behavior:
63
55
 
64
- - Development aggregate: `CHANGES_RESULT`, `DOCS_RESULT`, `DOCUMENTATION_RESULT`, `DOCUMENTATION_REQUIRED`, `VALIDATE_RESULT`, `CONTAINMENT_RESULT`, `STARTUP_RESULT`, `RENDERING_RESULT`, `RENDERING_TIER`, `DOCS_ONLY`, `VERSION_ONLY`, `OPENSPEC_TOUCHED`, `SELECTED_HEAD`, `EXPECTED_HEAD`, `EVENT_BASE_SHA`, `EVENT_HEAD_SHA`. The workflow produces these and `require-development-validation.mjs` or the selector consumes them.
56
+ - Development aggregate: `CHANGES_RESULT`, `DOCS_RESULT`, `DOCUMENTATION_RESULT`, `DOCUMENTATION_REQUIRED`, `VALIDATE_RESULT`, `STARTUP_RESULT`, `RENDERING_RESULT`, `RENDERING_TIER`, `DOCS_ONLY`, `VERSION_ONLY`, `OPENSPEC_TOUCHED`, `SELECTED_HEAD`, `EXPECTED_HEAD`, `EVENT_BASE_SHA`, `EVENT_HEAD_SHA`. The workflow produces these and `require-development-validation.mjs` or the selector consumes them.
65
57
  - Naming aggregate: `NAMING_RESULT`, `NAMING_REQUIRED`, `NAMING_HEAD`, produced by CI and consumed by the same required aggregate.
66
58
  - Validation: `VALIDATION_BUILD_READY`, `VALIDATION_CANDIDATE_TARBALL`, `VALIDATION_DOCUMENTATION_FULL_READY`, `VALIDATION_SELECTION_JSON`, `STARTUP_PERFORMANCE_RESULT`, owned by validation orchestration and exact-package fixtures.
67
59
  - Publication workflow-local handoffs: `BUILD`, `EVENT_NAME`, `EXISTS`, `EXPECTED_INTEGRITY`, `EXPECTED_REGISTRY_INTEGRITY`, `EXPECTED_REGISTRY_SHASUM`, `EXPECTED_SHASUM`, `MODE`, `PACKAGE`, `PLAN`, `PUBLISH`, `PULLS_PATH`, `PULL_REQUEST`, `REGISTRY_TARBALL`, `RELEASE_CHANNEL`, `RELEASE_VERSION`, `REQUESTED_CHANNEL`, `REQUESTED_SHA`, `SOURCE_SHA`, `VALIDATE`, `VERSION`, `WORK`, defined and consumed in `.github/workflows/publish.yml`.
68
- - Isolated fixture controls: `PROMPT_SUGGESTION_AGENT_DIR`, `RUN_PROMPT_SUGGESTION_PROVIDER_TEST`, `TEST_SUPERVISOR_SECRET`, owned by their specific provider/supervisor tests.
69
- - Host/tool integration: `CARGO`, `ZIG`, `PATH`, `HOME`, `USERPROFILE`, `APPDATA`, `LOCALAPPDATA`, XDG directory variables, `TERM`, `COLORTERM`, `TERM_PROGRAM`, `WT_SESSION`, `EXEPATH`, `MINGW_PREFIX`, `MSYSTEM`, and third-party `PI_*`, `GITHUB_*`, `GH_TOKEN`, and npm variables. Their external spellings and caller values are not private product naming targets. The forwarding of an arbitrary user's environment is distinct from defining an owned setting.
60
+ - Isolated fixture controls: `PROMPT_SUGGESTION_AGENT_DIR`, `RUN_PROMPT_SUGGESTION_PROVIDER_TEST`, owned by their specific provider tests.
61
+ - Host/tool integration: `PATH`, `HOME`, `USERPROFILE`, `APPDATA`, `LOCALAPPDATA`, XDG directory variables, `TERM`, `COLORTERM`, `TERM_PROGRAM`, `WT_SESSION`, `EXEPATH`, `MINGW_PREFIX`, `MSYSTEM`, and third-party `PI_*`, `GITHUB_*`, `GH_TOKEN`, and npm variables. Their external spellings and caller values are not private product naming targets. The forwarding of an arbitrary user's environment is distinct from defining an owned setting.
70
62
 
71
63
  ### Removed or reclassified registry entries
72
64
 
@@ -78,9 +70,9 @@ The old environment registry included `fixture` and `inputAcknowledgement`, but
78
70
 
79
71
  An update is performed by the release that is already installed, so the contract is negotiated rather than cut over. `neutral-launch-v1` is the only contract this build **writes** for its own releases, and the superseded `A1_RELEASE_*`/`A1_IMMUTABLE_WARMUP` keys are still **read** when an older launcher starts this build, and still **written** when this build starts a retained release that declares no contract. An installation therefore stays launchable across the cutover in both directions, and no user is asked to stop processes and reinstall by hand.
80
72
 
81
- Metadata that predates contract declaration is stale, never fatal. A pre-cutover active record does not stop a launch: it is ignored, the installed payload is materialized, and ordinary cohort selection activates it. A launch that cannot take the installed payload at all — an installation being replaced right now — starts the retained active release instead of failing, and leaves activation to the next launch. What still requires `neutral-launch-v1` outright is narrow and never blocks a launch: the installed package's own manifest must declare it, and an update recovery capsule is never translated.
73
+ Metadata that predates contract declaration is stale, never fatal. A pre-cutover active record does not stop a launch: it is ignored, the installed payload is materialized, and ordinary active-release selection activates it. A launch that cannot take the installed payload at all — an installation being replaced right now — starts the retained active release instead of failing, and leaves activation to the next launch. What still requires `neutral-launch-v1` outright is narrow and never blocks a launch: the installed package's own manifest must declare it, and an update recovery capsule is never translated.
82
74
 
83
- Activation after the global installation is handed over the same way. The package manifest declares `updateActivationContracts` (`activate-v1`) and ships `bin/activate.js`; an updater that serves a declared contract starts that entry with the data directory and the target version and relays its line-delimited progress events (`materializing`, `phase`, `warmup`, `completed`, `failed`) into its own journal and progress bar, while the entry materializes, certifies, warms, and supervises the tree it ships in with that tree's own code. The updater resolves nothing inside the installed tree but `package.json` and that entry; `test/repository-governance/update-activation-contract.test.ts` pins this. A tree that declares no contract the updater serves is activated in-process with the layout it had, which keeps an updater older than the contract and a downgrade to an older preview working.
75
+ Activation after the global installation is handed over the same way. The package manifest declares `updateActivationContracts` (`activate-v1`) and ships `bin/activate.js`; an updater that serves a declared contract starts that entry with the data directory and the target version and relays its line-delimited progress events (`materializing`, `phase`, `warmup`, `completed`, `failed`) into its own journal and progress bar, while the entry materializes, certifies, and warms the tree it ships in with that tree's own code. The updater resolves nothing inside the installed tree but `package.json` and that entry; `test/repository-governance/update-activation-contract.test.ts` pins this. A tree that declares no contract the updater serves is activated in-process with the layout it had, which keeps an updater older than the contract and a downgrade to an older preview working.
84
76
 
85
77
  `test/foundation/release/update-predecessor.integration.test.ts` is the gate for this. It installs each of the most recent published releases and drives the candidate through **that release's own** materialization and warmup, because a fixture built from the candidate would only prove the candidate agrees with itself. On Windows it also drives the newest predecessor's protected package replacement from a user-style A1 prefix with npm beside a separate Node installation, then exercises the explicit `0.2.2` installer-context bridge. Candidate-only recovery success therefore cannot hide a target-side fix that its installed predecessor cannot reach. No reset or migration runs automatically. If disposable state blocks installation, inspect its resolved paths and obtain separate approval before removal.
86
78
 
@@ -28,13 +28,12 @@ src/
28
28
  session-presenters/ pinned Pi selectors and transcript renderers built from engine objects
29
29
  tui-runtime/ neutral presentation runtime over pinned Pi TUI
30
30
  foundation/
31
- launch-guardian/ authenticated launch-instance coordination
32
- lifecycle/ dependency-free launch, process identity, and path contracts
33
- process-containment/ verified native containment and process inspection
34
- protocol/ authenticated control framing and client contracts
35
- release/ immutable releases, update, rollback, cohorts, and cleanup
36
- storage/ control-store persistence
37
- supervision/ endpoint, launch-instance, and release-cohort ownership
31
+ launch-context/ neutral private launch environment contract
32
+ lifecycle/ paths, session selection, and session worktree claims
33
+ release/ immutable releases, bootstrap, update, rollback, and age-based cleanup
34
+ session-writer-lock/ one writer per Pi session file through proper-lockfile
35
+ startup/ startup trace phases and startup budgets
36
+ terminal-cleanup/ bounded terminal reset, exit notice, and fatal-exit diagnostics
38
37
  ui/
39
38
  apps/ application registry and host lifecycle
40
39
  components/ vendor-neutral terminal UI primitives
@@ -47,8 +46,6 @@ Three layer boundaries hold regardless of the DAG: `src/contracts/*` import noth
47
46
 
48
47
  `src/cli` contains command policy but delegates runtime work. `src/composition` is the concrete dependency-injection boundary: it may know both neutral contracts and Pi implementations, while product features receive vendor-neutral ports. Foundation modules never import product features. Pi package knowledge remains inside the Pi adapter owners.
49
48
 
50
- Release-owned endpoint observation and recovery coordinate with supervision-owned publication and storage-owned boot reconciliation through the process guardian's OS-released gates; see [startup recovery](../launch-recovery.md) for the identity, concurrency, and diagnostic boundaries.
51
-
52
49
  Shared code moves to foundation only when it is product-agnostic, has a precise contract, and has more than one real consumer. Do not create `core`, `common`, `utils`, or `misc` dumping grounds.
53
50
 
54
51
  ## Feature ownership
@@ -89,7 +86,7 @@ Prefer the smallest independent boundary that proves the observable result. Do n
89
86
 
90
87
  The repository has one root `package.json`, `package-lock.json`, TypeScript configuration, Vitest configuration, and dependency installation. Nested manifests, lockfiles, `node_modules`, vendored package caches, logs, sessions, browser profiles, generated output, and runtime state are forbidden under production and feature trees.
91
88
 
92
- Build output mirrors the production namespaces directly under ignored `dist/`, without an intermediate `src/` directory; generated release/test evidence and agent-selected scratch files belong in ignored `.artifacts/`; task worktrees and local package outputs belong in ignored `.worktrees/` and `.builds/`. Repository tooling is grouped under `scripts/governance`, `scripts/release`, `scripts/pi`, and `scripts/development`; the few root scripts are standalone maintenance or build commands. Package contents are selected by the root manifest. The Rust process guardian and console terminal-host proof live under `native/`; Cargo output is ignored. Third-party terminal parser sources are isolated under `native/terminal-host/vendor/` and are not owned application modules.
89
+ Build output mirrors the production namespaces directly under ignored `dist/`, without an intermediate `src/` directory; generated release/test evidence and agent-selected scratch files belong in ignored `.artifacts/`; task worktrees and local package outputs belong in ignored `.worktrees/` and `.builds/`. Repository tooling is grouped under `scripts/governance`, `scripts/release`, `scripts/pi`, and `scripts/development`; the few root scripts are standalone maintenance or build commands. Package contents are selected by the root manifest. The repository contains no native code; the published package is pure JavaScript.
93
90
 
94
91
  ## Development worktrees
95
92
 
@@ -123,7 +120,7 @@ A stale Git registration elsewhere whose directory is missing and whose row is `
123
120
 
124
121
  Claude Code uses its established `EnterWorktree` tool by task name. The tracked `.claude/settings.json` wires `scripts/governance/claude-worktree-create.mjs` to create `.worktrees/<task-id>` detached at fresh `origin/develop`, or return an already registered path. The agent must still establish ownership before reusing that path and create the topic branch in a new detached worktree before editing. Passing an absolute `path` to `EnterWorktree` is reserved for a worktree created by hand, from primary before any shell command in that session. The matching `WorktreeRemove` hook declines removal: leave with `ExitWorktree` `keep` and use only the guarded cleanup tool for removal. Other agents do not need these tools or hooks.
125
122
 
126
- A1 linking acquires a cooperative live-session editing claim and switches footer repository/PR discovery; an existing draft PR is not required when linking first succeeds. Clean unlink/disposal releases that runtime claim; a crashed A1 owner becomes reusable only after exact process death is verified. Runtime association does not change process or tool cwd, create a Git lock, or register, release, or authorize cleanup. Context verification and editing handoff also grant no acceptance, finalization, merge, deletion, or cleanup authority. Repository commands therefore keep an explicit worktree path. The primary worktree stays on `develop` for integration and must not be used for task edits. Do not edit, adopt, move, or remove another session's worktree.
123
+ A1 linking acquires a cooperative live-session editing claim and switches footer repository/PR discovery; an existing draft PR is not required when linking first succeeds. Clean unlink/disposal releases that runtime claim; a crashed A1 owner becomes reusable only after its recorded process is no longer running. Runtime association does not change process or tool cwd, create a Git lock, or register, release, or authorize cleanup. Context verification and editing handoff also grant no acceptance, finalization, merge, deletion, or cleanup authority. Repository commands therefore keep an explicit worktree path. The primary worktree stays on `develop` for integration and must not be used for task edits. Do not edit, adopt, move, or remove another session's worktree.
127
124
 
128
125
  An agent that directly chooses a transient file path for a PR/comment body, command payload, captured output, temporary patch/diff, or ad hoc log must place it beneath the verified task worktree's exact `.artifacts/` root, never the primary checkout, another worktree, OS temp, home/desktop, or a sibling path. Such scratch remains ignored, unstaged, uncommitted, disposable, non-authoritative, and secret-free. This repository path rule does not relocate storage internally selected by tools, product runtime code, or hermetic tests.
129
126
 
@@ -140,6 +137,4 @@ An agent that directly chooses a transient file path for a PR/comment body, comm
140
137
 
141
138
  Both interactive profiles use the owned rendering pipeline. Bare `a1` exposes A1-owned surfaces; `a1 pi` withholds those surfaces while using Pi's ordinary profile root. The retired transparent attachment owner is not part of the production tree or dependency map.
142
139
 
143
- The current JavaScript control plane does not provide arbitrary-CLI tabs. Such tabs require the separately bounded console terminal host to own PTYs, authoritative terminal state, rendering, input routing, inactive-surface lifecycle, and reconnection. JavaScript may exchange typed identity, topology revision, capability, lifecycle, status, and recovery messages only; it must not relay terminal output, per-event child input, or rendered cells.
144
-
145
- Structured agents remain semantically separate and use typed events, commands, snapshots, cancellation, and recovery evidence. They must not derive state from ANSI text, terminal timing, or screen content. Native source ownership remains outside `src/`; packaged host selection is governed by release/package owners. Architecture tests reject terminal-host hot-path bytes in JavaScript protocols, terminal inference in structured runtimes, and replacement lightweight terminal parsers or renderers.
140
+ Each launch runs one agent in one directly attached process; there are no tabs, resident sessions, or arbitrary-CLI terminal surfaces. Production code under `src/` may not import `node-pty` or a terminal emulator or spawn a pseudoterminal, and the architecture gate rejects replacement lightweight terminal parsers or renderers. A multi-agent or composed-terminal feature needs its own approved change.
@@ -1,32 +1,21 @@
1
- # Multi-agent resource and data policy
1
+ # Resource and data policy
2
2
 
3
- This policy is mandatory for the multi-agent workspace. It prevents one adapter, terminal pane, recovery record, or proof artifact from exhausting the workspace and prevents accidental persistence of credentials or terminal streams.
3
+ This policy bounds what one A1 process may queue, retain, or persist, and prevents accidental persistence of credentials or terminal content. A1 runs one agent per directly attached process; it keeps no control store, workspace registry, or terminal model of its own.
4
4
 
5
5
  ## Resource budgets
6
6
 
7
- Budgets are minimum defaults, not promises of capacity. An implementation may lower them per agent, adapter, pane, host, or platform, but may not silently remove a limit.
7
+ Budgets are minimum defaults, not promises of capacity. An implementation may lower them per feature or platform, but may not silently remove a limit.
8
8
 
9
9
  | Resource | Default budget | Required outcome on breach |
10
10
  |---|---:|---|
11
- | Structured event payload | 64 KiB | Reject only that event and preserve diagnostics |
12
- | Structured snapshot payload | 1 MiB | Reject resynchronization and mark the agent degraded |
13
- | Structured attachment payload | 2 MiB | Reject only that attachment |
14
- | Queued structured events per agent | 256 | Apply negotiated pause, rejection, compaction, or disconnect |
15
- | Concurrent structured commands per agent | 4 | Reject or queue deterministically with a capability explanation |
16
- | Reconnect replay per adapter | 1,024 events | Stop replay, request a snapshot if available, or mark discontinuity |
17
- | Native-host control message | 1 MiB | Close the incompatible protocol channel without touching panes |
18
- | Native topology nodes per tab | 1,024 | Reject the topology mutation atomically |
19
- | Terminal sessions per host | 64 | Reject additional sessions as unsupported capacity |
20
- | Terminal launch arguments | 1,024 | Reject that launch request |
21
- | Terminal environment entries | 512 | Reject that launch request |
22
- | Retained terminal model per pane | Host-defined, always bounded | Apply documented compaction, backpressure, pause, or termination |
23
- | Scrollback per pane | Host-defined, always bounded | Compact from oldest data first without cross-pane mutation |
24
- | Proof evidence file | 16 MiB | Reject and request summarized evidence |
25
11
  | Diagnostic payload | 256 KiB | Redact, truncate, and retain enough evidence for the failed operation |
12
+ | Fatal-exit records | 10 records of 16 KiB each | Drop the oldest record; never retain prompt or input content |
13
+ | Evidence file | 16 MiB | Reject and request summarized evidence |
26
14
  | Packaged release-note resource | 1 MiB total; 128 KiB per note | Reject the damaged resource and retain the note as unacknowledged |
27
15
  | Release-note acknowledgement/claim | 4 KiB per profile; one claim; one-hour stale bound | Ignore malformed acknowledgement, recover stale claim, and never acknowledge implicitly |
16
+ | Session writer lock | one writer per session file; 10-second stale bound | Refuse a second writer and offer a fork; reclaim a stale lock after the bound |
28
17
 
29
- Every asynchronous consumer must implement a finite queue or window. Backpressure must isolate the offending agent/pane and must not block unrelated identities.
18
+ Every asynchronous consumer must implement a finite queue or window. Backpressure must isolate the offending operation and must not block unrelated sessions or processes.
30
19
 
31
20
  Stable release-note preparation generates Pi-style Markdown with a
32
21
  `## [version] - YYYY-MM-DD` heading and applicable categorized `###` sections. Human
@@ -40,13 +29,11 @@ and total catalog limits apply when the snapshot is combined with committed hist
40
29
 
41
30
  | Class | Examples | Storage policy |
42
31
  |---|---|---|
43
- | Workspace metadata | IDs, names, lifecycle, capability versions, topology revisions, recovery references | May persist in the control store |
32
+ | Release and update state | Immutable release records, update transaction journal, retention timestamps | May persist in A1's data directory; never stores session content or credentials |
44
33
  | Release-note state | Last acknowledged stable A1 version and opaque bounded claim token/time | May persist atomically in profile-isolated A1 configuration; never stores note text or Pi settings |
45
- | Structured payloads | Messages, tool calls, snapshots, attachments | Bound and process; arbitrary payload persistence remains unsupported |
46
- | User-authored prompt recall | Canonical interactive input and bounded provenance | May persist only through the profile-isolated prompt-history policy below, never in the control store |
47
- | Terminal content | PTY bytes, scrollback, selection, rendered cells | Never persist in A1's control store or diagnostics |
48
- | Host topology metadata | Window/tab/pane/session IDs, layout shape, dimensions, revision | May persist; not terminal content |
49
- | Native proof evidence | Artifact hashes, source revisions, workloads, latency/resource measurements, paint diagnostics | May persist in versioned evidence files without terminal content |
34
+ | Session worktree claims | Runtime and agent identity, process ID, canonical worktree path | May persist under A1 state; not terminal content |
35
+ | User-authored prompt recall | Canonical interactive input and bounded provenance | May persist only through the profile-isolated prompt-history policy below |
36
+ | Terminal content | Terminal bytes, scrollback, selection, rendered cells | Never persist in A1 state or diagnostics |
50
37
  | Environment values | `PATH`, profile overrides, arbitrary launch environment | Do not persist; treat as potentially sensitive |
51
38
  | Credentials and tokens | API keys, OAuth tokens, cookies, auth files, passwords | Never copy, log, or persist outside the owning agent/profile |
52
39
  | Authentication state | Pi profile auth, provider sessions, platform keychains | Owned only by the selected agent/profile |
@@ -81,12 +68,10 @@ retention, failure semantics, profile identity, and stopped-instance removal.
81
68
 
82
69
  ## Required architectural outcomes
83
70
 
84
- - Structured/RPC semantics must not be inferred from ANSI text, terminal timing, or visual content.
85
- - Native-host protocol code must not carry PTY bytes, per-event child input, rendered cells, cell grids, framebuffers, or screen buffers.
86
- - `a1 pi` must not import, initialize, launch, or connect to composed terminal-host infrastructure.
87
- - Transparent direct attachment must remain independent of composed infrastructure and must not relay terminal data.
88
- - Recovery records store identity and bounded references, not terminal streams, authentication material, or arbitrary environment values.
89
- - A failed in-terminal 2×2 proof cannot be waived to merge composed infrastructure.
90
- - Proof automation must not launch, focus, drive, resize, or close terminal applications on an active workstation.
71
+ - Agent semantics must not be inferred from ANSI text, terminal timing, or visual content.
72
+ - No module may own a pseudoterminal, emulate a terminal, or relay terminal bytes between the user's terminal and the UI.
73
+ - `a1 pi` uses the same directly attached pipeline with A1 surfaces withheld and never persists A1-owned state into the Pi profile.
74
+ - Persisted records store identity and bounded references, not terminal streams, authentication material, or arbitrary environment values.
75
+ - Test automation must not launch, focus, drive, resize, or close terminal applications on an active workstation.
91
76
 
92
77
  The executable repository policy tests cover these invariants alongside the architecture checker.
@@ -9,7 +9,8 @@ Exact package versions are recorded in `package-lock.json`.
9
9
  | Node.js | `>=22.19.0` |
10
10
  | Package manager | npm 11, lockfile v3 |
11
11
  | Language | TypeScript, strict native ESM, `NodeNext`, ES2023 |
12
- | Control storage | Built-in `node:sqlite` `DatabaseSync`, WAL mode |
12
+ | Prompt history storage | Built-in `node:sqlite` `DatabaseSync`, WAL mode |
13
+ | Session writer and worktree claim locks | `proper-lockfile` |
13
14
  | Process/version helpers | `cross-spawn`, `semver` |
14
15
  | Tests | Vitest |
15
16
 
@@ -23,24 +24,20 @@ Physical desktop automation is absent from the active repository baseline. Any f
23
24
 
24
25
  ## Package contents
25
26
 
26
- The published package contains:
27
+ The published package is pure JavaScript and contains:
27
28
 
28
- - the sole public `a1` command;
29
- - the internal supervisor, launch-guardian, exit-watcher, and fixed terminal-host role entries;
30
- - immutable release/bootstrap, lifecycle, protocol, storage, update, owned-UI, and Pi-adapter modules, plus `process-guardian.node` and `terminal-host.node` for every supported target with manifests and terminal-host notices;
29
+ - the sole public `a1` command and its directly attached `bin/ui.js` entry;
30
+ - the internal activation, warmup, automatic-update, update-recovery, and release-cleanup entries;
31
+ - immutable release/bootstrap, lifecycle, session-writer-lock, update, owned-UI, and Pi-adapter modules;
31
32
  - current user and architecture documentation.
32
33
 
33
- It contains no executable built from A1 sources, separate session-lock addon, browser/desktop GUI, physical automation driver, or generated runtime data. PTY ownership, terminal emulation, composition, and input translation exist only inside the terminal-host addon; the JavaScript product path does not relay terminal bytes.
34
+ It contains no native addon, executable built from A1 sources, browser/desktop GUI, physical automation driver, or generated runtime data. No module owns a pseudoterminal, emulates a terminal, or relays terminal bytes; the UI child inherits the terminal directly.
34
35
 
35
- ## Native addon layer
36
+ ## Build
36
37
 
37
- `npm run doctor` reports this contract against the current machine—Node range, npm major, git, the GitHub CLI, Rust/Cargo, Windows Microsoft C++ readiness where applicable, and whether `node_modules` matches the lockfile—and names the explicit setup action for anything missing. `npm run build` resolves the same native environment and runs the check before cleaning or compiling, so an unmet prerequisite fails by name rather than inside a module resolver, Cargo, or the linker. Unmet tool prerequisites block; a Node or npm version outside the declared contract is reported as an advisory without failing the build.
38
+ `npm run doctor` reports this contract against the current machine—Node range, npm major, git, the GitHub CLI, and whether `node_modules` matches the lockfile—and names the explicit setup action for anything missing. `npm run build` runs the same check before compiling, so an unmet prerequisite fails by name rather than inside a module resolver. Unmet tool prerequisites block; a Node or npm version outside the declared contract is reported as an advisory without failing the build.
38
39
 
39
- Source builds require Rust/Cargo 1.85 or newer; `rust-toolchain.toml` pins the exact version CI and publication install through `scripts/development/prepare-ci-rust.sh`, and rustup selects that version for Cargo commands inside the repository, installing it on first use. On Windows, the resolver honors explicit `CARGO` and `RUSTC` executables, then the launching `PATH`, then `%USERPROFILE%\.cargo\bin`; the fallback changes only build-child state. Windows native linking also requires Visual Studio or Visual Studio Build Tools with the Desktop development with C++ workload, MSVC x64/x86 tools, and a Windows SDK. Visual Studio Code is not a compiler prerequisite. An already valid developer environment is retained; otherwise the resolver uses the installed stable Visual Studio locator and `vcvars64.bat`, verifies that `cl.exe` and Microsoft's `link.exe` come from the selected VC tools, and passes the captured environment only to child processes. This prevents Git Bash's GNU `link.exe` from shadowing MSVC without changing persistent `PATH`. A1 never installs these tools, elevates privileges, or accepts licenses automatically. The Zig cache (`mlugg/setup-zig`, one entry per workflow and platform per run, bounded to 512 MiB) stays enabled: measured on 2026-10-16, a cold Zig build of `libghostty-vt` added about 40 to 60 seconds to a terminal-host test build (Linux 2m21s cold against 1m20s warm, Windows 2m05s against 1m26s), which the cache saves on every warm run.
40
-
41
- `npm run build` compiles `native/process-guardian` as the host platform's Node-API 9 addon, places `process-guardian.node` under `dist/native/<platform>-<architecture>/`, loads it to observe its version identity, and writes the v2 integrity manifest. It also builds the current platform's release-profile `terminal-host.node`, whose v2 manifest binds the addon, `dist/foundation/resident-tabs/host-entry.js`, and notices, so the ordinary `npm run build && ./scripts/dev` handoff exercises resident tabs without deployment. On Windows the normal build reuses a compatible ignored terminal-library cache or downloads the newest compatible library from the current branch or a successful CI run belonging to a pull request already merged into `develop`, then links it under the crate's manifest verification; it never silently invokes the quarantined Zig package fetch. An unavailable or mismatched prerequisite fails the build instead of leaving a nominally successful single-agent-only tree. The npm `prepare` lifecycle and validation preflight use the explicit core build because selected native lanes assemble and certify terminal hosts separately.
42
-
43
- Preview and stable candidate workflows build the addons on isolated Windows, Linux, and macOS arm64 runners, cross-compile the macOS x64 addons on the arm64 runner with `--target x86_64-apple-darwin`, and assemble all targets before packing. Those release runners retain their explicit `npm run build:terminal-host` step and pinned Zig input rather than consuming a workstation cache; Development validation lanes may instead restore a CI-built release addon from an exact-input cache and re-verify it (see [`../ci-release-runbook.md`](../ci-release-runbook.md)). Cross-compiled artifacts record a Mach-O architecture check when they cannot be loaded on the producing runner. Supported native code is always loaded by Node; an absent, incompatible, or unsupported addon fails before runtime startup rather than falling back to PID-only cleanup. The process-guardian addon inherits terminal handles but transports no terminal bytes. Its separate Node-hosted exit watcher restores terminal state after guardian failure, subject to the documented node-wide-kill gap. See [`process-guardian-provenance.md`](process-guardian-provenance.md), [`terminal-host-provenance.md`](terminal-host-provenance.md), and [`resident-tabs.md`](resident-tabs.md).
40
+ `npm run build` compiles TypeScript, runs the existing resource generators, and writes the runtime payload inventory. The npm `prepare` lifecycle runs the same build. Preview and stable candidate workflows pack the built tree once and validate those exact bytes on Windows, Linux, and macOS; there are no per-platform artifacts.
44
41
 
45
42
  ## Gates
46
43
 
@@ -89,19 +86,17 @@ One reusable workflow publishes both npm channels: `.github/workflows/publish.ym
89
86
 
90
87
  ## A1 state paths
91
88
 
92
- These paths are A1 control and release state, not Pi profile roots. All are overrideable for hermetic tests.
89
+ These paths are A1 release, update, and runtime state, not Pi profile roots. All are overrideable for hermetic tests.
93
90
 
94
91
  | Purpose | Override | Windows default | Unix default |
95
92
  |---|---|---|---|
96
93
  | Config | `A1_CONFIG_DIR` | `%APPDATA%\\a1` | `$XDG_CONFIG_HOME/a1` or `~/.config/a1` |
97
- | Control/release data | `A1_DATA_DIR` | `%LOCALAPPDATA%\\a1` | `$XDG_DATA_HOME/a1` or `~/.local/share/a1` |
94
+ | Release data | `A1_DATA_DIR` | `%LOCALAPPDATA%\\a1` | `$XDG_DATA_HOME/a1` or `~/.local/share/a1` |
98
95
  | Runtime | `A1_RUNTIME_DIR` | `%LOCALAPPDATA%\\a1\\runtime` | `$XDG_RUNTIME_DIR/a1` or `<data>/runtime` |
99
- | Database | `A1_DATABASE_PATH` | `<data>/control.sqlite3` | `<data>/control.sqlite3` |
100
- | Endpoint | `A1_ENDPOINT` | runtime-scoped `a1-*` named pipe | `<runtime>/supervisor.sock` |
101
96
 
102
97
  ### Identity hard cut and cleanup
103
98
 
104
- A1 does not read or migrate legacy `ADDONE_*` variables, `AddOne`/`addone` control-state directories, release manifests, database schemas, endpoint records, or protocol frames. Remove obsolete control state only after stopping old processes: `%APPDATA%\\AddOne` and `%LOCALAPPDATA%\\AddOne` on Windows, or the former `addone` directories under XDG config, data, and runtime roots on Unix. This cleanup is manual and never imports data into A1.
99
+ A1 does not read or migrate legacy `ADDONE_*` variables, `AddOne`/`addone` control-state directories, release manifests, or schemas. Remove obsolete control state only after stopping old processes: `%APPDATA%\\AddOne` and `%LOCALAPPDATA%\\AddOne` on Windows, or the former `addone` directories under XDG config, data, and runtime roots on Unix. This cleanup is manual and never imports data into A1.
105
100
 
106
101
  Do **not** remove `~/.a1/agent`; it is A1's current Pi profile root. `~/.pi/agent` remains the vanilla Pi profile.
107
102
 
@@ -118,7 +113,7 @@ The required PR naming job inspects complete new and changed source files. `npm
118
113
  Prompt history has a separate default: `<effective-home>/.a1/data/history/<profile-id>.sqlite3`
119
114
  on Windows, Linux, and macOS. The effective home follows launch-profile resolution
120
115
  (`A1_PROFILE_HOME` or the OS home), not `XDG_DATA_HOME`. An explicit `A1_DATA_DIR`
121
- continues to select `<A1_DATA_DIR>/history` as well as the control/release data root.
116
+ continues to select `<A1_DATA_DIR>/history` as well as the release data root.
122
117
  The home-based history default does not relocate the paths above or the compile
123
118
  cache at `<data>/cache/compile`. See [prompt history](../features/prompt-history.md)
124
119
  for the deliberate fresh start without migration, privacy, and manual removal.
@@ -6,8 +6,8 @@ decisions, and the decisions are where the work is: column arithmetic, sticky-he
6
6
  reservation, block-jump targets, span overlay under styling, and pointer hit regions.
7
7
 
8
8
  This file records what came from where, so a divergence can be judged against its source
9
- instead of argued from memory. It is the same discipline as
10
- [`terminal-host-provenance.md`](terminal-host-provenance.md), applied to UI source.
9
+ instead of argued from memory. It applies the same discipline as
10
+ [`history-editor-provenance.md`](history-editor-provenance.md) to UI source.
11
11
 
12
12
  ## Source
13
13
 
@@ -103,7 +103,7 @@ The real three-release `update-predecessor` scenario is exhaustive because its f
103
103
 
104
104
  Development outcomes report each owner/scope invocation separately while sharing authenticated build/package preparation. The aggregate reports setup, scope, job, aggregate-processing, total runner, and runner-critical-path durations. The acceptance targets are at most eight minutes of runner critical path and five minutes for one PR-required scope; an over-target result remains unmet without retries, timeout increases, workload reduction, or mutable installation caches. Hosted queue time is reported separately when available and is not counted as test execution.
105
105
 
106
- Candidate-packing Development lanes restore the release `terminal-host.node`, its manifest, and its third-party notices from an exact-input `actions/cache` entry keyed by the native tree, `rust-toolchain.toml`, the provenance configuration, the build scripts, the pinned Zig version, and the runner image. On a hit the lane skips the Rust toolchain, Zig, and `cargo` build steps, re-records the manifest's `host-entry.js` digest from the current TypeScript build (`build-terminal-host.mjs --reuse`), and still runs `verify-native-artifacts.mjs --local` before the build receipt; any tampered or mismatched restored file fails the lane instead of rebuilding. A miss builds as before and saves the result. This is build-output reuse with a complete input key, not a mutable installation cache, and publication lanes keep building in-run. Before this reuse, each `packs_candidate` lane spent 2.6 to 3.4 minutes on the release build, and a resident-tabs pull request repeated it in four lanes. Likewise the Linux terminal-host lane caches the `cargo-fuzz 0.13.2` binary by version and nightly date instead of compiling it each run, and the three terminal-host partition jobs run only their `role_integration` slice, so the crate's unit tests execute once per target per run rather than four times.
106
+ Candidate-packing Development lanes build the pure-JavaScript product once per lane with `npm run build` and record the build receipt; there is no native artifact to build, cache, restore, or certify.
107
107
 
108
108
  Inspect local committed and worktree impact without running tests:
109
109
 
@@ -127,7 +127,7 @@ Rendering evidence captures each selected producer/mode/workload matrix once and
127
127
 
128
128
  ## Resource-sensitive fast validation
129
129
 
130
- The authoritative fast-tier declaration identifies tests that repeatedly create temporary repositories, launch child processes, mutate storage, or coordinate release cohorts. The planner removes those files from the parallel remainder and runs them exactly once in one serial `vitest-fast-resource-sensitive` process with file parallelism disabled, on an isolated runner that no other partition shares. One process instead of one per file removes about twenty cold starts from the partition; each file still gets a fresh module context. Pull-request, development-package, and complete release plans use the same partition on every platform.
130
+ The authoritative fast-tier declaration identifies tests that repeatedly create temporary repositories, launch child processes, or mutate release and update state. The planner removes those files from the parallel remainder and runs them exactly once in one serial `vitest-fast-resource-sensitive` process with file parallelism disabled, on an isolated runner that no other partition shares. One process instead of one per file removes about twenty cold starts from the partition; each file still gets a fresh module context. Pull-request, development-package, and complete release plans use the same partition on every platform.
131
131
 
132
132
  The partition runs under an explicit `--testTimeout=30000`, the same hang bound the other explicit fast-tier invocations use. That bound is a hang detector, not a performance gate: shared Windows runners vary by a factor of two or more for identical work, and a fixed five-second wall-clock limit failed passing suites on runner noise. Per-test durations remain in the reporter evidence; `scripts/release/report-resource-sensitive-validation.mjs` records repeated executions and lists every test body above five seconds under `slowTests` so a real slowdown is visible without failing the pull request. A failure is still not retried or converted to success, and the bound is not raised to create margin.
133
133
 
@@ -154,7 +154,7 @@ For applicable code changes, it requires the dedicated Defender-enabled exact-pa
154
154
  | Windows Node 22 | Required for applicable changes | Not scheduled | Retained | Retained |
155
155
  | Windows Node 24 | Not scheduled | Retained | Retained | Retained |
156
156
 
157
- Each selected startup lane runs the package-install scenarios once: a failed budget remains failed and is never retried to obtain a warmed result. The budgets are the ones the `a1-shell` capability declares (2 seconds after an update and on a warm launch, 2.5 seconds with no live supervisor); development validation, development previews, nightly publication, and Full regression record an overrun as a warning and are judged by the three-run persistent-overrun verdict, while stable candidate validation fails on it (see `STARTUP_BUDGET_ENFORCEMENT` in [validation](validation.md)). The publication lane set comes from `scripts/release/publication-validation-matrix.mjs`: a numbered preview validates on the Windows, Linux, and macOS Node 24 lanes, and nightly covers the same head on Windows Node 22 within a day. Node 24 runtime support, other PR jobs, Defender, and publication gates are unchanged. Full validation retains every deferred startup, image, and history test through its existing suite owners.
157
+ Each selected startup lane runs the package-install scenarios once: a failed budget remains failed and is never retried to obtain a warmed result. The budgets are the ones the `a1-shell` capability declares (2 seconds after an update and on a warm launch, 2.5 seconds on a restart-equivalent launch); development validation, development previews, nightly publication, and Full regression record an overrun as a warning and are judged by the three-run persistent-overrun verdict, while stable candidate validation fails on it (see `STARTUP_BUDGET_ENFORCEMENT` in [validation](validation.md)). The publication lane set comes from `scripts/release/publication-validation-matrix.mjs`: a numbered preview validates on the Windows, Linux, and macOS Node 24 lanes, and nightly covers the same head on Windows Node 22 within a day. Node 24 runtime support, other PR jobs, Defender, and publication gates are unchanged. Full validation retains every deferred startup, image, and history test through its existing suite owners.
158
158
 
159
159
  The trade-off is delayed detection: a Node-24-specific regression can reach `develop` before nightly catches it, and the same is true for a real published-predecessor regression. A green bounded PR check does not certify Node 24 or real historical predecessor execution, and nightly failure still blocks its publication. For an unselected candidate or diagnosis, explicitly request the non-publishing standalone Full regression workflow for the desired branch or tag:
160
160
 
@@ -333,10 +333,10 @@ extra-path, wrong-body, or ambiguous work is refused. An existing reopening bran
333
333
  without that exact PR is preserved rather than overwritten. The local preparation
334
334
  checkout is never committed, reset, or used to publish package bytes.
335
335
 
336
- Candidate validation builds the process guardian on all supported platforms, stamps
336
+ Candidate validation builds the product, stamps
337
337
  the version, packs each package once, runs the complete stable suite against those
338
338
  bytes on Windows, Linux, and macOS, and retains the pair for 30 days as
339
- `release-package-<version>`. Stable publication skips the guardian builds and
339
+ `release-package-<version>`. Stable publication skips the build and
340
340
  validation lanes, adopts that retained pair, publishes both to npm `latest` with
341
341
  provenance from the `npm-publish` environment, and exercises the exact published
342
342
  installer/application pair in isolated prefixes on every release lane. Only after