@openrig/cli 0.5.2 → 0.5.3

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 (484) hide show
  1. package/daemon/assets/plugins/openrig-core/hooks/claude.json +36 -0
  2. package/daemon/assets/plugins/openrig-core/hooks/codex.json +27 -0
  3. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +132 -0
  4. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +35 -3
  5. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +8 -95
  6. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +63 -20
  7. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +6 -2
  8. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +28 -2
  9. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +42 -52
  10. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +23 -1
  11. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +7 -2
  12. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/CHANGELOG.md +64 -0
  13. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/SKILL.md +235 -0
  14. package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +31 -1
  15. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/CHANGELOG.md +48 -0
  16. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +211 -0
  17. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +8 -0
  18. package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +28 -1
  19. package/daemon/context-packs/skills/core/agent-starters/SKILL.md +132 -0
  20. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +9 -0
  21. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/SKILL.md +112 -0
  22. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +9 -0
  23. package/daemon/context-packs/skills/core/attention-queue/SKILL.md +264 -0
  24. package/daemon/context-packs/skills/core/attention-queue/manifest.yaml +9 -0
  25. package/daemon/context-packs/skills/core/cross-host-rig-commands/SKILL.md +195 -0
  26. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +9 -0
  27. package/daemon/context-packs/skills/core/human-in-the-loop/SKILL.md +104 -0
  28. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +9 -0
  29. package/daemon/context-packs/skills/core/openrig-architect/SKILL.md +378 -0
  30. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +9 -0
  31. package/daemon/context-packs/skills/core/openrig-cmux/SKILL.md +81 -0
  32. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +9 -0
  33. package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +153 -0
  34. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +9 -0
  35. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +460 -0
  36. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +9 -0
  37. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/SKILL.md +101 -0
  38. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +9 -0
  39. package/daemon/context-packs/skills/core/rig-lifecycle/SKILL.md +127 -0
  40. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +9 -0
  41. package/daemon/context-packs/skills/core/session-source-fork/SKILL.md +160 -0
  42. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +9 -0
  43. package/daemon/context-packs/skills/core/specification-system/SKILL.md +103 -0
  44. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +9 -0
  45. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/SKILL.md +118 -0
  46. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +9 -0
  47. package/daemon/context-packs/skills/core/watchdog/SKILL.md +126 -0
  48. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +9 -0
  49. package/daemon/context-packs/skills/pm/backlog-capture/SKILL.md +43 -0
  50. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +9 -0
  51. package/daemon/context-packs/skills/pm/context-builder/SKILL.md +87 -0
  52. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +9 -0
  53. package/daemon/context-packs/skills/pm/exec-summary/SKILL.md +84 -0
  54. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +9 -0
  55. package/daemon/context-packs/skills/pm/office-hours/SKILL.md +129 -0
  56. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +9 -0
  57. package/daemon/context-packs/skills/pm/plan-review/SKILL.md +98 -0
  58. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +9 -0
  59. package/daemon/context-packs/skills/pm/requirements-writer/SKILL.md +113 -0
  60. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +9 -0
  61. package/daemon/context-packs/skills/pm/ui-mockup/SKILL.md +76 -0
  62. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +9 -0
  63. package/daemon/context-packs/skills/pods/development-team/SKILL.md +156 -0
  64. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +9 -0
  65. package/daemon/context-packs/skills/pods/orchestration-team/SKILL.md +307 -0
  66. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +9 -0
  67. package/daemon/context-packs/skills/pods/oversight-team/SKILL.md +106 -0
  68. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +9 -0
  69. package/daemon/context-packs/skills/pods/review-team/SKILL.md +213 -0
  70. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +9 -0
  71. package/daemon/context-packs/skills/process/agent-browser/LOCAL-INSIGHTS.md +189 -0
  72. package/daemon/context-packs/skills/process/agent-browser/OPENRIG.md +40 -0
  73. package/daemon/context-packs/skills/process/agent-browser/SKILL.md +427 -0
  74. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +13 -0
  75. package/daemon/context-packs/skills/process/brainstorming/OPENRIG.md +48 -0
  76. package/daemon/context-packs/skills/process/brainstorming/SKILL.md +107 -0
  77. package/daemon/context-packs/skills/process/brainstorming/manifest.yaml +11 -0
  78. package/daemon/context-packs/skills/process/context-engineering/SKILL.md +479 -0
  79. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +9 -0
  80. package/daemon/context-packs/skills/process/dogfood/SKILL.md +225 -0
  81. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +13 -0
  82. package/daemon/context-packs/skills/process/dogfood/references/issue-taxonomy.md +109 -0
  83. package/daemon/context-packs/skills/process/dogfood/templates/dogfood-report-template.md +53 -0
  84. package/daemon/context-packs/skills/process/executing-plans/OPENRIG.md +56 -0
  85. package/daemon/context-packs/skills/process/executing-plans/SKILL.md +94 -0
  86. package/daemon/context-packs/skills/process/executing-plans/manifest.yaml +11 -0
  87. package/daemon/context-packs/skills/process/frontend-design/LICENSE.txt +177 -0
  88. package/daemon/context-packs/skills/process/frontend-design/SKILL.md +50 -0
  89. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +11 -0
  90. package/daemon/context-packs/skills/process/systematic-debugging/SKILL.md +301 -0
  91. package/daemon/context-packs/skills/process/systematic-debugging/condition-based-waiting-example.ts +158 -0
  92. package/daemon/context-packs/skills/process/systematic-debugging/condition-based-waiting.md +115 -0
  93. package/daemon/context-packs/skills/process/systematic-debugging/defense-in-depth.md +122 -0
  94. package/daemon/context-packs/skills/process/systematic-debugging/find-polluter.sh +63 -0
  95. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +19 -0
  96. package/daemon/context-packs/skills/process/systematic-debugging/root-cause-tracing.md +169 -0
  97. package/daemon/context-packs/skills/process/test-driven-development/SKILL.md +385 -0
  98. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +11 -0
  99. package/daemon/context-packs/skills/process/test-driven-development/testing-anti-patterns.md +299 -0
  100. package/daemon/context-packs/skills/process/using-superpowers/OPENRIG.md +48 -0
  101. package/daemon/context-packs/skills/process/using-superpowers/SKILL.md +106 -0
  102. package/daemon/context-packs/skills/process/using-superpowers/manifest.yaml +11 -0
  103. package/daemon/context-packs/skills/process/verification-before-completion/SKILL.md +155 -0
  104. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +9 -0
  105. package/daemon/context-packs/skills/process/writing-plans/OPENRIG.md +52 -0
  106. package/daemon/context-packs/skills/process/writing-plans/SKILL.md +126 -0
  107. package/daemon/context-packs/skills/process/writing-plans/manifest.yaml +11 -0
  108. package/daemon/context-packs/world/install/01-world-from-primitives.md +97 -0
  109. package/daemon/context-packs/world/install/02-permission-self-sleep.md +141 -0
  110. package/daemon/context-packs/world/install/03-what-this-is-for.md +86 -0
  111. package/daemon/context-packs/world/install/04-ontology.md +790 -0
  112. package/daemon/context-packs/world/install/05-harness-power-use.md +355 -0
  113. package/daemon/context-packs/world/install/06-a-competent-turn.md +225 -0
  114. package/daemon/context-packs/world/install/manifest.yaml +125 -0
  115. package/daemon/context-packs/world/install/reference-material.md +125 -0
  116. package/daemon/context-packs/world/install/what-you-can-do.md +416 -0
  117. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  118. package/daemon/dist/adapters/claude-code-adapter.js +7 -4
  119. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  120. package/daemon/dist/adapters/claude-resume.js +2 -2
  121. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  122. package/daemon/dist/adapters/tmux.d.ts +10 -2
  123. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  124. package/daemon/dist/adapters/tmux.js +27 -7
  125. package/daemon/dist/adapters/tmux.js.map +1 -1
  126. package/daemon/dist/adapters/yolo-mode.d.ts +18 -0
  127. package/daemon/dist/adapters/yolo-mode.d.ts.map +1 -1
  128. package/daemon/dist/adapters/yolo-mode.js +21 -0
  129. package/daemon/dist/adapters/yolo-mode.js.map +1 -1
  130. package/daemon/dist/build-info.js +3 -3
  131. package/daemon/dist/domain/codex-thread-id.d.ts +95 -0
  132. package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  133. package/daemon/dist/domain/codex-thread-id.js +171 -2
  134. package/daemon/dist/domain/codex-thread-id.js.map +1 -1
  135. package/daemon/dist/domain/context-packs/context-pack-types.d.ts +48 -0
  136. package/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  137. package/daemon/dist/domain/context-packs/context-pack-types.js +8 -0
  138. package/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  139. package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  140. package/daemon/dist/domain/context-packs/manifest-parser.js +234 -2
  141. package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  142. package/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts +34 -0
  143. package/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts.map +1 -0
  144. package/daemon/dist/domain/context-packs/probe-eval-bridge.js +38 -0
  145. package/daemon/dist/domain/context-packs/probe-eval-bridge.js.map +1 -0
  146. package/daemon/dist/domain/context-packs/profile-composer.d.ts +49 -0
  147. package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -0
  148. package/daemon/dist/domain/context-packs/profile-composer.js +125 -0
  149. package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -0
  150. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +53 -0
  151. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -0
  152. package/daemon/dist/domain/context-packs/profile-source-resolver.js +129 -0
  153. package/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -0
  154. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts +48 -0
  155. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts.map +1 -0
  156. package/daemon/dist/domain/context-packs/seat-recap-store.js +123 -0
  157. package/daemon/dist/domain/context-packs/seat-recap-store.js.map +1 -0
  158. package/daemon/dist/domain/markdown-address.d.ts +56 -0
  159. package/daemon/dist/domain/markdown-address.d.ts.map +1 -0
  160. package/daemon/dist/domain/markdown-address.js +188 -0
  161. package/daemon/dist/domain/markdown-address.js.map +1 -0
  162. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +8 -2
  163. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  164. package/daemon/dist/domain/model-divergence/current-generation-record.js +1 -1
  165. package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  166. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +33 -21
  167. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
  168. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +64 -55
  169. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
  170. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +4 -0
  171. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
  172. package/daemon/dist/domain/periodic-snapshot-scheduler.js +5 -1
  173. package/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
  174. package/daemon/dist/domain/permission-drift-observer.d.ts.map +1 -1
  175. package/daemon/dist/domain/permission-drift-observer.js +6 -1
  176. package/daemon/dist/domain/permission-drift-observer.js.map +1 -1
  177. package/daemon/dist/domain/process-census.d.ts +25 -0
  178. package/daemon/dist/domain/process-census.d.ts.map +1 -0
  179. package/daemon/dist/domain/process-census.js +47 -0
  180. package/daemon/dist/domain/process-census.js.map +1 -0
  181. package/daemon/dist/domain/resume-metadata-refresher.d.ts +31 -2
  182. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  183. package/daemon/dist/domain/resume-metadata-refresher.js +64 -29
  184. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  185. package/daemon/dist/domain/review/compose.d.ts +5 -26
  186. package/daemon/dist/domain/review/compose.d.ts.map +1 -1
  187. package/daemon/dist/domain/review/compose.js +31 -57
  188. package/daemon/dist/domain/review/compose.js.map +1 -1
  189. package/daemon/dist/domain/rigspec-instantiator.d.ts +4 -0
  190. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  191. package/daemon/dist/domain/rigspec-instantiator.js +39 -0
  192. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  193. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  194. package/daemon/dist/domain/rigspec-schema.js +19 -3
  195. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  196. package/daemon/dist/domain/scope/logical-checkbox.d.ts +26 -0
  197. package/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -0
  198. package/daemon/dist/domain/scope/logical-checkbox.js +65 -0
  199. package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -0
  200. package/daemon/dist/domain/scope/plan-lock-artifacts.d.ts +1 -1
  201. package/daemon/dist/domain/scope/plan-lock-artifacts.d.ts.map +1 -1
  202. package/daemon/dist/domain/scope/plan-lock-artifacts.js +2 -2
  203. package/daemon/dist/domain/scope/plan-lock-artifacts.js.map +1 -1
  204. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts +22 -0
  205. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts.map +1 -1
  206. package/daemon/dist/domain/scope/scaffold-placeholder.js +24 -0
  207. package/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -1
  208. package/daemon/dist/domain/seat-activity-service.d.ts +1 -0
  209. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  210. package/daemon/dist/domain/seat-activity-service.js +39 -23
  211. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  212. package/daemon/dist/domain/seat-handover-service.d.ts +22 -0
  213. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  214. package/daemon/dist/domain/seat-handover-service.js +32 -2
  215. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  216. package/daemon/dist/domain/session-transport.d.ts +8 -0
  217. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  218. package/daemon/dist/domain/session-transport.js +116 -0
  219. package/daemon/dist/domain/session-transport.js.map +1 -1
  220. package/daemon/dist/domain/shell-classifier.d.ts +23 -0
  221. package/daemon/dist/domain/shell-classifier.d.ts.map +1 -0
  222. package/daemon/dist/domain/shell-classifier.js +36 -0
  223. package/daemon/dist/domain/shell-classifier.js.map +1 -0
  224. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  225. package/daemon/dist/domain/slices/slice-detail-projector.js +10 -1
  226. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  227. package/daemon/dist/domain/spec-validation-advisory.d.ts +17 -0
  228. package/daemon/dist/domain/spec-validation-advisory.d.ts.map +1 -0
  229. package/daemon/dist/domain/spec-validation-advisory.js +38 -0
  230. package/daemon/dist/domain/spec-validation-advisory.js.map +1 -0
  231. package/daemon/dist/domain/successor-session-launcher.d.ts +7 -0
  232. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  233. package/daemon/dist/domain/successor-session-launcher.js +38 -1
  234. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  235. package/daemon/dist/domain/topology-defaults-installer.d.ts +47 -0
  236. package/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -0
  237. package/daemon/dist/domain/topology-defaults-installer.js +92 -0
  238. package/daemon/dist/domain/topology-defaults-installer.js.map +1 -0
  239. package/daemon/dist/domain/transcript-rotation.d.ts +4 -0
  240. package/daemon/dist/domain/transcript-rotation.d.ts.map +1 -1
  241. package/daemon/dist/domain/transcript-rotation.js +61 -3
  242. package/daemon/dist/domain/transcript-rotation.js.map +1 -1
  243. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  244. package/daemon/dist/domain/transcript-store.js +9 -2
  245. package/daemon/dist/domain/transcript-store.js.map +1 -1
  246. package/daemon/dist/domain/types.d.ts +3 -0
  247. package/daemon/dist/domain/types.d.ts.map +1 -1
  248. package/daemon/dist/domain/user-settings/settings-store.d.ts +10 -1
  249. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  250. package/daemon/dist/domain/user-settings/settings-store.js +39 -0
  251. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  252. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  253. package/daemon/dist/routes/context-packs.js +205 -0
  254. package/daemon/dist/routes/context-packs.js.map +1 -1
  255. package/daemon/dist/routes/seat.d.ts.map +1 -1
  256. package/daemon/dist/routes/seat.js +11 -0
  257. package/daemon/dist/routes/seat.js.map +1 -1
  258. package/daemon/dist/routes/sessions.js +55 -0
  259. package/daemon/dist/routes/sessions.js.map +1 -1
  260. package/daemon/dist/routes/transport.d.ts.map +1 -1
  261. package/daemon/dist/routes/transport.js +12 -3
  262. package/daemon/dist/routes/transport.js.map +1 -1
  263. package/daemon/dist/seat-recap-store-surface.d.ts +2 -0
  264. package/daemon/dist/seat-recap-store-surface.d.ts.map +1 -0
  265. package/daemon/dist/seat-recap-store-surface.js +6 -0
  266. package/daemon/dist/seat-recap-store-surface.js.map +1 -0
  267. package/daemon/dist/startup.d.ts.map +1 -1
  268. package/daemon/dist/startup.js +37 -6
  269. package/daemon/dist/startup.js.map +1 -1
  270. package/daemon/docs/reference/chain-file-convention.md +115 -0
  271. package/daemon/docs/reference/legacy-topology-migration.md +53 -0
  272. package/daemon/docs/reference/refocus-channel.md +80 -0
  273. package/daemon/docs/reference/sdlc-conventions.md +24 -0
  274. package/daemon/specs/agents/shared/skills/core/attention-queue/SKILL.md +1 -1
  275. package/daemon/specs/agents/shared/skills/core/human-in-the-loop/SKILL.md +1 -1
  276. package/daemon/specs/agents/shared/skills/core/session-source-fork/SKILL.md +1 -1
  277. package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +4 -4
  278. package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +8 -0
  279. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +72 -31
  280. package/daemon/specs/agents/shared/skills/pods/oversight-team/SKILL.md +106 -0
  281. package/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.md +479 -0
  282. package/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md +9 -0
  283. package/daemon/specs/rigs/launch/demo/project-example/README.md +25 -0
  284. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/SPEC.md +19 -0
  285. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/slices/01-shorten-first-run/PROGRESS.md +6 -0
  286. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/slices/01-shorten-first-run/PROOF.md +7 -0
  287. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/slices/01-shorten-first-run/SPEC.md +31 -0
  288. package/daemon/specs/rigs/preview/product-team/topology/instance/CRAFT.md +24 -0
  289. package/daemon/specs/rigs/preview/product-team/topology/rig/CRAFT.md +21 -0
  290. package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +50 -0
  291. package/daemon/specs/rigs/preview/product-team/topology/seats/dev1-qa/CRAFT.md +13 -0
  292. package/daemon/specs/rigs/preview/product-team/topology/seats/orch1-lead/CRAFT.md +17 -0
  293. package/daemon/specs/rigs/preview/product-team/topology/seats/rev1-r1/CRAFT.md +17 -0
  294. package/daemon/specs/rigs/preview/product-team/topology/seats/rev1-r2/CRAFT.md +15 -0
  295. package/dist/build-info.js +3 -3
  296. package/dist/commands/config.d.ts.map +1 -1
  297. package/dist/commands/config.js +8 -0
  298. package/dist/commands/config.js.map +1 -1
  299. package/dist/commands/context.d.ts.map +1 -1
  300. package/dist/commands/context.js +353 -48
  301. package/dist/commands/context.js.map +1 -1
  302. package/dist/commands/proof.d.ts.map +1 -1
  303. package/dist/commands/proof.js +70 -12
  304. package/dist/commands/proof.js.map +1 -1
  305. package/dist/commands/rig.d.ts.map +1 -1
  306. package/dist/commands/rig.js +5 -0
  307. package/dist/commands/rig.js.map +1 -1
  308. package/dist/commands/transcript.d.ts.map +1 -1
  309. package/dist/commands/transcript.js +25 -1
  310. package/dist/commands/transcript.js.map +1 -1
  311. package/dist/commands/walk.d.ts.map +1 -1
  312. package/dist/commands/walk.js +279 -26
  313. package/dist/commands/walk.js.map +1 -1
  314. package/dist/config-store.d.ts +15 -1
  315. package/dist/config-store.d.ts.map +1 -1
  316. package/dist/config-store.js +35 -1
  317. package/dist/config-store.js.map +1 -1
  318. package/dist/lib/scope/logical-checkbox.d.ts +26 -0
  319. package/dist/lib/scope/logical-checkbox.d.ts.map +1 -0
  320. package/dist/lib/scope/logical-checkbox.js +65 -0
  321. package/dist/lib/scope/logical-checkbox.js.map +1 -0
  322. package/dist/lib/scope/scaffold-placeholder.d.ts +22 -0
  323. package/dist/lib/scope/scaffold-placeholder.d.ts.map +1 -1
  324. package/dist/lib/scope/scaffold-placeholder.js +24 -0
  325. package/dist/lib/scope/scaffold-placeholder.js.map +1 -1
  326. package/dist/lib/topology-trace.d.ts +36 -0
  327. package/dist/lib/topology-trace.d.ts.map +1 -0
  328. package/dist/lib/topology-trace.js +91 -0
  329. package/dist/lib/topology-trace.js.map +1 -0
  330. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  331. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js +7 -4
  332. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  333. package/node_modules/@openrig/daemon/dist/adapters/claude-resume.js +2 -2
  334. package/node_modules/@openrig/daemon/dist/adapters/claude-resume.js.map +1 -1
  335. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +10 -2
  336. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
  337. package/node_modules/@openrig/daemon/dist/adapters/tmux.js +27 -7
  338. package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
  339. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.d.ts +18 -0
  340. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.d.ts.map +1 -1
  341. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.js +21 -0
  342. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.js.map +1 -1
  343. package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
  344. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.d.ts +95 -0
  345. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  346. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.js +171 -2
  347. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.js.map +1 -1
  348. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts +48 -0
  349. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  350. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js +8 -0
  351. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  352. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  353. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js +234 -2
  354. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  355. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts +34 -0
  356. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts.map +1 -0
  357. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.js +38 -0
  358. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.js.map +1 -0
  359. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts +49 -0
  360. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -0
  361. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js +125 -0
  362. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js.map +1 -0
  363. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +53 -0
  364. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -0
  365. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js +129 -0
  366. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -0
  367. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.d.ts +48 -0
  368. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.d.ts.map +1 -0
  369. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.js +123 -0
  370. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.js.map +1 -0
  371. package/node_modules/@openrig/daemon/dist/domain/markdown-address.d.ts +56 -0
  372. package/node_modules/@openrig/daemon/dist/domain/markdown-address.d.ts.map +1 -0
  373. package/node_modules/@openrig/daemon/dist/domain/markdown-address.js +188 -0
  374. package/node_modules/@openrig/daemon/dist/domain/markdown-address.js.map +1 -0
  375. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts +8 -2
  376. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  377. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js +1 -1
  378. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  379. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +33 -21
  380. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
  381. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.js +64 -55
  382. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
  383. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +4 -0
  384. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
  385. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.js +5 -1
  386. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
  387. package/node_modules/@openrig/daemon/dist/domain/permission-drift-observer.d.ts.map +1 -1
  388. package/node_modules/@openrig/daemon/dist/domain/permission-drift-observer.js +6 -1
  389. package/node_modules/@openrig/daemon/dist/domain/permission-drift-observer.js.map +1 -1
  390. package/node_modules/@openrig/daemon/dist/domain/process-census.d.ts +25 -0
  391. package/node_modules/@openrig/daemon/dist/domain/process-census.d.ts.map +1 -0
  392. package/node_modules/@openrig/daemon/dist/domain/process-census.js +47 -0
  393. package/node_modules/@openrig/daemon/dist/domain/process-census.js.map +1 -0
  394. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.d.ts +31 -2
  395. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  396. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.js +64 -29
  397. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  398. package/node_modules/@openrig/daemon/dist/domain/review/compose.d.ts +5 -26
  399. package/node_modules/@openrig/daemon/dist/domain/review/compose.d.ts.map +1 -1
  400. package/node_modules/@openrig/daemon/dist/domain/review/compose.js +31 -57
  401. package/node_modules/@openrig/daemon/dist/domain/review/compose.js.map +1 -1
  402. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +4 -0
  403. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  404. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +39 -0
  405. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  406. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  407. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js +19 -3
  408. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js.map +1 -1
  409. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.d.ts +26 -0
  410. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -0
  411. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.js +65 -0
  412. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.js.map +1 -0
  413. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.d.ts +1 -1
  414. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.d.ts.map +1 -1
  415. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.js +2 -2
  416. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.js.map +1 -1
  417. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.d.ts +22 -0
  418. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.d.ts.map +1 -1
  419. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.js +24 -0
  420. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -1
  421. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.d.ts +1 -0
  422. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  423. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.js +39 -23
  424. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.js.map +1 -1
  425. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.d.ts +22 -0
  426. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  427. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.js +32 -2
  428. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.js.map +1 -1
  429. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts +8 -0
  430. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts.map +1 -1
  431. package/node_modules/@openrig/daemon/dist/domain/session-transport.js +116 -0
  432. package/node_modules/@openrig/daemon/dist/domain/session-transport.js.map +1 -1
  433. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.d.ts +23 -0
  434. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.d.ts.map +1 -0
  435. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.js +36 -0
  436. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.js.map +1 -0
  437. package/node_modules/@openrig/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  438. package/node_modules/@openrig/daemon/dist/domain/slices/slice-detail-projector.js +10 -1
  439. package/node_modules/@openrig/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  440. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.d.ts +17 -0
  441. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.d.ts.map +1 -0
  442. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.js +38 -0
  443. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.js.map +1 -0
  444. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.d.ts +7 -0
  445. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  446. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.js +38 -1
  447. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  448. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts +47 -0
  449. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -0
  450. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js +92 -0
  451. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js.map +1 -0
  452. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.d.ts +4 -0
  453. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.d.ts.map +1 -1
  454. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.js +61 -3
  455. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.js.map +1 -1
  456. package/node_modules/@openrig/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  457. package/node_modules/@openrig/daemon/dist/domain/transcript-store.js +9 -2
  458. package/node_modules/@openrig/daemon/dist/domain/transcript-store.js.map +1 -1
  459. package/node_modules/@openrig/daemon/dist/domain/types.d.ts +3 -0
  460. package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
  461. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts +10 -1
  462. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  463. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js +39 -0
  464. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  465. package/node_modules/@openrig/daemon/dist/routes/context-packs.d.ts.map +1 -1
  466. package/node_modules/@openrig/daemon/dist/routes/context-packs.js +205 -0
  467. package/node_modules/@openrig/daemon/dist/routes/context-packs.js.map +1 -1
  468. package/node_modules/@openrig/daemon/dist/routes/seat.d.ts.map +1 -1
  469. package/node_modules/@openrig/daemon/dist/routes/seat.js +11 -0
  470. package/node_modules/@openrig/daemon/dist/routes/seat.js.map +1 -1
  471. package/node_modules/@openrig/daemon/dist/routes/sessions.js +55 -0
  472. package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
  473. package/node_modules/@openrig/daemon/dist/routes/transport.d.ts.map +1 -1
  474. package/node_modules/@openrig/daemon/dist/routes/transport.js +12 -3
  475. package/node_modules/@openrig/daemon/dist/routes/transport.js.map +1 -1
  476. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.d.ts +2 -0
  477. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.d.ts.map +1 -0
  478. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.js +6 -0
  479. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.js.map +1 -0
  480. package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
  481. package/node_modules/@openrig/daemon/dist/startup.js +37 -6
  482. package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
  483. package/node_modules/@openrig/daemon/package.json +6 -1
  484. package/package.json +1 -1
@@ -0,0 +1,50 @@
1
+ # Orchestration Craft — shipped defaults (product-team)
2
+
3
+ <!-- Shipped by the product-team rig spec (copy-if-absent; append freely).
4
+ Pod-class tactical reminders, shipped at the RIG altitude by ruling (the
5
+ pod level is deliberately skipped; revisit someday, not now). These are
6
+ the reminders you need AT THE MOMENT OF ACTING on another seat. -->
7
+
8
+ ## Reading another seat's pane
9
+
10
+ - **Ghost text vs staged text.** Both Claude Code and Codex render
11
+ autocomplete GHOST TEXT in the input box, and a capture cannot show font
12
+ color. Discriminators: cursor at the END of the text → possibly
13
+ typed-and-left (staged); cursor at the BEGINNING → ghost text.
14
+ Behaviorally: an Enter that does not consume it → ghost. Misreading ghost
15
+ as staged (or vice versa) has caused real misdiagnoses — check the cursor
16
+ before you conclude anything about an un-submitted line.
17
+ - **Text sitting AT the prompt = staged, not consumed.** The fix is one
18
+ `C-m`, never a re-send (a re-send delivers twice).
19
+ - **The spinner renders ABOVE the input box.** A capture of fewer than ~20
20
+ lines shows a bare prompt for a seat deep in work; never lower the line
21
+ count to "simplify" a liveness read.
22
+
23
+ ## Watching without burning the fleet
24
+
25
+ - **One capture, then arrange to be told.** You cannot watch — only glance,
26
+ and every glance costs a turn. If you must poll: two minutes minimum, and
27
+ identical output twice means STOP polling, not poll harder. A tight loop on
28
+ a shared provider can exhaust the usage limit and stop every seat on it.
29
+ - **Liveness is not health.** A pane can render while nothing progresses.
30
+ Cross the screen (`rig capture`) with `claimedAt` and
31
+ `rig queue transitions` before you call a seat stuck.
32
+
33
+ ## Acting on another seat
34
+
35
+ - **A wake, a refocus, and a checkpoint are three different interventions.**
36
+ A wake restores liveness and must not reframe the work; a refocus corrects
37
+ drift and opens with "finish your current action first"; a checkpoint is a
38
+ deliberate phase-boundary pause. Sending the heavy one is the most common
39
+ self-inflicted stall.
40
+ - **Never compact a peer to unblock something.** What comes back believes it
41
+ knows everything and no longer does — and you are the only one who knows it
42
+ happened. Deposit first, announce, and state what the seat no longer holds.
43
+
44
+ ## Adding a practice to these files
45
+
46
+ Discovery (it appears where it was earned — a LEARNED, a field note, a review
47
+ observation) → curation (is it generally applicable, or project-specific?) →
48
+ ship (add it to the spec's `topology/` defaults in source, one motivating
49
+ incident per line). Editing this installed copy helps THIS rig now; shipping
50
+ it helps every future install. See docs/reference/chain-file-convention.md.
@@ -0,0 +1,13 @@
1
+ # Seat Craft — dev1-qa (shipped default)
2
+
3
+ <!-- Copy-if-absent; this seat's occupants append what the position learns. -->
4
+
5
+ - QA owns the test-fix-feedback LOOP: fix in-slice issues directly, rerun the
6
+ proof, hill-climb, then ask the driver to check. The banned pattern is
7
+ find-bug → file RED → hand back → wait → repeat.
8
+ - You may author a fix; you may not be its sole final verifier.
9
+ - Reproduce before you fix; if the proof apparatus grows bigger than the fix,
10
+ stop and use the product instead — a human clicking finds in minutes what
11
+ immaculate rigor misses for days.
12
+ - A green suite is not proof the user path works: drive the real path on the
13
+ running artifact, pass/fail named before you run it.
@@ -0,0 +1,17 @@
1
+ # Seat Craft — orch1-lead (shipped default)
2
+
3
+ <!-- Copy-if-absent; this seat's occupants append what the position learns. -->
4
+
5
+ - You are the seat whose wrong claim gets believed downstream. Verify at
6
+ SOURCE before ruling — the handler body, not the summary; "merged" means on
7
+ the branch tip, checked with git.
8
+ - Do not do the work yourself: lock what *good* looks like, then delegate.
9
+ Hand-building converts your context — the scarce thing — into output
10
+ someone else could have produced.
11
+ - You are the shock absorber, not the wire: absorb upstream churn, relay only
12
+ settled decisions.
13
+ - Only this seat may park, and only with a watchdog armed
14
+ (`rig watchdog register`). Every other seat passes the baton.
15
+ - Never invent work to look busy; if every action this session was a reaction
16
+ to an inbound message, you have not chosen work once — that is drift even
17
+ when each response was correct.
@@ -0,0 +1,17 @@
1
+ # Seat Craft — rev1-r1 (shipped default)
2
+
3
+ <!-- Copy-if-absent; this seat's occupants append what the position learns. -->
4
+
5
+ - A CLEAR from this seat means you RAN it, not that you read a receipt.
6
+ Reading the handler body is still contract review; the completing check is
7
+ a behavioral probe of the running mechanism.
8
+ - Verdicts are BASE-SCOPED. If main moves during your review, say so in the
9
+ verdict: name both bases and the disposition (restack + patch-id proof
10
+ carries a CLEAR only on MATCH).
11
+ - Gates have a third state: INDETERMINATE. A killed, starved, or
12
+ contention-timed run is not RED and not green — attribute before ruling,
13
+ with a base A/B where possible.
14
+ - Predict before you check: state what a failing result would look like
15
+ BEFORE running the discriminator. If your finding appeared verbatim in the
16
+ dispatch, go read the artifact.
17
+ - Never review your own authorship; name the exclusion in the verdict.
@@ -0,0 +1,15 @@
1
+ # Seat Craft — rev1-r2 (shipped default)
2
+
3
+ <!-- Copy-if-absent; this seat's occupants append what the position learns. -->
4
+
5
+ - Your gate asks a DIFFERENT question than r1's: does each claim survive
6
+ contact with source, on your runtime. Two gates that ask the same question
7
+ are one gate.
8
+ - Check claims at source, not at the summary: open the named files at the
9
+ frozen sha, confirm ancestry from the stated base, run the focused suites
10
+ yourself.
11
+ - Mark every claim you relay: verified-at-source, inherited-unverified, or
12
+ believed. Fluency reads as reliability, so unmarked confidence transfers.
13
+ - An author's green is evidence, not a verdict; your independent count is the
14
+ verdict. Disclose any check you could not complete as INDETERMINATE with
15
+ its cause — never fold it into the CLEAR silently.
@@ -1,9 +1,9 @@
1
1
  // GENERATED by scripts/build-package.sh — the packaged build-identity stamp.
2
2
  export const BUILD_INFO = {
3
- semver: "0.5.2",
4
- commit: "029acda80a198db6d994b8ef80e349c758ad2848",
3
+ semver: "0.5.3",
4
+ commit: "e6add8b86b4bd008b8d46ec31a16fb09aff3b8f2",
5
5
  dirty: false,
6
- builtAt: "2026-08-22T17:39:04Z",
6
+ builtAt: "2026-08-26T02:55:45Z",
7
7
  };
8
8
  export function stampFields(info = BUILD_INFO) {
9
9
  if (!info.commit) return {};
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,wBAAgB,aAAa,CAC3B,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE;IACL,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C,GACA,OAAO,CAuJT"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,wBAAgB,aAAa,CAC3B,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE;IACL,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C,GACA,OAAO,CA+JT"}
@@ -49,8 +49,16 @@ Keys:
49
49
  daemon.* port, host
50
50
  db.path
51
51
  transcripts.* enabled, path, lines, poll_interval_seconds
52
+ (lines/poll_interval set scrollback CAPTURE depth + cadence.
53
+ Thin CLAUDE transcripts usually are NOT these — they mean the
54
+ seat's fullscreen renderer, whose alternate screen emits no
55
+ scrollback. OpenRig launches Claude with
56
+ CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 by default; set
57
+ OPENRIG_CLAUDE_DISABLE_ALTERNATE_SCREEN=0 to opt back into fullscreen.)
52
58
  workspace.* root, slices_root, steering_path, field_notes_root,
53
59
  specs_root, dogfood_evidence_root, operator_seat_name
60
+ topology.root the topology tree root (instance altitude at its top; default $OPENRIG_HOME/topology)
61
+ context.packs_root context-pack library landing zone for 'rig context add' (default $OPENRIG_HOME/context-packs)
54
62
  files.allowlist name:/abs/path,name:/abs/path
55
63
  progress.scan_roots name:/abs/path,name:/abs/path
56
64
  ui.preview.* refresh_interval_seconds, max_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AAG,CAAC,2BAA2B,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACvB,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACvB,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACzB,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA0L9C,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,UAAU,GAAG,OAAO,CA0RjE"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA6Q9C,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,UAAU,GAAG,OAAO,CA0fjE"}
@@ -10,10 +10,11 @@
10
10
  // ~/.openrig/context-packs/<name>/ — host-symlink-free contract,
11
11
  // matches `rig specs add` shape (regular files only; no symlinks).
12
12
  import { Command } from "commander";
13
- import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, } from "node:fs";
13
+ import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync, } from "node:fs";
14
+ import { dirname } from "node:path";
14
15
  import { basename, extname, isAbsolute, join, resolve } from "node:path";
15
16
  import { parse as parseYaml } from "yaml";
16
- import { getDefaultOpenRigPath } from "../openrig-compat.js";
17
+ import { ConfigStore } from "../config-store.js";
17
18
  import { DaemonClient } from "../client.js";
18
19
  import { getDaemonStatus, getDaemonUrl, statusGuardMessage } from "../daemon-lifecycle.js";
19
20
  import { realDeps } from "./daemon.js";
@@ -75,7 +76,10 @@ function assertDestinationNamespaceContained(targetRoot, installName) {
75
76
  }
76
77
  }
77
78
  }
78
- const ALLOWED_CONTEXT_PACK_SUFFIXES = new Set([".md", ".markdown", ".yaml", ".yml", ".txt"]);
79
+ // Kept in lockstep with the daemon parser's ALLOWED_FILE_SUFFIXES (manifest-parser.ts).
80
+ // OPR.0.5.3.7 R2 added .sh/.ts (skill helper assets, served as text); the install
81
+ // validator must accept what the daemon will serve.
82
+ const ALLOWED_CONTEXT_PACK_SUFFIXES = new Set([".md", ".markdown", ".yaml", ".yml", ".txt", ".sh", ".ts"]);
79
83
  function validateContextPackManifestForInstall(manifestPath) {
80
84
  let parsed;
81
85
  try {
@@ -124,6 +128,80 @@ function validateContextPackManifestForInstall(manifestPath) {
124
128
  }
125
129
  }
126
130
  }
131
+ function isHttpUrl(source) {
132
+ return /^https?:\/\//i.test(source);
133
+ }
134
+ async function fetchTextOrThrow(url, what) {
135
+ let res;
136
+ try {
137
+ res = await fetch(url);
138
+ }
139
+ catch (err) {
140
+ throw new Error(`Could not reach ${what} at ${url}: ${err.message}`);
141
+ }
142
+ if (!res.ok)
143
+ throw new Error(`Could not fetch ${what} at ${url}: HTTP ${res.status} ${res.statusText}`.trim());
144
+ // res.url is the FINAL url after any redirects — declared files must resolve
145
+ // relative to it, not the caller's original spelling (r2 MEDIUM-1).
146
+ return { text: await res.text(), finalUrl: res.url || url };
147
+ }
148
+ // OPR.0.5.3.7 R4 — install a context pack from a URL. <url> points at the pack's
149
+ // manifest.yaml (a trailing '/' is treated as '<url>manifest.yaml'); every
150
+ // files[].path is fetched relative to that manifest. ATOMIC BY CONSTRUCTION:
151
+ // everything stages into a temp SIBLING of the target and is published by one
152
+ // renameSync, so a malformed manifest, an unreachable URL, or a missing declared
153
+ // file leaves NO partial pack behind. Deliberately dumb: no registry, no cache.
154
+ async function installPackFromUrl(url, overrideName, targetRoot) {
155
+ const manifestUrl = url.endsWith("/") ? `${url}manifest.yaml` : url;
156
+ mkdirSync(targetRoot, { recursive: true });
157
+ const staging = mkdtempSync(join(targetRoot, ".tmp-add-"));
158
+ try {
159
+ // Fetch + validate the manifest before touching the target namespace.
160
+ const { text: manifestText, finalUrl: finalManifestUrl } = await fetchTextOrThrow(manifestUrl, "manifest");
161
+ writeFileSync(join(staging, "manifest.yaml"), manifestText);
162
+ validateContextPackManifestForInstall(join(staging, "manifest.yaml"));
163
+ const manifest = parseYaml(manifestText);
164
+ const installName = overrideName ?? manifest.name;
165
+ assertSafeInstallRef(installName);
166
+ assertDestinationNamespaceContained(targetRoot, installName);
167
+ const targetDir = join(targetRoot, installName);
168
+ if (existsSync(targetDir)) {
169
+ throw new Error(`A context pack named '${installName}' already exists at ${targetDir}. Remove it first or use --name to install under a different name.`);
170
+ }
171
+ // Fetch every declared file relative to the manifest's FINAL url (after
172
+ // redirects), via the platform URL resolver — never the caller's original
173
+ // spelling (r2 MEDIUM-1: a redirected manifest must not resolve files against
174
+ // the stale request base).
175
+ //
176
+ // BOUNDARY (r2 HIGH-1): new URL() also honors an ABSOLUTE f.path, and the
177
+ // manifest validator accepts a URL-shaped value as a filesystem-relative
178
+ // path. Require every resolved file URL to stay under the manifest's own
179
+ // directory (same origin + path prefix) so a stranger-supplied manifest can
180
+ // never make add fetch cross-origin or climb out of its pack. The trailing
181
+ // slash on the base defeats prefix-sibling ('/pack' vs '/pack-evil') tricks.
182
+ const manifestDirUrl = new URL("./", finalManifestUrl).href;
183
+ for (const f of manifest.files) {
184
+ const fileUrl = new URL(f.path, finalManifestUrl).href;
185
+ if (!fileUrl.startsWith(manifestDirUrl)) {
186
+ throw new Error(`manifest file '${f.path}' resolves to ${fileUrl}, outside the pack directory ${manifestDirUrl}. ` +
187
+ `Declared files must be relative to the manifest (no absolute URLs, no escaping the pack).`);
188
+ }
189
+ const { text: fileText } = await fetchTextOrThrow(fileUrl, `file '${f.path}'`);
190
+ const dest = join(staging, f.path);
191
+ mkdirSync(dirname(dest), { recursive: true });
192
+ writeFileSync(dest, fileText);
193
+ }
194
+ // Re-validate the on-disk staged pack, then publish atomically.
195
+ validateContextPackManifestForInstall(join(staging, "manifest.yaml"));
196
+ assertTreeHasNoSymlinks(staging);
197
+ renameSync(staging, targetDir);
198
+ return { targetDir, installName };
199
+ }
200
+ catch (err) {
201
+ rmSync(staging, { recursive: true, force: true });
202
+ throw err;
203
+ }
204
+ }
127
205
  async function resolvePack(client, nameOrRef) {
128
206
  if (nameOrRef.startsWith("context-pack:")) {
129
207
  throw new Error("Context pack colon-id addressing ('context-pack:<name>:<version>') was removed. " +
@@ -167,6 +245,7 @@ Examples:
167
245
  rig context add ./my-pack
168
246
  rig context rm packs/compaction-restore
169
247
  rig context sync
248
+ rig context trace --rig product-team --seat orch1-lead --name LEARNED.md
170
249
  `);
171
250
  const getDeps = () => depsOverride ?? {
172
251
  lifecycleDeps: realDeps(),
@@ -182,6 +261,56 @@ Examples:
182
261
  }
183
262
  return deps.clientFactory(getDaemonUrl(status));
184
263
  }
264
+ // OPR.0.5.3.6 — the productized chain-file trace. Daemon-independent by
265
+ // design: the walk is a config read + filesystem reads, so it works on a
266
+ // box whose daemon is down (orientation is exactly when that happens).
267
+ cmd.command("trace")
268
+ .description("Walk the topology tree for one chain filename (instance -> rig -> seat), keyed off topology.root")
269
+ .requiredOption("--rig <rig>", "Rig name (the rigs/<rig> altitude)")
270
+ .option("--seat <seat>", "Seat id (the seats/<seat> altitude); omit for a rig-level trace")
271
+ .requiredOption("--name <file>", "Chain filename, identical at every altitude (e.g. LEARNED.md, CULTURE.md)")
272
+ .option("--json", "JSON output for agents")
273
+ .action(async (opts) => {
274
+ const { ConfigStore } = await import("../config-store.js");
275
+ const { traceTopologyChain } = await import("../lib/topology-trace.js");
276
+ const store = new ConfigStore();
277
+ const resolved = store.resolveWithSource("topology.root");
278
+ let result;
279
+ try {
280
+ result = traceTopologyChain({
281
+ topologyRoot: String(resolved.value),
282
+ name: opts.name,
283
+ rig: opts.rig,
284
+ seat: opts.seat ?? null,
285
+ });
286
+ }
287
+ catch (err) {
288
+ // r2-B3: traversal-shaped input is a clean refusal, never a stack trace.
289
+ console.error(err instanceof Error ? err.message : String(err));
290
+ process.exitCode = 1;
291
+ return;
292
+ }
293
+ // Advisories go to stderr on BOTH output modes — a legacy read must
294
+ // never pass silently, and stdout stays clean for piping.
295
+ for (const level of result.levels) {
296
+ if (level.advisory)
297
+ console.error(`ADVISORY ${level.advisory}`);
298
+ }
299
+ if (opts.json) {
300
+ console.log(JSON.stringify({ topologyRootSource: resolved.source, ...result }, null, 2));
301
+ return;
302
+ }
303
+ console.log(`chain "${result.name}" under topology.root=${result.topologyRoot} (source: ${resolved.source})`);
304
+ for (const level of result.levels) {
305
+ if (level.source === "absent") {
306
+ console.log(`\n== ${level.altitude} — absent (${level.path})`);
307
+ continue;
308
+ }
309
+ const origin = level.source === "legacy" ? ` [LEGACY: ${level.resolvedPath}]` : "";
310
+ console.log(`\n== ${level.altitude} — ${level.path}${origin}`);
311
+ console.log(level.content?.trimEnd() ?? "");
312
+ }
313
+ });
185
314
  cmd.command("compose")
186
315
  .description("Compose ordered files into a durable context-pack ref (never delivers)")
187
316
  .requiredOption("--out <ref>", "Path-like durable output ref")
@@ -305,6 +434,175 @@ Examples:
305
434
  process.exitCode = 1;
306
435
  }
307
436
  });
437
+ // OPR.0.5.3.7 R1 — the PULL verb: an agent-facing serving verb over the EXISTING assembler
438
+ // path (the same by-ref/preview machinery `preview` uses — never a parallel assembler).
439
+ // `preview` is the operator's pre-send check; `get` is what a seat runs on demand to LOAD a
440
+ // library entry. Output is the assembled bundle itself (so the agent consumes exactly those
441
+ // bytes), warnings to stderr; `--json` for programmatic use. Naming ruled: `rig context get`
442
+ // (one library, one verb — NOT `rig skills get`; "skills" is an org category in the library).
443
+ cmd.command("get")
444
+ .argument("<name-or-ref>", "Context library entry name, path-like ref, or address (<pack-ref>/<file>#H2-slug/H3-slug)")
445
+ .description("Serve the assembled bundle for an agent to load on demand (the pull verb)")
446
+ .option("--json", "JSON output")
447
+ .action(async (nameOrRef, opts) => {
448
+ try {
449
+ const client = await getClient();
450
+ // OPR.0.5.3.5 Atom 4c (Q4: one `name#H2/H3` form across the verb
451
+ // family): an address routes to the daemon's single resolver home;
452
+ // stdout is exactly the resolved span bytes so an agent consumes the
453
+ // addressed section and nothing else. Fail-loud passthrough — the
454
+ // daemon names every failure; this verb adds nothing to it.
455
+ if (nameOrRef.includes("#")) {
456
+ const res = await client.get(`/api/context-packs/library/resolve-address?address=${encodeURIComponent(nameOrRef)}`);
457
+ if (res.status !== 200) {
458
+ throw new Error(res.data?.message ?? res.data?.error ?? `Daemon returned HTTP ${res.status} for resolve-address`);
459
+ }
460
+ if (opts.json)
461
+ console.log(JSON.stringify(res.data, null, 2));
462
+ else
463
+ console.log(res.data.text);
464
+ return;
465
+ }
466
+ const entry = await resolvePack(client, nameOrRef);
467
+ const res = await client.get(`/api/context-packs/library/by-ref/preview?ref=${encodeURIComponent(entry.relativePath)}`);
468
+ if (res.status !== 200)
469
+ throw new Error(`Daemon returned HTTP ${res.status}`);
470
+ const bundle = res.data;
471
+ if (opts.json) {
472
+ console.log(JSON.stringify(bundle, null, 2));
473
+ return;
474
+ }
475
+ // Warnings go to stderr so stdout is exactly the served bundle bytes.
476
+ if (bundle.missingFiles.length > 0) {
477
+ console.error(`Warning: ${bundle.missingFiles.length} file(s) referenced by manifest are missing on disk.`);
478
+ for (const m of bundle.missingFiles)
479
+ console.error(` - ${m.path} (role: ${m.role})`);
480
+ }
481
+ console.log(bundle.bundleText);
482
+ }
483
+ catch (err) {
484
+ console.error(err.message);
485
+ process.exitCode = 1;
486
+ }
487
+ });
488
+ // OPR.0.5.3.5 Atom 4d — situation-composed delivery (the profile verb).
489
+ // Serving only: pieces to stdout with their source labels (Q2-Amendment 1),
490
+ // budget report + provenance warnings to stderr. Delivery-free like every
491
+ // library verb — nothing here sends to a seat. Naming rig/seat (or mission)
492
+ // is the caller's explicit grant of read access to that directory subtree.
493
+ cmd.command("profile")
494
+ .argument("<name-or-ref>", "Context pack name or path-like ref (its manifest must declare atoms)")
495
+ .requiredOption("--situation <situation>", "fresh | handover | post-compaction")
496
+ // r1 4d obs 2: default from the seat's own environment — a codex seat that
497
+ // forgets the flag must not silently get a claude profile (mini-req 3 is
498
+ // the rule that the runtimes compose DIFFERENT profiles). Flag beats env;
499
+ // an unrecognized env value falls back to claude rather than erroring a
500
+ // surface the env owner may not control.
501
+ .option("--runtime <runtime>", "claude | codex (default: $OPENRIG_RUNTIME, else claude)")
502
+ .option("--budget <tokens>", "Situation token budget — overage is REPORTED, never truncated")
503
+ .option("--rig <rig>", "With --seat: grant read access to that seat's tree (seat: atoms)")
504
+ .option("--seat <seat>", "With --rig: the seat whose tree seat: atoms may read")
505
+ .option("--mission <mission>", "Grant read access to that mission's tree (mission: atoms)")
506
+ .option("--json", "JSON output (the full composed profile)")
507
+ .action(async (nameOrRef, opts) => {
508
+ try {
509
+ const client = await getClient();
510
+ const entry = await resolvePack(client, nameOrRef);
511
+ // r1 F2: the product's runtime vocabulary is "claude-code" / "codex"
512
+ // (the adapters' values, live on real seats) — map it EXPLICITLY. A
513
+ // genuinely unknown value falls back to claude WITH A VOICE: a future
514
+ // third runtime must not silently get a claude profile (the exact
515
+ // mini-req 3 hazard this default exists to close).
516
+ const envRuntime = process.env["OPENRIG_RUNTIME"];
517
+ let runtime = opts.runtime;
518
+ if (runtime === undefined) {
519
+ if (envRuntime === "codex")
520
+ runtime = "codex";
521
+ else if (envRuntime === "claude-code" || envRuntime === "claude")
522
+ runtime = "claude";
523
+ else {
524
+ if (envRuntime)
525
+ console.error(`Warning: unrecognized OPENRIG_RUNTIME '${envRuntime}' — composing the claude profile; pass --runtime to override.`);
526
+ runtime = "claude";
527
+ }
528
+ }
529
+ const params = new URLSearchParams({ ref: entry.relativePath, situation: opts.situation, runtime });
530
+ if (opts.budget !== undefined)
531
+ params.set("budget", opts.budget);
532
+ if (opts.rig !== undefined)
533
+ params.set("rig", opts.rig);
534
+ if (opts.seat !== undefined)
535
+ params.set("seat", opts.seat);
536
+ if (opts.mission !== undefined)
537
+ params.set("mission", opts.mission);
538
+ const res = await client.get(`/api/context-packs/library/by-ref/profile?${params.toString()}`);
539
+ if (res.status !== 200) {
540
+ throw new Error(res.data?.message ?? res.data?.error ?? `Daemon returned HTTP ${res.status} for by-ref/profile`);
541
+ }
542
+ const profile = res.data;
543
+ if (opts.json) {
544
+ console.log(JSON.stringify(profile, null, 2));
545
+ return;
546
+ }
547
+ // Warnings and the budget report ride stderr so stdout is exactly the
548
+ // composed walk an agent consumes.
549
+ for (const w of profile.provenanceWarnings ?? [])
550
+ console.error(`PROVENANCE ${w}`);
551
+ if (profile.budget) {
552
+ console.error(`BUDGET: over by ~${profile.budget.overageTokens} tokens (limit ${profile.budget.limitTokens}); ` +
553
+ `drop candidates in order: ${profile.budget.dropCandidates.map((d) => `${d.atomId} (${d.priority}, ~${d.estimatedTokens})`).join(", ")}`);
554
+ }
555
+ for (const p of profile.pieces ?? []) {
556
+ // r1 4d obs 1: the escape marker rides the FRAMING header, so an
557
+ // agent that discards stderr still learns a piece's bytes came from
558
+ // outside its root — self-describing payload, zero composed bytes
559
+ // touched.
560
+ const escaped = p.provenance?.escapesRoot ? " !ESCAPED-ROOT" : "";
561
+ console.log(`=== ${p.atomId} [${p.sourceKind}${escaped}] ${p.address} (~${p.estimatedTokens} tokens)`);
562
+ console.log(p.text);
563
+ console.log("");
564
+ }
565
+ }
566
+ catch (err) {
567
+ console.error(err.message);
568
+ process.exitCode = 1;
569
+ }
570
+ });
571
+ // OPR.0.5.3.5 mini-req 7 — the outgoing occupant's boundary write (the Q2
572
+ // requirement the store alone does not satisfy). Daemon-independent like
573
+ // trace: the seat dir resolves from topology.root CONFIG; the write flows
574
+ // through the ONE store (supersession + addressability gate); advisory
575
+ // contract findings ride stderr while the write still lands — the boundary
576
+ // is never blocked on prose shape.
577
+ cmd.command("recap-write")
578
+ .description("Write this seat's authored RECAP (decisions-with-rationale) at the handover boundary; supersedes the previous recap into the seat's chain")
579
+ .requiredOption("--rig <rig>", "Rig name (the rigs/<rig> altitude)")
580
+ .requiredOption("--seat <seat>", "Seat id (the seats/<seat> altitude)")
581
+ .requiredOption("--file <path>", "Markdown file containing the recap content")
582
+ .action(async (opts) => {
583
+ try {
584
+ const { writeSeatRecap, validateRecapContract, listRecapChain } = await import("@openrig/daemon/seat-recap-store");
585
+ const content = readFileSync(opts.file, "utf-8");
586
+ const store = new ConfigStore();
587
+ const topologyRoot = String(store.resolveWithSource("topology.root").value);
588
+ const seatDir = join(topologyRoot, "rigs", opts.rig, "seats", opts.seat);
589
+ if (!existsSync(seatDir)) {
590
+ throw new Error(`seat directory ${seatDir} does not exist — check --rig/--seat against the topology tree (topology.root=${topologyRoot}).`);
591
+ }
592
+ for (const f of validateRecapContract(content)) {
593
+ console.error(f.kind === "no-decisions-section"
594
+ ? "ADVISORY no-decisions-section: the authoring contract asks for decisions WITH rationale — conclusions alone are the lossy handoff shape."
595
+ : `ADVISORY nonstandard-unverified-marker (line ${f.line}): use the canonical 'UNVERIFIED:' form so uncertain facts stay findable.`);
596
+ }
597
+ writeSeatRecap({ seatDir, content });
598
+ const chain = listRecapChain(seatDir);
599
+ console.log(`Recap written: ${join(seatDir, "RECAP.md")}${chain.length > 0 ? ` (${chain.length} superseded predecessor${chain.length === 1 ? "" : "s"} retained)` : ""}`);
600
+ }
601
+ catch (err) {
602
+ console.error(err.message);
603
+ process.exitCode = 1;
604
+ }
605
+ });
308
606
  cmd.command("sync")
309
607
  .description("Re-walk discovery roots and refresh the library index")
310
608
  .option("--json", "JSON output")
@@ -332,56 +630,63 @@ Examples:
332
630
  }
333
631
  });
334
632
  cmd.command("add")
335
- .argument("<source-dir>", "Directory containing manifest.yaml + included files")
336
- .description("Install a context pack from a local directory into ~/.openrig/context-packs/")
337
- .option("--name <name>", "Override the install name (defaults to source directory basename)")
633
+ .argument("<source>", "Local directory OR http(s):// URL of a context pack (manifest.yaml + files)")
634
+ .description("Install a context pack from a local directory or a URL into the context-packs landing zone")
635
+ .option("--name <name>", "Override the install name (defaults to the manifest name / source basename)")
338
636
  .option("--json", "JSON output")
339
- .action(async (sourceDir, opts) => {
637
+ .action(async (source, opts) => {
340
638
  try {
341
- if (!existsSync(sourceDir))
342
- throw new Error(`Source directory not found: ${sourceDir}`);
343
- const stat = lstatSync(sourceDir);
344
- if (stat.isSymbolicLink())
345
- throw new Error(`Source must not be a symlink: ${sourceDir}`);
346
- if (!stat.isDirectory())
347
- throw new Error(`Source must be a directory containing manifest.yaml: ${sourceDir}`);
348
- const manifestPath = join(sourceDir, "manifest.yaml");
349
- if (!existsSync(manifestPath)) {
350
- throw new Error(`Source directory must contain manifest.yaml: ${sourceDir}`);
351
- }
352
- validateContextPackManifestForInstall(manifestPath);
353
- // Read the manifest's name as the canonical install name when
354
- // --name not given. Cheap parse: trust the daemon to validate
355
- // on next sync; here we just need the name.
356
- const installName = opts.name ?? (() => {
639
+ // OPR.0.5.3.7 R4 — config-resolved landing zone (env > config > $OPENRIG_HOME/context-packs),
640
+ // never a hardcoded ~/.openrig literal; the daemon resolves the same key.
641
+ const targetRoot = new ConfigStore().resolve().context.packsRoot;
642
+ let targetDir;
643
+ if (isHttpUrl(source)) {
644
+ // R4 — URL install: fetch → validate → atomic stage+rename (no partial pack).
645
+ ({ targetDir } = await installPackFromUrl(source, opts.name, targetRoot));
646
+ }
647
+ else {
648
+ // Local directory install.
649
+ if (!existsSync(source))
650
+ throw new Error(`Source directory not found: ${source}`);
651
+ const stat = lstatSync(source);
652
+ if (stat.isSymbolicLink())
653
+ throw new Error(`Source must not be a symlink: ${source}`);
654
+ if (!stat.isDirectory())
655
+ throw new Error(`Source must be a directory containing manifest.yaml: ${source}`);
656
+ const manifestPath = join(source, "manifest.yaml");
657
+ if (!existsSync(manifestPath)) {
658
+ throw new Error(`Source directory must contain manifest.yaml: ${source}`);
659
+ }
660
+ validateContextPackManifestForInstall(manifestPath);
661
+ const installName = opts.name ?? (() => {
662
+ try {
663
+ const raw = readFileSync(manifestPath, "utf-8");
664
+ const m = raw.match(/^name:\s*['"]?([^'"\n]+)['"]?\s*$/m);
665
+ return m?.[1]?.trim() || basename(source);
666
+ }
667
+ catch {
668
+ return basename(source);
669
+ }
670
+ })();
671
+ assertSafeInstallRef(installName);
672
+ assertTreeHasNoSymlinks(source);
673
+ mkdirSync(targetRoot, { recursive: true });
674
+ assertDestinationNamespaceContained(targetRoot, installName);
675
+ targetDir = join(targetRoot, installName);
676
+ let targetExists = false;
357
677
  try {
358
- const raw = readFileSync(manifestPath, "utf-8");
359
- const m = raw.match(/^name:\s*['"]?([^'"\n]+)['"]?\s*$/m);
360
- return m?.[1]?.trim() || basename(sourceDir);
678
+ lstatSync(targetDir);
679
+ targetExists = true;
361
680
  }
362
- catch {
363
- return basename(sourceDir);
681
+ catch (err) {
682
+ if (err.code !== "ENOENT")
683
+ throw err;
364
684
  }
365
- })();
366
- assertSafeInstallRef(installName);
367
- assertTreeHasNoSymlinks(sourceDir);
368
- const targetRoot = getDefaultOpenRigPath("context-packs");
369
- mkdirSync(targetRoot, { recursive: true });
370
- assertDestinationNamespaceContained(targetRoot, installName);
371
- const targetDir = join(targetRoot, installName);
372
- let targetExists = false;
373
- try {
374
- lstatSync(targetDir);
375
- targetExists = true;
376
- }
377
- catch (err) {
378
- if (err.code !== "ENOENT")
379
- throw err;
380
- }
381
- if (targetExists) {
382
- throw new Error(`A context pack named '${installName}' already exists at ${targetDir}. Remove it first or use --name to install under a different name.`);
383
- }
384
- cpSync(sourceDir, targetDir, { recursive: true });
685
+ if (targetExists) {
686
+ throw new Error(`A context pack named '${installName}' already exists at ${targetDir}. Remove it first or use --name to install under a different name.`);
687
+ }
688
+ cpSync(source, targetDir, { recursive: true });
689
+ }
385
690
  // Sync the daemon library so the new pack appears immediately.
386
691
  const client = await getClient();
387
692
  const syncRes = await client.post("/api/context-packs/library/sync");