@openrig/cli 0.4.2 → 0.4.4

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 (499) hide show
  1. package/daemon/assets/guidance/openrig-start.md +6 -0
  2. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +42 -2
  3. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +115 -0
  4. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +12 -12
  5. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +46 -0
  6. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  7. package/daemon/dist/adapters/codex-runtime-adapter.js +167 -3
  8. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  9. package/daemon/dist/adapters/tmux.d.ts +31 -0
  10. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  11. package/daemon/dist/adapters/tmux.js +62 -0
  12. package/daemon/dist/adapters/tmux.js.map +1 -1
  13. package/daemon/dist/build-info.d.ts +12 -0
  14. package/daemon/dist/build-info.d.ts.map +1 -0
  15. package/daemon/dist/build-info.js +11 -0
  16. package/daemon/dist/build-info.js.map +1 -0
  17. package/daemon/dist/db/migrations/045_resume_verification.d.ts +29 -0
  18. package/daemon/dist/db/migrations/045_resume_verification.d.ts.map +1 -0
  19. package/daemon/dist/db/migrations/045_resume_verification.js +34 -0
  20. package/daemon/dist/db/migrations/045_resume_verification.js.map +1 -0
  21. package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts +41 -0
  22. package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts.map +1 -0
  23. package/daemon/dist/db/migrations/046_seat_identity_verdicts.js +56 -0
  24. package/daemon/dist/db/migrations/046_seat_identity_verdicts.js.map +1 -0
  25. package/daemon/dist/db/migrations/047_events_node_type_index.d.ts +48 -0
  26. package/daemon/dist/db/migrations/047_events_node_type_index.d.ts.map +1 -0
  27. package/daemon/dist/db/migrations/047_events_node_type_index.js +52 -0
  28. package/daemon/dist/db/migrations/047_events_node_type_index.js.map +1 -0
  29. package/daemon/dist/db/migrations/048_queue_item_evidence_ref.d.ts +18 -0
  30. package/daemon/dist/db/migrations/048_queue_item_evidence_ref.d.ts.map +1 -0
  31. package/daemon/dist/db/migrations/048_queue_item_evidence_ref.js +22 -0
  32. package/daemon/dist/db/migrations/048_queue_item_evidence_ref.js.map +1 -0
  33. package/daemon/dist/domain/activity-endpoint.d.ts +25 -0
  34. package/daemon/dist/domain/activity-endpoint.d.ts.map +1 -0
  35. package/daemon/dist/domain/activity-endpoint.js +91 -0
  36. package/daemon/dist/domain/activity-endpoint.js.map +1 -0
  37. package/daemon/dist/domain/claim-service.d.ts +36 -0
  38. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  39. package/daemon/dist/domain/claim-service.js +90 -0
  40. package/daemon/dist/domain/claim-service.js.map +1 -1
  41. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +57 -0
  42. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  43. package/daemon/dist/domain/claude-compaction-enforcer.js +149 -3
  44. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  45. package/daemon/dist/domain/event-loop-monitor.d.ts +100 -0
  46. package/daemon/dist/domain/event-loop-monitor.d.ts.map +1 -0
  47. package/daemon/dist/domain/event-loop-monitor.js +127 -0
  48. package/daemon/dist/domain/event-loop-monitor.js.map +1 -0
  49. package/daemon/dist/domain/feed/attention-aggregator.d.ts +31 -0
  50. package/daemon/dist/domain/feed/attention-aggregator.d.ts.map +1 -0
  51. package/daemon/dist/domain/feed/attention-aggregator.js +119 -0
  52. package/daemon/dist/domain/feed/attention-aggregator.js.map +1 -0
  53. package/daemon/dist/domain/files/file-write-service.d.ts +11 -2
  54. package/daemon/dist/domain/files/file-write-service.d.ts.map +1 -1
  55. package/daemon/dist/domain/files/file-write-service.js +77 -0
  56. package/daemon/dist/domain/files/file-write-service.js.map +1 -1
  57. package/daemon/dist/domain/gate-predicate.d.ts +29 -0
  58. package/daemon/dist/domain/gate-predicate.d.ts.map +1 -0
  59. package/daemon/dist/domain/gate-predicate.js +73 -0
  60. package/daemon/dist/domain/gate-predicate.js.map +1 -0
  61. package/daemon/dist/domain/graph-projection.d.ts +7 -1
  62. package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
  63. package/daemon/dist/domain/graph-projection.js +19 -1
  64. package/daemon/dist/domain/graph-projection.js.map +1 -1
  65. package/daemon/dist/domain/hosts/fanout-contract.d.ts +33 -0
  66. package/daemon/dist/domain/hosts/fanout-contract.d.ts.map +1 -0
  67. package/daemon/dist/domain/hosts/fanout-contract.js +23 -0
  68. package/daemon/dist/domain/hosts/fanout-contract.js.map +1 -0
  69. package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts +49 -0
  70. package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -0
  71. package/daemon/dist/domain/hosts/hosts-registry-reader.js +165 -0
  72. package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -0
  73. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts +35 -0
  74. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts.map +1 -0
  75. package/daemon/dist/domain/hosts/remote-daemon-http.js +105 -0
  76. package/daemon/dist/domain/hosts/remote-daemon-http.js.map +1 -0
  77. package/daemon/dist/domain/human-route-enforcer.d.ts +71 -0
  78. package/daemon/dist/domain/human-route-enforcer.d.ts.map +1 -0
  79. package/daemon/dist/domain/human-route-enforcer.js +80 -0
  80. package/daemon/dist/domain/human-route-enforcer.js.map +1 -0
  81. package/daemon/dist/domain/mission-control/audit-browse.d.ts +8 -0
  82. package/daemon/dist/domain/mission-control/audit-browse.d.ts.map +1 -1
  83. package/daemon/dist/domain/mission-control/audit-browse.js +19 -0
  84. package/daemon/dist/domain/mission-control/audit-browse.js.map +1 -1
  85. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
  86. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
  87. package/daemon/dist/domain/mission-control/mission-control-action-log.js +4 -0
  88. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
  89. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +1 -1
  90. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -1
  91. package/daemon/dist/domain/mission-control/mission-control-read-layer.js +1 -1
  92. package/daemon/dist/domain/mission-control/mission-control-read-layer.js.map +1 -1
  93. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +28 -0
  94. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  95. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +125 -0
  96. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  97. package/daemon/dist/domain/node-inventory.d.ts +7 -1
  98. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  99. package/daemon/dist/domain/node-inventory.js +84 -5
  100. package/daemon/dist/domain/node-inventory.js.map +1 -1
  101. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +4 -0
  102. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
  103. package/daemon/dist/domain/periodic-snapshot-scheduler.js +11 -0
  104. package/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
  105. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +14 -0
  106. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -0
  107. package/daemon/dist/domain/policies/idle-gate-qitem.js +114 -0
  108. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -0
  109. package/daemon/dist/domain/ps-projection.d.ts +28 -1
  110. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  111. package/daemon/dist/domain/ps-projection.js +39 -0
  112. package/daemon/dist/domain/ps-projection.js.map +1 -1
  113. package/daemon/dist/domain/queue-repository.d.ts +25 -1
  114. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  115. package/daemon/dist/domain/queue-repository.js +111 -7
  116. package/daemon/dist/domain/queue-repository.js.map +1 -1
  117. package/daemon/dist/domain/restore-orchestrator.d.ts +8 -0
  118. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  119. package/daemon/dist/domain/restore-orchestrator.js +109 -27
  120. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  121. package/daemon/dist/domain/restore-plan-preview.d.ts +25 -1
  122. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  123. package/daemon/dist/domain/restore-plan-preview.js +72 -4
  124. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  125. package/daemon/dist/domain/resume-metadata-refresher.d.ts +44 -2
  126. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  127. package/daemon/dist/domain/resume-metadata-refresher.js +92 -6
  128. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  129. package/daemon/dist/domain/resume-token-capture.d.ts +50 -0
  130. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -0
  131. package/daemon/dist/domain/resume-token-capture.js +63 -0
  132. package/daemon/dist/domain/resume-token-capture.js.map +1 -0
  133. package/daemon/dist/domain/review/brief-spine.d.ts +19 -0
  134. package/daemon/dist/domain/review/brief-spine.d.ts.map +1 -0
  135. package/daemon/dist/domain/review/brief-spine.js +86 -0
  136. package/daemon/dist/domain/review/brief-spine.js.map +1 -0
  137. package/daemon/dist/domain/review/compose.d.ts +228 -0
  138. package/daemon/dist/domain/review/compose.d.ts.map +1 -0
  139. package/daemon/dist/domain/review/compose.js +773 -0
  140. package/daemon/dist/domain/review/compose.js.map +1 -0
  141. package/daemon/dist/domain/review/freeze.d.ts +31 -0
  142. package/daemon/dist/domain/review/freeze.d.ts.map +1 -0
  143. package/daemon/dist/domain/review/freeze.js +257 -0
  144. package/daemon/dist/domain/review/freeze.js.map +1 -0
  145. package/daemon/dist/domain/review/gather.d.ts +100 -0
  146. package/daemon/dist/domain/review/gather.d.ts.map +1 -0
  147. package/daemon/dist/domain/review/gather.js +676 -0
  148. package/daemon/dist/domain/review/gather.js.map +1 -0
  149. package/daemon/dist/domain/review/types.d.ts +258 -0
  150. package/daemon/dist/domain/review/types.d.ts.map +1 -0
  151. package/daemon/dist/domain/review/types.js +35 -0
  152. package/daemon/dist/domain/review/types.js.map +1 -0
  153. package/daemon/dist/domain/rig-status-compose.d.ts +62 -0
  154. package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -0
  155. package/daemon/dist/domain/rig-status-compose.js +149 -0
  156. package/daemon/dist/domain/rig-status-compose.js.map +1 -0
  157. package/daemon/dist/domain/rig-teardown.d.ts +3 -1
  158. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  159. package/daemon/dist/domain/rig-teardown.js +4 -19
  160. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  161. package/daemon/dist/domain/route-timing-recorder.d.ts +42 -0
  162. package/daemon/dist/domain/route-timing-recorder.d.ts.map +1 -0
  163. package/daemon/dist/domain/route-timing-recorder.js +62 -0
  164. package/daemon/dist/domain/route-timing-recorder.js.map +1 -0
  165. package/daemon/dist/domain/scope/scope-approve.d.ts +64 -0
  166. package/daemon/dist/domain/scope/scope-approve.d.ts.map +1 -0
  167. package/daemon/dist/domain/scope/scope-approve.js +153 -0
  168. package/daemon/dist/domain/scope/scope-approve.js.map +1 -0
  169. package/daemon/dist/domain/scope/scope-audit.d.ts +11 -1
  170. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  171. package/daemon/dist/domain/scope/scope-audit.js +203 -2
  172. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  173. package/daemon/dist/domain/seat-handover-service.d.ts +50 -7
  174. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  175. package/daemon/dist/domain/seat-handover-service.js +273 -33
  176. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  177. package/daemon/dist/domain/seat-identity-reconciler.d.ts +59 -0
  178. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -0
  179. package/daemon/dist/domain/seat-identity-reconciler.js +207 -0
  180. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -0
  181. package/daemon/dist/domain/seat-identity-store.d.ts +27 -0
  182. package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -0
  183. package/daemon/dist/domain/seat-identity-store.js +106 -0
  184. package/daemon/dist/domain/seat-identity-store.js.map +1 -0
  185. package/daemon/dist/domain/seat-switch-client-service.d.ts +57 -0
  186. package/daemon/dist/domain/seat-switch-client-service.d.ts.map +1 -0
  187. package/daemon/dist/domain/seat-switch-client-service.js +168 -0
  188. package/daemon/dist/domain/seat-switch-client-service.js.map +1 -0
  189. package/daemon/dist/domain/self-attach-service.d.ts +8 -0
  190. package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
  191. package/daemon/dist/domain/self-attach-service.js +20 -7
  192. package/daemon/dist/domain/self-attach-service.js.map +1 -1
  193. package/daemon/dist/domain/session-registry.d.ts +35 -4
  194. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  195. package/daemon/dist/domain/session-registry.js +89 -10
  196. package/daemon/dist/domain/session-registry.js.map +1 -1
  197. package/daemon/dist/domain/session-transport.d.ts +8 -1
  198. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  199. package/daemon/dist/domain/session-transport.js +143 -37
  200. package/daemon/dist/domain/session-transport.js.map +1 -1
  201. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  202. package/daemon/dist/domain/startup-orchestrator.js +34 -2
  203. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  204. package/daemon/dist/domain/startup-proof.d.ts +63 -0
  205. package/daemon/dist/domain/startup-proof.d.ts.map +1 -0
  206. package/daemon/dist/domain/startup-proof.js +165 -0
  207. package/daemon/dist/domain/startup-proof.js.map +1 -0
  208. package/daemon/dist/domain/successor-session-launcher.d.ts +103 -0
  209. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -0
  210. package/daemon/dist/domain/successor-session-launcher.js +246 -0
  211. package/daemon/dist/domain/successor-session-launcher.js.map +1 -0
  212. package/daemon/dist/domain/topology/multi-rig-launcher.d.ts +49 -0
  213. package/daemon/dist/domain/topology/multi-rig-launcher.d.ts.map +1 -0
  214. package/daemon/dist/domain/topology/multi-rig-launcher.js +132 -0
  215. package/daemon/dist/domain/topology/multi-rig-launcher.js.map +1 -0
  216. package/daemon/dist/domain/topology/remote-up-leaf.d.ts +29 -0
  217. package/daemon/dist/domain/topology/remote-up-leaf.d.ts.map +1 -0
  218. package/daemon/dist/domain/topology/remote-up-leaf.js +60 -0
  219. package/daemon/dist/domain/topology/remote-up-leaf.js.map +1 -0
  220. package/daemon/dist/domain/topology/topology-manifest.d.ts +34 -0
  221. package/daemon/dist/domain/topology/topology-manifest.d.ts.map +1 -0
  222. package/daemon/dist/domain/topology/topology-manifest.js +195 -0
  223. package/daemon/dist/domain/topology/topology-manifest.js.map +1 -0
  224. package/daemon/dist/domain/types.d.ts +86 -0
  225. package/daemon/dist/domain/types.d.ts.map +1 -1
  226. package/daemon/dist/domain/types.js +8 -0
  227. package/daemon/dist/domain/types.js.map +1 -1
  228. package/daemon/dist/domain/up-command-router.d.ts +1 -1
  229. package/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  230. package/daemon/dist/domain/up-command-router.js +34 -2
  231. package/daemon/dist/domain/up-command-router.js.map +1 -1
  232. package/daemon/dist/domain/user-settings/settings-store.d.ts +17 -0
  233. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  234. package/daemon/dist/domain/user-settings/settings-store.js +109 -0
  235. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  236. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +2 -2
  237. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  238. package/daemon/dist/domain/watchdog-jobs-repository.js +4 -0
  239. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  240. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  241. package/daemon/dist/domain/watchdog-policy-engine.js +19 -0
  242. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  243. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  244. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +51 -6
  245. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  246. package/daemon/dist/domain/workspace/workspace-doctor.d.ts +11 -0
  247. package/daemon/dist/domain/workspace/workspace-doctor.d.ts.map +1 -1
  248. package/daemon/dist/domain/workspace/workspace-doctor.js +82 -0
  249. package/daemon/dist/domain/workspace/workspace-doctor.js.map +1 -1
  250. package/daemon/dist/index.d.ts.map +1 -1
  251. package/daemon/dist/index.js +18 -1
  252. package/daemon/dist/index.js.map +1 -1
  253. package/daemon/dist/routes/activity.d.ts.map +1 -1
  254. package/daemon/dist/routes/activity.js +26 -0
  255. package/daemon/dist/routes/activity.js.map +1 -1
  256. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  257. package/daemon/dist/routes/agent-images.js +139 -0
  258. package/daemon/dist/routes/agent-images.js.map +1 -1
  259. package/daemon/dist/routes/compaction.d.ts +17 -0
  260. package/daemon/dist/routes/compaction.d.ts.map +1 -0
  261. package/daemon/dist/routes/compaction.js +125 -0
  262. package/daemon/dist/routes/compaction.js.map +1 -0
  263. package/daemon/dist/routes/config.d.ts.map +1 -1
  264. package/daemon/dist/routes/config.js +15 -6
  265. package/daemon/dist/routes/config.js.map +1 -1
  266. package/daemon/dist/routes/files.d.ts.map +1 -1
  267. package/daemon/dist/routes/files.js +45 -1
  268. package/daemon/dist/routes/files.js.map +1 -1
  269. package/daemon/dist/routes/mission-control.d.ts.map +1 -1
  270. package/daemon/dist/routes/mission-control.js +67 -2
  271. package/daemon/dist/routes/mission-control.js.map +1 -1
  272. package/daemon/dist/routes/queue.d.ts +8 -2
  273. package/daemon/dist/routes/queue.d.ts.map +1 -1
  274. package/daemon/dist/routes/queue.js +44 -4
  275. package/daemon/dist/routes/queue.js.map +1 -1
  276. package/daemon/dist/routes/restore-check.d.ts +10 -0
  277. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  278. package/daemon/dist/routes/restore-check.js +46 -37
  279. package/daemon/dist/routes/restore-check.js.map +1 -1
  280. package/daemon/dist/routes/review.d.ts +3 -0
  281. package/daemon/dist/routes/review.d.ts.map +1 -0
  282. package/daemon/dist/routes/review.js +169 -0
  283. package/daemon/dist/routes/review.js.map +1 -0
  284. package/daemon/dist/routes/rigs.d.ts.map +1 -1
  285. package/daemon/dist/routes/rigs.js +70 -1
  286. package/daemon/dist/routes/rigs.js.map +1 -1
  287. package/daemon/dist/routes/scope-approve.d.ts +3 -0
  288. package/daemon/dist/routes/scope-approve.d.ts.map +1 -0
  289. package/daemon/dist/routes/scope-approve.js +55 -0
  290. package/daemon/dist/routes/scope-approve.js.map +1 -0
  291. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  292. package/daemon/dist/routes/scope-audit.js +28 -1
  293. package/daemon/dist/routes/scope-audit.js.map +1 -1
  294. package/daemon/dist/routes/seat.d.ts.map +1 -1
  295. package/daemon/dist/routes/seat.js +53 -2
  296. package/daemon/dist/routes/seat.js.map +1 -1
  297. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  298. package/daemon/dist/routes/sessions.js +44 -9
  299. package/daemon/dist/routes/sessions.js.map +1 -1
  300. package/daemon/dist/routes/slices.d.ts.map +1 -1
  301. package/daemon/dist/routes/slices.js +49 -9
  302. package/daemon/dist/routes/slices.js.map +1 -1
  303. package/daemon/dist/routes/snapshots.d.ts.map +1 -1
  304. package/daemon/dist/routes/snapshots.js +16 -1
  305. package/daemon/dist/routes/snapshots.js.map +1 -1
  306. package/daemon/dist/routes/terminal-ws.d.ts.map +1 -1
  307. package/daemon/dist/routes/terminal-ws.js +58 -21
  308. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  309. package/daemon/dist/routes/transport.d.ts.map +1 -1
  310. package/daemon/dist/routes/transport.js +12 -5
  311. package/daemon/dist/routes/transport.js.map +1 -1
  312. package/daemon/dist/routes/up.d.ts.map +1 -1
  313. package/daemon/dist/routes/up.js +84 -0
  314. package/daemon/dist/routes/up.js.map +1 -1
  315. package/daemon/dist/routes/workspace.js +2 -2
  316. package/daemon/dist/server.d.ts +33 -0
  317. package/daemon/dist/server.d.ts.map +1 -1
  318. package/daemon/dist/server.js +41 -1
  319. package/daemon/dist/server.js.map +1 -1
  320. package/daemon/dist/startup.d.ts +1 -0
  321. package/daemon/dist/startup.d.ts.map +1 -1
  322. package/daemon/dist/startup.js +108 -20
  323. package/daemon/dist/startup.js.map +1 -1
  324. package/daemon/docs/reference/agent-startup-guide.md +1 -1
  325. package/daemon/docs/reference/product-factory-vps-runbook.md +132 -0
  326. package/daemon/docs/reference/sdlc-conventions.md +187 -0
  327. package/daemon/specs/agents/conveyor/builder/agent.yaml +1 -1
  328. package/daemon/specs/agents/conveyor/builder/guidance/role.md +1 -0
  329. package/daemon/specs/agents/conveyor/lead/agent.yaml +1 -1
  330. package/daemon/specs/agents/conveyor/lead/guidance/role.md +1 -0
  331. package/daemon/specs/agents/conveyor/planner/agent.yaml +1 -1
  332. package/daemon/specs/agents/conveyor/planner/guidance/role.md +1 -0
  333. package/daemon/specs/agents/conveyor/reviewer/agent.yaml +1 -1
  334. package/daemon/specs/agents/conveyor/reviewer/guidance/role.md +1 -0
  335. package/daemon/specs/agents/design/product-designer/agent.yaml +1 -1
  336. package/daemon/specs/agents/design/product-designer/guidance/role.md +1 -0
  337. package/daemon/specs/agents/development/implementer/agent.yaml +1 -1
  338. package/daemon/specs/agents/development/implementer/guidance/role.md +1 -0
  339. package/daemon/specs/agents/development/qa/agent.yaml +1 -1
  340. package/daemon/specs/agents/development/qa/guidance/role.md +1 -0
  341. package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +1 -1
  342. package/daemon/specs/agents/orchestration/orchestrator/guidance/role.md +1 -0
  343. package/daemon/specs/agents/product-management/pm/agent.yaml +1 -0
  344. package/daemon/specs/agents/product-management/pm/guidance/role.md +13 -0
  345. package/daemon/specs/agents/review/independent-reviewer/agent.yaml +1 -1
  346. package/daemon/specs/agents/review/independent-reviewer/guidance/role.md +1 -0
  347. package/daemon/specs/agents/shared/agent.yaml +2 -0
  348. package/daemon/specs/agents/shared/skills/core/mission-slice-sop/SKILL.md +115 -0
  349. package/daemon/specs/agents/shared/skills/core/openrig-operator/SKILL.md +4 -4
  350. package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +69 -23
  351. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +3 -3
  352. package/daemon/specs/rigs/focused/pm-team/CULTURE.md +4 -0
  353. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +1 -1
  354. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +1 -1
  355. package/daemon/specs/rigs/preview/product-team/CULTURE.md +4 -0
  356. package/dist/build-info.d.ts +8 -0
  357. package/dist/build-info.d.ts.map +1 -0
  358. package/dist/build-info.js +11 -0
  359. package/dist/build-info.js.map +1 -0
  360. package/dist/commands/compact.d.ts +15 -0
  361. package/dist/commands/compact.d.ts.map +1 -0
  362. package/dist/commands/compact.js +62 -0
  363. package/dist/commands/compact.js.map +1 -0
  364. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  365. package/dist/commands/config-init-workspace.js +20 -4
  366. package/dist/commands/config-init-workspace.js.map +1 -1
  367. package/dist/commands/daemon.d.ts.map +1 -1
  368. package/dist/commands/daemon.js +18 -2
  369. package/dist/commands/daemon.js.map +1 -1
  370. package/dist/commands/doctor.js +2 -2
  371. package/dist/commands/doctor.js.map +1 -1
  372. package/dist/commands/expand.js +1 -1
  373. package/dist/commands/expand.js.map +1 -1
  374. package/dist/commands/file.d.ts +7 -0
  375. package/dist/commands/file.d.ts.map +1 -0
  376. package/dist/commands/file.js +77 -0
  377. package/dist/commands/file.js.map +1 -0
  378. package/dist/commands/fork.d.ts +4 -0
  379. package/dist/commands/fork.d.ts.map +1 -0
  380. package/dist/commands/fork.js +101 -0
  381. package/dist/commands/fork.js.map +1 -0
  382. package/dist/commands/host.d.ts +34 -0
  383. package/dist/commands/host.d.ts.map +1 -0
  384. package/dist/commands/host.js +448 -0
  385. package/dist/commands/host.js.map +1 -0
  386. package/dist/commands/launch.d.ts.map +1 -1
  387. package/dist/commands/launch.js +34 -4
  388. package/dist/commands/launch.js.map +1 -1
  389. package/dist/commands/proof.d.ts +54 -0
  390. package/dist/commands/proof.d.ts.map +1 -0
  391. package/dist/commands/proof.js +311 -0
  392. package/dist/commands/proof.js.map +1 -0
  393. package/dist/commands/ps.d.ts +41 -7
  394. package/dist/commands/ps.d.ts.map +1 -1
  395. package/dist/commands/ps.js +357 -135
  396. package/dist/commands/ps.js.map +1 -1
  397. package/dist/commands/queue.d.ts +6 -0
  398. package/dist/commands/queue.d.ts.map +1 -1
  399. package/dist/commands/queue.js +154 -4
  400. package/dist/commands/queue.js.map +1 -1
  401. package/dist/commands/reconcile-session.d.ts.map +1 -1
  402. package/dist/commands/reconcile-session.js +2 -2
  403. package/dist/commands/reconcile-session.js.map +1 -1
  404. package/dist/commands/restore-check.d.ts.map +1 -1
  405. package/dist/commands/restore-check.js +93 -0
  406. package/dist/commands/restore-check.js.map +1 -1
  407. package/dist/commands/scope.d.ts.map +1 -1
  408. package/dist/commands/scope.js +191 -4
  409. package/dist/commands/scope.js.map +1 -1
  410. package/dist/commands/seat.d.ts +17 -0
  411. package/dist/commands/seat.d.ts.map +1 -1
  412. package/dist/commands/seat.js +145 -32
  413. package/dist/commands/seat.js.map +1 -1
  414. package/dist/commands/send.d.ts.map +1 -1
  415. package/dist/commands/send.js +161 -11
  416. package/dist/commands/send.js.map +1 -1
  417. package/dist/commands/start.d.ts +5 -0
  418. package/dist/commands/start.d.ts.map +1 -1
  419. package/dist/commands/start.js.map +1 -1
  420. package/dist/commands/startup-proof.d.ts +24 -0
  421. package/dist/commands/startup-proof.d.ts.map +1 -0
  422. package/dist/commands/startup-proof.js +100 -0
  423. package/dist/commands/startup-proof.js.map +1 -0
  424. package/dist/commands/unclaim.js +2 -2
  425. package/dist/commands/unclaim.js.map +1 -1
  426. package/dist/commands/up.d.ts +2 -0
  427. package/dist/commands/up.d.ts.map +1 -1
  428. package/dist/commands/up.js +79 -2
  429. package/dist/commands/up.js.map +1 -1
  430. package/dist/commands/watchdog.js +2 -2
  431. package/dist/commands/watchdog.js.map +1 -1
  432. package/dist/commands/workspace.js +6 -6
  433. package/dist/commands/workspace.js.map +1 -1
  434. package/dist/config-store.d.ts +4 -0
  435. package/dist/config-store.d.ts.map +1 -1
  436. package/dist/config-store.js +68 -0
  437. package/dist/config-store.js.map +1 -1
  438. package/dist/cross-host-executor.d.ts +1 -0
  439. package/dist/cross-host-executor.d.ts.map +1 -1
  440. package/dist/cross-host-executor.js +4 -1
  441. package/dist/cross-host-executor.js.map +1 -1
  442. package/dist/daemon-lifecycle.d.ts +23 -0
  443. package/dist/daemon-lifecycle.d.ts.map +1 -1
  444. package/dist/daemon-lifecycle.js +54 -6
  445. package/dist/daemon-lifecycle.js.map +1 -1
  446. package/dist/host-registry.d.ts +9 -0
  447. package/dist/host-registry.d.ts.map +1 -1
  448. package/dist/host-registry.js +32 -2
  449. package/dist/host-registry.js.map +1 -1
  450. package/dist/index.d.ts +5 -0
  451. package/dist/index.d.ts.map +1 -1
  452. package/dist/index.js +15 -1
  453. package/dist/index.js.map +1 -1
  454. package/dist/lib/codex-auth.d.ts +24 -0
  455. package/dist/lib/codex-auth.d.ts.map +1 -1
  456. package/dist/lib/codex-auth.js +89 -17
  457. package/dist/lib/codex-auth.js.map +1 -1
  458. package/dist/lib/file-transfer.d.ts +89 -0
  459. package/dist/lib/file-transfer.d.ts.map +1 -0
  460. package/dist/lib/file-transfer.js +300 -0
  461. package/dist/lib/file-transfer.js.map +1 -0
  462. package/dist/lib/hosts/fanout-contract.d.ts +33 -0
  463. package/dist/lib/hosts/fanout-contract.d.ts.map +1 -0
  464. package/dist/lib/hosts/fanout-contract.js +23 -0
  465. package/dist/lib/hosts/fanout-contract.js.map +1 -0
  466. package/dist/lib/scope/scope-audit.d.ts +11 -1
  467. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  468. package/dist/lib/scope/scope-audit.js +203 -2
  469. package/dist/lib/scope/scope-audit.js.map +1 -1
  470. package/dist/lib/scope/templates.d.ts +1 -0
  471. package/dist/lib/scope/templates.d.ts.map +1 -1
  472. package/dist/lib/scope/templates.js +9 -0
  473. package/dist/lib/scope/templates.js.map +1 -1
  474. package/dist/lib/scope-templates/backlog-deprecation.md +16 -0
  475. package/dist/lib/scope-templates/backlog-tech-debt.md +16 -0
  476. package/dist/lib/scope-templates/bug-fix.md +16 -0
  477. package/dist/lib/scope-templates/implementation-prd.md +33 -0
  478. package/dist/lib/scope-templates/mission-placeholder.md +41 -0
  479. package/dist/lib/scope-templates/mission-progress.md +2 -0
  480. package/dist/lib/scope-templates/mission-release.md +41 -0
  481. package/dist/lib/scope-templates/placeholder.md +12 -4
  482. package/dist/lib/scope-templates/proof.md +6 -0
  483. package/dist/lib/scope-templates/release-feature.md +14 -6
  484. package/dist/lib/scope-templates/research.md +16 -0
  485. package/dist/lib/scope-templates/slice-progress.md +2 -0
  486. package/dist/openrig-compat.d.ts +19 -0
  487. package/dist/openrig-compat.d.ts.map +1 -1
  488. package/dist/openrig-compat.js +31 -1
  489. package/dist/openrig-compat.js.map +1 -1
  490. package/dist/version.d.ts +5 -0
  491. package/dist/version.d.ts.map +1 -1
  492. package/dist/version.js +11 -1
  493. package/dist/version.js.map +1 -1
  494. package/package.json +1 -1
  495. package/ui/dist/assets/index-D69ZhNIr.js +598 -0
  496. package/ui/dist/assets/index-DJYun-8d.css +32 -0
  497. package/ui/dist/index.html +23 -2
  498. package/ui/dist/assets/index-CnqRX7A3.css +0 -32
  499. package/ui/dist/assets/index-CtL9jXFt.js +0 -582
@@ -0,0 +1,54 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * `rig proof` — the proof-drop write path (OPR.0.4.4.19 FR-8 + FR-11;
4
+ * conventions C1 + C2 + C8, D2 attestation).
5
+ *
6
+ * CLI-side filesystem only (plan-review + arch-lead confirmed): the drop
7
+ * validates the C1 header AT THE MOMENT THE EVIDENCE IS IN-HAND, writes the
8
+ * artifact into the slice's proof/ dir, and echoes the parsed header (the
9
+ * seat sees what the composer will see). No daemon involvement, no synthetic
10
+ * qitems, no DB writes.
11
+ *
12
+ * LOAD-BEARING boundaries:
13
+ * - Validation applies ONLY to drops made through this path. An artifact
14
+ * written by any other means (raw file write, existing workflows) is
15
+ * NEVER blocked at write time — the backstop is `rig scope audit`
16
+ * (FR-10), not a write-path gate on ordinary file I/O.
17
+ * - The D2 proof contract + self_check are AGENT JUDGMENT recorded here;
18
+ * the drop path ADVISES (exit 0) and never blocks on them. There is no
19
+ * configuration that makes any advisory blocking (BR-7).
20
+ */
21
+ /** C1 ratified closed sets (BR-4 — extending them is a convention change
22
+ * owned by pm-lead, not a code decision). */
23
+ export declare const C1_ARTIFACT_TYPES: readonly ["guard", "qa", "rev1-r1", "rev1-r2", "adjudication"];
24
+ export declare const C1_VERDICTS: readonly ["CLEAR", "BLOCKING", "CONCERNING", "PASS", "NOT-CLEAR"];
25
+ export interface C1Header {
26
+ slice: string;
27
+ candidate_sha: string;
28
+ artifact_type: string;
29
+ verdict: string;
30
+ money_evidence: string;
31
+ /** D2 optional attestation fields — advise-never-block. */
32
+ evidences?: string[];
33
+ self_check?: string;
34
+ }
35
+ export interface C1ValidationResult {
36
+ ok: boolean;
37
+ missing: string[];
38
+ invalid: Array<{
39
+ field: string;
40
+ value: string;
41
+ allowed: readonly string[];
42
+ }>;
43
+ }
44
+ /** Validate the five required C1 fields + closed sets. Pure. */
45
+ export declare function validateC1Header(header: Partial<C1Header>): C1ValidationResult;
46
+ /**
47
+ * Parse the pinned `## Proof contract` section out of a slice's
48
+ * IMPLEMENTATION-PRD.md (the C7 pinned name; PM-lane authored). Returns the
49
+ * promised items (checkbox-item form, one promised item per line), or null
50
+ * when the slice declares no contract (tier-1 degrade — zero noise).
51
+ */
52
+ export declare function parseProofContract(prdContent: string): string[] | null;
53
+ export declare function proofCommand(): Command;
54
+ //# sourceMappingURL=proof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/commands/proof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;;;;;;;;;;;;;;;GAkBG;AAEH;8CAC8C;AAC9C,eAAO,MAAM,iBAAiB,gEAAiE,CAAC;AAChG,eAAO,MAAM,WAAW,mEAAoE,CAAC;AAK7F,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC9E;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,kBAAkB,CAc9E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAYtE;AAMD,wBAAgB,YAAY,IAAI,OAAO,CA0PtC"}
@@ -0,0 +1,311 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { Command } from "commander";
4
+ import YAML from "yaml";
5
+ import { findSlice, resolveMissionsRoot } from "../lib/scope/scope-fs.js";
6
+ import { ScopeCliError } from "../lib/scope/types.js";
7
+ /**
8
+ * `rig proof` — the proof-drop write path (OPR.0.4.4.19 FR-8 + FR-11;
9
+ * conventions C1 + C2 + C8, D2 attestation).
10
+ *
11
+ * CLI-side filesystem only (plan-review + arch-lead confirmed): the drop
12
+ * validates the C1 header AT THE MOMENT THE EVIDENCE IS IN-HAND, writes the
13
+ * artifact into the slice's proof/ dir, and echoes the parsed header (the
14
+ * seat sees what the composer will see). No daemon involvement, no synthetic
15
+ * qitems, no DB writes.
16
+ *
17
+ * LOAD-BEARING boundaries:
18
+ * - Validation applies ONLY to drops made through this path. An artifact
19
+ * written by any other means (raw file write, existing workflows) is
20
+ * NEVER blocked at write time — the backstop is `rig scope audit`
21
+ * (FR-10), not a write-path gate on ordinary file I/O.
22
+ * - The D2 proof contract + self_check are AGENT JUDGMENT recorded here;
23
+ * the drop path ADVISES (exit 0) and never blocks on them. There is no
24
+ * configuration that makes any advisory blocking (BR-7).
25
+ */
26
+ /** C1 ratified closed sets (BR-4 — extending them is a convention change
27
+ * owned by pm-lead, not a code decision). */
28
+ export const C1_ARTIFACT_TYPES = ["guard", "qa", "rev1-r1", "rev1-r2", "adjudication"];
29
+ export const C1_VERDICTS = ["CLEAR", "BLOCKING", "CONCERNING", "PASS", "NOT-CLEAR"];
30
+ /** Video extensions for the C8 UX advisory (screencast evidence). */
31
+ const VIDEO_EXTENSIONS = new Set([".mp4", ".mov", ".webm", ".m4v", ".avi", ".mkv"]);
32
+ /** Validate the five required C1 fields + closed sets. Pure. */
33
+ export function validateC1Header(header) {
34
+ const missing = [];
35
+ for (const field of ["slice", "candidate_sha", "artifact_type", "verdict", "money_evidence"]) {
36
+ const value = header[field];
37
+ if (typeof value !== "string" || value.trim().length === 0)
38
+ missing.push(field);
39
+ }
40
+ const invalid = [];
41
+ if (header.artifact_type && !C1_ARTIFACT_TYPES.includes(header.artifact_type)) {
42
+ invalid.push({ field: "artifact_type", value: header.artifact_type, allowed: C1_ARTIFACT_TYPES });
43
+ }
44
+ if (header.verdict && !C1_VERDICTS.includes(header.verdict)) {
45
+ invalid.push({ field: "verdict", value: header.verdict, allowed: C1_VERDICTS });
46
+ }
47
+ return { ok: missing.length === 0 && invalid.length === 0, missing, invalid };
48
+ }
49
+ /**
50
+ * Parse the pinned `## Proof contract` section out of a slice's
51
+ * IMPLEMENTATION-PRD.md (the C7 pinned name; PM-lane authored). Returns the
52
+ * promised items (checkbox-item form, one promised item per line), or null
53
+ * when the slice declares no contract (tier-1 degrade — zero noise).
54
+ */
55
+ export function parseProofContract(prdContent) {
56
+ const lines = prdContent.split("\n");
57
+ const start = lines.findIndex((l) => /^##\s+Proof contract\s*$/i.test(l.trim()));
58
+ if (start === -1)
59
+ return null;
60
+ const items = [];
61
+ for (let i = start + 1; i < lines.length; i++) {
62
+ const line = lines[i];
63
+ if (/^##\s/.test(line))
64
+ break; // next section
65
+ const m = line.match(/^\s*-\s*(?:\[[ xX]\]\s*)?(.+\S)\s*$/);
66
+ if (m)
67
+ items.push(m[1]);
68
+ }
69
+ return items;
70
+ }
71
+ function isVideoFile(filePath) {
72
+ return VIDEO_EXTENSIONS.has(path.extname(filePath).toLowerCase());
73
+ }
74
+ export function proofCommand() {
75
+ const cmd = new Command("proof").description("Proof artifacts — drop gate/proof evidence into a slice's proof/ dir with the machine-readable C1 header, validated at the natural moment (OPR.0.4.4.19 FR-8). The drop is the SDLC's proof leg: --evidences joins it to the slice's ## Proof contract items (what the Living Notes DELIVERED section pairs + renders); proof-lock afterwards via rig scope slice approve --scope delivery. Conventions SSOT: docs/reference/sdlc-conventions.md.");
76
+ cmd.option("--workspace <path>", "Override workspace root (else cwd walk or $OPENRIG_WORK_ROOT)");
77
+ cmd
78
+ .command("add <slice-path>")
79
+ .description("Drop a proof artifact: authors the C1 frontmatter from flags, writes <slice>/proof/<name>, echoes the parsed header. Contract/self-check/C8 outputs are advisories (exit 0) — never gates.")
80
+ .option("--mission <name>", "Hint mission when slice-path is just NN-slug")
81
+ .requiredOption("--artifact-type <type>", `C1 artifact_type, one of: ${C1_ARTIFACT_TYPES.join(" | ")}`)
82
+ .requiredOption("--verdict <verdict>", `C1 verdict, one of: ${C1_VERDICTS.join(" | ")}`)
83
+ .requiredOption("--candidate-sha <sha>", "C1 candidate_sha — the join key (convention C2): the proven candidate tip this artifact judges")
84
+ .requiredOption("--money-evidence <line>", "C1 money_evidence — the one line of money evidence")
85
+ .option("--slice-id <dot-id>", "C1 slice dot-ID (defaults to the slice frontmatter id)")
86
+ .option("--file <path>", "Artifact body from a file (mutually exclusive with --body)")
87
+ .option("--body <text>", "Artifact body inline (mutually exclusive with --file)")
88
+ .option("--name <filename>", "Artifact filename in proof/ (defaults to the --file basename, else <artifact-type>-<verdict>-<UTC>.md)")
89
+ .option("--evidences <refs>", "D2 attestation: comma-separated proof-contract item refs this artifact covers (item text or 1-based index)")
90
+ .option("--self-check <text>", "D2 attestation: the agent's assertion that it LOOKED at the evidence and confirmed it shows the claim")
91
+ .option("--media <refs>", "Corrective §3.4: comma-separated media refs (relative to the slice proof/ dir) this drop stands behind — appended to the artifact body as markdown refs so the composer curates them into delivered.items[].proof")
92
+ .option("--json", "JSON output for agents")
93
+ .action(async (slicePath, opts, command) => {
94
+ const json = Boolean(opts.json);
95
+ const advisories = [];
96
+ const warns = [];
97
+ try {
98
+ if (opts.file && opts.body) {
99
+ throw new ScopeCliError({
100
+ fact: "Both --file and --body were provided.",
101
+ consequence: "The artifact body is ambiguous.",
102
+ action: "Pass exactly one of --file <path> or --body <text>.",
103
+ });
104
+ }
105
+ const parentOpts = (command.parent?.opts() ?? {});
106
+ const missionsRoot = resolveMissionsRoot({ override: parentOpts.workspace });
107
+ const slice = findSlice(missionsRoot, slicePath, opts.mission ?? null);
108
+ // Resolve the artifact body.
109
+ let body = "";
110
+ if (opts.file) {
111
+ if (!fs.existsSync(opts.file)) {
112
+ throw new ScopeCliError({
113
+ fact: `--file ${opts.file} does not exist.`,
114
+ consequence: "No artifact body to drop.",
115
+ action: "Point --file at the evidence file, or use --body.",
116
+ });
117
+ }
118
+ body = fs.readFileSync(opts.file, "utf8");
119
+ }
120
+ else if (opts.body) {
121
+ body = opts.body;
122
+ }
123
+ // Corrective §3.4 — attach curated media refs (proof/-relative) to
124
+ // the artifact body as markdown refs; the composer projects them
125
+ // into delivered.items[].proof for the covered deliverables. Same
126
+ // containment discipline as --name: nothing outside the slice dir.
127
+ const sliceProofDir = path.join(slice.absPath, "proof");
128
+ const mediaRefs = opts.media
129
+ ? opts.media.split(",").map((s) => s.trim()).filter(Boolean)
130
+ : [];
131
+ const mediaLines = [];
132
+ for (const ref of mediaRefs) {
133
+ if (path.isAbsolute(ref)) {
134
+ throw new ScopeCliError({
135
+ fact: `--media ref '${ref}' is absolute.`,
136
+ consequence: "The artifact was NOT dropped — proof media is co-located slice content (FR-5), referenced relative to the slice's proof/ dir.",
137
+ action: "Copy the media into the slice's proof/ dir and pass the relative name.",
138
+ });
139
+ }
140
+ const resolved = path.resolve(sliceProofDir, ref);
141
+ if (!resolved.startsWith(path.resolve(slice.absPath) + path.sep)) {
142
+ throw new ScopeCliError({
143
+ fact: `--media ref '${ref}' resolves outside the slice dir.`,
144
+ consequence: "The artifact was NOT dropped — out-of-slice media can never be served or frozen with the review (FR-5).",
145
+ action: "Move the media under the slice dir (proof/ is the natural home) and re-run.",
146
+ });
147
+ }
148
+ if (!fs.existsSync(resolved)) {
149
+ warns.push(`--media ref '${ref}' does not exist yet (${resolved}) — the review will show it as unavailable until the file lands`);
150
+ }
151
+ const ext = path.extname(ref).toLowerCase();
152
+ if (VIDEO_EXTENSIONS.has(ext))
153
+ mediaLines.push(`<video src="${ref}"></video>`);
154
+ else
155
+ mediaLines.push(`![${ref}](${ref})`);
156
+ }
157
+ if (mediaLines.length > 0) {
158
+ body = `${body.trimEnd()}\n\n## Media\n\n${mediaLines.join("\n")}\n`;
159
+ }
160
+ // Author the C1 header from flags + slice identity.
161
+ const header = {
162
+ slice: opts.sliceId ?? (typeof slice.id === "string" ? slice.id : undefined),
163
+ candidate_sha: opts.candidateSha,
164
+ artifact_type: opts.artifactType,
165
+ verdict: opts.verdict,
166
+ money_evidence: opts.moneyEvidence,
167
+ };
168
+ const evidences = opts.evidences
169
+ ? opts.evidences.split(",").map((s) => s.trim()).filter(Boolean)
170
+ : undefined;
171
+ if (evidences && evidences.length > 0)
172
+ header.evidences = evidences;
173
+ if (opts.selfCheck)
174
+ header.self_check = opts.selfCheck;
175
+ // Validate the closed sets AT DROP TIME (while the evidence is
176
+ // in-hand) — the one REJECTING validation this path performs.
177
+ const validation = validateC1Header(header);
178
+ if (!validation.ok) {
179
+ const parts = [];
180
+ if (validation.missing.length > 0)
181
+ parts.push(`missing required C1 field(s): ${validation.missing.join(", ")}`);
182
+ for (const inv of validation.invalid) {
183
+ parts.push(`${inv.field}='${inv.value}' is not in the ratified closed set (${inv.allowed.join(" | ")})`);
184
+ }
185
+ throw new ScopeCliError({
186
+ fact: `C1 header invalid — ${parts.join("; ")}.`,
187
+ consequence: "The artifact was NOT dropped (post-hoc reconstruction is the failure mode this fights).",
188
+ action: "Provide the named fields with allowed values and re-run while the evidence is in-hand. Extending the closed sets is a pm-lead convention change (BR-4).",
189
+ });
190
+ }
191
+ // D2 — validate evidences refs against the slice's declared proof
192
+ // contract (unknown refs = a named WARN, never a rejection), and
193
+ // emit the coverage/self_check ADVISORY when a contract exists.
194
+ const prdPath = path.join(slice.absPath, "IMPLEMENTATION-PRD.md");
195
+ const contractItems = fs.existsSync(prdPath)
196
+ ? parseProofContract(fs.readFileSync(prdPath, "utf8"))
197
+ : null;
198
+ let coveredItems = [];
199
+ if (contractItems && contractItems.length > 0) {
200
+ if (evidences && evidences.length > 0) {
201
+ for (const ref of evidences) {
202
+ const byIndex = /^\d+$/.test(ref) ? contractItems[Number.parseInt(ref, 10) - 1] : undefined;
203
+ const byText = contractItems.find((item) => item === ref);
204
+ const match = byText ?? byIndex;
205
+ if (match)
206
+ coveredItems.push(match);
207
+ else
208
+ warns.push(`evidences ref '${ref}' matches no declared proof-contract item (known items: ${contractItems.map((_, i) => i + 1).join(", ")} or exact text)`);
209
+ }
210
+ }
211
+ if (coveredItems.length === 0 || !header.self_check) {
212
+ const uncovered = contractItems.filter((item) => !coveredItems.includes(item));
213
+ const reasons = [];
214
+ if (coveredItems.length === 0)
215
+ reasons.push("this drop covers no declared contract item");
216
+ if (!header.self_check)
217
+ reasons.push("self_check attestation omitted");
218
+ advisories.push(`ADVISORY (D2, advise-never-block): ${reasons.join(" and ")}. ` +
219
+ `Uncovered contract item(s): ${uncovered.map((u) => `"${u}"`).join(", ")}. ` +
220
+ `The Packet-2 promised→delivered join will show these as MISSING (the ▲ insufficient-proof signal).`);
221
+ }
222
+ }
223
+ // FR-11 / C8 — the UX-slice video advisory (SHOULD/steer, exit 0,
224
+ // no configuration can make it blocking). Trigger: slice frontmatter
225
+ // ux-change: true (spec-time flag; never a qitem tag, never
226
+ // diff-inference). Satisfied when this drop is a video or the
227
+ // proof/ dir already holds one.
228
+ const uxChange = slice.frontmatter["ux-change"] === true;
229
+ if (uxChange) {
230
+ const proofDir = path.join(slice.absPath, "proof");
231
+ const existingVideo = fs.existsSync(proofDir)
232
+ && fs.readdirSync(proofDir).some((f) => isVideoFile(f));
233
+ const droppingVideo = (opts.file ? isVideoFile(opts.file) : false) || mediaRefs.some((r) => isVideoFile(r));
234
+ if (!existingVideo && !droppingVideo) {
235
+ advisories.push("ADVISORY (C8, SHOULD/steer): this slice is UX-tagged (ux-change: true) and its proof set has no video. " +
236
+ "UX-change slices SHOULD produce screenshot + video together — capture a screencast via the agent-browser-screencast method " +
237
+ "and hold it to the money-shot-edit bar. This never blocks a drop.");
238
+ }
239
+ }
240
+ // Write the artifact: YAML frontmatter + body into proof/.
241
+ const proofDir = path.join(slice.absPath, "proof");
242
+ const defaultName = `${opts.artifactType}-${opts.verdict}-${new Date().toISOString().replace(/[:.]/g, "-")}.md`;
243
+ const fileName = opts.name ?? (opts.file ? path.basename(opts.file) : defaultName);
244
+ // rev1-r2 BLOCKING fix (a7dedd93 review): --name is a FILENAME, never
245
+ // a path. Reject separators / dot-dot / absolute shapes BEFORE any
246
+ // filesystem effect, so the drop can only land inside proof/ (the
247
+ // FR-8 contract) — a traversal name like ../README.md must not reach
248
+ // slice control files.
249
+ if (fileName.includes("/") || fileName.includes("\\") || fileName.startsWith("..") || path.isAbsolute(fileName)) {
250
+ throw new ScopeCliError({
251
+ fact: `--name '${fileName}' is not a plain filename (path separators, '..', and absolute paths are rejected).`,
252
+ consequence: "The artifact was NOT dropped — proof drops land inside the slice proof/ dir only (FR-8).",
253
+ action: "Pass a bare filename like qa-clear.md; the drop path owns the directory.",
254
+ });
255
+ }
256
+ const target = path.resolve(proofDir, fileName);
257
+ // Defense-in-depth: even a name that slips the shape check must
258
+ // resolve INSIDE proof/ (same containment discipline as
259
+ // scope-approve's path-escape guard).
260
+ if (!target.startsWith(path.resolve(proofDir) + path.sep)) {
261
+ throw new ScopeCliError({
262
+ fact: `--name '${fileName}' resolves outside the slice proof/ dir.`,
263
+ consequence: "The artifact was NOT dropped.",
264
+ action: "Pass a bare filename; the drop path owns the directory.",
265
+ });
266
+ }
267
+ fs.mkdirSync(proofDir, { recursive: true });
268
+ const frontmatter = YAML.stringify(header).trimEnd();
269
+ fs.writeFileSync(target, `---\n${frontmatter}\n---\n\n${body}`, "utf8");
270
+ // Echo the parsed header — the seat sees what the composer will see.
271
+ const echo = {
272
+ dropped: path.relative(process.cwd(), target),
273
+ header: header,
274
+ contractItemsDeclared: contractItems?.length ?? 0,
275
+ contractItemsCovered: coveredItems,
276
+ mediaRefs,
277
+ warnings: warns,
278
+ advisories,
279
+ };
280
+ if (json) {
281
+ console.log(JSON.stringify(echo, null, 2));
282
+ }
283
+ else {
284
+ console.log(`Dropped: ${echo.dropped}`);
285
+ console.log(`Parsed C1 header:\n${frontmatter}`);
286
+ if (contractItems)
287
+ console.log(`Proof contract: ${coveredItems.length}/${contractItems.length} item(s) covered by this drop.`);
288
+ for (const w of warns)
289
+ console.error(`warning: ${w}`);
290
+ for (const a of advisories)
291
+ console.error(a);
292
+ }
293
+ // Advisories + warns NEVER change the exit code (BR-7).
294
+ }
295
+ catch (err) {
296
+ if (err instanceof ScopeCliError) {
297
+ if (json) {
298
+ console.log(JSON.stringify({ ok: false, error: { fact: err.fact, consequence: err.consequence, action: err.action } }, null, 2));
299
+ }
300
+ else {
301
+ console.error(`${err.fact}\n${err.consequence}\n${err.action}`);
302
+ }
303
+ process.exitCode = 1;
304
+ return;
305
+ }
306
+ throw err;
307
+ }
308
+ });
309
+ return cmd;
310
+ }
311
+ //# sourceMappingURL=proof.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.js","sourceRoot":"","sources":["../../src/commands/proof.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AAEH;8CAC8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAU,CAAC;AAChG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,CAAU,CAAC;AAE7F,qEAAqE;AACrE,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAA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  import { loadHostRegistry } from "../host-registry.js";
4
4
  import { runCrossHostCommand, type RunCrossHostCommandOpts } from "../cross-host-executor.js";
5
+ interface PsCliOptions {
6
+ json?: boolean;
7
+ nodes?: boolean;
8
+ full?: boolean;
9
+ verbose?: boolean;
10
+ limit?: string;
11
+ fields?: string;
12
+ summary?: boolean;
13
+ filter?: string;
14
+ host?: string;
15
+ allHosts?: boolean;
16
+ hosts?: string;
17
+ active?: boolean;
18
+ running?: boolean;
19
+ allRigs?: boolean;
20
+ rig?: string;
21
+ session?: string;
22
+ /** OPR.0.3.3.19 - include archived rigs (default excludes them). Parity
23
+ * with `rig stream list --include-archived`. */
24
+ includeArchived?: boolean;
25
+ }
5
26
  export interface PsDeps extends StatusDeps {
6
27
  /**
7
28
  * Cross-host hooks. Both default to the production loaders/executors; tests
@@ -13,14 +34,27 @@ export interface PsDeps extends StatusDeps {
13
34
  crossHostRun?: (host: Parameters<typeof runCrossHostCommand>[0], argv: readonly string[], opts?: RunCrossHostCommandOpts) => ReturnType<typeof runCrossHostCommand>;
14
35
  }
15
36
  /**
16
- * `rig ps`list running rigs and optionally their nodes.
37
+ * OPR.0.4.4.21 FR-2/FR-3THE centralized disclosure-ladder validator.
38
+ * Runs BEFORE the local/HTTP-host/SSH/fan-out dispatch split so every path
39
+ * obeys one grammar (qa1 plan-review: remote mode bypassed the session-rig
40
+ * injection and fanned wide). Principle (arch-ratified): IMPLICIT SCOPE
41
+ * DEFAULTS DON'T CROSS HOST BOUNDARIES — the session-rig default has no
42
+ * stable referent on a remote host (a same-named rig there would silently
43
+ * misresolve), so remote per-node views are explicit-or-error.
44
+ * Returns the teaching error text, or null when the invocation is valid.
45
+ */
46
+ export declare function validatePsLadder(opts: PsCliOptions, callerRig: string | undefined): string | null;
47
+ /**
48
+ * `rig ps` — the consolidated fleet map + explicit disclosure ladder.
17
49
  *
18
- * L3-followup adds CLI-side shaping flags (`--limit`, `--fields`, `--summary`,
19
- * `--filter`, `--full`) for context-window-safe output on large hosts. Default
20
- * `rig ps` (human) truncates to ~50 rigs with an explicit footer naming totals
21
- * and the `--full` opt-out. Default `rig ps --json` keeps the bare-array shape
22
- * for back-compat; the truncation/envelope shape only applies when at least
23
- * one of `--limit`/`--summary`/`--fields`/`--filter` is specified.
50
+ * OPR.0.4.4.21: the default is ALL active rigs, one compact O(rigs) row each
51
+ * (the current-rig-only default is retired). The token-safety invariant: no
52
+ * invocation returns per-node detail across all rigs unless explicitly
53
+ * flagged (--nodes -A), and even then rows are projected unless --full.
54
+ * Default `rig ps --json` keeps the bare-array shape for back-compat; the
55
+ * truncation/envelope shape only applies when at least one of
56
+ * `--limit`/`--summary`/`--fields`/`--filter` is specified.
24
57
  */
25
58
  export declare function psCommand(depsOverride?: PsDeps): Command;
59
+ export {};
26
60
  //# sourceMappingURL=ps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ps.d.ts","sourceRoot":"","sources":["../../src/commands/ps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAsH,MAAM,qBAAqB,CAAC;AAC3K,OAAO,EAAE,mBAAmB,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAqM9F,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAC/C,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,IAAI,CAAC,EAAE,uBAAuB,KAC3B,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;CAC7C;AAgSD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,YAAY,CAAC,EA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