@openrig/cli 0.7.14 → 0.7.16

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 (573) hide show
  1. package/README.md +5 -5
  2. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  3. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/README.md +28 -7
  6. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  7. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  8. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  9. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +8 -5
  10. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +13 -4
  11. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/CHANGELOG.md +10 -0
  12. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/SKILL.md +12 -13
  13. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +1 -1
  14. package/daemon/assets/skills/rigs/SKILL.md +105 -30
  15. package/daemon/context-packs/help/manifest.yaml +1 -1
  16. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  17. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +127 -16
  18. package/daemon/context-packs/reference/getting-started.md +17 -15
  19. package/daemon/context-packs/reference/manifest.yaml +4 -1
  20. package/daemon/context-packs/reference/product-journey-sdlc.md +348 -0
  21. package/daemon/context-packs/reference/rig-spec.md +92 -4
  22. package/daemon/context-packs/reference/whats-new.md +355 -5
  23. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +8 -5
  27. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +13 -4
  33. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/CHANGELOG.md +10 -0
  54. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/SKILL.md +12 -13
  55. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +3 -3
  56. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +1 -1
  78. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  81. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  82. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  83. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  84. package/daemon/dist/adapters/claude-code-adapter.js +6 -3
  85. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  86. package/daemon/dist/adapters/codex-resume.d.ts +2 -0
  87. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  88. package/daemon/dist/adapters/codex-resume.js +28 -11
  89. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  90. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +15 -0
  91. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  92. package/daemon/dist/adapters/codex-runtime-adapter.js +88 -31
  93. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  94. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +2 -0
  95. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  96. package/daemon/dist/adapters/community-harness-runtime-adapter.js +93 -36
  97. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  98. package/daemon/dist/adapters/pi-resume.d.ts +3 -0
  99. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  100. package/daemon/dist/adapters/pi-resume.js +99 -51
  101. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  102. package/daemon/dist/adapters/pi-runner.d.ts +2 -1
  103. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  104. package/daemon/dist/adapters/pi-runner.js +15 -9
  105. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  106. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +4 -0
  107. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  108. package/daemon/dist/adapters/pi-runtime-adapter.js +133 -75
  109. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  110. package/daemon/dist/adapters/tmux.d.ts +10 -0
  111. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  112. package/daemon/dist/adapters/tmux.js +42 -7
  113. package/daemon/dist/adapters/tmux.js.map +1 -1
  114. package/daemon/dist/build-info.js +3 -3
  115. package/daemon/dist/daemon-shutdown.d.ts +3 -0
  116. package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
  117. package/daemon/dist/daemon-shutdown.js +6 -0
  118. package/daemon/dist/daemon-shutdown.js.map +1 -1
  119. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  120. package/daemon/dist/db/all-migrations.js +6 -0
  121. package/daemon/dist/db/all-migrations.js.map +1 -1
  122. package/daemon/dist/db/migrations/165_run_bound_activity_grants.d.ts +4 -0
  123. package/daemon/dist/db/migrations/165_run_bound_activity_grants.d.ts.map +1 -0
  124. package/daemon/dist/db/migrations/165_run_bound_activity_grants.js +14 -0
  125. package/daemon/dist/db/migrations/165_run_bound_activity_grants.js.map +1 -0
  126. package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts +14 -0
  127. package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts.map +1 -0
  128. package/daemon/dist/db/migrations/167_seat_handover_attempts.js +54 -0
  129. package/daemon/dist/db/migrations/167_seat_handover_attempts.js.map +1 -0
  130. package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts +5 -0
  131. package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts.map +1 -0
  132. package/daemon/dist/db/migrations/169_seat_runtime_home_records.js +25 -0
  133. package/daemon/dist/db/migrations/169_seat_runtime_home_records.js.map +1 -0
  134. package/daemon/dist/domain/activity-grants.d.ts +36 -3
  135. package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
  136. package/daemon/dist/domain/activity-grants.js +188 -7
  137. package/daemon/dist/domain/activity-grants.js.map +1 -1
  138. package/daemon/dist/domain/applied-launch-observation-store.d.ts +2 -0
  139. package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
  140. package/daemon/dist/domain/applied-launch-observation-store.js +27 -16
  141. package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
  142. package/daemon/dist/domain/claim-service.d.ts +1 -3
  143. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  144. package/daemon/dist/domain/claim-service.js +3 -1
  145. package/daemon/dist/domain/claim-service.js.map +1 -1
  146. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -0
  147. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  148. package/daemon/dist/domain/claude-compaction-enforcer.js +85 -38
  149. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  150. package/daemon/dist/domain/codex-filesystem-preflight.d.ts +33 -0
  151. package/daemon/dist/domain/codex-filesystem-preflight.d.ts.map +1 -0
  152. package/daemon/dist/domain/codex-filesystem-preflight.js +255 -0
  153. package/daemon/dist/domain/codex-filesystem-preflight.js.map +1 -0
  154. package/daemon/dist/domain/codex-member-permissions.d.ts +25 -2
  155. package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
  156. package/daemon/dist/domain/codex-member-permissions.js +72 -18
  157. package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
  158. package/daemon/dist/domain/codex-network-default.d.ts +13 -0
  159. package/daemon/dist/domain/codex-network-default.d.ts.map +1 -1
  160. package/daemon/dist/domain/codex-network-default.js +37 -30
  161. package/daemon/dist/domain/codex-network-default.js.map +1 -1
  162. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts +6 -1
  163. package/daemon/dist/domain/codex-owned-plugin-trust.d.ts.map +1 -1
  164. package/daemon/dist/domain/codex-owned-plugin-trust.js +30 -9
  165. package/daemon/dist/domain/codex-owned-plugin-trust.js.map +1 -1
  166. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  167. package/daemon/dist/domain/compaction-restore-notice.js +59 -13
  168. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  169. package/daemon/dist/domain/destination-successor.d.ts +3 -0
  170. package/daemon/dist/domain/destination-successor.d.ts.map +1 -0
  171. package/daemon/dist/domain/destination-successor.js +49 -0
  172. package/daemon/dist/domain/destination-successor.js.map +1 -0
  173. package/daemon/dist/domain/execution-candidate-reader.d.ts +15 -5
  174. package/daemon/dist/domain/execution-candidate-reader.d.ts.map +1 -1
  175. package/daemon/dist/domain/execution-candidate-reader.js +36 -25
  176. package/daemon/dist/domain/execution-candidate-reader.js.map +1 -1
  177. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  178. package/daemon/dist/domain/execution-view.js +34 -11
  179. package/daemon/dist/domain/execution-view.js.map +1 -1
  180. package/daemon/dist/domain/gateway/destination-resolver.js +3 -3
  181. package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
  182. package/daemon/dist/domain/gateway/slack/config.d.ts +2 -0
  183. package/daemon/dist/domain/gateway/slack/config.d.ts.map +1 -1
  184. package/daemon/dist/domain/gateway/slack/config.js +4 -0
  185. package/daemon/dist/domain/gateway/slack/config.js.map +1 -1
  186. package/daemon/dist/domain/gateway/slack/inbound.d.ts +11 -0
  187. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  188. package/daemon/dist/domain/gateway/slack/inbound.js +3 -0
  189. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  190. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +2 -0
  191. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  192. package/daemon/dist/domain/gateway/slack/slack-api.js +4 -0
  193. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  194. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +2 -0
  195. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  196. package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -1
  197. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  198. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  199. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +36 -2
  200. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  201. package/daemon/dist/domain/gateway/slack/thread-routing.d.ts +5 -0
  202. package/daemon/dist/domain/gateway/slack/thread-routing.d.ts.map +1 -1
  203. package/daemon/dist/domain/gateway/slack/thread-routing.js +1 -1
  204. package/daemon/dist/domain/gateway/slack/thread-routing.js.map +1 -1
  205. package/daemon/dist/domain/health-passive-ceremony.d.ts +3 -0
  206. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  207. package/daemon/dist/domain/health-passive-ceremony.js +58 -11
  208. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  209. package/daemon/dist/domain/hosts/fleet-scopes.d.ts +111 -0
  210. package/daemon/dist/domain/hosts/fleet-scopes.d.ts.map +1 -0
  211. package/daemon/dist/domain/hosts/fleet-scopes.js +231 -0
  212. package/daemon/dist/domain/hosts/fleet-scopes.js.map +1 -0
  213. package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
  214. package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
  215. package/daemon/dist/domain/hosts/read-through.js +4 -0
  216. package/daemon/dist/domain/hosts/read-through.js.map +1 -1
  217. package/daemon/dist/domain/native-permission-store.d.ts +40 -0
  218. package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
  219. package/daemon/dist/domain/native-permission-store.js +115 -29
  220. package/daemon/dist/domain/native-permission-store.js.map +1 -1
  221. package/daemon/dist/domain/native-process-lineage.d.ts +11 -1
  222. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  223. package/daemon/dist/domain/native-process-lineage.js +25 -4
  224. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  225. package/daemon/dist/domain/native-resume-probe.d.ts +33 -1
  226. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  227. package/daemon/dist/domain/native-resume-probe.js +143 -4
  228. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  229. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  230. package/daemon/dist/domain/node-inventory.js +214 -30
  231. package/daemon/dist/domain/node-inventory.js.map +1 -1
  232. package/daemon/dist/domain/node-launcher.d.ts +3 -0
  233. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  234. package/daemon/dist/domain/node-launcher.js +6 -0
  235. package/daemon/dist/domain/node-launcher.js.map +1 -1
  236. package/daemon/dist/domain/permission-account.d.ts.map +1 -1
  237. package/daemon/dist/domain/permission-account.js +8 -6
  238. package/daemon/dist/domain/permission-account.js.map +1 -1
  239. package/daemon/dist/domain/permission-drift.d.ts +2 -1
  240. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  241. package/daemon/dist/domain/permission-drift.js +1 -1
  242. package/daemon/dist/domain/permission-drift.js.map +1 -1
  243. package/daemon/dist/domain/permission-policy/persisted-restore-posture.d.ts +62 -0
  244. package/daemon/dist/domain/permission-policy/persisted-restore-posture.d.ts.map +1 -0
  245. package/daemon/dist/domain/permission-policy/persisted-restore-posture.js +117 -0
  246. package/daemon/dist/domain/permission-policy/persisted-restore-posture.js.map +1 -0
  247. package/daemon/dist/domain/policies/context-usage-threshold.d.ts.map +1 -1
  248. package/daemon/dist/domain/policies/context-usage-threshold.js +5 -1
  249. package/daemon/dist/domain/policies/context-usage-threshold.js.map +1 -1
  250. package/daemon/dist/domain/policies/types.d.ts +2 -0
  251. package/daemon/dist/domain/policies/types.d.ts.map +1 -1
  252. package/daemon/dist/domain/queue-destination-check.d.ts +2 -0
  253. package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
  254. package/daemon/dist/domain/queue-destination-check.js +8 -11
  255. package/daemon/dist/domain/queue-destination-check.js.map +1 -1
  256. package/daemon/dist/domain/queue-repository.d.ts +29 -16
  257. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  258. package/daemon/dist/domain/queue-repository.js +61 -55
  259. package/daemon/dist/domain/queue-repository.js.map +1 -1
  260. package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
  261. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  262. package/daemon/dist/domain/queue-transition-log.js +9 -0
  263. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  264. package/daemon/dist/domain/queue-waiting.d.ts +4 -4
  265. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  266. package/daemon/dist/domain/queue-waiting.js +30 -16
  267. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  268. package/daemon/dist/domain/queue-wake-ladder.d.ts +12 -0
  269. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  270. package/daemon/dist/domain/queue-wake-ladder.js +27 -7
  271. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  272. package/daemon/dist/domain/receiver-context.js +1 -1
  273. package/daemon/dist/domain/receiver-context.js.map +1 -1
  274. package/daemon/dist/domain/rehydrate-eligibility.d.ts.map +1 -1
  275. package/daemon/dist/domain/rehydrate-eligibility.js +3 -2
  276. package/daemon/dist/domain/rehydrate-eligibility.js.map +1 -1
  277. package/daemon/dist/domain/reply-to-choice.d.ts +10 -0
  278. package/daemon/dist/domain/reply-to-choice.d.ts.map +1 -1
  279. package/daemon/dist/domain/reply-to-choice.js +23 -0
  280. package/daemon/dist/domain/reply-to-choice.js.map +1 -1
  281. package/daemon/dist/domain/restore-check-service.d.ts +5 -0
  282. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  283. package/daemon/dist/domain/restore-check-service.js +31 -6
  284. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  285. package/daemon/dist/domain/restore-orchestrator.d.ts +1 -1
  286. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  287. package/daemon/dist/domain/restore-orchestrator.js +88 -98
  288. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  289. package/daemon/dist/domain/restore-preconditions.d.ts +2 -0
  290. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
  291. package/daemon/dist/domain/restore-preconditions.js +6 -0
  292. package/daemon/dist/domain/restore-preconditions.js.map +1 -1
  293. package/daemon/dist/domain/resume-metadata-refresher.d.ts +21 -4
  294. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  295. package/daemon/dist/domain/resume-metadata-refresher.js +65 -14
  296. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  297. package/daemon/dist/domain/resume-token-capture.d.ts +6 -0
  298. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
  299. package/daemon/dist/domain/resume-token-capture.js +14 -8
  300. package/daemon/dist/domain/resume-token-capture.js.map +1 -1
  301. package/daemon/dist/domain/rig-edge-ops.js +1 -1
  302. package/daemon/dist/domain/rig-edge-ops.js.map +1 -1
  303. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  304. package/daemon/dist/domain/rigspec-instantiator.js +8 -3
  305. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  306. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  307. package/daemon/dist/domain/rigspec-preflight.js +21 -1
  308. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  309. package/daemon/dist/domain/rosters.d.ts +19 -0
  310. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  311. package/daemon/dist/domain/rosters.js +69 -12
  312. package/daemon/dist/domain/rosters.js.map +1 -1
  313. package/daemon/dist/domain/runner-grant-launch.d.ts +16 -0
  314. package/daemon/dist/domain/runner-grant-launch.d.ts.map +1 -0
  315. package/daemon/dist/domain/runner-grant-launch.js +86 -0
  316. package/daemon/dist/domain/runner-grant-launch.js.map +1 -0
  317. package/daemon/dist/domain/runtime-adapter.d.ts +17 -0
  318. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  319. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  320. package/daemon/dist/domain/seat-delivery-guard.d.ts +21 -3
  321. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  322. package/daemon/dist/domain/seat-delivery-guard.js +91 -4
  323. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  324. package/daemon/dist/domain/seat-handover-attempts.d.ts +50 -0
  325. package/daemon/dist/domain/seat-handover-attempts.d.ts.map +1 -0
  326. package/daemon/dist/domain/seat-handover-attempts.js +75 -0
  327. package/daemon/dist/domain/seat-handover-attempts.js.map +1 -0
  328. package/daemon/dist/domain/seat-handover-service.d.ts +64 -1
  329. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  330. package/daemon/dist/domain/seat-handover-service.js +450 -35
  331. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  332. package/daemon/dist/domain/seat-identity-reconciler.d.ts +3 -0
  333. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  334. package/daemon/dist/domain/seat-identity-reconciler.js +34 -2
  335. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  336. package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -2
  337. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  338. package/daemon/dist/domain/seat-lifecycle-service.js +53 -3
  339. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  340. package/daemon/dist/domain/seat-runtime-home-record-types.d.ts +16 -0
  341. package/daemon/dist/domain/seat-runtime-home-record-types.d.ts.map +1 -0
  342. package/daemon/dist/domain/seat-runtime-home-record-types.js +2 -0
  343. package/daemon/dist/domain/seat-runtime-home-record-types.js.map +1 -0
  344. package/daemon/dist/domain/seat-runtime-home-record.d.ts +173 -0
  345. package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -0
  346. package/daemon/dist/domain/seat-runtime-home-record.js +317 -0
  347. package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -0
  348. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +7 -0
  349. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  350. package/daemon/dist/domain/seat-runtime-switch-service.js +62 -2
  351. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  352. package/daemon/dist/domain/seat-skill-storage.d.ts +16 -1
  353. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
  354. package/daemon/dist/domain/seat-skill-storage.js +178 -1
  355. package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
  356. package/daemon/dist/domain/session-registry.d.ts +2 -0
  357. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  358. package/daemon/dist/domain/session-registry.js +16 -0
  359. package/daemon/dist/domain/session-registry.js.map +1 -1
  360. package/daemon/dist/domain/session-transport.d.ts +1 -0
  361. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  362. package/daemon/dist/domain/session-transport.js +7 -3
  363. package/daemon/dist/domain/session-transport.js.map +1 -1
  364. package/daemon/dist/domain/skill-catalog.d.ts +3 -0
  365. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  366. package/daemon/dist/domain/skill-catalog.js +7 -3
  367. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  368. package/daemon/dist/domain/skill-discovery.d.ts.map +1 -1
  369. package/daemon/dist/domain/skill-discovery.js +2 -1
  370. package/daemon/dist/domain/skill-discovery.js.map +1 -1
  371. package/daemon/dist/domain/slow-op-recorder.d.ts +3 -0
  372. package/daemon/dist/domain/slow-op-recorder.d.ts.map +1 -1
  373. package/daemon/dist/domain/slow-op-recorder.js +5 -0
  374. package/daemon/dist/domain/slow-op-recorder.js.map +1 -1
  375. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  376. package/daemon/dist/domain/snapshot-capture.js +5 -0
  377. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  378. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  379. package/daemon/dist/domain/startup-orchestrator.js +9 -0
  380. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  381. package/daemon/dist/domain/successor-session-launcher.d.ts +19 -1
  382. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  383. package/daemon/dist/domain/successor-session-launcher.js +81 -39
  384. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  385. package/daemon/dist/domain/sync-site-wrap.d.ts +13 -1
  386. package/daemon/dist/domain/sync-site-wrap.d.ts.map +1 -1
  387. package/daemon/dist/domain/sync-site-wrap.js +38 -0
  388. package/daemon/dist/domain/sync-site-wrap.js.map +1 -1
  389. package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -1
  390. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  391. package/daemon/dist/domain/terminal/terminal-service.js +17 -12
  392. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  393. package/daemon/dist/domain/types.d.ts +37 -1
  394. package/daemon/dist/domain/types.d.ts.map +1 -1
  395. package/daemon/dist/domain/types.js.map +1 -1
  396. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  397. package/daemon/dist/domain/user-settings/settings-browser.js +3 -1
  398. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  399. package/daemon/dist/domain/watchdog-policy-engine.d.ts +5 -0
  400. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  401. package/daemon/dist/domain/watchdog-policy-engine.js +4 -0
  402. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  403. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  404. package/daemon/dist/domain/workflow-exception-escalation.js +13 -8
  405. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  406. package/daemon/dist/domain/workflow-instance-store.d.ts +11 -0
  407. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  408. package/daemon/dist/domain/workflow-instance-store.js +35 -0
  409. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  410. package/daemon/dist/domain/workflow-projector.d.ts +7 -0
  411. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  412. package/daemon/dist/domain/workflow-projector.js +202 -91
  413. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  414. package/daemon/dist/domain/workflow-runtime.d.ts +8 -2
  415. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  416. package/daemon/dist/domain/workflow-runtime.js +116 -26
  417. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  418. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  419. package/daemon/dist/lib/pane-envelope.js +12 -7
  420. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  421. package/daemon/dist/routes/activity.d.ts.map +1 -1
  422. package/daemon/dist/routes/activity.js +34 -2
  423. package/daemon/dist/routes/activity.js.map +1 -1
  424. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  425. package/daemon/dist/routes/compaction.js +6 -3
  426. package/daemon/dist/routes/compaction.js.map +1 -1
  427. package/daemon/dist/routes/queue.d.ts.map +1 -1
  428. package/daemon/dist/routes/queue.js +44 -27
  429. package/daemon/dist/routes/queue.js.map +1 -1
  430. package/daemon/dist/routes/scopes.d.ts.map +1 -1
  431. package/daemon/dist/routes/scopes.js +102 -19
  432. package/daemon/dist/routes/scopes.js.map +1 -1
  433. package/daemon/dist/routes/seat.d.ts.map +1 -1
  434. package/daemon/dist/routes/seat.js +50 -2
  435. package/daemon/dist/routes/seat.js.map +1 -1
  436. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  437. package/daemon/dist/routes/sessions.js +63 -16
  438. package/daemon/dist/routes/sessions.js.map +1 -1
  439. package/daemon/dist/routes/startup.d.ts.map +1 -1
  440. package/daemon/dist/routes/startup.js +116 -18
  441. package/daemon/dist/routes/startup.js.map +1 -1
  442. package/daemon/dist/routes/transport.d.ts.map +1 -1
  443. package/daemon/dist/routes/transport.js +36 -2
  444. package/daemon/dist/routes/transport.js.map +1 -1
  445. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  446. package/daemon/dist/routes/watchdog.js +7 -1
  447. package/daemon/dist/routes/watchdog.js.map +1 -1
  448. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  449. package/daemon/dist/routes/workflow.js +22 -4
  450. package/daemon/dist/routes/workflow.js.map +1 -1
  451. package/daemon/dist/startup.d.ts.map +1 -1
  452. package/daemon/dist/startup.js +132 -46
  453. package/daemon/dist/startup.js.map +1 -1
  454. package/daemon/docs/reference/agent-startup-guide.md +88 -1
  455. package/daemon/docs/reference/bundle-formats.md +6 -4
  456. package/daemon/docs/reference/daemon-http-clients.md +3 -1
  457. package/daemon/docs/reference/developing.md +1 -1
  458. package/daemon/docs/reference/gateway-participants.md +5 -3
  459. package/daemon/docs/reference/getting-started.md +17 -15
  460. package/daemon/docs/reference/harness-runner-contract.md +27 -1
  461. package/daemon/docs/reference/health-diagnosis.md +5 -3
  462. package/daemon/docs/reference/keeping-a-watch.md +14 -9
  463. package/daemon/docs/reference/quickstart.md +2 -2
  464. package/daemon/docs/reference/rig-spec.md +92 -4
  465. package/daemon/docs/reference/rosters.md +26 -0
  466. package/daemon/docs/reference/seat-delivery.md +7 -1
  467. package/daemon/docs/reference/slack-app-setup.md +4 -0
  468. package/daemon/docs/reference/whats-new.md +355 -5
  469. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +13 -4
  470. package/dist/build-info.js +3 -3
  471. package/dist/client.d.ts +7 -3
  472. package/dist/client.d.ts.map +1 -1
  473. package/dist/client.js +11 -2
  474. package/dist/client.js.map +1 -1
  475. package/dist/commands/down.d.ts.map +1 -1
  476. package/dist/commands/down.js +2 -1
  477. package/dist/commands/down.js.map +1 -1
  478. package/dist/commands/launch.d.ts.map +1 -1
  479. package/dist/commands/launch.js +8 -0
  480. package/dist/commands/launch.js.map +1 -1
  481. package/dist/commands/mcp.d.ts.map +1 -1
  482. package/dist/commands/mcp.js +18 -1
  483. package/dist/commands/mcp.js.map +1 -1
  484. package/dist/commands/ps.d.ts +1 -0
  485. package/dist/commands/ps.d.ts.map +1 -1
  486. package/dist/commands/ps.js +13 -6
  487. package/dist/commands/ps.js.map +1 -1
  488. package/dist/commands/queue.d.ts.map +1 -1
  489. package/dist/commands/queue.js +6 -2
  490. package/dist/commands/queue.js.map +1 -1
  491. package/dist/commands/roster.d.ts +4 -2
  492. package/dist/commands/roster.d.ts.map +1 -1
  493. package/dist/commands/roster.js +2 -2
  494. package/dist/commands/roster.js.map +1 -1
  495. package/dist/commands/seat.d.ts +2 -0
  496. package/dist/commands/seat.d.ts.map +1 -1
  497. package/dist/commands/seat.js +198 -11
  498. package/dist/commands/seat.js.map +1 -1
  499. package/dist/commands/send.d.ts.map +1 -1
  500. package/dist/commands/send.js +31 -6
  501. package/dist/commands/send.js.map +1 -1
  502. package/dist/commands/slack.d.ts.map +1 -1
  503. package/dist/commands/slack.js +2 -0
  504. package/dist/commands/slack.js.map +1 -1
  505. package/dist/commands/walk.d.ts.map +1 -1
  506. package/dist/commands/walk.js +4 -0
  507. package/dist/commands/walk.js.map +1 -1
  508. package/dist/commands/workflow.d.ts.map +1 -1
  509. package/dist/commands/workflow.js +25 -1
  510. package/dist/commands/workflow.js.map +1 -1
  511. package/dist/daemon-lifecycle.d.ts.map +1 -1
  512. package/dist/daemon-lifecycle.js +10 -5
  513. package/dist/daemon-lifecycle.js.map +1 -1
  514. package/dist/lib/work-install.d.ts.map +1 -1
  515. package/dist/lib/work-install.js +7 -3
  516. package/dist/lib/work-install.js.map +1 -1
  517. package/dist/mcp-http.d.ts +3 -0
  518. package/dist/mcp-http.d.ts.map +1 -1
  519. package/dist/mcp-http.js +13 -0
  520. package/dist/mcp-http.js.map +1 -1
  521. package/dist/mcp-server.d.ts +9 -2
  522. package/dist/mcp-server.d.ts.map +1 -1
  523. package/dist/mcp-server.js +269 -76
  524. package/dist/mcp-server.js.map +1 -1
  525. package/package.json +1 -1
  526. package/tui/dist/commands/registry.d.ts.map +1 -1
  527. package/tui/dist/commands/registry.js +1 -0
  528. package/tui/dist/commands/registry.js.map +1 -1
  529. package/tui/dist/connected-assistants.js +1 -1
  530. package/tui/dist/connected-assistants.js.map +1 -1
  531. package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
  532. package/tui/dist/crash-cart/start-daemon.js +4 -2
  533. package/tui/dist/crash-cart/start-daemon.js.map +1 -1
  534. package/tui/dist/daemon-client.d.ts +9 -0
  535. package/tui/dist/daemon-client.d.ts.map +1 -1
  536. package/tui/dist/daemon-client.js +40 -0
  537. package/tui/dist/daemon-client.js.map +1 -1
  538. package/tui/dist/hydrate.d.ts +1 -1
  539. package/tui/dist/hydrate.d.ts.map +1 -1
  540. package/tui/dist/hydrate.js +12 -0
  541. package/tui/dist/hydrate.js.map +1 -1
  542. package/tui/dist/main.js +7 -3
  543. package/tui/dist/main.js.map +1 -1
  544. package/tui/dist/page-read.d.ts.map +1 -1
  545. package/tui/dist/page-read.js +2 -1
  546. package/tui/dist/page-read.js.map +1 -1
  547. package/tui/dist/render.d.ts.map +1 -1
  548. package/tui/dist/render.js +8 -2
  549. package/tui/dist/render.js.map +1 -1
  550. package/tui/dist/scopes/fleet-scopes-model.d.ts +73 -0
  551. package/tui/dist/scopes/fleet-scopes-model.d.ts.map +1 -0
  552. package/tui/dist/scopes/fleet-scopes-model.js +102 -0
  553. package/tui/dist/scopes/fleet-scopes-model.js.map +1 -0
  554. package/tui/dist/scopes/scopes-model.d.ts +2 -0
  555. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  556. package/tui/dist/scopes/scopes-model.js +7 -4
  557. package/tui/dist/scopes/scopes-model.js.map +1 -1
  558. package/tui/dist/sections.d.ts.map +1 -1
  559. package/tui/dist/sections.js +5 -0
  560. package/tui/dist/sections.js.map +1 -1
  561. package/tui/dist/startup.d.ts +5 -0
  562. package/tui/dist/startup.d.ts.map +1 -1
  563. package/tui/dist/startup.js +12 -0
  564. package/tui/dist/startup.js.map +1 -1
  565. package/tui/dist/state.d.ts.map +1 -1
  566. package/tui/dist/state.js +12 -5
  567. package/tui/dist/state.js.map +1 -1
  568. package/tui/dist/types.d.ts +16 -1
  569. package/tui/dist/types.d.ts.map +1 -1
  570. package/ui/dist/assets/index-BX8TUZ0E.css +32 -0
  571. package/ui/dist/assets/{index-BOYrLyfQ.js → index-BvUEh33d.js} +1 -1
  572. package/ui/dist/index.html +2 -2
  573. package/ui/dist/assets/index-DqSRu4OY.css +0 -32
@@ -1,5 +1,6 @@
1
1
  import { codexEnvelopeArgs } from "../domain/codex-rebuild-permissions.js";
2
- import { codexMemberEnvelope, observeCodexEnvelope, readProfileFingerprint } from "../domain/codex-member-permissions.js";
2
+ import { codexMemberLaunch, observeCodexEnvelope, readProfileFingerprint } from "../domain/codex-member-permissions.js";
3
+ import { codexPolicyWarning, resolveCodexFilesystemHome, verifyCodexFilesystemPolicy } from "../domain/codex-filesystem-preflight.js";
3
4
  import { operationalLaunchArg } from "./kernel-authority.js";
4
5
  import nodePath from "node:path";
5
6
  import fs from "node:fs";
@@ -77,6 +78,10 @@ export class CodexRuntimeAdapter {
77
78
  // the real probe by default.
78
79
  verifyProfilePreflight;
79
80
  profileFingerprint;
81
+ verifyFilesystemPolicy;
82
+ // A handover checks the exact binding before retiring its predecessor. Consume
83
+ // that result once at dispatch, rather than repeat a refusal after cutover.
84
+ filesystemPreflight = new WeakMap();
80
85
  // #69: whether the installed Codex supports --no-daemon. Startup wires the real probe;
81
86
  // absent (unit tests, other embedders) keeps the existing invocation unchanged.
82
87
  detectDaemonSupport;
@@ -130,6 +135,7 @@ export class CodexRuntimeAdapter {
130
135
  this.codexHome = deps.codexHome;
131
136
  this.seatHome = deps.seatHome;
132
137
  this.profileFingerprint = deps.profileFingerprint ?? readProfileFingerprint;
138
+ this.verifyFilesystemPolicy = deps.verifyFilesystemPolicy ?? verifyCodexFilesystemPolicy;
133
139
  this.launchPath = deps.launchPath;
134
140
  this.detectDaemonSupport = deps.detectDaemonSupport;
135
141
  this.readNetworkDefault = deps.readNetworkDefault;
@@ -164,7 +170,9 @@ export class CodexRuntimeAdapter {
164
170
  /** The home a seat's Codex uses: its own from its member or rig `env:`, else the daemon's explicit CODEX_HOME. Undefined
165
171
  * keeps the legacy OS/PID home behavior. */
166
172
  homeFor(binding) {
167
- return this.ownHome(binding) ?? this.codexHome;
173
+ const selected = this.ownHome(binding) ?? this.codexHome;
174
+ return binding?.codexPermissions && "filesystem" in binding.codexPermissions
175
+ ? selected ?? resolveCodexFilesystemHome(undefined, this.fs.homedir) : selected;
168
176
  }
169
177
  /** Only the seat's own CODEX_HOME, undefined when it declares none. Probes and readers get it as an extra argument
170
178
  * only when it's set, so a seat without one calls them exactly as before. */
@@ -172,7 +180,7 @@ export class CodexRuntimeAdapter {
172
180
  return binding?.accountHome ?? (binding?.nodeId ? this.seatHome?.(binding.nodeId, binding.accountHome === null) : undefined);
173
181
  }
174
182
  ownHomeCommandOpt(binding) {
175
- const own = this.ownHome(binding);
183
+ const own = binding.codexPermissions && "filesystem" in binding.codexPermissions ? this.homeFor(binding) : this.ownHome(binding);
176
184
  return own ? { codexHome: own } : {};
177
185
  }
178
186
  ownHomeOpt(binding) {
@@ -342,7 +350,8 @@ export class CodexRuntimeAdapter {
342
350
  // Codex's "continue without trusting" choice writes no state, so an existing install with no hooks.state entry for any
343
351
  // of OpenRig's hooks may be an unrecorded skip, or an older install that never granted them. OpenRig trusts its own
344
352
  // exact shipped hooks there as on a first install (#17). Any recorded choice for one of them, or a layer it can't read,
345
- // leaves native review in place. A proven owned grant may renew its content approval.
353
+ // leaves native review in place. A proven owned grant may renew its content approval, and its declarations when a new
354
+ // shipped bundle changes them and every approval still matches OpenRig's own record.
346
355
  const firstInstall = !this.fs.exists(cacheRoot) && !layers.some(layer => layer.state === "read"
347
356
  && Object.hasOwn((parseToml(layer.content).plugins ?? {}), CODEX_CORE_PLUGIN_KEY));
348
357
  const noOwnHookChoice = (read) => {
@@ -366,11 +375,18 @@ export class CodexRuntimeAdapter {
366
375
  const planned = planOwnedCodexContentApproval({ configPath, content, layers: currentLayers, shipped, installed: cachedDir, freshGrant });
367
376
  if (!planned)
368
377
  return;
378
+ for (const [key, hash] of Object.entries(planned.trustedHashes))
379
+ content = upsertCodexHookTrust(content, key, hash);
380
+ // The declaration writer ends the file with one newline; keep the owner's own ending.
381
+ if (content !== before)
382
+ content = content.replace(/\n*$/, /\n*$/.exec(before)?.[0] ?? "");
369
383
  for (const [key, hash] of Object.entries(planned.hashes))
370
384
  content = upsertCodexHookTrust(content, key, hash, "trusted_content_hash");
371
385
  // The line writer must not alter examples in strings or duplicate quoted keys.
372
386
  try {
373
387
  const expected = parseToml(before);
388
+ for (const [key, hash] of Object.entries(planned.trustedHashes))
389
+ expected.hooks.state[key].trusted_hash = hash;
374
390
  for (const [key, hash] of Object.entries(planned.hashes))
375
391
  expected.hooks.state[key].trusted_content_hash = hash;
376
392
  if (!isDeepStrictEqual(parseToml(content), expected))
@@ -379,8 +395,10 @@ export class CodexRuntimeAdapter {
379
395
  catch {
380
396
  return;
381
397
  } // Leave native review and owner bytes intact for unsupported TOML spellings.
382
- if (this.fs.readFile(configPath) !== before)
383
- return; // A concurrent native choice wins.
398
+ // A concurrent native choice wins: in this file, or in any layer the plan read (a layer appearing, changing,
399
+ // disappearing or becoming unreadable counts).
400
+ if (this.fs.readFile(configPath) !== before || !isDeepStrictEqual(readLayers(), currentLayers))
401
+ return;
384
402
  if (content !== before)
385
403
  this.fs.writeFile(configPath, content);
386
404
  recordOwnedCodexApproval(configPath, planned.approval);
@@ -821,6 +839,39 @@ export class CodexRuntimeAdapter {
821
839
  }
822
840
  return { delivered, failed, ...(warnings.length ? { warnings } : {}) };
823
841
  }
842
+ /** No managed config writes, pane input, termination or bindings change here. */
843
+ async preflightLaunch(binding) {
844
+ const decision = await this.checkFilesystemPolicy(binding);
845
+ if (!decision)
846
+ return { ok: true };
847
+ if (!decision.ok)
848
+ return decision;
849
+ const profile = await this.checkProfileLoad(binding);
850
+ if (!profile.ok)
851
+ return profile;
852
+ this.filesystemPreflight.set(binding, decision);
853
+ return decision.verified ? { ok: true } : { ok: true, warnings: [codexPolicyWarning(decision.reason)] };
854
+ }
855
+ async checkFilesystemPolicy(binding) {
856
+ if (!binding.codexPermissions || !("filesystem" in binding.codexPermissions))
857
+ return undefined;
858
+ try {
859
+ return await this.verifyFilesystemPolicy({ permissions: binding.codexPermissions, cwd: binding.cwd,
860
+ codexHome: this.homeFor(binding), launchPath: this.launchPath, launchWrapper: binding.launchWrapper,
861
+ codexConfigProfile: binding.codexConfigProfile?.trim() || undefined });
862
+ }
863
+ catch {
864
+ return { ok: true, verified: false, reason: "Native Codex configuration reader failed" };
865
+ }
866
+ }
867
+ async checkProfileLoad(binding) {
868
+ const profile = binding.codexConfigProfile?.trim();
869
+ if (!profile)
870
+ return { ok: true };
871
+ const own = this.ownHome(binding);
872
+ const probe = await (own ? this.verifyProfilePreflight(profile, binding.cwd, own) : this.verifyProfilePreflight(profile, binding.cwd));
873
+ return probe.ok ? { ok: true } : { ok: false, error: `${probe.error}${probe.migrationHint ? `\n Fix: ${probe.migrationHint}` : ""}` };
874
+ }
824
875
  async launchHarness(binding, opts) {
825
876
  if (binding.accountHome !== undefined && !this.seatLaunchEnvironment) {
826
877
  return { ok: false, error: "Isolated account-home launch support is unavailable; no agent started." };
@@ -840,6 +891,7 @@ export class CodexRuntimeAdapter {
840
891
  if (!prepared.ok)
841
892
  return prepared;
842
893
  const { modelArg, effortArg, appliedLaunch, postureArg, queueStateDirArg, gitDirArg, seatFolderArg, daemonArg, networkArg, loginShellArg } = prepared;
894
+ const policyNotice = appliedLaunch.reason?.startsWith("policy not verified:") ? { warnings: [appliedLaunch.reason] } : {};
843
895
  // Fork branch: `codex fork <parent_thread_id>`. Captures the NEW thread id
844
896
  // post-fork. Parent thread id is NOT persisted onto the new seat record
845
897
  // (identity-honesty bedrock).
@@ -881,7 +933,7 @@ export class CodexRuntimeAdapter {
881
933
  // without a token and the handover's readiness checks still decide success. Any other fork
882
934
  // keeps its unsent context pending for `rig seat continue`, which verifies the child first.
883
935
  if (opts.forkSource.pendingIdAllowed)
884
- return { ok: true, appliedLaunch };
936
+ return { ok: true, appliedLaunch, ...policyNotice };
885
937
  return {
886
938
  ok: false,
887
939
  error: "codex fork: could not capture new post-fork thread id",
@@ -889,7 +941,7 @@ export class CodexRuntimeAdapter {
889
941
  forkIdentityPending: true,
890
942
  };
891
943
  }
892
- return { ok: true, resumeToken: threadId, resumeType: "codex_id", appliedLaunch };
944
+ return { ok: true, resumeToken: threadId, resumeType: "codex_id", appliedLaunch, ...policyNotice };
893
945
  }
894
946
  // OPR.0.4.8.2: one posture decision (codexPostureArg) for the fresh launch too — YOLO forces
895
947
  // -s danger-full-access (overrides even a named profile); otherwise the named profile, or
@@ -916,16 +968,16 @@ export class CodexRuntimeAdapter {
916
968
  const verification = await this.verifyResumeLaunch(binding.tmuxSession, updatePrompt, { resumeToken: opts.resumeToken, ...this.ownHomeOpt(binding) });
917
969
  if (!verification.ok)
918
970
  return verification;
919
- return { ok: true, resumeToken: opts.resumeToken, resumeType: "codex_id", appliedLaunch,
971
+ return { ok: true, resumeToken: opts.resumeToken, resumeType: "codex_id", appliedLaunch, ...policyNotice,
920
972
  ...(verification.resumedProcess ? { resumedProcess: verification.resumedProcess } : {}) };
921
973
  }
922
974
  const threadId = await this.captureFreshThreadId(binding, updatePrompt);
923
975
  if (updatePrompt.failure)
924
976
  return updatePrompt.failure;
925
977
  if (threadId) {
926
- return { ok: true, resumeToken: threadId, resumeType: "codex_id", appliedLaunch };
978
+ return { ok: true, resumeToken: threadId, resumeType: "codex_id", appliedLaunch, ...policyNotice };
927
979
  }
928
- return { ok: true, appliedLaunch };
980
+ return { ok: true, appliedLaunch, ...policyNotice };
929
981
  }
930
982
  /** The command launchHarness would type to resume `resumeToken`, wrapped in the seat launch environment,
931
983
  * for a caller that runs it itself (a respawned direct-native pane). Nothing is sent to the pane. */
@@ -947,7 +999,8 @@ export class CodexRuntimeAdapter {
947
999
  catch {
948
1000
  return { ok: false, error: "launch_wrapper unavailable; no agent started." };
949
1001
  }
950
- return { ok: true, command, core, appliedLaunch: prepared.appliedLaunch };
1002
+ return { ok: true, command, core, appliedLaunch: prepared.appliedLaunch,
1003
+ ...(prepared.appliedLaunch.reason?.startsWith("policy not verified:") ? { warnings: [prepared.appliedLaunch.reason] } : {}) };
951
1004
  }
952
1005
  /** Type a command buildResumeCommand built into the pane's shell, then verify the resume as launchHarness
953
1006
  * does. Nothing is prepared again, so the command runs exactly as it was built and checked. */
@@ -1000,6 +1053,11 @@ export class CodexRuntimeAdapter {
1000
1053
  /** Launch flags shared by fresh, fork and resume, decided once per launch. With `running`, the probed and
1001
1054
  * prepared parts come from the running Codex instead, and no Codex process is started to decide them. */
1002
1055
  async prepareLaunch(binding, name, running, opts) {
1056
+ const checkedBeforeCutover = this.filesystemPreflight.get(binding);
1057
+ const decision = checkedBeforeCutover ?? await this.checkFilesystemPolicy(binding);
1058
+ this.filesystemPreflight.delete(binding);
1059
+ if (decision && !decision.ok)
1060
+ return decision;
1003
1061
  // The config write and, for a seat that selected openrig-core, its install run as one step under the config lock, so
1004
1062
  // concurrent launches never interleave them. An unselected seat's launch never installs.
1005
1063
  // A seat with its own CODEX_HOME gets OpenRig's managed config (hooks, feature flag) and plugin in that home.
@@ -1022,44 +1080,43 @@ export class CodexRuntimeAdapter {
1022
1080
  const effortArg = effort ? ` -c ${shellQuote(`model_reasoning_effort="${effort}"`)}` : "";
1023
1081
  const profile = binding.codexConfigProfile?.trim();
1024
1082
  const profileArg = profile ? ` -p ${shellQuote(profile)}` : "";
1025
- // A handover rebuild's observed predecessor envelope, else the seat's own envelope, replaces the posture decision.
1026
- const memberEnvelope = binding.codexRebuildPermissions || !binding.codexPermissions ? undefined : codexMemberEnvelope(binding.codexPermissions);
1027
- const envelope = binding.codexRebuildPermissions ?? memberEnvelope;
1028
- const posture = envelope
1083
+ const filesystemPermissions = binding.codexPermissions && "filesystem" in binding.codexPermissions ? binding.codexPermissions : undefined;
1084
+ // An authored filesystem policy always wins over a stale observed legacy envelope. Legacy rebuilds keep their carry behavior.
1085
+ const memberChoice = binding.codexPermissions && (!binding.codexRebuildPermissions || filesystemPermissions) ? codexMemberLaunch(binding.codexPermissions) : undefined;
1086
+ const envelope = memberChoice ? undefined : binding.codexRebuildPermissions;
1087
+ const posture = memberChoice ? profileArg + memberChoice.args : envelope
1029
1088
  ? profileArg + codexEnvelopeArgs(envelope)
1030
1089
  : codexPostureArg(profileArg, process.env, binding.launchPosture);
1031
- const appliedLaunch = envelope ? observeCodexEnvelope(envelope) : observeCodexSandbox(posture);
1090
+ const appliedLaunch = memberChoice?.observation ?? (envelope ? observeCodexEnvelope(envelope) : observeCodexSandbox(posture));
1091
+ if (decision && !decision.verified)
1092
+ appliedLaunch.reason = codexPolicyWarning(decision.reason);
1032
1093
  // The seat's envelope is not full access, so a policy's full_bypass extras don't follow it.
1033
- const postureArg = posture + operationalLaunchArg(this.runtime, memberEnvelope ? { ...binding, kernelAuthority: false, launchPosture: undefined } : binding);
1094
+ const postureArg = posture + operationalLaunchArg(this.runtime, memberChoice ? { ...binding, kernelAuthority: false, launchPosture: undefined } : binding);
1034
1095
  if (running) {
1035
1096
  // The running Codex already loaded its profile; drift in -p is the caller's to compare.
1036
1097
  // Its own --add-dirs, git dirs included, carry over as they ran; none are resolved again. They follow the
1037
1098
  // conversation id, as on every resume, so the resume proof reads the id even when a dir has a space.
1038
1099
  return { ok: true, model, modelArg, effort, effortArg, profile, appliedLaunch, postureArg,
1039
1100
  queueStateDirArg: "",
1040
- gitDirArg: running.addDirs.map((dir) => ` --add-dir ${shellQuote(dir)}`).join(""),
1101
+ gitDirArg: (filesystemPermissions ? [] : running.addDirs).map((dir) => ` --add-dir ${shellQuote(dir)}`).join(""),
1041
1102
  seatFolderArg: "",
1042
1103
  daemonOptOut: running.daemonOptOut, daemonArg: running.daemonOptOut ? " --no-daemon" : "",
1043
- networkArg: running.networkOverride ? ` -c ${shellQuote(CODEX_NETWORK_DEFAULT_OVERRIDE)}` : "",
1104
+ networkArg: !filesystemPermissions && running.networkOverride ? ` -c ${shellQuote(CODEX_NETWORK_DEFAULT_OVERRIDE)}` : "",
1044
1105
  loginShellArg: running.nonLoginShell ? codexNonLoginShellArg : "" };
1045
1106
  }
1046
1107
  // OPR.0.3.4.7 — profile-LOAD probe before launch/resume. A legacy
1047
1108
  // [profiles.<name>] table or invalid TOML must fail BEFORE the opaque
1048
1109
  // `codex -p <profile> resume` failure. An absent .config.toml passes
1049
1110
  // (Codex default-layers it; advisor Option B).
1050
- if (profile) {
1051
- const probeResult = await (own ? this.verifyProfilePreflight(profile, binding.cwd, own) : this.verifyProfilePreflight(profile, binding.cwd));
1052
- if (!probeResult.ok) {
1053
- return {
1054
- ok: false,
1055
- error: `${probeResult.error}${probeResult.migrationHint ? `\n Fix: ${probeResult.migrationHint}` : ""}`,
1056
- };
1057
- }
1111
+ if (profile && !checkedBeforeCutover) {
1112
+ const loaded = await this.checkProfileLoad(binding);
1113
+ if (!loaded.ok)
1114
+ return loaded;
1058
1115
  }
1059
1116
  // Codex rejects writable --add-dir roots under a read-only sandbox. Only
1060
1117
  // suppress OpenRig's generated roots when later project layers cannot make it writable.
1061
1118
  // A seat envelope states its sandbox: read-only gets no generated roots; workspace-write keeps them.
1062
- const suppressAutoAddDirs = memberEnvelope ? memberEnvelope.sandboxPolicy.type === "read-only"
1119
+ const suppressAutoAddDirs = memberChoice ? memberChoice.suppressAutoAddDirs
1063
1120
  : Boolean(!binding.codexRebuildPermissions && profile && posture === profileArg && this.profileRemainsReadOnly(profile, binding.cwd, home));
1064
1121
  // Issue #121: fresh, resume and fork get the same git metadata dirs, so a restored or forked seat can still commit.
1065
1122
  // A rebuild keeps the writable roots its observed envelope names instead.
@@ -1068,7 +1125,7 @@ export class CodexRuntimeAdapter {
1068
1125
  // The seat's own topology folder, so it can keep its LEARNED.md and recap: the same launches and the same suppression.
1069
1126
  const seatFolder = binding.codexRebuildPermissions || suppressAutoAddDirs ? undefined : this.prepareSeatFolder?.(name);
1070
1127
  const seatFolderArg = seatFolder ? ` --add-dir ${shellQuote(seatFolder)}` : "";
1071
- const teamWorkspaceArg = !envelope && binding.teamPermissionDefault && !profile
1128
+ const teamWorkspaceArg = !memberChoice && !envelope && binding.teamPermissionDefault && !profile
1072
1129
  && appliedLaunch.state === "observed" && appliedLaunch.value === "workspace-write"
1073
1130
  ? codexTeamWorkspaceArg(this.prepareTeamWorkspace, name) : "";
1074
1131
  const queueStateDirArg = binding.codexRebuildPermissions || suppressAutoAddDirs
@@ -1082,7 +1139,7 @@ export class CodexRuntimeAdapter {
1082
1139
  const daemonOptOut = daemonSupport?.kind === "supported";
1083
1140
  const daemonArg = daemonOptOut ? " --no-daemon" : "";
1084
1141
  // #275: on the plain floor, network access unless Codex reports an opt-out or policy. An envelope states its own.
1085
- const networkArg = envelope ? ""
1142
+ const networkArg = memberChoice || envelope ? ""
1086
1143
  : await codexNetworkDefaultArg(own && this.readNetworkDefault ? ((cwd) => this.readNetworkDefault(cwd, own)) : this.readNetworkDefault, appliedLaunch, binding.cwd, name);
1087
1144
  // The launch facts keep the probed daemon choice, so a printed recovery command can repeat it; no probe, no fact.
1088
1145
  const launchFacts = daemonSupport ? { ...appliedLaunch, daemonOptOut } : appliedLaunch;