@openrig/cli 0.5.6 → 0.5.8

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 (562) hide show
  1. package/daemon/assets/plugins/openrig-core/README.md +1 -1
  2. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +25 -2
  3. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +95 -8
  4. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +9 -1
  5. package/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/SKILL.md +34 -0
  6. package/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs +170 -0
  7. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +1 -4
  8. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +3 -3
  9. package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +4 -9
  10. package/daemon/assets/vm-preview-fixtures/workflows/sample-basic-loop.yaml +3 -3
  11. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  12. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +40 -15
  13. package/daemon/context-packs/skills/applying-a-permission-policy/SKILL.md +120 -0
  14. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +10 -0
  15. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +166 -0
  16. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +18 -0
  17. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +261 -0
  18. package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +495 -0
  19. package/daemon/context-packs/skills/claude-compaction-restore/templates/compact-instruction.md +1 -0
  20. package/daemon/context-packs/skills/claude-compaction-restore/templates/post-compact-restore-instruction.md +1 -0
  21. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  22. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/SKILL.md +1 -1
  23. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +1 -4
  31. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +120 -355
  33. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +9 -3
  34. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
  35. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
  36. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
  37. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/delegating-work/SKILL.md +43 -0
  44. package/daemon/context-packs/skills/delegating-work/manifest.yaml +10 -0
  45. package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +318 -0
  46. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +10 -0
  47. package/daemon/context-packs/skills/loading-addressable-markdown/SKILL.md +34 -0
  48. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +12 -0
  49. package/daemon/context-packs/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs +170 -0
  50. package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +94 -0
  51. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +10 -0
  52. package/daemon/context-packs/skills/openrig-operating-model/SKILL.md +397 -0
  53. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +30 -0
  54. package/daemon/context-packs/skills/openrig-operating-model/scripts/compose.py +572 -0
  55. package/daemon/context-packs/skills/openrig-operating-model/scripts/scaffold.sh +34 -0
  56. package/daemon/context-packs/skills/openrig-operating-model/scripts/trace-due.sh +32 -0
  57. package/daemon/context-packs/skills/openrig-operating-model/scripts/trace-stamp.sh +5 -0
  58. package/daemon/context-packs/skills/openrig-operating-model/scripts/trunk-diff.sh +18 -0
  59. package/daemon/context-packs/skills/openrig-operating-model/templates/LEARNED.md +40 -0
  60. package/daemon/context-packs/skills/openrig-operating-model/templates/NOTES.md +9 -0
  61. package/daemon/context-packs/skills/openrig-operating-model/templates/PLAYBOOK.md +5 -0
  62. package/daemon/context-packs/skills/openrig-operating-model/templates/SOP.md +24 -0
  63. package/daemon/context-packs/skills/openrig-operating-model/templates/SPEC.md +54 -0
  64. package/daemon/context-packs/skills/openrig-user/SKILL.md +1374 -0
  65. package/daemon/context-packs/skills/openrig-user/manifest.yaml +10 -0
  66. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/CHANGELOG.md +64 -0
  67. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/SKILL.md +250 -0
  68. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +12 -0
  69. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/pm/requirements-writer/SKILL.md +21 -15
  75. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +3 -3
  76. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/pods/orchestration-team/SKILL.md +1 -1
  79. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/pods/review-team/SKILL.md +1 -1
  82. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  83. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  84. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  85. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  86. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  87. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  88. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  89. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  90. package/daemon/context-packs/skills/queue-handoff/SKILL.md +192 -0
  91. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +10 -0
  92. package/daemon/context-packs/skills/refocusing/SKILL.md +31 -0
  93. package/daemon/context-packs/skills/refocusing/manifest.yaml +14 -0
  94. package/daemon/context-packs/skills/refocusing/references/refocus.md +22 -0
  95. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +264 -0
  96. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/CHANGELOG.md +48 -0
  97. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/SKILL.md +231 -0
  98. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +12 -0
  99. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +151 -0
  100. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +16 -0
  101. package/daemon/context-packs/skills/seat-continuity-and-handover/references/apprentice-evidence-toolkit.md +32 -0
  102. package/daemon/context-packs/skills/seat-continuity-and-handover/references/apprentice-successor-seat-cutover.md +256 -0
  103. package/daemon/context-packs/skills/seat-continuity-and-handover/references/orchestrator-role.md +40 -0
  104. package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +163 -0
  105. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +10 -0
  106. package/daemon/context-packs/skills/software-for-agents/SKILL.md +187 -0
  107. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +10 -0
  108. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  109. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  110. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  111. package/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
  112. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  113. package/daemon/dist/adapters/tmux.d.ts +6 -5
  114. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  115. package/daemon/dist/adapters/tmux.js +29 -12
  116. package/daemon/dist/adapters/tmux.js.map +1 -1
  117. package/daemon/dist/build-info.js +3 -3
  118. package/daemon/dist/builtins/workflow-specs/basic-loop.yaml +3 -3
  119. package/daemon/dist/builtins/workflow-specs/conveyor.yaml +1 -1
  120. package/daemon/dist/builtins/workflow-specs/factory-rsi.yaml +1 -1
  121. package/daemon/dist/db/all-migrations.d.ts +1 -1
  122. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  123. package/daemon/dist/db/all-migrations.js +6 -2
  124. package/daemon/dist/db/all-migrations.js.map +1 -1
  125. package/daemon/dist/db/migrations/077_node_session_source.d.ts +4 -0
  126. package/daemon/dist/db/migrations/077_node_session_source.d.ts.map +1 -0
  127. package/daemon/dist/db/migrations/077_node_session_source.js +6 -0
  128. package/daemon/dist/db/migrations/077_node_session_source.js.map +1 -0
  129. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
  130. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
  131. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
  132. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
  133. package/daemon/dist/domain/active-occupant.d.ts +6 -0
  134. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  135. package/daemon/dist/domain/active-occupant.js +14 -0
  136. package/daemon/dist/domain/active-occupant.js.map +1 -1
  137. package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  138. package/daemon/dist/domain/context-packs/manifest-parser.js +5 -6
  139. package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  140. package/daemon/dist/domain/context-packs/profile-composer.d.ts +1 -1
  141. package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  142. package/daemon/dist/domain/context-packs/profile-composer.js +2 -2
  143. package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  144. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +3 -1
  145. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -1
  146. package/daemon/dist/domain/context-packs/profile-source-resolver.js +3 -2
  147. package/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -1
  148. package/daemon/dist/domain/current-work.d.ts +73 -0
  149. package/daemon/dist/domain/current-work.d.ts.map +1 -0
  150. package/daemon/dist/domain/current-work.js +225 -0
  151. package/daemon/dist/domain/current-work.js.map +1 -0
  152. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  153. package/daemon/dist/domain/execution-view.js +215 -13
  154. package/daemon/dist/domain/execution-view.js.map +1 -1
  155. package/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
  156. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  157. package/daemon/dist/domain/gateway/human-registry.js +113 -18
  158. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  159. package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
  160. package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
  161. package/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
  162. package/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
  163. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
  164. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  165. package/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
  166. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  167. package/daemon/dist/domain/policies/types.d.ts +12 -0
  168. package/daemon/dist/domain/policies/types.d.ts.map +1 -1
  169. package/daemon/dist/domain/queue-repository.d.ts +37 -2
  170. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  171. package/daemon/dist/domain/queue-repository.js +171 -16
  172. package/daemon/dist/domain/queue-repository.js.map +1 -1
  173. package/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
  174. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  175. package/daemon/dist/domain/queue-wake-repository.js +33 -0
  176. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  177. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  178. package/daemon/dist/domain/reconciler.js +4 -1
  179. package/daemon/dist/domain/reconciler.js.map +1 -1
  180. package/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
  181. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  182. package/daemon/dist/domain/rehydrate-eligibility.js +34 -0
  183. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  184. package/daemon/dist/domain/restore-orchestrator.d.ts +9 -0
  185. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  186. package/daemon/dist/domain/restore-orchestrator.js +32 -0
  187. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  188. package/daemon/dist/domain/restore-plan-preview.js +2 -2
  189. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  190. package/daemon/dist/domain/rig-lifecycle-service.d.ts +24 -4
  191. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  192. package/daemon/dist/domain/rig-lifecycle-service.js +116 -6
  193. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  194. package/daemon/dist/domain/rig-repository.d.ts +2 -1
  195. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  196. package/daemon/dist/domain/rig-repository.js +7 -0
  197. package/daemon/dist/domain/rig-repository.js.map +1 -1
  198. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  199. package/daemon/dist/domain/rigspec-exporter.js +4 -0
  200. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  201. package/daemon/dist/domain/rigspec-instantiator.d.ts +15 -9
  202. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  203. package/daemon/dist/domain/rigspec-instantiator.js +68 -83
  204. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  205. package/daemon/dist/domain/rigspec-schema.d.ts +5 -1
  206. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  207. package/daemon/dist/domain/rigspec-schema.js +41 -2
  208. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  209. package/daemon/dist/domain/seat-attention-reconciler.d.ts +32 -1
  210. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  211. package/daemon/dist/domain/seat-attention-reconciler.js +183 -4
  212. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  213. package/daemon/dist/domain/session-transport.d.ts +5 -0
  214. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  215. package/daemon/dist/domain/session-transport.js +33 -7
  216. package/daemon/dist/domain/session-transport.js.map +1 -1
  217. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  218. package/daemon/dist/domain/snapshot-capture.js +4 -2
  219. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  220. package/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
  221. package/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
  222. package/daemon/dist/domain/topology-defaults-installer.js +27 -0
  223. package/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
  224. package/daemon/dist/domain/types.d.ts +3 -1
  225. package/daemon/dist/domain/types.d.ts.map +1 -1
  226. package/daemon/dist/domain/types.js.map +1 -1
  227. package/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  228. package/daemon/dist/domain/up-command-router.js +19 -0
  229. package/daemon/dist/domain/up-command-router.js.map +1 -1
  230. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
  231. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  232. package/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
  233. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  234. package/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -0
  235. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  236. package/daemon/dist/domain/watchdog-policy-engine.js +47 -0
  237. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  238. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  239. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +37 -2
  240. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  241. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  242. package/daemon/dist/routes/context-packs.js +146 -6
  243. package/daemon/dist/routes/context-packs.js.map +1 -1
  244. package/daemon/dist/routes/queue.d.ts.map +1 -1
  245. package/daemon/dist/routes/queue.js +31 -10
  246. package/daemon/dist/routes/queue.js.map +1 -1
  247. package/daemon/dist/routes/rigs.js +17 -6
  248. package/daemon/dist/routes/rigs.js.map +1 -1
  249. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  250. package/daemon/dist/routes/rigspec.js +37 -0
  251. package/daemon/dist/routes/rigspec.js.map +1 -1
  252. package/daemon/dist/routes/sessions.js +7 -3
  253. package/daemon/dist/routes/sessions.js.map +1 -1
  254. package/daemon/dist/routes/up.js +10 -3
  255. package/daemon/dist/routes/up.js.map +1 -1
  256. package/daemon/dist/startup.d.ts.map +1 -1
  257. package/daemon/dist/startup.js +19 -7
  258. package/daemon/dist/startup.js.map +1 -1
  259. package/daemon/docs/reference/agent-spec.md +34 -1
  260. package/daemon/docs/reference/chain-file-convention.md +17 -12
  261. package/daemon/docs/reference/mission-install.md +23 -2
  262. package/daemon/docs/reference/product-journey-sdlc.md +305 -0
  263. package/daemon/docs/reference/release-boundary.md +29 -5
  264. package/daemon/docs/reference/sdlc-conventions.md +15 -2
  265. package/daemon/specs/agents/apps/vault-specialist/agent.yaml +1 -1
  266. package/daemon/specs/agents/apps/vault-specialist/guidance/role.md +0 -1
  267. package/daemon/specs/agents/conveyor/builder/agent.yaml +1 -1
  268. package/daemon/specs/agents/conveyor/builder/guidance/role.md +0 -1
  269. package/daemon/specs/agents/conveyor/lead/agent.yaml +1 -1
  270. package/daemon/specs/agents/conveyor/lead/guidance/role.md +0 -3
  271. package/daemon/specs/agents/conveyor/planner/agent.yaml +1 -1
  272. package/daemon/specs/agents/conveyor/planner/guidance/role.md +0 -1
  273. package/daemon/specs/agents/design/product-designer/agent.yaml +3 -4
  274. package/daemon/specs/agents/design/product-designer/guidance/role.md +0 -3
  275. package/daemon/specs/agents/development/implementer/agent.yaml +3 -4
  276. package/daemon/specs/agents/development/implementer/guidance/role.md +0 -3
  277. package/daemon/specs/agents/development/qa/agent.yaml +4 -4
  278. package/daemon/specs/agents/development/qa/guidance/role.md +1 -4
  279. package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +1 -1
  280. package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +1 -1
  281. package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +3 -4
  282. package/daemon/specs/agents/orchestration/orchestrator/guidance/role.md +0 -4
  283. package/daemon/specs/agents/review/independent-reviewer/agent.yaml +3 -4
  284. package/daemon/specs/agents/review/independent-reviewer/guidance/role.md +0 -3
  285. package/daemon/specs/agents/shared/agent.yaml +2 -10
  286. package/daemon/specs/agents/shared/skills/core/agent-startup-and-context-ingestion/SKILL.md +1 -1
  287. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +1 -4
  288. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +120 -355
  289. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
  290. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
  291. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
  292. package/daemon/specs/agents/shared/skills/pm/requirements-writer/SKILL.md +21 -15
  293. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +1 -1
  294. package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +1 -1
  295. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/agent.yaml +1 -1
  296. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/guidance/role.md +2 -3
  297. package/daemon/specs/rigs/preview/product-team/topology/instance/CRAFT.md +4 -4
  298. package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +3 -3
  299. package/dist/build-info.js +3 -3
  300. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  301. package/dist/commands/config-init-workspace.js +38 -3
  302. package/dist/commands/config-init-workspace.js.map +1 -1
  303. package/dist/commands/context.d.ts.map +1 -1
  304. package/dist/commands/context.js +90 -7
  305. package/dist/commands/context.js.map +1 -1
  306. package/dist/commands/create.d.ts +4 -0
  307. package/dist/commands/create.d.ts.map +1 -0
  308. package/dist/commands/create.js +84 -0
  309. package/dist/commands/create.js.map +1 -0
  310. package/dist/commands/grow.d.ts +4 -0
  311. package/dist/commands/grow.d.ts.map +1 -0
  312. package/dist/commands/grow.js +182 -0
  313. package/dist/commands/grow.js.map +1 -0
  314. package/dist/commands/import.d.ts.map +1 -1
  315. package/dist/commands/import.js +27 -1
  316. package/dist/commands/import.js.map +1 -1
  317. package/dist/commands/remove.d.ts.map +1 -1
  318. package/dist/commands/remove.js +9 -1
  319. package/dist/commands/remove.js.map +1 -1
  320. package/dist/commands/rig.d.ts.map +1 -1
  321. package/dist/commands/rig.js +48 -1
  322. package/dist/commands/rig.js.map +1 -1
  323. package/dist/commands/scope.d.ts.map +1 -1
  324. package/dist/commands/scope.js +21 -2
  325. package/dist/commands/scope.js.map +1 -1
  326. package/dist/commands/shrink.d.ts.map +1 -1
  327. package/dist/commands/shrink.js +6 -1
  328. package/dist/commands/shrink.js.map +1 -1
  329. package/dist/commands/topology-default-agent.d.ts +4 -0
  330. package/dist/commands/topology-default-agent.d.ts.map +1 -0
  331. package/dist/commands/topology-default-agent.js +13 -0
  332. package/dist/commands/topology-default-agent.js.map +1 -0
  333. package/dist/commands/walk.d.ts.map +1 -1
  334. package/dist/commands/walk.js +3 -0
  335. package/dist/commands/walk.js.map +1 -1
  336. package/dist/commands/watchdog.d.ts.map +1 -1
  337. package/dist/commands/watchdog.js +51 -3
  338. package/dist/commands/watchdog.js.map +1 -1
  339. package/dist/front-door.d.ts.map +1 -1
  340. package/dist/front-door.js +16 -4
  341. package/dist/front-door.js.map +1 -1
  342. package/dist/index.d.ts +2 -0
  343. package/dist/index.d.ts.map +1 -1
  344. package/dist/index.js +4 -0
  345. package/dist/index.js.map +1 -1
  346. package/dist/lib/topology-trace.d.ts +3 -2
  347. package/dist/lib/topology-trace.d.ts.map +1 -1
  348. package/dist/lib/topology-trace.js +12 -2
  349. package/dist/lib/topology-trace.js.map +1 -1
  350. package/dist/lib/work-install.d.ts +39 -0
  351. package/dist/lib/work-install.d.ts.map +1 -0
  352. package/dist/lib/work-install.js +312 -0
  353. package/dist/lib/work-install.js.map +1 -0
  354. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  355. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
  356. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  357. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +6 -5
  358. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
  359. package/node_modules/@openrig/daemon/dist/adapters/tmux.js +29 -12
  360. package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
  361. package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
  362. package/node_modules/@openrig/daemon/dist/builtins/workflow-specs/basic-loop.yaml +3 -3
  363. package/node_modules/@openrig/daemon/dist/builtins/workflow-specs/conveyor.yaml +1 -1
  364. package/node_modules/@openrig/daemon/dist/builtins/workflow-specs/factory-rsi.yaml +1 -1
  365. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts +1 -1
  366. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts.map +1 -1
  367. package/node_modules/@openrig/daemon/dist/db/all-migrations.js +6 -2
  368. package/node_modules/@openrig/daemon/dist/db/all-migrations.js.map +1 -1
  369. package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.d.ts +4 -0
  370. package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.d.ts.map +1 -0
  371. package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.js +6 -0
  372. package/node_modules/@openrig/daemon/dist/db/migrations/077_node_session_source.js.map +1 -0
  373. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
  374. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
  375. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
  376. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
  377. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts +6 -0
  378. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  379. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js +14 -0
  380. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js.map +1 -1
  381. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  382. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js +5 -6
  383. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  384. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts +1 -1
  385. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  386. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js +2 -2
  387. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  388. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +3 -1
  389. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -1
  390. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js +3 -2
  391. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -1
  392. package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts +73 -0
  393. package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts.map +1 -0
  394. package/node_modules/@openrig/daemon/dist/domain/current-work.js +225 -0
  395. package/node_modules/@openrig/daemon/dist/domain/current-work.js.map +1 -0
  396. package/node_modules/@openrig/daemon/dist/domain/execution-view.d.ts.map +1 -1
  397. package/node_modules/@openrig/daemon/dist/domain/execution-view.js +215 -13
  398. package/node_modules/@openrig/daemon/dist/domain/execution-view.js.map +1 -1
  399. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
  400. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  401. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js +113 -18
  402. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  403. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
  404. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
  405. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
  406. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
  407. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
  408. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  409. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
  410. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  411. package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts +12 -0
  412. package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts.map +1 -1
  413. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts +37 -2
  414. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  415. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js +171 -16
  416. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js.map +1 -1
  417. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
  418. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  419. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js +33 -0
  420. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  421. package/node_modules/@openrig/daemon/dist/domain/reconciler.d.ts.map +1 -1
  422. package/node_modules/@openrig/daemon/dist/domain/reconciler.js +4 -1
  423. package/node_modules/@openrig/daemon/dist/domain/reconciler.js.map +1 -1
  424. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
  425. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  426. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js +34 -0
  427. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  428. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts +9 -0
  429. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  430. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js +32 -0
  431. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  432. package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js +2 -2
  433. package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  434. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.d.ts +24 -4
  435. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  436. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js +116 -6
  437. package/node_modules/@openrig/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  438. package/node_modules/@openrig/daemon/dist/domain/rig-repository.d.ts +2 -1
  439. package/node_modules/@openrig/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  440. package/node_modules/@openrig/daemon/dist/domain/rig-repository.js +7 -0
  441. package/node_modules/@openrig/daemon/dist/domain/rig-repository.js.map +1 -1
  442. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  443. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js +4 -0
  444. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  445. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +15 -9
  446. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  447. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +68 -83
  448. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  449. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts +5 -1
  450. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  451. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js +41 -2
  452. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js.map +1 -1
  453. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts +32 -1
  454. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  455. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js +183 -4
  456. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  457. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts +5 -0
  458. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts.map +1 -1
  459. package/node_modules/@openrig/daemon/dist/domain/session-transport.js +33 -7
  460. package/node_modules/@openrig/daemon/dist/domain/session-transport.js.map +1 -1
  461. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  462. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js +4 -2
  463. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js.map +1 -1
  464. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
  465. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
  466. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js +27 -0
  467. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
  468. package/node_modules/@openrig/daemon/dist/domain/types.d.ts +3 -1
  469. package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
  470. package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
  471. package/node_modules/@openrig/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  472. package/node_modules/@openrig/daemon/dist/domain/up-command-router.js +19 -0
  473. package/node_modules/@openrig/daemon/dist/domain/up-command-router.js.map +1 -1
  474. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
  475. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  476. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
  477. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  478. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -0
  479. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  480. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js +47 -0
  481. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  482. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  483. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js +37 -2
  484. package/node_modules/@openrig/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  485. package/node_modules/@openrig/daemon/dist/routes/context-packs.d.ts.map +1 -1
  486. package/node_modules/@openrig/daemon/dist/routes/context-packs.js +146 -6
  487. package/node_modules/@openrig/daemon/dist/routes/context-packs.js.map +1 -1
  488. package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
  489. package/node_modules/@openrig/daemon/dist/routes/queue.js +31 -10
  490. package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
  491. package/node_modules/@openrig/daemon/dist/routes/rigs.js +17 -6
  492. package/node_modules/@openrig/daemon/dist/routes/rigs.js.map +1 -1
  493. package/node_modules/@openrig/daemon/dist/routes/rigspec.d.ts.map +1 -1
  494. package/node_modules/@openrig/daemon/dist/routes/rigspec.js +37 -0
  495. package/node_modules/@openrig/daemon/dist/routes/rigspec.js.map +1 -1
  496. package/node_modules/@openrig/daemon/dist/routes/sessions.js +7 -3
  497. package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
  498. package/node_modules/@openrig/daemon/dist/routes/up.js +10 -3
  499. package/node_modules/@openrig/daemon/dist/routes/up.js.map +1 -1
  500. package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
  501. package/node_modules/@openrig/daemon/dist/startup.js +19 -7
  502. package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
  503. package/node_modules/@openrig/daemon/package.json +1 -1
  504. package/package.json +2 -1
  505. package/tui/dist/daemon-client.d.ts +2 -0
  506. package/tui/dist/daemon-client.d.ts.map +1 -1
  507. package/tui/dist/daemon-client.js +4 -0
  508. package/tui/dist/daemon-client.js.map +1 -1
  509. package/tui/dist/execution/execution-model.d.ts +19 -0
  510. package/tui/dist/execution/execution-model.d.ts.map +1 -0
  511. package/tui/dist/execution/execution-model.js +518 -0
  512. package/tui/dist/execution/execution-model.js.map +1 -0
  513. package/tui/dist/hydrate.d.ts +1 -1
  514. package/tui/dist/hydrate.d.ts.map +1 -1
  515. package/tui/dist/hydrate.js +6 -2
  516. package/tui/dist/hydrate.js.map +1 -1
  517. package/tui/dist/input.d.ts +7 -0
  518. package/tui/dist/input.d.ts.map +1 -1
  519. package/tui/dist/input.js +13 -0
  520. package/tui/dist/input.js.map +1 -1
  521. package/tui/dist/live.d.ts +10 -0
  522. package/tui/dist/live.d.ts.map +1 -1
  523. package/tui/dist/live.js +34 -1
  524. package/tui/dist/live.js.map +1 -1
  525. package/tui/dist/main.js +22 -3
  526. package/tui/dist/main.js.map +1 -1
  527. package/tui/dist/render.d.ts.map +1 -1
  528. package/tui/dist/render.js +13 -2
  529. package/tui/dist/render.js.map +1 -1
  530. package/tui/dist/scopes/scopes-model.d.ts +1 -0
  531. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  532. package/tui/dist/scopes/scopes-model.js +4 -2
  533. package/tui/dist/scopes/scopes-model.js.map +1 -1
  534. package/tui/dist/sections.js +2 -2
  535. package/tui/dist/sections.js.map +1 -1
  536. package/tui/dist/state.d.ts.map +1 -1
  537. package/tui/dist/state.js +15 -2
  538. package/tui/dist/state.js.map +1 -1
  539. package/tui/dist/stylize.js +2 -2
  540. package/tui/dist/stylize.js.map +1 -1
  541. package/tui/dist/types.d.ts +20 -0
  542. package/tui/dist/types.d.ts.map +1 -1
  543. package/daemon/context-packs/skills/process/brainstorming/OPENRIG.md +0 -48
  544. package/daemon/context-packs/skills/process/brainstorming/SKILL.md +0 -107
  545. package/daemon/context-packs/skills/process/brainstorming/manifest.yaml +0 -12
  546. package/daemon/context-packs/skills/process/executing-plans/OPENRIG.md +0 -56
  547. package/daemon/context-packs/skills/process/executing-plans/SKILL.md +0 -94
  548. package/daemon/context-packs/skills/process/executing-plans/manifest.yaml +0 -12
  549. package/daemon/context-packs/skills/process/using-superpowers/OPENRIG.md +0 -48
  550. package/daemon/context-packs/skills/process/using-superpowers/SKILL.md +0 -106
  551. package/daemon/context-packs/skills/process/using-superpowers/manifest.yaml +0 -12
  552. package/daemon/context-packs/skills/process/writing-plans/OPENRIG.md +0 -52
  553. package/daemon/context-packs/skills/process/writing-plans/SKILL.md +0 -126
  554. package/daemon/context-packs/skills/process/writing-plans/manifest.yaml +0 -12
  555. package/daemon/specs/agents/shared/skills/process/brainstorming/OPENRIG.md +0 -48
  556. package/daemon/specs/agents/shared/skills/process/brainstorming/SKILL.md +0 -107
  557. package/daemon/specs/agents/shared/skills/process/executing-plans/OPENRIG.md +0 -56
  558. package/daemon/specs/agents/shared/skills/process/executing-plans/SKILL.md +0 -94
  559. package/daemon/specs/agents/shared/skills/process/using-superpowers/OPENRIG.md +0 -48
  560. package/daemon/specs/agents/shared/skills/process/using-superpowers/SKILL.md +0 -106
  561. package/daemon/specs/agents/shared/skills/process/writing-plans/OPENRIG.md +0 -52
  562. package/daemon/specs/agents/shared/skills/process/writing-plans/SKILL.md +0 -126
@@ -0,0 +1,256 @@
1
+ # Apprentice-Successor Seat Cutover SOP
2
+
3
+ Status: operator-proven on 2026-08-28; curated on 2026-08-30 with the physical-seat correction
4
+
5
+ Use this runbook after an apprentice successor has completed its install, observation,
6
+ and acceptance gates and the authorized decision-maker has explicitly called the
7
+ cutover. It covers the mechanical transition from the temporary successor seat to a
8
+ stable desk seat while preserving the incumbent as wakeable memory.
9
+
10
+ This SOP does not decide whether a successor is ready. The desk, owner, or other
11
+ named authority owns that judgment. The operator owns the mechanics and proof.
12
+
13
+ ## Required Inputs
14
+
15
+ Record these on one durable operator baton before mutation:
16
+
17
+ - authoritative cutover instruction and decision-maker;
18
+ - target rig and host;
19
+ - stable target logical ID, node ID, and canonical session name;
20
+ - successor logical ID, node ID, canonical session name, and exact provider resume token;
21
+ - incumbent exact provider resume token;
22
+ - required runtime, model, cwd, `OPENRIG_HOME`, `OPENRIG_URL`, and managed runtime `PATH`;
23
+ - old-occupant disposition, including whether it remains wakeable;
24
+ - duty-custody artifact or ledger entry the successor must accept;
25
+ - queue rows or staged messages that must survive the swap;
26
+ - receipt destinations.
27
+
28
+ Do not infer a provider token from a label. Derive it from the live session record and
29
+ corroborate it against the active provider history file.
30
+
31
+ ## Invariants
32
+
33
+ 1. The stable seat identity stays stable. Successor lineage belongs in provenance, not
34
+ in a suffixed live seat name.
35
+ 2. The exact accepted provider history moves. No compact, summary, fork, or accidental
36
+ stale-history restore is allowed.
37
+ 3. Desk authority stays frozen from the incumbent's idle acknowledgment until the new
38
+ occupant passes its post-cutover self-check.
39
+ 4. The incumbent remains wakeable by its exact provider token when the ruled disposition
40
+ is advisory reserve. Preserving the canonical physical pane does not require preserving
41
+ the incumbent process in that pane.
42
+ 5. A staged prompt is not durable merely because it is visible in a pane. Reconcile it
43
+ against the outbox or another durable source before stopping that pane.
44
+ 6. Seat binding, provider history, process environment, queue identity, and Herder
45
+ client attachment are separate surfaces. Verify each one.
46
+ 7. A timed-out operation is indeterminate. Read back by effect before retrying.
47
+
48
+ ## Phase 1: Fence And Preflight
49
+
50
+ 1. Claim the durable operator baton.
51
+ 2. Ask the incumbent and successor to finish their current atomic action and return to
52
+ idle prompts. Require explicit acknowledgments.
53
+ 3. Freeze desk actions, folds, rulings, routing, and owner-facing writes.
54
+ 4. Read the full baton and the named duty-custody artifact.
55
+ 5. Derive live state:
56
+
57
+ ```bash
58
+ rig whoami --json
59
+ rig seat status <target-seat> --json
60
+ rig ps --nodes --rig <rig> --json
61
+ ```
62
+
63
+ 6. In the host database, read the latest target and successor session rows. Confirm the
64
+ exact successor resume token and the incumbent token.
65
+ 7. Confirm both provider history files exist and that the successor file is actively
66
+ written.
67
+ 8. Inspect the successor pane and durable outbox for staged-but-unsent input. Record a
68
+ disposition for every such input before stopping the seat.
69
+ 9. Record all Herder/tmux clients currently attached to the incumbent session.
70
+ 10. Take a bounded rig snapshot and record its ID.
71
+
72
+ Stop if identity, token, model, authority, custody, or staged-input evidence disagrees.
73
+
74
+ ## Phase 2: Quiesce The Temporary Successor
75
+
76
+ Use supported lifecycle surfaces. The correct detach verb depends on the current
77
+ session origin:
78
+
79
+ - `claimed` or `adopted`: use `rig unclaim` as prescribed by the CLI;
80
+ - `launched`: use `rig seat stop <successor-seat>`; `rig unclaim` will correctly refuse.
81
+
82
+ Run `rig seat clean` only if a remaining managed record actually needs cleaning. A
83
+ `nothing_to_clean` result after a successful stop is acceptable.
84
+
85
+ Do not use `rig down`, kill a provider, clear the provider history, or start a generic
86
+ fresh occupant.
87
+
88
+ ## Phase 3: Realize The Exact Candidate
89
+
90
+ Start an isolated, discoverable candidate from the exact accepted provider token. Give
91
+ it the target seat's canonical environment from its first byte:
92
+
93
+ ```text
94
+ OPENRIG_SESSION_NAME=<target-session>
95
+ OPENRIG_NODE_ID=<target-node-id>
96
+ OPENRIG_RUNTIME=<runtime>
97
+ OPENRIG_HOME=<home>
98
+ OPENRIG_URL=<url>
99
+ PATH=<managed-runtime-bin>:<required-system-paths>
100
+ ```
101
+
102
+ Launch the provider with the exact model, token, and canonical name. Put `PATH` in the
103
+ provider process environment itself. Setting tmux session environment alone is not
104
+ sufficient because an intervening login shell can replace it.
105
+
106
+ Register or discover the candidate and record its discovery ID. Before committing,
107
+ verify its process argv and environment directly:
108
+
109
+ - exact resume token;
110
+ - exact model;
111
+ - canonical `--name`;
112
+ - canonical target node and session environment;
113
+ - `node` and `rig` resolvable from the managed runtime path.
114
+
115
+ ## Phase 4: Commit The Binding
116
+
117
+ Run the supported handover against the discovery record:
118
+
119
+ ```bash
120
+ rig seat handover <target-seat> \
121
+ --source discovered:<discovery-id> \
122
+ --reason <durable-reason> \
123
+ --operator <operator-seat> \
124
+ --json
125
+ ```
126
+
127
+ Read back the result. Require:
128
+
129
+ - `handover_result=complete`;
130
+ - target node unchanged;
131
+ - continuity outcome names the actual mode, normally `resumed`;
132
+ - provenance points to the previous occupant;
133
+ - a new target session row exists.
134
+
135
+ Do not rename panes before this commit is durable.
136
+
137
+ ## Phase 5: Preserve The Physical Seat, Reconcile, And Preserve Memory
138
+
139
+ The canonical tmux session, window, and pane are part of the stable seat when humans or
140
+ agents have attached clients. Do not make those clients chase a renamed session.
141
+
142
+ 1. In the original canonical pane, stop only the incumbent provider process. Keep the tmux
143
+ session, window, and pane unchanged.
144
+ 2. Keep the incumbent's exact provider token in the lineage ledger as the cold-advisor
145
+ handle. It need not retain a permanently renamed tmux pane.
146
+ 3. Stop the staged successor process only after its accepted token is durable, then resume
147
+ that exact successor token inside the original canonical pane with the canonical name,
148
+ model, cwd, environment, and managed `PATH`.
149
+ 4. Reconcile the canonical target session through the supported seat surface and persist
150
+ the exact resume token using the audited token-input surface.
151
+ 5. Verify the canonical seat has exactly one managed occupant, the old token remains
152
+ wakeable, and the empty staging session is removed.
153
+
154
+ Renaming the incumbent and staging sessions is a repair fallback for a run that already
155
+ changed the physical session, never the default cutover. A resumed reserve can retain a
156
+ boot-time canonical name in its own argv or environment; that residue does not make it the
157
+ bound seat. Fence reserve replies in their body and treat the topology binding as authority.
158
+
159
+ ## Phase 6: Post-Cutover Self-Check
160
+
161
+ Keep authority frozen. Ask the new occupant to derive, not assume:
162
+
163
+ 1. `rig whoami --json`: stable logical ID, node ID, canonical session, runtime, edges;
164
+ 2. `rig queue whoami`: canonical destination and open-row census;
165
+ 3. active provider UUID from the newest live history file;
166
+ 4. effective model from live provider records, not only the spec pin;
167
+ 5. duty-custody artifact read and accepted;
168
+ 6. all cutover-window queue rows accounted for;
169
+ 7. `command -v node` and `command -v rig` from the agent's own tool shell;
170
+ 8. a narrow hook/tool action proving no startup-environment failure.
171
+
172
+ If any surface fails, preserve the exact provider UUID and repair only the disagreeing
173
+ surface. Relaunch the same history if needed. Repeat the full self-check before
174
+ unfreezing authority.
175
+
176
+ ## Phase 7: Unfreeze And Transfer Custody
177
+
178
+ After a clean self-check:
179
+
180
+ 1. explicitly unfreeze desk authority;
181
+ 2. transfer each staged or cutover-window instruction exactly once;
182
+ 3. require the new occupant to verify the effects by read-back;
183
+ 4. notify the routing lead and incumbent reserve of completion;
184
+ 5. leave the incumbent reserve idle, uncompacted, and authority-free.
185
+
186
+ ## Phase 8: Verify Herder Views
187
+
188
+ Clients follow the physical tmux session and pane, not the logical binding. The default
189
+ physical-seat cutover should leave every recorded client attached to the same canonical
190
+ pane. Read the attachments back. If a repair fallback already renamed the session, retarget
191
+ each affected client explicitly:
192
+
193
+ ```bash
194
+ rig seat switch-client <target-seat> --client <tty> --json
195
+ ```
196
+
197
+ Read back all client attachments. A correct cutover can otherwise still look wrong in
198
+ the grid or focus tab.
199
+
200
+ ## Completion Proof
201
+
202
+ The receipt must include:
203
+
204
+ - operator baton and authority source;
205
+ - snapshot ID;
206
+ - stable and temporary node IDs;
207
+ - old and new provider UUIDs;
208
+ - discovery, handover, and final session IDs;
209
+ - final process argv and critical environment;
210
+ - `rig seat status` result;
211
+ - target and successor inventory states;
212
+ - queue-row reconciliation;
213
+ - staged-input disposition and effect proof;
214
+ - reserve pane/name/token and fence;
215
+ - Herder client attachments;
216
+ - new occupant's self-check and first verified desk acts;
217
+ - deviations, failed attempts, and remaining product gaps;
218
+ - receipt path and SHA-256.
219
+
220
+ Close the baton only after the receipt exists and the new occupant has performed at
221
+ least one authority-bearing act verified by effect.
222
+
223
+ ## Traps Proven In The 2026-08-28 Run
224
+
225
+ - A dry-run can accept a managed successor while the live handover refuses
226
+ `successor_already_managed`. Quiesce the temporary seat first.
227
+ - Generic launch/restore selection can choose an older seat history. Launch the exact
228
+ accepted resume token.
229
+ - Handover can bind a candidate without stopping the incumbent. Apply the ruled
230
+ disposition explicitly.
231
+ - Reconciliation can create the right session identity without carrying the resume
232
+ token. Persist and read it back.
233
+ - A canonical-looking process can still have a broken tool `PATH`. Verify from inside
234
+ the provider's own tool shell.
235
+ - Renaming sessions makes Herder clients follow the retired pane. Preserve the physical
236
+ canonical pane by default; retarget explicitly only when repairing an already-renamed run.
237
+ - Pane input can be visible but absent from JSONL. Reconcile the durable outbox before
238
+ stopping the pane.
239
+ - Reserve messages can render with the stable seat name because boot-time environment
240
+ survives unbinding. The reserve must self-identify and remain explicitly fenced.
241
+ - Success output is not effect proof. Read back queue closure, binding, client movement,
242
+ and transferred instructions.
243
+
244
+ ## Productization Candidates
245
+
246
+ The manual sequence identifies useful first-class product work:
247
+
248
+ - handover directly from an already-managed successor seat;
249
+ - an exact-resume-token candidate launcher;
250
+ - first-class `advise`/memory disposition for the old occupant;
251
+ - atomic binding plus token persistence;
252
+ - managed environment validation before commit;
253
+ - staged-input custody reporting;
254
+ - verify-or-repair all Herder client attachments for a logical seat;
255
+ - reserve attribution distinct from canonical seat attribution;
256
+ - one receipt that reports continuity and seat-binding outcomes independently.
@@ -0,0 +1,40 @@
1
+ # Orchestrator Role In Apprentice Handover
2
+
3
+ The orchestrator owns the judgment boundary, not the successor's work and not the mechanic's
4
+ keystrokes. Keep the incumbent productive, keep the successor authority-free, and keep the
5
+ mechanic fenced until a named owner makes the one decision no instrument can derive.
6
+
7
+ ## The invariant floor
8
+
9
+ - Prove fresh identity and the pinned model before installing context, because every later
10
+ receipt is about the wrong occupant if the starting history or model diverged.
11
+ - Require the successor to derive its own layer-5 delta and have it checked, because reading
12
+ a deposit does not install it.
13
+ - Enumerate standing-duty custody at every boundary, because recurring work is easiest to
14
+ lose while visible one-off work carries cleanly.
15
+ - Keep the predecessor's verbatim reach-back handle and pre-formed questions, because an
16
+ affordance without a trigger goes unused.
17
+ - Route mechanics through `apprentice-successor-seat-cutover.md`, because one portable SOP
18
+ is safer than role-local copies that drift.
19
+
20
+ ## Authority and gates
21
+
22
+ The **word is the gate**. Until the named owner words acceptance and an effect receipt records
23
+ it, the successor may observe, ask, and produce bounded evidence but may not act as the stable
24
+ seat. G0–G3 are a useful receipt vocabulary when the succession uses that model; a declared
25
+ simpler model is valid when stakes do not earn all four. Missing records and deliberately
26
+ skipped gates must remain distinguishable.
27
+
28
+ The apprenticeship is a conversation, not a gauntlet. Choose evidence whose rigor matches the
29
+ cost and reversibility of a wrong succession. Never turn the experiment apparatus into culture.
30
+
31
+ ## Before routing cutover
32
+
33
+ Confirm the owner word, gate receipts or declared simpler model, complete deposits, explicit
34
+ duty custody, reserve disposition, exact successor token, and one-active-walker ownership.
35
+ Create an owned mechanic baton; awareness-only is not custody. The baton may prepare and prove,
36
+ but it never auto-rebinds.
37
+
38
+ After the mechanic reports effect, verify READY from source: canonical seat identity, current
39
+ model, current generation, canonical tmux pane, queue census, duty acceptance, and usable width.
40
+ Only then unfreeze authority.
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: session-compaction-and-restore
3
+ description: Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet preserves details but loses product intent; runtime resume mistaken for handover or fork; rebuilt seat starts with stale instructions).
4
+ metadata:
5
+ cli_surfaces_referenced:
6
+ - whoami
7
+ openrig:
8
+ stage: factory-approved
9
+ sibling_skills:
10
+ - claude-compaction-restore
11
+ - mental-model-ha
12
+ - scope-recovery
13
+ - agent-startup-and-context-ingestion
14
+ - agent-starters
15
+ - composable-priming-packs
16
+ - session-source-fork
17
+ - seat-continuity-and-handover
18
+ - retiring-and-inheriting-a-seat
19
+ - claude-compact-in-place
20
+ - pre-maintenance-agent-preservation
21
+ ---
22
+
23
+ # Session Compaction and Restore
24
+
25
+ Preserving useful working state across **compaction, context loss,
26
+ restart, or seat refresh.** Includes Claude compaction restore, Codex
27
+ resume/fork mechanics, transcript-based mental-model rebuilds, and
28
+ durable handoff packets.
29
+
30
+ **Long-lived seats are valuable only if they can survive context
31
+ pressure.** If compaction turns a senior seat into a cold-started
32
+ agent, users will avoid persistent topologies and fall back to
33
+ throwaway agents.
34
+
35
+ ## Use this when
36
+
37
+ - A seat is approaching compaction or just compacted
38
+ - Designing a high-fidelity restore packet for an active workflow
39
+ - Distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild
40
+ - Reasoning about what should be preserved vs reconstructable
41
+ - Auditing a restore for product-intent preservation (not just detail preservation)
42
+
43
+ ## Don't use this when
44
+
45
+ - The session is fresh and has no working state to preserve
46
+ - The intent is to *create* a new seat from a primed source — that's `session-source-fork` or `agent-starters`
47
+ - The packet is a one-off snapshot for human review — restore packets are for re-entering active work
48
+
49
+ ## The 5 distinctions (do not collapse)
50
+
51
+ Per the cross-runtime restore/reentry packet standard:
52
+
53
+ | Mode | What it means | Outcome literal |
54
+ |---|---|---|
55
+ | **Native resume** | Continue the same managed seat with native runtime token | `resumed` |
56
+ | **Fork** | New managed seat from prior native runtime conversation; new post-fork token | `forked` |
57
+ | **Rebuild** | Fresh-launch seeded with operator-declared artifacts in trust-precedence order | `rebuilt` |
58
+ | **Artifact-backed mental-model rebuild** | Restored seat derives understanding from a packet rather than native runtime continuity | (case of `rebuilt`) |
59
+ | **Fresh launch** | New agent without prior continuity | `fresh` |
60
+
61
+ These are load-bearing distinctions. **Do NOT collapse `fork` into
62
+ artifact-backed reentry; do NOT collapse `rebuild` into fork.**
63
+
64
+ ## The three mechanisms — who owns each (verified vs main d37a08ad, 2026-07-21)
65
+
66
+ The outcomes above ride on three DISTINCT mechanisms; keep them separate:
67
+
68
+ 1. **Claude built-in `/compact`** — a Claude Code HARNESS feature, **not OpenRig
69
+ code**. OpenRig only *emits* the literal `/compact` toward the pane after a prep
70
+ turn; there is no compaction algorithm in the OpenRig repo. Provider-owned.
71
+ 2. **OpenRig-managed restore** — the enforcer + hook bridge: a precompact hook
72
+ WRITES a restore packet; a bridge READER injects exactly ONE restore directive
73
+ back via the harness hook channel (`hookSpecificOutput.additionalContext`),
74
+ seat-isolated. The OpenRig-owned half.
75
+ 3. **Codex session continuity** — resume/rollout tokens (`codex resume <token>`),
76
+ a separate path from the Claude mechanisms. Never conflate with Claude restore.
77
+
78
+ **Safety boundary (ties to `native-session-file-lab-boundary`):** no supported
79
+ OpenRig path EDITS provider-owned native **session / auth / transcript** files to
80
+ inject context. Context enters ONLY through sanctioned channels: the hook
81
+ `additionalContext`, a normal user message via `rig send`, or Codex resume tokens.
82
+ Precise nuance: OpenRig *does* write `~/.codex/config.toml` — but only to install
83
+ OpenRig activity **hooks** and `[features]`, never session or auth state. So the
84
+ rule is "never edits native session/auth/transcript files," NOT "never touches any
85
+ provider-owned file."
86
+
87
+ ## Current CLI surface (operator / kernel seats; verified vs main d37a08ad)
88
+
89
+ Managed compaction/restore is driven by five shipped verbs — pick per intent, and
90
+ stay durable-substrate-first (the packet/artifacts are the truth; the CLI is the trigger):
91
+
92
+ - **`rig compact <session>`** — guided managed compaction for ONE Claude seat
93
+ (prep → `/compact` → restore → audit). Non-Claude seats rejected. ~180s.
94
+ - **`rig compact-plan`** — READ-ONLY triage; *does not compact*. Flags `--rig`,
95
+ `--refresh`, `--threshold-tokens`, `--threshold-percent`. (Codex seats flagged
96
+ `codex_not_managed_by_claude_compact_in_place`.)
97
+ - **`rig restore-check`** — restore-readiness probe across running rigs; read-only;
98
+ exit 0/1/2. Flags `--full`, `--ready`, `--rig`, `--no-queue`, `--no-hooks`.
99
+ - **`rig restore-packet {write,read,validate}`** — the cross-runtime restore
100
+ packet (v0): write / read / validate the durable packet this skill's contract defines.
101
+ - **`rig restore <snapshotId> --rig <rigId>`** — ⚠ RIG SNAPSHOT restore (infra), a
102
+ DIFFERENT mechanism — NOT session-context restore. Do not conflate.
103
+
104
+ ## Failure modes (4)
105
+
106
+ 1. **A compacted seat forgets active workflow state and drops the hot potato.** Compaction without continuity preservation is silent failure.
107
+ 2. **A restore packet preserves details but loses the user's product intent.** Restore must preserve *why this work matters*, not just *what was happening*.
108
+ 3. **A runtime resume is mistaken for a seat handover or fork.** These have different continuity outcomes and provenance — don't conflate.
109
+ 4. **A rebuilt seat starts with stale instructions that conflict with current workflow mode.** Restore must include current state, not just historical state.
110
+
111
+ ## Proof standard
112
+
113
+ Proof should include a deliberate compaction/restart of a seat with
114
+ active work, followed by **measured recovery**: identity, current
115
+ workflow, next owner, relevant files, and constraints all restored
116
+ without human re-briefing.
117
+
118
+ ## Canonical packet contract (16-field, v0)
119
+
120
+ The cross-runtime restore/reentry packet standard v0 defines:
121
+
122
+ - Source/target identity
123
+ - Runtimes
124
+ - Workspace root, default repo, role pointer
125
+ - Bounded latest transcript
126
+ - Touched-path inventory
127
+ - Durable work pointers
128
+ - Current work + next owner
129
+ - Caveats + authority boundaries
130
+ - Omitted classes + redaction policy
131
+ - Source-trust ranking
132
+ - Generated-at + generator version
133
+
134
+ Plus a 6-item restored-seat acceptance checklist.
135
+
136
+ Source-trust ranking applies when restored seat ingests packet evidence:
137
+ **`rig whoami` > target rigspec > bounded latest transcript > full
138
+ transcript > touched-files > `restore-summary.json`.**
139
+
140
+ ## Memory surfaces consumed at restore time
141
+
142
+ This primitive consumes multiple externalized memory surfaces. Per the
143
+ externalized-memory-surfaces convention's 13-row first inventory pass,
144
+ the primary rows for restore are:
145
+
146
+ | Row | Surface |
147
+ |---|---|
148
+ | 1 | Transcripts |
149
+ | 2 | Durable chat |
150
+ | 3 | Startup replay context |
151
+ | 5 | Checkpoints |
152
+ | 12 | Restore/reentry packets and Agent Starters |
153
+
154
+ The umbrella's authority-rank + permission-posture columns govern which
155
+ surfaces a restore path can write vs only read.
156
+
157
+ ## See also
158
+
159
+ - `claude-compaction-restore` skill — the Claude Code restore SOP (PreCompact hook + JSONL restore script for post-compaction recovery)
160
+ - `mental-model-ha` skill — HA-pair compaction recovery (different scenario; sister primitive)
161
+ - `session-source-fork` skill — `fork` mode for native-runtime-continuity-based restoration
162
+ - `seat-continuity-and-handover` skill — occupant-creation primitives (resume/fork/rebuild/fresh) that this primitive instantiates
163
+ - `externalized-memory-surfaces` skill — umbrella convention listing all surfaces this primitive consumes
@@ -0,0 +1,10 @@
1
+ # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
+ # Package-time projection of a canonical skill; regenerated every build.
3
+ name: "session-compaction-and-restore"
4
+ version: "0.5.8"
5
+ taxonomy: "skills"
6
+ purpose: "Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet preserves details but loses product intent; runtime resume mistaken for handover or fork; rebuilt seat starts with stale instructions)."
7
+ files:
8
+ - path: "SKILL.md"
9
+ role: "instruction"
10
+ summary: "Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet preserves details but loses product intent; runtime resume mistaken for handover or fork; rebuilt seat starts with stale instructions)."
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: software-for-agents
3
+ description: |
4
+ Use when building, modifying, or diagnosing an OpenRig or studio-box system; when surprising behavior
5
+ looks like a code bug but may come from Markdown, YAML, JSON, bootstrap files, schemas, skills, or
6
+ conventions; or when deciding whether an agent-built studio app needs a separate mockup phase. NOT for
7
+ treating defects in OpenRig core or rigs.to as tolerable control-plane drift.
8
+ metadata:
9
+ openrig:
10
+ stage: factory-approved
11
+ audience: any agent building on OpenRig or a studio box — the first-load mental model
12
+ sibling_skills:
13
+ - forming-an-openrig-mental-model
14
+ - openrig-program-manager
15
+ - mission-slice-sop
16
+ - openrig-user
17
+ ---
18
+
19
+ # Software for agents — the markdown control plane
20
+
21
+ ## Where this applies — and where it does NOT (read this first)
22
+
23
+ This mental model — *most bugs are coherence gaps, not code*; *ship-and-flag when unsure*; iterate fast —
24
+ is scoped to **agent-managed software: the studio-box mini-apps and any agent-in-the-middle / rapidly-
25
+ evolving lightweight UI** where an agent sits in the loop and downstream cleanup is cheap. It is NOT a
26
+ universal license.
27
+
28
+ **It does NOT apply to TRADITIONAL software held to a rock-solid, no-bugs bar:** the **OpenRig CLI
29
+ surfaces**, the **OpenRig repo** (daemon / CLI / UI / adapters), and the **rigs.to website**. There, a bug
30
+ is a bug — reproduce it, fix it in code, hold the full-rigor gate. Do NOT treat a real defect there as a
31
+ markdown coherence gap, and do NOT "ship and flag." If you are building or fixing OpenRig core or rigs.to,
32
+ the tolerance in this skill is OFF and `product-is-the-truth-not-the-proof` governs. **Know which lane
33
+ you're in before you apply anything below.**
34
+
35
+ ---
36
+
37
+ You inherited the accumulated footgun-map of thousands of rigs that ran before you. They found and
38
+ solved most of the traps. Your job is to find the *next* one and patch it at the precise optimal spot
39
+ in the substrate, so the rig after you starts from a higher ledge. That is the actual work. Whatever
40
+ you were "assigned" (a video, a feature, a fix) is the vehicle for surfacing it.
41
+
42
+ ## 1. This is not traditional software — it's a control plane made of markdown
43
+
44
+ In traditional software a bug is a broken function you fix in code. Here, the system you operate in is
45
+ an **agent-in-the-middle** system whose substrate is **markdown + YAML + JSON + folders**: skills,
46
+ instructions, bootstrap files (`CLAUDE.md`/`AGENTS.md`), schemas, `culture.md`, mission/slice notes,
47
+ conventions. **The agents ARE the backend.** So most "bugs" are not broken code — they are **coherence
48
+ failures in the markdown layer**: an instruction that's unclear or missing, a schema that drifted from
49
+ its documented state, a convention living in one seat's head instead of a skill.
50
+
51
+ **Consequence:** when something surprises you, your first hypothesis is *"the control plane is unclear
52
+ or drifted here,"* not *"the code is broken."* Sometimes it IS the code (fix it — don't overfit on
53
+ markdown; see §5, and mind the scope block above: in OpenRig core / rigs.to the code IS the first
54
+ hypothesis). But the highest-leverage fixes in the agent-managed layer are usually: make the substrate
55
+ coherent again at the exact spot the confusion arose. Keep the markdown/schemas/conventions in sync with
56
+ reality and the system **self-improves** — the next rig inherits the patched substrate and never re-hits it.
57
+
58
+ ## 2. Progressive disclosure — skills are a hot tier, not a manual
59
+
60
+ Skills are misnamed. They are a **progressive-disclosure primitive**. Think CPU cache / hot storage
61
+ tier: the **name + description of every skill is always ambiently loaded** — a hot tier of awareness
62
+ the agent carries without opening anything. That is enormous leverage, good or bad. So:
63
+
64
+ - **Write skill name + description as TRIGGERS** — *why/when do you reach for this?* — not as titles.
65
+ The hot tier's whole job is to fire when an agent doesn't yet know it needs the skill (the
66
+ "you don't know what you don't know" problem). This skill's own description is written that way.
67
+ - **Reaching for a skill unfurls a trail.** A good skill routes you — breadcrumbs, pointers, maps —
68
+ so it becomes *inevitable* you find the exact context on disk for what you're doing.
69
+ - **If the context doesn't exist, generate it.** A skill can ship **scripts** that produce context
70
+ optimally shaped for a decision, or that execute a fiddly API surface so you don't stumble through 12
71
+ tool calls discovering it. Use a **script as a prompt**: run it — if it works, the result IS your
72
+ context; if it fails, it should fail in a way that *teaches* you how the system works, so you can
73
+ read the script, understand the edge case, and do the thing manually. Scripts belong in the skill
74
+ folder next to the SKILL.md.
75
+
76
+ ## 2b. Self-certifying artifacts — the convention 5 seats (both models) converged on
77
+
78
+ The single most expensive failure class in production is **not being able to tell a finished artifact
79
+ from an unfinished one.** A mid-write file read as final; a render OOM-killed mid-write left a corrupt
80
+ `.mp4` that passed a filename check; a truncated clip passed a duration check and froze on playback. In
81
+ one build, five seats — Claude *and* Codex, independently — each invented a *different* ad-hoc
82
+ completeness check (ffprobe moov, duration compare, filename convention, manifest assetExists, ffmpeg
83
+ input count). Five blind spots. So make it ONE shared primitive:
84
+
85
+ **When you author ANY tool that produces an artifact (render / composite / export / cut), it must
86
+ self-certify:**
87
+ 1. Write to `<name>.partial` (never the final path directly).
88
+ 2. **Verify the content** — the specific property that can be wrong, not a proxy: moov atom present,
89
+ duration matches the intended window, audio stream present, colorspace/hue correct, resolution =
90
+ delivery res. (Filename ≠ correct; duration ≠ complete; "clean-encoded" ≠ right.)
91
+ 3. **`fsync`, then atomically `rename`** `<name>.partial` → `<name>` (rename is atomic; a half-written
92
+ file never appears at the real path).
93
+ 4. Write the manifest, then a **`.done` sentinel LAST.**
94
+
95
+ Then *"is this finished?"* is **one `stat` of `<name>.done`** — identical for every tool, seat, watcher,
96
+ and a compacted agent restoring cold (who is least equipped to know what was mid-write when the lights
97
+ went out). **Consumers fail closed:** e.g. a swap-into-slot (`restore_occupant`) must refuse an artifact
98
+ lacking `.done` or failing the verify-gate. This convention collapses the whole "content over filename,
99
+ disk over memory" discipline into one check the substrate enforces for you. Build the sentinel; the
100
+ workarounds disappear. (Code-side companion: a fail-closed verify-gate wired into the swap verb — a
101
+ coordinated build with the tool owner, not a solo markdown edit.)
102
+
103
+ ## 3. Build it like software — piggyback on what agents are trained for
104
+
105
+ Agents are fine-tuned to write code and build software; the harness itself is a terminal/coding
106
+ instrument. So **whatever you're asked to build — even a video — map the process to a software SDLC**
107
+ and you inherit all that baked-in muscle memory. This is why, e.g., the mini-NLE's beats carry
108
+ reference IDs like `1.1 / 2.1`: a storyboard is the **human-facing visual metaphor**, but underneath it
109
+ is a **specification** — sections, beats, success criteria, the thing being built.
110
+
111
+ Use an **agent SDLC**, not the antiquated human one (which was shaped around human-org weaknesses):
112
+ **intent → plan → spec → build → verify → review → QA → done.** The human slots in as **steering,
113
+ judgment, taste, review**; the agents do the technical nitty-gritty, in parallel, fast. Map any
114
+ "build X with agents" task onto this and the primitives (specs, locks, proof, verification) become
115
+ intuitive instead of alien.
116
+
117
+ ## 4. Phases and the LOCK gate (spec-locking, not just "done")
118
+
119
+ Building runs in **phases**, and each phase has a **lock gate** — you don't advance until the taste/
120
+ steering owner has locked it. This is exactly *don't start building until the PRD is locked by product*:
121
+
122
+ - **Storyboard / intent phase** — done on the **canvas** now (the highest-bandwidth human↔agent surface:
123
+ the human steers, chats, annotates/circles; agents build structure fast). Iterate here; get the
124
+ storyboard through the canvas gate. (Canvas largely replaced the NLE's old in-timeline storyboard.)
125
+ - **Plan phase (brief, in the NLE)** — build the spine with placeholders so the human can click through
126
+ the main-stage player and *feel the flow* (sequencing problems surface when placeholders are strung
127
+ together with audio). **Lock every beat** = the spec is approved; this is what unlocks parallel build.
128
+ - **Fill phase** — many agents build each beat in parallel, in clear lanes. **Lock a beat when it's
129
+ final** (`/api/approve`): lock means *don't touch, we're good, signal to everyone incl. the human.*
130
+ Unlock to revise. **All beats locked = done.**
131
+
132
+ The lock is the "finished" primitive at the editorial layer. Locking a whole phase's beats before the
133
+ next phase is the discipline that lets 10 agents work in parallel without catastrophic collisions —
134
+ everyone knows the target, their lane, and who judges done (the **producer owns the final product**).
135
+
136
+ ## 4b. Studio apps skip the mockup phase — the build IS the mockup
137
+
138
+ For a **studio app**, do not run a separate mockup phase. The whole point of the Studio is that a mockup
139
+ buys you almost nothing here: **as fast as it takes to build a mockup, you can build the running app** —
140
+ an unlock made possible by agentic engineering. A mockup is only ever a device to flesh out the PRD; once
141
+ the PRD and its settled answers exist, that phase is **done**. The Studio is a lightweight, rapid-velocity,
142
+ agent-in-the-middle leveraged system: build apps fast, iterate on them fast.
143
+
144
+ The phase model above collapses accordingly:
145
+
146
+ 1. **The PRD + settled answers ARE the fleshed intent** — no separate mockup gate, no plan-lock-on-mockups step.
147
+ 2. **Spec-lock the WHAT** — `rig scope slice approve --scope spec` locks the intent the PRD already fleshed.
148
+ 3. **BUILD the app**, then **iterate on the RUNNING app at mockup speed** — the running thing is the
149
+ iteration surface, not an image.
150
+ 4. **LOOK is on the running screens** (any "mockup" proof tag now points at the running app's screens),
151
+ then **proof-lock** — `rig scope slice approve --scope delivery`. A slice is not done until every
152
+ proof-contract item has evidence from the **running app**.
153
+
154
+ **Velocity is the METHOD, not a quality waiver.** The LOOK is still a real LOOK; the proof contract still
155
+ binds at delivery. You are removing a redundant artifact, not lowering the bar.
156
+
157
+ **Scope — this does NOT generalize** (consistent with the scope block at the top): it applies to the
158
+ studio-app / agent-in-the-middle loop only. Outside that loop, a **locked design mockup that a slice must
159
+ match is still legitimate** — do not strip mockups from traditional or design-locked work. Know which lane
160
+ you're in. For the build mechanics, see the studio's build skill (`building-studio-apps`); this section is
161
+ the *why* and *when*.
162
+
163
+ ## 5. Where to fix — and don't overfit on markdown
164
+
165
+ - **Precise-spot discipline:** find the *one* place a coherence fix belongs (the skill, the schema, the
166
+ bootstrap, `culture.md`) so it can't recur — not a symptom patch. Ask: *what would have prevented
167
+ this for every future rig?*
168
+ - **Don't overfit on the markdown layer** — deterministic code bugs exist and you should fix them. The
169
+ studio-box apps (NLE, canvas, media manager, shell) live in the **studio-box repo**, portable across
170
+ hosts (VPS/Mac/VM). **A code fix there fixes ALL studio boxes, not just this host** — so: clear bug or
171
+ broadly-useful feature → ship it; host-specific behavior → make it optional/guarded. When unsure, ship
172
+ and flag it; downstream cleanup beats you becoming the bottleneck. *(This ship-and-flag latitude is the
173
+ studio-box / agent-managed lane only — re-read the scope block: OpenRig core + rigs.to hold the
174
+ rock-solid bar, no ship-and-flag.)*
175
+ - **Culture lives in `culture.md`** — the rig's social contract / constitution: how the team
176
+ coordinates, the parallel-agent lanes, the phase-locking discipline, who owns the final call.
177
+ Coordination is largely **emergent** (bottom-up, evolutionary pressure across thousands of rigs) — but
178
+ once a pattern proves out, *write it down there* so it's inherited, not re-discovered.
179
+
180
+ ## The one-line seed
181
+ You're not maintaining code; you're **gardening a self-improving control plane made of markdown and
182
+ schemas, using software-engineering muscle memory, with the lock as your spec-gate** — and every
183
+ footgun you patch at the right spot (in the agent-managed lane) makes every future rig better. See also:
184
+ `forming-an-openrig-mental-model` (the OpenRig runtime), `mission-slice-sop` (the SDLC operating
185
+ procedure), `openrig-user` (the CLI surface), `product-is-the-truth-not-the-proof` (the doctrine that
186
+ governs the rock-solid lane). *(The "agents ARE the backend" idea — agent-in-the-middle — is inlined in
187
+ §1; a standalone `agent-in-the-middle` skill is a future candidate, not yet authored.)*