@openrig/cli 0.4.4 → 0.4.6

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 (431) hide show
  1. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +6 -8
  2. package/daemon/assets/plugins/openrig-core/skills/openrig-cmux/SKILL.md +86 -0
  3. package/daemon/assets/plugins/openrig-core/skills/openrig-herdr/SKILL.md +158 -0
  4. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +744 -96
  5. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  6. package/daemon/dist/adapters/codex-runtime-adapter.js +12 -8
  7. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  8. package/daemon/dist/adapters/pi-resume.d.ts +32 -0
  9. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -0
  10. package/daemon/dist/adapters/pi-resume.js +125 -0
  11. package/daemon/dist/adapters/pi-resume.js.map +1 -0
  12. package/daemon/dist/adapters/pi-runner-protocol.d.ts +88 -0
  13. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -0
  14. package/daemon/dist/adapters/pi-runner-protocol.js +153 -0
  15. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -0
  16. package/daemon/dist/adapters/pi-runner.d.ts +99 -0
  17. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -0
  18. package/daemon/dist/adapters/pi-runner.js +519 -0
  19. package/daemon/dist/adapters/pi-runner.js.map +1 -0
  20. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +61 -0
  21. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -0
  22. package/daemon/dist/adapters/pi-runtime-adapter.js +356 -0
  23. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -0
  24. package/daemon/dist/adapters/tmux.d.ts +22 -1
  25. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  26. package/daemon/dist/adapters/tmux.js +40 -1
  27. package/daemon/dist/adapters/tmux.js.map +1 -1
  28. package/daemon/dist/build-info.js +3 -3
  29. package/daemon/dist/builtins/workflow-specs/branched-remediation.yaml +31 -0
  30. package/daemon/dist/builtins/workflow-specs/factory-rsi.yaml +152 -0
  31. package/daemon/dist/builtins/workflow-specs/gated-release.yaml +26 -0
  32. package/daemon/dist/builtins/workflow-specs/linear-build.yaml +21 -0
  33. package/daemon/dist/db/migrations/049_workflow_instance_version.d.ts +20 -0
  34. package/daemon/dist/db/migrations/049_workflow_instance_version.d.ts.map +1 -0
  35. package/daemon/dist/db/migrations/049_workflow_instance_version.js +24 -0
  36. package/daemon/dist/db/migrations/049_workflow_instance_version.js.map +1 -0
  37. package/daemon/dist/db/migrations/050_workflow_spec_json.d.ts +22 -0
  38. package/daemon/dist/db/migrations/050_workflow_spec_json.d.ts.map +1 -0
  39. package/daemon/dist/db/migrations/050_workflow_spec_json.js +26 -0
  40. package/daemon/dist/db/migrations/050_workflow_spec_json.js.map +1 -0
  41. package/daemon/dist/db/migrations/051_workflow_resume.d.ts +22 -0
  42. package/daemon/dist/db/migrations/051_workflow_resume.d.ts.map +1 -0
  43. package/daemon/dist/db/migrations/051_workflow_resume.js +27 -0
  44. package/daemon/dist/db/migrations/051_workflow_resume.js.map +1 -0
  45. package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.d.ts +26 -0
  46. package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.d.ts.map +1 -0
  47. package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.js +30 -0
  48. package/daemon/dist/db/migrations/052_workflow_instance_bound_rig.js.map +1 -0
  49. package/daemon/dist/db/migrations/053_sessions_node_id_index.d.ts +48 -0
  50. package/daemon/dist/db/migrations/053_sessions_node_id_index.d.ts.map +1 -0
  51. package/daemon/dist/db/migrations/053_sessions_node_id_index.js +53 -0
  52. package/daemon/dist/db/migrations/053_sessions_node_id_index.js.map +1 -0
  53. package/daemon/dist/db/migrations/054_queue_transitions_archive.d.ts +34 -0
  54. package/daemon/dist/db/migrations/054_queue_transitions_archive.d.ts.map +1 -0
  55. package/daemon/dist/db/migrations/054_queue_transitions_archive.js +49 -0
  56. package/daemon/dist/db/migrations/054_queue_transitions_archive.js.map +1 -0
  57. package/daemon/dist/domain/claim-service.d.ts +11 -0
  58. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  59. package/daemon/dist/domain/claim-service.js +3 -1
  60. package/daemon/dist/domain/claim-service.js.map +1 -1
  61. package/daemon/dist/domain/discovery-types.d.ts +1 -1
  62. package/daemon/dist/domain/discovery-types.d.ts.map +1 -1
  63. package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts +1 -0
  64. package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -1
  65. package/daemon/dist/domain/hosts/hosts-registry-reader.js +19 -0
  66. package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -1
  67. package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts +11 -0
  68. package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts.map +1 -0
  69. package/daemon/dist/domain/hosts/hosts-registry-writer.js +54 -0
  70. package/daemon/dist/domain/hosts/hosts-registry-writer.js.map +1 -0
  71. package/daemon/dist/domain/hosts/read-through.d.ts +28 -0
  72. package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -0
  73. package/daemon/dist/domain/hosts/read-through.js +139 -0
  74. package/daemon/dist/domain/hosts/read-through.js.map +1 -0
  75. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts +21 -0
  76. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts.map +1 -1
  77. package/daemon/dist/domain/hosts/remote-daemon-http.js +49 -0
  78. package/daemon/dist/domain/hosts/remote-daemon-http.js.map +1 -1
  79. package/daemon/dist/domain/node-inventory.d.ts +18 -0
  80. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  81. package/daemon/dist/domain/node-inventory.js +206 -95
  82. package/daemon/dist/domain/node-inventory.js.map +1 -1
  83. package/daemon/dist/domain/node-launcher.d.ts +11 -0
  84. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  85. package/daemon/dist/domain/node-launcher.js +10 -0
  86. package/daemon/dist/domain/node-launcher.js.map +1 -1
  87. package/daemon/dist/domain/policies/workflow-keepalive.d.ts +7 -0
  88. package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
  89. package/daemon/dist/domain/policies/workflow-keepalive.js +93 -13
  90. package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
  91. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  92. package/daemon/dist/domain/ps-projection.js +37 -26
  93. package/daemon/dist/domain/ps-projection.js.map +1 -1
  94. package/daemon/dist/domain/queue-repository.d.ts +105 -0
  95. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  96. package/daemon/dist/domain/queue-repository.js +193 -4
  97. package/daemon/dist/domain/queue-repository.js.map +1 -1
  98. package/daemon/dist/domain/queue-retention.d.ts +130 -0
  99. package/daemon/dist/domain/queue-retention.d.ts.map +1 -0
  100. package/daemon/dist/domain/queue-retention.js +224 -0
  101. package/daemon/dist/domain/queue-retention.js.map +1 -0
  102. package/daemon/dist/domain/restore-orchestrator.d.ts +5 -0
  103. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  104. package/daemon/dist/domain/restore-orchestrator.js +29 -2
  105. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  106. package/daemon/dist/domain/resume-token-capture.d.ts +13 -0
  107. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
  108. package/daemon/dist/domain/resume-token-capture.js +14 -1
  109. package/daemon/dist/domain/resume-token-capture.js.map +1 -1
  110. package/daemon/dist/domain/resume-token-validation.d.ts +1 -1
  111. package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
  112. package/daemon/dist/domain/resume-token-validation.js +58 -10
  113. package/daemon/dist/domain/resume-token-validation.js.map +1 -1
  114. package/daemon/dist/domain/review/compose.d.ts +50 -1
  115. package/daemon/dist/domain/review/compose.d.ts.map +1 -1
  116. package/daemon/dist/domain/review/compose.js +92 -3
  117. package/daemon/dist/domain/review/compose.js.map +1 -1
  118. package/daemon/dist/domain/review/fleet-compose.d.ts +52 -0
  119. package/daemon/dist/domain/review/fleet-compose.d.ts.map +1 -0
  120. package/daemon/dist/domain/review/fleet-compose.js +294 -0
  121. package/daemon/dist/domain/review/fleet-compose.js.map +1 -0
  122. package/daemon/dist/domain/review/gather.d.ts +16 -1
  123. package/daemon/dist/domain/review/gather.d.ts.map +1 -1
  124. package/daemon/dist/domain/review/gather.js +177 -41
  125. package/daemon/dist/domain/review/gather.js.map +1 -1
  126. package/daemon/dist/domain/review/types.d.ts +104 -1
  127. package/daemon/dist/domain/review/types.d.ts.map +1 -1
  128. package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
  129. package/daemon/dist/domain/rig-expansion-service.js +3 -0
  130. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  131. package/daemon/dist/domain/rig-repository.d.ts +7 -6
  132. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  133. package/daemon/dist/domain/rig-repository.js +33 -11
  134. package/daemon/dist/domain/rig-repository.js.map +1 -1
  135. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  136. package/daemon/dist/domain/rigspec-codec.js +3 -0
  137. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  138. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  139. package/daemon/dist/domain/rigspec-exporter.js +4 -0
  140. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  141. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  142. package/daemon/dist/domain/rigspec-instantiator.js +11 -0
  143. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  144. package/daemon/dist/domain/rigspec-preflight.d.ts +6 -0
  145. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  146. package/daemon/dist/domain/rigspec-preflight.js +26 -1
  147. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  148. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  149. package/daemon/dist/domain/rigspec-schema.js +20 -1
  150. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  151. package/daemon/dist/domain/runtime-verifier.d.ts +7 -1
  152. package/daemon/dist/domain/runtime-verifier.d.ts.map +1 -1
  153. package/daemon/dist/domain/runtime-verifier.js +39 -1
  154. package/daemon/dist/domain/runtime-verifier.js.map +1 -1
  155. package/daemon/dist/domain/seat-handover-service.d.ts +9 -0
  156. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  157. package/daemon/dist/domain/seat-handover-service.js +2 -0
  158. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  159. package/daemon/dist/domain/seat-identity-store.d.ts +7 -0
  160. package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
  161. package/daemon/dist/domain/seat-identity-store.js +27 -0
  162. package/daemon/dist/domain/seat-identity-store.js.map +1 -1
  163. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  164. package/daemon/dist/domain/seat-status-service.js +6 -4
  165. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  166. package/daemon/dist/domain/session-name.d.ts +22 -0
  167. package/daemon/dist/domain/session-name.d.ts.map +1 -1
  168. package/daemon/dist/domain/session-name.js +29 -0
  169. package/daemon/dist/domain/session-name.js.map +1 -1
  170. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  171. package/daemon/dist/domain/slices/slice-detail-projector.js +4 -5
  172. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  173. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +18 -2
  174. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
  175. package/daemon/dist/domain/spec-library-workflow-scanner.js +23 -1
  176. package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
  177. package/daemon/dist/domain/startup-proof.d.ts +10 -6
  178. package/daemon/dist/domain/startup-proof.d.ts.map +1 -1
  179. package/daemon/dist/domain/startup-proof.js +35 -7
  180. package/daemon/dist/domain/startup-proof.js.map +1 -1
  181. package/daemon/dist/domain/successor-session-launcher.d.ts +16 -0
  182. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  183. package/daemon/dist/domain/successor-session-launcher.js +13 -0
  184. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  185. package/daemon/dist/domain/terminal/cmux-provider-adapter.d.ts +27 -0
  186. package/daemon/dist/domain/terminal/cmux-provider-adapter.d.ts.map +1 -0
  187. package/daemon/dist/domain/terminal/cmux-provider-adapter.js +67 -0
  188. package/daemon/dist/domain/terminal/cmux-provider-adapter.js.map +1 -0
  189. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +77 -0
  190. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -0
  191. package/daemon/dist/domain/terminal/herdr-adapter.js +266 -0
  192. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -0
  193. package/daemon/dist/domain/terminal/herdr-transport.d.ts +50 -0
  194. package/daemon/dist/domain/terminal/herdr-transport.d.ts.map +1 -0
  195. package/daemon/dist/domain/terminal/herdr-transport.js +145 -0
  196. package/daemon/dist/domain/terminal/herdr-transport.js.map +1 -0
  197. package/daemon/dist/domain/terminal/terminal-provider.d.ts +88 -0
  198. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -0
  199. package/daemon/dist/domain/terminal/terminal-provider.js +17 -0
  200. package/daemon/dist/domain/terminal/terminal-provider.js.map +1 -0
  201. package/daemon/dist/domain/terminal/terminal-service.d.ts +60 -0
  202. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -0
  203. package/daemon/dist/domain/terminal/terminal-service.js +174 -0
  204. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -0
  205. package/daemon/dist/domain/terminal/terminal-views-store.d.ts +77 -0
  206. package/daemon/dist/domain/terminal/terminal-views-store.d.ts.map +1 -0
  207. package/daemon/dist/domain/terminal/terminal-views-store.js +146 -0
  208. package/daemon/dist/domain/terminal/terminal-views-store.js.map +1 -0
  209. package/daemon/dist/domain/terminal/view-composer.d.ts +42 -0
  210. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -0
  211. package/daemon/dist/domain/terminal/view-composer.js +137 -0
  212. package/daemon/dist/domain/terminal/view-composer.js.map +1 -0
  213. package/daemon/dist/domain/tmux-option-defaults.d.ts +89 -0
  214. package/daemon/dist/domain/tmux-option-defaults.d.ts.map +1 -0
  215. package/daemon/dist/domain/tmux-option-defaults.js +132 -0
  216. package/daemon/dist/domain/tmux-option-defaults.js.map +1 -0
  217. package/daemon/dist/domain/types.d.ts +34 -1
  218. package/daemon/dist/domain/types.d.ts.map +1 -1
  219. package/daemon/dist/domain/types.js.map +1 -1
  220. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  221. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  222. package/daemon/dist/domain/user-settings/settings-store.js +92 -0
  223. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  224. package/daemon/dist/domain/workflow/slice-workflow-projection.d.ts.map +1 -1
  225. package/daemon/dist/domain/workflow/slice-workflow-projection.js +6 -2
  226. package/daemon/dist/domain/workflow/slice-workflow-projection.js.map +1 -1
  227. package/daemon/dist/domain/workflow-boot-sweep.d.ts +28 -0
  228. package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -0
  229. package/daemon/dist/domain/workflow-boot-sweep.js +102 -0
  230. package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -0
  231. package/daemon/dist/domain/workflow-deadline.d.ts +74 -0
  232. package/daemon/dist/domain/workflow-deadline.d.ts.map +1 -0
  233. package/daemon/dist/domain/workflow-deadline.js +165 -0
  234. package/daemon/dist/domain/workflow-deadline.js.map +1 -0
  235. package/daemon/dist/domain/workflow-exception-escalation.d.ts +33 -0
  236. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -0
  237. package/daemon/dist/domain/workflow-exception-escalation.js +104 -0
  238. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -0
  239. package/daemon/dist/domain/workflow-exception-router.d.ts +33 -0
  240. package/daemon/dist/domain/workflow-exception-router.d.ts.map +1 -0
  241. package/daemon/dist/domain/workflow-exception-router.js +96 -0
  242. package/daemon/dist/domain/workflow-exception-router.js.map +1 -0
  243. package/daemon/dist/domain/workflow-exception.d.ts +90 -0
  244. package/daemon/dist/domain/workflow-exception.d.ts.map +1 -0
  245. package/daemon/dist/domain/workflow-exception.js +122 -0
  246. package/daemon/dist/domain/workflow-exception.js.map +1 -0
  247. package/daemon/dist/domain/workflow-frontier-guard.d.ts +24 -0
  248. package/daemon/dist/domain/workflow-frontier-guard.d.ts.map +1 -0
  249. package/daemon/dist/domain/workflow-frontier-guard.js +30 -0
  250. package/daemon/dist/domain/workflow-frontier-guard.js.map +1 -0
  251. package/daemon/dist/domain/workflow-instance-store.d.ts +28 -0
  252. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  253. package/daemon/dist/domain/workflow-instance-store.js +66 -10
  254. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  255. package/daemon/dist/domain/workflow-keepalive-arming.d.ts +35 -0
  256. package/daemon/dist/domain/workflow-keepalive-arming.d.ts.map +1 -0
  257. package/daemon/dist/domain/workflow-keepalive-arming.js +87 -0
  258. package/daemon/dist/domain/workflow-keepalive-arming.js.map +1 -0
  259. package/daemon/dist/domain/workflow-projector.d.ts +117 -2
  260. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  261. package/daemon/dist/domain/workflow-projector.js +672 -41
  262. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  263. package/daemon/dist/domain/workflow-role-context.d.ts +57 -0
  264. package/daemon/dist/domain/workflow-role-context.d.ts.map +1 -0
  265. package/daemon/dist/domain/workflow-role-context.js +120 -0
  266. package/daemon/dist/domain/workflow-role-context.js.map +1 -0
  267. package/daemon/dist/domain/workflow-role-resolver.d.ts +65 -0
  268. package/daemon/dist/domain/workflow-role-resolver.d.ts.map +1 -0
  269. package/daemon/dist/domain/workflow-role-resolver.js +108 -0
  270. package/daemon/dist/domain/workflow-role-resolver.js.map +1 -0
  271. package/daemon/dist/domain/workflow-runtime.d.ts +157 -1
  272. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  273. package/daemon/dist/domain/workflow-runtime.js +718 -11
  274. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  275. package/daemon/dist/domain/workflow-spec-cache.d.ts +26 -1
  276. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  277. package/daemon/dist/domain/workflow-spec-cache.js +327 -13
  278. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  279. package/daemon/dist/domain/workflow-types.d.ts +143 -8
  280. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  281. package/daemon/dist/domain/workflow-types.js +14 -1
  282. package/daemon/dist/domain/workflow-types.js.map +1 -1
  283. package/daemon/dist/domain/workflow-validator.d.ts +11 -1
  284. package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  285. package/daemon/dist/domain/workflow-validator.js +246 -1
  286. package/daemon/dist/domain/workflow-validator.js.map +1 -1
  287. package/daemon/dist/index.d.ts +17 -0
  288. package/daemon/dist/index.d.ts.map +1 -1
  289. package/daemon/dist/index.js +44 -0
  290. package/daemon/dist/index.js.map +1 -1
  291. package/daemon/dist/routes/activity.js +22 -0
  292. package/daemon/dist/routes/activity.js.map +1 -1
  293. package/daemon/dist/routes/hosts.d.ts +5 -0
  294. package/daemon/dist/routes/hosts.d.ts.map +1 -0
  295. package/daemon/dist/routes/hosts.js +346 -0
  296. package/daemon/dist/routes/hosts.js.map +1 -0
  297. package/daemon/dist/routes/queue.d.ts +2 -7
  298. package/daemon/dist/routes/queue.d.ts.map +1 -1
  299. package/daemon/dist/routes/queue.js +264 -9
  300. package/daemon/dist/routes/queue.js.map +1 -1
  301. package/daemon/dist/routes/review.d.ts.map +1 -1
  302. package/daemon/dist/routes/review.js +26 -0
  303. package/daemon/dist/routes/review.js.map +1 -1
  304. package/daemon/dist/routes/seat.js +13 -0
  305. package/daemon/dist/routes/seat.js.map +1 -1
  306. package/daemon/dist/routes/terminal.d.ts +11 -0
  307. package/daemon/dist/routes/terminal.d.ts.map +1 -0
  308. package/daemon/dist/routes/terminal.js +104 -0
  309. package/daemon/dist/routes/terminal.js.map +1 -0
  310. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  311. package/daemon/dist/routes/workflow.js +102 -10
  312. package/daemon/dist/routes/workflow.js.map +1 -1
  313. package/daemon/dist/server.d.ts +5 -0
  314. package/daemon/dist/server.d.ts.map +1 -1
  315. package/daemon/dist/server.js +22 -0
  316. package/daemon/dist/server.js.map +1 -1
  317. package/daemon/dist/startup.d.ts.map +1 -1
  318. package/daemon/dist/startup.js +221 -12
  319. package/daemon/dist/startup.js.map +1 -1
  320. package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +29 -0
  321. package/daemon/specs/agents/factory-rsi/dogfood/guidance/role.md +37 -0
  322. package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +29 -0
  323. package/daemon/specs/agents/factory-rsi/release-manager/guidance/role.md +40 -0
  324. package/daemon/specs/agents/shared/skills/core/mission-slice-sop/SKILL.md +6 -8
  325. package/daemon/specs/agents/shared/skills/core/openrig-cmux/SKILL.md +86 -0
  326. package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +158 -0
  327. package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +6 -6
  328. package/daemon/specs/rigs/launch/factory-rsi/CULTURE.md +47 -0
  329. package/daemon/specs/rigs/launch/factory-rsi/rig.yaml +115 -0
  330. package/dist/build-info.js +3 -3
  331. package/dist/commands/broadcast.d.ts +6 -1
  332. package/dist/commands/broadcast.d.ts.map +1 -1
  333. package/dist/commands/broadcast.js +101 -15
  334. package/dist/commands/broadcast.js.map +1 -1
  335. package/dist/commands/capture.d.ts.map +1 -1
  336. package/dist/commands/capture.js +99 -8
  337. package/dist/commands/capture.js.map +1 -1
  338. package/dist/commands/config.d.ts.map +1 -1
  339. package/dist/commands/config.js +4 -0
  340. package/dist/commands/config.js.map +1 -1
  341. package/dist/commands/down.d.ts.map +1 -1
  342. package/dist/commands/down.js +5 -0
  343. package/dist/commands/down.js.map +1 -1
  344. package/dist/commands/host.d.ts +14 -0
  345. package/dist/commands/host.d.ts.map +1 -1
  346. package/dist/commands/host.js +338 -14
  347. package/dist/commands/host.js.map +1 -1
  348. package/dist/commands/launch.d.ts.map +1 -1
  349. package/dist/commands/launch.js +5 -0
  350. package/dist/commands/launch.js.map +1 -1
  351. package/dist/commands/ps.d.ts.map +1 -1
  352. package/dist/commands/ps.js +10 -4
  353. package/dist/commands/ps.js.map +1 -1
  354. package/dist/commands/queue.d.ts +36 -0
  355. package/dist/commands/queue.d.ts.map +1 -1
  356. package/dist/commands/queue.js +73 -7
  357. package/dist/commands/queue.js.map +1 -1
  358. package/dist/commands/restore-packet.d.ts.map +1 -1
  359. package/dist/commands/restore-packet.js +13 -2
  360. package/dist/commands/restore-packet.js.map +1 -1
  361. package/dist/commands/send.d.ts.map +1 -1
  362. package/dist/commands/send.js +114 -9
  363. package/dist/commands/send.js.map +1 -1
  364. package/dist/commands/terminal.d.ts +6 -0
  365. package/dist/commands/terminal.d.ts.map +1 -0
  366. package/dist/commands/terminal.js +116 -0
  367. package/dist/commands/terminal.js.map +1 -0
  368. package/dist/commands/transcript.d.ts +6 -1
  369. package/dist/commands/transcript.d.ts.map +1 -1
  370. package/dist/commands/transcript.js +113 -30
  371. package/dist/commands/transcript.js.map +1 -1
  372. package/dist/commands/up.d.ts.map +1 -1
  373. package/dist/commands/up.js +9 -0
  374. package/dist/commands/up.js.map +1 -1
  375. package/dist/commands/whoami.d.ts.map +1 -1
  376. package/dist/commands/whoami.js +11 -0
  377. package/dist/commands/whoami.js.map +1 -1
  378. package/dist/commands/workflow-errors.d.ts +23 -0
  379. package/dist/commands/workflow-errors.d.ts.map +1 -0
  380. package/dist/commands/workflow-errors.js +100 -0
  381. package/dist/commands/workflow-errors.js.map +1 -0
  382. package/dist/commands/workflow-follow.d.ts +71 -0
  383. package/dist/commands/workflow-follow.d.ts.map +1 -0
  384. package/dist/commands/workflow-follow.js +259 -0
  385. package/dist/commands/workflow-follow.js.map +1 -0
  386. package/dist/commands/workflow-render.d.ts +114 -0
  387. package/dist/commands/workflow-render.d.ts.map +1 -0
  388. package/dist/commands/workflow-render.js +223 -0
  389. package/dist/commands/workflow-render.js.map +1 -0
  390. package/dist/commands/workflow.d.ts +1 -0
  391. package/dist/commands/workflow.d.ts.map +1 -1
  392. package/dist/commands/workflow.js +278 -14
  393. package/dist/commands/workflow.js.map +1 -1
  394. package/dist/config-store.d.ts +15 -1
  395. package/dist/config-store.d.ts.map +1 -1
  396. package/dist/config-store.js +103 -0
  397. package/dist/config-store.js.map +1 -1
  398. package/dist/cross-host-cli-helpers.d.ts +13 -0
  399. package/dist/cross-host-cli-helpers.d.ts.map +1 -1
  400. package/dist/cross-host-cli-helpers.js +27 -0
  401. package/dist/cross-host-cli-helpers.js.map +1 -1
  402. package/dist/cross-host-target.d.ts +49 -0
  403. package/dist/cross-host-target.d.ts.map +1 -0
  404. package/dist/cross-host-target.js +35 -0
  405. package/dist/cross-host-target.js.map +1 -0
  406. package/dist/host-registry.d.ts +8 -0
  407. package/dist/host-registry.d.ts.map +1 -1
  408. package/dist/host-registry.js +32 -0
  409. package/dist/host-registry.js.map +1 -1
  410. package/dist/host-selection.d.ts +13 -0
  411. package/dist/host-selection.d.ts.map +1 -0
  412. package/dist/host-selection.js +54 -0
  413. package/dist/host-selection.js.map +1 -0
  414. package/dist/index.d.ts +2 -0
  415. package/dist/index.d.ts.map +1 -1
  416. package/dist/index.js +2 -0
  417. package/dist/index.js.map +1 -1
  418. package/dist/remote-host-ops.d.ts +1 -0
  419. package/dist/remote-host-ops.d.ts.map +1 -1
  420. package/dist/remote-host-ops.js +11 -4
  421. package/dist/remote-host-ops.js.map +1 -1
  422. package/dist/session-name.d.ts +23 -0
  423. package/dist/session-name.d.ts.map +1 -0
  424. package/dist/session-name.js +61 -0
  425. package/dist/session-name.js.map +1 -0
  426. package/package.json +1 -1
  427. package/ui/dist/assets/index-CFqxa0zW.css +32 -0
  428. package/ui/dist/assets/index-zrFqS7gL.js +623 -0
  429. package/ui/dist/index.html +2 -2
  430. package/ui/dist/assets/index-D69ZhNIr.js +0 -598
  431. package/ui/dist/assets/index-DJYun-8d.css +0 -32
@@ -0,0 +1,152 @@
1
+ # OpenRig 0.4.6 canonical single-rig RSI factory MVP (OPR.0.4.6.FAC2).
2
+ #
3
+ # ONE rig + ONE workflow = the recursive-self-improvement factory MVP. The
4
+ # in-band INNER LOOP is a bounded, engine-routed SDLC:
5
+ # plan → implement → qa_check → review → release
6
+ # under the enforceable max_hops guard (WF-1 sanction); a failing check or
7
+ # review routes back to implement for bounded remediation; exceptions route via
8
+ # the WF-5 dial (orchestrator-first); the release leg PREPARES and holds the ship
9
+ # decision at a human gate (publish is a human act). Runs on the shipped engine
10
+ # with the v0 hardcode seam (target.rig baked + preferred_targets) — no binding
11
+ # layer needed.
12
+ #
13
+ # The RSI recursion is the DECOUPLED dogfood edge: the dogfood seat runs
14
+ # out-of-band and continuously against the SHIPPED product (not a second QA on
15
+ # the build artifact) and feeds its findings into the next plan — ungated, with
16
+ # no loop-stop in the MVP. The exact continuous out-of-band runtime mechanism is
17
+ # refined in a later release; here the inner loop is in-band and dogfood is the
18
+ # out-of-band feed, referenced by the `dogfood` role below.
19
+ workflow:
20
+ id: factory-rsi
21
+ version: 1
22
+ objective: >
23
+ Plan, build, check, review, and release one slice as a bounded,
24
+ deterministic, engine-routed inner loop on a single rig. Dogfood runs
25
+ out-of-band against the shipped product and feeds its findings into the next
26
+ plan — the RSI edge, with no human required.
27
+ target:
28
+ rig: factory-rsi
29
+ entry:
30
+ role: planner
31
+ coordination_terminal_turn_rule: hot_potato
32
+ # Exceptions route orchestrator-first (the WF-5 v1.3 dial); the human knows
33
+ # at altitude via the awareness row. The orchestrator role below is the dial
34
+ # target — resolved through the same role→preferred_targets mechanism.
35
+ exception_routing:
36
+ default: orchestrator
37
+ orchestrator_role: orchestrator
38
+ roles:
39
+ planner:
40
+ skill_refs: [openrig-user, requirements-writer, writing-plans]
41
+ preferred_targets: [plan-planner@factory-rsi]
42
+ implementer:
43
+ skill_refs: [openrig-user, development-team, test-driven-development]
44
+ preferred_targets: [build-implementer@factory-rsi]
45
+ qa:
46
+ skill_refs: [openrig-user, verification-before-completion]
47
+ preferred_targets: [check-qa@factory-rsi]
48
+ reviewer:
49
+ skill_refs: [openrig-user, review-team, plan-review]
50
+ preferred_targets: [review-reviewer@factory-rsi]
51
+ release_manager:
52
+ skill_refs: [openrig-user, release-manager]
53
+ preferred_targets: [release-manager@factory-rsi]
54
+ orchestrator:
55
+ skill_refs: [openrig-user, orchestration-team]
56
+ preferred_targets: [orch-lead@factory-rsi]
57
+ # The dogfood role is DECOUPLED from the inner loop: it runs out-of-band
58
+ # against the SHIPPED product and feeds findings into the next plan (the RSI
59
+ # edge). It is intentionally NOT an inner-loop step here; the continuous
60
+ # out-of-band runtime mechanism is refined in a later release.
61
+ dogfood:
62
+ skill_refs: [openrig-user, dogfood, systematic-debugging]
63
+ preferred_targets: [dogfood-tester@factory-rsi]
64
+ steps:
65
+ - id: plan
66
+ actor_role: planner
67
+ objective: >
68
+ Turn the current input — the product corpus on cycle 1, or the recorded
69
+ out-of-band dogfood findings thereafter — into ONE buildable slice spec.
70
+ The findings arrive as recorded closure evidence, never chat.
71
+ allowed_exits: [handoff, waiting, failed]
72
+ next_hop:
73
+ mode: require
74
+ suggested_roles: [implementer]
75
+ - id: implement
76
+ actor_role: implementer
77
+ objective: Build the slice per the plan and produce proof for the check.
78
+ allowed_exits: [handoff, waiting, failed]
79
+ next_hop:
80
+ mode: require
81
+ suggested_roles: [qa]
82
+ - id: qa_check
83
+ actor_role: qa
84
+ objective: >
85
+ Check the built artifact. Passing hands to review; a FAILING check (the
86
+ artifact's verdict, not the step's dysfunction) routes back to implement
87
+ for bounded remediation.
88
+ allowed_exits: [handoff, waiting, failed]
89
+ next_hop:
90
+ mode: require
91
+ suggested_roles: [reviewer]
92
+ on:
93
+ failed: implement
94
+ - id: review
95
+ actor_role: reviewer
96
+ objective: >
97
+ Review the artifact (cross-runtime diversity vs the builder). Passing
98
+ hands to the release prep; a failing review routes back to implement.
99
+ allowed_exits: [handoff, waiting, failed]
100
+ next_hop:
101
+ mode: require
102
+ suggested_roles: [release_manager]
103
+ on:
104
+ failed: implement
105
+ - id: release_prep
106
+ actor_role: release_manager
107
+ objective: >
108
+ Prepare the release notes, docs/website updates, and the release PR, and
109
+ record the cycle's release evidence at `proof/PROOF.md` in the workspace
110
+ (the `evidence_ref` the sign-off gate points at). This is the
111
+ release-manager's ACTUAL work and it runs BEFORE any gate — the prepared
112
+ artifacts exist first; publish stays a human act (held at release_signoff).
113
+ allowed_exits: [handoff, waiting, failed]
114
+ next_hop:
115
+ # Explicit step-id route (NOT suggested_roles): release_prep and
116
+ # release_signoff share the release_manager actor_role, so a role-based
117
+ # hop would be ambiguous (it would match the first release_manager step).
118
+ # The prepared artifacts therefore exist BEFORE the human gate below.
119
+ on:
120
+ handoff: release_signoff
121
+ - id: release_signoff
122
+ actor_role: release_manager
123
+ objective: >
124
+ Hold the ship decision at the human gate, against the release artifacts
125
+ already prepared in release_prep. Approval lets the human proceed to
126
+ publish; nothing is published automatically.
127
+ allowed_exits: [done, waiting, failed]
128
+ gate:
129
+ target: human@kernel
130
+ summary: "RSI cycle clean; release artifacts prepared — sign off to publish (publish is a human act)."
131
+ # Workspace-relative pointer to the release evidence release_prep records
132
+ # (the same convention the shipped gated-release.yaml example uses); it is
133
+ # produced in the running workspace per cycle, not a slice file.
134
+ evidence_ref: proof/PROOF.md
135
+ next_hop:
136
+ mode: forbid
137
+ invariants:
138
+ continuation_required: true
139
+ preserve_lineage: true
140
+ closure_required: true
141
+ allowed_exits: [handoff, waiting, done, failed]
142
+ loop_guards:
143
+ # ENFORCEABLE (integer >= 1) — sanctions the bounded remediation loops
144
+ # (qa_check→implement, review→implement); the WF-1 validator requires it and
145
+ # the Argo unbounded-recursion lesson demands it. A trip becomes a WF-5
146
+ # exception; a resume grants one more bounded window (WF-5 FR-4 livelock rail).
147
+ max_hops: 20
148
+ spawn_budget: 0
149
+ closure:
150
+ success: RSI cycle clean; release candidate prepared and held at the human ship gate.
151
+ degraded: Cycle stopped with a named blocker or a bounded max_hops trip awaiting resume.
152
+ failed: Step failed as an exception; preserve the finding and route via the dial.
@@ -0,0 +1,26 @@
1
+ # OpenRig 0.4.6 spec-language example — the GATED STAGE shape.
2
+ # A human sign-off gate on the final step (compiles to the shipped
3
+ # human-route machinery: tier human-gate + summary + evidence_ref,
4
+ # resolved by `rig queue resolve`), plus per-step harness pins.
5
+ workflow:
6
+ id: gated-release
7
+ version: 1
8
+ objective: Build, prove, then hold the ship decision at a human gate.
9
+ roles:
10
+ builder:
11
+ preferred_targets: [flow-builder@acme-flow]
12
+ prover:
13
+ preferred_targets: [flow-prover@acme-flow, flow-prover2@acme-flow]
14
+ steps:
15
+ - id: build
16
+ actor_role: builder
17
+ harness: claude-code
18
+ - id: prove
19
+ actor_role: prover
20
+ harness: codex
21
+ - id: ship-signoff
22
+ actor_role: prover
23
+ gate:
24
+ target: human@kernel
25
+ summary: "Release candidate proven; sign off to ship"
26
+ evidence_ref: proof/PROOF.md
@@ -0,0 +1,21 @@
1
+ # OpenRig 0.4.6 spec-language example — the LINEAR PIPELINE shape.
2
+ # Zero WF-2 features: declaration-order routing, byte-identical to the
3
+ # WF-1 engine's behavior (the zero-regression reference shape).
4
+ workflow:
5
+ id: linear-build
6
+ version: 1
7
+ objective: Move one packet through plan, build, prove in declaration order.
8
+ roles:
9
+ planner:
10
+ preferred_targets: [flow-planner@acme-flow]
11
+ builder:
12
+ preferred_targets: [flow-builder@acme-flow]
13
+ prover:
14
+ preferred_targets: [flow-prover@acme-flow]
15
+ steps:
16
+ - id: plan
17
+ actor_role: planner
18
+ - id: build
19
+ actor_role: builder
20
+ - id: prove
21
+ actor_role: prover
@@ -0,0 +1,20 @@
1
+ import type { Migration } from "../migrate.js";
2
+ /**
3
+ * OPR.0.4.6.WF1 FR-5 — workflow_instances.version column.
4
+ *
5
+ * The optimistic-concurrency guard for instance advancement: every
6
+ * project() carries the version it read into the transaction, and
7
+ * updateFrontier's UPDATE is qualified `WHERE version = ?` with a
8
+ * `version = version + 1` bump. Zero rows changed = a concurrent
9
+ * writer advanced the instance first → structured
10
+ * `instance_version_conflict` (the whole scribe transaction rolls
11
+ * back). SQLite's single-writer serialization orders the writes;
12
+ * the version guard is what stops the SECOND writer from operating on
13
+ * the stale instance state it read before the first committed.
14
+ *
15
+ * Additive, NOT NULL with DEFAULT 0 so existing in-flight instances
16
+ * adopt version 0 and their next projection bumps normally — no
17
+ * backfill required.
18
+ */
19
+ export declare const workflowInstanceVersionSchema: Migration;
20
+ //# sourceMappingURL=049_workflow_instance_version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"049_workflow_instance_version.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/049_workflow_instance_version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAK3C,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * OPR.0.4.6.WF1 FR-5 — workflow_instances.version column.
3
+ *
4
+ * The optimistic-concurrency guard for instance advancement: every
5
+ * project() carries the version it read into the transaction, and
6
+ * updateFrontier's UPDATE is qualified `WHERE version = ?` with a
7
+ * `version = version + 1` bump. Zero rows changed = a concurrent
8
+ * writer advanced the instance first → structured
9
+ * `instance_version_conflict` (the whole scribe transaction rolls
10
+ * back). SQLite's single-writer serialization orders the writes;
11
+ * the version guard is what stops the SECOND writer from operating on
12
+ * the stale instance state it read before the first committed.
13
+ *
14
+ * Additive, NOT NULL with DEFAULT 0 so existing in-flight instances
15
+ * adopt version 0 and their next projection bumps normally — no
16
+ * backfill required.
17
+ */
18
+ export const workflowInstanceVersionSchema = {
19
+ name: "049_workflow_instance_version.sql",
20
+ sql: `
21
+ ALTER TABLE workflow_instances ADD COLUMN version INTEGER NOT NULL DEFAULT 0;
22
+ `,
23
+ };
24
+ //# sourceMappingURL=049_workflow_instance_version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"049_workflow_instance_version.js","sourceRoot":"","sources":["../../../src/db/migrations/049_workflow_instance_version.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAc;IACtD,IAAI,EAAE,mCAAmC;IACzC,GAAG,EAAE;;GAEJ;CACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { Migration } from "../migrate.js";
2
+ /**
3
+ * OPR.0.4.6.WF1 FR-6/FR-9 (source discovery during build) —
4
+ * workflow_specs.spec_json column.
5
+ *
6
+ * At ac75777a the cache stored only roles_json + steps_json (+ scalar
7
+ * columns), so `getByNameVersion` — the path the PROJECTOR resolves
8
+ * specs through at every project() — rebuilt a spec with
9
+ * `loop_guards`, `invariants`, `closure`, and `entry` silently DROPPED
10
+ * (rowToWorkflowSpec's column-only branch). readThrough compensated
11
+ * for VALIDATION by overriding with the freshly file-parsed spec, but
12
+ * projection-time enforcement (FR-6 max_hops) could never see the
13
+ * declared guard. This column stores the FULL parsed spec at cache
14
+ * time so the runtime enforces exactly what the author declared, even
15
+ * after the source file moves or disappears (the cache's own survival
16
+ * contract).
17
+ *
18
+ * NULLABLE: legacy rows fall back to the column-only reconstruction
19
+ * (honest degradation) and self-heal on their next readThrough.
20
+ */
21
+ export declare const workflowSpecJsonSchema: Migration;
22
+ //# sourceMappingURL=050_workflow_spec_json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"050_workflow_spec_json.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/050_workflow_spec_json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAKpC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * OPR.0.4.6.WF1 FR-6/FR-9 (source discovery during build) —
3
+ * workflow_specs.spec_json column.
4
+ *
5
+ * At ac75777a the cache stored only roles_json + steps_json (+ scalar
6
+ * columns), so `getByNameVersion` — the path the PROJECTOR resolves
7
+ * specs through at every project() — rebuilt a spec with
8
+ * `loop_guards`, `invariants`, `closure`, and `entry` silently DROPPED
9
+ * (rowToWorkflowSpec's column-only branch). readThrough compensated
10
+ * for VALIDATION by overriding with the freshly file-parsed spec, but
11
+ * projection-time enforcement (FR-6 max_hops) could never see the
12
+ * declared guard. This column stores the FULL parsed spec at cache
13
+ * time so the runtime enforces exactly what the author declared, even
14
+ * after the source file moves or disappears (the cache's own survival
15
+ * contract).
16
+ *
17
+ * NULLABLE: legacy rows fall back to the column-only reconstruction
18
+ * (honest degradation) and self-heal on their next readThrough.
19
+ */
20
+ export const workflowSpecJsonSchema = {
21
+ name: "050_workflow_spec_json.sql",
22
+ sql: `
23
+ ALTER TABLE workflow_specs ADD COLUMN spec_json TEXT;
24
+ `,
25
+ };
26
+ //# sourceMappingURL=050_workflow_spec_json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"050_workflow_spec_json.js","sourceRoot":"","sources":["../../../src/db/migrations/050_workflow_spec_json.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAc;IAC/C,IAAI,EAAE,4BAA4B;IAClC,GAAG,EAAE;;GAEJ;CACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { Migration } from "../migrate.js";
2
+ /**
3
+ * OPR.0.4.6.WF5 FR-4 — workflow_instances resume columns.
4
+ *
5
+ * `resume_count`: the recorded redrive fact (the AWS Step Functions
6
+ * `redriveCount` shape — a first-class recorded field, never inferred
7
+ * from the trail).
8
+ *
9
+ * `hops_baseline`: the LIVELOCK RAIL (arch return R1). max_hops bounds
10
+ * each DRIVE, not the instance lifetime: the projection guard compares
11
+ * hops accrued since the LATEST instantiate-OR-resume, so a human
12
+ * resume sanctions exactly one more bounded window instead of
13
+ * re-tripping instantly on the first post-resume projection. WF-1's
14
+ * guard comment left this exact seam open ("WF-5 FR-4's resume later
15
+ * amends the baseline").
16
+ *
17
+ * Additive, NOT NULL DEFAULT 0: existing instances keep the v1
18
+ * baseline (0) and zero resumes — no backfill, byte-identical behavior
19
+ * until the first resume.
20
+ */
21
+ export declare const workflowResumeSchema: Migration;
22
+ //# sourceMappingURL=051_workflow_resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"051_workflow_resume.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/051_workflow_resume.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAMlC,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * OPR.0.4.6.WF5 FR-4 — workflow_instances resume columns.
3
+ *
4
+ * `resume_count`: the recorded redrive fact (the AWS Step Functions
5
+ * `redriveCount` shape — a first-class recorded field, never inferred
6
+ * from the trail).
7
+ *
8
+ * `hops_baseline`: the LIVELOCK RAIL (arch return R1). max_hops bounds
9
+ * each DRIVE, not the instance lifetime: the projection guard compares
10
+ * hops accrued since the LATEST instantiate-OR-resume, so a human
11
+ * resume sanctions exactly one more bounded window instead of
12
+ * re-tripping instantly on the first post-resume projection. WF-1's
13
+ * guard comment left this exact seam open ("WF-5 FR-4's resume later
14
+ * amends the baseline").
15
+ *
16
+ * Additive, NOT NULL DEFAULT 0: existing instances keep the v1
17
+ * baseline (0) and zero resumes — no backfill, byte-identical behavior
18
+ * until the first resume.
19
+ */
20
+ export const workflowResumeSchema = {
21
+ name: "051_workflow_resume.sql",
22
+ sql: `
23
+ ALTER TABLE workflow_instances ADD COLUMN resume_count INTEGER NOT NULL DEFAULT 0;
24
+ ALTER TABLE workflow_instances ADD COLUMN hops_baseline INTEGER NOT NULL DEFAULT 0;
25
+ `,
26
+ };
27
+ //# sourceMappingURL=051_workflow_resume.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"051_workflow_resume.js","sourceRoot":"","sources":["../../../src/db/migrations/051_workflow_resume.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAc;IAC7C,IAAI,EAAE,yBAAyB;IAC/B,GAAG,EAAE;;;GAGJ;CACF,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { Migration } from "../migrate.js";
2
+ /**
3
+ * OPR.0.4.6.FAC1 — workflow_instances.bound_rig column.
4
+ *
5
+ * The binding layer's A1 substrate: a workflow instance is pointed at a
6
+ * rig at INSTANTIATION (`--rig` / route `targetRig`, defaulting to the
7
+ * spec's `target.rig`), and the binding persists on the instance so
8
+ * every owner-resolution site (projection, gate compile, entry, resume,
9
+ * exception routing) resolves roles against THAT rig's inventory.
10
+ *
11
+ * Persists the rig NAME, not the id (ARCH Q4): the name is the durable
12
+ * operator-space coordinate — consistent with the seat-name doctrine; a
13
+ * torn-down-and-recreated rig keeps the binding. Name→id is resolved
14
+ * FRESH at each resolution site (an exists-check-class read); a
15
+ * vanished rig fails loud there, never silently.
16
+ *
17
+ * NULLABLE, no default: NULL = unbound = byte-identical pre-FAC-1
18
+ * behavior for every pre-existing row and every instantiate that names
19
+ * no rig. No backfill.
20
+ *
21
+ * NUMBERING (binding, arch supersession 2026-07-07): FAC-1 fixed-claims
22
+ * 052; FS-1 renumbers its in-flight 051/052-adjacent migrations to 053+
23
+ * at its own rebase regardless of merge order.
24
+ */
25
+ export declare const workflowInstanceBoundRigSchema: Migration;
26
+ //# sourceMappingURL=052_workflow_instance_bound_rig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"052_workflow_instance_bound_rig.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/052_workflow_instance_bound_rig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,8BAA8B,EAAE,SAK5C,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * OPR.0.4.6.FAC1 — workflow_instances.bound_rig column.
3
+ *
4
+ * The binding layer's A1 substrate: a workflow instance is pointed at a
5
+ * rig at INSTANTIATION (`--rig` / route `targetRig`, defaulting to the
6
+ * spec's `target.rig`), and the binding persists on the instance so
7
+ * every owner-resolution site (projection, gate compile, entry, resume,
8
+ * exception routing) resolves roles against THAT rig's inventory.
9
+ *
10
+ * Persists the rig NAME, not the id (ARCH Q4): the name is the durable
11
+ * operator-space coordinate — consistent with the seat-name doctrine; a
12
+ * torn-down-and-recreated rig keeps the binding. Name→id is resolved
13
+ * FRESH at each resolution site (an exists-check-class read); a
14
+ * vanished rig fails loud there, never silently.
15
+ *
16
+ * NULLABLE, no default: NULL = unbound = byte-identical pre-FAC-1
17
+ * behavior for every pre-existing row and every instantiate that names
18
+ * no rig. No backfill.
19
+ *
20
+ * NUMBERING (binding, arch supersession 2026-07-07): FAC-1 fixed-claims
21
+ * 052; FS-1 renumbers its in-flight 051/052-adjacent migrations to 053+
22
+ * at its own rebase regardless of merge order.
23
+ */
24
+ export const workflowInstanceBoundRigSchema = {
25
+ name: "052_workflow_instance_bound_rig.sql",
26
+ sql: `
27
+ ALTER TABLE workflow_instances ADD COLUMN bound_rig TEXT;
28
+ `,
29
+ };
30
+ //# sourceMappingURL=052_workflow_instance_bound_rig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"052_workflow_instance_bound_rig.js","sourceRoot":"","sources":["../../../src/db/migrations/052_workflow_instance_bound_rig.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAc;IACvD,IAAI,EAAE,qCAAqC;IAC3C,GAAG,EAAE;;GAEJ;CACF,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { Migration } from "../migrate.js";
2
+ /**
3
+ * OPR.0.4.6 FS-1 (daemon read-path hardening, W1.1) — sessions per-node recency index.
4
+ *
5
+ * ROOT CAUSE (arch grounding ARCH-DESIGN-GROUNDING-fs1-2026-07-06, F1;
6
+ * re-verified firsthand at 384e60f1): the `sessions` table
7
+ * (002_bindings_sessions.ts) was created with ZERO indexes on `node_id` — its
8
+ * only index is the `id` PRIMARY-KEY autoindex. The "latest session per node"
9
+ * subquery `(SELECT s2.id FROM sessions s2 WHERE s2.node_id = ? ORDER BY … LIMIT 1)`
10
+ * is therefore a FULL SCAN of `sessions`, and it appears PER NODE at THREE sites
11
+ * on the hot `/api/ps` path — multiplied by the rig-level N+1 (getEntries loops
12
+ * rigs), one poll scanned `sessions` many times over (the 0.6-0.9s wedge at the
13
+ * host shape). The three sites, and their ORDER BY (why the index is 3-column):
14
+ * - ps-projection.ts:157 ORDER BY created_at DESC, id DESC ← the load-bearing shape
15
+ * - node-inventory.ts:442 ORDER BY id DESC
16
+ * - ps-projection.ts:256 ORDER BY id DESC
17
+ *
18
+ * INDEX SHAPE = (node_id, created_at DESC, id DESC) — arch RULING (B), decided
19
+ * by FIXTURE-MEASURED evidence, NOT preference. Measured before/after on the real
20
+ * incident fixture (24 rigs / 175 nodes / 445 sessions) — evidence:
21
+ * missions/release-0.4.6/slices/01-fs1-daemon-read-path-hardening/proof/
22
+ * perf-hardening-evidence/W1.1-sessions-index-measure-2026-07-06-dev44-driver2.md
23
+ * - id-DESC sites (:442, :256): full-scan → covering seek, ~63x (0.677s→0.011s / 52.5k evals).
24
+ * - created_at site (:157): under a 2-col (node_id, id DESC) index it SEARCHes
25
+ * node_id but keeps a TEMP B-TREE sort (~18.6x); under THIS 3-col index it is
26
+ * `SEARCH … USING COVERING INDEX` with NO sort (~95x, 0.856s→0.009s) — the
27
+ * measured ~5x that decided the shape.
28
+ * - Bound proven at 10x scale (4450 sessions): full-scan 8.4s (grows with data)
29
+ * vs seek 0.024s (~flat) = ~350x. CREATE INDEX = 0.013s, safe on populated data.
30
+ * The 3-column index leads with `node_id` (the equality seek), so the two id-DESC
31
+ * sites still get the node_id seek (full-scan eliminated); their residual is a
32
+ * per-node sort over ~2-3 rows (445 sessions / 175 nodes) — arch-accepted as noise.
33
+ * ONE index by ruling: this migration WIDENS to the 3-column shape and never grows
34
+ * a sibling (a second index = write amplification + space for no measured need).
35
+ *
36
+ * CREATE INDEX IF NOT EXISTS is idempotent + safe on a live/populated table
37
+ * (SQLite builds it in one pass; no schema/data change).
38
+ *
39
+ * Sibling audit (arch D1.1): the snapshots(rig_id, created_at) subqueries in the
40
+ * rigs projection are a separate index-audit item in W1, not this migration.
41
+ *
42
+ * Number 053: main shipped 051_workflow_resume and FAC-1 reserves
43
+ * 052_workflow_instance_bound_rig, so FS-1's index migration renumbered
44
+ * 051→053 (orch deconflict 2026-07-06; re-verify the free slot against the
45
+ * final merged tree at rebase/proof time). The index NAME + shape are unchanged.
46
+ */
47
+ export declare const sessionsNodeIdIndexSchema: Migration;
48
+ //# sourceMappingURL=053_sessions_node_id_index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"053_sessions_node_id_index.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/053_sessions_node_id_index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAMvC,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * OPR.0.4.6 FS-1 (daemon read-path hardening, W1.1) — sessions per-node recency index.
3
+ *
4
+ * ROOT CAUSE (arch grounding ARCH-DESIGN-GROUNDING-fs1-2026-07-06, F1;
5
+ * re-verified firsthand at 384e60f1): the `sessions` table
6
+ * (002_bindings_sessions.ts) was created with ZERO indexes on `node_id` — its
7
+ * only index is the `id` PRIMARY-KEY autoindex. The "latest session per node"
8
+ * subquery `(SELECT s2.id FROM sessions s2 WHERE s2.node_id = ? ORDER BY … LIMIT 1)`
9
+ * is therefore a FULL SCAN of `sessions`, and it appears PER NODE at THREE sites
10
+ * on the hot `/api/ps` path — multiplied by the rig-level N+1 (getEntries loops
11
+ * rigs), one poll scanned `sessions` many times over (the 0.6-0.9s wedge at the
12
+ * host shape). The three sites, and their ORDER BY (why the index is 3-column):
13
+ * - ps-projection.ts:157 ORDER BY created_at DESC, id DESC ← the load-bearing shape
14
+ * - node-inventory.ts:442 ORDER BY id DESC
15
+ * - ps-projection.ts:256 ORDER BY id DESC
16
+ *
17
+ * INDEX SHAPE = (node_id, created_at DESC, id DESC) — arch RULING (B), decided
18
+ * by FIXTURE-MEASURED evidence, NOT preference. Measured before/after on the real
19
+ * incident fixture (24 rigs / 175 nodes / 445 sessions) — evidence:
20
+ * missions/release-0.4.6/slices/01-fs1-daemon-read-path-hardening/proof/
21
+ * perf-hardening-evidence/W1.1-sessions-index-measure-2026-07-06-dev44-driver2.md
22
+ * - id-DESC sites (:442, :256): full-scan → covering seek, ~63x (0.677s→0.011s / 52.5k evals).
23
+ * - created_at site (:157): under a 2-col (node_id, id DESC) index it SEARCHes
24
+ * node_id but keeps a TEMP B-TREE sort (~18.6x); under THIS 3-col index it is
25
+ * `SEARCH … USING COVERING INDEX` with NO sort (~95x, 0.856s→0.009s) — the
26
+ * measured ~5x that decided the shape.
27
+ * - Bound proven at 10x scale (4450 sessions): full-scan 8.4s (grows with data)
28
+ * vs seek 0.024s (~flat) = ~350x. CREATE INDEX = 0.013s, safe on populated data.
29
+ * The 3-column index leads with `node_id` (the equality seek), so the two id-DESC
30
+ * sites still get the node_id seek (full-scan eliminated); their residual is a
31
+ * per-node sort over ~2-3 rows (445 sessions / 175 nodes) — arch-accepted as noise.
32
+ * ONE index by ruling: this migration WIDENS to the 3-column shape and never grows
33
+ * a sibling (a second index = write amplification + space for no measured need).
34
+ *
35
+ * CREATE INDEX IF NOT EXISTS is idempotent + safe on a live/populated table
36
+ * (SQLite builds it in one pass; no schema/data change).
37
+ *
38
+ * Sibling audit (arch D1.1): the snapshots(rig_id, created_at) subqueries in the
39
+ * rigs projection are a separate index-audit item in W1, not this migration.
40
+ *
41
+ * Number 053: main shipped 051_workflow_resume and FAC-1 reserves
42
+ * 052_workflow_instance_bound_rig, so FS-1's index migration renumbered
43
+ * 051→053 (orch deconflict 2026-07-06; re-verify the free slot against the
44
+ * final merged tree at rebase/proof time). The index NAME + shape are unchanged.
45
+ */
46
+ export const sessionsNodeIdIndexSchema = {
47
+ name: "053_sessions_node_id_index.sql",
48
+ sql: `
49
+ CREATE INDEX IF NOT EXISTS idx_sessions_node_created_id
50
+ ON sessions(node_id, created_at DESC, id DESC);
51
+ `,
52
+ };
53
+ //# sourceMappingURL=053_sessions_node_id_index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"053_sessions_node_id_index.js","sourceRoot":"","sources":["../../../src/db/migrations/053_sessions_node_id_index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAc;IAClD,IAAI,EAAE,gCAAgC;IACtC,GAAG,EAAE;;;GAGJ;CACF,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { Migration } from "../migrate.js";
2
+ /**
3
+ * OPR.0.4.6 FS-1 (daemon read-path hardening, W2) — queue_transitions ARCHIVE
4
+ * sibling table (arch D3: ARCHIVE-never-plain-delete for the audit surface).
5
+ *
6
+ * `queue_transitions` is an AUDIT surface with product meaning (chain of record;
7
+ * `rig queue resolve` records decision text here) — INSERT-ONLY today, no prune
8
+ * path exists, so it grows unbounded (13691 rows on the incident fixture) and
9
+ * bloats backups + any transitions-reading surface. Arch D3 ruling: NEVER
10
+ * plain-delete; MOVE terminal-and-aged transitions into this sibling table, in
11
+ * the SAME transaction, so the audit trail is preserved (queryable in place),
12
+ * not lost.
13
+ *
14
+ * Schema MIRRORS `queue_transitions` (025) column-for-column so a move is a
15
+ * single `INSERT INTO queue_transitions_archive (...) SELECT ... FROM
16
+ * queue_transitions WHERE ...` + `DELETE`, both inside one txn. `transition_id`
17
+ * is a plain PRIMARY KEY (NOT AUTOINCREMENT) so archived rows KEEP their original
18
+ * id — audit references stay resolvable across the move. `archived_at` records
19
+ * when the row was archived (provenance; the source `ts` is preserved untouched).
20
+ *
21
+ * THE ACTIVE-FRONTIER INVARIANT (enforced by the W2 runner, not this migration):
22
+ * only transitions of TERMINAL qitems whose LAST transition is older than the
23
+ * retention window (default 30d) are ever moved; a non-terminal qitem's full
24
+ * transition history is never touched, at any age. The move runner + retention
25
+ * knobs land in the W2 maintenance-tick change; this migration is the sibling
26
+ * table + its read index only (additive; no data change to `queue_transitions`).
27
+ *
28
+ * Number 054: renumbered 052→054 with the FS-1 index (053) after the
29
+ * 051_workflow_resume ship + FAC-1's 052 reservation (orch deconflict
30
+ * 2026-07-06; re-verify against the final merged tree at rebase/proof time).
31
+ * The archive table + index names are unchanged.
32
+ */
33
+ export declare const queueTransitionsArchiveSchema: Migration;
34
+ //# sourceMappingURL=054_queue_transitions_archive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"054_queue_transitions_archive.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/054_queue_transitions_archive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAgB3C,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * OPR.0.4.6 FS-1 (daemon read-path hardening, W2) — queue_transitions ARCHIVE
3
+ * sibling table (arch D3: ARCHIVE-never-plain-delete for the audit surface).
4
+ *
5
+ * `queue_transitions` is an AUDIT surface with product meaning (chain of record;
6
+ * `rig queue resolve` records decision text here) — INSERT-ONLY today, no prune
7
+ * path exists, so it grows unbounded (13691 rows on the incident fixture) and
8
+ * bloats backups + any transitions-reading surface. Arch D3 ruling: NEVER
9
+ * plain-delete; MOVE terminal-and-aged transitions into this sibling table, in
10
+ * the SAME transaction, so the audit trail is preserved (queryable in place),
11
+ * not lost.
12
+ *
13
+ * Schema MIRRORS `queue_transitions` (025) column-for-column so a move is a
14
+ * single `INSERT INTO queue_transitions_archive (...) SELECT ... FROM
15
+ * queue_transitions WHERE ...` + `DELETE`, both inside one txn. `transition_id`
16
+ * is a plain PRIMARY KEY (NOT AUTOINCREMENT) so archived rows KEEP their original
17
+ * id — audit references stay resolvable across the move. `archived_at` records
18
+ * when the row was archived (provenance; the source `ts` is preserved untouched).
19
+ *
20
+ * THE ACTIVE-FRONTIER INVARIANT (enforced by the W2 runner, not this migration):
21
+ * only transitions of TERMINAL qitems whose LAST transition is older than the
22
+ * retention window (default 30d) are ever moved; a non-terminal qitem's full
23
+ * transition history is never touched, at any age. The move runner + retention
24
+ * knobs land in the W2 maintenance-tick change; this migration is the sibling
25
+ * table + its read index only (additive; no data change to `queue_transitions`).
26
+ *
27
+ * Number 054: renumbered 052→054 with the FS-1 index (053) after the
28
+ * 051_workflow_resume ship + FAC-1's 052 reservation (orch deconflict
29
+ * 2026-07-06; re-verify against the final merged tree at rebase/proof time).
30
+ * The archive table + index names are unchanged.
31
+ */
32
+ export const queueTransitionsArchiveSchema = {
33
+ name: "054_queue_transitions_archive.sql",
34
+ sql: `
35
+ CREATE TABLE IF NOT EXISTS queue_transitions_archive (
36
+ transition_id INTEGER PRIMARY KEY,
37
+ qitem_id TEXT NOT NULL,
38
+ ts TEXT NOT NULL,
39
+ state TEXT NOT NULL,
40
+ transition_note TEXT,
41
+ actor_session TEXT NOT NULL,
42
+ closure_reason TEXT,
43
+ closure_target TEXT,
44
+ archived_at TEXT NOT NULL
45
+ );
46
+ CREATE INDEX IF NOT EXISTS idx_queue_transitions_archive_qitem ON queue_transitions_archive(qitem_id, ts);
47
+ `,
48
+ };
49
+ //# sourceMappingURL=054_queue_transitions_archive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"054_queue_transitions_archive.js","sourceRoot":"","sources":["../../../src/db/migrations/054_queue_transitions_archive.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAc;IACtD,IAAI,EAAE,mCAAmC;IACzC,GAAG,EAAE;;;;;;;;;;;;;GAaJ;CACF,CAAC"}