@openrig/cli 0.5.7 → 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 (362) hide show
  1. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +25 -2
  2. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +95 -8
  3. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +9 -1
  4. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  5. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +40 -15
  6. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  7. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  8. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +95 -8
  9. package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +9 -1
  10. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  11. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  12. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  13. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  14. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  15. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  16. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  17. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  18. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  19. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +120 -355
  20. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +9 -3
  21. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
  22. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
  23. package/daemon/context-packs/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
  24. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  61. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  62. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  63. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  64. package/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
  65. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  66. package/daemon/dist/adapters/tmux.d.ts +6 -5
  67. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  68. package/daemon/dist/adapters/tmux.js +29 -12
  69. package/daemon/dist/adapters/tmux.js.map +1 -1
  70. package/daemon/dist/build-info.js +3 -3
  71. package/daemon/dist/db/all-migrations.d.ts +1 -1
  72. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  73. package/daemon/dist/db/all-migrations.js +3 -1
  74. package/daemon/dist/db/all-migrations.js.map +1 -1
  75. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
  76. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
  77. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
  78. package/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
  79. package/daemon/dist/domain/active-occupant.d.ts +6 -0
  80. package/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  81. package/daemon/dist/domain/active-occupant.js +14 -0
  82. package/daemon/dist/domain/active-occupant.js.map +1 -1
  83. package/daemon/dist/domain/current-work.d.ts +73 -0
  84. package/daemon/dist/domain/current-work.d.ts.map +1 -0
  85. package/daemon/dist/domain/current-work.js +225 -0
  86. package/daemon/dist/domain/current-work.js.map +1 -0
  87. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  88. package/daemon/dist/domain/execution-view.js +215 -13
  89. package/daemon/dist/domain/execution-view.js.map +1 -1
  90. package/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
  91. package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  92. package/daemon/dist/domain/gateway/human-registry.js +113 -18
  93. package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  94. package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
  95. package/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
  96. package/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
  97. package/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
  98. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
  99. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  100. package/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
  101. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  102. package/daemon/dist/domain/policies/types.d.ts +12 -0
  103. package/daemon/dist/domain/policies/types.d.ts.map +1 -1
  104. package/daemon/dist/domain/queue-repository.d.ts +37 -2
  105. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  106. package/daemon/dist/domain/queue-repository.js +171 -16
  107. package/daemon/dist/domain/queue-repository.js.map +1 -1
  108. package/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
  109. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  110. package/daemon/dist/domain/queue-wake-repository.js +33 -0
  111. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  112. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  113. package/daemon/dist/domain/reconciler.js +4 -1
  114. package/daemon/dist/domain/reconciler.js.map +1 -1
  115. package/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
  116. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  117. package/daemon/dist/domain/rehydrate-eligibility.js +34 -0
  118. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  119. package/daemon/dist/domain/restore-orchestrator.d.ts +9 -0
  120. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  121. package/daemon/dist/domain/restore-orchestrator.js +32 -0
  122. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  123. package/daemon/dist/domain/restore-plan-preview.js +2 -2
  124. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  125. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  126. package/daemon/dist/domain/rigspec-exporter.js +2 -0
  127. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  128. package/daemon/dist/domain/rigspec-instantiator.d.ts +15 -9
  129. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  130. package/daemon/dist/domain/rigspec-instantiator.js +66 -83
  131. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  132. package/daemon/dist/domain/rigspec-schema.d.ts +5 -1
  133. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  134. package/daemon/dist/domain/rigspec-schema.js +41 -2
  135. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  136. package/daemon/dist/domain/seat-attention-reconciler.d.ts +32 -1
  137. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  138. package/daemon/dist/domain/seat-attention-reconciler.js +183 -4
  139. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  140. package/daemon/dist/domain/session-transport.d.ts +5 -0
  141. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  142. package/daemon/dist/domain/session-transport.js +33 -7
  143. package/daemon/dist/domain/session-transport.js.map +1 -1
  144. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  145. package/daemon/dist/domain/snapshot-capture.js +4 -2
  146. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  147. package/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
  148. package/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
  149. package/daemon/dist/domain/topology-defaults-installer.js +27 -0
  150. package/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
  151. package/daemon/dist/domain/types.d.ts +1 -1
  152. package/daemon/dist/domain/types.d.ts.map +1 -1
  153. package/daemon/dist/domain/types.js.map +1 -1
  154. package/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  155. package/daemon/dist/domain/up-command-router.js +19 -0
  156. package/daemon/dist/domain/up-command-router.js.map +1 -1
  157. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
  158. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  159. package/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
  160. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  161. package/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -0
  162. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  163. package/daemon/dist/domain/watchdog-policy-engine.js +47 -0
  164. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  165. package/daemon/dist/routes/queue.d.ts.map +1 -1
  166. package/daemon/dist/routes/queue.js +31 -10
  167. package/daemon/dist/routes/queue.js.map +1 -1
  168. package/daemon/dist/routes/rigs.js +10 -3
  169. package/daemon/dist/routes/rigs.js.map +1 -1
  170. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  171. package/daemon/dist/routes/rigspec.js +37 -0
  172. package/daemon/dist/routes/rigspec.js.map +1 -1
  173. package/daemon/dist/routes/up.js +10 -3
  174. package/daemon/dist/routes/up.js.map +1 -1
  175. package/daemon/dist/startup.d.ts.map +1 -1
  176. package/daemon/dist/startup.js +16 -6
  177. package/daemon/dist/startup.js.map +1 -1
  178. package/daemon/docs/reference/agent-spec.md +33 -0
  179. package/daemon/docs/reference/chain-file-convention.md +17 -12
  180. package/daemon/docs/reference/release-boundary.md +29 -5
  181. package/daemon/docs/reference/sdlc-conventions.md +6 -0
  182. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +120 -355
  183. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/backup-sqlite.mjs +62 -0
  184. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/inspect-upgrade.mjs +40 -0
  185. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs +151 -0
  186. package/daemon/specs/rigs/preview/product-team/topology/instance/CRAFT.md +4 -4
  187. package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +3 -3
  188. package/dist/build-info.js +3 -3
  189. package/dist/commands/context.d.ts.map +1 -1
  190. package/dist/commands/context.js +55 -9
  191. package/dist/commands/context.js.map +1 -1
  192. package/dist/commands/import.d.ts.map +1 -1
  193. package/dist/commands/import.js +27 -1
  194. package/dist/commands/import.js.map +1 -1
  195. package/dist/commands/watchdog.d.ts.map +1 -1
  196. package/dist/commands/watchdog.js +51 -3
  197. package/dist/commands/watchdog.js.map +1 -1
  198. package/dist/front-door.d.ts.map +1 -1
  199. package/dist/front-door.js +16 -4
  200. package/dist/front-door.js.map +1 -1
  201. package/dist/lib/topology-trace.d.ts +3 -2
  202. package/dist/lib/topology-trace.d.ts.map +1 -1
  203. package/dist/lib/topology-trace.js +12 -2
  204. package/dist/lib/topology-trace.js.map +1 -1
  205. package/dist/lib/work-install.d.ts.map +1 -1
  206. package/dist/lib/work-install.js +65 -31
  207. package/dist/lib/work-install.js.map +1 -1
  208. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  209. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js +249 -2
  210. package/node_modules/@openrig/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  211. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +6 -5
  212. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
  213. package/node_modules/@openrig/daemon/dist/adapters/tmux.js +29 -12
  214. package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
  215. package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
  216. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts +1 -1
  217. package/node_modules/@openrig/daemon/dist/db/all-migrations.d.ts.map +1 -1
  218. package/node_modules/@openrig/daemon/dist/db/all-migrations.js +3 -1
  219. package/node_modules/@openrig/daemon/dist/db/all-migrations.js.map +1 -1
  220. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts +17 -0
  221. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.d.ts.map +1 -0
  222. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js +21 -0
  223. package/node_modules/@openrig/daemon/dist/db/migrations/078_idle_gate_fired_condition.js.map +1 -0
  224. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts +6 -0
  225. package/node_modules/@openrig/daemon/dist/domain/active-occupant.d.ts.map +1 -1
  226. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js +14 -0
  227. package/node_modules/@openrig/daemon/dist/domain/active-occupant.js.map +1 -1
  228. package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts +73 -0
  229. package/node_modules/@openrig/daemon/dist/domain/current-work.d.ts.map +1 -0
  230. package/node_modules/@openrig/daemon/dist/domain/current-work.js +225 -0
  231. package/node_modules/@openrig/daemon/dist/domain/current-work.js.map +1 -0
  232. package/node_modules/@openrig/daemon/dist/domain/execution-view.d.ts.map +1 -1
  233. package/node_modules/@openrig/daemon/dist/domain/execution-view.js +215 -13
  234. package/node_modules/@openrig/daemon/dist/domain/execution-view.js.map +1 -1
  235. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts +3 -2
  236. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
  237. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js +113 -18
  238. package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js.map +1 -1
  239. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts +3 -2
  240. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.d.ts.map +1 -1
  241. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js +7 -5
  242. package/node_modules/@openrig/daemon/dist/domain/model-divergence/effective-model-readers.js.map +1 -1
  243. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts +5 -5
  244. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  245. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js +130 -22
  246. package/node_modules/@openrig/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  247. package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts +12 -0
  248. package/node_modules/@openrig/daemon/dist/domain/policies/types.d.ts.map +1 -1
  249. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts +37 -2
  250. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  251. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js +171 -16
  252. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js.map +1 -1
  253. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts +19 -0
  254. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  255. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js +33 -0
  256. package/node_modules/@openrig/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  257. package/node_modules/@openrig/daemon/dist/domain/reconciler.d.ts.map +1 -1
  258. package/node_modules/@openrig/daemon/dist/domain/reconciler.js +4 -1
  259. package/node_modules/@openrig/daemon/dist/domain/reconciler.js.map +1 -1
  260. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts +11 -1
  261. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  262. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js +34 -0
  263. package/node_modules/@openrig/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  264. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts +9 -0
  265. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  266. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js +32 -0
  267. package/node_modules/@openrig/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  268. package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js +2 -2
  269. package/node_modules/@openrig/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  270. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  271. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js +2 -0
  272. package/node_modules/@openrig/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  273. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +15 -9
  274. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  275. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +66 -83
  276. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  277. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts +5 -1
  278. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  279. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js +41 -2
  280. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js.map +1 -1
  281. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts +32 -1
  282. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  283. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js +183 -4
  284. package/node_modules/@openrig/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  285. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts +5 -0
  286. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts.map +1 -1
  287. package/node_modules/@openrig/daemon/dist/domain/session-transport.js +33 -7
  288. package/node_modules/@openrig/daemon/dist/domain/session-transport.js.map +1 -1
  289. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  290. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js +4 -2
  291. package/node_modules/@openrig/daemon/dist/domain/snapshot-capture.js.map +1 -1
  292. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts +4 -2
  293. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -1
  294. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js +27 -0
  295. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js.map +1 -1
  296. package/node_modules/@openrig/daemon/dist/domain/types.d.ts +1 -1
  297. package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
  298. package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
  299. package/node_modules/@openrig/daemon/dist/domain/up-command-router.d.ts.map +1 -1
  300. package/node_modules/@openrig/daemon/dist/domain/up-command-router.js +19 -0
  301. package/node_modules/@openrig/daemon/dist/domain/up-command-router.js.map +1 -1
  302. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts +9 -0
  303. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  304. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js +15 -2
  305. package/node_modules/@openrig/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  306. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts +7 -0
  307. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  308. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js +47 -0
  309. package/node_modules/@openrig/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  310. package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
  311. package/node_modules/@openrig/daemon/dist/routes/queue.js +31 -10
  312. package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
  313. package/node_modules/@openrig/daemon/dist/routes/rigs.js +10 -3
  314. package/node_modules/@openrig/daemon/dist/routes/rigs.js.map +1 -1
  315. package/node_modules/@openrig/daemon/dist/routes/rigspec.d.ts.map +1 -1
  316. package/node_modules/@openrig/daemon/dist/routes/rigspec.js +37 -0
  317. package/node_modules/@openrig/daemon/dist/routes/rigspec.js.map +1 -1
  318. package/node_modules/@openrig/daemon/dist/routes/up.js +10 -3
  319. package/node_modules/@openrig/daemon/dist/routes/up.js.map +1 -1
  320. package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
  321. package/node_modules/@openrig/daemon/dist/startup.js +16 -6
  322. package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
  323. package/node_modules/@openrig/daemon/package.json +1 -1
  324. package/package.json +2 -1
  325. package/tui/dist/daemon-client.d.ts +2 -0
  326. package/tui/dist/daemon-client.d.ts.map +1 -1
  327. package/tui/dist/daemon-client.js +4 -0
  328. package/tui/dist/daemon-client.js.map +1 -1
  329. package/tui/dist/execution/execution-model.d.ts +19 -0
  330. package/tui/dist/execution/execution-model.d.ts.map +1 -0
  331. package/tui/dist/execution/execution-model.js +518 -0
  332. package/tui/dist/execution/execution-model.js.map +1 -0
  333. package/tui/dist/hydrate.d.ts +1 -1
  334. package/tui/dist/hydrate.d.ts.map +1 -1
  335. package/tui/dist/hydrate.js +6 -2
  336. package/tui/dist/hydrate.js.map +1 -1
  337. package/tui/dist/input.d.ts +7 -0
  338. package/tui/dist/input.d.ts.map +1 -1
  339. package/tui/dist/input.js +13 -0
  340. package/tui/dist/input.js.map +1 -1
  341. package/tui/dist/live.d.ts +10 -0
  342. package/tui/dist/live.d.ts.map +1 -1
  343. package/tui/dist/live.js +34 -1
  344. package/tui/dist/live.js.map +1 -1
  345. package/tui/dist/main.js +22 -3
  346. package/tui/dist/main.js.map +1 -1
  347. package/tui/dist/render.d.ts.map +1 -1
  348. package/tui/dist/render.js +13 -2
  349. package/tui/dist/render.js.map +1 -1
  350. package/tui/dist/scopes/scopes-model.d.ts +1 -0
  351. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  352. package/tui/dist/scopes/scopes-model.js +4 -2
  353. package/tui/dist/scopes/scopes-model.js.map +1 -1
  354. package/tui/dist/sections.js +2 -2
  355. package/tui/dist/sections.js.map +1 -1
  356. package/tui/dist/state.d.ts.map +1 -1
  357. package/tui/dist/state.js +15 -2
  358. package/tui/dist/state.js.map +1 -1
  359. package/tui/dist/stylize.js +2 -2
  360. package/tui/dist/stylize.js.map +1 -1
  361. package/tui/dist/types.d.ts +20 -0
  362. package/tui/dist/types.d.ts.map +1 -1
@@ -91,6 +91,28 @@ function readConfiguredContent(home) {
91
91
  };
92
92
  }
93
93
 
94
+ // A live seat carries no OPENRIG_REFOCUS_WORK_NODE, so the trace used to report an
95
+ // unresolved work node while the daemon could already name the seat's typed baton. Ask it.
96
+ // The explicit variable always wins and short-circuits the call; any failure here returns
97
+ // null and leaves the pre-existing gap line intact, because refusing to answer is correct
98
+ // and guessing a work node would silently re-point the whole trace.
99
+ function deriveWorkStart() {
100
+ if (process.env.OPENRIG_REFOCUS_WORK_NODE) return process.env.OPENRIG_REFOCUS_WORK_NODE;
101
+ const result = spawnSync("rig", ["queue", "whoami", "--json"], {
102
+ encoding: "utf8",
103
+ env: process.env,
104
+ timeout: 2_000,
105
+ maxBuffer: 16 * 1024 * 1024,
106
+ });
107
+ if (result.error || result.status !== 0 || !result.stdout || !result.stdout.trim()) return null;
108
+ try {
109
+ const workNodePath = JSON.parse(result.stdout)?.currentWork?.workNodePath;
110
+ return typeof workNodePath === "string" && workNodePath ? workNodePath : null;
111
+ } catch {
112
+ return null;
113
+ }
114
+ }
115
+
94
116
  function renderTrace() {
95
117
  const script = path.resolve(__dirname, "../../skills/refocusing/scripts/trace-to-root.py");
96
118
  const args = [
@@ -101,8 +123,9 @@ function renderTrace() {
101
123
  if (process.env.OPENRIG_REFOCUS_TOPOLOGY_NODE) {
102
124
  args.push("--topology-start", process.env.OPENRIG_REFOCUS_TOPOLOGY_NODE);
103
125
  }
104
- if (process.env.OPENRIG_REFOCUS_WORK_NODE) {
105
- args.push("--work-start", process.env.OPENRIG_REFOCUS_WORK_NODE);
126
+ const workStart = deriveWorkStart();
127
+ if (workStart) {
128
+ args.push("--work-start", workStart);
106
129
  }
107
130
  const result = spawnSync(process.env.PYTHON || "python3", args, {
108
131
  encoding: "utf8",
@@ -6,7 +6,12 @@ import { spawnSync } from "node:child_process";
6
6
 
7
7
  const skillRoot = path.resolve(new URL("..", import.meta.url).pathname);
8
8
  const restoreScript = path.join(skillRoot, "scripts", "restore-from-jsonl.mjs");
9
- const outRoot = "/tmp/claude-compaction-restore";
9
+ // P6(C) injectable output-root: the packet base defaults to the shared
10
+ // /tmp/claude-compaction-restore (production), but becomes per-run isolated when the
11
+ // hermetic env-var OPENRIG_COMPACTION_OUT_ROOT is set — so concurrent writers with the
12
+ // same injected clock + sessionId no longer collide on the same `${sessionId}-${stamp}`
13
+ // dir. Mirrors the injectable-clock seam (OPENRIG_TEST_CLOCK_NOW). Empty/absent = /tmp.
14
+ const outRoot = process.env.OPENRIG_COMPACTION_OUT_ROOT || "/tmp/claude-compaction-restore";
10
15
  const defaultRestoreInstruction =
11
16
  "Read the claude-compaction-restore skill and follow its \"If You Just Compacted\" protocol.";
12
17
 
@@ -24,6 +29,14 @@ function getOpenRigHome() {
24
29
  return process.env.OPENRIG_HOME || process.env.RIGGED_HOME || path.join(os.homedir(), ".openrig");
25
30
  }
26
31
 
32
+ // A3-R3 injectable clock (slice 51-01): marker.createdAt defaults to real wall-clock,
33
+ // but becomes deterministic when the shared hermetic env-var OPENRIG_TEST_CLOCK_NOW is
34
+ // set (an ISO instant). Empty/absent = production real-time.
35
+ function nowIso() {
36
+ const injected = process.env.OPENRIG_TEST_CLOCK_NOW;
37
+ return typeof injected === "string" && injected.trim().length > 0 ? injected : new Date().toISOString();
38
+ }
39
+
27
40
  function expandInstructionPath(filePath) {
28
41
  if (filePath.startsWith("~/")) return path.join(os.homedir(), filePath.slice(2));
29
42
  if (filePath.startsWith("${OPENRIG_HOME}/")) {
@@ -41,6 +54,50 @@ function readInstructionFile(filePath) {
41
54
  return fs.readFileSync(expanded, "utf8");
42
55
  }
43
56
 
57
+ // OPR.0.4.1.09 / R5 marker-lifecycle (foreign-content-in-marker face): the hook
58
+ // path must apply the SAME seat-check the daemon enforcer's resolvePostCompactExtra
59
+ // applies (rev1-r2 dcd95bd9), or a FOREIGN seat's global messageFilePath leaks into
60
+ // THIS seat's marker. Parse a WELL-FORMED leading `---` frontmatter for a declared
61
+ // seat (target_seat / seat / session); body text is never scanned; a broken/absent
62
+ // fence is GENERIC (valid for any seat). Byte-mirrors the enforcer regexes.
63
+ function declaredSeatOf(content) {
64
+ const fm = /^\s*---\s*\n([\s\S]*?)\n---/.exec(content);
65
+ if (!fm) return null;
66
+ const m = /^[ \t]*(?:target[_-]?seat|seat|session(?:[_-]?name)?)[ \t]*:[ \t]*["']?([^"'\n#]+?)["']?[ \t]*$/im.exec(fm[1]);
67
+ return m ? m[1].trim() : null;
68
+ }
69
+
70
+ function sanitizeSeat(value) {
71
+ return value.replace(/[^a-zA-Z0-9_.@-]/g, "_");
72
+ }
73
+
74
+ // Resolve the post-compaction extra FOR THIS SEAT (mirror of the enforcer): (1) prefer
75
+ // a per-seat compaction/post-compact-extra/<seat>.md — no cross-seat contamination
76
+ // possible; (2) fall back to the global ONLY when it does not declare a DIFFERENT seat
77
+ // (a wrong-seat global is REFUSED). Generic/undeclared/configured-but-absent stay
78
+ // allowed. Returns the path to read, or null when nothing valid for this seat.
79
+ function resolveSeatSafeExtraPath(globalFilePathRaw) {
80
+ const rawSeat = process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || "";
81
+ const seatKey = rawSeat ? sanitizeSeat(rawSeat) : "";
82
+ if (seatKey) {
83
+ const perSeatPath = path.join(getOpenRigHome(), "compaction", "post-compact-extra", `${seatKey}.md`);
84
+ if (fs.existsSync(perSeatPath)) {
85
+ const declared = declaredSeatOf(fs.readFileSync(perSeatPath, "utf8"));
86
+ if (declared && sanitizeSeat(declared) !== seatKey) return null; // wrong-seat per-seat file
87
+ return perSeatPath;
88
+ }
89
+ }
90
+ const trimmed = (globalFilePathRaw || "").trim();
91
+ if (!trimmed) return null;
92
+ const expanded = expandInstructionPath(trimmed);
93
+ // configured-but-absent: keep the path (an absent file cannot be a wrong-seat leak;
94
+ // readInstructionFile returns "" so nothing is appended).
95
+ if (!fs.existsSync(expanded)) return trimmed;
96
+ const declared = declaredSeatOf(fs.readFileSync(expanded, "utf8"));
97
+ if (declared && sanitizeSeat(declared) !== seatKey) return null; // foreign-seat global REFUSED
98
+ return trimmed;
99
+ }
100
+
44
101
  function sessionKey(input) {
45
102
  const raw = [
46
103
  process.env.OPENRIG_SESSION_NAME,
@@ -58,12 +115,28 @@ function pendingMarkerPath(input) {
58
115
  return path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.json`);
59
116
  }
60
117
 
118
+ // R5 absent-when-needed: drop a lightweight EXPECTED sentinel FIRST (before the packet is
119
+ // generated + the marker is written), carrying the SAME identity binding the marker gets.
120
+ // Its presence-without-a-marker is what lets the bridge be LOUD about a missing packet
121
+ // (hook died partway / write failed); policy off = no hook = no sentinel = silent.
122
+ function writeExpectedSentinel(input) {
123
+ const p = path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.expected.json`);
124
+ fs.mkdirSync(path.dirname(p), { recursive: true });
125
+ fs.writeFileSync(p, `${JSON.stringify({
126
+ version: 1,
127
+ sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
128
+ sessionId: input.session_id || input.sessionId || null,
129
+ transcriptPath: input.transcript_path || null,
130
+ createdAt: nowIso(),
131
+ }, null, 2)}\n`, "utf8");
132
+ }
133
+
61
134
  function writePendingRestoreMarker(input, parsed, restoreInstruction, customMessage) {
62
135
  const markerPath = pendingMarkerPath(input);
63
136
  fs.mkdirSync(path.dirname(markerPath), { recursive: true });
64
137
  const payload = {
65
138
  version: 1,
66
- createdAt: new Date().toISOString(),
139
+ createdAt: nowIso(),
67
140
  sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
68
141
  sessionId: input.session_id || input.sessionId || null,
69
142
  transcriptPath: input.transcript_path || null,
@@ -118,13 +191,18 @@ function readClaudeCompactionMessage() {
118
191
  parts.push(`Inline restore instruction:\n${inline}`);
119
192
  }
120
193
  if (filePath && filePath.length > 0) {
121
- try {
122
- const fileText = readInstructionFile(filePath);
123
- if (fileText) {
124
- parts.push(`Additional restore instruction file (${filePath}):\n${fileText}`);
194
+ // R5 seat-check: resolve to the per-seat extra or a seat-safe global; a
195
+ // foreign-seat global resolves to null and is never injected into this marker.
196
+ const resolved = resolveSeatSafeExtraPath(filePath);
197
+ if (resolved) {
198
+ try {
199
+ const fileText = readInstructionFile(resolved);
200
+ if (fileText) {
201
+ parts.push(`Additional restore instruction file (${resolved}):\n${fileText}`);
202
+ }
203
+ } catch {
204
+ // Keep any inline instruction; unreadable extra files degrade quietly.
125
205
  }
126
- } catch {
127
- // Keep any inline instruction; unreadable extra files degrade quietly.
128
206
  }
129
207
  }
130
208
  if (parts.length > 0) return parts.join("\n\n");
@@ -140,7 +218,16 @@ function buildSystemMessage(restoreInstruction, customMessage) {
140
218
  }
141
219
 
142
220
  try {
221
+ // Slice 51-01 RIDER (leak-visibility, review-r1 escalation): OPENRIG_TEST_CLOCK_NOW is
222
+ // read by nowIso() to make createdAt deterministic in tests — but a LEAKED var in a
223
+ // real seat would silently FREEZE production createdAt. Announce loudly on stderr when
224
+ // active so any leak is visible in seat logs; absence stays silent (production path).
225
+ // MUST stay byte-identical to STUB_CLOCK_ANNOUNCEMENT in stub-runner.ts.
226
+ if (typeof process.env.OPENRIG_TEST_CLOCK_NOW === "string" && process.env.OPENRIG_TEST_CLOCK_NOW.trim().length > 0) {
227
+ process.stderr.write("OPENRIG_TEST_CLOCK_NOW active — timestamps are injected\n");
228
+ }
143
229
  const input = readHookInput();
230
+ writeExpectedSentinel(input); // R5: sentinel FIRST, before the packet + marker (catches hook-died-partway)
144
231
  const args = [restoreScript, "--out", outRoot, "--json"];
145
232
  if (input.cwd) args.push("--cwd", input.cwd);
146
233
  if (input.transcript_path && input.transcript_path.endsWith(".jsonl") && fs.existsSync(input.transcript_path)) {
@@ -423,8 +423,16 @@ function restoreInstructions(summary, outputPaths) {
423
423
  return lines.join("\n");
424
424
  }
425
425
 
426
+ // A3-R3 injectable clock (slice 51-01): the packet output-dir timestamped path
427
+ // defaults to real wall-clock, but becomes deterministic when the shared hermetic
428
+ // env-var OPENRIG_TEST_CLOCK_NOW is set (an ISO instant). Empty/absent = production.
429
+ function nowIso() {
430
+ const injected = process.env.OPENRIG_TEST_CLOCK_NOW;
431
+ return typeof injected === "string" && injected.trim().length > 0 ? injected : new Date().toISOString();
432
+ }
433
+
426
434
  function writeOutputs(summary, outRoot) {
427
- const stamp = new Date().toISOString().replace(/[:.]/g, "-");
435
+ const stamp = nowIso().replace(/[:.]/g, "-");
428
436
  const base = path.join(outRoot, `${summary.sessionId ?? "unknown-session"}-${stamp}`);
429
437
  fs.mkdirSync(base, { recursive: true });
430
438
 
@@ -1,6 +1,6 @@
1
1
  # Public capability and source-map width for the default onboarding walk.
2
2
  name: onboarding-width
3
- version: "0.5.7"
3
+ version: "0.5.8"
4
4
  # OPR.0.5.6.10 — affordances knowledge (what this system can do) is world
5
5
  # content under the coining-session definitions.
6
6
  taxonomy: world
@@ -10,9 +10,10 @@ already does it, or two verbs crossed already answer it. **You cannot look up a
10
10
  not know exists.** So the point of what follows is not skill. It is recognition: that when a task
11
11
  lands, something rhymes, and you go check instead of building.
12
12
 
13
- Eighty-one-plus top-level verbs ship (canon last patched for v0.5.3 — delta-v0.5.3 at dc57a5d1). Read this
14
- once for shape, and let it make you suspicious that a thing already exists. Model-divergence
15
- proclamations are live product (trust them; pins use canonical model IDs).
13
+ Eighty-one-plus top-level verbs ship (capability canon refreshed through
14
+ `capability-delta-v0.5.7`). Read this once for shape, and let it make you suspicious that a thing
15
+ already exists. Model-divergence proclamations are live product (trust them; pins use canonical
16
+ model IDs).
16
17
 
17
18
  ---
18
19
 
@@ -33,9 +34,11 @@ one command away. Your memory of the fleet is a claim about the past.
33
34
  - **`rig queue whoami`** — what the daemon thinks you are holding. Not what you remember holding.
34
35
  - **`rig seat status <seat>`** — what the system already believes about a seat's handover state,
35
36
  and whether the thing you did an hour ago actually landed.
36
- - **`rig view list` / `rig view show <lens>`** — named lenses over coordination state: who has been
37
- active lately, what is waiting on the owner, how loaded each pod is. **`rig view register`**
38
- turns a query you keep re-running into a first-class view.
37
+ - **`rig view list` / `rig view show <lens>`** — named lenses over coordination state: use
38
+ `view show escalations` for owner attention, `view show pickup` for claimed-row state, and
39
+ `view show execution` for done/now/next. An `INDETERMINATE` cell stays unknown rather than
40
+ being filled from memory. **`rig view register`** turns a query you keep re-running into a
41
+ first-class view.
39
42
  - **`rig config`** — bare, with no arguments: every key, every current value, and where each came
40
43
  from. Most agents assume compaction thresholds, snapshot cadence and scan intervals are hardcoded
41
44
  daemon behaviour. They are configuration. **Watch one thing:** `source: default` does not mean
@@ -47,9 +50,10 @@ one command away. Your memory of the fleet is a claim about the past.
47
50
  **The terminal is the wire.** A message is typed into another agent's prompt and it cannot be
48
51
  unseen — which makes messages the one delivery channel that never gets skipped.
49
52
 
50
- - **`rig send`** — put words in front of one seat, several, a pod, or a rig. **`--verify` is a
51
- hint, not a verdict**: its false negatives are common enough to be measured, so confirm by
52
- reading the far end rather than trusting the return.
53
+ - **`rig send`** — put words in front of one seat, several, a pod, or a rig. **`--verify` checks
54
+ pane-only delivery**: the text was staged at the far end, not that the agent consumed or acted
55
+ on it. Alternate-screen and queued-command cases can still yield false negatives, so
56
+ consequential delivery gets an effect check at the far end rather than a blind retry.
53
57
  - **`rig send --raw`** / **`--dangerously-interact --reason "<why>"`** — a seat is frozen on an
54
58
  interactive prompt or a permission block. Normal `send` *refuses* to answer a prompt on purpose;
55
59
  this is the deliberate override, and it is how you unblock a peer who cannot unblock itself.
@@ -93,7 +97,9 @@ your context, your compaction and your replacement — and it is the only thing
93
97
  - **`rig queue show`** — what a row *actually says*. The header is not the body.
94
98
  - **`rig queue claim` / `unclaim`** — is this mine and running, or still pending where two agents
95
99
  might double-work it. Put it down honestly when it is not yours.
96
- - **`rig queue update`** — record what happened in a form the rest of the system can act on.
100
+ - **`rig queue update`** — record what happened in a form the rest of the system can act on. A
101
+ `--note` does not reopen a terminal row; terminal-to-active repair requires explicit `--reopen`
102
+ with both `--state` and `--note`.
97
103
  - **`rig queue handoff`** — pass work so the close and the create are **one transaction**, instead
98
104
  of closing yours, failing to create theirs, and stranding the work in between.
99
105
  - **`rig queue block` / `resolve`** — park a row on a real blocker so it stays **yours and
@@ -102,8 +108,9 @@ your context, your compaction and your replacement — and it is the only thing
102
108
  and sitting on it silently is indistinguishable from a crash.**
103
109
  - **`rig queue overdue`** — what was claimed and never closed in time. **Defaults to the current
104
110
  rig**; ask for more if you mean more.
105
- - **`rig queue undelivered`** — rows the *sender believed* were delivered where the nudge failed
106
- and nothing was ever woken. **`overdue` and `undelivered` are the two halves of "is anything
111
+ - **`rig queue undelivered`** — pending create-path nudge failures only. For gateway or human
112
+ delivery, the row's transitions are the receipt ledger; `undelivered` does not answer whether a
113
+ person received the escalation. **`overdue` and `undelivered` are the two halves of "is anything
107
114
  silently stuck", and a rig can be clean on one and rotten on the other.**
108
115
  - **`rig queue inbox-drop` / `inbox-pending` / `inbox-absorb` / `inbox-deny`** — put something in
109
116
  front of a seat that it can *refuse*. Mail, not assignment.
@@ -119,7 +126,8 @@ inside will start you again. Everything here is an arrangement made *in advance*
119
126
  you that is still running.
120
127
 
121
128
  - **`rig watchdog register`** — arm a wake for a condition that will become true after you are
122
- asleep, compacted or finished.
129
+ asleep, compacted or finished. For a context wall, use the exact
130
+ `--policy context-usage-threshold` rather than a hand-rolled transcript timer.
123
131
  - **`rig watchdog list` / `show` / `status` / `stop`** — did it fire, is it still live, did someone
124
132
  stop it. **Quiet skips are not recorded**, so a healthy idle job and a job that never ran look
125
133
  identical in `status` — INDETERMINATE is the honest read until `show` says otherwise.
@@ -154,8 +162,9 @@ cheaper than being it.
154
162
 
155
163
  ## Bringing things into and out of existence
156
164
 
157
- **A rig is a shape you can create, grow, shrink and retire while it runs.** You do not have to tear
158
- one down to change it, and you rarely have to start from nothing.
165
+ **Need a small team now, without authoring YAML?** Start with `rig create`, then use `rig grow`
166
+ (including `--new-pod`) while it runs. A working topology can become a reusable spec later; you do
167
+ not have to tear one down to change it, and you rarely have to start from nothing.
159
168
 
160
169
  - **`rig up <source>`** — make a whole rig exist and run: from a spec you wrote, a shipped starter
161
170
  by name, a bundle someone handed you, or a stopped rig.
@@ -165,6 +174,8 @@ one down to change it, and you rarely have to start from nothing.
165
174
  - **`rig add`** / **`rig expand`** — graft one more member, or a whole new pod, onto a rig that is
166
175
  already running.
167
176
  - **`rig remove`** / **`rig shrink`** — take a seat, or an entire pod, out of a running topology.
177
+ If it holds active work, pass `--fallback <live-seat>` to reroute before mutation; without a
178
+ valid fallback the command refuses rather than strand the rows.
168
179
  - **`rig fork`** — take an existing shape and make a variant of it, rather than authoring a new one
169
180
  from nothing. Cheaper than it sounds, and the usual right answer when you want *almost* this.
170
181
  - **`rig archive` / `unarchive`** — get a finished rig out of your default view without losing
@@ -207,12 +218,18 @@ because someone lost work once.
207
218
  actually come back, and for everything that would not, which check fails and what the fix is.
208
219
  - **`rig restore-packet write` / `read` / `validate`** — a seat is about to die or must move
209
220
  runtimes; capture what it knows into a portable artifact instead of losing it with the process.
221
+ - **A seat's `compaction_strategy` is declared, not improvised at the wall.** Pair a threshold-
222
+ managed seat with the `context-usage-threshold` watchdog above so continuity is arranged while
223
+ the seat can still act.
210
224
  - **`rig handover <seat>`** — replace the **occupant** of a seat while the seat, its name, its
211
225
  edges and its inbound work stay exactly where they are. **`rig seat handover` is the PLANNING
212
226
  half** — it shows you what would happen; the top-level verb performs it. Two commands, similar
213
227
  names, different blast radius.
214
228
  - **`rig seat clear-attention` / `set-resume-token`** — clear a stale attention flag, or repair a
215
229
  lost resume handle so restore works next time.
230
+ - **`rig seat set-model` / `stop` / `clean`** — persist the model for later managed resumes, stop
231
+ exactly one live seat, or clear a dead seat's stale binding. When the topology is right and only
232
+ the occupant is wrong, use these seat lifecycle verbs or `rig handover`, not a rig down/up cycle.
216
233
  - **`rig compact-plan`** → **`rig compact`** — who is near the context wall, then act on it.
217
234
  **Ordering matters: running `compact` without the plan is guessing which seat needed it.**
218
235
  - **Know what compaction costs before you reach for it.** On some runtimes what comes back has
@@ -251,6 +268,8 @@ scheme, and nothing downstream can see it.
251
268
  is never evidence the work is good.
252
269
  - **`rig scope slice repair` / `mission repair`** — conform missing progress files and malformed
253
270
  frontmatter without hand-editing YAML.
271
+ - **`docs/reference/sdlc-conventions.md`** — choose from the SDLC component menu with its planning
272
+ dial when shaping mission/slice YAML. It is a menu sized to the work, not a fixed pipeline.
254
273
  - **`rig proof add`** — put evidence where the slice, the audit and the UI will all find it,
255
274
  instead of pasting it into a message. **The contract it pairs to is chosen by source-selection
256
275
  law, and a pristine scaffold PRD can never silently become that contract**: the drop derives
@@ -259,6 +278,9 @@ scheme, and nothing downstream can see it.
259
278
  own echo is the answer — not a re-read of the files.
260
279
  - **`rig workspace doctor` / `validate`** — does the daemon agree with you about where the work
261
280
  tree is, and which files are missing the frontmatter their kind requires.
281
+ - **`rig context work-install --project … --mission … --slice … [--deliver]`** — resolves the ordered
282
+ context plan; add `--deliver` to emit the exact extant files in that same order while marking
283
+ absent pieces visibly. Without the flag it remains plan-only.
262
284
  - **`rig context show` / `sync` / `rm`** — what is inside a context pack before you prime a seat
263
285
  with it, and how to make the library catch up when you edit one.
264
286
  - **`rig context get <name-or-ref>`** — pull exact context by address instead of reading files:
@@ -276,6 +298,9 @@ scheme, and nothing downstream can see it.
276
298
  atoms. Cross-source access (`seat:` / `mission:` atoms) is an **authoring** affordance: declared
277
299
  in pack manifests and granted via `--rig/--seat/--mission` at composition time — never an
278
300
  ad-hoc argument to `get`.
301
+ - **Stable position knowledge is `taxonomy: lore`, not a public skill.** Route it with
302
+ `docs/reference/lore-routing.md` so private seat knowledge stays reusable without entering the
303
+ shipped capability world.
279
304
  - **`rig context recap-write`** — a durable, seat-scoped RECAP beside LEARNED with a
280
305
  collision-safe superseded chain, written at the handover or compaction boundary; restore
281
306
  packets carry the pointer, so a successor reads decisions-with-rationale instead of scrollback.
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "applying-a-permission-policy"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when a permission policy is attached to a rig/seat (rig.yaml permission_policy:), or a user asks you to apply one, and you must translate that harness-neutral policy into the target harness's LIVE permission config — Claude settings.json / Codex config.toml / Pi run flags. Agent-driven and interactive: you read the policy, ground yourself in YOUR harness version, show the diff, and ask before writing. NOT for defining policies (that's the policy spec) and NOT a set-and-forget updater."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "claude-compaction-restore"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when a Claude Code session has just compacted, is about to compact, reached context limit, resumed after /compact, or needs to rebuild its working mental model from Claude JSONL transcripts and touched files."
7
7
  files:
@@ -6,7 +6,12 @@ import { spawnSync } from "node:child_process";
6
6
 
7
7
  const skillRoot = path.resolve(new URL("..", import.meta.url).pathname);
8
8
  const restoreScript = path.join(skillRoot, "scripts", "restore-from-jsonl.mjs");
9
- const outRoot = "/tmp/claude-compaction-restore";
9
+ // P6(C) injectable output-root: the packet base defaults to the shared
10
+ // /tmp/claude-compaction-restore (production), but becomes per-run isolated when the
11
+ // hermetic env-var OPENRIG_COMPACTION_OUT_ROOT is set — so concurrent writers with the
12
+ // same injected clock + sessionId no longer collide on the same `${sessionId}-${stamp}`
13
+ // dir. Mirrors the injectable-clock seam (OPENRIG_TEST_CLOCK_NOW). Empty/absent = /tmp.
14
+ const outRoot = process.env.OPENRIG_COMPACTION_OUT_ROOT || "/tmp/claude-compaction-restore";
10
15
  const defaultRestoreInstruction =
11
16
  "Read the claude-compaction-restore skill and follow its \"If You Just Compacted\" protocol.";
12
17
 
@@ -24,6 +29,14 @@ function getOpenRigHome() {
24
29
  return process.env.OPENRIG_HOME || process.env.RIGGED_HOME || path.join(os.homedir(), ".openrig");
25
30
  }
26
31
 
32
+ // A3-R3 injectable clock (slice 51-01): marker.createdAt defaults to real wall-clock,
33
+ // but becomes deterministic when the shared hermetic env-var OPENRIG_TEST_CLOCK_NOW is
34
+ // set (an ISO instant). Empty/absent = production real-time.
35
+ function nowIso() {
36
+ const injected = process.env.OPENRIG_TEST_CLOCK_NOW;
37
+ return typeof injected === "string" && injected.trim().length > 0 ? injected : new Date().toISOString();
38
+ }
39
+
27
40
  function expandInstructionPath(filePath) {
28
41
  if (filePath.startsWith("~/")) return path.join(os.homedir(), filePath.slice(2));
29
42
  if (filePath.startsWith("${OPENRIG_HOME}/")) {
@@ -41,6 +54,50 @@ function readInstructionFile(filePath) {
41
54
  return fs.readFileSync(expanded, "utf8");
42
55
  }
43
56
 
57
+ // OPR.0.4.1.09 / R5 marker-lifecycle (foreign-content-in-marker face): the hook
58
+ // path must apply the SAME seat-check the daemon enforcer's resolvePostCompactExtra
59
+ // applies (rev1-r2 dcd95bd9), or a FOREIGN seat's global messageFilePath leaks into
60
+ // THIS seat's marker. Parse a WELL-FORMED leading `---` frontmatter for a declared
61
+ // seat (target_seat / seat / session); body text is never scanned; a broken/absent
62
+ // fence is GENERIC (valid for any seat). Byte-mirrors the enforcer regexes.
63
+ function declaredSeatOf(content) {
64
+ const fm = /^\s*---\s*\n([\s\S]*?)\n---/.exec(content);
65
+ if (!fm) return null;
66
+ const m = /^[ \t]*(?:target[_-]?seat|seat|session(?:[_-]?name)?)[ \t]*:[ \t]*["']?([^"'\n#]+?)["']?[ \t]*$/im.exec(fm[1]);
67
+ return m ? m[1].trim() : null;
68
+ }
69
+
70
+ function sanitizeSeat(value) {
71
+ return value.replace(/[^a-zA-Z0-9_.@-]/g, "_");
72
+ }
73
+
74
+ // Resolve the post-compaction extra FOR THIS SEAT (mirror of the enforcer): (1) prefer
75
+ // a per-seat compaction/post-compact-extra/<seat>.md — no cross-seat contamination
76
+ // possible; (2) fall back to the global ONLY when it does not declare a DIFFERENT seat
77
+ // (a wrong-seat global is REFUSED). Generic/undeclared/configured-but-absent stay
78
+ // allowed. Returns the path to read, or null when nothing valid for this seat.
79
+ function resolveSeatSafeExtraPath(globalFilePathRaw) {
80
+ const rawSeat = process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || "";
81
+ const seatKey = rawSeat ? sanitizeSeat(rawSeat) : "";
82
+ if (seatKey) {
83
+ const perSeatPath = path.join(getOpenRigHome(), "compaction", "post-compact-extra", `${seatKey}.md`);
84
+ if (fs.existsSync(perSeatPath)) {
85
+ const declared = declaredSeatOf(fs.readFileSync(perSeatPath, "utf8"));
86
+ if (declared && sanitizeSeat(declared) !== seatKey) return null; // wrong-seat per-seat file
87
+ return perSeatPath;
88
+ }
89
+ }
90
+ const trimmed = (globalFilePathRaw || "").trim();
91
+ if (!trimmed) return null;
92
+ const expanded = expandInstructionPath(trimmed);
93
+ // configured-but-absent: keep the path (an absent file cannot be a wrong-seat leak;
94
+ // readInstructionFile returns "" so nothing is appended).
95
+ if (!fs.existsSync(expanded)) return trimmed;
96
+ const declared = declaredSeatOf(fs.readFileSync(expanded, "utf8"));
97
+ if (declared && sanitizeSeat(declared) !== seatKey) return null; // foreign-seat global REFUSED
98
+ return trimmed;
99
+ }
100
+
44
101
  function sessionKey(input) {
45
102
  const raw = [
46
103
  process.env.OPENRIG_SESSION_NAME,
@@ -58,12 +115,28 @@ function pendingMarkerPath(input) {
58
115
  return path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.json`);
59
116
  }
60
117
 
118
+ // R5 absent-when-needed: drop a lightweight EXPECTED sentinel FIRST (before the packet is
119
+ // generated + the marker is written), carrying the SAME identity binding the marker gets.
120
+ // Its presence-without-a-marker is what lets the bridge be LOUD about a missing packet
121
+ // (hook died partway / write failed); policy off = no hook = no sentinel = silent.
122
+ function writeExpectedSentinel(input) {
123
+ const p = path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.expected.json`);
124
+ fs.mkdirSync(path.dirname(p), { recursive: true });
125
+ fs.writeFileSync(p, `${JSON.stringify({
126
+ version: 1,
127
+ sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
128
+ sessionId: input.session_id || input.sessionId || null,
129
+ transcriptPath: input.transcript_path || null,
130
+ createdAt: nowIso(),
131
+ }, null, 2)}\n`, "utf8");
132
+ }
133
+
61
134
  function writePendingRestoreMarker(input, parsed, restoreInstruction, customMessage) {
62
135
  const markerPath = pendingMarkerPath(input);
63
136
  fs.mkdirSync(path.dirname(markerPath), { recursive: true });
64
137
  const payload = {
65
138
  version: 1,
66
- createdAt: new Date().toISOString(),
139
+ createdAt: nowIso(),
67
140
  sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
68
141
  sessionId: input.session_id || input.sessionId || null,
69
142
  transcriptPath: input.transcript_path || null,
@@ -118,13 +191,18 @@ function readClaudeCompactionMessage() {
118
191
  parts.push(`Inline restore instruction:\n${inline}`);
119
192
  }
120
193
  if (filePath && filePath.length > 0) {
121
- try {
122
- const fileText = readInstructionFile(filePath);
123
- if (fileText) {
124
- parts.push(`Additional restore instruction file (${filePath}):\n${fileText}`);
194
+ // R5 seat-check: resolve to the per-seat extra or a seat-safe global; a
195
+ // foreign-seat global resolves to null and is never injected into this marker.
196
+ const resolved = resolveSeatSafeExtraPath(filePath);
197
+ if (resolved) {
198
+ try {
199
+ const fileText = readInstructionFile(resolved);
200
+ if (fileText) {
201
+ parts.push(`Additional restore instruction file (${resolved}):\n${fileText}`);
202
+ }
203
+ } catch {
204
+ // Keep any inline instruction; unreadable extra files degrade quietly.
125
205
  }
126
- } catch {
127
- // Keep any inline instruction; unreadable extra files degrade quietly.
128
206
  }
129
207
  }
130
208
  if (parts.length > 0) return parts.join("\n\n");
@@ -140,7 +218,16 @@ function buildSystemMessage(restoreInstruction, customMessage) {
140
218
  }
141
219
 
142
220
  try {
221
+ // Slice 51-01 RIDER (leak-visibility, review-r1 escalation): OPENRIG_TEST_CLOCK_NOW is
222
+ // read by nowIso() to make createdAt deterministic in tests — but a LEAKED var in a
223
+ // real seat would silently FREEZE production createdAt. Announce loudly on stderr when
224
+ // active so any leak is visible in seat logs; absence stays silent (production path).
225
+ // MUST stay byte-identical to STUB_CLOCK_ANNOUNCEMENT in stub-runner.ts.
226
+ if (typeof process.env.OPENRIG_TEST_CLOCK_NOW === "string" && process.env.OPENRIG_TEST_CLOCK_NOW.trim().length > 0) {
227
+ process.stderr.write("OPENRIG_TEST_CLOCK_NOW active — timestamps are injected\n");
228
+ }
143
229
  const input = readHookInput();
230
+ writeExpectedSentinel(input); // R5: sentinel FIRST, before the packet + marker (catches hook-died-partway)
144
231
  const args = [restoreScript, "--out", outRoot, "--json"];
145
232
  if (input.cwd) args.push("--cwd", input.cwd);
146
233
  if (input.transcript_path && input.transcript_path.endsWith(".jsonl") && fs.existsSync(input.transcript_path)) {
@@ -423,8 +423,16 @@ function restoreInstructions(summary, outputPaths) {
423
423
  return lines.join("\n");
424
424
  }
425
425
 
426
+ // A3-R3 injectable clock (slice 51-01): the packet output-dir timestamped path
427
+ // defaults to real wall-clock, but becomes deterministic when the shared hermetic
428
+ // env-var OPENRIG_TEST_CLOCK_NOW is set (an ISO instant). Empty/absent = production.
429
+ function nowIso() {
430
+ const injected = process.env.OPENRIG_TEST_CLOCK_NOW;
431
+ return typeof injected === "string" && injected.trim().length > 0 ? injected : new Date().toISOString();
432
+ }
433
+
426
434
  function writeOutputs(summary, outRoot) {
427
- const stamp = new Date().toISOString().replace(/[:.]/g, "-");
435
+ const stamp = nowIso().replace(/[:.]/g, "-");
428
436
  const base = path.join(outRoot, `${summary.sessionId ?? "unknown-session"}-${stamp}`);
429
437
  fs.mkdirSync(base, { recursive: true });
430
438
 
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "agent-starters"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when creating, refreshing, packaging, inspecting, promoting, or deprecating a named per-seat starting point — Agent Starter manifest authoring, the 6-state lifecycle (captured → named → inspectable → used → promoted → deprecated), provenance honesty, and refusal rules. NOT a VM image; a managed starting point composed from agent role + startup context + optional native session source + provenance."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "agent-startup-and-context-ingestion"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when designing or auditing how an agent becomes useful after launch — AGENTS.md overlays, role files, skills, rig specs, workflow specs, startup checklists, refocus messages, \"rig context\" surface. Covers the 4 failure modes that make startup context fail (old rig spec misses current operating mode; current agents never told about new guidance; startup file as dumping ground; orchestrator transmits implementation without preserving product intent)."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "cross-host-rig-commands"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when issuing `rig` commands against a remote host via `--host <id>` flag (single-hop SSH to a host declared in `~/.openrig/hosts.yaml`). Covers the 4 structured failure modes (ssh-unreachable / permission-gate / remote-daemon-unreachable / remote-command-failed), the `--verify` honest pass-through (SSH success is NOT verify success), and the host-registry shape. v0 supports `rig send / capture / ps / whoami --host <id>`."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "human-in-the-loop"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when classifying a slice closeout (auto-continue / human gate / park), routing a real decision to a human, or designing a human queue/dashboard surface. Treats humans as durable network participants with attention surfaces, queues, and decision records — escalation lands as a durable attention item, not a chat message. Approval is NOT required for every clean closeout; the default RSI conveyor continues unless an explicit human gate is reached."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "messaging-the-human"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when a human decision, access grant, external action, or escalation must survive the operator's absence, or when an orchestrator or PM has a judgment-worthy update for the operator."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "openrig-architect"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when designing multi-agent topologies that run ON OpenRig — authoring RigSpec and AgentSpec files for new rigs, creating agent startup content (guidance / skills / culture), or diagnosing why a launched rig's agents aren't behaving as intended. NOT for changing OpenRig itself (use openrig-builder); NOT for ordinary CLI operation of an existing rig (use openrig-user). Covers the full authoring lifecycle from user intent to validated, launchable rig."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "openrig-cmux"
4
- version: "0.5.7"
4
+ version: "0.5.8"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when opening OpenRig fleet terminals into cmux — turning a rig, pod, mission, slice, or saved view into live agent tiles via `rig terminal --provider cmux`, or driving cmux on an agent's request. Same OpenRig view semantics as openrig-herdr (the verbs, honest-partial/degrade, read-only cross-rig, scroll/copy, same-size-only duplicates); cmux is the **best-effort** provider (herdr is the default and the proof-gated one). Prefer openrig-herdr unless cmux is specifically wanted."
7
7
  files: