@openrig/cli 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  2. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  3. package/daemon/assets/plugins/openrig-core/README.md +1 -1
  4. package/daemon/assets/plugins/openrig-core/hooks/claude.json +36 -0
  5. package/daemon/assets/plugins/openrig-core/hooks/codex.json +27 -0
  6. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +152 -0
  7. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +35 -3
  8. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +8 -95
  9. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +63 -20
  10. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +6 -2
  11. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +28 -2
  12. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +42 -52
  13. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +26 -1
  14. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +7 -2
  15. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/CHANGELOG.md +64 -0
  16. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/SKILL.md +235 -0
  17. package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +31 -1
  18. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/CHANGELOG.md +48 -0
  19. package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +211 -0
  20. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +8 -0
  21. package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +31 -9
  22. package/daemon/context-packs/skills/core/agent-starters/SKILL.md +132 -0
  23. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +9 -0
  24. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/SKILL.md +112 -0
  25. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +9 -0
  26. package/daemon/context-packs/skills/core/attention-queue/SKILL.md +264 -0
  27. package/daemon/context-packs/skills/core/attention-queue/manifest.yaml +9 -0
  28. package/daemon/context-packs/skills/core/cross-host-rig-commands/SKILL.md +195 -0
  29. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +9 -0
  30. package/daemon/context-packs/skills/core/human-in-the-loop/SKILL.md +104 -0
  31. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +9 -0
  32. package/daemon/context-packs/skills/core/openrig-architect/SKILL.md +378 -0
  33. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +9 -0
  34. package/daemon/context-packs/skills/core/openrig-cmux/SKILL.md +81 -0
  35. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +9 -0
  36. package/daemon/context-packs/skills/core/openrig-herdr/SKILL.md +153 -0
  37. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +9 -0
  38. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +460 -0
  39. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +9 -0
  40. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/SKILL.md +101 -0
  41. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +9 -0
  42. package/daemon/context-packs/skills/core/rig-lifecycle/SKILL.md +127 -0
  43. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +9 -0
  44. package/daemon/context-packs/skills/core/session-source-fork/SKILL.md +160 -0
  45. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +9 -0
  46. package/daemon/context-packs/skills/core/specification-system/SKILL.md +103 -0
  47. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +9 -0
  48. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/SKILL.md +118 -0
  49. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +9 -0
  50. package/daemon/context-packs/skills/core/watchdog/SKILL.md +126 -0
  51. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +9 -0
  52. package/daemon/context-packs/skills/pm/backlog-capture/SKILL.md +43 -0
  53. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +9 -0
  54. package/daemon/context-packs/skills/pm/context-builder/SKILL.md +87 -0
  55. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +9 -0
  56. package/daemon/context-packs/skills/pm/exec-summary/SKILL.md +84 -0
  57. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +9 -0
  58. package/daemon/context-packs/skills/pm/office-hours/SKILL.md +129 -0
  59. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +9 -0
  60. package/daemon/context-packs/skills/pm/plan-review/SKILL.md +98 -0
  61. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +9 -0
  62. package/daemon/context-packs/skills/pm/requirements-writer/SKILL.md +113 -0
  63. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +9 -0
  64. package/daemon/context-packs/skills/pm/ui-mockup/SKILL.md +76 -0
  65. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +9 -0
  66. package/daemon/context-packs/skills/pods/development-team/SKILL.md +156 -0
  67. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +9 -0
  68. package/daemon/context-packs/skills/pods/orchestration-team/SKILL.md +307 -0
  69. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +9 -0
  70. package/daemon/context-packs/skills/pods/oversight-team/SKILL.md +106 -0
  71. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +9 -0
  72. package/daemon/context-packs/skills/pods/review-team/SKILL.md +213 -0
  73. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +9 -0
  74. package/daemon/context-packs/skills/process/agent-browser/LOCAL-INSIGHTS.md +189 -0
  75. package/daemon/context-packs/skills/process/agent-browser/OPENRIG.md +40 -0
  76. package/daemon/context-packs/skills/process/agent-browser/SKILL.md +427 -0
  77. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +13 -0
  78. package/daemon/context-packs/skills/process/brainstorming/OPENRIG.md +48 -0
  79. package/daemon/context-packs/skills/process/brainstorming/SKILL.md +107 -0
  80. package/daemon/context-packs/skills/process/brainstorming/manifest.yaml +11 -0
  81. package/daemon/context-packs/skills/process/context-engineering/SKILL.md +479 -0
  82. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +9 -0
  83. package/daemon/context-packs/skills/process/dogfood/SKILL.md +225 -0
  84. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +13 -0
  85. package/daemon/context-packs/skills/process/dogfood/references/issue-taxonomy.md +109 -0
  86. package/daemon/context-packs/skills/process/dogfood/templates/dogfood-report-template.md +53 -0
  87. package/daemon/context-packs/skills/process/executing-plans/OPENRIG.md +56 -0
  88. package/daemon/context-packs/skills/process/executing-plans/SKILL.md +94 -0
  89. package/daemon/context-packs/skills/process/executing-plans/manifest.yaml +11 -0
  90. package/daemon/context-packs/skills/process/frontend-design/LICENSE.txt +177 -0
  91. package/daemon/context-packs/skills/process/frontend-design/SKILL.md +50 -0
  92. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +11 -0
  93. package/daemon/context-packs/skills/process/systematic-debugging/SKILL.md +301 -0
  94. package/daemon/context-packs/skills/process/systematic-debugging/condition-based-waiting-example.ts +158 -0
  95. package/daemon/context-packs/skills/process/systematic-debugging/condition-based-waiting.md +115 -0
  96. package/daemon/context-packs/skills/process/systematic-debugging/defense-in-depth.md +122 -0
  97. package/daemon/context-packs/skills/process/systematic-debugging/find-polluter.sh +63 -0
  98. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +19 -0
  99. package/daemon/context-packs/skills/process/systematic-debugging/root-cause-tracing.md +169 -0
  100. package/daemon/context-packs/skills/process/test-driven-development/SKILL.md +385 -0
  101. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +11 -0
  102. package/daemon/context-packs/skills/process/test-driven-development/testing-anti-patterns.md +299 -0
  103. package/daemon/context-packs/skills/process/using-superpowers/OPENRIG.md +48 -0
  104. package/daemon/context-packs/skills/process/using-superpowers/SKILL.md +106 -0
  105. package/daemon/context-packs/skills/process/using-superpowers/manifest.yaml +11 -0
  106. package/daemon/context-packs/skills/process/verification-before-completion/SKILL.md +155 -0
  107. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +9 -0
  108. package/daemon/context-packs/skills/process/writing-plans/OPENRIG.md +52 -0
  109. package/daemon/context-packs/skills/process/writing-plans/SKILL.md +126 -0
  110. package/daemon/context-packs/skills/process/writing-plans/manifest.yaml +11 -0
  111. package/daemon/context-packs/world/install/01-world-from-primitives.md +97 -0
  112. package/daemon/context-packs/world/install/02-permission-self-sleep.md +141 -0
  113. package/daemon/context-packs/world/install/03-what-this-is-for.md +86 -0
  114. package/daemon/context-packs/world/install/04-ontology.md +790 -0
  115. package/daemon/context-packs/world/install/05-harness-power-use.md +355 -0
  116. package/daemon/context-packs/world/install/06-a-competent-turn.md +225 -0
  117. package/daemon/context-packs/world/install/manifest.yaml +125 -0
  118. package/daemon/context-packs/world/install/reference-material.md +125 -0
  119. package/daemon/context-packs/world/install/what-you-can-do.md +416 -0
  120. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  121. package/daemon/dist/adapters/claude-code-adapter.js +7 -4
  122. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  123. package/daemon/dist/adapters/claude-resume.js +2 -2
  124. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  125. package/daemon/dist/adapters/tmux.d.ts +41 -2
  126. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  127. package/daemon/dist/adapters/tmux.js +58 -18
  128. package/daemon/dist/adapters/tmux.js.map +1 -1
  129. package/daemon/dist/adapters/yolo-mode.d.ts +18 -0
  130. package/daemon/dist/adapters/yolo-mode.d.ts.map +1 -1
  131. package/daemon/dist/adapters/yolo-mode.js +21 -0
  132. package/daemon/dist/adapters/yolo-mode.js.map +1 -1
  133. package/daemon/dist/build-info.js +3 -3
  134. package/daemon/dist/daemon-db-path.d.ts.map +1 -1
  135. package/daemon/dist/daemon-db-path.js +50 -2
  136. package/daemon/dist/daemon-db-path.js.map +1 -1
  137. package/daemon/dist/domain/codex-thread-id.d.ts +95 -0
  138. package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  139. package/daemon/dist/domain/codex-thread-id.js +171 -2
  140. package/daemon/dist/domain/codex-thread-id.js.map +1 -1
  141. package/daemon/dist/domain/context-packs/context-pack-types.d.ts +48 -0
  142. package/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  143. package/daemon/dist/domain/context-packs/context-pack-types.js +8 -0
  144. package/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  145. package/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  146. package/daemon/dist/domain/context-packs/manifest-parser.js +234 -2
  147. package/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  148. package/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts +34 -0
  149. package/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts.map +1 -0
  150. package/daemon/dist/domain/context-packs/probe-eval-bridge.js +38 -0
  151. package/daemon/dist/domain/context-packs/probe-eval-bridge.js.map +1 -0
  152. package/daemon/dist/domain/context-packs/profile-composer.d.ts +49 -0
  153. package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -0
  154. package/daemon/dist/domain/context-packs/profile-composer.js +125 -0
  155. package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -0
  156. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +53 -0
  157. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -0
  158. package/daemon/dist/domain/context-packs/profile-source-resolver.js +129 -0
  159. package/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -0
  160. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts +48 -0
  161. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts.map +1 -0
  162. package/daemon/dist/domain/context-packs/seat-recap-store.js +123 -0
  163. package/daemon/dist/domain/context-packs/seat-recap-store.js.map +1 -0
  164. package/daemon/dist/domain/markdown-address.d.ts +56 -0
  165. package/daemon/dist/domain/markdown-address.d.ts.map +1 -0
  166. package/daemon/dist/domain/markdown-address.js +188 -0
  167. package/daemon/dist/domain/markdown-address.js.map +1 -0
  168. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts +8 -2
  169. package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  170. package/daemon/dist/domain/model-divergence/current-generation-record.js +1 -1
  171. package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  172. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +33 -21
  173. package/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
  174. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js +64 -55
  175. package/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
  176. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +4 -0
  177. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
  178. package/daemon/dist/domain/periodic-snapshot-scheduler.js +5 -1
  179. package/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
  180. package/daemon/dist/domain/permission-drift-observer.d.ts.map +1 -1
  181. package/daemon/dist/domain/permission-drift-observer.js +6 -1
  182. package/daemon/dist/domain/permission-drift-observer.js.map +1 -1
  183. package/daemon/dist/domain/plugin-discovery-service.d.ts +16 -0
  184. package/daemon/dist/domain/plugin-discovery-service.d.ts.map +1 -1
  185. package/daemon/dist/domain/plugin-discovery-service.js +175 -1
  186. package/daemon/dist/domain/plugin-discovery-service.js.map +1 -1
  187. package/daemon/dist/domain/plugin-vendor-service.d.ts +9 -5
  188. package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
  189. package/daemon/dist/domain/plugin-vendor-service.js +101 -12
  190. package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
  191. package/daemon/dist/domain/process-census.d.ts +25 -0
  192. package/daemon/dist/domain/process-census.d.ts.map +1 -0
  193. package/daemon/dist/domain/process-census.js +47 -0
  194. package/daemon/dist/domain/process-census.js.map +1 -0
  195. package/daemon/dist/domain/queue-repository.d.ts +3 -1
  196. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  197. package/daemon/dist/domain/queue-repository.js +50 -2
  198. package/daemon/dist/domain/queue-repository.js.map +1 -1
  199. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  200. package/daemon/dist/domain/reconciler.js +6 -1
  201. package/daemon/dist/domain/reconciler.js.map +1 -1
  202. package/daemon/dist/domain/resume-metadata-refresher.d.ts +31 -2
  203. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  204. package/daemon/dist/domain/resume-metadata-refresher.js +64 -29
  205. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  206. package/daemon/dist/domain/review/compose.d.ts +5 -26
  207. package/daemon/dist/domain/review/compose.d.ts.map +1 -1
  208. package/daemon/dist/domain/review/compose.js +31 -57
  209. package/daemon/dist/domain/review/compose.js.map +1 -1
  210. package/daemon/dist/domain/rig-repository.d.ts +4 -0
  211. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  212. package/daemon/dist/domain/rig-repository.js +9 -0
  213. package/daemon/dist/domain/rig-repository.js.map +1 -1
  214. package/daemon/dist/domain/rigspec-instantiator.d.ts +13 -0
  215. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  216. package/daemon/dist/domain/rigspec-instantiator.js +71 -0
  217. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  218. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  219. package/daemon/dist/domain/rigspec-schema.js +19 -3
  220. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  221. package/daemon/dist/domain/running-name-guard.d.ts +52 -0
  222. package/daemon/dist/domain/running-name-guard.d.ts.map +1 -0
  223. package/daemon/dist/domain/running-name-guard.js +34 -0
  224. package/daemon/dist/domain/running-name-guard.js.map +1 -0
  225. package/daemon/dist/domain/scope/logical-checkbox.d.ts +26 -0
  226. package/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -0
  227. package/daemon/dist/domain/scope/logical-checkbox.js +65 -0
  228. package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -0
  229. package/daemon/dist/domain/scope/plan-lock-artifacts.d.ts +1 -1
  230. package/daemon/dist/domain/scope/plan-lock-artifacts.d.ts.map +1 -1
  231. package/daemon/dist/domain/scope/plan-lock-artifacts.js +2 -2
  232. package/daemon/dist/domain/scope/plan-lock-artifacts.js.map +1 -1
  233. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts +22 -0
  234. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts.map +1 -1
  235. package/daemon/dist/domain/scope/scaffold-placeholder.js +24 -0
  236. package/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -1
  237. package/daemon/dist/domain/seat-activity-service.d.ts +1 -0
  238. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  239. package/daemon/dist/domain/seat-activity-service.js +39 -23
  240. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  241. package/daemon/dist/domain/seat-handover-service.d.ts +22 -0
  242. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  243. package/daemon/dist/domain/seat-handover-service.js +32 -2
  244. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  245. package/daemon/dist/domain/seat-lifecycle-service.d.ts +97 -0
  246. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -0
  247. package/daemon/dist/domain/seat-lifecycle-service.js +312 -0
  248. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -0
  249. package/daemon/dist/domain/session-transport.d.ts +16 -5
  250. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  251. package/daemon/dist/domain/session-transport.js +155 -16
  252. package/daemon/dist/domain/session-transport.js.map +1 -1
  253. package/daemon/dist/domain/shell-classifier.d.ts +23 -0
  254. package/daemon/dist/domain/shell-classifier.d.ts.map +1 -0
  255. package/daemon/dist/domain/shell-classifier.js +36 -0
  256. package/daemon/dist/domain/shell-classifier.js.map +1 -0
  257. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  258. package/daemon/dist/domain/slices/slice-detail-projector.js +10 -1
  259. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  260. package/daemon/dist/domain/spec-validation-advisory.d.ts +17 -0
  261. package/daemon/dist/domain/spec-validation-advisory.d.ts.map +1 -0
  262. package/daemon/dist/domain/spec-validation-advisory.js +38 -0
  263. package/daemon/dist/domain/spec-validation-advisory.js.map +1 -0
  264. package/daemon/dist/domain/successor-session-launcher.d.ts +7 -0
  265. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  266. package/daemon/dist/domain/successor-session-launcher.js +38 -1
  267. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  268. package/daemon/dist/domain/topology-defaults-installer.d.ts +47 -0
  269. package/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -0
  270. package/daemon/dist/domain/topology-defaults-installer.js +92 -0
  271. package/daemon/dist/domain/topology-defaults-installer.js.map +1 -0
  272. package/daemon/dist/domain/transcript-rotation.d.ts +4 -0
  273. package/daemon/dist/domain/transcript-rotation.d.ts.map +1 -1
  274. package/daemon/dist/domain/transcript-rotation.js +61 -3
  275. package/daemon/dist/domain/transcript-rotation.js.map +1 -1
  276. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  277. package/daemon/dist/domain/transcript-store.js +9 -2
  278. package/daemon/dist/domain/transcript-store.js.map +1 -1
  279. package/daemon/dist/domain/types.d.ts +39 -0
  280. package/daemon/dist/domain/types.d.ts.map +1 -1
  281. package/daemon/dist/domain/types.js.map +1 -1
  282. package/daemon/dist/domain/user-settings/settings-store.d.ts +10 -1
  283. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  284. package/daemon/dist/domain/user-settings/settings-store.js +39 -0
  285. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  286. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  287. package/daemon/dist/routes/context-packs.js +205 -0
  288. package/daemon/dist/routes/context-packs.js.map +1 -1
  289. package/daemon/dist/routes/queue.d.ts.map +1 -1
  290. package/daemon/dist/routes/queue.js +29 -24
  291. package/daemon/dist/routes/queue.js.map +1 -1
  292. package/daemon/dist/routes/rigspec.js +20 -6
  293. package/daemon/dist/routes/rigspec.js.map +1 -1
  294. package/daemon/dist/routes/seat.d.ts.map +1 -1
  295. package/daemon/dist/routes/seat.js +69 -0
  296. package/daemon/dist/routes/seat.js.map +1 -1
  297. package/daemon/dist/routes/sessions.js +55 -0
  298. package/daemon/dist/routes/sessions.js.map +1 -1
  299. package/daemon/dist/routes/transport.d.ts.map +1 -1
  300. package/daemon/dist/routes/transport.js +52 -39
  301. package/daemon/dist/routes/transport.js.map +1 -1
  302. package/daemon/dist/routes/up.js +21 -2
  303. package/daemon/dist/routes/up.js.map +1 -1
  304. package/daemon/dist/seat-recap-store-surface.d.ts +2 -0
  305. package/daemon/dist/seat-recap-store-surface.d.ts.map +1 -0
  306. package/daemon/dist/seat-recap-store-surface.js +6 -0
  307. package/daemon/dist/seat-recap-store-surface.js.map +1 -0
  308. package/daemon/dist/startup.d.ts.map +1 -1
  309. package/daemon/dist/startup.js +37 -6
  310. package/daemon/dist/startup.js.map +1 -1
  311. package/daemon/docs/reference/chain-file-convention.md +115 -0
  312. package/daemon/docs/reference/legacy-topology-migration.md +53 -0
  313. package/daemon/docs/reference/refocus-channel.md +80 -0
  314. package/daemon/docs/reference/sdlc-conventions.md +24 -0
  315. package/daemon/specs/agents/shared/skills/core/attention-queue/SKILL.md +1 -1
  316. package/daemon/specs/agents/shared/skills/core/human-in-the-loop/SKILL.md +1 -1
  317. package/daemon/specs/agents/shared/skills/core/session-source-fork/SKILL.md +1 -1
  318. package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +4 -4
  319. package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +8 -0
  320. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +72 -31
  321. package/daemon/specs/agents/shared/skills/pods/oversight-team/SKILL.md +106 -0
  322. package/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.md +479 -0
  323. package/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md +9 -0
  324. package/daemon/specs/rigs/launch/demo/project-example/README.md +25 -0
  325. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/SPEC.md +19 -0
  326. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/slices/01-shorten-first-run/PROGRESS.md +6 -0
  327. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/slices/01-shorten-first-run/PROOF.md +7 -0
  328. package/daemon/specs/rigs/launch/demo/project-example/missions/improve-onboarding/slices/01-shorten-first-run/SPEC.md +31 -0
  329. package/daemon/specs/rigs/preview/product-team/topology/instance/CRAFT.md +24 -0
  330. package/daemon/specs/rigs/preview/product-team/topology/rig/CRAFT.md +21 -0
  331. package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +50 -0
  332. package/daemon/specs/rigs/preview/product-team/topology/seats/dev1-qa/CRAFT.md +13 -0
  333. package/daemon/specs/rigs/preview/product-team/topology/seats/orch1-lead/CRAFT.md +17 -0
  334. package/daemon/specs/rigs/preview/product-team/topology/seats/rev1-r1/CRAFT.md +17 -0
  335. package/daemon/specs/rigs/preview/product-team/topology/seats/rev1-r2/CRAFT.md +15 -0
  336. package/dist/build-info.js +3 -3
  337. package/dist/cli-error.js +1 -1
  338. package/dist/cli-error.js.map +1 -1
  339. package/dist/commands/broadcast.js +6 -0
  340. package/dist/commands/broadcast.js.map +1 -1
  341. package/dist/commands/config.d.ts.map +1 -1
  342. package/dist/commands/config.js +8 -0
  343. package/dist/commands/config.js.map +1 -1
  344. package/dist/commands/context.d.ts.map +1 -1
  345. package/dist/commands/context.js +363 -48
  346. package/dist/commands/context.js.map +1 -1
  347. package/dist/commands/daemon.d.ts.map +1 -1
  348. package/dist/commands/daemon.js +23 -2
  349. package/dist/commands/daemon.js.map +1 -1
  350. package/dist/commands/import.d.ts.map +1 -1
  351. package/dist/commands/import.js +10 -0
  352. package/dist/commands/import.js.map +1 -1
  353. package/dist/commands/proof.d.ts.map +1 -1
  354. package/dist/commands/proof.js +70 -12
  355. package/dist/commands/proof.js.map +1 -1
  356. package/dist/commands/queue.d.ts.map +1 -1
  357. package/dist/commands/queue.js +36 -13
  358. package/dist/commands/queue.js.map +1 -1
  359. package/dist/commands/rig.d.ts.map +1 -1
  360. package/dist/commands/rig.js +5 -0
  361. package/dist/commands/rig.js.map +1 -1
  362. package/dist/commands/seat.d.ts.map +1 -1
  363. package/dist/commands/seat.js +88 -0
  364. package/dist/commands/seat.js.map +1 -1
  365. package/dist/commands/send.d.ts.map +1 -1
  366. package/dist/commands/send.js +224 -20
  367. package/dist/commands/send.js.map +1 -1
  368. package/dist/commands/transcript.d.ts.map +1 -1
  369. package/dist/commands/transcript.js +25 -1
  370. package/dist/commands/transcript.js.map +1 -1
  371. package/dist/commands/up.d.ts.map +1 -1
  372. package/dist/commands/up.js +8 -0
  373. package/dist/commands/up.js.map +1 -1
  374. package/dist/commands/walk.d.ts +1 -1
  375. package/dist/commands/walk.d.ts.map +1 -1
  376. package/dist/commands/walk.js +293 -30
  377. package/dist/commands/walk.js.map +1 -1
  378. package/dist/config-store.d.ts +15 -1
  379. package/dist/config-store.d.ts.map +1 -1
  380. package/dist/config-store.js +35 -1
  381. package/dist/config-store.js.map +1 -1
  382. package/dist/lib/scope/logical-checkbox.d.ts +26 -0
  383. package/dist/lib/scope/logical-checkbox.d.ts.map +1 -0
  384. package/dist/lib/scope/logical-checkbox.js +65 -0
  385. package/dist/lib/scope/logical-checkbox.js.map +1 -0
  386. package/dist/lib/scope/scaffold-placeholder.d.ts +22 -0
  387. package/dist/lib/scope/scaffold-placeholder.d.ts.map +1 -1
  388. package/dist/lib/scope/scaffold-placeholder.js +24 -0
  389. package/dist/lib/scope/scaffold-placeholder.js.map +1 -1
  390. package/dist/lib/topology-trace.d.ts +36 -0
  391. package/dist/lib/topology-trace.d.ts.map +1 -0
  392. package/dist/lib/topology-trace.js +91 -0
  393. package/dist/lib/topology-trace.js.map +1 -0
  394. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  395. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js +7 -4
  396. package/node_modules/@openrig/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  397. package/node_modules/@openrig/daemon/dist/adapters/claude-resume.js +2 -2
  398. package/node_modules/@openrig/daemon/dist/adapters/claude-resume.js.map +1 -1
  399. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +41 -2
  400. package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
  401. package/node_modules/@openrig/daemon/dist/adapters/tmux.js +58 -18
  402. package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
  403. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.d.ts +18 -0
  404. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.d.ts.map +1 -1
  405. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.js +21 -0
  406. package/node_modules/@openrig/daemon/dist/adapters/yolo-mode.js.map +1 -1
  407. package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
  408. package/node_modules/@openrig/daemon/dist/daemon-db-path.d.ts.map +1 -1
  409. package/node_modules/@openrig/daemon/dist/daemon-db-path.js +50 -2
  410. package/node_modules/@openrig/daemon/dist/daemon-db-path.js.map +1 -1
  411. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.d.ts +95 -0
  412. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  413. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.js +171 -2
  414. package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.js.map +1 -1
  415. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts +48 -0
  416. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.d.ts.map +1 -1
  417. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js +8 -0
  418. package/node_modules/@openrig/daemon/dist/domain/context-packs/context-pack-types.js.map +1 -1
  419. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.d.ts.map +1 -1
  420. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js +234 -2
  421. package/node_modules/@openrig/daemon/dist/domain/context-packs/manifest-parser.js.map +1 -1
  422. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts +34 -0
  423. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.d.ts.map +1 -0
  424. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.js +38 -0
  425. package/node_modules/@openrig/daemon/dist/domain/context-packs/probe-eval-bridge.js.map +1 -0
  426. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts +49 -0
  427. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -0
  428. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js +125 -0
  429. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-composer.js.map +1 -0
  430. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +53 -0
  431. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -0
  432. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js +129 -0
  433. package/node_modules/@openrig/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -0
  434. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.d.ts +48 -0
  435. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.d.ts.map +1 -0
  436. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.js +123 -0
  437. package/node_modules/@openrig/daemon/dist/domain/context-packs/seat-recap-store.js.map +1 -0
  438. package/node_modules/@openrig/daemon/dist/domain/markdown-address.d.ts +56 -0
  439. package/node_modules/@openrig/daemon/dist/domain/markdown-address.d.ts.map +1 -0
  440. package/node_modules/@openrig/daemon/dist/domain/markdown-address.js +188 -0
  441. package/node_modules/@openrig/daemon/dist/domain/markdown-address.js.map +1 -0
  442. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts +8 -2
  443. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
  444. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js +1 -1
  445. package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
  446. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts +33 -21
  447. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.d.ts.map +1 -1
  448. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.js +64 -55
  449. package/node_modules/@openrig/daemon/dist/domain/model-divergence/model-divergence-monitor.js.map +1 -1
  450. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +4 -0
  451. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
  452. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.js +5 -1
  453. package/node_modules/@openrig/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
  454. package/node_modules/@openrig/daemon/dist/domain/permission-drift-observer.d.ts.map +1 -1
  455. package/node_modules/@openrig/daemon/dist/domain/permission-drift-observer.js +6 -1
  456. package/node_modules/@openrig/daemon/dist/domain/permission-drift-observer.js.map +1 -1
  457. package/node_modules/@openrig/daemon/dist/domain/plugin-discovery-service.d.ts +16 -0
  458. package/node_modules/@openrig/daemon/dist/domain/plugin-discovery-service.d.ts.map +1 -1
  459. package/node_modules/@openrig/daemon/dist/domain/plugin-discovery-service.js +175 -1
  460. package/node_modules/@openrig/daemon/dist/domain/plugin-discovery-service.js.map +1 -1
  461. package/node_modules/@openrig/daemon/dist/domain/plugin-vendor-service.d.ts +9 -5
  462. package/node_modules/@openrig/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
  463. package/node_modules/@openrig/daemon/dist/domain/plugin-vendor-service.js +101 -12
  464. package/node_modules/@openrig/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
  465. package/node_modules/@openrig/daemon/dist/domain/process-census.d.ts +25 -0
  466. package/node_modules/@openrig/daemon/dist/domain/process-census.d.ts.map +1 -0
  467. package/node_modules/@openrig/daemon/dist/domain/process-census.js +47 -0
  468. package/node_modules/@openrig/daemon/dist/domain/process-census.js.map +1 -0
  469. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts +3 -1
  470. package/node_modules/@openrig/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  471. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js +50 -2
  472. package/node_modules/@openrig/daemon/dist/domain/queue-repository.js.map +1 -1
  473. package/node_modules/@openrig/daemon/dist/domain/reconciler.d.ts.map +1 -1
  474. package/node_modules/@openrig/daemon/dist/domain/reconciler.js +6 -1
  475. package/node_modules/@openrig/daemon/dist/domain/reconciler.js.map +1 -1
  476. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.d.ts +31 -2
  477. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  478. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.js +64 -29
  479. package/node_modules/@openrig/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  480. package/node_modules/@openrig/daemon/dist/domain/review/compose.d.ts +5 -26
  481. package/node_modules/@openrig/daemon/dist/domain/review/compose.d.ts.map +1 -1
  482. package/node_modules/@openrig/daemon/dist/domain/review/compose.js +31 -57
  483. package/node_modules/@openrig/daemon/dist/domain/review/compose.js.map +1 -1
  484. package/node_modules/@openrig/daemon/dist/domain/rig-repository.d.ts +4 -0
  485. package/node_modules/@openrig/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  486. package/node_modules/@openrig/daemon/dist/domain/rig-repository.js +9 -0
  487. package/node_modules/@openrig/daemon/dist/domain/rig-repository.js.map +1 -1
  488. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts +13 -0
  489. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  490. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js +71 -0
  491. package/node_modules/@openrig/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  492. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  493. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js +19 -3
  494. package/node_modules/@openrig/daemon/dist/domain/rigspec-schema.js.map +1 -1
  495. package/node_modules/@openrig/daemon/dist/domain/running-name-guard.d.ts +52 -0
  496. package/node_modules/@openrig/daemon/dist/domain/running-name-guard.d.ts.map +1 -0
  497. package/node_modules/@openrig/daemon/dist/domain/running-name-guard.js +34 -0
  498. package/node_modules/@openrig/daemon/dist/domain/running-name-guard.js.map +1 -0
  499. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.d.ts +26 -0
  500. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.d.ts.map +1 -0
  501. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.js +65 -0
  502. package/node_modules/@openrig/daemon/dist/domain/scope/logical-checkbox.js.map +1 -0
  503. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.d.ts +1 -1
  504. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.d.ts.map +1 -1
  505. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.js +2 -2
  506. package/node_modules/@openrig/daemon/dist/domain/scope/plan-lock-artifacts.js.map +1 -1
  507. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.d.ts +22 -0
  508. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.d.ts.map +1 -1
  509. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.js +24 -0
  510. package/node_modules/@openrig/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -1
  511. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.d.ts +1 -0
  512. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  513. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.js +39 -23
  514. package/node_modules/@openrig/daemon/dist/domain/seat-activity-service.js.map +1 -1
  515. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.d.ts +22 -0
  516. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  517. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.js +32 -2
  518. package/node_modules/@openrig/daemon/dist/domain/seat-handover-service.js.map +1 -1
  519. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts +97 -0
  520. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -0
  521. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js +312 -0
  522. package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js.map +1 -0
  523. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts +16 -5
  524. package/node_modules/@openrig/daemon/dist/domain/session-transport.d.ts.map +1 -1
  525. package/node_modules/@openrig/daemon/dist/domain/session-transport.js +155 -16
  526. package/node_modules/@openrig/daemon/dist/domain/session-transport.js.map +1 -1
  527. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.d.ts +23 -0
  528. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.d.ts.map +1 -0
  529. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.js +36 -0
  530. package/node_modules/@openrig/daemon/dist/domain/shell-classifier.js.map +1 -0
  531. package/node_modules/@openrig/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  532. package/node_modules/@openrig/daemon/dist/domain/slices/slice-detail-projector.js +10 -1
  533. package/node_modules/@openrig/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  534. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.d.ts +17 -0
  535. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.d.ts.map +1 -0
  536. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.js +38 -0
  537. package/node_modules/@openrig/daemon/dist/domain/spec-validation-advisory.js.map +1 -0
  538. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.d.ts +7 -0
  539. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  540. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.js +38 -1
  541. package/node_modules/@openrig/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  542. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts +47 -0
  543. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.d.ts.map +1 -0
  544. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js +92 -0
  545. package/node_modules/@openrig/daemon/dist/domain/topology-defaults-installer.js.map +1 -0
  546. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.d.ts +4 -0
  547. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.d.ts.map +1 -1
  548. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.js +61 -3
  549. package/node_modules/@openrig/daemon/dist/domain/transcript-rotation.js.map +1 -1
  550. package/node_modules/@openrig/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  551. package/node_modules/@openrig/daemon/dist/domain/transcript-store.js +9 -2
  552. package/node_modules/@openrig/daemon/dist/domain/transcript-store.js.map +1 -1
  553. package/node_modules/@openrig/daemon/dist/domain/types.d.ts +39 -0
  554. package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
  555. package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
  556. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts +10 -1
  557. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  558. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js +39 -0
  559. package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  560. package/node_modules/@openrig/daemon/dist/routes/context-packs.d.ts.map +1 -1
  561. package/node_modules/@openrig/daemon/dist/routes/context-packs.js +205 -0
  562. package/node_modules/@openrig/daemon/dist/routes/context-packs.js.map +1 -1
  563. package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
  564. package/node_modules/@openrig/daemon/dist/routes/queue.js +29 -24
  565. package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
  566. package/node_modules/@openrig/daemon/dist/routes/rigspec.js +20 -6
  567. package/node_modules/@openrig/daemon/dist/routes/rigspec.js.map +1 -1
  568. package/node_modules/@openrig/daemon/dist/routes/seat.d.ts.map +1 -1
  569. package/node_modules/@openrig/daemon/dist/routes/seat.js +69 -0
  570. package/node_modules/@openrig/daemon/dist/routes/seat.js.map +1 -1
  571. package/node_modules/@openrig/daemon/dist/routes/sessions.js +55 -0
  572. package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
  573. package/node_modules/@openrig/daemon/dist/routes/transport.d.ts.map +1 -1
  574. package/node_modules/@openrig/daemon/dist/routes/transport.js +52 -39
  575. package/node_modules/@openrig/daemon/dist/routes/transport.js.map +1 -1
  576. package/node_modules/@openrig/daemon/dist/routes/up.js +21 -2
  577. package/node_modules/@openrig/daemon/dist/routes/up.js.map +1 -1
  578. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.d.ts +2 -0
  579. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.d.ts.map +1 -0
  580. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.js +6 -0
  581. package/node_modules/@openrig/daemon/dist/seat-recap-store-surface.js.map +1 -0
  582. package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
  583. package/node_modules/@openrig/daemon/dist/startup.js +37 -6
  584. package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
  585. package/node_modules/@openrig/daemon/package.json +6 -1
  586. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "OpenRig canonical skills and hooks for cross-runtime agent topology coordination, continuity, and operating discipline.",
5
5
  "author": {
6
6
  "name": "Mike Schwarz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrig-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "OpenRig canonical skills and hooks for cross-runtime agent topology coordination, continuity, and operating discipline.",
5
5
  "author": {
6
6
  "name": "Mike Schwarz",
@@ -4,7 +4,7 @@ Canonical OpenRig skills and hooks for cross-runtime agent topology coordination
4
4
 
5
5
  ## What this plugin ships
6
6
 
7
- **Skills (12):** the canonical OpenRig operating knowledge — how to use the `rig` CLI, how to design rig topologies, how to recover from compaction, how to hand work off durably between agents, how to maintain seat continuity across handovers and restarts, how to apply a permission policy to a seat's live harness, and how to decide who does a task.
7
+ **Skills (14):** the canonical OpenRig operating knowledge — how to use the `rig` CLI, how to design rig topologies, how to recover from compaction, how to hand work off durably between agents, how to maintain seat continuity and inherit or retire a seat across handovers and restarts, how to apply a permission policy to a seat's live harness, and how to decide who does a task.
8
8
 
9
9
  **Hooks:** activity-tracking hooks (Claude Code: 4 events; Codex: 3 events) that POST agent state to the OpenRig daemon for real-time UI seat-status updates.
10
10
 
@@ -19,6 +19,15 @@
19
19
  "timeout": 5
20
20
  }
21
21
  ]
22
+ },
23
+ {
24
+ "hooks": [
25
+ {
26
+ "type": "command",
27
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
28
+ "timeout": 5
29
+ }
30
+ ]
22
31
  }
23
32
  ],
24
33
  "UserPromptSubmit": [
@@ -39,6 +48,15 @@
39
48
  "timeout": 5
40
49
  }
41
50
  ]
51
+ },
52
+ {
53
+ "hooks": [
54
+ {
55
+ "type": "command",
56
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
57
+ "timeout": 5
58
+ }
59
+ ]
42
60
  }
43
61
  ],
44
62
  "PreCompact": [
@@ -61,6 +79,15 @@
61
79
  "timeout": 5
62
80
  }
63
81
  ]
82
+ },
83
+ {
84
+ "hooks": [
85
+ {
86
+ "type": "command",
87
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
88
+ "timeout": 5
89
+ }
90
+ ]
64
91
  }
65
92
  ],
66
93
  "Stop": [
@@ -72,6 +99,15 @@
72
99
  "timeout": 5
73
100
  }
74
101
  ]
102
+ },
103
+ {
104
+ "hooks": [
105
+ {
106
+ "type": "command",
107
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
108
+ "timeout": 5
109
+ }
110
+ ]
75
111
  }
76
112
  ],
77
113
  "Notification": [
@@ -9,6 +9,15 @@
9
9
  "timeout": 5
10
10
  }
11
11
  ]
12
+ },
13
+ {
14
+ "hooks": [
15
+ {
16
+ "type": "command",
17
+ "command": "node \"${PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
18
+ "timeout": 5
19
+ }
20
+ ]
12
21
  }
13
22
  ],
14
23
  "UserPromptSubmit": [
@@ -20,6 +29,15 @@
20
29
  "timeout": 5
21
30
  }
22
31
  ]
32
+ },
33
+ {
34
+ "hooks": [
35
+ {
36
+ "type": "command",
37
+ "command": "node \"${PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
38
+ "timeout": 5
39
+ }
40
+ ]
23
41
  }
24
42
  ],
25
43
  "Stop": [
@@ -31,6 +49,15 @@
31
49
  "timeout": 5
32
50
  }
33
51
  ]
52
+ },
53
+ {
54
+ "hooks": [
55
+ {
56
+ "type": "command",
57
+ "command": "node \"${PLUGIN_ROOT}/hooks/scripts/refocus.cjs\"",
58
+ "timeout": 5
59
+ }
60
+ ]
34
61
  }
35
62
  ],
36
63
  "PermissionRequest": [
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ // openrig-core REFOCUS hook (OPR.0.5.3.6 — promoted from the lab where it ran
4
+ // live on 6+ seats; the mechanism ships, the CONTENT is configurable).
5
+ //
6
+ // WHY: the moment an agent most needs to reorient is the moment it is least
7
+ // able to choose to. Drift does not feel like drift — it feels like work. So
8
+ // refocus FIRES rather than waits to be invoked.
9
+ //
10
+ // THIS IS ALSO HOW TOPOLOGY CHAIN FILES REACH A RUNNING SEAT. Editing a file
11
+ // under topology.root is not delivery — a running seat reads its config at
12
+ // session start and its context never re-reads disk on its own. This hook is
13
+ // the delivery channel: Stop / PostCompact observations retain due-state,
14
+ // then inject orientation content at the seat's next context-visible boundary
15
+ // (SessionStart / UserPromptSubmit), so a shipped or updated chain file becomes
16
+ // live doctrine without a relaunch.
17
+ //
18
+ // SIGNAL = TRANSCRIPT GROWTH, not turns and not wall-clock. A "turn" is one
19
+ // prompt submission; an agent can burn 200k tokens across fifty tool calls
20
+ // inside ONE turn, so a turn counter is blind to exactly the drift that
21
+ // matters. The JSONL grows monotonically with work done (measured ~8.9 bytes
22
+ // per context token, so ~300k tokens ≈ 2.6MB — rough on purpose; it needs to
23
+ // be monotonic, not exact). Tune with OPENRIG_REFOCUS_BYTES.
24
+ //
25
+ // CONTENT IS CONFIGURABLE, NEVER PROJECT-SPECIFIC IN SOURCE. Resolution:
26
+ // 1. OPENRIG_REFOCUS_CONTENT_REF env — resolved by `rig context get`.
27
+ // 2. OPENRIG_REFOCUS_CONTENT_FILE env — an operator-authored file.
28
+ // 3. $OPENRIG_HOME/refocus/REFOCUS.md — the instance's standing content.
29
+ // 4. The generic three-question orientation below (project-neutral).
30
+ // Project- or mission-specific refocus text belongs in those FILES, on the
31
+ // instance that needs it — it must never be committed here.
32
+ //
33
+ // Observes: SessionStart (fresh orientation), Stop (catches the long single
34
+ // turn), UserPromptSubmit, and PostCompact on Claude (post-compaction
35
+ // re-orientation; Codex exposes no compact hook — growth+Stop is the coverage
36
+ // there). Emits only at context-visible boundaries and stays silent unless due.
37
+ // A configured REF failure degrades loudly inside the delivered payload; every
38
+ // failure remains non-blocking because a refocus hook must never break a turn.
39
+
40
+ const fs = require("node:fs");
41
+ const path = require("node:path");
42
+ const { spawnSync } = require("node:child_process");
43
+ const THRESH = Number(process.env.OPENRIG_REFOCUS_BYTES || 2_600_000);
44
+
45
+ const readStdin = () => new Promise((r) => { let d = ""; process.stdin.setEncoding("utf8");
46
+ process.stdin.on("data", (c) => d += c); process.stdin.on("end", () => r(d)); process.stdin.on("error", () => r("")); });
47
+
48
+ (async () => {
49
+ let input = {}; try { input = JSON.parse((await readStdin()) || "{}") || {}; } catch {}
50
+ const ev = input.hook_event_name || "UserPromptSubmit";
51
+ const seat = process.env.OPENRIG_SESSION_NAME || "unknown-seat";
52
+ const home = process.env.OPENRIG_HOME || path.join(process.env.HOME || "/tmp", ".openrig");
53
+ const tpath = input.transcript_path || input.transcriptPath || "";
54
+
55
+ let size = 0; try { size = fs.statSync(tpath).size; } catch {}
56
+
57
+ const dir = path.join(home, "refocus");
58
+ const file = path.join(dir, `${seat.replace(/[^A-Za-z0-9@._-]/g, "_")}.json`);
59
+ let st = { lastBytes: 0 };
60
+ try { st = JSON.parse(fs.readFileSync(file, "utf8")) || st; } catch {}
61
+ const writeState = () => {
62
+ try { fs.mkdirSync(dir, { recursive: true }); fs.writeFileSync(file, JSON.stringify(st)); } catch {}
63
+ };
64
+
65
+ const grown = size > 0 ? size - (st.lastBytes || 0) : 0;
66
+ const due = ev === "SessionStart" || ev === "PostCompact" || Boolean(st.pendingOn) || grown >= THRESH;
67
+ if (!due) { process.exit(0); } // silent no-op — the common path
68
+
69
+ // Stop and PostCompact do not expose hook output to the agent's next context.
70
+ // Remember that delivery is due, but do not consume transcript growth until a
71
+ // context-visible boundary actually accepts the payload.
72
+ const contextVisible = ev === "SessionStart" || ev === "UserPromptSubmit";
73
+ if (!contextVisible) {
74
+ st.pendingOn ||= ev;
75
+ st.pendingAt ||= new Date().toISOString();
76
+ writeState();
77
+ process.exit(0);
78
+ }
79
+
80
+ // A library ref wins over file configuration and reuses the public assembler instead of
81
+ // growing a second resolver inside this hook. REF failures stay visible without blocking
82
+ // the session boundary; REF-unset follows the folded FILE/default path byte-for-byte.
83
+ const contentRef = process.env.OPENRIG_REFOCUS_CONTENT_REF || "";
84
+ let configured = null;
85
+ let refFailure = null;
86
+ if (contentRef) {
87
+ const result = spawnSync("rig", ["context", "get", contentRef], {
88
+ encoding: "utf8",
89
+ env: process.env,
90
+ timeout: 4_000,
91
+ maxBuffer: 16 * 1024 * 1024,
92
+ });
93
+ if (!result.error && result.status === 0 && result.stdout.trim()) {
94
+ configured = result.stdout;
95
+ } else {
96
+ refFailure = result.error?.message
97
+ || result.stderr?.trim()
98
+ || result.stdout?.trim()
99
+ || `rig context get exited ${result.status ?? "without a status"}`;
100
+ refFailure = String(refFailure).replace(/\s+/g, " ").trim();
101
+ }
102
+ } else {
103
+ // Configurable content: operator file beats instance file beats the generic default.
104
+ const contentFile = [
105
+ process.env.OPENRIG_REFOCUS_CONTENT_FILE,
106
+ path.join(home, "refocus", "REFOCUS.md"),
107
+ ].filter(Boolean).find((p) => { try { return fs.existsSync(p); } catch { return false; } });
108
+ if (contentFile) {
109
+ try { configured = fs.readFileSync(contentFile, "utf8").trim() || null; } catch {}
110
+ }
111
+ }
112
+
113
+ const why = ev === "SessionStart" ? "fresh session"
114
+ : st.pendingOn === "PostCompact" ? "just compacted — your picture is lossy"
115
+ : `${Math.round(grown / 1e6 * 10) / 10}MB of work since your last refocus`;
116
+
117
+ const generic = [
118
+ `1. What is the person actually trying to get? Not your current task — the outcome.`,
119
+ `2. Does what you are doing RIGHT NOW move that? If you cannot say what a user gets, stop and say so.`,
120
+ `3. What have you concluded without opening the file or running the thing?`,
121
+ ``,
122
+ `Discomfort on any of these IS the signal — drift feels like work.`,
123
+ ``,
124
+ `Your topology context (instance/rig/seat craft and this seat's LEARNED) is one walk away:`,
125
+ `rig context trace --rig <rig> --seat <seat> --name CRAFT.md — read it, do not recall it.`,
126
+ `A seat's LEARNED.md is written by previous occupants in the first person: it is evidence`,
127
+ `about the SEAT, never your own memory.`,
128
+ ];
129
+
130
+ const payload = refFailure ? [
131
+ `REFOCUS CONTENT REF FAILED: ${contentRef} — ${refFailure}`,
132
+ ``,
133
+ `REFOCUS (${why}). Answer briefly, out loud, before your next move:`,
134
+ ``,
135
+ ...generic,
136
+ ] : [
137
+ `REFOCUS (${why}). Answer briefly, out loud, before your next move:`,
138
+ ``,
139
+ ...(contentRef
140
+ ? [`REFOCUS CONTENT SOURCE: OPENRIG_REFOCUS_CONTENT_REF=${contentRef}`, ``, configured]
141
+ : configured ? [configured] : generic),
142
+ ];
143
+ const output = JSON.stringify({ hookSpecificOutput: { hookEventName: ev, additionalContext: payload.join("\n") } });
144
+ process.stdout.write(output, () => {
145
+ st.lastBytes = size;
146
+ st.firedAt = new Date().toISOString();
147
+ st.firedOn = ev;
148
+ delete st.pendingOn;
149
+ delete st.pendingAt;
150
+ writeState();
151
+ });
152
+ })();
@@ -92,6 +92,32 @@ restored from packet at <path>; resumed at step <X>
92
92
 
93
93
  Include the main files you read in full when you make that statement.
94
94
 
95
+ 9. **REFOCUS BEFORE YOU RESUME — the restore returns your TASK, not your BEARINGS.** Everything
96
+ above rebuilds *what you were doing*. None of it rebuilds *what the work is for* or *how this
97
+ rig operates* — those live in the chains, and nothing in steps 1–8 walks them. Invoke the
98
+ `refocus` skill and do its reads before your next substantive move.
99
+
100
+ **Measured 2026-08-13, and this step exists because of it:** a seat completed this protocol
101
+ faithfully — packet built, narrative read tail-first, read-depth audit reported honestly — and
102
+ resumed with a perfect picture of its atom and *zero* work-tree context. It had never opened
103
+ the mission or project nodes, and could only paraphrase the release's intent second-hand from
104
+ a peer's message. It then produced a technically-correct trace concluding *"I hold nothing"*
105
+ while holding 18 pending rows. **A restore that returns you to your task without your bearings
106
+ is how a confidently-wrong agent gets back to work.**
107
+
108
+ **On the marker and the packet's size (measured across restores, 2026-08):** two realities the restore
109
+ must handle honestly —
110
+
111
+ - **The per-seat marker (`restore-pending/<session>.json`) is frequently absent** — in five observed
112
+ restores it was never present. Treat the JSONL rebuild via `restore-from-jsonl.mjs` as the **primary**
113
+ path, not a fallback: run it regardless of whether a marker exists. (When product-infra reliably writes
114
+ the marker for tmux-launched seats, it becomes a fast-path upgrade — not a prerequisite that keeps failing.)
115
+ - **The generated transcript can be very large** (measured at ~346k tokens in one restore). Do **not**
116
+ read it front-to-back or claim to. `restore-instructions.md` declares its token cost up front; default
117
+ to the **most recent ~50k tokens of unique narrative first** (recency is what a restore needs — the
118
+ thread that produced the current frontier, not the boot handshake), and go earlier only if a specific
119
+ question requires it. A restore must leave room for the work it was restored to do.
120
+
95
121
  ## Required Read-Depth Audit
96
122
 
97
123
  After the first restore pass, audit yourself before continuing.
@@ -101,9 +127,15 @@ After the first restore pass, audit yourself before continuing.
101
127
  2. Mark each item as `FULL`, `PARTIAL`, or `NOT_READ`.
102
128
  3. You will be given a task where all of these files are required reading in
103
129
  order to understand the task.
104
- 4. Do not optimize for token conservation.
105
- 5. Read every `PARTIAL` or `NOT_READ` item in full now.
106
- 6. Report the final read-depth table before doing any substantive task work.
130
+ 4. Read `PARTIAL`/`NOT_READ` items in full — but **to a declared budget with a stopping rule**, not
131
+ unbounded. Prioritize by relevance to the active task; for a large transcript read the most recent
132
+ unique narrative first (see *If You Just Compacted*), not front-to-back.
133
+ 5. **Stop** when either every task-relevant item is `FULL`, or you reach the budget — *a restore that
134
+ cannot leave room for the work it was restored to do is not a successful restore.* "Read everything,
135
+ never conserve" has no termination condition; that open-endedness is the bug, not the goal.
136
+ 6. Report the final read-depth table **honestly** (`FULL`/`PARTIAL`/`NOT_READ`, each with a reason)
137
+ before task work. **An honest `PARTIAL` with its reason is a correct outcome, not a failure** — do
138
+ not claim a completion you did not reach.
107
139
 
108
140
  ## Guardrails
109
141
 
@@ -6,12 +6,7 @@ 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
- // 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";
9
+ const outRoot = "/tmp/claude-compaction-restore";
15
10
  const defaultRestoreInstruction =
16
11
  "Read the claude-compaction-restore skill and follow its \"If You Just Compacted\" protocol.";
17
12
 
@@ -29,14 +24,6 @@ function getOpenRigHome() {
29
24
  return process.env.OPENRIG_HOME || process.env.RIGGED_HOME || path.join(os.homedir(), ".openrig");
30
25
  }
31
26
 
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
-
40
27
  function expandInstructionPath(filePath) {
41
28
  if (filePath.startsWith("~/")) return path.join(os.homedir(), filePath.slice(2));
42
29
  if (filePath.startsWith("${OPENRIG_HOME}/")) {
@@ -54,50 +41,6 @@ function readInstructionFile(filePath) {
54
41
  return fs.readFileSync(expanded, "utf8");
55
42
  }
56
43
 
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
-
101
44
  function sessionKey(input) {
102
45
  const raw = [
103
46
  process.env.OPENRIG_SESSION_NAME,
@@ -115,28 +58,12 @@ function pendingMarkerPath(input) {
115
58
  return path.join(getOpenRigHome(), "compaction", "restore-pending", `${sessionKey(input)}.json`);
116
59
  }
117
60
 
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
-
134
61
  function writePendingRestoreMarker(input, parsed, restoreInstruction, customMessage) {
135
62
  const markerPath = pendingMarkerPath(input);
136
63
  fs.mkdirSync(path.dirname(markerPath), { recursive: true });
137
64
  const payload = {
138
65
  version: 1,
139
- createdAt: nowIso(),
66
+ createdAt: new Date().toISOString(),
140
67
  sessionName: process.env.OPENRIG_SESSION_NAME || process.env.RIGGED_SESSION_NAME || null,
141
68
  sessionId: input.session_id || input.sessionId || null,
142
69
  transcriptPath: input.transcript_path || null,
@@ -191,18 +118,13 @@ function readClaudeCompactionMessage() {
191
118
  parts.push(`Inline restore instruction:\n${inline}`);
192
119
  }
193
120
  if (filePath && filePath.length > 0) {
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.
121
+ try {
122
+ const fileText = readInstructionFile(filePath);
123
+ if (fileText) {
124
+ parts.push(`Additional restore instruction file (${filePath}):\n${fileText}`);
205
125
  }
126
+ } catch {
127
+ // Keep any inline instruction; unreadable extra files degrade quietly.
206
128
  }
207
129
  }
208
130
  if (parts.length > 0) return parts.join("\n\n");
@@ -218,16 +140,7 @@ function buildSystemMessage(restoreInstruction, customMessage) {
218
140
  }
219
141
 
220
142
  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
- }
229
143
  const input = readHookInput();
230
- writeExpectedSentinel(input); // R5: sentinel FIRST, before the packet + marker (catches hook-died-partway)
231
144
  const args = [restoreScript, "--out", outRoot, "--json"];
232
145
  if (input.cwd) args.push("--cwd", input.cwd);
233
146
  if (input.transcript_path && input.transcript_path.endsWith(".jsonl") && fs.existsSync(input.transcript_path)) {