oh-my-codex 0.21.0 → 0.21.2

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 (346) hide show
  1. package/Cargo.toml +1 -1
  2. package/README.md +4 -2
  3. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts +2 -0
  4. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts.map +1 -0
  5. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js +592 -0
  6. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js.map +1 -0
  7. package/dist/cli/__tests__/detached-leader-teardown.test.js +270 -33
  8. package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -1
  9. package/dist/cli/__tests__/doctor-warning-copy.test.js +133 -5
  10. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  11. package/dist/cli/__tests__/index.test.js +543 -2
  12. package/dist/cli/__tests__/index.test.js.map +1 -1
  13. package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts +2 -0
  14. package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts.map +1 -0
  15. package/dist/cli/__tests__/issue-windows-cancel-identity.test.js +17 -0
  16. package/dist/cli/__tests__/issue-windows-cancel-identity.test.js.map +1 -0
  17. package/dist/cli/__tests__/launch-fallback.test.js +15 -3
  18. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  19. package/dist/cli/__tests__/package-bin-contract.test.js +20 -0
  20. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
  21. package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts +2 -0
  22. package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts.map +1 -0
  23. package/dist/cli/__tests__/plugin-cache-stale-lock.test.js +76 -0
  24. package/dist/cli/__tests__/plugin-cache-stale-lock.test.js.map +1 -0
  25. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts +2 -0
  26. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts.map +1 -0
  27. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js +1662 -0
  28. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js.map +1 -0
  29. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts +2 -0
  30. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts.map +1 -0
  31. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js +522 -0
  32. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js.map +1 -0
  33. package/dist/cli/__tests__/ralplan-advisory.test.d.ts +2 -0
  34. package/dist/cli/__tests__/ralplan-advisory.test.d.ts.map +1 -0
  35. package/dist/cli/__tests__/ralplan-advisory.test.js +301 -0
  36. package/dist/cli/__tests__/ralplan-advisory.test.js.map +1 -0
  37. package/dist/cli/__tests__/ralplan.test.js +39 -0
  38. package/dist/cli/__tests__/ralplan.test.js.map +1 -1
  39. package/dist/cli/__tests__/resume.test.js +81 -6
  40. package/dist/cli/__tests__/resume.test.js.map +1 -1
  41. package/dist/cli/__tests__/session-scoped-runtime.test.js +423 -4
  42. package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
  43. package/dist/cli/__tests__/setup-install-mode.test.js +60 -3
  44. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  45. package/dist/cli/__tests__/setup-refresh.test.js +9 -0
  46. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
  47. package/dist/cli/__tests__/sparkshell-cli.test.js +4 -0
  48. package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
  49. package/dist/cli/__tests__/ultragoal.test.js +71 -0
  50. package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
  51. package/dist/cli/__tests__/windows-popup-loop-contract.test.js +30 -4
  52. package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
  53. package/dist/cli/doctor.d.ts.map +1 -1
  54. package/dist/cli/doctor.js +57 -8
  55. package/dist/cli/doctor.js.map +1 -1
  56. package/dist/cli/index.d.ts +113 -7
  57. package/dist/cli/index.d.ts.map +1 -1
  58. package/dist/cli/index.js +1850 -185
  59. package/dist/cli/index.js.map +1 -1
  60. package/dist/cli/native-assets.d.ts +2 -1
  61. package/dist/cli/native-assets.d.ts.map +1 -1
  62. package/dist/cli/native-assets.js +7 -7
  63. package/dist/cli/native-assets.js.map +1 -1
  64. package/dist/cli/plugin-marketplace.d.ts +89 -4
  65. package/dist/cli/plugin-marketplace.d.ts.map +1 -1
  66. package/dist/cli/plugin-marketplace.js +2135 -118
  67. package/dist/cli/plugin-marketplace.js.map +1 -1
  68. package/dist/cli/ralplan.d.ts +2 -1
  69. package/dist/cli/ralplan.d.ts.map +1 -1
  70. package/dist/cli/ralplan.js +149 -9
  71. package/dist/cli/ralplan.js.map +1 -1
  72. package/dist/cli/setup.d.ts.map +1 -1
  73. package/dist/cli/setup.js +7 -1
  74. package/dist/cli/setup.js.map +1 -1
  75. package/dist/cli/sparkshell.d.ts.map +1 -1
  76. package/dist/cli/sparkshell.js +9 -10
  77. package/dist/cli/sparkshell.js.map +1 -1
  78. package/dist/cli/update-worker.js +9 -0
  79. package/dist/cli/update-worker.js.map +1 -1
  80. package/dist/cli/update.d.ts +1 -0
  81. package/dist/cli/update.d.ts.map +1 -1
  82. package/dist/cli/update.js +9 -0
  83. package/dist/cli/update.js.map +1 -1
  84. package/dist/config/__tests__/generator-idempotent.test.js +118 -0
  85. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  86. package/dist/config/generator.d.ts.map +1 -1
  87. package/dist/config/generator.js +74 -4
  88. package/dist/config/generator.js.map +1 -1
  89. package/dist/hooks/__tests__/keyword-detector.test.js +74 -0
  90. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  91. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts +2 -0
  92. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts.map +1 -0
  93. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js +250 -0
  94. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js.map +1 -0
  95. package/dist/hooks/__tests__/session.test.js +10 -1
  96. package/dist/hooks/__tests__/session.test.js.map +1 -1
  97. package/dist/hooks/keyword-detector.d.ts +8 -1
  98. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  99. package/dist/hooks/keyword-detector.js +130 -9
  100. package/dist/hooks/keyword-detector.js.map +1 -1
  101. package/dist/hooks/session.d.ts +5 -0
  102. package/dist/hooks/session.d.ts.map +1 -1
  103. package/dist/hooks/session.js +17 -3
  104. package/dist/hooks/session.js.map +1 -1
  105. package/dist/hud/__tests__/index.test.js +16 -1
  106. package/dist/hud/__tests__/index.test.js.map +1 -1
  107. package/dist/hud/__tests__/reconcile.test.js +134 -7
  108. package/dist/hud/__tests__/reconcile.test.js.map +1 -1
  109. package/dist/hud/__tests__/render.test.js +57 -0
  110. package/dist/hud/__tests__/render.test.js.map +1 -1
  111. package/dist/hud/__tests__/session-attached.test.d.ts +2 -0
  112. package/dist/hud/__tests__/session-attached.test.d.ts.map +1 -0
  113. package/dist/hud/__tests__/session-attached.test.js +82 -0
  114. package/dist/hud/__tests__/session-attached.test.js.map +1 -0
  115. package/dist/hud/__tests__/state.test.js +94 -2
  116. package/dist/hud/__tests__/state.test.js.map +1 -1
  117. package/dist/hud/__tests__/tmux-split-realtmux.test.js +169 -2
  118. package/dist/hud/__tests__/tmux-split-realtmux.test.js.map +1 -1
  119. package/dist/hud/__tests__/tmux.test.js +104 -22
  120. package/dist/hud/__tests__/tmux.test.js.map +1 -1
  121. package/dist/hud/__tests__/types.test.js +9 -0
  122. package/dist/hud/__tests__/types.test.js.map +1 -1
  123. package/dist/hud/__tests__/watch-detached.test.d.ts +2 -0
  124. package/dist/hud/__tests__/watch-detached.test.d.ts.map +1 -0
  125. package/dist/hud/__tests__/watch-detached.test.js +383 -0
  126. package/dist/hud/__tests__/watch-detached.test.js.map +1 -0
  127. package/dist/hud/__tests__/watch-realtmux.test.d.ts +2 -0
  128. package/dist/hud/__tests__/watch-realtmux.test.d.ts.map +1 -0
  129. package/dist/hud/__tests__/watch-realtmux.test.js +322 -0
  130. package/dist/hud/__tests__/watch-realtmux.test.js.map +1 -0
  131. package/dist/hud/index.d.ts +3 -0
  132. package/dist/hud/index.d.ts.map +1 -1
  133. package/dist/hud/index.js +98 -20
  134. package/dist/hud/index.js.map +1 -1
  135. package/dist/hud/reconcile.d.ts.map +1 -1
  136. package/dist/hud/reconcile.js +68 -24
  137. package/dist/hud/reconcile.js.map +1 -1
  138. package/dist/hud/render.d.ts.map +1 -1
  139. package/dist/hud/render.js +20 -0
  140. package/dist/hud/render.js.map +1 -1
  141. package/dist/hud/session-attached.d.ts +15 -0
  142. package/dist/hud/session-attached.d.ts.map +1 -0
  143. package/dist/hud/session-attached.js +47 -0
  144. package/dist/hud/session-attached.js.map +1 -0
  145. package/dist/hud/state.d.ts +9 -1
  146. package/dist/hud/state.d.ts.map +1 -1
  147. package/dist/hud/state.js +140 -3
  148. package/dist/hud/state.js.map +1 -1
  149. package/dist/hud/tmux.d.ts +4 -0
  150. package/dist/hud/tmux.d.ts.map +1 -1
  151. package/dist/hud/tmux.js +86 -23
  152. package/dist/hud/tmux.js.map +1 -1
  153. package/dist/hud/types.d.ts +20 -0
  154. package/dist/hud/types.d.ts.map +1 -1
  155. package/dist/hud/types.js +3 -0
  156. package/dist/hud/types.js.map +1 -1
  157. package/dist/modes/base.d.ts +15 -2
  158. package/dist/modes/base.d.ts.map +1 -1
  159. package/dist/modes/base.js +105 -16
  160. package/dist/modes/base.js.map +1 -1
  161. package/dist/question/autopilot-wait.js +2 -2
  162. package/dist/question/autopilot-wait.js.map +1 -1
  163. package/dist/question/deep-interview.js +2 -2
  164. package/dist/question/deep-interview.js.map +1 -1
  165. package/dist/ralplan/__tests__/advisory-activation.test.d.ts +2 -0
  166. package/dist/ralplan/__tests__/advisory-activation.test.d.ts.map +1 -0
  167. package/dist/ralplan/__tests__/advisory-activation.test.js +700 -0
  168. package/dist/ralplan/__tests__/advisory-activation.test.js.map +1 -0
  169. package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts +2 -0
  170. package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts.map +1 -0
  171. package/dist/ralplan/__tests__/advisory-detached-transition.test.js +88 -0
  172. package/dist/ralplan/__tests__/advisory-detached-transition.test.js.map +1 -0
  173. package/dist/ralplan/__tests__/advisory.test.d.ts +2 -0
  174. package/dist/ralplan/__tests__/advisory.test.d.ts.map +1 -0
  175. package/dist/ralplan/__tests__/advisory.test.js +1087 -0
  176. package/dist/ralplan/__tests__/advisory.test.js.map +1 -0
  177. package/dist/ralplan/__tests__/runtime.test.js +416 -7
  178. package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
  179. package/dist/ralplan/advisory-activation-verifier.d.ts +19 -0
  180. package/dist/ralplan/advisory-activation-verifier.d.ts.map +1 -0
  181. package/dist/ralplan/advisory-activation-verifier.js +77 -0
  182. package/dist/ralplan/advisory-activation-verifier.js.map +1 -0
  183. package/dist/ralplan/advisory-activation.d.ts +34 -0
  184. package/dist/ralplan/advisory-activation.d.ts.map +1 -0
  185. package/dist/ralplan/advisory-activation.js +205 -0
  186. package/dist/ralplan/advisory-activation.js.map +1 -0
  187. package/dist/ralplan/advisory-contract.d.ts +103 -0
  188. package/dist/ralplan/advisory-contract.d.ts.map +1 -0
  189. package/dist/ralplan/advisory-contract.js +83 -0
  190. package/dist/ralplan/advisory-contract.js.map +1 -0
  191. package/dist/ralplan/advisory-detached-transition.d.ts +11 -0
  192. package/dist/ralplan/advisory-detached-transition.d.ts.map +1 -0
  193. package/dist/ralplan/advisory-detached-transition.js +21 -0
  194. package/dist/ralplan/advisory-detached-transition.js.map +1 -0
  195. package/dist/ralplan/advisory-evidence.d.ts +91 -0
  196. package/dist/ralplan/advisory-evidence.d.ts.map +1 -0
  197. package/dist/ralplan/advisory-evidence.js +393 -0
  198. package/dist/ralplan/advisory-evidence.js.map +1 -0
  199. package/dist/ralplan/advisory-lifecycle-validation.d.ts +11 -0
  200. package/dist/ralplan/advisory-lifecycle-validation.d.ts.map +1 -0
  201. package/dist/ralplan/advisory-lifecycle-validation.js +72 -0
  202. package/dist/ralplan/advisory-lifecycle-validation.js.map +1 -0
  203. package/dist/ralplan/advisory-postconditions.d.ts +3 -0
  204. package/dist/ralplan/advisory-postconditions.d.ts.map +1 -0
  205. package/dist/ralplan/advisory-postconditions.js +33 -0
  206. package/dist/ralplan/advisory-postconditions.js.map +1 -0
  207. package/dist/ralplan/advisory-recovery-journal.d.ts +56 -0
  208. package/dist/ralplan/advisory-recovery-journal.d.ts.map +1 -0
  209. package/dist/ralplan/advisory-recovery-journal.js +136 -0
  210. package/dist/ralplan/advisory-recovery-journal.js.map +1 -0
  211. package/dist/ralplan/advisory-storage.d.ts +24 -0
  212. package/dist/ralplan/advisory-storage.d.ts.map +1 -0
  213. package/dist/ralplan/advisory-storage.js +106 -0
  214. package/dist/ralplan/advisory-storage.js.map +1 -0
  215. package/dist/ralplan/advisory.d.ts +99 -0
  216. package/dist/ralplan/advisory.d.ts.map +1 -0
  217. package/dist/ralplan/advisory.js +914 -0
  218. package/dist/ralplan/advisory.js.map +1 -0
  219. package/dist/ralplan/documented-leader-preflight.d.ts +8 -0
  220. package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -1
  221. package/dist/ralplan/documented-leader-preflight.js +60 -2
  222. package/dist/ralplan/documented-leader-preflight.js.map +1 -1
  223. package/dist/ralplan/runtime-advisory-lifecycle.d.ts +74 -0
  224. package/dist/ralplan/runtime-advisory-lifecycle.d.ts.map +1 -0
  225. package/dist/ralplan/runtime-advisory-lifecycle.js +352 -0
  226. package/dist/ralplan/runtime-advisory-lifecycle.js.map +1 -0
  227. package/dist/ralplan/runtime-contract.d.ts +126 -0
  228. package/dist/ralplan/runtime-contract.d.ts.map +1 -0
  229. package/dist/ralplan/runtime-contract.js +2 -0
  230. package/dist/ralplan/runtime-contract.js.map +1 -0
  231. package/dist/ralplan/runtime.d.ts +6 -109
  232. package/dist/ralplan/runtime.d.ts.map +1 -1
  233. package/dist/ralplan/runtime.js +174 -56
  234. package/dist/ralplan/runtime.js.map +1 -1
  235. package/dist/scripts/__tests__/postinstall.test.js +26 -0
  236. package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
  237. package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts +2 -0
  238. package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts.map +1 -0
  239. package/dist/scripts/__tests__/ralplan-advisory-hook.test.js +299 -0
  240. package/dist/scripts/__tests__/ralplan-advisory-hook.test.js.map +1 -0
  241. package/dist/scripts/__tests__/smoke-packed-install.test.js +102 -8
  242. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
  243. package/dist/scripts/codex-native-hook.d.ts +20 -0
  244. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  245. package/dist/scripts/codex-native-hook.js +226 -15
  246. package/dist/scripts/codex-native-hook.js.map +1 -1
  247. package/dist/scripts/postinstall.d.ts +7 -0
  248. package/dist/scripts/postinstall.d.ts.map +1 -1
  249. package/dist/scripts/postinstall.js +40 -0
  250. package/dist/scripts/postinstall.js.map +1 -1
  251. package/dist/scripts/smoke-packed-install.d.ts +21 -5
  252. package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
  253. package/dist/scripts/smoke-packed-install.js +157 -57
  254. package/dist/scripts/smoke-packed-install.js.map +1 -1
  255. package/dist/state/__tests__/mode-binding-lease.test.d.ts +2 -0
  256. package/dist/state/__tests__/mode-binding-lease.test.d.ts.map +1 -0
  257. package/dist/state/__tests__/mode-binding-lease.test.js +498 -0
  258. package/dist/state/__tests__/mode-binding-lease.test.js.map +1 -0
  259. package/dist/state/__tests__/operations.test.js +1 -0
  260. package/dist/state/__tests__/operations.test.js.map +1 -1
  261. package/dist/state/__tests__/pinned-atomic-file.test.d.ts +2 -0
  262. package/dist/state/__tests__/pinned-atomic-file.test.d.ts.map +1 -0
  263. package/dist/state/__tests__/pinned-atomic-file.test.js +438 -0
  264. package/dist/state/__tests__/pinned-atomic-file.test.js.map +1 -0
  265. package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts +2 -0
  266. package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts.map +1 -0
  267. package/dist/state/__tests__/skill-active-exact-session-transaction.test.js +179 -0
  268. package/dist/state/__tests__/skill-active-exact-session-transaction.test.js.map +1 -0
  269. package/dist/state/__tests__/skill-active.test.js +29 -1
  270. package/dist/state/__tests__/skill-active.test.js.map +1 -1
  271. package/dist/state/mode-binding-lease-helper.d.ts +2 -0
  272. package/dist/state/mode-binding-lease-helper.d.ts.map +1 -0
  273. package/dist/state/mode-binding-lease-helper.js +623 -0
  274. package/dist/state/mode-binding-lease-helper.js.map +1 -0
  275. package/dist/state/mode-binding-lease.d.ts +25 -0
  276. package/dist/state/mode-binding-lease.d.ts.map +1 -0
  277. package/dist/state/mode-binding-lease.js +380 -0
  278. package/dist/state/mode-binding-lease.js.map +1 -0
  279. package/dist/state/operations.d.ts +29 -1
  280. package/dist/state/operations.d.ts.map +1 -1
  281. package/dist/state/operations.js +203 -122
  282. package/dist/state/operations.js.map +1 -1
  283. package/dist/state/pinned-atomic-file-darwin-client.d.ts +34 -0
  284. package/dist/state/pinned-atomic-file-darwin-client.d.ts.map +1 -0
  285. package/dist/state/pinned-atomic-file-darwin-client.js +174 -0
  286. package/dist/state/pinned-atomic-file-darwin-client.js.map +1 -0
  287. package/dist/state/pinned-atomic-file-darwin-helper.d.ts +2 -0
  288. package/dist/state/pinned-atomic-file-darwin-helper.d.ts.map +1 -0
  289. package/dist/state/pinned-atomic-file-darwin-helper.js +275 -0
  290. package/dist/state/pinned-atomic-file-darwin-helper.js.map +1 -0
  291. package/dist/state/pinned-atomic-file-darwin-janitor.d.ts +2 -0
  292. package/dist/state/pinned-atomic-file-darwin-janitor.d.ts.map +1 -0
  293. package/dist/state/pinned-atomic-file-darwin-janitor.js +272 -0
  294. package/dist/state/pinned-atomic-file-darwin-janitor.js.map +1 -0
  295. package/dist/state/pinned-atomic-file.d.ts +29 -0
  296. package/dist/state/pinned-atomic-file.d.ts.map +1 -0
  297. package/dist/state/pinned-atomic-file.js +536 -0
  298. package/dist/state/pinned-atomic-file.js.map +1 -0
  299. package/dist/state/process-identity.d.ts +30 -0
  300. package/dist/state/process-identity.d.ts.map +1 -0
  301. package/dist/state/process-identity.js +99 -0
  302. package/dist/state/process-identity.js.map +1 -0
  303. package/dist/state/skill-active.d.ts +18 -1
  304. package/dist/state/skill-active.d.ts.map +1 -1
  305. package/dist/state/skill-active.js +82 -5
  306. package/dist/state/skill-active.js.map +1 -1
  307. package/dist/state/workflow-transition-reconcile.js +1 -1
  308. package/dist/state/workflow-transition-reconcile.js.map +1 -1
  309. package/dist/team/__tests__/tmux-session.test.js +109 -0
  310. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  311. package/dist/team/tmux-session.d.ts.map +1 -1
  312. package/dist/team/tmux-session.js +10 -1
  313. package/dist/team/tmux-session.js.map +1 -1
  314. package/dist/utils/__tests__/file-durability.test.js +20 -0
  315. package/dist/utils/__tests__/file-durability.test.js.map +1 -1
  316. package/dist/utils/file-durability.d.ts +1 -1
  317. package/dist/utils/file-durability.d.ts.map +1 -1
  318. package/dist/utils/file-durability.js.map +1 -1
  319. package/dist/verification/__tests__/ci-rust-gates.test.js +12 -4
  320. package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
  321. package/dist/verification/__tests__/ci-trusted-publish.test.d.ts +2 -0
  322. package/dist/verification/__tests__/ci-trusted-publish.test.d.ts.map +1 -0
  323. package/dist/verification/__tests__/ci-trusted-publish.test.js +205 -0
  324. package/dist/verification/__tests__/ci-trusted-publish.test.js.map +1 -0
  325. package/dist/verification/__tests__/explore-harness-release-workflow.test.js +10 -5
  326. package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
  327. package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts +2 -0
  328. package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts.map +1 -0
  329. package/dist/verification/__tests__/publish-npm-manual-retired.test.js +22 -0
  330. package/dist/verification/__tests__/publish-npm-manual-retired.test.js.map +1 -0
  331. package/package.json +1 -1
  332. package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
  333. package/plugins/oh-my-codex/skills/doctor/SKILL.md +1 -1
  334. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +1 -1
  335. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +10 -1
  336. package/plugins/oh-my-codex/skills/team/SKILL.md +2 -0
  337. package/skills/doctor/SKILL.md +1 -1
  338. package/skills/omx-setup/SKILL.md +1 -1
  339. package/skills/ralplan/SKILL.md +10 -1
  340. package/skills/team/SKILL.md +2 -0
  341. package/src/scripts/__tests__/postinstall.test.ts +28 -0
  342. package/src/scripts/__tests__/ralplan-advisory-hook.test.ts +320 -0
  343. package/src/scripts/__tests__/smoke-packed-install.test.ts +120 -7
  344. package/src/scripts/codex-native-hook.ts +220 -10
  345. package/src/scripts/postinstall.ts +46 -0
  346. package/src/scripts/smoke-packed-install.ts +175 -70
@@ -126,7 +126,7 @@ export const PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS = [
126
126
  { name: 'compact-explicit-negation', prompt: '$ralplan,$autopilot are prohibited', expectedSkill: null, expectedStopBlock: false },
127
127
  { name: 'compact-implicit-negation', prompt: 'Autopilot mode،deep interview are prohibited.', expectedSkill: null, expectedStopBlock: false },
128
128
  { name: 'doc-clause-local-prefix', prompt: '$ralplan; $autopilot is documented in the guide.', expectedSkill: 'ralplan', expectedStopBlock: true },
129
- { name: 'doc-chain-described', prompt: 'use $ralplan is the workflow command; autopilot mode is documented in the guide; $team execute it', expectedSkill: 'team', expectedStopBlock: false, insideTmux: true },
129
+ { name: 'doc-chain-described', prompt: 'use $ralplan is the workflow command; autopilot mode is documented in the guide; $team execute it', expectedSkill: 'team', expectedStopBlock: true, insideTmux: true },
130
130
  { name: 'doc-chain-workflow', prompt: 'use $ralplan is the workflow command; autopilot mode is workflow documentation; use $ralph execute it', expectedSkill: 'ralph', expectedStopBlock: true },
131
131
  { name: 'ref-inline-explicit', prompt: '[docs]: $ralplan\n$autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true },
132
132
  { name: 'ref-inline-prompts', prompt: '[docs]: /prompts:architect\n$autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true },
@@ -152,10 +152,10 @@ export const PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS = [
152
152
  { name: 'neg-fw-dot-reopen', prompt: 'Do not run $ralplan. use $autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true },
153
153
  { name: 'neg-greek-q-reopen', prompt: 'Do not run $ralplan; use $autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true },
154
154
  { name: 'unicode-attached-contrast', prompt: 'Do not use deep interview яbut use autopilot mode.', expectedSkill: null, expectedStopBlock: false },
155
- { name: 'prefix-list-followup', prompt: 'Do not run $ralplan, $autopilot; use $team execute it', expectedSkill: 'team', expectedStopBlock: false, insideTmux: true },
155
+ { name: 'prefix-list-followup', prompt: 'Do not run $ralplan, $autopilot; use $team execute it', expectedSkill: 'team', expectedStopBlock: true, insideTmux: true },
156
156
  { name: 'mixed-postposed-chain', prompt: '$ralplan, autopilot mode, $team are prohibited.', expectedSkill: null, expectedStopBlock: false },
157
- { name: 'implicit-first-doc-chain', prompt: 'Autopilot mode and $ralplan are workflow commands; use $team execute it', expectedSkill: 'team', expectedStopBlock: false, insideTmux: true },
158
- { name: 'both-mixed-doc-followup', prompt: 'Both autopilot mode and $ralplan are workflow commands; use $team execute it', expectedSkill: 'team', expectedStopBlock: false, insideTmux: true },
157
+ { name: 'implicit-first-doc-chain', prompt: 'Autopilot mode and $ralplan are workflow commands; use $team execute it', expectedSkill: 'team', expectedStopBlock: true, insideTmux: true },
158
+ { name: 'both-mixed-doc-followup', prompt: 'Both autopilot mode and $ralplan are workflow commands; use $team execute it', expectedSkill: 'team', expectedStopBlock: true, insideTmux: true },
159
159
  { name: 'doc-semicolon-preserves-earlier', prompt: 'Use autopilot mode; use $ralplan is the workflow command.', expectedSkill: 'autopilot', expectedStopBlock: true },
160
160
  { name: 'doc-independent-comma', prompt: 'Use autopilot mode, and $ralplan is documented in the guide.', expectedSkill: 'autopilot', expectedStopBlock: true },
161
161
  { name: 'reference-unclosed-quote-destination', prompt: '[docs]: "target\n$autopilot build it', expectedSkill: null, expectedStopBlock: false },
@@ -203,7 +203,7 @@ export const PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS = [
203
203
  { name: 'percent-suffix', prompt: '$ralplan%docs', expectedSkill: null, expectedStopBlock: false },
204
204
  { name: 'fullwidth-percent-suffix', prompt: '$ralplan%docs', expectedSkill: null, expectedStopBlock: false },
205
205
  { name: 'g1a-ordered-multi-skill', prompt: '$ralplan, $autopilot; $team', expectedSkill: 'ralplan', expectedStopBlock: true, expectedDeferredSkills: ['autopilot', 'team'], expectedActiveSkills: ['ralplan'], insideTmux: true },
206
- { name: 'g1c-duplicate-alias', prompt: '$autopilot $oh-my-codex:autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true, expectedDeferredSkills: [], expectedActiveSkills: [] },
206
+ { name: 'g1c-duplicate-alias', prompt: '$autopilot $oh-my-codex:autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true, expectedDeferredSkills: [], expectedActiveSkills: ['autopilot'] },
207
207
  { name: 'b3-longer-valid-fence', prompt: '```text\n$autopilot build it\n````\n$ralplan plan it', expectedSkill: 'ralplan', expectedStopBlock: true },
208
208
  { name: 'b4-shorter-invalid-fence', prompt: '````text\n$autopilot build it\n```\n$ralplan plan it', expectedSkill: null, expectedStopBlock: false },
209
209
  { name: 'b5-different-marker-invalid-fence', prompt: '```text\n$autopilot build it\n~~~\n$ralplan plan it', expectedSkill: null, expectedStopBlock: false },
@@ -211,8 +211,29 @@ export const PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS = [
211
211
 
212
212
  export function assertPackedRegressionWorkflowState(
213
213
  testCase: { readonly name: string; readonly expectedSkill: string },
214
- skillState: { readonly active?: boolean; readonly skill?: string; readonly phase?: string; readonly error?: string; readonly active_skills?: readonly unknown[] },
214
+ skillState: {
215
+ readonly active?: boolean;
216
+ readonly skill?: string;
217
+ readonly phase?: string;
218
+ readonly error?: string;
219
+ readonly transition_error?: string;
220
+ readonly active_skills?: readonly unknown[];
221
+ },
215
222
  ): void {
223
+ // `$ralph` is a retired skill token in 0.21.0. UserPromptSubmit must leave a
224
+ // durable failed sunset receipt instead of activating the legacy workflow.
225
+ if (testCase.expectedSkill === 'ralph') {
226
+ const sunsetError = skillState.transition_error ?? skillState.error ?? '';
227
+ if (
228
+ skillState.active !== false
229
+ || skillState.skill !== 'ralph'
230
+ || skillState.phase !== 'failed'
231
+ || !sunsetError.includes('Skill "$ralph" has been removed. Use "$ultragoal" instead.')
232
+ ) {
233
+ throw new Error(`packed regression ${testCase.name} persisted unexpected retired ralph state`);
234
+ }
235
+ return;
236
+ }
216
237
  const matchesExpectedState = skillState.active === true && skillState.skill === testCase.expectedSkill;
217
238
  if (!matchesExpectedState) {
218
239
  throw new Error(`packed regression ${testCase.name} persisted unexpected workflow state`);
@@ -222,7 +243,9 @@ export function assertPackedRegressionWorkflowState(
222
243
  export function shouldPackedRegressionStopBlock(
223
244
  testCase: { readonly expectedSkill: string | null; readonly expectedStopBlock: boolean },
224
245
  ): boolean {
225
- return testCase.expectedStopBlock;
246
+ // A retired `$ralph` prompt records a terminal sunset receipt and must not
247
+ // prevent Stop from completing.
248
+ return testCase.expectedSkill !== 'ralph' && testCase.expectedStopBlock;
226
249
  }
227
250
 
228
251
  export function buildPackedRegressionEnvironment(
@@ -2295,19 +2318,95 @@ function parseNativeHookSmokeOutput(probe: string, stdout: string): Record<strin
2295
2318
  return parsed as Record<string, unknown>;
2296
2319
  }
2297
2320
 
2298
- function requireNativeHookPermissionDeny(probe: string, output: Record<string, unknown>, reason: RegExp): void {
2299
- const hookSpecificOutput = output.hookSpecificOutput;
2300
- if (!hookSpecificOutput || typeof hookSpecificOutput !== 'object' || Array.isArray(hookSpecificOutput)) {
2301
- throw new Error(`native hook ${probe} did not emit hookSpecificOutput`);
2321
+ /**
2322
+ * #3497/#3481 contract: PreToolUse is advisory-only. Former conductor/planning
2323
+ * hard-gate deny probes now pin the advisory surface instead. Accepts the two
2324
+ * documented advisory shapes (empty no-op output, or systemMessage plus optional
2325
+ * PreToolUse additionalContext) and rejects anything that would hide a real
2326
+ * regression: a hard block, stopped continuation, a stopReason, any
2327
+ * permissionDecision (deny or allow), or unexpected/malformed fields.
2328
+ */
2329
+ export function assertNativeHookAdvisoryPreToolUse(
2330
+ probe: string,
2331
+ output: Record<string, unknown>,
2332
+ ): void {
2333
+ if (output.decision === 'block') {
2334
+ throw new Error(`native hook ${probe} emitted a hard block; PreToolUse is advisory-only`);
2335
+ }
2336
+ if (output.continue === false) {
2337
+ throw new Error(`native hook ${probe} stopped continuation; PreToolUse is advisory-only`);
2338
+ }
2339
+ if (output.decision !== undefined || output.continue !== undefined) {
2340
+ throw new Error(`native hook ${probe} emitted an unexpected decision/continue shape`);
2341
+ }
2342
+ if (output.stopReason !== undefined) {
2343
+ throw new Error(`native hook ${probe} emitted stopReason ${JSON.stringify(output.stopReason)}`);
2302
2344
  }
2303
- const hookOutput = hookSpecificOutput as Record<string, unknown>;
2304
- if (hookOutput.permissionDecision !== 'deny') {
2305
- throw new Error(`native hook ${probe} did not deny permission`);
2345
+ const systemMessage = output.systemMessage;
2346
+ if (systemMessage !== undefined && (typeof systemMessage !== 'string' || systemMessage.trim() === '')) {
2347
+ throw new Error(`native hook ${probe} emitted a malformed systemMessage`);
2306
2348
  }
2307
- if (!reason.test(String(hookOutput.permissionDecisionReason ?? ''))) {
2308
- throw new Error(`native hook ${probe} denial did not match ${reason.source}`);
2349
+ const hasHookSpecificOutput = output.hookSpecificOutput !== undefined;
2350
+ const hookOutput = !hasHookSpecificOutput
2351
+ ? {}
2352
+ : (typeof output.hookSpecificOutput === 'object' && output.hookSpecificOutput !== null && !Array.isArray(output.hookSpecificOutput))
2353
+ ? output.hookSpecificOutput as Record<string, unknown>
2354
+ : null;
2355
+ if (hookOutput === null) {
2356
+ throw new Error(`native hook ${probe} emitted a malformed hookSpecificOutput`);
2357
+ }
2358
+ if (hookOutput.permissionDecision !== undefined) {
2359
+ throw new Error(
2360
+ `native hook ${probe} emitted permissionDecision ${JSON.stringify(hookOutput.permissionDecision)}; PreToolUse is advisory-only`,
2361
+ );
2362
+ }
2363
+ if (hookOutput.hookEventName !== undefined && hookOutput.hookEventName !== 'PreToolUse') {
2364
+ throw new Error(`native hook ${probe} hookSpecificOutput names ${JSON.stringify(hookOutput.hookEventName)}`);
2365
+ }
2366
+ for (const key of Object.keys(output)) {
2367
+ if (key !== 'systemMessage' && key !== 'hookSpecificOutput') {
2368
+ throw new Error(`native hook ${probe} emitted unexpected top-level field ${JSON.stringify(key)}`);
2369
+ }
2370
+ }
2371
+ for (const key of Object.keys(hookOutput)) {
2372
+ if (key !== 'hookEventName' && key !== 'additionalContext') {
2373
+ throw new Error(`native hook ${probe} hookSpecificOutput emitted unexpected field ${JSON.stringify(key)}`);
2374
+ }
2375
+ }
2376
+ if (hasHookSpecificOutput) {
2377
+ if (hookOutput.hookEventName !== 'PreToolUse' || typeof hookOutput.additionalContext !== 'string' || hookOutput.additionalContext.trim() === '') {
2378
+ throw new Error(`native hook ${probe} emitted a malformed PreToolUse advisory envelope`);
2379
+ }
2380
+ if (systemMessage !== hookOutput.additionalContext) {
2381
+ throw new Error(`native hook ${probe} advisory envelope does not mirror systemMessage`);
2382
+ }
2309
2383
  }
2310
2384
  }
2385
+ /**
2386
+ * Lists persisted artifacts (files or symlinks) under a state root. The
2387
+ * advisory hook may bootstrap an empty `.omx/state` directory (#3497); only
2388
+ * persisted entries constitute authority-sensitive state creation.
2389
+ */
2390
+ export function listPersistedStateFiles(root: string): string[] {
2391
+ let rootStat;
2392
+ try {
2393
+ rootStat = lstatSync(root);
2394
+ } catch (error) {
2395
+ if (isNodeErrorWithCode(error, 'ENOENT')) return [];
2396
+ throw error;
2397
+ }
2398
+ if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) return [root];
2399
+ const files: string[] = [];
2400
+ const walk = (dir: string): void => {
2401
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
2402
+ const fullPath = join(dir, entry.name);
2403
+ if (entry.isDirectory()) walk(fullPath);
2404
+ else files.push(fullPath);
2405
+ }
2406
+ };
2407
+ walk(root);
2408
+ return files;
2409
+ }
2311
2410
 
2312
2411
  function smokeInstalledNativeHookDist(prefixDir: string, runtimeBinary: string): void {
2313
2412
  function runPackedTransportRegressions(hookScript: string, smokeCwd: string): void {
@@ -2389,9 +2488,15 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2389
2488
  const g2cPayload = { ...PACKED_CODEX_01445_NO_POINTER_NO_TRACKER_FIXTURE, cwd: g2cCwd };
2390
2489
  const g2cResult = invoke(g2cCwd, buildPackedRegressionEnvironment({ name: 'g2c-01445' }), g2cPayload);
2391
2490
  const g2cStdout = String(g2cResult.stdout || '');
2392
- const g2cExpected = '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"unsupported_documented_leader_proof: Codex hooks do not expose a documented, non-user-mintable root identity required for adapted Ralplan."}}\n';
2393
- if (g2cStdout !== g2cExpected) throw new Error('packed Codex 0.144.5 fixture returned unexpected PreToolUse bytes');
2394
- if (existsSync(join(g2cCwd, '.omx', 'state'))) throw new Error('packed Codex 0.144.5 fixture created pointer or tracker state');
2491
+ // #3497: this historical adapted-Ralplan PreToolUse deny is now advisory;
2492
+ // the CLI preflight still fails closed when the role intent is executed.
2493
+ assertNativeHookAdvisoryPreToolUse(
2494
+ 'PreToolUse packed Codex 0.144.5 fixture',
2495
+ parseNativeHookSmokeOutput('PreToolUse packed Codex 0.144.5 fixture', g2cStdout),
2496
+ );
2497
+ if (listPersistedStateFiles(join(g2cCwd, '.omx', 'state')).length > 0) {
2498
+ throw new Error('packed Codex 0.144.5 fixture persisted pointer or tracker state');
2499
+ }
2395
2500
  }
2396
2501
 
2397
2502
  const globalNodeModules = resolveGlobalNodeModules(prefixDir);
@@ -2646,7 +2751,9 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2646
2751
  thread_id: leaderAgentId,
2647
2752
  }, teamEnv).stdout),
2648
2753
  );
2649
- requireNativeHookPermissionDeny('PreToolUse leader with Team environment', leaderOutput, /Main-root Conductor mode is active/);
2754
+ // #3497/#3481: conductor hard gates were deleted; the leader with Team
2755
+ // environment is no longer denied and must emit advisory-only output.
2756
+ assertNativeHookAdvisoryPreToolUse('PreToolUse leader with Team environment', leaderOutput);
2650
2757
 
2651
2758
  const childEnv = {
2652
2759
  ...hookEnv,
@@ -2690,12 +2797,11 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2690
2797
  actor: 'main-root' | 'native-child',
2691
2798
  probe: string,
2692
2799
  output: Record<string, unknown>,
2693
- expectedReason = actor === 'native-child' ? /OWNER_CONFIRMATION_REQUIRED/ : /Main-root Conductor mode is active/,
2694
- ): void => requireNativeHookPermissionDeny(
2695
- `PreToolUse ${actor} ${probe}`,
2696
- output,
2697
- expectedReason,
2698
- );
2800
+ ): void => {
2801
+ // #3497/#3481: conductor/owner/provenance PreToolUse hard gates were
2802
+ // deleted; these actor probes now pin the advisory-only contract.
2803
+ assertNativeHookAdvisoryPreToolUse(`PreToolUse ${actor} ${probe}`, output);
2804
+ };
2699
2805
  for (const actor of ['main-root', 'native-child'] as const) {
2700
2806
  for (const [probe, command] of [
2701
2807
  ['finite cp directory leaf symlink', 'cp .omx/state/payload .omx/state/inbox'],
@@ -2797,8 +2903,8 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2797
2903
  requireActorDeny(actor, probe, runActorProbe(actor, probe, 'Bash', { command }));
2798
2904
  }
2799
2905
  }
2800
- requireNativeHookPermissionDeny(
2801
- 'identityless remote mutation',
2906
+ assertNativeHookAdvisoryPreToolUse(
2907
+ 'PreToolUse identityless remote mutation',
2802
2908
  parseNativeHookSmokeOutput(
2803
2909
  'PreToolUse identityless remote mutation',
2804
2910
  String(invokeAuthorizationProbe({
@@ -2810,7 +2916,6 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2810
2916
  tool_input: { command: 'PATH=/usr/bin:/bin gh issue create --title x --body y' },
2811
2917
  }, childEnv).stdout),
2812
2918
  ),
2813
- /OWNER_CONFIRMATION_REQUIRED/,
2814
2919
  );
2815
2920
  for (const [probe, identity] of [
2816
2921
  ['conflicting owner and current thread aliases', { owner_codex_thread_id: leaderAgentId, thread_id: 'agent-packed-install-child' }],
@@ -2818,8 +2923,8 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2818
2923
  ['reversed conflicting session aliases', { session_id: 'foreign-session', sessionId, agent_id: leaderAgentId, thread_id: leaderAgentId }],
2819
2924
  ['conflicting owner and agent aliases', { owner_codex_thread_id: 'foreign-owner', agent_id: leaderAgentId }],
2820
2925
  ] as const) {
2821
- requireNativeHookPermissionDeny(
2822
- probe,
2926
+ assertNativeHookAdvisoryPreToolUse(
2927
+ `PreToolUse ${probe}`,
2823
2928
  parseNativeHookSmokeOutput(
2824
2929
  probe,
2825
2930
  String(invokeAuthorizationProbe({
@@ -2832,15 +2937,14 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2832
2937
  tool_input: { command: 'PATH=/usr/bin:/bin gh issue create --title x --body y' },
2833
2938
  }, childEnv).stdout),
2834
2939
  ),
2835
- /PROVENANCE_DENIED/,
2836
2940
  );
2837
2941
  }
2838
2942
  for (const [probe, identity] of [
2839
2943
  ['foreign active session', { session_id: 'foreign-session', agent_id: leaderAgentId, thread_id: leaderAgentId }],
2840
2944
  ['absent active session', { agent_id: leaderAgentId, thread_id: leaderAgentId }],
2841
2945
  ] as const) {
2842
- requireNativeHookPermissionDeny(
2843
- probe,
2946
+ assertNativeHookAdvisoryPreToolUse(
2947
+ `PreToolUse ${probe}`,
2844
2948
  parseNativeHookSmokeOutput(
2845
2949
  probe,
2846
2950
  String(invokeAuthorizationProbe({
@@ -2852,7 +2956,6 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2852
2956
  tool_input: { file_path: 'src/session-bypass.ts', content: 'owned\n' },
2853
2957
  }, childEnv).stdout),
2854
2958
  ),
2855
- /PROVENANCE_DENIED/,
2856
2959
  );
2857
2960
  }
2858
2961
  for (const [order, sessionAliases] of [
@@ -2864,8 +2967,8 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2864
2967
  ['bash', 'Bash', { command: 'printf pwn >& src/alias-bypass.ts' }],
2865
2968
  ['state', 'mcp__omx_state__state_write', { mode: 'ultragoal', active: true }],
2866
2969
  ] as const) {
2867
- requireNativeHookPermissionDeny(
2868
- `session alias ${order}/${transport}`,
2970
+ assertNativeHookAdvisoryPreToolUse(
2971
+ `PreToolUse session alias ${order}/${transport}`,
2869
2972
  parseNativeHookSmokeOutput(
2870
2973
  `PreToolUse session alias ${order}/${transport}`,
2871
2974
  String(invokeAuthorizationProbe({
@@ -2879,12 +2982,11 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2879
2982
  tool_input: toolInput,
2880
2983
  }, childEnv).stdout),
2881
2984
  ),
2882
- /PROVENANCE_DENIED/,
2883
2985
  );
2884
2986
  }
2885
2987
  }
2886
- requireNativeHookPermissionDeny(
2887
- 'noncanonical cwd metadata target',
2988
+ assertNativeHookAdvisoryPreToolUse(
2989
+ 'PreToolUse noncanonical cwd metadata target',
2888
2990
  parseNativeHookSmokeOutput(
2889
2991
  'PreToolUse noncanonical cwd metadata target',
2890
2992
  String(invokeAuthorizationProbe({
@@ -2898,10 +3000,9 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2898
3000
  tool_input: { file_path: '.omx/state/inbox/cwd-bypass', content: 'owned\n' },
2899
3001
  }, childEnv).stdout),
2900
3002
  ),
2901
- /Main-root Conductor mode is active/,
2902
3003
  );
2903
- requireNativeHookPermissionDeny(
2904
- 'identityless native-session remote mutation',
3004
+ assertNativeHookAdvisoryPreToolUse(
3005
+ 'PreToolUse identityless native-session remote mutation',
2905
3006
  parseNativeHookSmokeOutput(
2906
3007
  'PreToolUse identityless native-session remote mutation',
2907
3008
  String(invokeAuthorizationProbe({
@@ -2913,7 +3014,6 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2913
3014
  tool_input: { path: 'src/session-bypass.ts' },
2914
3015
  }, childEnv).stdout),
2915
3016
  ),
2916
- /OWNER_CONFIRMATION_REQUIRED|Main-root Conductor mode is active/,
2917
3017
  );
2918
3018
  if (Object.keys(runActorProbe('main-root', 'finite cp metadata leaf control', 'Bash', {
2919
3019
  command: 'cp .omx/state/payload .omx/handoffs/run-1/payload',
@@ -2979,30 +3079,28 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
2979
3079
  current_phase: 'planning',
2980
3080
  session_id: boxedPlanningSiblingSessionId,
2981
3081
  }));
2982
- requireNativeHookPermissionDeny(
2983
- 'main-root boxed planning state symlink',
3082
+ assertNativeHookAdvisoryPreToolUse(
3083
+ 'PreToolUse main-root boxed planning state symlink',
2984
3084
  runActorProbe('main-root', 'boxed planning state symlink', 'Write', { file_path: boxedPlanningStatePath, content: 'owned\n' }, {
2985
3085
  OMX_ROOT: boxedPlanningRoot,
2986
3086
  OMX_TEAM_STATE_ROOT: '',
2987
3087
  }),
2988
- /(?:Ralplan is active|Main-root Conductor mode is active)/,
2989
3088
  );
2990
- requireNativeHookPermissionDeny(
2991
- 'main-root boxed planning state hardlink',
3089
+ assertNativeHookAdvisoryPreToolUse(
3090
+ 'PreToolUse main-root boxed planning state hardlink',
2992
3091
  runActorProbe('main-root', 'boxed planning state hardlink', 'Write', { file_path: boxedPlanningHardLinkPath, content: 'owned\n' }, {
2993
3092
  OMX_ROOT: boxedPlanningRoot,
2994
3093
  OMX_TEAM_STATE_ROOT: '',
2995
3094
  }),
2996
- /(?:Ralplan is active|Main-root Conductor mode is active)/,
2997
3095
  );
2998
- requireNativeHookPermissionDeny(
2999
- 'main-root boxed planning sibling session',
3096
+ assertNativeHookAdvisoryPreToolUse(
3097
+ 'PreToolUse main-root boxed planning sibling session',
3000
3098
  runActorProbe('main-root', 'boxed planning sibling session', 'Write', { file_path: boxedPlanningSiblingPath, content: 'owned\n' }, {
3001
3099
  OMX_ROOT: boxedPlanningRoot,
3002
3100
  OMX_TEAM_STATE_ROOT: '',
3003
3101
  }),
3004
- /(?:Ralplan is active|Main-root Conductor mode is active)/,
3005
3102
  );
3103
+
3006
3104
  if (Object.keys(runActorProbe('main-root', 'hardlink metadata source control', 'Bash', {
3007
3105
  command: 'ln .omx/state/conductor-ledger.json .omx/handoffs/run-1/ledger-link',
3008
3106
  })).length !== 0) {
@@ -3049,7 +3147,7 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
3049
3147
  tool_input: { file_path: 'src/packed-conflict.ts', content: 'escaped' },
3050
3148
  }, childEnv).stdout),
3051
3149
  );
3052
- requireNativeHookPermissionDeny('PreToolUse conflicting leader identity', output, /PROVENANCE_DENIED/);
3150
+ assertNativeHookAdvisoryPreToolUse('PreToolUse conflicting leader identity', output);
3053
3151
  }
3054
3152
  const consistentLeaderOutput = parseNativeHookSmokeOutput(
3055
3153
  'PreToolUse consistent leader identity',
@@ -3063,7 +3161,8 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
3063
3161
  tool_input: { file_path: 'src/packed-consistent-leader.ts', content: 'escaped' },
3064
3162
  }, childEnv).stdout),
3065
3163
  );
3066
- requireNativeHookPermissionDeny('PreToolUse consistent leader identity', consistentLeaderOutput, /Main-root Conductor mode is active/);
3164
+ // #3497: the consistent leader identity is no longer conductor-denied.
3165
+ assertNativeHookAdvisoryPreToolUse('PreToolUse consistent leader identity', consistentLeaderOutput);
3067
3166
  const ownerSessionClaimOutput = parseNativeHookSmokeOutput(
3068
3167
  'PreToolUse owner-session identity claim',
3069
3168
  String(invokeAuthorizationProbe({
@@ -3076,7 +3175,8 @@ function runPackedTransportRegressions(hookScript: string, smokeCwd: string): vo
3076
3175
  tool_input: { file_path: 'src/packed-session-claim.ts', content: 'escaped' },
3077
3176
  }, childEnv).stdout),
3078
3177
  );
3079
- requireNativeHookPermissionDeny('PreToolUse owner-session identity claim', ownerSessionClaimOutput, /OWNER_CONFIRMATION_REQUIRED/);
3178
+ // #3481: owner-confirmation PreToolUse hard gate was removed.
3179
+ assertNativeHookAdvisoryPreToolUse('PreToolUse owner-session identity claim', ownerSessionClaimOutput);
3080
3180
 
3081
3181
  const wgetReviewMutationCommands = [
3082
3182
  ['bare wget download', 'wget https://example.test/file'],
@@ -3822,8 +3922,8 @@ PY`],
3822
3922
  if (existsSync(join(packedCancelStateDir, 'skill-active-state.json'))) {
3823
3923
  throw new Error('packed issue 3280 cancellation mutated root compatibility state');
3824
3924
  }
3825
- requireNativeHookPermissionDeny(
3826
- 'main-root boxed planning CLI poisoned state root',
3925
+ assertNativeHookAdvisoryPreToolUse(
3926
+ 'PreToolUse main-root boxed planning CLI poisoned state root',
3827
3927
  runActorProbe(
3828
3928
  'main-root',
3829
3929
  'boxed planning CLI poisoned state root',
@@ -3831,7 +3931,6 @@ PY`],
3831
3931
  { command: `OMX_STATE_ROOT=${join(smokeCwd, 'src', 'state')} ${packedNpmCommandPrefix} omx state write --input '{"mode":"ralplan","active":true}' --json` },
3832
3932
  { OMX_ROOT: boxedPlanningRoot, OMX_TEAM_STATE_ROOT: '' },
3833
3933
  ),
3834
- /(?:Ralplan is active|Main-root Conductor mode is active)/,
3835
3934
  );
3836
3935
  const npmBinPathShadow = join(smokeCwd, '.omx', 'state', 'inbox', 'cat');
3837
3936
  symlinkSync('/usr/bin/touch', npmBinPathShadow);
@@ -4534,21 +4633,20 @@ PY`],
4534
4633
  'sessionless planning state write',
4535
4634
  'mcp__omx_state__state_write',
4536
4635
  { mode: 'ralplan', active: true, current_phase: 'planning' },
4537
- ), /PROVENANCE_DENIED/);
4636
+ ));
4538
4637
  requireActorDeny('native-child', 'foreign planning state write', runActorProbe(
4539
4638
  'native-child',
4540
4639
  'foreign planning state write',
4541
4640
  'mcp__omx_state__state_write',
4542
4641
  { mode: 'ralplan', active: false, current_phase: 'complete', session_id: 'foreign-session' },
4543
- ), /PROVENANCE_DENIED/);
4642
+ ));
4544
4643
  symlinkSync(join(smokeCwd, 'src'), join(smokeCwd, '.omx', 'drafts'));
4545
4644
  for (const actor of ['main-root', 'native-child'] as const) {
4546
4645
  const output = runActorProbe(actor, 'linked planning artifact redirect', 'Bash', {
4547
4646
  command: 'printf owned > .omx/drafts/linked-plan.md',
4548
4647
  });
4549
- if ((output.hookSpecificOutput as { permissionDecision?: string } | undefined)?.permissionDecision !== 'deny') {
4550
- throw new Error(`packed ${actor} linked planning artifact redirect should be denied`);
4551
- }
4648
+ // #3497: planning artifact redirects are advisory-only now.
4649
+ assertNativeHookAdvisoryPreToolUse(`PreToolUse ${actor} linked planning artifact redirect`, output);
4552
4650
  }
4553
4651
  writeFileSync(join(stateDir, 'sessions', sessionId, 'skill-active-state.json'), JSON.stringify({
4554
4652
  active: true,
@@ -4599,12 +4697,17 @@ PY`],
4599
4697
  tool_input: { command: 'omx ralplan role-intent write --role architect --parent-thread "$CODEX_THREAD_ID" --json' },
4600
4698
  }),
4601
4699
  });
4602
- const preToolUseExpected = '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"unsupported_documented_leader_proof: Codex hooks do not expose a documented, non-user-mintable root identity required for adapted Ralplan."}}\n';
4603
- if (String(preToolUseResult.stdout || '') !== preToolUseExpected) {
4604
- throw new Error('installed #3212 PreToolUse did not emit the exact unsupported denial');
4605
- }
4700
+ // #3497: the documented-leader PreToolUse hard gate is deleted; the hook
4701
+ // must not hard-deny or emit the unsupported-proof reason. The CLI-level
4702
+ // fail-closed contract below still guards the actual authority boundary.
4703
+ assertNativeHookAdvisoryPreToolUse(
4704
+ 'PreToolUse installed #3212 role-intent',
4705
+ parseNativeHookSmokeOutput('PreToolUse installed #3212 role-intent', String(preToolUseResult.stdout || '')),
4706
+ );
4606
4707
  const authorityStateRoot = join(roleIntentCwd, '.omx', 'state');
4607
- if (existsSync(authorityStateRoot)) throw new Error('installed #3212 PreToolUse created authority-sensitive state');
4708
+ if (listPersistedStateFiles(authorityStateRoot).length > 0) {
4709
+ throw new Error('installed #3212 PreToolUse persisted authority-sensitive state');
4710
+ }
4608
4711
 
4609
4712
  const roleIntentCliResult = spawnSync(process.execPath, [realpathSync(join(packageRoot, 'dist', 'cli', 'omx.js')), 'ralplan', 'role-intent', 'write', '--role', 'architect', '--parent-thread', roleIntentNativeSessionId, '--json'], {
4610
4713
  cwd: roleIntentCwd,
@@ -4616,7 +4719,9 @@ PY`],
4616
4719
  if (String(roleIntentCliResult.stdout || '') !== '{"ok":false,"reason":"unsupported_documented_leader_proof"}\n') {
4617
4720
  throw new Error('installed #3212 role-intent CLI returned an unexpected fail-closed denial');
4618
4721
  }
4619
- if (existsSync(authorityStateRoot)) throw new Error('installed #3212 role-intent CLI created authority-sensitive state');
4722
+ if (listPersistedStateFiles(authorityStateRoot).length > 0) {
4723
+ throw new Error('installed #3212 role-intent CLI persisted authority-sensitive state');
4724
+ }
4620
4725
 
4621
4726
  for (const [caseIndex, testCase] of PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS.entries()) {
4622
4727
  const caseCwd = join(smokeCwd, testCase.name);