@qlairoslabs/acp-client 0.13.0-alpha.1 → 0.13.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/CONSUMER_GUIDE.md +181 -8
  2. package/MIGRATION-0.12-to-0.13.md +20 -7
  3. package/package.json +13 -2
  4. package/src/agent/config.ts +2 -0
  5. package/src/agent/conversation-manager.ts +1 -0
  6. package/src/agent/native-operations.ts +40 -0
  7. package/src/agent-session-config.ts +2 -0
  8. package/src/agent-session.ts +12 -2
  9. package/src/agent.ts +100 -2
  10. package/src/client.ts +5 -3
  11. package/src/controller-connection.ts +1 -0
  12. package/src/controller.ts +2 -0
  13. package/src/index.ts +3 -0
  14. package/src/launcher.ts +2 -0
  15. package/src/native/approvals.ts +20 -3
  16. package/src/native/capabilities.ts +2 -2
  17. package/src/native/connection.ts +1 -1
  18. package/src/native/controller.ts +5 -3
  19. package/src/native/host-config.ts +2 -0
  20. package/src/native/host.ts +83 -4
  21. package/src/native/mcp.ts +47 -0
  22. package/src/native/recovery.ts +8 -7
  23. package/src/native/reminders/routine-guard.ts +4 -3
  24. package/src/native/reminders/routine-wire.ts +1 -1
  25. package/src/native-harness/README.md +58 -1
  26. package/src/native-harness/package.json +4 -0
  27. package/src/native-harness/scripts/build-routine-zones.py +47 -0
  28. package/src/native-harness/src/capabilities/attachments/admission.ts +42 -0
  29. package/src/native-harness/src/capabilities/attachments/image-validation.ts +98 -0
  30. package/src/native-harness/src/capabilities/attachments/input.ts +1 -0
  31. package/src/native-harness/src/capabilities/attachments/read.ts +76 -0
  32. package/src/native-harness/src/capabilities/attachments/recovery.ts +26 -0
  33. package/src/native-harness/src/capabilities/attachments/selection.ts +37 -0
  34. package/src/native-harness/src/capabilities/attachments/service.ts +75 -0
  35. package/src/native-harness/src/capabilities/attachments/upload.ts +164 -0
  36. package/src/native-harness/src/capabilities/attachments/vision.ts +45 -0
  37. package/src/native-harness/src/capabilities/context/build.ts +5 -0
  38. package/src/native-harness/src/capabilities/context/session.ts +2 -1
  39. package/src/native-harness/src/capabilities/model/openrouter-stream.ts +80 -17
  40. package/src/native-harness/src/capabilities/model/runner.ts +6 -3
  41. package/src/native-harness/src/capabilities/reminders/cron-calendar.ts +50 -0
  42. package/src/native-harness/src/capabilities/reminders/cron-fields.ts +46 -0
  43. package/src/native-harness/src/capabilities/reminders/cron-proof.ts +32 -0
  44. package/src/native-harness/src/capabilities/reminders/cron-zone.ts +53 -0
  45. package/src/native-harness/src/capabilities/reminders/iana-zones.json.gz +0 -0
  46. package/src/native-harness/src/capabilities/reminders/iana-zones.ts +34 -0
  47. package/src/native-harness/src/capabilities/reminders/interval.ts +30 -0
  48. package/src/native-harness/src/capabilities/reminders/routine-advance.ts +47 -0
  49. package/src/native-harness/src/capabilities/reminders/routine-backlog.ts +47 -0
  50. package/src/native-harness/src/capabilities/reminders/routine-expiry.ts +15 -0
  51. package/src/native-harness/src/capabilities/reminders/routine-occurrence.ts +65 -0
  52. package/src/native-harness/src/capabilities/reminders/routine-schedule.ts +70 -0
  53. package/src/native-harness/src/capabilities/reminders/unattended.ts +8 -0
  54. package/src/native-harness/src/capabilities/tools/mcp/client.ts +97 -0
  55. package/src/native-harness/src/capabilities/tools/mcp/http.ts +183 -0
  56. package/src/native-harness/src/capabilities/tools/mcp/registry.ts +62 -0
  57. package/src/native-harness/src/capabilities/tools/mcp/result.ts +33 -0
  58. package/src/native-harness/src/capabilities/tools/mcp/schema.ts +77 -0
  59. package/src/native-harness/src/capabilities/tools/mcp/secrets.ts +28 -0
  60. package/src/native-harness/src/capabilities/tools/mcp/stdio.ts +105 -0
  61. package/src/native-harness/src/capabilities/tools/reminders/index.ts +27 -5
  62. package/src/native-harness/src/capabilities/tools/runtime/invocations.ts +4 -1
  63. package/src/native-harness/src/capabilities/tools/web/config.ts +1 -0
  64. package/src/native-harness/src/capabilities/tools/web/definitions.ts +18 -0
  65. package/src/native-harness/src/capabilities/tools/web/direct-address.ts +56 -0
  66. package/src/native-harness/src/capabilities/tools/web/direct-transport.ts +235 -0
  67. package/src/native-harness/src/capabilities/tools/web/direct.ts +149 -0
  68. package/src/native-harness/src/capabilities/tools/web/exa-transport.ts +41 -0
  69. package/src/native-harness/src/capabilities/tools/web/exa.ts +71 -0
  70. package/src/native-harness/src/capabilities/tools/web/preview.ts +44 -0
  71. package/src/native-harness/src/capabilities/tools/web/registry.ts +47 -0
  72. package/src/native-harness/src/capabilities/tools/web/usage.ts +1 -0
  73. package/src/native-harness/src/contracts/agent.ts +3 -1
  74. package/src/native-harness/src/contracts/attachments.ts +62 -0
  75. package/src/native-harness/src/contracts/config-permissions.ts +14 -3
  76. package/src/native-harness/src/contracts/context.ts +1 -1
  77. package/src/native-harness/src/contracts/events.ts +2 -2
  78. package/src/native-harness/src/contracts/loop.ts +3 -3
  79. package/src/native-harness/src/contracts/mcp.ts +22 -0
  80. package/src/native-harness/src/contracts/model-execution.ts +2 -1
  81. package/src/native-harness/src/contracts/operator-controls.ts +8 -1
  82. package/src/native-harness/src/contracts/protocol.ts +21 -5
  83. package/src/native-harness/src/contracts/reminders.ts +4 -2
  84. package/src/native-harness/src/contracts/routines.ts +20 -0
  85. package/src/native-harness/src/contracts/session-file.ts +2 -0
  86. package/src/native-harness/src/contracts/session.ts +8 -3
  87. package/src/native-harness/src/contracts/storage.ts +32 -13
  88. package/src/native-harness/src/contracts/tools.ts +2 -0
  89. package/src/native-harness/src/contracts/web.ts +16 -0
  90. package/src/native-harness/src/governance/permissions/gate.ts +9 -2
  91. package/src/native-harness/src/governance/policy/resolve.ts +6 -1
  92. package/src/native-harness/src/index.ts +48 -12
  93. package/src/native-harness/src/interfaces/cli/development.ts +108 -53
  94. package/src/native-harness/src/interfaces/cli/serve.ts +2 -2
  95. package/src/native-harness/src/interfaces/cli/start.ts +22 -13
  96. package/src/native-harness/src/interfaces/client.ts +8 -2
  97. package/src/native-harness/src/interfaces/inspector/index.html +7 -1
  98. package/src/native-harness/src/interfaces/inspector/state.ts +6 -2
  99. package/src/native-harness/src/interfaces/protocol/load.ts +3 -1
  100. package/src/native-harness/src/interfaces/protocol/local.ts +13 -4
  101. package/src/native-harness/src/interfaces/protocol/operator.ts +8 -2
  102. package/src/native-harness/src/interfaces/protocol/server.ts +102 -36
  103. package/src/native-harness/src/interfaces/protocol/stdio-client.ts +8 -0
  104. package/src/native-harness/src/interfaces/web-chat/index.html +65 -12
  105. package/src/native-harness/src/interfaces/web-chat/server.ts +30 -3
  106. package/src/native-harness/src/kernel/channels.ts +27 -15
  107. package/src/native-harness/src/kernel/loop.ts +1 -1
  108. package/src/native-harness/src/runtime/config/inference-key.ts +7 -0
  109. package/src/native-harness/src/runtime/config/managed.ts +1 -1
  110. package/src/native-harness/src/runtime/config/paths.ts +8 -1
  111. package/src/native-harness/src/runtime/execution/mcp-stdio.ts +31 -0
  112. package/src/native-harness/src/runtime/reminder-validation.ts +31 -10
  113. package/src/native-harness/src/runtime/reminders.ts +2 -2
  114. package/src/native-harness/src/state/storage/archive.ts +113 -12
  115. package/src/native-harness/src/state/storage/attachment-files.ts +58 -0
  116. package/src/native-harness/src/state/storage/attachment-import.ts +106 -0
  117. package/src/native-harness/src/state/storage/attachment-tables.ts +123 -0
  118. package/src/native-harness/src/state/storage/engine.ts +396 -45
  119. package/src/native-harness/src/state/storage/inference.ts +30 -2
  120. package/src/native-harness/src/state/storage/memory-attachments.ts +56 -0
  121. package/src/native-harness/src/state/storage/memory-reminders.ts +31 -6
  122. package/src/native-harness/src/state/storage/memory.ts +32 -4
  123. package/src/native-harness/src/state/storage/reminder-archive.ts +53 -12
  124. package/src/native-harness/src/state/storage/reminder-change.ts +60 -14
  125. package/src/native-harness/src/state/storage/reminder-tables.ts +11 -3
  126. package/src/native-harness/src/state/storage/routine-row.ts +25 -0
  127. package/src/native-harness/src/state/storage/session-file.ts +22 -9
  128. package/src/native-harness/src/state/storage/sqlite-reminders.ts +48 -8
  129. package/src/native-harness/src/state/storage/sqlite.ts +59 -11
  130. package/src/native-harness/src/state/storage/web-tables.ts +47 -0
  131. package/src/native-harness/src/testing.ts +151 -56
  132. package/src/native-harness/src/util/attachment-input.ts +42 -0
  133. package/src/native-harness/src/util/config.ts +64 -9
  134. package/src/native-harness/src/util/intake.ts +7 -0
  135. package/src/native-harness/src/util/mcp-config.ts +102 -0
  136. package/src/native-harness/src/util/web-config.ts +34 -0
  137. package/src/native-harness/src/util/web-usage.ts +33 -0
  138. package/src/orchestrator/permissions.ts +6 -3
  139. package/src/permissions/conversation.ts +13 -5
  140. package/src/permissions/matcher.ts +2 -0
  141. package/src/permissions/outcome.ts +12 -1
  142. package/src/permissions/policy.ts +13 -8
  143. package/src/steering/combine.ts +1 -0
  144. package/src/steering/contracts.ts +3 -0
  145. package/src/terminals.ts +9 -6
  146. package/src/native/reminders/reminders.test.ts +0 -553
  147. package/src/native/reminders/routine-config.typecheck.ts +0 -13
  148. package/src/native/reminders/wire.typecheck.ts +0 -13
  149. package/src/native-harness/.res/README.md +0 -1
  150. package/src/native-harness/.res/architecture/README.md +0 -21
  151. package/src/native-harness/.res/architecture/context-and-data.md +0 -31
  152. package/src/native-harness/.res/architecture/execution.md +0 -42
  153. package/src/native-harness/.res/architecture/overview.md +0 -44
  154. package/src/native-harness/.res/architecture/persistence.md +0 -56
  155. package/src/native-harness/.res/architecture/suspend-and-resume.md +0 -45
  156. package/src/native-harness/.res/architecture/technical-architecture.md +0 -50
  157. package/src/native-harness/.res/decisions/0001-basic-loop.md +0 -11
  158. package/src/native-harness/.res/decisions/0002-channel-input.md +0 -17
  159. package/src/native-harness/.res/decisions/0003-inference-inspection.md +0 -14
  160. package/src/native-harness/.res/decisions/0004-shared-context.md +0 -21
  161. package/src/native-harness/.res/decisions/0005-notice-inbox.md +0 -20
  162. package/src/native-harness/.res/decisions/0006-explicit-notices.md +0 -12
  163. package/src/native-harness/.res/decisions/0007-channel-output.md +0 -12
  164. package/src/native-harness/.res/decisions/0008-browser-client.md +0 -16
  165. package/src/native-harness/.res/decisions/0009-scripted-model.md +0 -18
  166. package/src/native-harness/.res/decisions/0010-inprocess-protocol.md +0 -19
  167. package/src/native-harness/.res/decisions/0011-stdio-transport.md +0 -21
  168. package/src/native-harness/.res/decisions/0012-session-storage-contract.md +0 -37
  169. package/src/native-harness/.res/decisions/0013-durable-delivery-contract.md +0 -64
  170. package/src/native-harness/.res/decisions/0014-channel-controls-contract.md +0 -73
  171. package/src/native-harness/.res/decisions/0015-session-file-contract.md +0 -72
  172. package/src/native-harness/.res/decisions/0016-configuration-permissions.md +0 -159
  173. package/src/native-harness/.res/decisions/0017-openrouter-managed-config.md +0 -69
  174. package/src/native-harness/.res/decisions/0018-tool-dispatch-evidence.md +0 -78
  175. package/src/native-harness/.res/decisions/0019-model-execution.md +0 -188
  176. package/src/native-harness/.res/decisions/0020-startup-channel-changes.md +0 -71
  177. package/src/native-harness/.res/decisions/0021-tools-and-host-callbacks.md +0 -100
  178. package/src/native-harness/.res/decisions/0022-operator-controls.md +0 -115
  179. package/src/native-harness/.res/decisions/0023-long-running-mock.md +0 -82
  180. package/src/native-harness/.res/decisions/0024-callback-policy-names.md +0 -46
  181. package/src/native-harness/.res/decisions/0025-external-notices.md +0 -364
  182. package/src/native-harness/.res/decisions/0026-bounded-context.md +0 -81
  183. package/src/native-harness/.res/decisions/0027-development-instructions.md +0 -22
  184. package/src/native-harness/.res/decisions/0028-debug-tools.md +0 -16
  185. package/src/native-harness/.res/decisions/0029-bounded-model-call-pages.md +0 -37
  186. package/src/native-harness/.res/decisions/0030-timeline-retrieval.md +0 -145
  187. package/src/native-harness/.res/decisions/0031-one-off-reminders.md +0 -173
  188. package/src/native-harness/.res/docs/11-15.md +0 -148
  189. package/src/native-harness/.res/docs/BUSINESS_RULES.md +0 -111
  190. package/src/native-harness/.res/docs/WORK.md +0 -65
  191. package/src/native-harness/.res/docs/_/11-16-persistence/LOG.md +0 -312
  192. package/src/native-harness/.res/docs/_/11-16-persistence/PLAN.md +0 -77
  193. package/src/native-harness/.res/docs/_/11-16-persistence/SPEC.md +0 -313
  194. package/src/native-harness/.res/docs/_/11-19-channel-controls/LOG.md +0 -160
  195. package/src/native-harness/.res/docs/_/11-19-channel-controls/PLAN.md +0 -89
  196. package/src/native-harness/.res/docs/_/11-19-channel-controls/SPEC.md +0 -135
  197. package/src/native-harness/.res/docs/_/11-19-config-permissions/LOG.md +0 -143
  198. package/src/native-harness/.res/docs/_/11-19-config-permissions/PLAN.md +0 -93
  199. package/src/native-harness/.res/docs/_/11-19-config-permissions/SPEC.md +0 -181
  200. package/src/native-harness/.res/docs/acp-client-integration/0001-DESIGN/11-20-LOG.md +0 -433
  201. package/src/native-harness/.res/docs/acp-client-integration/0001-DESIGN/PLAN.md +0 -60
  202. package/src/native-harness/.res/docs/acp-client-integration/0001-DESIGN/PROTOCOL.md +0 -141
  203. package/src/native-harness/.res/docs/acp-client-integration/0001-DESIGN/SPEC.md +0 -168
  204. package/src/native-harness/.res/docs/attachments/0001-DESIGN/SPEC.md +0 -111
  205. package/src/native-harness/.res/docs/bounded-context/0001-DESIGN/PLAN.md +0 -129
  206. package/src/native-harness/.res/docs/bounded-context/0001-DESIGN/SPEC.md +0 -135
  207. package/src/native-harness/.res/docs/channel-messaging/0001-DESIGN-external-notices/LOG.md +0 -437
  208. package/src/native-harness/.res/docs/channel-messaging/0001-DESIGN-external-notices/PLAN.md +0 -127
  209. package/src/native-harness/.res/docs/channel-messaging/0001-DESIGN-external-notices/SPEC.md +0 -203
  210. package/src/native-harness/.res/docs/long-running-mock/0001-DESIGN/LOG.md +0 -292
  211. package/src/native-harness/.res/docs/long-running-mock/0001-DESIGN/PLAN.md +0 -91
  212. package/src/native-harness/.res/docs/long-running-mock/0001-DESIGN/SPEC.md +0 -187
  213. package/src/native-harness/.res/docs/model-execution/0001-DESIGN/LOG.md +0 -148
  214. package/src/native-harness/.res/docs/model-execution/0001-DESIGN/PLAN.md +0 -95
  215. package/src/native-harness/.res/docs/model-execution/0001-DESIGN/SPEC.md +0 -200
  216. package/src/native-harness/.res/docs/model-execution/0002-AMENDMENT-accounting/SPEC.md +0 -80
  217. package/src/native-harness/.res/docs/operator-controls/0001-DESIGN/LOG.md +0 -206
  218. package/src/native-harness/.res/docs/operator-controls/0001-DESIGN/PLAN.md +0 -106
  219. package/src/native-harness/.res/docs/operator-controls/0001-DESIGN/SPEC.md +0 -297
  220. package/src/native-harness/.res/docs/persistence/0002-AMENDMENT-session-file/LOG.md +0 -41
  221. package/src/native-harness/.res/docs/persistence/0002-AMENDMENT-session-file/PLAN.md +0 -36
  222. package/src/native-harness/.res/docs/persistence/0002-AMENDMENT-session-file/SPEC.md +0 -84
  223. package/src/native-harness/.res/docs/shell-execution/0001-DESIGN/SPEC.md +0 -147
  224. package/src/native-harness/.res/docs/timeline-retrieval/0001-DESIGN/LOG.md +0 -15
  225. package/src/native-harness/.res/docs/timeline-retrieval/0001-DESIGN/PLAN.md +0 -107
  226. package/src/native-harness/.res/docs/timeline-retrieval/0001-DESIGN/SPEC.md +0 -114
  227. package/src/native-harness/.res/docs/todos/11-19-TODO-auto_review-approve.md +0 -24
  228. package/src/native-harness/.res/docs/todos/11-20-TODO-user-entered-tool-code.md +0 -23
  229. package/src/native-harness/.res/docs/todos/11-21-TODO-node-resource-coordination.md +0 -103
  230. package/src/native-harness/.res/docs/todos/11-22-TODO-harness-m1-sequence.md +0 -50
  231. package/src/native-harness/.res/docs/tools-and-callbacks/0001-DESIGN/LOG.md +0 -337
  232. package/src/native-harness/.res/docs/tools-and-callbacks/0001-DESIGN/PLAN.md +0 -76
  233. package/src/native-harness/.res/docs/tools-and-callbacks/0001-DESIGN/SPEC.md +0 -204
  234. package/src/native-harness/.res/docs/tools-and-callbacks/0002-AMENDMENT-callback-policy/LOG.md +0 -73
  235. package/src/native-harness/.res/docs/tools-and-callbacks/0002-AMENDMENT-callback-policy/SPEC.md +0 -64
  236. package/src/native-harness/.res/docs/tools-and-callbacks/0003-DESIGN-attachment-tools/SPEC.md +0 -58
  237. package/src/native-harness/.res/docs/tools-and-callbacks/0004-DESIGN-reminder-tools/LOG.md +0 -45
  238. package/src/native-harness/.res/docs/tools-and-callbacks/0004-DESIGN-reminder-tools/PLAN.md +0 -108
  239. package/src/native-harness/.res/docs/tools-and-callbacks/0004-DESIGN-reminder-tools/SPEC.md +0 -169
  240. package/src/native-harness/.res/docs/web-tools/0001-DESIGN/SPEC.md +0 -128
  241. package/src/native-harness/.res/marketing-draft.md +0 -22
  242. package/src/native-harness/.res/sandbox/1-simple-harness/README.md +0 -285
  243. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-1.md +0 -19
  244. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-10.md +0 -138
  245. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-11.md +0 -148
  246. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-12.md +0 -172
  247. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-13.md +0 -194
  248. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-14.md +0 -233
  249. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-15.md +0 -249
  250. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-16.md +0 -265
  251. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-17.md +0 -279
  252. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-18.md +0 -293
  253. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-19.md +0 -307
  254. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-2.md +0 -29
  255. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-20.md +0 -317
  256. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-21.md +0 -327
  257. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-3.md +0 -40
  258. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-4.md +0 -59
  259. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-5.md +0 -69
  260. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-6.md +0 -79
  261. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-7.md +0 -89
  262. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-8.md +0 -102
  263. package/src/native-harness/.res/sandbox/1-simple-harness/conversation/context-9.md +0 -116
  264. package/src/native-harness/.res/sandbox/1-simple-harness/conversation.jsonl +0 -49
  265. package/src/native-harness/.res/sandbox/1-simple-harness/doc.md +0 -87
  266. package/src/native-harness/.res/sandbox/1-simple-harness/harness.py +0 -289
  267. package/src/native-harness/.res/sandbox/1-simple-harness/local/harness copy 2.py +0 -221
  268. package/src/native-harness/.res/sandbox/1-simple-harness/local/harness copy 3.py +0 -287
  269. package/src/native-harness/.res/sandbox/1-simple-harness/local/harness copy.py +0 -165
  270. package/src/native-harness/.res/sandbox/1-simple-harness/state.json +0 -22
  271. package/src/native-harness/.res/sandbox/1-simple-harness/system-prompt.md +0 -2
  272. package/src/native-harness/AGENTS.md +0 -70
  273. package/src/native-harness/ARCHITECTURE.md +0 -249
  274. package/src/native-harness/bun.lock +0 -26
  275. package/src/native-harness/test/agent.test.ts +0 -130
  276. package/src/native-harness/test/approval-gate.test.ts +0 -255
  277. package/src/native-harness/test/approval-protocol.test.ts +0 -94
  278. package/src/native-harness/test/boundaries.test.ts +0 -18
  279. package/src/native-harness/test/channel-controls.test.ts +0 -322
  280. package/src/native-harness/test/client-abort.test.ts +0 -136
  281. package/src/native-harness/test/config-policy.test.ts +0 -301
  282. package/src/native-harness/test/conformance/storage.ts +0 -1141
  283. package/src/native-harness/test/context.test.ts +0 -177
  284. package/src/native-harness/test/crash.test.ts +0 -187
  285. package/src/native-harness/test/debug-tools.test.ts +0 -67
  286. package/src/native-harness/test/development-cli.test.ts +0 -67
  287. package/src/native-harness/test/development.test.ts +0 -171
  288. package/src/native-harness/test/dispatch-evidence.test.ts +0 -58
  289. package/src/native-harness/test/e2e.test.ts +0 -186
  290. package/src/native-harness/test/external-notices.test.ts +0 -101
  291. package/src/native-harness/test/fixtures/approval-e2e.jsonl +0 -4
  292. package/src/native-harness/test/fixtures/crash-scenario.jsonl +0 -5
  293. package/src/native-harness/test/fixtures/development-lifecycle.jsonl +0 -10
  294. package/src/native-harness/test/fixtures/echo-scenario.jsonl +0 -3
  295. package/src/native-harness/test/fixtures/format2-schema.ts +0 -27
  296. package/src/native-harness/test/fixtures/format3-schema.ts +0 -16
  297. package/src/native-harness/test/fixtures/hold-scenario.jsonl +0 -4
  298. package/src/native-harness/test/fixtures/model-e2e.jsonl +0 -3
  299. package/src/native-harness/test/fixtures/storage-owner.ts +0 -20
  300. package/src/native-harness/test/format-reply.test.ts +0 -10
  301. package/src/native-harness/test/helpers/operator-view.ts +0 -41
  302. package/src/native-harness/test/helpers/scenario.ts +0 -9
  303. package/src/native-harness/test/helpers/session.ts +0 -38
  304. package/src/native-harness/test/helpers/stdio.ts +0 -46
  305. package/src/native-harness/test/inspector.test.ts +0 -77
  306. package/src/native-harness/test/listeners.test.ts +0 -49
  307. package/src/native-harness/test/loop.test.ts +0 -88
  308. package/src/native-harness/test/model-channel-double.test.ts +0 -87
  309. package/src/native-harness/test/model-crash.test.ts +0 -62
  310. package/src/native-harness/test/model-delivery-regressions.test.ts +0 -55
  311. package/src/native-harness/test/model-e2e.test.ts +0 -71
  312. package/src/native-harness/test/model-final-filter.test.ts +0 -30
  313. package/src/native-harness/test/model-large-reply.test.ts +0 -28
  314. package/src/native-harness/test/model-live-queue.test.ts +0 -33
  315. package/src/native-harness/test/model-runner.test.ts +0 -117
  316. package/src/native-harness/test/model-storage.test.ts +0 -99
  317. package/src/native-harness/test/model-stream-adapter.test.ts +0 -26
  318. package/src/native-harness/test/model-stream-public.test.ts +0 -77
  319. package/src/native-harness/test/notices.test.ts +0 -64
  320. package/src/native-harness/test/openrouter-config.test.ts +0 -218
  321. package/src/native-harness/test/operator-controls.test.ts +0 -132
  322. package/src/native-harness/test/output.test.ts +0 -44
  323. package/src/native-harness/test/owner-config.test.ts +0 -64
  324. package/src/native-harness/test/permissions-e2e.test.ts +0 -68
  325. package/src/native-harness/test/persistence.test.ts +0 -236
  326. package/src/native-harness/test/portability.test.ts +0 -337
  327. package/src/native-harness/test/protocol.test.ts +0 -160
  328. package/src/native-harness/test/reminder-clock.test.ts +0 -61
  329. package/src/native-harness/test/reminder-stdio.test.ts +0 -140
  330. package/src/native-harness/test/reminder-storage.test.ts +0 -124
  331. package/src/native-harness/test/scenario-jsonl.test.ts +0 -112
  332. package/src/native-harness/test/scripted.test.ts +0 -92
  333. package/src/native-harness/test/session-file.test.ts +0 -51
  334. package/src/native-harness/test/startup-channel-changes.test.ts +0 -256
  335. package/src/native-harness/test/stdio.test.ts +0 -132
  336. package/src/native-harness/test/storage-memory.test.ts +0 -4
  337. package/src/native-harness/test/storage-sqlite.test.ts +0 -420
  338. package/src/native-harness/test/suspension.test.ts +0 -430
  339. package/src/native-harness/test/timeline-retrieval.test.ts +0 -211
  340. package/src/native-harness/test/tools-catalog.test.ts +0 -468
  341. package/src/native-harness/test/tools-protocol.test.ts +0 -418
  342. package/src/native-harness/test/transfers.test.ts +0 -94
  343. package/src/native-harness/test/web-chat.test.ts +0 -35
@@ -1,297 +0,0 @@
1
- # Operator and consumer controls
2
-
3
- Date: 2026-11-20.
4
- Status: proposed for review. See [PLAN.md](PLAN.md) for module ownership and
5
- implementation gates.
6
-
7
- ## Goal
8
-
9
- Let a consumer control an agent, manage one of its channels, and attach to a
10
- conversation independently. Prove the behavior through acp-client and the
11
- public harness client over stdio. Build on the accepted revisions of the
12
- [acp-client integration](../../acp-client-integration/0001-DESIGN/SPEC.md) and
13
- [tools and host callbacks](../../tools-and-callbacks/0001-DESIGN/SPEC.md).
14
- Reuse the existing [channel controls](../../11-19-channel-controls/SPEC.md).
15
-
16
- ## Ownership
17
-
18
- | Scope | Owner | Effect |
19
- | --- | --- | --- |
20
- | Agent session | Harness; the consumer host owns the process and transport | Session lifecycle governs execution across all its channels. |
21
- | Channel | Harness | Channel lifecycle governs admission and execution for that channel. A turn and its tool invocations belong to the channel. |
22
- | Attachment | Consumer | An attachment lets the client observe a channel. A listener can unsubscribe independently. Disposing the attachment releases local resources. |
23
-
24
- An agent session represents one identity and timeline. Each channel keeps its
25
- own lifecycle, turns, pending inputs, and policy over the session tool catalog.
26
- An active channel can admit input and run a turn with no attachments. The
27
- harness supplies `notify_channel` by default in normal session composition,
28
- including the scripted stdio server. The harness derives the source channel
29
- and turn, reserves the built-in name, and uses the existing tool permission
30
- and channel admission rules. Closing a client view leaves the channel, its
31
- work, and the shared host connection intact.
32
- Closing the host's stdio connection still has the existing EOF stop semantics.
33
- Two clients may observe one channel through the consumer without creating two
34
- harness channels or two turn supervisors for it.
35
-
36
- ## Status
37
-
38
- | Scope | Consumer view |
39
- | --- | --- |
40
- | Attachment | **Connected** or **Disconnected**. Connected means the client has attached and can observe the channel. |
41
- | Channel | **Active · Idle**, **Active · Working**, **Suspending**, or **Suspended**. **Retired** is permanent. Map the harness's existing `open` state to **Active**. |
42
- | Agent | **Online**, **Suspending**, **Suspended**, or **Offline**. While online, show **Idle** or **Working in N channels**, derived from the number of channels with a running turn. |
43
-
44
- Show a session-level blocker alongside the channel's own state. An active
45
- channel under a suspended session stays active but cannot run until the
46
- session resumes. A channel waiting on an approval or callback with a running
47
- turn counts as working. A checkpointed turn and pending inputs by themselves
48
- do not count as running work. Where phase data is available, show the phase,
49
- its start time, and the relevant turn, approval, model call, or tool ID.
50
-
51
- Offline means the host knows the agent is down. If the client loses its own
52
- connection and cannot verify the agent state, show that state as unknown or
53
- mark the last view as stale. Obtain a current view through the existing public
54
- status operation and revisioned channel observation.
55
-
56
- ## Attachment and controller API
57
-
58
- Plain attach observes the existing channel and preserves its lifecycle. A
59
- consumer can offer an attach-and-start convenience option for normal use.
60
- Install event handling and reconcile the initial view before exposing live
61
- updates. When the same operation makes work eligible, establish observation
62
- before enabling execution. A repeated attach on the same controller reuses its
63
- attachment. A repeated start leaves an already active channel active.
64
-
65
- Disposing the attachment is idempotent. It stops local delivery and leaves
66
- accepted inputs, running turns, and pending approvals in the harness under
67
- their existing lifecycle rules. Removing a listener just stops delivery to
68
- that listener.
69
-
70
- Keep the existing `ConversationController.start()` and `stop()` pair for the
71
- shared high-level workflow. Native start can attach and make an eligible
72
- channel available. ACP keeps its existing lifecycle. A client can compose
73
- restart as stop followed by start after a successful stop. For native, this
74
- uses the same channel ID and keeps its history. Plain reattachment never
75
- resumes a suspended channel. Expose attach-only as a capability where
76
- supported. The console or UI can offer a detach action through attachment
77
- disposal.
78
-
79
- For this slice, keep native `stop()` as a targeted interrupt and detach. The
80
- channel remains eligible for future work. When a running turn is targeted,
81
- successful stop confirms that the harness interrupted it or that it had
82
- already ceased running. If the connection drops before confirmation, surface
83
- the unconfirmed result and reconcile the target on reopen. Shared Restart
84
- opens only after successful stop. Attachment disposal leaves the turn running.
85
- Explicitly suspend the channel to prevent future turns, and resume it to
86
- restore eligibility. Host shutdown acts at agent scope.
87
-
88
- ### Approval delivery and authority
89
-
90
- The harness owns each pending approval, associates it with its channel and
91
- exact tool call, and enforces its existing deadline and cancellation rules.
92
- It publishes `approval_requested` on the existing connection and accepts
93
- `allow_once` or `deny` through `approval/respond` for the pending request ID.
94
- A harness without an approval-capable consumer skips calls that need approval.
95
-
96
- The embedding application can configure one responder on acp-client's
97
- `NativeHarnessHost`. The host receives approval events for all its channels
98
- before forwarding events to conversation controllers. A configured host
99
- responder is the sole answer path for that agent. The embedding application
100
- decides which operators may answer through it. Channel attachment and message
101
- submission confer no approval authority. For applications without a host
102
- responder, preserve the existing conversation handler and its behavior.
103
-
104
- The application can present requests through an operator inbox or inline in
105
- a chat using their channel and tool-call IDs. With a configured responder,
106
- disposing the last chat attachment leaves the host connection and the pending
107
- request intact. If nobody can answer, the request waits under its existing
108
- deadline. Closing the approval-capable host connection follows the existing
109
- cancellation rules.
110
-
111
- `channel/observe` exposes still-pending approvals so a reattached view can
112
- reconcile them with live events by request ID. The harness response remains
113
- authoritative for answer races. Expiry, suspension, interruption, and
114
- disconnection close requests under the existing rules. Late or duplicate
115
- answers grant no permission. Harness-level participant roles and automatic
116
- approval review are deferred.
117
-
118
- ## Opening, reconciliation, and history
119
-
120
- | Operation | Scope and response |
121
- | --- | --- |
122
- | Open agent | Open the configured session, recover execution state, and apply startup channel changes before work becomes eligible. Return session identity, lifecycle, revision, and startup change results. The open response excludes transcript pages and historical turns and inputs. |
123
- | Attach or reattach | Require a channel ID. Return current channel state, its running or checkpointed turn, and any live approval the consumer can act on. Establish the revision boundary for live delivery. |
124
- | Reconcile tracked work | Look up the specific input or turn IDs the host still tracks, scoped to the channel. Recover their outcomes and committed reply IDs or references without walking earlier history. |
125
- | Read history | Explicitly request either one channel's conversation or the agent's cross-channel timeline. Fetch additional pages only on request. |
126
-
127
- Use focused storage reads for open, channel observation, and tracked recovery.
128
- These paths must avoid materializing the historical timeline, turns, or inbox
129
- records. Recovery still updates unfinished work and applies pending startup
130
- changes under the existing rules.
131
-
132
- ### Public protocol
133
-
134
- | Request | Inputs and result |
135
- | --- | --- |
136
- | `session/open` | Takes the session ID, optional config, and optional startup channel changes. Opens an existing session and returns identity, lifecycle, revision, and startup change outcomes. A missing session is `not_found`; the host can then use `session/create`. Both readiness responses are lightweight. |
137
- | `channel/observe` | Takes a channel ID. Returns one revisioned view with channel lifecycle, a pending-input count, the running or checkpointed turn summary, and actionable pending approvals. The consumer uses the existing connection's live event stream. |
138
- | `channel/reconcile` | Takes a channel ID and a bounded batch of input and turn IDs. Returns their current disposition, explicitly identifies unknown IDs, and exposes committed reply references for the matched turns. Page any reply references that exceed the response budget. |
139
- | `channel/messages` | Takes a channel ID and optional limit. The initial request reads the newest page. An older-page cursor continues backward. A saved message position and an upper revision begin forward catch-up. A continuation cursor advances that catch-up within the same bounds. Returns messages with stable IDs and recoverable positions, plus a continuation when more records exist. |
140
- | `session/timeline` | Takes an optional limit and older-page cursor. Returns a page of attributed timeline events and a continuation when older events exist. |
141
-
142
- Replace the public `session/load` and `session/messages` paths in the harness
143
- and switch acp-client to these operations in the same slice. The former wire
144
- shapes require no migration or compatibility path. Keep the existing lifecycle
145
- requests and `session/message/read` for assistant text references. Preserve
146
- stored sessions and startup channel-change behavior. Recovered work becomes
147
- eligible after the open response is sent, subject to session and channel state.
148
-
149
- The live attachment path registers delivery before taking the current view.
150
- Recover an active turn even when it has no local submission record. Restore
151
- completed turns as history and scope live supervision to live work. Use stable
152
- IDs to deduplicate committed replies where the initial view overlaps live
153
- delivery. Transient deltas follow the existing delivery contract.
154
-
155
- ### History views
156
-
157
- Both views read the same stored timeline through the storage adapter. A
158
- conversation page requires a channel ID. Its limit counts committed participant
159
- messages and assistant text messages. Tool calls, tool results, internal notices,
160
- and transient deltas consume none of that budget. The agent timeline pages by
161
- stored events across channels and can include notices and tool activity.
162
-
163
- Return the newest page first and order records chronologically within each
164
- page. Use an opaque cursor bound to the session, view, channel where applicable,
165
- and the original timeline boundary. Older reads use indexed sequence ranges.
166
- Respect the wire-size bound and use references for oversized records where
167
- supported. If a single event is oversized, return a bounded entry with its
168
- identity, attribution, and an omitted-payload indicator. Include an existing
169
- scoped result reference when available. The cursor advances past this entry.
170
- The [business rules](../../BUSINESS_RULES.md) set the page default and opt-in
171
- fetch behavior.
172
-
173
- acp-client resolves its conversation ID to the harness channel ID and retains
174
- its consumer-facing pagination interface. A consumer using its own transcript
175
- can attach and receive live events without requesting harness history. That
176
- mode recovers tracked outcomes and can leave gaps for untracked turns completed
177
- while the consumer missed live delivery. When the harness supplies the
178
- transcript, the chat UI can request the newest page as part of opening the
179
- view. Targeted recovery works with either transcript source. History reads
180
- have no effect on model context or execution.
181
-
182
- Both paged and live committed conversation messages expose the same stable ID
183
- and a channel-scoped position. Forward catch-up is supported in this slice and
184
- remains opt-in. Buffer live delivery for the affected channel, then read bounded
185
- pages after the last persisted position up to and including the observation
186
- revision. Deliver those pages in chronological order and merge live messages
187
- using stable IDs. Advance the persisted position only after messages through
188
- that position have been saved. A retry can safely resume from the last saved
189
- position. If live delivery resumes while a gap is unresolved, keep the saved
190
- catch-up position before the gap even if newer messages are displayed. A
191
- consumer without a saved position can explicitly request the newest page.
192
-
193
- Return the stored channel, turn, and actor attribution. Participant messages
194
- carry the participant ID. Agent output and tool results carry the agent actor.
195
- The turn's linked inputs preserve provenance when multiple participants steer
196
- it. Internal notices retain source and destination channels. Connection tracing
197
- and participant-filtered reads are deferred.
198
-
199
- ## Channel controls
200
-
201
- - Create, edit, and retire channels through the existing operations. Creating
202
- a channel starts no turn. A retired ID cannot be reactivated.
203
- - Suspend closes admission and lets existing work reach the suspension
204
- boundary. The response confirms the channel's committed suspension.
205
- - Resume clears the individual suspension. Work becomes eligible when the
206
- session can run. Accepted, untaken inputs remain pending through suspension.
207
- - Interrupt targets one exact turn. Late or stale requests cannot affect the
208
- next turn. The active channel can still take new work.
209
-
210
- Suspended is the reversible inactive state for v1. If an immediate combined
211
- action is added, interrupt and close admission as one harness transition and
212
- leave the channel suspended. The base slice can use the existing separate
213
- suspend and interrupt controls. Follow the existing recovery rules for any
214
- uncertain tool effects.
215
-
216
- ## Agent and host controls
217
-
218
- - Start opens the configured agent session through the existing host launch
219
- sequence and the lightweight open path. Concurrent startup requests share
220
- the launch. Opening a suspended session preserves its suspension.
221
- - Suspend stops session-wide admission and waits for the existing suspension
222
- boundary. While it waits, allow status and targeted interrupts through the
223
- same connection. If a callback is holding it open, show the blocking turn
224
- and tool where available. The suspend response confirms the checkpoint is
225
- ready for a clean replacement of the process.
226
- - Resume explicitly makes eligible channels able to run. An individually
227
- suspended channel stays suspended. Surface incompatibility and preserve
228
- the checkpoints.
229
- - Stop immediately ends session execution and shuts down the child. An
230
- intentional stop suppresses automatic reopen. If the child exits without
231
- confirmation, recover the authoritative outcomes on the next open and
232
- reconcile tracked turns by ID.
233
-
234
- For a planned update, suspend, close the child after suspension commits, open
235
- the same session with the replacement, and explicitly resume. Reuse the public
236
- harness client. acp-client owns orchestration and presentation for this flow.
237
-
238
- ## Config, capabilities, and usage
239
-
240
- Use `initialize` capabilities to expose supported controls. Validate candidate
241
- configuration through `config/validate` and apply it through the existing open
242
- path. Keep credential values out of operator output. Aggregate the existing
243
- durable model-call records by session or channel. Represent missing provider
244
- usage as unknown and surface when an aggregate is partial.
245
-
246
- ## Acceptance
247
-
248
- Use a scripted model over real stdio without provider credentials.
249
-
250
- 1. Attach Alice and Bob. Detach Alice without interrupting her turn and let it
251
- finish. Have Bob's scripted model call `notify_channel` for Alice's active
252
- channel. Wait for the notice-driven reply to commit while she is detached.
253
- Reattach with an explicit history read and verify each committed reply
254
- appears once, later events arrive, and Bob's attachment remains intact.
255
- Verify ordinary session composition offers the built-in once when policy
256
- permits it, policy denial prevents dispatch, and consumer registration
257
- cannot shadow it.
258
- 2. Suspend Alice while Bob works. Verify Alice rejects new input, her accepted
259
- untaken work stays pending, and explicit resume enables it once. A stale
260
- interrupt leaves a newer turn alone. Verify repeated attachment and
261
- disposal do not change the channel's lifecycle.
262
- 3. Suspend the session while a tool is running. Observe the blocking call,
263
- let it settle, replace the child, reload, and resume. Verify the tool's
264
- effect happened once and an individually suspended channel stays suspended.
265
- In a separate run, stop during suspension and reconcile interrupted work.
266
- 4. Verify the consumer can distinguish disconnected, offline, suspended, and
267
- online with multiple working channels. Check capabilities, invalid config
268
- validation, and a usage summary containing missing provider usage.
269
- 5. Open a session with at least 10,000 timeline records and enough turns or
270
- inputs to exceed the existing full-load frame. Verify open and attachment
271
- read no transcript when fetching is disabled. Hold inference and verify
272
- storage reads for open, attachment, and targeted recovery stay bounded.
273
- Confirm targeted recovery still finds a tracked outcome. Request Alice's
274
- newest conversation page and verify the query stays scoped to her channel.
275
- Page backward while new
276
- replies arrive and verify ordering, stable attribution, and no duplicate or
277
- missing messages. Verify tool activity does not consume the conversation
278
- page budget and remains visible in the separately paged agent timeline.
279
- 6. With a configured host responder, detach the last observer while an
280
- approval is pending. Answer through the host before expiry and verify the
281
- tool runs once. In a separate case, request approval while nobody is
282
- attached, then reattach and recover the pending request by ID. Verify an
283
- observer without approval authority cannot answer, expiry and cancellation
284
- retain their existing effects, and late or duplicate answers cannot
285
- dispatch the tool. Verify the existing conversation handler still works
286
- when the application configures no host responder.
287
- 7. Verify shared Restart waits for targeted interruption before reopening the
288
- conversation. An unconfirmed stop makes Restart fail before it calls start.
289
- Verify the next turn and other channels are unaffected by the targeted request.
290
- 8. Place an oversized tool result between ordinary timeline records and verify
291
- paging advances past it. Lose the stream across an untracked turn, catch up
292
- explicitly from a saved position while live delivery resumes, and verify
293
- each missed reply is persisted once. Interrupt catch-up between pages and
294
- verify retry resumes from the last persisted position.
295
-
296
- Channel restart as a separate native operation, context reset, and the full
297
- standalone CLI remain outside this slice.
@@ -1,41 +0,0 @@
1
- # Session-file amendment log
2
-
3
- Branch `aiagent/cod1a-session-file`, based on accepted channel-controls closure
4
- `3428258`; spec and plan `5ec2850` cherry-picked as `23ccdf3`. Implementer:
5
- cod1a-m. Independent reviewer: gro1a-o. Coordinator: haurness-l.
6
-
7
- ## Contract
8
-
9
- Decision 0015 defines the binary envelope, CBOR profile, active config,
10
- destination script resource, atomic import and compatibility. Contract review
11
- precedes implementation.
12
-
13
- Gro reviewed `818ffc5` and requested explicit decoder validation order and
14
- legacy database/config-read guarantees. The follow-up locks both, and records
15
- the agreed serialization and whitespace-path outcomes.
16
-
17
- Gro approved the contract at `277d095`; their typecheck passed. The binary codec
18
- implements the approved definite-length CBOR profile and header validation.
19
- Memory and SQLite atomically publish imported config with the logical snapshot;
20
- legacy sessions report no saved config. The scripted server captures active
21
- config at open and path and chunked transfer use the same file codec. SQLite
22
- stores the config in metadata without changing format version 3. Documentation
23
- describes the new format and destination-owned script.
24
-
25
- Implementation gate: `bun run typecheck` passed; `bun test ./test` passed 182
26
- tests, 0 failures, 2631 assertions in 23 files (39.07s), with local IPC access.
27
- Fixed CBOR vectors and malformed headers, lengths and payloads are exercised;
28
- adapter tests cover atomicity and config reads. Public stdio tests cover the
29
- large chunked round trip, path import, missing source config, missing destination
30
- script, individually suspended checkpoint and no repeated tool call.
31
-
32
- Transfer preflight retains the existing `transfer/open` rule: a declared upload
33
- over `maxBytes` is refused before any header bytes are available. Complete files
34
- and path imports follow the approved header/actual-length/size validation order.
35
- Managed reopen from saved config is deferred to the configuration integration.
36
- Gro approved implementation `7e49bd5` without findings. Their independent gate
37
- passed `bun run typecheck --pretty false` and `bun test ./test`: 182 pass, 0
38
- fail, 2631 assertions across 23 files (39.16s). They accepted the transfer/open
39
- preflight caveat above. Managed reopen remains outside this slice; import saves
40
- config and callers still supply it when opening. The accepted behavior revision
41
- is `7e49bd5`; this approval note is log-only.
@@ -1,36 +0,0 @@
1
- # Session-file amendment plan
2
-
3
- Date: 2026-11-19.
4
- Status: proposed for review.
5
-
6
- ## Scope and code areas
7
-
8
- Implement the [file-format amendment](SPEC.md) on the accepted
9
- channel-controls revision after its final gate. Record the base before work
10
- starts and use its logical snapshot contract.
11
-
12
- | Area | Work |
13
- | --- | --- |
14
- | Storage and archive contracts | Define the versioned envelope, portable config payload, and contract for storing imported config. Record a decision before dependent changes. |
15
- | `src/state/storage/` | Add the shared binary codec next to logical archive validation. Validate and publish snapshot and config together through atomic import. Preserve the existing export eligibility and SQLite compatibility rules. |
16
- | Session assembly | Supply the config already loaded by the session and verify its exact value after import. The configuration slice owns managed reopen from the saved value. |
17
- | `src/interfaces/protocol/` and the typed client | Reuse bounded byte transfer and file-path operations for the new encoding. Keep the codec shared across transports. |
18
- | Verification | Extend the existing portability and transfer tests. Use scripted stdio for the fresh-home round trip. |
19
-
20
- ## Implementation and review
21
-
22
- 1. Define the header and encoding, whole-file limit, stored-config contract,
23
- and referenced-resource rules, including what happens to the scripted
24
- model file. Record the archive contract decision.
25
- 2. Implement the codec, active-config export, and validated atomic import.
26
- Test both file paths and bounded stdio transfer. Exercise invalid headers
27
- and payloads, including files in the old standalone JSON encoding.
28
- 3. Run typecheck and the harness suite. Have an independent reviewer check the
29
- exact revision. Include a fresh-home round trip with the source config
30
- file missing. Verify export eligibility and preservation of individual
31
- suspension across session resume after import.
32
-
33
- Use one implementer and at least one independent review. Record assignments,
34
- gate evidence, and the accepted revision in `LOG.md` once implementation
35
- starts. The configuration slice verifies managed reopen without a sidecar
36
- when its loader is connected.
@@ -1,84 +0,0 @@
1
- # Session-file format amendment
2
-
3
- Date: 2026-11-19.
4
- Status: TODO, design for review.
5
-
6
- Amends the export/import encoding and configuration payload in the
7
- [persistence baseline](../../11-16-persistence/SPEC.md). The existing rules
8
- for consistent export, atomic import into a fresh destination, bounded transfer,
9
- and explicit resume still apply.
10
-
11
- ## File format
12
-
13
- Export one library-owned binary file with the `.harness` extension. The library
14
- encodes and decodes it directly. The proposed first format is a fixed header
15
- followed by one CBOR payload:
16
-
17
- ```text
18
- [HARNSESS: 8 bytes][format version: 2 bytes][payload length: 4 bytes][payload]
19
- ```
20
-
21
- The version and length are unsigned integers in big-endian order. The session
22
- file version is independent of the SQLite schema and snapshot schema. The
23
- contract review confirms the version number, supported payload types, and
24
- encoder and decoder. The format uses no ZIP layer or encryption.
25
-
26
- Apply the existing transfer size limit to the whole file, including the
27
- header, for both file paths and stdio. The decoder checks the marker, version,
28
- and exact payload length before decoding. Reject truncated headers, length
29
- mismatches, trailing bytes, and malformed payloads. This slice can decode the
30
- complete bounded file in memory.
31
-
32
- The binary envelope replaces the experimental standalone JSON `.harness`
33
- encoding. Reject files in that old encoding. Reuse the logical snapshot
34
- contract and validation from channel controls inside the new envelope. Existing
35
- SQLite compatibility is governed by channel controls.
36
-
37
- ## Payload and config
38
-
39
- Carry the logical session snapshot, including timeline, turns, pending work,
40
- deduplication records, ID allocation, and any checkpoints. Use the snapshot
41
- contract of the implementation base, including its channel-control state.
42
-
43
- Carry the portable, validated config that the source server is using. Export
44
- reads that active config even if its source `config.json` was edited or removed
45
- after open. Validate both snapshot and config, then save them together as part
46
- of the existing atomic import into a fresh destination. Reject an occupied
47
- destination and leave it intact.
48
-
49
- This amendment proves that the active config survives export and import. The
50
- [configuration design](../../11-19-config-permissions/SPEC.md) owns loading the
51
- saved copy for managed reopen without a sidecar or inline config.
52
-
53
- Credential values and host functions come from the destination environment.
54
- During contract review, identify which other config references are portable
55
- data and which require a destination resource. Include a scripted model file
56
- in that decision so a test can demonstrate what a fresh destination needs.
57
-
58
- ## Export eligibility
59
-
60
- Keep the channel-controls rule. When the session is running, export requires
61
- no running or checkpointed turns, no channels currently suspending, and no
62
- pending input. A fully suspended session can export its checkpoints and
63
- pending work. A session can report idle while an individually suspended
64
- channel still holds work. Suspend the session before exporting in that case.
65
-
66
- ## Acceptance
67
-
68
- - Export and import through the public API into a fresh home. Preserve the
69
- snapshot and exact active config, including when the source config file is
70
- gone. Verify failed validation of either record leaves no partial import.
71
- - Individually suspend one channel with a checkpoint and pending input.
72
- Verify export is refused while the session is running, then suspend the
73
- session and round-trip it. On import, session resume leaves the channel
74
- suspended. Channel resume continues the checkpoint without replaying a
75
- completed tool call.
76
- - Transfer a file larger than one stdio frame and verify path and stdio
77
- imports decode the same format.
78
- - Reject old standalone JSON exports, truncated headers, length mismatches,
79
- trailing bytes, malformed payloads, unsupported versions, and files over
80
- the size limit. Verify an existing destination stays intact on failure.
81
-
82
- The amendment can verify the config payload against the scripted server's
83
- existing loaded config. Managed reopen from the saved config is an integration
84
- gate for the configuration design.
@@ -1,147 +0,0 @@
1
- # Shell execution
2
-
3
- Date: 2026-11-22
4
-
5
- Status: Proposed for M2. Define the rest of the initial tool set before
6
- starting implementation. Foreground execution is the first increment.
7
-
8
- ## Tool contract
9
-
10
- Expose one optional `shell` tool for running commands directly in an Agent's
11
- execution environment. The initial runner executes Bash on Linux. The tool
12
- description tells the model which shell syntax is available.
13
-
14
- ```json
15
- {
16
- "command": "git branch --show-current",
17
- "cwd": "/dir3/d"
18
- }
19
- ```
20
-
21
- `command` is a non-empty shell command string. `cwd` is an absolute path in the
22
- runner's environment. Each call supplies its own directory. A `cd` within one
23
- invocation changes the directory for that shell and its children. Later calls
24
- and other channels keep their own directories. The configured environment
25
- determines which directories and programs are available.
26
-
27
- The first increment returns exit status, bounded inline stdout and stderr, and
28
- an explicit clipping flag. Clipped bytes are unavailable afterward. A nonzero
29
- exit status is a command outcome with its output. A failure to start, deadline
30
- expiry, or interruption uses the existing execution outcome conventions.
31
-
32
- When retaining output is added, use the existing `read_tool_result` contract.
33
- The producer retains the bytes and declares retention and expiry. The harness
34
- routes reads by result reference and checks session, channel, and invocation
35
- ownership. This works with a runner on a separate filesystem.
36
-
37
- ## Permission and dispatch
38
-
39
- Reuse the checked harness-owned tool registration defined for [web tools](../../web-tools/0001-DESIGN/SPEC.md).
40
- Validate availability, the command, and the working directory before approval.
41
- Pair unavailable or malformed calls with a rejection before prompting or
42
- starting a process. If approval is required, show the exact command and working
43
- directory. Recheck availability at dispatch, execute the approved arguments,
44
- and record the call and paired outcome through the existing tool lifecycle.
45
- Command-specific rules such as matching a Git subcommand can be added to the
46
- permission layer later. The initial policy applies to `shell` as a tool.
47
-
48
- ## Runner and execution environment
49
-
50
- The runner implements process execution behind the [architecture's execution
51
- port](../../../../ARCHITECTURE.md). It receives the validated command, working
52
- directory, invocation identity, and cancellation signal. It starts the shell,
53
- captures output, and tracks the process and its children through exit or
54
- termination. The harness owns tool admission, turn state, and recording the
55
- paired result. The shell implementation lives outside the kernel.
56
-
57
- The deployment selects the runner and its environment. If the harness is
58
- already inside the Agent container and that container provides the intended
59
- boundary, the runner can be an in-process adapter that spawns Bash there. If
60
- execution happens in a different environment, the runner can dispatch to it
61
- behind the same tool contract. A sandbox controls which filesystem mounts,
62
- network access, and resources the processes receive. The working directory
63
- selects a starting location within that environment.
64
-
65
- Start with one supported Linux deployment and verify the boundary from an
66
- actual command. Reuse the existing Agent environment if it keeps harness-only
67
- credentials and process state out of reach. Otherwise, run commands in a
68
- separate execution environment. Supply an explicit subprocess environment
69
- with credentials intended for commands. Isolation also covers what commands
70
- can access through mounted files and process information. A local subprocess
71
- can serve trusted development with its host access documented. The model
72
- chooses the command and directory. Deployment owns the target and its access.
73
-
74
- The [attachment tools](../../tools-and-callbacks/0003-DESIGN-attachment-tools/SPEC.md)
75
- copy inputs into this same runner environment and publish outputs from it.
76
-
77
- ## Foreground execution
78
-
79
- Foreground is the default. The calling turn waits for the tool outcome before
80
- its next inference. Other channels can continue. Follow the existing
81
- [tool execution and deadline rules](../../tools-and-callbacks/0001-DESIGN/SPEC.md),
82
- including configurable deadlines and suspension behavior.
83
-
84
- The runner owns process and output cleanup through settlement. On normal shell
85
- exit, capture its status, terminate managed children left running, and drain
86
- the output pipes within bounds. On timeout or interruption, request termination
87
- and escalate after a bounded grace period. Report whether termination was
88
- confirmed or remains uncertain. A process group can cover ordinary foreground
89
- commands. A deployment that promises cleanup of detached children needs
90
- runtime-managed process containment. Report the outcome as uncertain when a
91
- crash prevents confirmation. Recovery keeps the original invocation identity
92
- and does not launch the command again.
93
-
94
- ## Background execution
95
-
96
- A follow-up increment adds `background: true` to `shell`. The call returns a
97
- job ID after successful launch. The turn can continue and finish while the
98
- runner manages the job and its output. Shell syntax such as a trailing `&`
99
- does not create a tracked job.
100
-
101
- Each job belongs to its originating channel. The runner must support checking
102
- status, reading bounded output, and cancelling by ID. Record the job's terminal
103
- outcome before sending a completion notice with its ID, outcome, and output
104
- reference when available. Use the existing channel notice path. The notice
105
- can start an idle channel or reach a running turn at its next inference
106
- boundary, subject to channel and session admission. Retrying notice delivery
107
- uses a stable identity and never launches the command again.
108
-
109
- Channel suspension interrupts every live background job owned by that channel.
110
- Once suspension starts, fence new launches and cancel jobs already launched,
111
- including their child processes. A launch racing with suspension is either
112
- rejected or tracked and included in cancellation. The runner handles this by
113
- channel even when the launching turn has ended. Use the same cancellation path
114
- as for an interrupted foreground command. A successful suspension acknowledgment
115
- requires confirmed job termination. If confirmation misses the control deadline,
116
- report suspension as pending and keep the channel fenced. Other channels can
117
- continue. Preserve an outcome already recorded before cancellation. Keep
118
- undelivered notices pending until the channel can accept them again. Resume
119
- makes those notices eligible for delivery and leaves cancelled jobs terminal.
120
-
121
- The background increment must define where job records live, which jobs
122
- survive a harness or runner restart, how output is retained, and how channel
123
- deletion and session-wide lifecycle operations affect jobs. If the outcome
124
- cannot be established after a failure, report it as uncertain. A job can
125
- outlive its launching turn. Background shell jobs run commands chosen by the
126
- agent. Delegated workers can plan and carry out work themselves.
127
-
128
- ## Acceptance
129
-
130
- 1. Run commands in two different directories from concurrent channels. Show
131
- that changing directories within one shell has no effect on another call.
132
- 2. Show that denied, unavailable, and malformed calls start no process. Verify
133
- that unavailable and malformed calls produce a paired rejection without an
134
- approval prompt, and that approval shows the exact command and directory.
135
- 3. Verify stdout, stderr, exit status, bounded output, and interruption of a
136
- command with child processes. Test Bash exiting while a child still holds an
137
- output pipe open. Exercise the supported execution boundary with a visible
138
- workspace, an inaccessible path, and a harness-only secret.
139
- 4. For the background increment, show that the original turn ends while the
140
- job runs, then observe completion waking an unattached idle channel and
141
- steering an active channel. Verify status, output, cancellation, and retry
142
- of a lost completion receipt without another launch.
143
- 5. Let the launching turn finish, then suspend its idle channel while both
144
- channels have jobs. Verify that suspension acknowledges confirmed termination
145
- of its job and the other job continues. Check the launch race, pending status
146
- if confirmation misses the deadline, notice delivery after resume, and that
147
- the interrupted job runs only once.
@@ -1,15 +0,0 @@
1
- # Timeline G1 review closure
2
-
3
- Clad approved G1a at `1eb8181791b8445c4843345ab863e285c6f82261` and
4
- G1b/G1c at `67072c5c1938840b92a8751e97bc964f33020ee1`. The independent
5
- clean archive run passed both typechecks, 9 focused retrieval tests,
6
- 11 rehearsal tests, 391 harness tests and 1679 root tests. The rehearsal
7
- verified attributed retrieval through real stdio. Clad also tested a
8
- database written by the original alpha revision and reopened it with
9
- both revisions using its original configuration.
10
-
11
- Message windows still read the full stored bodies of up to 41 entries
12
- on each page. The fragment and output bounds apply to delivery.
13
- Older strict config readers refuse saved configurations containing
14
- the new timelineTools key. The canonical storage and archive formats
15
- retain their existing versions. Haurness-l owns integration.