@openrig/cli 0.6.6 → 0.6.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 (637) hide show
  1. package/README.md +97 -28
  2. package/daemon/assets/claude-team-permissions.cjs +262 -0
  3. package/daemon/assets/onboarding/02-self-and-competent-action.md +20 -13
  4. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-health.cjs +41 -0
  7. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +69 -12
  8. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +13 -2
  9. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +4 -0
  10. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +6 -0
  11. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +1 -1
  12. package/daemon/assets/plugins/openrig-core/skills/refocusing/SKILL.md +31 -4
  13. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +24 -13
  14. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +3 -0
  15. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +42 -0
  16. package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +6 -0
  17. package/daemon/assets/skills/rigs/SKILL.md +133 -0
  18. package/daemon/context-packs/help/help.md +48 -19
  19. package/daemon/context-packs/help/manifest.yaml +1 -1
  20. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  21. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +239 -43
  22. package/daemon/context-packs/reference/getting-started.md +356 -212
  23. package/daemon/context-packs/reference/instance-layout.md +5 -0
  24. package/daemon/context-packs/reference/manifest.yaml +4 -1
  25. package/daemon/context-packs/reference/rig-spec.md +48 -20
  26. package/daemon/context-packs/reference/whats-new.md +96 -0
  27. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +13 -2
  31. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +4 -0
  33. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +6 -0
  38. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-architect/SKILL.md +3 -0
  40. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +1 -1
  44. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/openrig-software-factory/SKILL.md +19 -12
  46. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +17 -16
  48. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +2 -0
  49. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/refocusing/SKILL.md +31 -4
  83. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  84. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +24 -13
  85. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/SKILL.md +3 -0
  86. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  87. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +42 -0
  88. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  89. package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +6 -0
  90. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  91. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  92. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  93. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  94. package/daemon/dist/adapters/claude-code-adapter.d.ts +1 -1
  95. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  96. package/daemon/dist/adapters/claude-code-adapter.js +23 -13
  97. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  98. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  99. package/daemon/dist/adapters/codex-resume.js +17 -0
  100. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  101. package/daemon/dist/adapters/codex-runtime-adapter.js +2 -2
  102. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  103. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  104. package/daemon/dist/adapters/kernel-authority.js +29 -11
  105. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  106. package/daemon/dist/adapters/pi-readiness.d.ts +15 -0
  107. package/daemon/dist/adapters/pi-readiness.d.ts.map +1 -0
  108. package/daemon/dist/adapters/pi-readiness.js +90 -0
  109. package/daemon/dist/adapters/pi-readiness.js.map +1 -0
  110. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  111. package/daemon/dist/adapters/pi-runner-protocol.js +1 -0
  112. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
  113. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  114. package/daemon/dist/adapters/pi-runner.js +13 -2
  115. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  116. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  117. package/daemon/dist/adapters/tmux.js +9 -6
  118. package/daemon/dist/adapters/tmux.js.map +1 -1
  119. package/daemon/dist/build-info.js +3 -3
  120. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  121. package/daemon/dist/db/all-migrations.js +4 -0
  122. package/daemon/dist/db/all-migrations.js.map +1 -1
  123. package/daemon/dist/db/migrations/096_rig_install_root.d.ts +3 -0
  124. package/daemon/dist/db/migrations/096_rig_install_root.d.ts.map +1 -0
  125. package/daemon/dist/db/migrations/096_rig_install_root.js +5 -0
  126. package/daemon/dist/db/migrations/096_rig_install_root.js.map +1 -0
  127. package/daemon/dist/db/migrations/097_thread_part_map.d.ts +3 -0
  128. package/daemon/dist/db/migrations/097_thread_part_map.d.ts.map +1 -0
  129. package/daemon/dist/db/migrations/097_thread_part_map.js +20 -0
  130. package/daemon/dist/db/migrations/097_thread_part_map.js.map +1 -0
  131. package/daemon/dist/domain/activity-taxonomy.d.ts +7 -0
  132. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  133. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  134. package/daemon/dist/domain/agent-activity-store.d.ts +12 -0
  135. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  136. package/daemon/dist/domain/agent-activity-store.js +55 -30
  137. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  138. package/daemon/dist/domain/agent-images/agent-image-types.d.ts +1 -1
  139. package/daemon/dist/domain/agent-images/agent-image-types.d.ts.map +1 -1
  140. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  141. package/daemon/dist/domain/bootstrap-orchestrator.js +6 -4
  142. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  143. package/daemon/dist/domain/bundle-install-context.d.ts +2 -2
  144. package/daemon/dist/domain/bundle-install-context.d.ts.map +1 -1
  145. package/daemon/dist/domain/bundle-install-context.js +16 -3
  146. package/daemon/dist/domain/bundle-install-context.js.map +1 -1
  147. package/daemon/dist/domain/bundle-types.d.ts +1 -1
  148. package/daemon/dist/domain/bundle-types.d.ts.map +1 -1
  149. package/daemon/dist/domain/chat-repository.d.ts +5 -0
  150. package/daemon/dist/domain/chat-repository.d.ts.map +1 -1
  151. package/daemon/dist/domain/chat-repository.js +8 -0
  152. package/daemon/dist/domain/chat-repository.js.map +1 -1
  153. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  154. package/daemon/dist/domain/claim-service.js +5 -4
  155. package/daemon/dist/domain/claim-service.js.map +1 -1
  156. package/daemon/dist/domain/claude-activity-hooks.d.ts +3 -0
  157. package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
  158. package/daemon/dist/domain/claude-activity-hooks.js +8 -1
  159. package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
  160. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +34 -2
  161. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  162. package/daemon/dist/domain/claude-compaction-enforcer.js +195 -107
  163. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  164. package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  165. package/daemon/dist/domain/codex-thread-id.js +4 -2
  166. package/daemon/dist/domain/codex-thread-id.js.map +1 -1
  167. package/daemon/dist/domain/context-monitor.d.ts +5 -0
  168. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  169. package/daemon/dist/domain/context-monitor.js +23 -6
  170. package/daemon/dist/domain/context-monitor.js.map +1 -1
  171. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  172. package/daemon/dist/domain/execution-view.js +57 -11
  173. package/daemon/dist/domain/execution-view.js.map +1 -1
  174. package/daemon/dist/domain/gateway/connections-projection.d.ts +4 -0
  175. package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -1
  176. package/daemon/dist/domain/gateway/connections-projection.js +2 -0
  177. package/daemon/dist/domain/gateway/connections-projection.js.map +1 -1
  178. package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
  179. package/daemon/dist/domain/gateway/destination-resolver.js +7 -4
  180. package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
  181. package/daemon/dist/domain/gateway/human-readiness.d.ts.map +1 -1
  182. package/daemon/dist/domain/gateway/human-readiness.js +23 -6
  183. package/daemon/dist/domain/gateway/human-readiness.js.map +1 -1
  184. package/daemon/dist/domain/gateway/human-registry.d.ts +2 -2
  185. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  186. package/daemon/dist/domain/gateway/human-registry.js +2 -2
  187. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  188. package/daemon/dist/domain/gateway/slack/capabilities.d.ts.map +1 -1
  189. package/daemon/dist/domain/gateway/slack/capabilities.js +3 -1
  190. package/daemon/dist/domain/gateway/slack/capabilities.js.map +1 -1
  191. package/daemon/dist/domain/gateway/slack/channel-map.d.ts +39 -0
  192. package/daemon/dist/domain/gateway/slack/channel-map.d.ts.map +1 -0
  193. package/daemon/dist/domain/gateway/slack/channel-map.js +114 -0
  194. package/daemon/dist/domain/gateway/slack/channel-map.js.map +1 -0
  195. package/daemon/dist/domain/gateway/slack/config.d.ts +7 -0
  196. package/daemon/dist/domain/gateway/slack/config.d.ts.map +1 -1
  197. package/daemon/dist/domain/gateway/slack/config.js +19 -2
  198. package/daemon/dist/domain/gateway/slack/config.js.map +1 -1
  199. package/daemon/dist/domain/gateway/slack/inbound.d.ts +24 -1
  200. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  201. package/daemon/dist/domain/gateway/slack/inbound.js +105 -3
  202. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  203. package/daemon/dist/domain/gateway/slack/message.d.ts +7 -0
  204. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  205. package/daemon/dist/domain/gateway/slack/message.js +36 -0
  206. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  207. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +2 -0
  208. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  209. package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
  210. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  211. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +7 -2
  212. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  213. package/daemon/dist/domain/gateway/slack/slack-api.js +35 -3
  214. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  215. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +34 -7
  216. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  217. package/daemon/dist/domain/gateway/slack/slack-delivery.js +268 -51
  218. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  219. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +17 -0
  220. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  221. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +107 -24
  222. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  223. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts +2 -0
  224. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts.map +1 -1
  225. package/daemon/dist/domain/gateway/slack/socket-inbound.js +40 -0
  226. package/daemon/dist/domain/gateway/slack/socket-inbound.js.map +1 -1
  227. package/daemon/dist/domain/gateway/slack/thread-routing.d.ts.map +1 -1
  228. package/daemon/dist/domain/gateway/slack/thread-routing.js +22 -2
  229. package/daemon/dist/domain/gateway/slack/thread-routing.js.map +1 -1
  230. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts +14 -0
  231. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts.map +1 -1
  232. package/daemon/dist/domain/gateway/slack/thread-seat-map.js +27 -0
  233. package/daemon/dist/domain/gateway/slack/thread-seat-map.js.map +1 -1
  234. package/daemon/dist/domain/generated-file-hygiene.d.ts.map +1 -1
  235. package/daemon/dist/domain/generated-file-hygiene.js +7 -4
  236. package/daemon/dist/domain/generated-file-hygiene.js.map +1 -1
  237. package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
  238. package/daemon/dist/domain/managed-blocks.js +5 -2
  239. package/daemon/dist/domain/managed-blocks.js.map +1 -1
  240. package/daemon/dist/domain/markdown-address.d.ts.map +1 -1
  241. package/daemon/dist/domain/markdown-address.js +23 -6
  242. package/daemon/dist/domain/markdown-address.js.map +1 -1
  243. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  244. package/daemon/dist/domain/native-process-lineage.js +50 -3
  245. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  246. package/daemon/dist/domain/node-inventory.d.ts +2 -2
  247. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  248. package/daemon/dist/domain/node-inventory.js +30 -4
  249. package/daemon/dist/domain/node-inventory.js.map +1 -1
  250. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  251. package/daemon/dist/domain/node-launcher.js +1 -0
  252. package/daemon/dist/domain/node-launcher.js.map +1 -1
  253. package/daemon/dist/domain/pane-binding-observation.d.ts +1 -0
  254. package/daemon/dist/domain/pane-binding-observation.d.ts.map +1 -1
  255. package/daemon/dist/domain/pane-binding-observation.js +3 -1
  256. package/daemon/dist/domain/pane-binding-observation.js.map +1 -1
  257. package/daemon/dist/domain/plugin-vendor-service.d.ts +6 -0
  258. package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
  259. package/daemon/dist/domain/plugin-vendor-service.js +12 -0
  260. package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
  261. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  262. package/daemon/dist/domain/profile-resolver.js +54 -15
  263. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  264. package/daemon/dist/domain/ps-projection.d.ts +11 -9
  265. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  266. package/daemon/dist/domain/ps-projection.js +15 -12
  267. package/daemon/dist/domain/ps-projection.js.map +1 -1
  268. package/daemon/dist/domain/queue-nudge-text.d.ts +4 -0
  269. package/daemon/dist/domain/queue-nudge-text.d.ts.map +1 -0
  270. package/daemon/dist/domain/queue-nudge-text.js +35 -0
  271. package/daemon/dist/domain/queue-nudge-text.js.map +1 -0
  272. package/daemon/dist/domain/queue-repository.d.ts +7 -0
  273. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  274. package/daemon/dist/domain/queue-repository.js +50 -20
  275. package/daemon/dist/domain/queue-repository.js.map +1 -1
  276. package/daemon/dist/domain/queue-retention.d.ts +2 -2
  277. package/daemon/dist/domain/queue-retention.js +4 -4
  278. package/daemon/dist/domain/queue-wait-backoff.d.ts.map +1 -1
  279. package/daemon/dist/domain/queue-wait-backoff.js +6 -2
  280. package/daemon/dist/domain/queue-wait-backoff.js.map +1 -1
  281. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  282. package/daemon/dist/domain/queue-waiting.js +7 -2
  283. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  284. package/daemon/dist/domain/queue-wake-ladder.d.ts +15 -2
  285. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  286. package/daemon/dist/domain/queue-wake-ladder.js +29 -6
  287. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  288. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  289. package/daemon/dist/domain/rehydrate-eligibility.js +5 -2
  290. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  291. package/daemon/dist/domain/reply-to-choice.d.ts +6 -2
  292. package/daemon/dist/domain/reply-to-choice.d.ts.map +1 -1
  293. package/daemon/dist/domain/reply-to-choice.js +9 -6
  294. package/daemon/dist/domain/reply-to-choice.js.map +1 -1
  295. package/daemon/dist/domain/restore-check-service.d.ts +5 -1
  296. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  297. package/daemon/dist/domain/restore-check-service.js +17 -3
  298. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  299. package/daemon/dist/domain/restore-orchestrator.d.ts +1 -0
  300. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  301. package/daemon/dist/domain/restore-orchestrator.js +17 -11
  302. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  303. package/daemon/dist/domain/rig-repository.d.ts +3 -1
  304. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  305. package/daemon/dist/domain/rig-repository.js +13 -4
  306. package/daemon/dist/domain/rig-repository.js.map +1 -1
  307. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  308. package/daemon/dist/domain/rig-teardown.js +6 -0
  309. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  310. package/daemon/dist/domain/rigspec-instantiator.d.ts +1 -0
  311. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  312. package/daemon/dist/domain/rigspec-instantiator.js +1 -1
  313. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  314. package/daemon/dist/domain/rigspec-preflight.d.ts +1 -1
  315. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  316. package/daemon/dist/domain/rigspec-preflight.js +8 -4
  317. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  318. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  319. package/daemon/dist/domain/rigspec-schema.js +19 -4
  320. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  321. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  322. package/daemon/dist/domain/seat-activity-service.js +16 -6
  323. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  324. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  325. package/daemon/dist/domain/seat-handover-service.js +9 -1
  326. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  327. package/daemon/dist/domain/session-jsonl.d.ts.map +1 -1
  328. package/daemon/dist/domain/session-jsonl.js +10 -4
  329. package/daemon/dist/domain/session-jsonl.js.map +1 -1
  330. package/daemon/dist/domain/session-transport.d.ts +16 -21
  331. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  332. package/daemon/dist/domain/session-transport.js +70 -37
  333. package/daemon/dist/domain/session-transport.js.map +1 -1
  334. package/daemon/dist/domain/skill-audit.d.ts +19 -0
  335. package/daemon/dist/domain/skill-audit.d.ts.map +1 -1
  336. package/daemon/dist/domain/skill-audit.js +97 -5
  337. package/daemon/dist/domain/skill-audit.js.map +1 -1
  338. package/daemon/dist/domain/skill-catalog.d.ts +11 -0
  339. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  340. package/daemon/dist/domain/skill-catalog.js +145 -12
  341. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  342. package/daemon/dist/domain/skill-mirror-drift.d.ts +6 -1
  343. package/daemon/dist/domain/skill-mirror-drift.d.ts.map +1 -1
  344. package/daemon/dist/domain/skill-mirror-drift.js +23 -12
  345. package/daemon/dist/domain/skill-mirror-drift.js.map +1 -1
  346. package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  347. package/daemon/dist/domain/snapshot-repository.js +12 -32
  348. package/daemon/dist/domain/snapshot-repository.js.map +1 -1
  349. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +4 -1
  350. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  351. package/daemon/dist/domain/terminal/herdr-adapter.js +14 -7
  352. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  353. package/daemon/dist/domain/terminal/terminal-provider.d.ts +9 -0
  354. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  355. package/daemon/dist/domain/terminal/terminal-service.d.ts +4 -0
  356. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  357. package/daemon/dist/domain/terminal/terminal-service.js +23 -11
  358. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  359. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  360. package/daemon/dist/domain/transcript-store.js +21 -9
  361. package/daemon/dist/domain/transcript-store.js.map +1 -1
  362. package/daemon/dist/domain/types.d.ts +2 -0
  363. package/daemon/dist/domain/types.d.ts.map +1 -1
  364. package/daemon/dist/domain/types.js.map +1 -1
  365. package/daemon/dist/domain/usage-samples-store.js +2 -2
  366. package/daemon/dist/domain/usage-samples-store.js.map +1 -1
  367. package/daemon/dist/domain/usage-series.d.ts.map +1 -1
  368. package/daemon/dist/domain/usage-series.js +42 -10
  369. package/daemon/dist/domain/usage-series.js.map +1 -1
  370. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  371. package/daemon/dist/domain/user-settings/settings-browser.js +2 -0
  372. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  373. package/daemon/dist/domain/user-settings/settings-store.js +1 -1
  374. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  375. package/daemon/dist/domain/watchdog-due.d.ts +17 -0
  376. package/daemon/dist/domain/watchdog-due.d.ts.map +1 -0
  377. package/daemon/dist/domain/watchdog-due.js +45 -0
  378. package/daemon/dist/domain/watchdog-due.js.map +1 -0
  379. package/daemon/dist/domain/watchdog-scheduler.d.ts.map +1 -1
  380. package/daemon/dist/domain/watchdog-scheduler.js +3 -7
  381. package/daemon/dist/domain/watchdog-scheduler.js.map +1 -1
  382. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  383. package/daemon/dist/domain/workflow-projector.js +15 -5
  384. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  385. package/daemon/dist/domain/workflow-runtime.js +1 -1
  386. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  387. package/daemon/dist/domain/workflow-step-trail-log.d.ts +6 -0
  388. package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
  389. package/daemon/dist/domain/workflow-step-trail-log.js +11 -0
  390. package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
  391. package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
  392. package/daemon/dist/domain/workflow-validator.js +22 -1
  393. package/daemon/dist/domain/workflow-validator.js.map +1 -1
  394. package/daemon/dist/domain/workspace/project-catalog.js +1 -1
  395. package/daemon/dist/domain/workspace/project-catalog.js.map +1 -1
  396. package/daemon/dist/gateway-slack-surface.d.ts +1 -0
  397. package/daemon/dist/gateway-slack-surface.d.ts.map +1 -1
  398. package/daemon/dist/gateway-slack-surface.js +2 -1
  399. package/daemon/dist/gateway-slack-surface.js.map +1 -1
  400. package/daemon/dist/index.d.ts +1 -0
  401. package/daemon/dist/index.d.ts.map +1 -1
  402. package/daemon/dist/index.js +7 -7
  403. package/daemon/dist/index.js.map +1 -1
  404. package/daemon/dist/routes/agent-images.js +5 -5
  405. package/daemon/dist/routes/agent-images.js.map +1 -1
  406. package/daemon/dist/routes/bootstrap-failure-response.d.ts +13 -0
  407. package/daemon/dist/routes/bootstrap-failure-response.d.ts.map +1 -0
  408. package/daemon/dist/routes/bootstrap-failure-response.js +52 -0
  409. package/daemon/dist/routes/bootstrap-failure-response.js.map +1 -0
  410. package/daemon/dist/routes/bundles.d.ts.map +1 -1
  411. package/daemon/dist/routes/bundles.js +23 -36
  412. package/daemon/dist/routes/bundles.js.map +1 -1
  413. package/daemon/dist/routes/chat.d.ts.map +1 -1
  414. package/daemon/dist/routes/chat.js +16 -1
  415. package/daemon/dist/routes/chat.js.map +1 -1
  416. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  417. package/daemon/dist/routes/restore-check.js +2 -0
  418. package/daemon/dist/routes/restore-check.js.map +1 -1
  419. package/daemon/dist/routes/rigs.js +2 -2
  420. package/daemon/dist/routes/rigs.js.map +1 -1
  421. package/daemon/dist/routes/seat.js +13 -13
  422. package/daemon/dist/routes/seat.js.map +1 -1
  423. package/daemon/dist/routes/sessions.js +11 -11
  424. package/daemon/dist/routes/sessions.js.map +1 -1
  425. package/daemon/dist/routes/skills.d.ts.map +1 -1
  426. package/daemon/dist/routes/skills.js +15 -7
  427. package/daemon/dist/routes/skills.js.map +1 -1
  428. package/daemon/dist/routes/terminal-ws.js +15 -2
  429. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  430. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  431. package/daemon/dist/routes/terminal.js +6 -4
  432. package/daemon/dist/routes/terminal.js.map +1 -1
  433. package/daemon/dist/routes/up.d.ts.map +1 -1
  434. package/daemon/dist/routes/up.js +5 -56
  435. package/daemon/dist/routes/up.js.map +1 -1
  436. package/daemon/dist/startup.d.ts.map +1 -1
  437. package/daemon/dist/startup.js +32 -7
  438. package/daemon/dist/startup.js.map +1 -1
  439. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  440. package/daemon/dist/terminal/TerminalSessionBroker.js +9 -1
  441. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  442. package/daemon/docs/reference/agent-spec.md +10 -10
  443. package/daemon/docs/reference/agent-startup-guide.md +7 -2
  444. package/daemon/docs/reference/bundle-formats.md +6 -4
  445. package/daemon/docs/reference/chain-file-convention.md +2 -2
  446. package/daemon/docs/reference/developing.md +1 -1
  447. package/daemon/docs/reference/edge-types.md +1 -1
  448. package/daemon/docs/reference/getting-started.md +356 -212
  449. package/daemon/docs/reference/help.md +48 -19
  450. package/daemon/docs/reference/instance-layout.md +5 -0
  451. package/daemon/docs/reference/non-interruptive-mode.md +7 -4
  452. package/daemon/docs/reference/project-workspace.md +2 -2
  453. package/daemon/docs/reference/publishing-a-rig-bundle.md +15 -10
  454. package/daemon/docs/reference/refocus-channel.md +14 -2
  455. package/daemon/docs/reference/rig-bundle.md +39 -19
  456. package/daemon/docs/reference/rig-spec.md +48 -20
  457. package/daemon/docs/reference/rosters.md +2 -1
  458. package/daemon/docs/reference/schemas/registry-entry.v1.schema.json +1 -1
  459. package/daemon/docs/reference/sdlc-conventions.md +4 -2
  460. package/daemon/docs/reference/slack-app-setup.md +69 -9
  461. package/daemon/docs/reference/topology-naming.md +74 -0
  462. package/daemon/docs/reference/whats-new.md +96 -0
  463. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +6 -0
  464. package/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md +3 -0
  465. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +1 -1
  466. package/daemon/specs/agents/shared/skills/core/openrig-software-factory/SKILL.md +19 -12
  467. package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +17 -16
  468. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +2 -0
  469. package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +60 -0
  470. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +105 -19
  471. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +5 -2
  472. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +44 -0
  473. package/dist/build-info.js +3 -3
  474. package/dist/cli-error.d.ts.map +1 -1
  475. package/dist/cli-error.js +11 -3
  476. package/dist/cli-error.js.map +1 -1
  477. package/dist/client.d.ts +2 -0
  478. package/dist/client.d.ts.map +1 -1
  479. package/dist/client.js +2 -0
  480. package/dist/client.js.map +1 -1
  481. package/dist/commands/agent-image.js +2 -2
  482. package/dist/commands/agent-image.js.map +1 -1
  483. package/dist/commands/bundle.d.ts.map +1 -1
  484. package/dist/commands/bundle.js +5 -4
  485. package/dist/commands/bundle.js.map +1 -1
  486. package/dist/commands/chatroom.d.ts.map +1 -1
  487. package/dist/commands/chatroom.js +21 -1
  488. package/dist/commands/chatroom.js.map +1 -1
  489. package/dist/commands/context.d.ts.map +1 -1
  490. package/dist/commands/context.js +12 -2
  491. package/dist/commands/context.js.map +1 -1
  492. package/dist/commands/doctor.d.ts +3 -1
  493. package/dist/commands/doctor.d.ts.map +1 -1
  494. package/dist/commands/doctor.js +14 -7
  495. package/dist/commands/doctor.js.map +1 -1
  496. package/dist/commands/down.d.ts.map +1 -1
  497. package/dist/commands/down.js +42 -0
  498. package/dist/commands/down.js.map +1 -1
  499. package/dist/commands/gateway.d.ts.map +1 -1
  500. package/dist/commands/gateway.js +4 -3
  501. package/dist/commands/gateway.js.map +1 -1
  502. package/dist/commands/launch.d.ts.map +1 -1
  503. package/dist/commands/launch.js +114 -8
  504. package/dist/commands/launch.js.map +1 -1
  505. package/dist/commands/package.d.ts.map +1 -1
  506. package/dist/commands/package.js +6 -3
  507. package/dist/commands/package.js.map +1 -1
  508. package/dist/commands/policy.d.ts.map +1 -1
  509. package/dist/commands/policy.js +6 -5
  510. package/dist/commands/policy.js.map +1 -1
  511. package/dist/commands/proof.js +1 -1
  512. package/dist/commands/proof.js.map +1 -1
  513. package/dist/commands/queue.d.ts.map +1 -1
  514. package/dist/commands/queue.js +6 -3
  515. package/dist/commands/queue.js.map +1 -1
  516. package/dist/commands/restore-packet.d.ts.map +1 -1
  517. package/dist/commands/restore-packet.js +6 -4
  518. package/dist/commands/restore-packet.js.map +1 -1
  519. package/dist/commands/scope.js +6 -6
  520. package/dist/commands/scope.js.map +1 -1
  521. package/dist/commands/setup.d.ts +6 -15
  522. package/dist/commands/setup.d.ts.map +1 -1
  523. package/dist/commands/setup.js +121 -332
  524. package/dist/commands/setup.js.map +1 -1
  525. package/dist/commands/skill.d.ts.map +1 -1
  526. package/dist/commands/skill.js +12 -1
  527. package/dist/commands/skill.js.map +1 -1
  528. package/dist/commands/slack.d.ts +5 -1
  529. package/dist/commands/slack.d.ts.map +1 -1
  530. package/dist/commands/slack.js +143 -6
  531. package/dist/commands/slack.js.map +1 -1
  532. package/dist/commands/stream.js +1 -1
  533. package/dist/commands/stream.js.map +1 -1
  534. package/dist/commands/terminal.d.ts +33 -0
  535. package/dist/commands/terminal.d.ts.map +1 -1
  536. package/dist/commands/terminal.js +30 -12
  537. package/dist/commands/terminal.js.map +1 -1
  538. package/dist/commands/tui.js +4 -4
  539. package/dist/commands/tui.js.map +1 -1
  540. package/dist/commands/workflow-follow.d.ts +1 -1
  541. package/dist/commands/workflow-follow.d.ts.map +1 -1
  542. package/dist/commands/workflow-follow.js +4 -3
  543. package/dist/commands/workflow-follow.js.map +1 -1
  544. package/dist/commands/workflow.d.ts.map +1 -1
  545. package/dist/commands/workflow.js +30 -18
  546. package/dist/commands/workflow.js.map +1 -1
  547. package/dist/config-store.js +1 -1
  548. package/dist/config-store.js.map +1 -1
  549. package/dist/front-door.d.ts.map +1 -1
  550. package/dist/front-door.js +4 -2
  551. package/dist/front-door.js.map +1 -1
  552. package/dist/herdr-launch-config.d.ts +3 -0
  553. package/dist/herdr-launch-config.d.ts.map +1 -0
  554. package/dist/herdr-launch-config.js +37 -0
  555. package/dist/herdr-launch-config.js.map +1 -0
  556. package/dist/index.d.ts.map +1 -1
  557. package/dist/index.js +2 -1
  558. package/dist/index.js.map +1 -1
  559. package/dist/launch-plan-guard.d.ts +27 -0
  560. package/dist/launch-plan-guard.d.ts.map +1 -0
  561. package/dist/launch-plan-guard.js +73 -0
  562. package/dist/launch-plan-guard.js.map +1 -0
  563. package/dist/lib/bundle-source.d.ts +2 -0
  564. package/dist/lib/bundle-source.d.ts.map +1 -1
  565. package/dist/lib/bundle-source.js +12 -1
  566. package/dist/lib/bundle-source.js.map +1 -1
  567. package/dist/lib/context-git.d.ts +2 -0
  568. package/dist/lib/context-git.d.ts.map +1 -1
  569. package/dist/lib/context-git.js +55 -5
  570. package/dist/lib/context-git.js.map +1 -1
  571. package/dist/lib/scope/scope-fs.d.ts +3 -2
  572. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  573. package/dist/lib/scope/scope-fs.js +97 -9
  574. package/dist/lib/scope/scope-fs.js.map +1 -1
  575. package/dist/lib/scope/templates.d.ts.map +1 -1
  576. package/dist/lib/scope/templates.js +28 -24
  577. package/dist/lib/scope/templates.js.map +1 -1
  578. package/dist/provider-auth.d.ts +32 -0
  579. package/dist/provider-auth.d.ts.map +1 -0
  580. package/dist/provider-auth.js +128 -0
  581. package/dist/provider-auth.js.map +1 -0
  582. package/dist/terminal-window.d.ts +19 -0
  583. package/dist/terminal-window.d.ts.map +1 -0
  584. package/dist/terminal-window.js +513 -0
  585. package/dist/terminal-window.js.map +1 -0
  586. package/package.json +2 -2
  587. package/tui/dist/commands/registry.js +2 -2
  588. package/tui/dist/commands/registry.js.map +1 -1
  589. package/tui/dist/config/config-model.d.ts.map +1 -1
  590. package/tui/dist/config/config-model.js +1 -0
  591. package/tui/dist/config/config-model.js.map +1 -1
  592. package/tui/dist/connections/connections-model.d.ts +5 -0
  593. package/tui/dist/connections/connections-model.d.ts.map +1 -1
  594. package/tui/dist/connections/connections-model.js +1 -1
  595. package/tui/dist/connections/connections-model.js.map +1 -1
  596. package/tui/dist/daemon-client.d.ts +5 -0
  597. package/tui/dist/daemon-client.d.ts.map +1 -1
  598. package/tui/dist/daemon-client.js.map +1 -1
  599. package/tui/dist/execution/workflow-model.d.ts.map +1 -1
  600. package/tui/dist/execution/workflow-model.js +3 -1
  601. package/tui/dist/execution/workflow-model.js.map +1 -1
  602. package/tui/dist/hydrate.d.ts +1 -1
  603. package/tui/dist/hydrate.d.ts.map +1 -1
  604. package/tui/dist/hydrate.js +3 -1
  605. package/tui/dist/hydrate.js.map +1 -1
  606. package/tui/dist/main.js +39 -15
  607. package/tui/dist/main.js.map +1 -1
  608. package/tui/dist/page-read.js +1 -1
  609. package/tui/dist/page-read.js.map +1 -1
  610. package/tui/dist/pending-address.d.ts +7 -0
  611. package/tui/dist/pending-address.d.ts.map +1 -0
  612. package/tui/dist/pending-address.js +11 -0
  613. package/tui/dist/pending-address.js.map +1 -0
  614. package/tui/dist/render.d.ts.map +1 -1
  615. package/tui/dist/render.js +10 -6
  616. package/tui/dist/render.js.map +1 -1
  617. package/tui/dist/scopes/scopes-model.js +4 -4
  618. package/tui/dist/socket-server.d.ts +3 -1
  619. package/tui/dist/socket-server.d.ts.map +1 -1
  620. package/tui/dist/socket-server.js +6 -0
  621. package/tui/dist/socket-server.js.map +1 -1
  622. package/tui/dist/state.d.ts.map +1 -1
  623. package/tui/dist/state.js +40 -13
  624. package/tui/dist/state.js.map +1 -1
  625. package/tui/dist/stylize.js +1 -1
  626. package/tui/dist/stylize.js.map +1 -1
  627. package/tui/dist/terminals/open-window.d.ts +5 -0
  628. package/tui/dist/terminals/open-window.d.ts.map +1 -0
  629. package/tui/dist/terminals/open-window.js +55 -0
  630. package/tui/dist/terminals/open-window.js.map +1 -0
  631. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  632. package/tui/dist/terminals/terminal-model.js +16 -17
  633. package/tui/dist/terminals/terminal-model.js.map +1 -1
  634. package/tui/dist/types.d.ts +16 -1
  635. package/tui/dist/types.d.ts.map +1 -1
  636. package/ui/dist/assets/{index-HHSvwF97.js → index-D5n8EwkG.js} +1 -1
  637. package/ui/dist/index.html +1 -1
@@ -11,10 +11,14 @@ const fs = require("node:fs");
11
11
  const path = require("node:path");
12
12
  const crypto = require("node:crypto");
13
13
  const { spawnSync } = require("node:child_process");
14
+ const { recordRefocusResult } = require("./refocus-health.cjs");
14
15
 
15
16
  const DEFAULT_THRESHOLD = 2_600_000;
16
17
  const FALSE_VALUES = new Set(["0", "false", "off", "no"]);
17
18
  const CONTENT_LOOKUP_TIMEOUT_MS = 2_000;
19
+ // Normal managed restore advances on ~30 s polls with a 10 s idle wait.
20
+ // A lost daemon stage must not suppress this occupant's refocus indefinitely.
21
+ const MANAGED_RESTORE_HOLD_MS = 10 * 60_000;
18
22
 
19
23
  function runtime() {
20
24
  const index = process.argv.indexOf("--runtime");
@@ -188,6 +192,7 @@ function renderTrace() {
188
192
  script,
189
193
  "--trees", trees,
190
194
  "--depth", process.env.OPENRIG_REFOCUS_DEPTH || "light",
195
+ "--check",
191
196
  ];
192
197
  if (process.env.OPENRIG_REFOCUS_TOPOLOGY_NODE) {
193
198
  args.push("--topology-start", process.env.OPENRIG_REFOCUS_TOPOLOGY_NODE);
@@ -213,9 +218,15 @@ function renderTrace() {
213
218
  maxBuffer: 16 * 1024 * 1024,
214
219
  });
215
220
  const reason = result.error?.message || result.stderr?.trim() || `trace exited ${result.status ?? "without a status"}`;
216
- const trace = !result.error && result.status === 0 && result.stdout.trim()
217
- ? result.stdout.trim() : `TRACE GAP — ${String(reason).replace(/\s+/g, " ").trim()}`;
218
- return [trace, role].filter(Boolean).join("\n\n");
221
+ const failed = Boolean(result.error) || result.status !== 0 || !result.stdout?.trim();
222
+ const trace = [
223
+ ...(failed ? [`TRACE GAP — ${String(reason).replace(/\s+/g, " ").trim()}`] : []),
224
+ result.stdout?.trim(),
225
+ ].filter(Boolean).join("\n");
226
+ return {
227
+ text: [trace, role].filter(Boolean).join("\n\n"),
228
+ failed,
229
+ };
219
230
  }
220
231
 
221
232
  (async () => {
@@ -226,6 +237,16 @@ function renderTrace() {
226
237
  const event = input.hook_event_name || "UserPromptSubmit";
227
238
  const harness = runtime();
228
239
 
240
+ // The acknowledgement is never an actionable restore turn. The managed
241
+ // marker below also holds earlier/later peer messages, not just this prompt.
242
+ const rawPrompt = typeof input.prompt === "string" ? input.prompt.trim() : "";
243
+ // Claude can wrap a complete submitted message as pasted content. Unwrap only
244
+ // that envelope; a peer quoting a restore request is still an ordinary prompt.
245
+ const prompt = harness === "claude"
246
+ ? (rawPrompt.match(/^<pasted_content id="([^"]+)">\s*([\s\S]*)\s*<\/pasted_content id="\1">$/)?.[2]?.trim() ?? rawPrompt)
247
+ : rawPrompt;
248
+ if (event === "UserPromptSubmit" && prompt.startsWith("OpenRig post-compaction turn boundary.")) process.exit(0);
249
+
229
250
  // Fresh-session orientation is the default onboarding pack's job. Even a manually invoked hook must
230
251
  // no-op here, so a stale registration cannot corrupt the world install.
231
252
  if (event === "SessionStart") process.exit(0);
@@ -311,16 +332,16 @@ function renderTrace() {
311
332
  state = { lastBytes: size, baselineAt: new Date().toISOString() };
312
333
  persist();
313
334
  } else if (size > 0 && size < Number(state.lastBytes || 0)) {
314
- // Shrink clears pending and resets the baseline BEFORE due computation. The
315
- // reset itself emits no refocus, and a stale pending can never ride through a
316
- // reset into a delivery. Advisory once per reset episode: the reset moment is
317
- // the dedupe (afterwards lastBytes === size), and the marker records in state.
318
- delete state.pendingOn;
319
- delete state.pendingAt;
335
+ // Shrink invalidates growth-based due state, not an exact PostCompact event
336
+ // awaiting its actionable restore turn.
337
+ if (state.pendingOn !== "PostCompact") {
338
+ delete state.pendingOn;
339
+ delete state.pendingAt;
340
+ }
320
341
  state.lastReset = { at: new Date().toISOString(), fromBytes: Number(state.lastBytes || 0), toBytes: size };
321
342
  state.lastBytes = size;
322
343
  persist();
323
- process.stderr.write(`refocus: transcript shrank for ${seat} — baseline reset, pending cleared\n`);
344
+ process.stderr.write(`refocus: transcript shrank for ${seat} — baseline reset; PostCompact pending retained if present\n`);
324
345
  }
325
346
 
326
347
  const lastBytes = Number(state.lastBytes || 0);
@@ -334,17 +355,46 @@ function renderTrace() {
334
355
  if (!due) process.exit(0);
335
356
 
336
357
  if (event !== "UserPromptSubmit") {
358
+ if (event === "PostCompact" && harness === "claude") {
359
+ // PreCompact records whether THIS compact was initiated by the enforcer.
360
+ // A manual /compact overwrites the marker with false; other occupants
361
+ // cannot hold this session. Read the early sentinel first if it survives.
362
+ state.managedRestorePending = false;
363
+ for (const suffix of [".expected.json", ".json"]) {
364
+ try {
365
+ const marker = JSON.parse(fs.readFileSync(path.join(home, "compaction", "restore-pending", seatKey + suffix), "utf8"));
366
+ if (marker.sessionName !== seat || (marker.sessionId ? marker.sessionId !== identity : !transcriptPath || marker.transcriptPath !== transcriptPath)) continue;
367
+ state.managedRestorePending = marker.managedRefocusPending === true;
368
+ break;
369
+ } catch {}
370
+ }
371
+ if (state.managedRestorePending) state.managedRestorePendingAt = new Date().toISOString();
372
+ else delete state.managedRestorePendingAt;
373
+ }
337
374
  if (event === "PostCompact" || !state.pendingOn) state.pendingOn = event;
338
375
  state.pendingAt ||= new Date().toISOString();
339
376
  persist();
340
377
  process.exit(0);
341
378
  }
342
379
 
380
+ if (harness === "claude" && state.managedRestorePending) {
381
+ const heldFor = Date.now() - Date.parse(state.managedRestorePendingAt);
382
+ // Missing/invalid timestamps from older state, or a clock moving backwards,
383
+ // cannot establish a live hold. No timer or extra turn is created here.
384
+ if (heldFor >= 0 && heldFor < MANAGED_RESTORE_HOLD_MS
385
+ && !prompt.startsWith("Please respond to this normal user message now by restoring this Claude session after compaction.")) process.exit(0);
386
+ delete state.managedRestorePending;
387
+ delete state.managedRestorePendingAt;
388
+ persist();
389
+ }
390
+
343
391
  // Run the public trace before resolving a context ref. Besides keeping the
344
392
  // content ladder untouched, this makes `rig context get` the last resolver
345
393
  // call and preserves the existing observable ref contract.
346
- const trace = renderTrace();
394
+ const rendered = renderTrace();
395
+ const trace = rendered.text;
347
396
  const configured = readConfiguredContent(home);
397
+ const failed = rendered.failed || Boolean(configured.failure);
348
398
  const why = onDemand
349
399
  ? "on demand"
350
400
  : state.pendingOn === "PostCompact"
@@ -391,7 +441,14 @@ function renderTrace() {
391
441
  additionalContext: payload,
392
442
  },
393
443
  });
394
- process.stdout.write(output, () => {
444
+ process.stdout.write(output, (error) => {
445
+ recordRefocusResult({ home, seat, identity, failed: failed || Boolean(error) });
446
+ if (failed || error) {
447
+ state.pendingOn ||= event;
448
+ state.pendingAt ||= new Date().toISOString();
449
+ persist();
450
+ return;
451
+ }
395
452
  if (size > 0) state.lastBytes = size;
396
453
  state.firedAt = new Date().toISOString();
397
454
  state.firedOn = event;
@@ -92,8 +92,10 @@ You are about to lose every connection you have built. Spend this turn making th
92
92
  What were the threads? What did you work out about how the pieces fit? What is unfinished? What did you
93
93
  decide, and why? What were you about to be wrong about?
94
94
  2. **Write the restore map at the exact path named in OpenRig's preparation request.** Follow that
95
- request's completion marker and atomic publication instructions: the daemon waits for that specific
96
- file. Do not substitute the seat folder or another map. Managed preparation normally uses
95
+ request's completion instructions: use your ordinary file-edit tool to write the named `.tmp` file,
96
+ with the exact completion marker as its last line, then finish and close it. The daemon publishes
97
+ the completed map atomically; do not run a shell rename or write the final file incrementally.
98
+ Do not substitute the seat folder or another map. Managed preparation normally publishes
97
99
  `<launch cwd>/.openrig/compaction/preparation/<session>/<attempt>/RESTORE-MAP.md`; its parent
98
100
  compaction folder ignores itself in Git because maps hold private working context. Unknown or
99
101
  unwritable launch directories retain the instance-home fallback named in the request; it may need
@@ -149,6 +151,15 @@ already leaves you. The edges are the point.
149
151
 
150
152
  You have facts without connections. Rebuild the connections before you act on anything.
151
153
 
154
+ Use the native read tool for file reads throughout restoration. Load `refocusing`
155
+ and consume the current topology and work trace that actually arrived with the
156
+ restore request; do not rerun Python merely to duplicate it. If no current trace
157
+ arrived, name that delivery gap. A packet pointer, compact summary or truncated
158
+ extract is not a full source read. Read required notes and full sources separately
159
+ and complete the restore steps and read-depth audit below; partial reading does
160
+ not establish completed restoration. The earlier acknowledgement-only boundary
161
+ is not a restore request.
162
+
152
163
  1. **Check for a hold first.** Read the restore request, the per-seat instruction file
153
164
  (`<OPENRIG_HOME>/compaction/post-compact-extra/<session>.md`, named by your full session such as
154
165
  `dev-impl@my-rig.md`) when it exists, the newest row or message from whoever routes your work, and any hold
@@ -125,6 +125,8 @@ function writeExpectedSentinel(input) {
125
125
  fs.mkdirSync(path.dirname(p), { recursive: true });
126
126
  fs.writeFileSync(p, `${JSON.stringify({
127
127
  version: 1,
128
+ managedRefocusPending: typeof input.custom_instructions === "string"
129
+ && input.custom_instructions.trimStart().startsWith("OpenRig managed compaction; wait for the restore request."),
128
130
  sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
129
131
  sessionId: input.session_id || input.sessionId || null,
130
132
  transcriptPath: input.transcript_path || null,
@@ -137,6 +139,8 @@ function writePendingRestoreMarker(input, parsed, restoreInstruction, customMess
137
139
  fs.mkdirSync(path.dirname(markerPath), { recursive: true });
138
140
  const payload = {
139
141
  version: 1,
142
+ managedRefocusPending: typeof input.custom_instructions === "string"
143
+ && input.custom_instructions.trimStart().startsWith("OpenRig managed compaction; wait for the restore request."),
140
144
  createdAt: nowIso(),
141
145
  sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
142
146
  sessionId: input.session_id || input.sessionId || null,
@@ -92,6 +92,12 @@ the human (a pending human decision, or a row parked on the human), since a
92
92
  reply in that thread would answer the decision. In every such case the
93
93
  `--verify` result says `threaded: false` with the reason.
94
94
 
95
+ To answer a reply the human typed inside one of your threads, `--reply-to` the
96
+ row their reply landed as. The update posts in that thread unless one of the
97
+ cases above applies, and `--verify` reports it the same way. A message the
98
+ human started at the top level of the channel has no thread yet, so the answer
99
+ posts as a new message.
100
+
95
101
  A **decision** with a few clear choices can carry `--human-questions-file <path>`:
96
102
  a JSON array of 1–4 questions, each
97
103
  `{"id", "question", "options": [{"id", "label", "recommended"?}]}` with 2–4
@@ -57,7 +57,7 @@ These are auto-delivered to every rig; their name+description are already in you
57
57
  - **loading-addressable-markdown** — a task names Markdown as `path#h2-slug` or `path#h2-slug/h3-slug` outside the context-pack library.
58
58
  - **session-compaction-and-restore** — preparing for, or recovering from, compaction (any runtime). The write- and read-side protocol.
59
59
  - **queue-handoff** — you're passing durable work to another seat or ending your turn. The queue is the work ledger, not chat.
60
- - **refocusing** — a long-running seat may have lost the product outcome, crossed a major boundary, or compacted and needs a fresh path-based trace.
60
+ - **refocusing** — invoke as `refocusing` when a long-running seat may have lost the product outcome, crossed a major boundary, or compacted and needs a fresh path-based trace.
61
61
  - **seat-continuity-and-handover** — handing your seat's work across a restart or to another owner.
62
62
  - **orienting-to-an-inherited-seat** — you just inherited an existing seat through a planned handover and need to verify its identity, state, and testimony.
63
63
  - **retiring-and-inheriting-a-seat** — you're planning a seat transition and need to retire the current occupant into a fresh successor without losing continuity.
@@ -11,20 +11,47 @@ metadata:
11
11
 
12
12
  # Refocusing
13
13
 
14
+ Invoke the skill as `refocusing`, its frontmatter name. OpenRig seeds it in the
15
+ Claude and Codex global skill roots and includes selected plugin skills in managed
16
+ loadouts. Existing externally managed copies remain authoritative. If the harness
17
+ has not discovered it yet, read this installed skill file and run its script directly;
18
+ hook registration alone does not prove native skill discovery.
19
+
14
20
  Refocus preserves a long session's earned expertise while re-grounding it in current intent and
15
21
  lived context. It is not a restart, wake, or phase checkpoint.
16
22
 
17
- Run the bundled trace from this skill directory instead of reconstructing the hierarchy from memory:
23
+ During an actionable managed restore, consume the current topology and work trace
24
+ that actually arrived with the request. Do not rerun Python merely to duplicate it.
25
+ If no current trace arrived, name that delivery gap. A packet pointer, compact
26
+ summary or truncated extract is not a full source read. Use the native file-read
27
+ tool for required notes and full sources, and complete the existing restore audit;
28
+ partial file reads do not establish completed refocus or restoration.
29
+
30
+ For a new trace outside that delivered context, follow the command guidance below.
31
+ Resolve the bundled script's absolute path from the directory of this loaded skill.
32
+ Stay in your current working directory; do not `cd` into the skill directory, which
33
+ can change the inferred work node. Run the trace as **one plain command**, replacing
34
+ the example path with the actual absolute path written out in the tool call:
18
35
 
19
36
  ```bash
20
- python3 scripts/trace-to-root.py --trees both --depth light
37
+ python3 "/absolute/path/to/refocusing/scripts/trace-to-root.py" --trees both --depth light
21
38
  ```
22
39
 
40
+ Do not combine this command with shell variables, environment assignments, command
41
+ substitution, exit-status printing or file-reading loops. Read the named source
42
+ files separately with the native read tool. Combined shell loops or variables can
43
+ require native approval even when the intended operations are read-only; a plain
44
+ command is not a guarantee that approval will never be needed.
45
+
46
+ For managed compaction, refocus during the restore request or its read-depth
47
+ audit. The earlier acknowledgement-only boundary is not permission to restore.
48
+
23
49
  Use `--trees topology|work|both` to select context domains and `--depth light|full` to control how
24
50
  much each node contributes. Light work traces compose `intent:` and name notes; full traces include
25
51
  the complete node and notes bodies. The script resolves `topology.root` and `workspace.root` with
26
- `rig config get`. When a current node cannot be derived, set `OPENRIG_REFOCUS_TOPOLOGY_NODE` or
27
- `OPENRIG_REFOCUS_WORK_NODE`, or pass the matching `--*-start` option.
52
+ `rig config get`. When a known current node must be supplied, pass `--work-start` or
53
+ `--topology-start` with its literal absolute path in the same plain command. Do not
54
+ substitute the project root for a mission or slice node and claim that mission was traced.
28
55
 
29
56
  The trace walks the topology and work trees. For the project's own declared context (intent, context files,
30
57
  skills), `rig context work-install` lists it; read what the next action needs.
@@ -148,10 +148,11 @@ def light_learned(text):
148
148
  return body[:boundary if boundary > 0 else 800].rstrip() + "\n[… use --depth full for the rest]"
149
149
 
150
150
 
151
- def render_topology(start, root, depth):
151
+ def render_topology(start, root, depth, failures):
152
152
  output = ["## TOPOLOGY TRACE", f"root: {root}", f"start: {start}"]
153
153
  nodes, error = ascent(start, root)
154
154
  if error:
155
+ failures.append(error)
155
156
  return "\n".join(output + [f"TRACE GAP — {error}"])
156
157
  for node in nodes:
157
158
  chain_file = node / "LEARNED.md"
@@ -165,12 +166,13 @@ def render_topology(start, root, depth):
165
166
  return "\n".join(output)
166
167
 
167
168
 
168
- def render_work(start, root, depth, fallback=None):
169
+ def render_work(start, root, depth, failures, fallback=None):
169
170
  output = ["## WORK TRACE", f"root: {root}", f"start: {start}"]
170
171
  if fallback:
171
172
  output.append(f"FALLBACK — {fallback}")
172
173
  nodes, error = ascent(start, root)
173
174
  if error:
175
+ failures.append(error)
174
176
  return "\n".join(output + [f"TRACE GAP — {error}"])
175
177
  for node in nodes:
176
178
  label = node.relative_to(root) or Path(".")
@@ -188,12 +190,14 @@ def render_work(start, root, depth, fallback=None):
188
190
 
189
191
  notes, resolution_error = resolve_notes(node)
190
192
  if resolution_error:
193
+ failures.append(resolution_error)
191
194
  output.append(f"NOTES RESOLUTION GAP — {resolution_error} at {node}")
192
195
  elif notes:
193
196
  notes_path, notes_name = notes
194
197
  if depth == "full":
195
198
  notes_text = read(notes_path)
196
199
  if notes_text is None:
200
+ failures.append(f"unreadable notes: {notes_path}")
197
201
  output.append(f"NOTES RESOLUTION GAP — resolved {notes_name} became unreadable at {notes_path}")
198
202
  else:
199
203
  output.append(f"\nNOTES · {notes_name}\n{notes_text.strip()}")
@@ -201,6 +205,7 @@ def render_work(start, root, depth, fallback=None):
201
205
  try:
202
206
  size = notes_path.stat().st_size
203
207
  except OSError:
208
+ failures.append(f"unreadable notes: {notes_path}")
204
209
  output.append(f"NOTES RESOLUTION GAP — resolved {notes_name} became unreadable at {notes_path}")
205
210
  else:
206
211
  output.append(f"NOTES · {notes_name} · {size} bytes · {notes_path}")
@@ -273,43 +278,49 @@ def main():
273
278
  parser.add_argument("--work-start")
274
279
  parser.add_argument("--work-basis", help="the daemon's reason no current work node was named")
275
280
  parser.add_argument("--work-unknown", help="why the current work node could not be read")
281
+ parser.add_argument("--check", action="store_true", help="exit nonzero on trace or notes resolution failure; rendered text is unchanged")
276
282
  args = parser.parse_args()
277
283
 
278
284
  sections = []
285
+ failures = []
286
+
287
+ def gap(text):
288
+ failures.append(text)
289
+ return text
279
290
  if args.trees in {"topology", "both"}:
280
291
  root = configured_root("topology.root", "OPENRIG_TOPOLOGY_ROOT")
281
292
  if root is None:
282
- sections.append("## TOPOLOGY TRACE\nTRACE GAP — topology.root is unresolved")
293
+ sections.append(gap("## TOPOLOGY TRACE\nTRACE GAP — topology.root is unresolved"))
283
294
  else:
284
295
  start = Path(args.topology_start) if args.topology_start else derive_topology_start(root)
285
- sections.append(render_topology(start, root, args.depth) if start else
286
- "## TOPOLOGY TRACE\nTRACE GAP — current topology node is unresolved; set OPENRIG_REFOCUS_TOPOLOGY_NODE")
296
+ sections.append(render_topology(start, root, args.depth, failures) if start else
297
+ gap("## TOPOLOGY TRACE\nTRACE GAP — current topology node is unresolved; pass --topology-start with a literal absolute path (or configure OPENRIG_REFOCUS_TOPOLOGY_NODE separately)"))
287
298
 
288
299
  if args.trees in {"work", "both"}:
289
300
  root = configured_root("workspace.root", "OPENRIG_WORKSPACE_ROOT")
290
301
  if root is None:
291
- sections.append("## WORK TRACE\nTRACE GAP — workspace.root is unresolved")
302
+ sections.append(gap("## WORK TRACE\nTRACE GAP — workspace.root is unresolved"))
292
303
  else:
293
304
  # Precedence: an explicit start wins; then the hook's daemon answer (basis or unknown);
294
305
  # only a standalone run with neither falls back to inferring from the working directory.
295
306
  explicit = args.work_start or os.environ.get("OPENRIG_REFOCUS_WORK_NODE")
296
307
  if explicit:
297
- sections.append(render_work(Path(explicit), root, args.depth))
308
+ sections.append(render_work(Path(explicit), root, args.depth, failures))
298
309
  elif args.work_basis == NO_CURRENT_BATON_BASIS:
299
- sections.append(render_work(root, root, args.depth, fallback=(
310
+ sections.append(render_work(root, root, args.depth, failures, fallback=(
300
311
  f"no current typed baton ({args.work_basis}). Showing the project-level chain from the work root: "
301
312
  "a broad orientation, not evidence of a current mission")))
302
313
  elif args.work_basis:
303
- sections.append(f"## WORK TRACE\nTRACE GAP — no single current work node: {args.work_basis}")
314
+ sections.append(gap(f"## WORK TRACE\nTRACE GAP — no single current work node: {args.work_basis}"))
304
315
  elif args.work_unknown:
305
- sections.append(f"## WORK TRACE\nTRACE GAP — current work node UNKNOWN: {args.work_unknown}")
316
+ sections.append(gap(f"## WORK TRACE\nTRACE GAP — current work node UNKNOWN: {args.work_unknown}"))
306
317
  else:
307
318
  start = derive_work_start(root)
308
- sections.append(render_work(start, root, args.depth) if start else
309
- "## WORK TRACE\nTRACE GAP — current work node is unresolved; set OPENRIG_REFOCUS_WORK_NODE")
319
+ sections.append(render_work(start, root, args.depth, failures) if start else
320
+ gap("## WORK TRACE\nTRACE GAP — current work node is unresolved; pass --work-start with a literal absolute path (or configure OPENRIG_REFOCUS_WORK_NODE separately)"))
310
321
 
311
322
  print("\n\n".join(sections))
312
- return 0
323
+ return 1 if args.check and failures else 0
313
324
 
314
325
 
315
326
  if __name__ == "__main__":
@@ -61,6 +61,9 @@ threshold you can see coming; fall back to compaction only when a transition was
61
61
  cadence, on which surface, and who will hold it after cutover. Carry each duty both in this
62
62
  packet and in durable seat state, because recurring duties are the content most often lost at
63
63
  a generation boundary while urgent one-off work carries cleanly.
64
+ **Write the seat's recap too:** run `rig context recap-write --rig <rig> --seat <seat> --file <draft>`
65
+ alongside updating `LEARNED.md`. A `rebuild` reads `RECAP.md` before anything else. The format
66
+ the store checks is in `seat-continuity-and-handover`, "Write the seat's recap before a handover".
64
67
  3. **Prime the fresh successor** — `rig walk` the packet into the seat (paced delivery lets the
65
68
  successor absorb it in order), or launch-with-packet. The successor reads it as
66
69
  *inheritance*, not *identity*. **The packet's first-read line MUST point the successor at
@@ -124,6 +124,48 @@ and provenance results independently. A help listing or dry-run is not proof of
124
124
  successful transition. The linked cutover SOP supplies the operator mechanics
125
125
  and required effect checks after the named owner authorizes the action.
126
126
 
127
+ ## Write the seat's recap before a handover
128
+
129
+ A `rebuild` primes the successor from the seat's durable artifacts, highest trust
130
+ first:
131
+ 1. the authored `RECAP.md`;
132
+ 2. `LEARNED.md`;
133
+ 3. the latest restore packet, when one is marked;
134
+ 4. the superseded recaps.
135
+
136
+ A missing `RECAP.md` is recorded as a gap. The successor is directed to the remaining
137
+ available artifacts in that order. So before a handover, a compaction or a long pause,
138
+ the sitting occupant writes its recap alongside `LEARNED.md`:
139
+
140
+ ```sh
141
+ rig context recap-write --rig <rig> --seat <seat> --file <draft.md>
142
+ ```
143
+
144
+ - `<seat>` is the seat's folder under `rigs/<rig>/seats/`, the part of its session
145
+ name before `@`.
146
+ - The command reads `topology.root` and doesn't need the daemon.
147
+ - Each write moves the previous recap into the seat's `recap-superseded/` chain,
148
+ which later rebuilds also read. Write through this command, not a file tool, so
149
+ the chain is kept.
150
+
151
+ **The store refuses the write, and writes nothing,** when a section can't be
152
+ addressed. Only H2 and H3 headings are sections. Addresses lowercase the title,
153
+ remove Markdown formatting markers, replace remaining runs outside `a-z`/`0-9` with
154
+ a hyphen, and trim edge hyphens. Duplicate section paths, a nonblank H2/H3 title
155
+ that normalizes to an empty slug, and an unclosed code fence are refused. A
156
+ duplicate path is two H2s with the same address, or two H3s with the same address
157
+ under one H2. Blank headings are retained as scope boundaries.
158
+
159
+ **It writes, with an advisory on stderr,** when:
160
+ - no H2 or H3 title contains "decision";
161
+ - a line mentions "unverified" without the exact marker `UNVERIFIED:`.
162
+
163
+ **A recap that passes the first time** has:
164
+ - a short summary;
165
+ - a `## Decisions, with reasons` section, each decision with its reason;
166
+ - what's in flight and who owns the next step;
167
+ - an `UNVERIFIED:` line for each fact you haven't checked yourself.
168
+
127
169
  ## Why load-bearing for RSI
128
170
 
129
171
  Any recursive seat-refresh loop must be able to replace an occupant
@@ -152,6 +152,12 @@ selected startup path, use `skills/core/agent-startup-and-context-ingestion/SKIL
152
152
  A packet or marker proves retained/delivered evidence, not successful provider
153
153
  restoration; measure the resumed seat against the proof standard above.
154
154
 
155
+ Before a planned compaction, restart or long pause, write the seat's authored recap
156
+ with `rig context recap-write --rig <rig> --seat <seat> --file <draft>`. Its format is
157
+ in `seat-continuity-and-handover`, "Write the seat's recap before a handover". A
158
+ rebuild reads it before `LEARNED.md`, and a profile source of `seat:RECAP.md` serves
159
+ it after a restore.
160
+
155
161
  ## See also
156
162
 
157
163
  - `claude-compaction-restore` skill — the Claude Code restore SOP (PreCompact hook + JSONL restore script for post-compaction recovery)
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: rigs
3
+ description: Use when the user mentions OpenRig, rigs or the rig command, or wants a team of coding agents (Claude Code, Codex) on their project. That includes installing, setting up, starting or updating OpenRig, seeing or getting back to their OpenRig agents, TUI or operator, starting or sharing a team, and joining this session to one.
4
+ ---
5
+
6
+ # rigs: your route into OpenRig
7
+
8
+ OpenRig runs a team of coding agents (Claude Code, Codex and others) side by side in tmux. A local daemon keeps their
9
+ tasks, messages and state, so the team keeps working across restarts. This skill gets OpenRig installed, gets a team
10
+ working on what the person wants, and shows how to work with that team from here.
11
+
12
+ **The goal is a team doing the person's work, not just an install.** Go through the steps in order and stop early only
13
+ if the person asks you to. When they say what they want built, give it to OpenRig's operator (step 2) instead of
14
+ building it yourself.
15
+
16
+ Tell the person what you're about to run and why before you run it. Don't install system packages or change their
17
+ machine without a yes. Starting OpenRig and a team writes files: Codex hooks and settings in
18
+ `~/.codex/config.toml`, a discovery skill in `~/.claude/skills` and `~/.agents/skills`, and, in the repository, managed
19
+ guidance in `AGENTS.md` or `CLAUDE.md` plus the team's skills and plugins. Say so before you start OpenRig
20
+ ([the full list](https://github.com/mvschwarz/openrig#what-openrig-changes-on-your-machine)).
21
+
22
+ ## 1. Install OpenRig, if it isn't installed
23
+
24
+ - **Check first:** `rig --version`. If it prints a version, go to step 2.
25
+ - **What it needs:** macOS or Linux, Node.js 22 or 24, tmux, and Claude Code or Codex signed in. Check only what's
26
+ missing: `node --version`, `tmux -V`, `claude auth status` or `codex login status`.
27
+ - **Install:** `npm install -g @openrig/cli`, then `rig preflight` (Node, tmux, the daemon port and state folders)
28
+ and `rig doctor`.
29
+ - **Then go on to step 2:** say it's installed and ask what they want worked on, and in which repository. A plain
30
+ "install OpenRig" includes this. Stop here only if they say not to start a team.
31
+ - **If something fails:** `rig context get help` is the help guide for the installed version. If `rig` itself won't
32
+ run, use https://www.openrig.dev/help/agents. Getting started: https://openrig.dev/docs/getting-started
33
+
34
+ ## 2. Open OpenRig and give its operator the goal
35
+
36
+ - **Start OpenRig:** `rig daemon status`, and `rig daemon start` if it isn't running. `rig preflight` and `rig doctor`
37
+ don't start it. Starting it also starts OpenRig's own team, the kernel, whose operator sets up the person's team.
38
+ Keep it.
39
+ - **Show them OpenRig, the handoff:** once OpenRig is running, open the OpenRig TUI and operator for the person. Say
40
+ you're opening it, then run `rig terminal open saved:kernel --window` on the daemon's desktop. This is the next step
41
+ after installing or starting OpenRig, and the way back whenever they want their agents or OpenRig again. Don't wait
42
+ to be asked or for particular words. If they've said not now, give them that command for later. It opens a view
43
+ itself, using herdr when installed or plain tmux otherwise:
44
+ - **Inside Herdr** (you run in a Herdr pane): it switches the person's Herdr to an `openrig kernel` space, reusing a live
45
+ one. No new window and no macOS prompt; their own spaces stay in the sidebar.
46
+ - **In Terminal or Ghostty:** a new tab or window the size of theirs.
47
+ - **From Claude Desktop, iTerm or VS Code on a Mac:** a new Ghostty window when supported, otherwise Terminal. Only
48
+ here, tell the person before running it that **Allow is fine** if macOS asks to control that app.
49
+ `echo $TERM_PROGRAM $__CFBundleIdentifier` tells you where you run. `herdr`, `Apple_Terminal` or `ghostty`, or
50
+ `tmux` with `com.apple.Terminal` or `com.mitchellh.ghostty`, mean no macOS prompt, so don't mention one. `tmux`
51
+ with anything else (iTerm, VS Code) can prompt, so say Allow is fine first.
52
+ - **Layout:** under 120 columns the operator fills the first page; from 120, the dashboard and operator share it. The
53
+ advisor has its own tab or tmux window.
54
+
55
+ Then tell the person in a sentence or two where it opened and that the operator is ready for what they want to
56
+ build. Don't list agents or statuses (the TUI shows them), and don't suggest a command for them to type.
57
+ Preserve the current terminal. If OpenRig's notes say it couldn't confirm the view, say so plainly. If it's already
58
+ open, point them to it rather than opening another. Only if the window cannot open, `rig tui --shared` is the
59
+ dashboard-only fallback; explain the failure and help with the chosen fallback. Herdr is visible only in a terminal
60
+ the person can see; switching the shared TUI to `:terminals` does not open one. No and headless/SSH use are valid
61
+ background outcomes. Provider-only `--provider herdr` or `--provider cmux` is for an existing provider workspace,
62
+ not the first desktop window.
63
+ - **If the window can't open, or over headless SSH:** say plainly that no visible terminal was opened, and ask the
64
+ person to open a new terminal window or tab on the daemon's host. Over SSH, that's a new SSH session to it with the
65
+ known account. If you only know an HTTP daemon address, ask for the SSH details rather than inventing them. Then
66
+ give them one complete command:
67
+ - **The command OpenRig printed:** when `rig terminal open saved:kernel --window` can't open a window, it says why
68
+ and ends with `run:` and a command (the `error` field with `--json`). That command already names the installed
69
+ herdr binary and the daemon's socket, or the conversation to attach. Relay it exactly rather than composing one.
70
+ If a note asks you to place the view once Herdr starts, run that `rig terminal open` yourself after they start it.
71
+ - **If it printed no command:** find `operator.agent` in `rig ps --nodes --rig kernel --json`, take its
72
+ `canonicalSessionName` (never a guessed name) and give
73
+ `env -u TMUX tmux attach-session -t '=<canonicalSessionName>'` for the operator's conversation.
74
+
75
+ For any other failure, the table under "What can interrupt installation and the OpenRig view" in
76
+ `rig context get reference/getting-started.md#open-the-kernel-conversations` says why and what to do next.
77
+ - **Give the operator the goal:** ask what they want worked on, in which repository and on which branch, unless they've
78
+ said. Find the `operator.agent` row in `rig ps --nodes --rig kernel --json`, take its `canonicalSessionName`
79
+ (never the logical ID or a guessed name) and send:
80
+ `rig send <canonicalSessionName> 'This is the agent that installed OpenRig. The person will answer in your pane. Goal: <goal>. Project folder: <absolute path>. Branch: <branch>.'`
81
+ Or the person types the goal and folder in the operator's pane. If they give you a goal later, forward it the same
82
+ way. The operator helps them pick a team that fits their logins, starts it on their yes and gives the goal to the
83
+ team's lead. Show them where the operator answers, and don't build the project yourself.
84
+ - **Relay the operator's questions:** the operator asks in its own pane, and the person may not be looking there.
85
+ After each step you hand it, read its screen with `rig capture <canonicalSessionName>`. When it asks the person
86
+ something (start this team? which folder? which option?), ask them here in the operator's words and send their
87
+ answer back with `rig send`, or tell them to answer in the operator's pane. Unlike a prompt or a menu, a question
88
+ doesn't show up as a stopped seat, so don't leave it to a background wait.
89
+ - **Installation is finished** when the operator is ready and the person is talking to it; a healthy daemon alone isn't
90
+ that. If they'd rather talk later, keep that choice, leave them the exact connection step and say the handoff to the
91
+ operator is still pending.
92
+ - **See what's running:** `rig ps`, then `rig ps --nodes --rig <rig>` for a team's agents. If a team is already
93
+ running in that repository, tell the operator.
94
+ - **Check it's ready before you say so:** `rig ps --nodes --rig <rig>`. If an agent is stopped at a prompt or a menu,
95
+ read it with `rig capture <seat>@<rig>` and answer with the key that screen shows (`rig send --help` says how to
96
+ send a digit, a letter or Escape), or ask the person. Capture it again before sending anything more.
97
+ - **Join this session to the team, if that helps:**
98
+ `rig attach --self --rig <rigId> --pod <pod> --member <name> --runtime <claude-code|codex> --print-env` adds this
99
+ session as a new member of a pod. `--node <logicalId>` binds it to an existing seat instead. Attach once, and keep
100
+ the variables it prints (`OPENRIG_NODE_ID` and `OPENRIG_SESSION_NAME`). Each command may run in a fresh shell, so put
101
+ them in front of every later `rig` command. Check with `rig whoami --json`.
102
+ - **Replies:** other agents can't type into this session. Read work sent to you with
103
+ `rig queue list --destination <your address>` and `rig queue show <id> --full`, and read an agent's screen with
104
+ `rig capture <seat>@<rig>`.
105
+
106
+ ## 3. Follow the work to its result
107
+
108
+ - **Find the team's task:** the operator gives the goal to the team's lead as a queue task: `dev-build@starter`, or
109
+ `orch-lead` in `workshop` and `factory` (for starter and factory, `rig specs preview <name> --kind rig` says what
110
+ each seat does; for a running team, `rig ps --nodes --rig <rig>`). Find it with
111
+ `rig queue list --destination <seat>@<rig> -a`.
112
+ - **Follow it to the result:** a task that changed hands isn't finished. `rig queue show <id> --full` names the seat it
113
+ went to, and that seat's next task is the one whose `handedOffFrom` is that ID
114
+ (`rig queue list --destination <seat>@<rig> -a -o json`). Follow each handoff until an agent reports the result, and
115
+ use `rig capture <seat>@<rig>` to see what it's doing. Then read what it produced and tell the person what the team
116
+ actually did (the branch, commit, review or PR text), not just that you sent it.
117
+ - **Give the team more work:** write the goal to a file: what to change, in which repository and branch, what done
118
+ looks like, and that the result comes back to you (the branch or commit, the review, any PR text). Then
119
+ `rig queue create --source <your name> --destination <seat>@<rig> --body-file <file>`, and tell that agent with
120
+ `rig send <seat>@<rig> "task <id> is yours"`. A message informs, and a queue task is the work someone owns.
121
+ `--source` names you when this session hasn't joined the team.
122
+ - **Then ask what's next.** If no team can take the work, fix that or ask the person. Don't quietly do it yourself.
123
+ - **Other ways to work with the team:** `rig send <seat>@<rig> "..."` types into an agent's terminal,
124
+ `rig capture <seat>@<rig>` reads its screen, and `rig ps --nodes --rig <rig>` shows who's on it.
125
+
126
+ ## 4. Find out more
127
+
128
+ - **How OpenRig works:** `rig context profile world-public --situation fresh`.
129
+ - **What you can do:** `rig context get onboarding-width` (the capability map).
130
+ - **Everything in the library:** `rig context list`.
131
+ - **Exact syntax:** `rig <command> --help` is always current for the installed version.
132
+
133
+ Written for OpenRig 0.6.7. When something here and `--help` disagree, `--help` wins.