@osolmaz/pi-workflows 0.16.1 → 0.16.3

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 (327) hide show
  1. package/README.md +41 -41
  2. package/dist/builtins/monitor.workflow.d.ts +1 -1
  3. package/dist/builtins/monitor.workflow.js +8 -8
  4. package/dist/builtins/pi-agent-group.js +3 -3
  5. package/dist/builtins/pi-agent-group.js.map +1 -1
  6. package/dist/channels/adapter-entry.js +14 -14
  7. package/dist/channels/adapter-entry.js.map +1 -1
  8. package/dist/client/client.d.ts +6 -6
  9. package/dist/client/client.js +27 -27
  10. package/dist/client/client.js.map +1 -1
  11. package/dist/client/protocol.d.ts +4 -1
  12. package/dist/client/protocol.js +17 -11
  13. package/dist/client/protocol.js.map +1 -1
  14. package/dist/client/resolver.d.ts +4 -4
  15. package/dist/client/view.d.ts +7 -1
  16. package/dist/client/view.js +1 -0
  17. package/dist/client/view.js.map +1 -1
  18. package/dist/extension/index.d.ts +1 -1
  19. package/dist/extension/index.js +66 -47
  20. package/dist/extension/index.js.map +1 -1
  21. package/dist/extension/recorder.d.ts +1 -1
  22. package/dist/extension/recorder.js +1 -1
  23. package/dist/extension/recorder.js.map +1 -1
  24. package/dist/extension/remote-recorder-store.d.ts +1 -1
  25. package/dist/extension/remote-recorder-store.js +2 -2
  26. package/dist/extension/remote-recorder-store.js.map +1 -1
  27. package/dist/extension/{controller-command.d.ts → resource-manager-command.d.ts} +6 -6
  28. package/dist/extension/{controller-command.js → resource-manager-command.js} +7 -7
  29. package/dist/extension/resource-manager-command.js.map +1 -0
  30. package/dist/extension/session-delivery.d.ts +1 -1
  31. package/dist/extension/session-delivery.js +2 -2
  32. package/dist/extension/session-delivery.js.map +1 -1
  33. package/dist/extension/session-view.d.ts +1 -1
  34. package/dist/extension/session-view.js +1 -1
  35. package/dist/extension/session-view.js.map +1 -1
  36. package/dist/extension/workflow-message-coordinator.d.ts +4 -3
  37. package/dist/extension/workflow-message-coordinator.js +81 -29
  38. package/dist/extension/workflow-message-coordinator.js.map +1 -1
  39. package/dist/resource-managers/conditions.d.ts +6 -0
  40. package/dist/{controllers → resource-managers}/conditions.js +3 -3
  41. package/dist/resource-managers/conditions.js.map +1 -0
  42. package/dist/resource-managers/definition.d.ts +6 -0
  43. package/dist/resource-managers/definition.js +45 -0
  44. package/dist/resource-managers/definition.js.map +1 -0
  45. package/dist/resource-managers/effects.d.ts +15 -0
  46. package/dist/{controllers → resource-managers}/effects.js +2 -2
  47. package/dist/resource-managers/effects.js.map +1 -0
  48. package/dist/resource-managers/errors.d.ts +12 -0
  49. package/dist/resource-managers/errors.js +25 -0
  50. package/dist/resource-managers/errors.js.map +1 -0
  51. package/dist/resource-managers/index.d.ts +12 -0
  52. package/dist/resource-managers/index.js +12 -0
  53. package/dist/resource-managers/index.js.map +1 -0
  54. package/dist/resource-managers/json.js.map +1 -0
  55. package/dist/resource-managers/loader.d.ts +23 -0
  56. package/dist/resource-managers/loader.js +75 -0
  57. package/dist/resource-managers/loader.js.map +1 -0
  58. package/dist/resource-managers/results.d.ts +5 -0
  59. package/dist/resource-managers/results.js.map +1 -0
  60. package/dist/resource-managers/runtime.d.ts +59 -0
  61. package/dist/{controllers/manager.js → resource-managers/runtime.js} +57 -57
  62. package/dist/resource-managers/runtime.js.map +1 -0
  63. package/dist/{controllers → resource-managers}/sqlite.d.ts +51 -43
  64. package/dist/{controllers → resource-managers}/sqlite.js +187 -125
  65. package/dist/resource-managers/sqlite.js.map +1 -0
  66. package/dist/{controllers → resource-managers}/store.d.ts +33 -33
  67. package/dist/{controllers → resource-managers}/store.js.map +1 -1
  68. package/dist/{controllers → resource-managers}/types.d.ts +41 -41
  69. package/dist/{controllers → resource-managers}/types.js.map +1 -1
  70. package/dist/resource-managers/workflows.d.ts +34 -0
  71. package/dist/{controllers → resource-managers}/workflows.js +15 -15
  72. package/dist/resource-managers/workflows.js.map +1 -0
  73. package/dist/server/channel-effects.js.map +1 -0
  74. package/dist/{host → server}/channel-supervisor.d.ts +6 -6
  75. package/dist/{host → server}/channel-supervisor.js +3 -3
  76. package/dist/server/channel-supervisor.js.map +1 -0
  77. package/dist/{host/child-worker-supervisor.d.ts → server/child-runner-supervisor.d.ts} +15 -13
  78. package/dist/{host/child-worker-supervisor.js → server/child-runner-supervisor.js} +6 -5
  79. package/dist/server/child-runner-supervisor.js.map +1 -0
  80. package/dist/{host → server}/processes.d.ts +3 -3
  81. package/dist/{host → server}/processes.js +3 -3
  82. package/dist/server/processes.js.map +1 -0
  83. package/dist/{host → server}/resolver-entry.d.ts +6 -6
  84. package/dist/{host → server}/resolver-entry.js +14 -14
  85. package/dist/server/resolver-entry.js.map +1 -0
  86. package/dist/server/resource-runner-entry.d.ts +2 -0
  87. package/dist/{host/controller-worker-entry.js → server/resource-runner-entry.js} +33 -33
  88. package/dist/server/resource-runner-entry.js.map +1 -0
  89. package/dist/server/resource-runner-protocol.d.ts +36 -0
  90. package/dist/server/resource-runner-protocol.js +49 -0
  91. package/dist/server/resource-runner-protocol.js.map +1 -0
  92. package/dist/server/resource-runner-supervisor.d.ts +21 -0
  93. package/dist/{host/worker-supervisor.js → server/resource-runner-supervisor.js} +17 -17
  94. package/dist/server/resource-runner-supervisor.js.map +1 -0
  95. package/dist/{host → server}/rpc-bridge.d.ts +3 -3
  96. package/dist/{host → server}/rpc-bridge.js +3 -3
  97. package/dist/server/rpc-bridge.js.map +1 -0
  98. package/dist/{host → server}/rpc-executor.d.ts +1 -1
  99. package/dist/{host → server}/rpc-executor.js +3 -3
  100. package/dist/server/rpc-executor.js.map +1 -0
  101. package/dist/{host/host-entry.js → server/server-entry.js} +6 -6
  102. package/dist/server/server-entry.js.map +1 -0
  103. package/dist/{host/runner.d.ts → server/server.d.ts} +47 -39
  104. package/dist/{host/runner.js → server/server.js} +624 -535
  105. package/dist/server/server.js.map +1 -0
  106. package/dist/{host → server}/state.d.ts +25 -25
  107. package/dist/{host → server}/state.js +49 -49
  108. package/dist/server/state.js.map +1 -0
  109. package/dist/{host → server}/view.d.ts +7 -7
  110. package/dist/{host → server}/view.js +19 -15
  111. package/dist/server/view.js.map +1 -0
  112. package/dist/server/workflow-runner-content.d.ts +6 -0
  113. package/dist/server/workflow-runner-content.js +96 -0
  114. package/dist/server/workflow-runner-content.js.map +1 -0
  115. package/dist/server/workflow-runner-entry.d.ts +13 -0
  116. package/dist/{host/worker-entry.js → server/workflow-runner-entry.js} +89 -57
  117. package/dist/server/workflow-runner-entry.js.map +1 -0
  118. package/dist/server/workflow-runner-protocol.d.ts +69 -0
  119. package/dist/server/workflow-runner-protocol.js +176 -0
  120. package/dist/server/workflow-runner-protocol.js.map +1 -0
  121. package/dist/{host/worker-store.d.ts → server/workflow-runner-store.d.ts} +11 -11
  122. package/dist/{host/worker-store.js → server/workflow-runner-store.js} +8 -8
  123. package/dist/server/workflow-runner-store.js.map +1 -0
  124. package/dist/server/workflow-runner-supervisor.d.ts +22 -0
  125. package/dist/server/workflow-runner-supervisor.js +56 -0
  126. package/dist/server/workflow-runner-supervisor.js.map +1 -0
  127. package/dist/state/prune.d.ts +1 -1
  128. package/dist/state/prune.js +17 -10
  129. package/dist/state/prune.js.map +1 -1
  130. package/dist/state/schema.js +2 -2
  131. package/dist/state/workflow-messages.d.ts +3 -1
  132. package/dist/state/workflow-messages.js +32 -1
  133. package/dist/state/workflow-messages.js.map +1 -1
  134. package/dist/viewer/backup.js +1 -1
  135. package/dist/viewer/backup.js.map +1 -1
  136. package/dist/viewer/cli.d.ts +2 -2
  137. package/dist/viewer/cli.js +46 -32
  138. package/dist/viewer/cli.js.map +1 -1
  139. package/dist/viewer/tui.d.ts +1 -1
  140. package/dist/viewer/tui.js +1 -1
  141. package/dist/viewer/tui.js.map +1 -1
  142. package/dist/workflows/command-batch.js +2 -2
  143. package/dist/workflows/composition.js +0 -4
  144. package/dist/workflows/composition.js.map +1 -1
  145. package/dist/workflows/definition.js +0 -8
  146. package/dist/workflows/definition.js.map +1 -1
  147. package/dist/workflows/engine.js +18 -20
  148. package/dist/workflows/engine.js.map +1 -1
  149. package/dist/workflows/schema.js +0 -4
  150. package/dist/workflows/schema.js.map +1 -1
  151. package/dist/workflows/store.d.ts +27 -11
  152. package/dist/workflows/store.js +66 -18
  153. package/dist/workflows/store.js.map +1 -1
  154. package/dist/workflows/types.d.ts +3 -5
  155. package/docs/2026-08-20-durable-workflow-launch-plan.md +12 -12
  156. package/docs/2026-08-25-workflow-follow-ups.md +7 -7
  157. package/docs/2026-08-25-workflow-settings.md +3 -3
  158. package/docs/2026-08-30-out-of-process-workflow-host-plan.md +3 -3
  159. package/docs/2026-09-01-restore-session-delivery-controls-plan.md +5 -5
  160. package/docs/2026-09-01-unified-workflow-client-plan.md +6 -6
  161. package/docs/2026-09-02-installed-live-e2e-plan.md +3 -3
  162. package/docs/2026-09-02-unify-workflow-messages-plan.md +8 -8
  163. package/docs/2026-09-04-workflow-run-state-plan.md +363 -0
  164. package/docs/DEFERRED_TURNS.md +7 -7
  165. package/docs/DESIGN_PHILOSOPHY.md +1 -1
  166. package/docs/HUMAN_DECISIONS.md +11 -11
  167. package/docs/HUMAN_DECISION_PRESENTATIONS.md +4 -4
  168. package/docs/MONITOR.md +1 -1
  169. package/docs/RESOURCE_MANAGERS.md +221 -0
  170. package/docs/SQLITE_STATE.md +40 -34
  171. package/docs/WORKFLOW_COMPOSITION.md +1 -1
  172. package/docs/{WORKFLOW_HOST.md → WORKFLOW_SERVER.md} +131 -116
  173. package/docs/WORKFLOW_STEP_MESSAGES.md +18 -18
  174. package/docs/WORKFLOW_UPDATES.md +16 -16
  175. package/docs/development.md +15 -14
  176. package/docs/live-replay-protocol.md +20 -20
  177. package/docs/plans/2026-08-04-controller-runtime-plan.md +25 -25
  178. package/docs/plans/2026-08-05-always-on-workflows-plan.md +8 -8
  179. package/docs/plans/2026-08-10-agent-managed-monitor-workflows-plan.md +2 -2
  180. package/docs/plans/2026-08-13-session-addressed-workflow-notifications-plan.md +1 -1
  181. package/docs/plans/2026-08-16-workflow-updates-plan.md +5 -5
  182. package/docs/plans/2026-08-19-human-decision-gates-plan.md +1 -1
  183. package/docs/plans/2026-08-20-bounded-command-batches-plan.md +1 -1
  184. package/docs/plans/2026-08-21-deferred-turn-intents-plan.md +3 -3
  185. package/docs/plans/2026-08-21-sanity-check-plan.md +2 -2
  186. package/docs/plans/2026-08-23-assistant-agent-completion-plan.md +5 -5
  187. package/docs/plans/2026-08-23-sqlite-state-plan.md +25 -25
  188. package/docs/plans/2026-08-25-live-workflow-settings-plan.md +4 -4
  189. package/docs/plans/2026-08-27-workflow-terminal-restart-plan.md +3 -3
  190. package/docs/plans/2026-09-04-workflow-runner-resume-state-plan.md +318 -0
  191. package/docs/plans/piw-viewer-experience-implementation-plan.md +1 -1
  192. package/docs/tui-viewer.md +9 -9
  193. package/docs/workflows.md +78 -63
  194. package/examples/{controllers/pull-request.controller.ts → resource-managers/pull-request.resource-manager.ts} +12 -12
  195. package/herdr-plugin.toml +1 -1
  196. package/package.json +5 -5
  197. package/protocol/client.v1.schema.json +7 -7
  198. package/protocol/fixtures/client-v1.json +1 -1
  199. package/src/builtins/monitor.workflow.ts +9 -9
  200. package/src/builtins/pi-agent-group.ts +3 -3
  201. package/src/channels/adapter-entry.ts +14 -14
  202. package/src/client/client.ts +33 -32
  203. package/src/client/protocol.ts +16 -11
  204. package/src/client/resolver.ts +4 -4
  205. package/src/client/view.ts +9 -1
  206. package/src/extension/index.ts +81 -53
  207. package/src/extension/recorder.ts +1 -1
  208. package/src/extension/remote-recorder-store.ts +2 -2
  209. package/src/extension/resource-manager-command.ts +45 -0
  210. package/src/extension/session-delivery.ts +2 -2
  211. package/src/extension/session-view.ts +1 -1
  212. package/src/extension/workflow-message-coordinator.ts +94 -30
  213. package/src/{controllers → resource-managers}/conditions.ts +23 -23
  214. package/src/resource-managers/definition.ts +71 -0
  215. package/src/{controllers → resource-managers}/effects.ts +9 -9
  216. package/src/resource-managers/errors.ts +27 -0
  217. package/src/resource-managers/index.ts +88 -0
  218. package/src/resource-managers/loader.ts +111 -0
  219. package/src/{controllers → resource-managers}/results.ts +4 -4
  220. package/src/{controllers/manager.ts → resource-managers/runtime.ts} +95 -92
  221. package/src/{controllers → resource-managers}/sqlite.ts +275 -181
  222. package/src/{controllers → resource-managers}/store.ts +46 -38
  223. package/src/{controllers → resource-managers}/types.ts +50 -41
  224. package/src/{controllers → resource-managers}/workflows.ts +43 -41
  225. package/src/{host → server}/channel-supervisor.ts +8 -8
  226. package/src/{host/child-worker-supervisor.ts → server/child-runner-supervisor.ts} +22 -18
  227. package/src/{host → server}/processes.ts +3 -3
  228. package/src/{host → server}/resolver-entry.ts +28 -25
  229. package/src/{host/controller-worker-entry.ts → server/resource-runner-entry.ts} +67 -65
  230. package/src/server/resource-runner-protocol.ts +103 -0
  231. package/src/server/resource-runner-supervisor.ts +76 -0
  232. package/src/{host → server}/rpc-bridge.ts +3 -3
  233. package/src/{host → server}/rpc-executor.ts +4 -4
  234. package/src/{host/host-entry.ts → server/server-entry.ts} +5 -5
  235. package/src/{host/runner.ts → server/server.ts} +786 -672
  236. package/src/{host → server}/state.ts +78 -67
  237. package/src/{host → server}/view.ts +21 -17
  238. package/src/server/workflow-runner-content.ts +119 -0
  239. package/src/{host/worker-entry.ts → server/workflow-runner-entry.ts} +131 -82
  240. package/src/server/workflow-runner-protocol.ts +241 -0
  241. package/src/{host/worker-store.ts → server/workflow-runner-store.ts} +18 -20
  242. package/src/server/workflow-runner-supervisor.ts +79 -0
  243. package/src/state/prune.ts +27 -9
  244. package/src/state/schema.ts +2 -2
  245. package/src/state/workflow-messages.ts +52 -1
  246. package/src/viewer/backup.ts +1 -1
  247. package/src/viewer/cli.ts +50 -36
  248. package/src/viewer/tui.ts +1 -1
  249. package/src/workflows/command-batch.ts +2 -2
  250. package/src/workflows/composition.ts +0 -5
  251. package/src/workflows/definition.ts +0 -8
  252. package/src/workflows/engine.ts +18 -21
  253. package/src/workflows/schema.ts +0 -6
  254. package/src/workflows/store.ts +95 -28
  255. package/src/workflows/types.ts +3 -5
  256. package/dist/controllers/conditions.d.ts +0 -6
  257. package/dist/controllers/conditions.js.map +0 -1
  258. package/dist/controllers/definition.d.ts +0 -6
  259. package/dist/controllers/definition.js +0 -45
  260. package/dist/controllers/definition.js.map +0 -1
  261. package/dist/controllers/effects.d.ts +0 -15
  262. package/dist/controllers/effects.js.map +0 -1
  263. package/dist/controllers/errors.d.ts +0 -12
  264. package/dist/controllers/errors.js +0 -25
  265. package/dist/controllers/errors.js.map +0 -1
  266. package/dist/controllers/index.d.ts +0 -12
  267. package/dist/controllers/index.js +0 -12
  268. package/dist/controllers/index.js.map +0 -1
  269. package/dist/controllers/json.js.map +0 -1
  270. package/dist/controllers/loader.d.ts +0 -23
  271. package/dist/controllers/loader.js +0 -74
  272. package/dist/controllers/loader.js.map +0 -1
  273. package/dist/controllers/manager.d.ts +0 -59
  274. package/dist/controllers/manager.js.map +0 -1
  275. package/dist/controllers/results.d.ts +0 -5
  276. package/dist/controllers/results.js.map +0 -1
  277. package/dist/controllers/sqlite.js.map +0 -1
  278. package/dist/controllers/workflows.d.ts +0 -34
  279. package/dist/controllers/workflows.js.map +0 -1
  280. package/dist/extension/controller-command.js.map +0 -1
  281. package/dist/host/channel-effects.js.map +0 -1
  282. package/dist/host/channel-supervisor.js.map +0 -1
  283. package/dist/host/child-worker-supervisor.js.map +0 -1
  284. package/dist/host/controller-worker-entry.d.ts +0 -2
  285. package/dist/host/controller-worker-entry.js.map +0 -1
  286. package/dist/host/controller-worker-protocol.d.ts +0 -36
  287. package/dist/host/controller-worker-protocol.js +0 -49
  288. package/dist/host/controller-worker-protocol.js.map +0 -1
  289. package/dist/host/controller-worker-supervisor.d.ts +0 -21
  290. package/dist/host/controller-worker-supervisor.js +0 -54
  291. package/dist/host/controller-worker-supervisor.js.map +0 -1
  292. package/dist/host/host-entry.js.map +0 -1
  293. package/dist/host/processes.js.map +0 -1
  294. package/dist/host/resolver-entry.js.map +0 -1
  295. package/dist/host/rpc-bridge.js.map +0 -1
  296. package/dist/host/rpc-executor.js.map +0 -1
  297. package/dist/host/runner.js.map +0 -1
  298. package/dist/host/state.js.map +0 -1
  299. package/dist/host/view.js.map +0 -1
  300. package/dist/host/worker-entry.d.ts +0 -10
  301. package/dist/host/worker-entry.js.map +0 -1
  302. package/dist/host/worker-protocol.d.ts +0 -31
  303. package/dist/host/worker-protocol.js +0 -122
  304. package/dist/host/worker-protocol.js.map +0 -1
  305. package/dist/host/worker-store.js.map +0 -1
  306. package/dist/host/worker-supervisor.d.ts +0 -22
  307. package/dist/host/worker-supervisor.js.map +0 -1
  308. package/docs/CONTROLLERS.md +0 -217
  309. package/src/controllers/definition.ts +0 -65
  310. package/src/controllers/errors.ts +0 -27
  311. package/src/controllers/index.ts +0 -88
  312. package/src/controllers/loader.ts +0 -104
  313. package/src/extension/controller-command.ts +0 -45
  314. package/src/host/controller-worker-protocol.ts +0 -104
  315. package/src/host/controller-worker-supervisor.ts +0 -79
  316. package/src/host/worker-protocol.ts +0 -165
  317. package/src/host/worker-supervisor.ts +0 -74
  318. /package/dist/{controllers → resource-managers}/json.d.ts +0 -0
  319. /package/dist/{controllers → resource-managers}/json.js +0 -0
  320. /package/dist/{controllers → resource-managers}/results.js +0 -0
  321. /package/dist/{controllers → resource-managers}/store.js +0 -0
  322. /package/dist/{controllers → resource-managers}/types.js +0 -0
  323. /package/dist/{host → server}/channel-effects.d.ts +0 -0
  324. /package/dist/{host → server}/channel-effects.js +0 -0
  325. /package/dist/{host/host-entry.d.ts → server/server-entry.d.ts} +0 -0
  326. /package/src/{controllers → resource-managers}/json.ts +0 -0
  327. /package/src/{host → server}/channel-effects.ts +0 -0
@@ -44,9 +44,7 @@ export type WorkflowEffectRecovery = "idempotent" | "manual";
44
44
  export type WorkflowManagedEffect = {
45
45
  /** Stable external effect category, for example `github.comment`. */
46
46
  type: string;
47
- /** Stable key. Idempotent adapters must pass this key to the external system. */
48
- idempotencyKey: string | ((context: WorkflowNodeContext) => MaybePromise<string>);
49
- /** Canonical request data used to reject key reuse with another operation. */
47
+ /** Canonical request data used to reject engine-owned key reuse with another operation. */
50
48
  request: unknown | ((context: WorkflowNodeContext) => MaybePromise<unknown>);
51
49
  /** `manual` never retries after an uncertain child exit. */
52
50
  recovery: WorkflowEffectRecovery;
@@ -80,7 +78,7 @@ export type WorkflowProgressData = {
80
78
  export type WorkflowNodeCommon = {
81
79
  /**
82
80
  * Per-node active-execution timeout or a callback that derives it from the run context.
83
- * Waiting, paused, disconnected, and host-down origin-session time does not count.
81
+ * Waiting, paused, disconnected, and server-down origin-session time does not count.
84
82
  * Null disables the deadline. Omission falls back to the engine default (15 minutes).
85
83
  */
86
84
  timeoutMs?: number | null | ((context: WorkflowNodeContext) => MaybePromise<number | null>);
@@ -810,7 +808,7 @@ export type WorkflowEngineOptions = {
810
808
  notificationSink?: WorkflowNotificationSink;
811
809
  /** Canonical SQLite database. Defaults to `~/.pi/agent/workflows/state.sqlite`. */
812
810
  databasePath?: string;
813
- /** Durable execution store. Workers use a host-backed implementation. */
811
+ /** Durable execution store. Runners use a server-backed implementation. */
814
812
  store?: import("./store.js").WorkflowExecutionStore;
815
813
  /**
816
814
  * Awaited after `run_started` is persisted, before any node executes.
@@ -18,7 +18,7 @@ If startup then fails, pi-workflows must save the failure and start one new mode
18
18
  actionable error. The model can correct the request and call `workflow start` again. A failed launch
19
19
  must release the session reservation so the corrected run can start.
20
20
 
21
- This change stays inside pi-workflows. It uses the existing project-scoped SQLite controller store
21
+ This change stays inside pi-workflows. It uses the existing project-scoped SQLite resource manager store
22
22
  and documented Pi extension APIs. It does not change Pi, add a service, or add another database.
23
23
 
24
24
  ## Current failure
@@ -81,12 +81,12 @@ pi-workflows is in alpha. Change the current storage and tool contracts in place
81
81
  - Change the SQLite table definitions and TypeScript types directly.
82
82
  - Remove the superseded status values and launch path in the same change.
83
83
 
84
- An existing controller store with the old alpha table layout is incompatible. On open, pi-workflows
84
+ An existing resource manager store with the old alpha table layout is incompatible. On open, pi-workflows
85
85
  must verify the required table columns and status contract. If the layout is old, it must stop with a
86
- clear instruction to preserve any needed run evidence and reset the project-scoped controller store.
86
+ clear instruction to preserve any needed run evidence and reset the project-scoped resource manager store.
87
87
  It must not silently reinterpret or delete old state.
88
88
 
89
- Run bundles remain separate evidence. Resetting an incompatible controller queue must not delete run
89
+ Run bundles remain separate evidence. Resetting an incompatible resource manager queue must not delete run
90
90
  bundle directories.
91
91
 
92
92
  ## Public behavior
@@ -118,7 +118,7 @@ includes:
118
118
  - Workflow resolution and definition validation.
119
119
  - Declared input validation.
120
120
  - Parent checkpoint and source checks for continuations.
121
- - Controller-store access.
121
+ - ResourceManager-store access.
122
122
  - Existing active or queued session reservation.
123
123
  - Pending final presentation conflicts.
124
124
 
@@ -217,7 +217,7 @@ bundle owns input after the engine starts.
217
217
 
218
218
  Keep `workflow_notifications` limited to passive `progress` and `final` reports. A launch failure creates an eligible row in `workflow_turn_intents`; it does not add a run-level notification kind.
219
219
 
220
- The project-scoped controller store remains private local state. Tests must verify restrictive file
220
+ The project-scoped resource manager store remains private local state. Tests must verify restrictive file
221
221
  and directory permissions.
222
222
 
223
223
  ## State transitions
@@ -273,9 +273,9 @@ can correct it without including secret values.
273
273
 
274
274
  ## Implementation plan
275
275
 
276
- ### 1. Replace the alpha controller-store layout
276
+ ### 1. Replace the alpha resource manager store layout
277
277
 
278
- Update `src/controllers/sqlite.ts` and its exported queue and notification types.
278
+ Update `src/resource-managers/sqlite.ts` and its exported queue and notification types.
279
279
 
280
280
  - Keep `CONTROLLER_STORE_SCHEMA` at `pi-workflows.controller-store.v1`.
281
281
  - Change `SCHEMA_SQL` directly.
@@ -316,8 +316,8 @@ Preparation owns resolution, validation, run ID allocation, immutable source ide
316
316
  digest, and reservation. Activation owns claims, engine construction, recorder setup, `activeRun`,
317
317
  running state, and executor release.
318
318
 
319
- Controller child workflows remain on their controller scheduler path. Share pure workflow-resolution
320
- helpers where useful, but do not make controller children wait for an interactive agent boundary.
319
+ Resource manager child workflows remain on their resource manager scheduler path. Share pure workflow-resolution
320
+ helpers where useful, but do not make resource manager children wait for an interactive agent boundary.
321
321
 
322
322
  ### 4. Change the start tool
323
323
 
@@ -361,7 +361,7 @@ surface.
361
361
  ### 8. Update documentation
362
362
 
363
363
  Update `docs/workflows.md` with the queued start contract, run ID, status, cancellation, failure
364
- follow-up, and model retry behavior. Update controller-store documentation with the alpha reset rule.
364
+ follow-up, and model retry behavior. Update resource manager store documentation with the alpha reset rule.
365
365
  Do not document a v2 schema or migration path.
366
366
 
367
367
  ## Tests
@@ -438,7 +438,7 @@ copy as the implementation source.
438
438
 
439
439
  - Do not change Pi or propose a new Pi API.
440
440
  - Do not add a service, daemon, remote queue, telemetry endpoint, or second database.
441
- - Do not preserve old alpha controller-store layouts.
441
+ - Do not preserve old alpha resource manager store layouts.
442
442
  - Do not add a migration or v2 schema.
443
443
  - Do not add blind automatic workflow retries.
444
444
  - Do not change built-in workflow behavior except for test fixtures needed to verify startup.
@@ -32,7 +32,7 @@ Remove an unsent prompt with:
32
32
  }
33
33
  ```
34
34
 
35
- A model can remove only a prompt added by the same session tool source. A controller can remove only its own prompt. A verified human can remove any unsent prompt in the owned run.
35
+ A model can remove only a prompt added by the same session tool source. A resource manager can remove only its own prompt. A verified human can remove any unsent prompt in the owned run.
36
36
 
37
37
  Direct commands are also available:
38
38
 
@@ -57,7 +57,7 @@ await ctx.workflows.removeFollowUp({
57
57
  });
58
58
  ```
59
59
 
60
- The host creates the actor and stable request identity. Prompt data cannot claim human or controller authority.
60
+ The server creates the actor and stable request identity. Prompt data cannot claim human or resource manager authority.
61
61
 
62
62
  ## Ordering and run states
63
63
 
@@ -65,25 +65,25 @@ Prompts keep database acceptance order. Several requests can add several prompts
65
65
 
66
66
  - Running, paused, parked, and waiting workflows accept new prompts.
67
67
  - Pause and park keep prompts queued.
68
- - A checkpoint continuation keeps queued prompt rows attached to the chain member that accepted them. The host walks the continuation chain to determine their final source outcome; it does not rewrite the rows.
68
+ - A checkpoint continuation keeps queued prompt rows attached to the chain member that accepted them. The server walks the continuation chain to determine their final source outcome; it does not rewrite the rows.
69
69
  - Successful completion records the terminal run and terminal workflow message before a follow-up can send.
70
70
  - Failed, timed-out, and cancelled workflows cancel every unsent prompt.
71
71
  - A terminal workflow rejects new prompts. Repeating an earlier request ID can still return its first result.
72
72
 
73
73
  A repeated request ID with the same prompt returns the first result. Reusing that ID with different content fails.
74
74
 
75
- Each accepted prompt creates its `workflow_follow_ups` source record and one `followUp` workflow message in one transaction. The message points to its source through `sourceId`; the source row stores no message pointer. The host derives eligibility from saved domain facts. A follow-up is eligible only after the source continuation chain completes successfully, its terminal message turn ends, every earlier accepted follow-up is settled or cancelled, and no nonterminal run, including one waiting for a checkpoint or protected decision, reserves the origin session.
75
+ Each accepted prompt creates its `workflow_follow_ups` source record and one `followUp` workflow message in one transaction. The message points to its source through `sourceId`; the source row stores no message pointer. The server derives eligibility from saved domain facts. A follow-up is eligible only after the source continuation chain completes successfully, its terminal message turn ends, every earlier accepted follow-up is settled or cancelled, and no nonterminal run, including one waiting for a checkpoint or protected decision, reserves the origin session.
76
76
 
77
77
  ## One message path
78
78
 
79
79
  The shared `WorkflowMessageCoordinator` handles follow-ups. There is no follow-up sender.
80
80
 
81
81
  1. Wait for the terminal outcome, sent terminal workflow message, and matching model-turn end.
82
- 2. After every host connection, wait for the complete origin-session view and report the active branch.
83
- 3. Wait until the host view names this `followUp` as the next eligible pending message, Pi is idle, and no earlier workflow message is active.
82
+ 2. After every server connection, wait for the complete origin-session view and report the active branch.
83
+ 3. Wait until the server view names this `followUp` as the next eligible pending message, Pi is idle, and no earlier workflow message is active.
84
84
  4. Keep its ID in the coordinator's in-memory queued map and report a matching active-branch entry when one already exists.
85
85
  5. Otherwise, recheck synchronously that Pi is idle, has no pending input, the message is absent, and the connection still owns the active coordinator epoch. Call documented `pi.sendMessage()` with the follow-up prompt and `triggerTurn: true` without an `await` between the check and call.
86
- 6. Report the active branch so the host saves the observed Pi entry ID and marks the message `sent`.
86
+ 6. Report the active branch so the server saves the observed Pi entry ID and marks the message `sent`.
87
87
  7. Wait for that turn and any workflow it starts to finish before the next follow-up becomes eligible.
88
88
 
89
89
  The follow-up custom message starts normal conversation work and can use a user-style renderer. Its internal workflow message ID stays in custom details and does not enter provider-facing content. It can ask the model to start another workflow, but it cannot resume or reactivate the completed workflow. Text that starts with `/` remains plain model input; a custom message cannot dispatch a Pi slash command or expand a prompt template. A `restart` chosen from the terminal turn creates a separate immutable workflow run.
@@ -108,7 +108,7 @@ await ctx.workflows.changeSettings({
108
108
  });
109
109
  ```
110
110
 
111
- Each request has a stable host-issued ID. Repeating the same ID and content returns the first result. Reusing an ID with different content fails. When one model response emits several workflow tool calls, the extension applies them in source order so a settings change cannot race past a later step submission.
111
+ Each request has a stable server-issued ID. Repeating the same ID and content returns the first result. Reusing an ID with different content fails. When one model response emits several workflow tool calls, the extension applies them in source order so a settings change cannot race past a later step submission.
112
112
 
113
113
  `expectedChangeNumber` protects the complete settings value. A JSON Patch `test` operation can protect one field. When no expected number is supplied, the patch applies to the latest saved value in database acceptance order.
114
114
 
@@ -127,11 +127,11 @@ The permissions mean:
127
127
 
128
128
  `read` is not a privacy filter. Workflow code in that scope receives the complete typed settings value.
129
129
 
130
- The host records the actor outside the patch:
130
+ The server records the actor outside the patch:
131
131
 
132
132
  - `session` for a model workflow-tool call;
133
133
  - `human` for a direct command or verified human decision;
134
- - `controller` for a controller request;
134
+ - `controller` for a resource manager request; this internal version-1 actor value is retained;
135
135
  - `policy` only for existing saved policy code.
136
136
 
137
137
  Patch data cannot claim another actor type.
@@ -12,7 +12,7 @@ A live workflow lost its lease while it was still working. The workflow engine k
12
12
 
13
13
  This plan fixes that failure first, then removes its root architectural cause. One user-level host will own workflow state. Each active run will execute in a supervised child process. Pi will become a client that starts work, presents interactive requests, and submits answers through documented extension APIs.
14
14
 
15
- [Workflow host](WORKFLOW_HOST.md) defines the complete target process, protocol, state, recovery, and Pi integration contracts. This plan gives the implementation order and acceptance checks.
15
+ [Workflow server](WORKFLOW_SERVER.md) defines the complete target process, protocol, state, recovery, and Pi integration contracts. This plan gives the implementation order and acceptance checks.
16
16
 
17
17
  ## Goals
18
18
 
@@ -273,7 +273,7 @@ The host protocol and worker runtime may exist under tests before the final swit
273
273
  - Recover a resumable expired run.
274
274
  - Stop an uncertain effect for manual review.
275
275
 
276
- ### Host and child isolation
276
+ ### Server and child isolation
277
277
 
278
278
  - Block a child event loop longer than the run lease and prove the host keeps ownership.
279
279
  - Kill Pi while a run computes.
@@ -333,7 +333,7 @@ Run Pi Reviewer against `main` until no P0 or P1 findings remain. Check pull-req
333
333
  - Expired running rows can be resumed or cancelled safely.
334
334
  - Pi restart does not lose or falsely fail pending work.
335
335
  - An unanswered interactive request keeps its original node deadline, follows its timeout route, and cannot hold a stale session reservation forever.
336
- - Host restart recovers durable work without duplicate transitions.
336
+ - Server restart recovers durable work without duplicate transitions.
337
337
  - Interactive steps still use the origin Pi session.
338
338
  - Duplicate commands and submissions return stored receipts.
339
339
  - A submission is not accepted until supervised workflow validation succeeds.
@@ -10,9 +10,9 @@ date: 2026-09-01
10
10
 
11
11
  This repair restored the widget, Escape pause, and the first shared sender. Version 0.16.0 still has a model-turn status bug and did not preserve all earlier session features. The approved [workflow-message restoration plan](2026-09-02-unify-workflow-messages-plan.md) replaces separate send records with one workflow-message contract and restores the remaining behavior.
12
12
 
13
- The out-of-process workflow host removed the Pi workflow widget and Escape-to-pause behavior. A later delivery safety fix also caused normal polling to report `Interactive request presentation claim conflict`. This plan restores those features and fixes delivery without bringing back the embedded workflow runtime.
13
+ The out-of-process workflow server removed the Pi workflow widget and Escape-to-pause behavior. A later delivery safety fix also caused normal polling to report `Interactive request presentation claim conflict`. This plan restores those features and fixes delivery without bringing back the embedded workflow runtime.
14
14
 
15
- [Workflow host](WORKFLOW_HOST.md) remains the process and state specification. [Workflow step messages](WORKFLOW_STEP_MESSAGES.md) remains the session message specification. This plan records the cause, scope, implementation order, and acceptance checks for the repair.
15
+ [Workflow server](WORKFLOW_SERVER.md) remains the process and state specification. [Workflow step messages](WORKFLOW_STEP_MESSAGES.md) remains the session message specification. This plan records the cause, scope, implementation order, and acceptance checks for the repair.
16
16
 
17
17
  ## Observed problems
18
18
 
@@ -34,7 +34,7 @@ The coordinator also removes its local queued guard before durable settlement fi
34
34
  ## Requirements
35
35
 
36
36
  - Keep one global host as the normal workflow state writer.
37
- - Keep workflow and controller code in supervised child processes.
37
+ - Keep workflow and resource manager code in supervised child processes.
38
38
  - Use documented Pi extension APIs only.
39
39
  - Preserve one ordered session delivery path for steps, decisions, notifications, and final results.
40
40
  - Never send through an expired claim.
@@ -92,7 +92,7 @@ The change may update:
92
92
  - host pause and resume handling for parked interactions;
93
93
  - existing version-1 interaction response fields;
94
94
  - focused unit, integration, and live Pi tests;
95
- - the workflow host and authoring documentation.
95
+ - the workflow server and authoring documentation.
96
96
 
97
97
  ## Non-goals
98
98
 
@@ -125,7 +125,7 @@ The change may update:
125
125
  - A paused interaction rejects `update` and `submit`.
126
126
  - Resume keeps the same request and allows submission without another prompt.
127
127
  - Non-aborted turns and unrelated sessions do not pause the workflow.
128
- - The extension and host execute no workflow or controller code in their own event loops.
128
+ - The extension and host execute no workflow or resource manager code in their own event loops.
129
129
 
130
130
  ## Verification
131
131
 
@@ -37,7 +37,7 @@ These are not independent display defects. The extension, Herdr integration, and
37
37
 
38
38
  ## Root cause
39
39
 
40
- `WorkflowHostClient` is the authority for commands, but it is not the authority for live views.
40
+ `WorkflowClient` is the authority for commands, but it is not the authority for live views.
41
41
 
42
42
  The Pi extension opens SQLite twice during one refresh. It first finds the origin session reservation and then loads the run from a second database snapshot. It maps durable workflow state directly to a widget label. The host cannot add exact origin-session model activity to that result.
43
43
 
@@ -200,7 +200,7 @@ The widget shows the Herdr hint only when the documented Herdr capability check
200
200
 
201
201
  ### One live `piw` source
202
202
 
203
- Local `piw` connects to the package-owned host, subscribes to run views, and fetches pages through `pi-workflows.client.v1`. When the socket is absent, Rust may start the host only by executing the installed `pi-workflows host start` command. Rust does not reimplement host launch, locking, epochs, or readiness. If that command is unavailable or fails, `piw` stops with the direct install or startup instruction.
203
+ Local `piw` connects to the package-owned host, subscribes to run views, and fetches pages through `pi-workflows.client.v1`. When the socket is absent, Rust may start the host only by executing the installed `pi-workflows server start` command. Rust does not reimplement host launch, locking, epochs, or readiness. If that command is unavailable or fails, `piw` stops with the direct install or startup instruction.
204
204
 
205
205
  `piw serve` stops reading SQLite. It becomes a loopback-only WebSocket relay for the same logical protocol. Remote clients continue to use an SSH tunnel. The relay opens one host socket connection for each WebSocket connection and couples their lifecycles one to one. It carries frames only. It does not multiplex clients, translate run state, keep another projection, or retain activity after either side closes.
206
206
 
@@ -237,7 +237,7 @@ No migration, compatibility reader, dual protocol, bridge period, or feature fla
237
237
 
238
238
  ### 2. Make the host the only live database reader
239
239
 
240
- **Location:** `src/host/`, `src/state/`, controller stores, and state maintenance commands.
240
+ **Location:** `src/server/`, `src/state/`, resource manager stores, and state maintenance commands.
241
241
 
242
242
  **Change:** Add host handlers for atomic origin-session view lookup, run-list and run-view snapshots, revision subscriptions, bounded pages, and active database maintenance. Keep projection reads and writes in the host. A view read must resolve the session reservation, run, durable display facts, and presentation revision from one consistent read boundary. Persist generated large view values in the run-scoped content table under their digest and media type before advertising their references. Do not reuse general state blobs or allow another run to read the content. Store the complete original workflow definition, not its escaped projection. Externalize large replay checkpoints and make both clients resolve them. Route state-changing Pi extension commands through the durable retry path. Give the CLI one stable client identity and one fresh key for each backup or applied prune invocation. Reuse that key only for the invocation's automatic reconnect retry, with a new request ID. Keep an in-flight maintenance operation alive after disconnect, store its accepted or rejected command receipt before response, wait for it during host shutdown, and adopt an exact retry. Wait for socket drain before sending another snapshot, and remove every subscription kind explicitly when its client unsubscribes.
243
243
 
@@ -245,7 +245,7 @@ No migration, compatibility reader, dual protocol, bridge period, or feature fla
245
245
 
246
246
  ### 3. Add the host status reducer and activity overlay
247
247
 
248
- **Location:** a host-owned view module under `src/host/` or `src/viewer/`, with no Pi import.
248
+ **Location:** a host-owned view module under `src/server/` or `src/viewer/`, with no Pi import.
249
249
 
250
250
  **Change:** Build the `display` object from durable facts and the validated activity overlay. Add connection-scoped activity leases and monotonic sequences. Apply the documented status precedence and allowed-control rules in one function.
251
251
 
@@ -255,7 +255,7 @@ No migration, compatibility reader, dual protocol, bridge period, or feature fla
255
255
 
256
256
  **Location:** `src/extension/session-view.ts`, `src/extension/index.ts`, and the delivery coordinator.
257
257
 
258
- **Change:** Remove all extension imports and construction of `HostStateStore`, `SqliteControllerStore`, `WorkflowRunStore`, and the active state path. Replace `waitForInteractionSubmission`, `pendingInteractionForSession`, `pendingDecision`, `interactionPresentationClaimIsLive`, `hasClaimableNotification`, `hasClaimableTurn`, `terminalRunState`, `sessionRun`, and the widget's two-read refresh with `WorkflowClient` requests or the one origin-session subscription. The `interaction.submit` response supplies the final validation outcome. Report exact delivery activity from documented Pi events and the coordinator's delivery map. Render only the host `display` object. Keep Escape pause tied to the exact active workflow delivery.
258
+ **Change:** Remove all extension imports and construction of `ServerStateStore`, `SqliteResourceManagerStore`, `WorkflowRunStore`, and the active state path. Replace `waitForInteractionSubmission`, `pendingInteractionForSession`, `pendingDecision`, `interactionPresentationClaimIsLive`, `hasClaimableNotification`, `hasClaimableTurn`, `terminalRunState`, `sessionRun`, and the widget's two-read refresh with `WorkflowClient` requests or the one origin-session subscription. The `interaction.submit` response supplies the final validation outcome. Report exact delivery activity from documented Pi events and the coordinator's delivery map. Render only the host `display` object. Keep Escape pause tied to the exact active workflow delivery.
259
259
 
260
260
  **Verification:** Hold Pi busy longer than both the poll interval and activity lease. The widget stays `running` while refreshed exact activity is live, falls back to `waiting` after activity ends without submission, and shows `paused` only after the host accepts pause. The controlled run produces one visible delivery and one model turn without claiming a universal exactly-once guarantee.
261
261
 
@@ -277,7 +277,7 @@ No migration, compatibility reader, dual protocol, bridge period, or feature fla
277
277
 
278
278
  ### 7. Remove split paths and update documentation
279
279
 
280
- **Location:** old host/replay protocol code, obsolete viewer readers, `docs/WORKFLOW_HOST.md`, `docs/SQLITE_STATE.md`, `docs/live-replay-protocol.md`, README usage, and package contents.
280
+ **Location:** old host/replay protocol code, obsolete viewer readers, `docs/WORKFLOW_SERVER.md`, `docs/SQLITE_STATE.md`, `docs/live-replay-protocol.md`, README usage, and package contents.
281
281
 
282
282
  **Change:** Delete the superseded request/response and replay contracts, direct live readers, duplicated status reducers, and fallback flags. Update all user commands and architecture diagrams to show the one client stack. Keep inactive backup verification explicitly separate.
283
283
 
@@ -46,7 +46,7 @@ Each run will use:
46
46
 
47
47
  Pi will start with `--no-skills`, `--no-themes`, `--no-prompt-templates`, `--no-context-files`, and `--no-builtin-tools`. The runner must not use `--no-extensions`, because that would also disable Pi Workflows.
48
48
 
49
- After startup, the runner will call RPC `get_commands`. The `workflow`, `controller`, and `piw` commands must come from the packed Pi Workflows package. Any other user or project extension is a failure. Base Pi's own inline commands are allowed.
49
+ After startup, the runner will call RPC `get_commands`. The `workflow`, `resource-manager`, and `piw` commands must come from the packed Pi Workflows package. Any other user or project extension is a failure. Base Pi's own inline commands are allowed.
50
50
 
51
51
  ## Installed package test
52
52
 
@@ -96,7 +96,7 @@ The runner will start it through Pi RPC and check the following sequence:
96
96
  2. RPC emits `setWidget` and `setStatus` for the `pi-workflows` key with `running` state.
97
97
  3. `/workflow pause` is accepted.
98
98
  4. The widget and status change to `paused`.
99
- 5. Host status reports one parked run and no active workflow worker.
99
+ 5. Server status reports one parked run and no active workflow runner.
100
100
  6. `/workflow resume` is accepted.
101
101
  7. The widget and status return to `running`.
102
102
  8. The workflow completes with the fixed output.
@@ -170,7 +170,7 @@ A real-model run requires explicit provider and model arguments. `--runtime-only
170
170
  The standalone runner will own one temporary root and remove it in a `finally` path. It will:
171
171
 
172
172
  - close the Pi RPC process;
173
- - stop the workflow host through the installed client;
173
+ - stop the workflow server through the installed client;
174
174
  - wait for the host endpoint to disappear;
175
175
  - stop child workers started for the smoke workflows;
176
176
  - remove the npm consumer installation, sessions, workflow state, and fixture project.
@@ -15,7 +15,7 @@ This change gives the host one saved list of workflow messages that Pi must add
15
15
 
16
16
  The same change restores the user features removed during the host cut. It keeps one global host, one client protocol, one database, and one production runtime.
17
17
 
18
- [Workflow host](WORKFLOW_HOST.md) remains the process and state specification. [Workflow messages in Pi](WORKFLOW_STEP_MESSAGES.md) remains the Pi message specification. This plan changes both contracts in place.
18
+ [Workflow server](WORKFLOW_SERVER.md) remains the process and state specification. [Workflow messages in Pi](WORKFLOW_STEP_MESSAGES.md) remains the Pi message specification. This plan changes both contracts in place.
19
19
 
20
20
  ## Current problems
21
21
 
@@ -70,9 +70,9 @@ Several reference pages still describe reminders, follow-ups, live settings cont
70
70
 
71
71
  - Do not restore the embedded workflow executor.
72
72
  - Do not let the extension, CLI, or `piw` open live SQLite state.
73
- - Do not restore per-project hosts or `/controller start` and `/controller stop`.
73
+ - Do not restore per-project hosts or `/resource-manager start` and `/resource-manager stop`.
74
74
  - Do not send a workflow prompt into an active model turn.
75
- - Do not run workflow or controller code in the host event loop.
75
+ - Do not run workflow or resource manager code in the host event loop.
76
76
  - Do not change Pi core, private Pi APIs, Pi session files, or Pi session schemas.
77
77
  - Do not add another database, service, runtime, compatibility reader, fallback, or feature flag.
78
78
  - Do not claim exactly-once model execution.
@@ -227,7 +227,7 @@ The host applies the end and its workflow consequence in one transaction:
227
227
 
228
228
  The transaction stores one immutable end event, updates activity, and creates or cancels messages together. Repeating the same report adopts that result. A stale or different turn ID cannot end newer activity.
229
229
 
230
- The host clears process-local activity when the client disconnects. Host startup does not close a Pi turn because the host cannot know whether Pi is still working. On `session_start`, the extension reports the active branch before new sends. If Pi is still busy, it reports `started` again with the retained turn ID. Only an idle-session branch report can close an open sent message with synthetic `stopReason: "lost"`. A lost step follows the normal unproductive-turn rule. A lost terminal or follow-up closes without reopening the completed workflow.
230
+ The host clears process-local activity when the client disconnects. Server startup does not close a Pi turn because the host cannot know whether Pi is still working. On `session_start`, the extension reports the active branch before new sends. If Pi is still busy, it reports `started` again with the retained turn ID. Only an idle-session branch report can close an open sent message with synthetic `stopReason: "lost"`. A lost step follows the normal unproductive-turn rule. A lost terminal or follow-up closes without reopening the completed workflow.
231
231
 
232
232
  ### Display rule
233
233
 
@@ -270,7 +270,7 @@ This applies to:
270
270
  - cancelled runs;
271
271
  - launch failures;
272
272
  - claim loss when safe handoff is impossible and the host commits a terminal result;
273
- - controller interruption.
273
+ - resource manager interruption.
274
274
 
275
275
  An ordinary claim transfer remains a handoff and creates no terminal message. A stale owner cannot create one.
276
276
 
@@ -391,7 +391,7 @@ Restore TypeScript viewer step scrubbing and its one-second elapsed-time redraw.
391
391
  - Escape pauses only the exact matching workflow turn.
392
392
  - Pause, cancel, answer, update, and submit remain durable host commands.
393
393
  - A pending interaction on a paused run rejects update and submit until resume.
394
- - Workflow and controller code remain in supervised children.
394
+ - Workflow and resource manager code remain in supervised children.
395
395
  - Side effects remain idempotent or explicitly ambiguous.
396
396
  - `/piw`, `Ctrl+Shift+R`, Herdr placement, and widget scrolling remain available.
397
397
  - Local and remote `piw` use the same client protocol and exact run view.
@@ -455,7 +455,7 @@ The later status work binds only to `workflow_messages`. Do not implement a temp
455
455
 
456
456
  ### Update reference documentation
457
457
 
458
- Update [Workflow host](WORKFLOW_HOST.md), [Workflow messages in Pi](WORKFLOW_STEP_MESSAGES.md), [SQLite state](SQLITE_STATE.md), [Live client protocol](live-replay-protocol.md), [Deferred workflow turns](DEFERRED_TURNS.md), [workflow follow-ups](2026-08-25-workflow-follow-ups.md), [workflow settings](2026-08-25-workflow-settings.md), [Human decisions](HUMAN_DECISIONS.md), [Human decision presentations](HUMAN_DECISION_PRESENTATIONS.md), [Session event journal](session-event-journal.md), [Rust TUI viewer](tui-viewer.md), the earlier host plans, the authoring reference, and README to match the implementation.
458
+ Update [Workflow server](WORKFLOW_SERVER.md), [Workflow messages in Pi](WORKFLOW_STEP_MESSAGES.md), [SQLite state](SQLITE_STATE.md), [Live client protocol](live-replay-protocol.md), [Deferred workflow turns](DEFERRED_TURNS.md), [workflow follow-ups](2026-08-25-workflow-follow-ups.md), [workflow settings](2026-08-25-workflow-settings.md), [Human decisions](HUMAN_DECISIONS.md), [Human decision presentations](HUMAN_DECISION_PRESENTATIONS.md), [Session event journal](session-event-journal.md), [Rust TUI viewer](tui-viewer.md), the earlier host plans, the authoring reference, and README to match the implementation.
459
459
 
460
460
  Remove temporary current-version warnings only after live checks pass.
461
461
 
@@ -498,7 +498,7 @@ Remove temporary current-version warnings only after live checks pass.
498
498
  - Pause and resume a presented step and receive one step message with reason `resumed`.
499
499
  - Prove initial, reminder, and resumed prompts use the same message kind, contract, attempt identity, eligibility, and recovery path.
500
500
  - Prove the partial unique index allows at most one pending step message per request for every reason.
501
- - Complete, fail, time out, cancel, fail launch without recoverable handoff, and interrupt through a controller; receive one terminal turn in each case.
501
+ - Complete, fail, time out, cancel, fail launch without recoverable handoff, and interrupt through a resource manager; receive one terminal turn in each case.
502
502
  - Settle a checkpoint parent through a continuation and prove only the final chain leaf gets a terminal turn.
503
503
  - Restart safely, reject a fourth restart, and reject a repeated terminal fingerprint.
504
504
  - Queue and remove follow-ups, then send remaining prompts once in order without pointer deadlock.