codex-orchestrator 0.1.51 → 2.0.1

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 (570) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +45 -389
  3. package/dist/src/index.d.ts +16 -46
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +8 -24
  6. package/dist/src/index.js.map +1 -1
  7. package/dist/src/v2/acceptance-proof.d.ts +111 -0
  8. package/dist/src/v2/acceptance-proof.d.ts.map +1 -0
  9. package/dist/src/v2/acceptance-proof.js +427 -0
  10. package/dist/src/v2/acceptance-proof.js.map +1 -0
  11. package/dist/src/v2/adapters/command.d.ts.map +1 -0
  12. package/dist/src/v2/adapters/command.js.map +1 -0
  13. package/dist/src/v2/adapters/durable-atomic-file.d.ts.map +1 -0
  14. package/dist/src/v2/adapters/durable-atomic-file.js.map +1 -0
  15. package/dist/src/v2/adapters/gh-cli.d.ts.map +1 -0
  16. package/dist/src/v2/adapters/gh-cli.js.map +1 -0
  17. package/dist/src/v2/adapters/gh-issue-adapter.d.ts.map +1 -0
  18. package/dist/src/v2/adapters/gh-issue-adapter.js.map +1 -0
  19. package/dist/src/v2/adapters/gh-pull-request-adapter.d.ts.map +1 -0
  20. package/dist/src/v2/adapters/gh-pull-request-adapter.js.map +1 -0
  21. package/dist/src/v2/adapters/issues.d.ts.map +1 -0
  22. package/dist/src/v2/adapters/issues.js.map +1 -0
  23. package/dist/src/v2/adapters/mission-coordinator-lock.d.ts.map +1 -0
  24. package/dist/src/v2/adapters/mission-coordinator-lock.js.map +1 -0
  25. package/dist/src/v2/adapters/path-policy.d.ts.map +1 -0
  26. package/dist/src/v2/adapters/path-policy.js.map +1 -0
  27. package/dist/src/v2/adapters/pull-requests.d.ts.map +1 -0
  28. package/dist/src/v2/adapters/pull-requests.js.map +1 -0
  29. package/dist/src/v2/adapters/target-activity-fence.d.ts.map +1 -0
  30. package/dist/src/{runner → v2/adapters}/target-activity-fence.js +1 -1
  31. package/dist/src/v2/adapters/target-activity-fence.js.map +1 -0
  32. package/dist/src/{git → v2/adapters}/worktree.d.ts +1 -1
  33. package/dist/src/v2/adapters/worktree.d.ts.map +1 -0
  34. package/dist/src/{git → v2/adapters}/worktree.js +2 -2
  35. package/dist/src/v2/adapters/worktree.js.map +1 -0
  36. package/dist/src/v2/atomic-store.d.ts +36 -0
  37. package/dist/src/v2/atomic-store.d.ts.map +1 -0
  38. package/dist/src/v2/atomic-store.js +328 -0
  39. package/dist/src/v2/atomic-store.js.map +1 -0
  40. package/dist/src/v2/candidate-cli.d.ts +22 -0
  41. package/dist/src/v2/candidate-cli.d.ts.map +1 -0
  42. package/dist/src/v2/candidate-cli.js +161 -0
  43. package/dist/src/v2/candidate-cli.js.map +1 -0
  44. package/dist/src/v2/checked-change.d.ts +49 -0
  45. package/dist/src/v2/checked-change.d.ts.map +1 -0
  46. package/dist/src/v2/checked-change.js +139 -0
  47. package/dist/src/v2/checked-change.js.map +1 -0
  48. package/dist/src/v2/cli-contract.d.ts +8 -0
  49. package/dist/src/v2/cli-contract.d.ts.map +1 -0
  50. package/dist/src/v2/cli-contract.js +32 -0
  51. package/dist/src/v2/cli-contract.js.map +1 -0
  52. package/dist/src/v2/codex-process.d.ts +71 -0
  53. package/dist/src/v2/codex-process.d.ts.map +1 -0
  54. package/dist/src/v2/codex-process.js +404 -0
  55. package/dist/src/v2/codex-process.js.map +1 -0
  56. package/dist/src/v2/config.d.ts +45 -0
  57. package/dist/src/v2/config.d.ts.map +1 -0
  58. package/dist/src/v2/config.js +139 -0
  59. package/dist/src/v2/config.js.map +1 -0
  60. package/dist/src/v2/containment.d.ts +55 -0
  61. package/dist/src/v2/containment.d.ts.map +1 -0
  62. package/dist/src/v2/containment.js +370 -0
  63. package/dist/src/v2/containment.js.map +1 -0
  64. package/dist/src/v2/implementation-report.d.ts +18 -0
  65. package/dist/src/v2/implementation-report.d.ts.map +1 -0
  66. package/dist/src/v2/implementation-report.js +147 -0
  67. package/dist/src/v2/implementation-report.js.map +1 -0
  68. package/dist/src/v2/legacy-cutover.d.ts +52 -0
  69. package/dist/src/v2/legacy-cutover.d.ts.map +1 -0
  70. package/dist/src/v2/legacy-cutover.js +87 -0
  71. package/dist/src/v2/legacy-cutover.js.map +1 -0
  72. package/dist/src/v2/mobile-lease.d.ts +97 -0
  73. package/dist/src/v2/mobile-lease.d.ts.map +1 -0
  74. package/dist/src/v2/mobile-lease.js +253 -0
  75. package/dist/src/v2/mobile-lease.js.map +1 -0
  76. package/dist/src/v2/proof-report.d.ts +118 -0
  77. package/dist/src/v2/proof-report.d.ts.map +1 -0
  78. package/dist/src/v2/proof-report.js +703 -0
  79. package/dist/src/v2/proof-report.js.map +1 -0
  80. package/dist/src/v2/proof-store.d.ts +42 -0
  81. package/dist/src/v2/proof-store.d.ts.map +1 -0
  82. package/dist/src/v2/proof-store.js +180 -0
  83. package/dist/src/v2/proof-store.js.map +1 -0
  84. package/dist/src/v2/report-envelope.d.ts +4 -0
  85. package/dist/src/v2/report-envelope.d.ts.map +1 -0
  86. package/dist/src/v2/report-envelope.js +46 -0
  87. package/dist/src/v2/report-envelope.js.map +1 -0
  88. package/dist/src/v2/run-issue.d.ts +213 -0
  89. package/dist/src/v2/run-issue.d.ts.map +1 -0
  90. package/dist/src/v2/run-issue.js +906 -0
  91. package/dist/src/v2/run-issue.js.map +1 -0
  92. package/dist/src/v2/run-store.d.ts +136 -0
  93. package/dist/src/v2/run-store.d.ts.map +1 -0
  94. package/dist/src/v2/run-store.js +346 -0
  95. package/dist/src/v2/run-store.js.map +1 -0
  96. package/dist/src/v2/runtime-assets.d.ts +31 -0
  97. package/dist/src/v2/runtime-assets.d.ts.map +1 -0
  98. package/dist/src/v2/runtime-assets.js +473 -0
  99. package/dist/src/v2/runtime-assets.js.map +1 -0
  100. package/dist/src/v2/runtime.d.ts +137 -0
  101. package/dist/src/v2/runtime.d.ts.map +1 -0
  102. package/dist/src/v2/runtime.js +847 -0
  103. package/dist/src/v2/runtime.js.map +1 -0
  104. package/dist/src/v2/setup-cli.d.ts +5 -0
  105. package/dist/src/v2/setup-cli.d.ts.map +1 -0
  106. package/dist/src/v2/setup-cli.js +83 -0
  107. package/dist/src/v2/setup-cli.js.map +1 -0
  108. package/dist/src/v2/setup-runtime.d.ts +6 -0
  109. package/dist/src/v2/setup-runtime.d.ts.map +1 -0
  110. package/dist/src/v2/setup-runtime.js +213 -0
  111. package/dist/src/v2/setup-runtime.js.map +1 -0
  112. package/dist/src/v2/setup-store.d.ts +19 -0
  113. package/dist/src/v2/setup-store.d.ts.map +1 -0
  114. package/dist/src/v2/setup-store.js +208 -0
  115. package/dist/src/v2/setup-store.js.map +1 -0
  116. package/dist/src/v2/setup.d.ts +147 -0
  117. package/dist/src/v2/setup.d.ts.map +1 -0
  118. package/dist/src/v2/setup.js +529 -0
  119. package/dist/src/v2/setup.js.map +1 -0
  120. package/docs/deep-dive.md +54 -803
  121. package/internal-skills/acceptance-proof/SKILL.md +14 -0
  122. package/internal-skills/acceptance-proof/references/android.md +14 -0
  123. package/internal-skills/acceptance-proof/references/browser.md +13 -0
  124. package/internal-skills/acceptance-proof/references/ios.md +14 -0
  125. package/internal-skills/acceptance-proof/tools/android-lease.mjs +280 -0
  126. package/internal-skills/acceptance-proof/tools/ios-lease.mjs +288 -0
  127. package/internal-skills/agent-auto/SKILL.md +14 -0
  128. package/package.json +11 -18
  129. package/bridge-runtime.json +0 -2719
  130. package/dist/src/bridge-runtime.d.ts +0 -17
  131. package/dist/src/bridge-runtime.d.ts.map +0 -1
  132. package/dist/src/bridge-runtime.js +0 -170
  133. package/dist/src/bridge-runtime.js.map +0 -1
  134. package/dist/src/cli.d.ts +0 -3
  135. package/dist/src/cli.d.ts.map +0 -1
  136. package/dist/src/cli.js +0 -569
  137. package/dist/src/cli.js.map +0 -1
  138. package/dist/src/codex/command-adapter.d.ts +0 -47
  139. package/dist/src/codex/command-adapter.d.ts.map +0 -1
  140. package/dist/src/codex/command-adapter.js +0 -169
  141. package/dist/src/codex/command-adapter.js.map +0 -1
  142. package/dist/src/codex/mobile-device-guard.d.ts +0 -7
  143. package/dist/src/codex/mobile-device-guard.d.ts.map +0 -1
  144. package/dist/src/codex/mobile-device-guard.js +0 -63
  145. package/dist/src/codex/mobile-device-guard.js.map +0 -1
  146. package/dist/src/config/constants.d.ts +0 -6
  147. package/dist/src/config/constants.d.ts.map +0 -1
  148. package/dist/src/config/constants.js +0 -19
  149. package/dist/src/config/constants.js.map +0 -1
  150. package/dist/src/config/schema.d.ts +0 -234
  151. package/dist/src/config/schema.d.ts.map +0 -1
  152. package/dist/src/config/schema.js +0 -673
  153. package/dist/src/config/schema.js.map +0 -1
  154. package/dist/src/fs/durable-atomic-file.d.ts.map +0 -1
  155. package/dist/src/fs/durable-atomic-file.js.map +0 -1
  156. package/dist/src/git/base-branch.d.ts +0 -26
  157. package/dist/src/git/base-branch.d.ts.map +0 -1
  158. package/dist/src/git/base-branch.js +0 -45
  159. package/dist/src/git/base-branch.js.map +0 -1
  160. package/dist/src/git/worktree.d.ts.map +0 -1
  161. package/dist/src/git/worktree.js.map +0 -1
  162. package/dist/src/github/gh-cli.d.ts.map +0 -1
  163. package/dist/src/github/gh-cli.js.map +0 -1
  164. package/dist/src/github/gh-issue-adapter.d.ts.map +0 -1
  165. package/dist/src/github/gh-issue-adapter.js.map +0 -1
  166. package/dist/src/github/gh-pull-request-adapter.d.ts.map +0 -1
  167. package/dist/src/github/gh-pull-request-adapter.js.map +0 -1
  168. package/dist/src/github/issues.d.ts.map +0 -1
  169. package/dist/src/github/issues.js.map +0 -1
  170. package/dist/src/github/pull-requests.d.ts.map +0 -1
  171. package/dist/src/github/pull-requests.js.map +0 -1
  172. package/dist/src/package-info.d.ts +0 -6
  173. package/dist/src/package-info.d.ts.map +0 -1
  174. package/dist/src/package-info.js +0 -13
  175. package/dist/src/package-info.js.map +0 -1
  176. package/dist/src/path-policy.d.ts.map +0 -1
  177. package/dist/src/path-policy.js.map +0 -1
  178. package/dist/src/process/command.d.ts.map +0 -1
  179. package/dist/src/process/command.js.map +0 -1
  180. package/dist/src/review-handoff.d.ts +0 -3
  181. package/dist/src/review-handoff.d.ts.map +0 -1
  182. package/dist/src/review-handoff.js +0 -8
  183. package/dist/src/review-handoff.js.map +0 -1
  184. package/dist/src/runner/acceptance-proof-loop.d.ts +0 -97
  185. package/dist/src/runner/acceptance-proof-loop.d.ts.map +0 -1
  186. package/dist/src/runner/acceptance-proof-loop.js +0 -404
  187. package/dist/src/runner/acceptance-proof-loop.js.map +0 -1
  188. package/dist/src/runner/acceptance-proof-runner.d.ts +0 -24
  189. package/dist/src/runner/acceptance-proof-runner.d.ts.map +0 -1
  190. package/dist/src/runner/acceptance-proof-runner.js +0 -121
  191. package/dist/src/runner/acceptance-proof-runner.js.map +0 -1
  192. package/dist/src/runner/acceptance-proof.d.ts +0 -189
  193. package/dist/src/runner/acceptance-proof.d.ts.map +0 -1
  194. package/dist/src/runner/acceptance-proof.js +0 -594
  195. package/dist/src/runner/acceptance-proof.js.map +0 -1
  196. package/dist/src/runner/agent-attempt.d.ts +0 -105
  197. package/dist/src/runner/agent-attempt.d.ts.map +0 -1
  198. package/dist/src/runner/agent-attempt.js +0 -245
  199. package/dist/src/runner/agent-attempt.js.map +0 -1
  200. package/dist/src/runner/android-visual-proof-command.d.ts +0 -26
  201. package/dist/src/runner/android-visual-proof-command.d.ts.map +0 -1
  202. package/dist/src/runner/android-visual-proof-command.js +0 -592
  203. package/dist/src/runner/android-visual-proof-command.js.map +0 -1
  204. package/dist/src/runner/auto-visual-proof-command.d.ts +0 -15
  205. package/dist/src/runner/auto-visual-proof-command.d.ts.map +0 -1
  206. package/dist/src/runner/auto-visual-proof-command.js +0 -64
  207. package/dist/src/runner/auto-visual-proof-command.js.map +0 -1
  208. package/dist/src/runner/browser-proof-contract.d.ts +0 -134
  209. package/dist/src/runner/browser-proof-contract.d.ts.map +0 -1
  210. package/dist/src/runner/browser-proof-contract.js +0 -400
  211. package/dist/src/runner/browser-proof-contract.js.map +0 -1
  212. package/dist/src/runner/browser-visual-proof-command.d.ts +0 -101
  213. package/dist/src/runner/browser-visual-proof-command.d.ts.map +0 -1
  214. package/dist/src/runner/browser-visual-proof-command.js +0 -532
  215. package/dist/src/runner/browser-visual-proof-command.js.map +0 -1
  216. package/dist/src/runner/command-utils.d.ts +0 -15
  217. package/dist/src/runner/command-utils.d.ts.map +0 -1
  218. package/dist/src/runner/command-utils.js +0 -228
  219. package/dist/src/runner/command-utils.js.map +0 -1
  220. package/dist/src/runner/completion-report.d.ts +0 -121
  221. package/dist/src/runner/completion-report.d.ts.map +0 -1
  222. package/dist/src/runner/completion-report.js +0 -381
  223. package/dist/src/runner/completion-report.js.map +0 -1
  224. package/dist/src/runner/context-snapshot.d.ts +0 -33
  225. package/dist/src/runner/context-snapshot.d.ts.map +0 -1
  226. package/dist/src/runner/context-snapshot.js +0 -99
  227. package/dist/src/runner/context-snapshot.js.map +0 -1
  228. package/dist/src/runner/daemon-command.d.ts +0 -30
  229. package/dist/src/runner/daemon-command.d.ts.map +0 -1
  230. package/dist/src/runner/daemon-command.js +0 -262
  231. package/dist/src/runner/daemon-command.js.map +0 -1
  232. package/dist/src/runner/doctor-command.d.ts +0 -41
  233. package/dist/src/runner/doctor-command.d.ts.map +0 -1
  234. package/dist/src/runner/doctor-command.js +0 -177
  235. package/dist/src/runner/doctor-command.js.map +0 -1
  236. package/dist/src/runner/durable-run-summary.d.ts +0 -80
  237. package/dist/src/runner/durable-run-summary.d.ts.map +0 -1
  238. package/dist/src/runner/durable-run-summary.js +0 -200
  239. package/dist/src/runner/durable-run-summary.js.map +0 -1
  240. package/dist/src/runner/flutter-sdk-discovery.d.ts +0 -5
  241. package/dist/src/runner/flutter-sdk-discovery.d.ts.map +0 -1
  242. package/dist/src/runner/flutter-sdk-discovery.js +0 -103
  243. package/dist/src/runner/flutter-sdk-discovery.js.map +0 -1
  244. package/dist/src/runner/fresh-context-review.d.ts +0 -22
  245. package/dist/src/runner/fresh-context-review.d.ts.map +0 -1
  246. package/dist/src/runner/fresh-context-review.js +0 -177
  247. package/dist/src/runner/fresh-context-review.js.map +0 -1
  248. package/dist/src/runner/handoff-evidence.d.ts +0 -141
  249. package/dist/src/runner/handoff-evidence.d.ts.map +0 -1
  250. package/dist/src/runner/handoff-evidence.js +0 -543
  251. package/dist/src/runner/handoff-evidence.js.map +0 -1
  252. package/dist/src/runner/hygiene-cleanup.d.ts +0 -15
  253. package/dist/src/runner/hygiene-cleanup.d.ts.map +0 -1
  254. package/dist/src/runner/hygiene-cleanup.js +0 -25
  255. package/dist/src/runner/hygiene-cleanup.js.map +0 -1
  256. package/dist/src/runner/ios-visual-proof-command.d.ts +0 -25
  257. package/dist/src/runner/ios-visual-proof-command.d.ts.map +0 -1
  258. package/dist/src/runner/ios-visual-proof-command.js +0 -353
  259. package/dist/src/runner/ios-visual-proof-command.js.map +0 -1
  260. package/dist/src/runner/issue-state-machine.d.ts +0 -39
  261. package/dist/src/runner/issue-state-machine.d.ts.map +0 -1
  262. package/dist/src/runner/issue-state-machine.js +0 -124
  263. package/dist/src/runner/issue-state-machine.js.map +0 -1
  264. package/dist/src/runner/issue-tree.d.ts +0 -65
  265. package/dist/src/runner/issue-tree.d.ts.map +0 -1
  266. package/dist/src/runner/issue-tree.js +0 -474
  267. package/dist/src/runner/issue-tree.js.map +0 -1
  268. package/dist/src/runner/lifecycle-events.d.ts +0 -44
  269. package/dist/src/runner/lifecycle-events.d.ts.map +0 -1
  270. package/dist/src/runner/lifecycle-events.js +0 -108
  271. package/dist/src/runner/lifecycle-events.js.map +0 -1
  272. package/dist/src/runner/local-execution-session.d.ts +0 -112
  273. package/dist/src/runner/local-execution-session.d.ts.map +0 -1
  274. package/dist/src/runner/local-execution-session.js +0 -1064
  275. package/dist/src/runner/local-execution-session.js.map +0 -1
  276. package/dist/src/runner/local-state.d.ts +0 -44
  277. package/dist/src/runner/local-state.d.ts.map +0 -1
  278. package/dist/src/runner/local-state.js +0 -150
  279. package/dist/src/runner/local-state.js.map +0 -1
  280. package/dist/src/runner/mission-activation.d.ts +0 -29
  281. package/dist/src/runner/mission-activation.d.ts.map +0 -1
  282. package/dist/src/runner/mission-activation.js +0 -54
  283. package/dist/src/runner/mission-activation.js.map +0 -1
  284. package/dist/src/runner/mission-agent-broker.d.ts +0 -53
  285. package/dist/src/runner/mission-agent-broker.d.ts.map +0 -1
  286. package/dist/src/runner/mission-agent-broker.js +0 -182
  287. package/dist/src/runner/mission-agent-broker.js.map +0 -1
  288. package/dist/src/runner/mission-cancellation.d.ts +0 -77
  289. package/dist/src/runner/mission-cancellation.d.ts.map +0 -1
  290. package/dist/src/runner/mission-cancellation.js +0 -180
  291. package/dist/src/runner/mission-cancellation.js.map +0 -1
  292. package/dist/src/runner/mission-canonical-path.d.ts +0 -34
  293. package/dist/src/runner/mission-canonical-path.d.ts.map +0 -1
  294. package/dist/src/runner/mission-canonical-path.js +0 -121
  295. package/dist/src/runner/mission-canonical-path.js.map +0 -1
  296. package/dist/src/runner/mission-capability-kernel.d.ts +0 -34
  297. package/dist/src/runner/mission-capability-kernel.d.ts.map +0 -1
  298. package/dist/src/runner/mission-capability-kernel.js +0 -158
  299. package/dist/src/runner/mission-capability-kernel.js.map +0 -1
  300. package/dist/src/runner/mission-check-policy.d.ts +0 -17
  301. package/dist/src/runner/mission-check-policy.d.ts.map +0 -1
  302. package/dist/src/runner/mission-check-policy.js +0 -31
  303. package/dist/src/runner/mission-check-policy.js.map +0 -1
  304. package/dist/src/runner/mission-coordinator-lock.d.ts.map +0 -1
  305. package/dist/src/runner/mission-coordinator-lock.js.map +0 -1
  306. package/dist/src/runner/mission-deployment.d.ts +0 -21
  307. package/dist/src/runner/mission-deployment.d.ts.map +0 -1
  308. package/dist/src/runner/mission-deployment.js +0 -108
  309. package/dist/src/runner/mission-deployment.js.map +0 -1
  310. package/dist/src/runner/mission-evaluation.d.ts +0 -61
  311. package/dist/src/runner/mission-evaluation.d.ts.map +0 -1
  312. package/dist/src/runner/mission-evaluation.js +0 -183
  313. package/dist/src/runner/mission-evaluation.js.map +0 -1
  314. package/dist/src/runner/mission-executor-probe.d.ts +0 -10
  315. package/dist/src/runner/mission-executor-probe.d.ts.map +0 -1
  316. package/dist/src/runner/mission-executor-probe.js +0 -180
  317. package/dist/src/runner/mission-executor-probe.js.map +0 -1
  318. package/dist/src/runner/mission-git-contracts.d.ts +0 -75
  319. package/dist/src/runner/mission-git-contracts.d.ts.map +0 -1
  320. package/dist/src/runner/mission-git-contracts.js +0 -201
  321. package/dist/src/runner/mission-git-contracts.js.map +0 -1
  322. package/dist/src/runner/mission-git-runtime-owner-ref.d.ts +0 -13
  323. package/dist/src/runner/mission-git-runtime-owner-ref.d.ts.map +0 -1
  324. package/dist/src/runner/mission-git-runtime-owner-ref.js +0 -111
  325. package/dist/src/runner/mission-git-runtime-owner-ref.js.map +0 -1
  326. package/dist/src/runner/mission-git-transaction.d.ts +0 -97
  327. package/dist/src/runner/mission-git-transaction.d.ts.map +0 -1
  328. package/dist/src/runner/mission-git-transaction.js +0 -1009
  329. package/dist/src/runner/mission-git-transaction.js.map +0 -1
  330. package/dist/src/runner/mission-identifiers.d.ts +0 -31
  331. package/dist/src/runner/mission-identifiers.d.ts.map +0 -1
  332. package/dist/src/runner/mission-identifiers.js +0 -75
  333. package/dist/src/runner/mission-identifiers.js.map +0 -1
  334. package/dist/src/runner/mission-input-snapshot.d.ts +0 -21
  335. package/dist/src/runner/mission-input-snapshot.d.ts.map +0 -1
  336. package/dist/src/runner/mission-input-snapshot.js +0 -63
  337. package/dist/src/runner/mission-input-snapshot.js.map +0 -1
  338. package/dist/src/runner/mission-ownership.d.ts +0 -38
  339. package/dist/src/runner/mission-ownership.d.ts.map +0 -1
  340. package/dist/src/runner/mission-ownership.js +0 -88
  341. package/dist/src/runner/mission-ownership.js.map +0 -1
  342. package/dist/src/runner/mission-patch-audit.d.ts +0 -21
  343. package/dist/src/runner/mission-patch-audit.d.ts.map +0 -1
  344. package/dist/src/runner/mission-patch-audit.js +0 -186
  345. package/dist/src/runner/mission-patch-audit.js.map +0 -1
  346. package/dist/src/runner/mission-path-language.d.ts +0 -6
  347. package/dist/src/runner/mission-path-language.d.ts.map +0 -1
  348. package/dist/src/runner/mission-path-language.js +0 -106
  349. package/dist/src/runner/mission-path-language.js.map +0 -1
  350. package/dist/src/runner/mission-permit-authority.d.ts +0 -26
  351. package/dist/src/runner/mission-permit-authority.d.ts.map +0 -1
  352. package/dist/src/runner/mission-permit-authority.js +0 -145
  353. package/dist/src/runner/mission-permit-authority.js.map +0 -1
  354. package/dist/src/runner/mission-plan-parent-coordinator.d.ts +0 -87
  355. package/dist/src/runner/mission-plan-parent-coordinator.d.ts.map +0 -1
  356. package/dist/src/runner/mission-plan-parent-coordinator.js +0 -441
  357. package/dist/src/runner/mission-plan-parent-coordinator.js.map +0 -1
  358. package/dist/src/runner/mission-plan-parent.d.ts +0 -156
  359. package/dist/src/runner/mission-plan-parent.d.ts.map +0 -1
  360. package/dist/src/runner/mission-plan-parent.js +0 -589
  361. package/dist/src/runner/mission-plan-parent.js.map +0 -1
  362. package/dist/src/runner/mission-process-executor.d.ts +0 -25
  363. package/dist/src/runner/mission-process-executor.d.ts.map +0 -1
  364. package/dist/src/runner/mission-process-executor.js +0 -182
  365. package/dist/src/runner/mission-process-executor.js.map +0 -1
  366. package/dist/src/runner/mission-publication-git.d.ts +0 -21
  367. package/dist/src/runner/mission-publication-git.d.ts.map +0 -1
  368. package/dist/src/runner/mission-publication-git.js +0 -61
  369. package/dist/src/runner/mission-publication-git.js.map +0 -1
  370. package/dist/src/runner/mission-publication.d.ts +0 -192
  371. package/dist/src/runner/mission-publication.d.ts.map +0 -1
  372. package/dist/src/runner/mission-publication.js +0 -1001
  373. package/dist/src/runner/mission-publication.js.map +0 -1
  374. package/dist/src/runner/mission-quarantine-patch-executor.d.ts +0 -29
  375. package/dist/src/runner/mission-quarantine-patch-executor.d.ts.map +0 -1
  376. package/dist/src/runner/mission-quarantine-patch-executor.js +0 -121
  377. package/dist/src/runner/mission-quarantine-patch-executor.js.map +0 -1
  378. package/dist/src/runner/mission-repository-executor.d.ts +0 -54
  379. package/dist/src/runner/mission-repository-executor.d.ts.map +0 -1
  380. package/dist/src/runner/mission-repository-executor.js +0 -192
  381. package/dist/src/runner/mission-repository-executor.js.map +0 -1
  382. package/dist/src/runner/mission-repository-observer.d.ts +0 -8
  383. package/dist/src/runner/mission-repository-observer.d.ts.map +0 -1
  384. package/dist/src/runner/mission-repository-observer.js +0 -24
  385. package/dist/src/runner/mission-repository-observer.js.map +0 -1
  386. package/dist/src/runner/mission-reservations.d.ts +0 -15
  387. package/dist/src/runner/mission-reservations.d.ts.map +0 -1
  388. package/dist/src/runner/mission-reservations.js +0 -116
  389. package/dist/src/runner/mission-reservations.js.map +0 -1
  390. package/dist/src/runner/mission-resolution-loop.d.ts +0 -172
  391. package/dist/src/runner/mission-resolution-loop.d.ts.map +0 -1
  392. package/dist/src/runner/mission-resolution-loop.js +0 -318
  393. package/dist/src/runner/mission-resolution-loop.js.map +0 -1
  394. package/dist/src/runner/mission-runtime-owner.d.ts +0 -36
  395. package/dist/src/runner/mission-runtime-owner.d.ts.map +0 -1
  396. package/dist/src/runner/mission-runtime-owner.js +0 -174
  397. package/dist/src/runner/mission-runtime-owner.js.map +0 -1
  398. package/dist/src/runner/mission-safe-executor.d.ts +0 -96
  399. package/dist/src/runner/mission-safe-executor.d.ts.map +0 -1
  400. package/dist/src/runner/mission-safe-executor.js +0 -288
  401. package/dist/src/runner/mission-safe-executor.js.map +0 -1
  402. package/dist/src/runner/mission-sandbox.d.ts +0 -16
  403. package/dist/src/runner/mission-sandbox.d.ts.map +0 -1
  404. package/dist/src/runner/mission-sandbox.js +0 -91
  405. package/dist/src/runner/mission-sandbox.js.map +0 -1
  406. package/dist/src/runner/mission-scheduler.d.ts +0 -57
  407. package/dist/src/runner/mission-scheduler.d.ts.map +0 -1
  408. package/dist/src/runner/mission-scheduler.js +0 -205
  409. package/dist/src/runner/mission-scheduler.js.map +0 -1
  410. package/dist/src/runner/mission-scope-expansion.d.ts +0 -47
  411. package/dist/src/runner/mission-scope-expansion.d.ts.map +0 -1
  412. package/dist/src/runner/mission-scope-expansion.js +0 -147
  413. package/dist/src/runner/mission-scope-expansion.js.map +0 -1
  414. package/dist/src/runner/mission-state-machine.d.ts +0 -118
  415. package/dist/src/runner/mission-state-machine.d.ts.map +0 -1
  416. package/dist/src/runner/mission-state-machine.js +0 -316
  417. package/dist/src/runner/mission-state-machine.js.map +0 -1
  418. package/dist/src/runner/mission-state-store.d.ts +0 -70
  419. package/dist/src/runner/mission-state-store.d.ts.map +0 -1
  420. package/dist/src/runner/mission-state-store.js +0 -916
  421. package/dist/src/runner/mission-state-store.js.map +0 -1
  422. package/dist/src/runner/mobile-device-lease.d.ts +0 -11
  423. package/dist/src/runner/mobile-device-lease.d.ts.map +0 -1
  424. package/dist/src/runner/mobile-device-lease.js +0 -121
  425. package/dist/src/runner/mobile-device-lease.js.map +0 -1
  426. package/dist/src/runner/mobile-visual-proof-command.d.ts +0 -17
  427. package/dist/src/runner/mobile-visual-proof-command.d.ts.map +0 -1
  428. package/dist/src/runner/mobile-visual-proof-command.js +0 -168
  429. package/dist/src/runner/mobile-visual-proof-command.js.map +0 -1
  430. package/dist/src/runner/plan-auto-command.d.ts +0 -35
  431. package/dist/src/runner/plan-auto-command.d.ts.map +0 -1
  432. package/dist/src/runner/plan-auto-command.js +0 -918
  433. package/dist/src/runner/plan-auto-command.js.map +0 -1
  434. package/dist/src/runner/plan-auto-recovery.d.ts +0 -83
  435. package/dist/src/runner/plan-auto-recovery.d.ts.map +0 -1
  436. package/dist/src/runner/plan-auto-recovery.js +0 -303
  437. package/dist/src/runner/plan-auto-recovery.js.map +0 -1
  438. package/dist/src/runner/prompt.d.ts +0 -68
  439. package/dist/src/runner/prompt.d.ts.map +0 -1
  440. package/dist/src/runner/prompt.js +0 -202
  441. package/dist/src/runner/prompt.js.map +0 -1
  442. package/dist/src/runner/proof-routing.d.ts +0 -73
  443. package/dist/src/runner/proof-routing.d.ts.map +0 -1
  444. package/dist/src/runner/proof-routing.js +0 -182
  445. package/dist/src/runner/proof-routing.js.map +0 -1
  446. package/dist/src/runner/proof-strategy.d.ts +0 -21
  447. package/dist/src/runner/proof-strategy.d.ts.map +0 -1
  448. package/dist/src/runner/proof-strategy.js +0 -26
  449. package/dist/src/runner/proof-strategy.js.map +0 -1
  450. package/dist/src/runner/recovery.d.ts +0 -25
  451. package/dist/src/runner/recovery.d.ts.map +0 -1
  452. package/dist/src/runner/recovery.js +0 -89
  453. package/dist/src/runner/recovery.js.map +0 -1
  454. package/dist/src/runner/review-gate-policy.d.ts +0 -13
  455. package/dist/src/runner/review-gate-policy.d.ts.map +0 -1
  456. package/dist/src/runner/review-gate-policy.js +0 -241
  457. package/dist/src/runner/review-gate-policy.js.map +0 -1
  458. package/dist/src/runner/review-gates.d.ts +0 -28
  459. package/dist/src/runner/review-gates.d.ts.map +0 -1
  460. package/dist/src/runner/review-gates.js +0 -328
  461. package/dist/src/runner/review-gates.js.map +0 -1
  462. package/dist/src/runner/rework-policy.d.ts +0 -48
  463. package/dist/src/runner/rework-policy.d.ts.map +0 -1
  464. package/dist/src/runner/rework-policy.js +0 -150
  465. package/dist/src/runner/rework-policy.js.map +0 -1
  466. package/dist/src/runner/run-log.d.ts +0 -18
  467. package/dist/src/runner/run-log.d.ts.map +0 -1
  468. package/dist/src/runner/run-log.js +0 -53
  469. package/dist/src/runner/run-log.js.map +0 -1
  470. package/dist/src/runner/runner-handoff-decision.d.ts +0 -48
  471. package/dist/src/runner/runner-handoff-decision.d.ts.map +0 -1
  472. package/dist/src/runner/runner-handoff-decision.js +0 -93
  473. package/dist/src/runner/runner-handoff-decision.js.map +0 -1
  474. package/dist/src/runner/safety.d.ts +0 -14
  475. package/dist/src/runner/safety.d.ts.map +0 -1
  476. package/dist/src/runner/safety.js +0 -31
  477. package/dist/src/runner/safety.js.map +0 -1
  478. package/dist/src/runner/scope-isolation-policy.d.ts +0 -17
  479. package/dist/src/runner/scope-isolation-policy.d.ts.map +0 -1
  480. package/dist/src/runner/scope-isolation-policy.js +0 -82
  481. package/dist/src/runner/scope-isolation-policy.js.map +0 -1
  482. package/dist/src/runner/scoped-auto-command.d.ts +0 -90
  483. package/dist/src/runner/scoped-auto-command.d.ts.map +0 -1
  484. package/dist/src/runner/scoped-auto-command.js +0 -561
  485. package/dist/src/runner/scoped-auto-command.js.map +0 -1
  486. package/dist/src/runner/scoped-recovery.d.ts +0 -78
  487. package/dist/src/runner/scoped-recovery.d.ts.map +0 -1
  488. package/dist/src/runner/scoped-recovery.js +0 -601
  489. package/dist/src/runner/scoped-recovery.js.map +0 -1
  490. package/dist/src/runner/session-home.d.ts +0 -8
  491. package/dist/src/runner/session-home.d.ts.map +0 -1
  492. package/dist/src/runner/session-home.js +0 -18
  493. package/dist/src/runner/session-home.js.map +0 -1
  494. package/dist/src/runner/status-command.d.ts +0 -38
  495. package/dist/src/runner/status-command.d.ts.map +0 -1
  496. package/dist/src/runner/status-command.js +0 -97
  497. package/dist/src/runner/status-command.js.map +0 -1
  498. package/dist/src/runner/target-activity-fence.d.ts.map +0 -1
  499. package/dist/src/runner/target-activity-fence.js.map +0 -1
  500. package/dist/src/runner/terminal-outcome.d.ts +0 -58
  501. package/dist/src/runner/terminal-outcome.d.ts.map +0 -1
  502. package/dist/src/runner/terminal-outcome.js +0 -73
  503. package/dist/src/runner/terminal-outcome.js.map +0 -1
  504. package/dist/src/runner/visual-proof-runner.d.ts +0 -27
  505. package/dist/src/runner/visual-proof-runner.d.ts.map +0 -1
  506. package/dist/src/runner/visual-proof-runner.js +0 -379
  507. package/dist/src/runner/visual-proof-runner.js.map +0 -1
  508. package/dist/src/runner/worktree-cleanup.d.ts +0 -27
  509. package/dist/src/runner/worktree-cleanup.d.ts.map +0 -1
  510. package/dist/src/runner/worktree-cleanup.js +0 -63
  511. package/dist/src/runner/worktree-cleanup.js.map +0 -1
  512. package/dist/src/setup/codex-command-resolver.d.ts +0 -10
  513. package/dist/src/setup/codex-command-resolver.d.ts.map +0 -1
  514. package/dist/src/setup/codex-command-resolver.js +0 -91
  515. package/dist/src/setup/codex-command-resolver.js.map +0 -1
  516. package/dist/src/setup/github-label-adapter.d.ts +0 -13
  517. package/dist/src/setup/github-label-adapter.d.ts.map +0 -1
  518. package/dist/src/setup/github-label-adapter.js +0 -28
  519. package/dist/src/setup/github-label-adapter.js.map +0 -1
  520. package/dist/src/setup/labels.d.ts +0 -27
  521. package/dist/src/setup/labels.d.ts.map +0 -1
  522. package/dist/src/setup/labels.js +0 -42
  523. package/dist/src/setup/labels.js.map +0 -1
  524. package/dist/src/setup/project-config.d.ts +0 -24
  525. package/dist/src/setup/project-config.d.ts.map +0 -1
  526. package/dist/src/setup/project-config.js +0 -678
  527. package/dist/src/setup/project-config.js.map +0 -1
  528. package/dist/src/setup/prompt-sync.d.ts +0 -14
  529. package/dist/src/setup/prompt-sync.d.ts.map +0 -1
  530. package/dist/src/setup/prompt-sync.js +0 -228
  531. package/dist/src/setup/prompt-sync.js.map +0 -1
  532. package/dist/src/setup/setup-command.d.ts +0 -29
  533. package/dist/src/setup/setup-command.d.ts.map +0 -1
  534. package/dist/src/setup/setup-command.js +0 -304
  535. package/dist/src/setup/setup-command.js.map +0 -1
  536. package/dist/src/setup/skill-runtime-v2-preparation.d.ts +0 -56
  537. package/dist/src/setup/skill-runtime-v2-preparation.d.ts.map +0 -1
  538. package/dist/src/setup/skill-runtime-v2-preparation.js +0 -304
  539. package/dist/src/setup/skill-runtime-v2-preparation.js.map +0 -1
  540. package/dist/src/setup/workflows.d.ts +0 -10
  541. package/dist/src/setup/workflows.d.ts.map +0 -1
  542. package/dist/src/setup/workflows.js +0 -41
  543. package/dist/src/setup/workflows.js.map +0 -1
  544. package/prompts/setup-skill.md +0 -12
  545. package/prompts/workflows/acceptance-proof.md +0 -29
  546. package/prompts/workflows/breakdown-review.md +0 -48
  547. package/prompts/workflows/issue-breakdown.md +0 -155
  548. package/prompts/workflows/issue-tree-orchestration.md +0 -163
  549. package/prompts/workflows/prd.md +0 -80
  550. package/prompts/workflows/scoped-implementation.md +0 -129
  551. package/prompts/workflows/triage.md +0 -149
  552. /package/dist/src/{process → v2/adapters}/command.d.ts +0 -0
  553. /package/dist/src/{process → v2/adapters}/command.js +0 -0
  554. /package/dist/src/{fs → v2/adapters}/durable-atomic-file.d.ts +0 -0
  555. /package/dist/src/{fs → v2/adapters}/durable-atomic-file.js +0 -0
  556. /package/dist/src/{github → v2/adapters}/gh-cli.d.ts +0 -0
  557. /package/dist/src/{github → v2/adapters}/gh-cli.js +0 -0
  558. /package/dist/src/{github → v2/adapters}/gh-issue-adapter.d.ts +0 -0
  559. /package/dist/src/{github → v2/adapters}/gh-issue-adapter.js +0 -0
  560. /package/dist/src/{github → v2/adapters}/gh-pull-request-adapter.d.ts +0 -0
  561. /package/dist/src/{github → v2/adapters}/gh-pull-request-adapter.js +0 -0
  562. /package/dist/src/{github → v2/adapters}/issues.d.ts +0 -0
  563. /package/dist/src/{github → v2/adapters}/issues.js +0 -0
  564. /package/dist/src/{runner → v2/adapters}/mission-coordinator-lock.d.ts +0 -0
  565. /package/dist/src/{runner → v2/adapters}/mission-coordinator-lock.js +0 -0
  566. /package/dist/src/{path-policy.d.ts → v2/adapters/path-policy.d.ts} +0 -0
  567. /package/dist/src/{path-policy.js → v2/adapters/path-policy.js} +0 -0
  568. /package/dist/src/{github → v2/adapters}/pull-requests.d.ts +0 -0
  569. /package/dist/src/{github → v2/adapters}/pull-requests.js +0 -0
  570. /package/dist/src/{runner → v2/adapters}/target-activity-fence.d.ts +0 -0
package/docs/deep-dive.md CHANGED
@@ -1,835 +1,86 @@
1
- # codex-orchestrator Deep Dive
1
+ # Runner architecture
2
2
 
3
- This document is the technical companion to the main README. The README explains
4
- what problem `codex-orchestrator` solves and how to start using it. This file
5
- describes how the package works internally, what features it provides, and where
6
- the main control points are.
3
+ ## One public runtime
7
4
 
8
- ## System Role
5
+ The package bin is `dist/src/v2/candidate-cli.js`; `candidate-cli` is only the historical source filename. It is the sole public CLI and routes `setup`, `doctor`, `status`, direct `run`, and serial `daemon` commands. The root package export exposes only V2 contracts.
9
6
 
10
- `codex-orchestrator` is a local runner that connects four things:
7
+ The runtime is split into a policy core under `src/v2/` and a small package-owned adapter closure under `src/v2/adapters/`. No earlier runner implementation is shipped or executed.
11
8
 
12
- - GitHub Issues as the work queue;
13
- - GitHub labels as the authorization and state model;
14
- - git worktrees as isolated implementation workspaces;
15
- - Codex CLI as the implementation agent.
9
+ ## Trust boundary
16
10
 
17
- The runner does not replace human review. It prepares work for review. A
18
- successful run ends with a pushed branch, a draft pull request, issue comments,
19
- and review labels. It does not auto-merge.
11
+ The Runner is trusted. It owns:
20
12
 
21
- ## Package vs Repository Policy
13
+ - issue discovery and authorization;
14
+ - worktree and durable state ownership;
15
+ - finite check execution;
16
+ - process launch, timeout, cancellation, and quiescence;
17
+ - Git commits, branches, pushes, pull requests, labels, and comments;
18
+ - mobile leases and proof artifact validation.
22
19
 
23
- The npm package contains reusable orchestration logic:
20
+ Implementation and proof Codex processes are untrusted workers. They receive bounded input, a dedicated tool home, a safe `PATH`, and only explicitly allowed non-secret tool environment values. Ordinary Codex execution and native Codex subagents may use the same user-owned Codex authentication and can read files available to the same local OS user; the containment certificate records this explicitly. GitHub, SSH, npm, and cloud publication credentials are scrubbed, and operations that require external authority remain finite Runner-owned actions.
24
21
 
25
- - CLI commands;
26
- - config schema and validation;
27
- - GitHub issue and PR operations;
28
- - worktree and branch management;
29
- - Codex prompt execution;
30
- - validation and review-gate evaluation;
31
- - durable local state and recovery reports.
22
+ This boundary prevents prompt content or repository code from receiving external publication authority. It does not claim OS-level secrecy from the current local user, so reports and artifacts are separately checked for credential/path disclosure. A child can implement, inspect, test, and report; the Runner performs authorized publication after validation.
32
23
 
33
- Each target repository owns its policy under `.codex-orchestrator/`:
24
+ ## Configuration
34
25
 
35
- - `config.json` for labels, branches, checks, gates, deny rules, and runner
36
- behavior;
37
- - `prompts/` for repo-local prompts used by Codex workflows;
38
- - proof and artifact directories created during runs.
26
+ `.codex-orchestrator/config.json` is an exact, versioned contract. Unknown keys and removed policy surfaces are rejected. It names one GitHub repository, four labels (`auto`, `running`, `blocked`, `review`), one branch template, a serial polling interval, five implementation cycles, one Codex command contract, finite checks, one proof artifact directory, and deny lists.
39
27
 
40
- This split keeps the package generic while letting each repository choose how
41
- strict autonomous work should be.
28
+ The committed config contains policy, never live run state or credentials. Durable runtime state is stored beneath the configured state directory and the Runner's private home.
42
29
 
43
- ## CLI Commands
30
+ ## `runIssue`
44
31
 
45
- ### `health`
32
+ Direct runs and daemon-discovered runs call the same lifecycle:
46
33
 
47
- Checks whether the CLI can run in the current environment. It is intended as a
48
- quick sanity check after installation.
34
+ 1. Snapshot issue and repository identity.
35
+ 2. Verify authorization and acquire fenced ownership.
36
+ 3. Create or reconcile the issue worktree.
37
+ 4. Run one implementation attempt and validate its structured report.
38
+ 5. Inspect all tracked, staged, unstaged, untracked, and ignored denied-path changes.
39
+ 6. Commit the validated implementation candidate locally.
40
+ 7. Run configured checks and create a nominal `CheckedChange` bound to exact Git and content hashes.
41
+ 8. Run Acceptance Proof against that binding.
42
+ 9. Publish with durable intents and postcondition reconciliation.
43
+ 10. Persist and return one typed terminal or resumable result.
49
44
 
50
- ### `setup`
45
+ Implementation findings return to the same worktree for at most five cycles. A malformed report gets one report-only repair; a clean transport disconnect gets one separate transport retry. Neither budget silently becomes another implementation cycle.
51
46
 
52
- Creates project-local config and prompt files under `.codex-orchestrator/`.
47
+ ## Durable effects
53
48
 
54
- Important behavior:
49
+ Every external or non-idempotent operation uses intent-before-effect and confirmation-after-observation. On restart, the Runner inspects the durable intent and remote/local postcondition before deciding whether to retry. It does not infer failure merely from a lost response.
55
50
 
56
- - infers GitHub owner and repo from `git remote origin` by default;
57
- - can override owner, repo, or target path with flags;
58
- - can create missing GitHub labels with `--prepare-labels`;
59
- - can preview changes with `--dry-run`;
60
- - copies package-owned fallback prompts when local skills are missing;
61
- - does not launch Codex, commit files, or open pull requests.
51
+ Atomic files use write, flush, rename, and directory synchronization where supported. Locks and leases carry fencing tokens and process/boot identity. Unknown ownership or inability to prove process-group absence is a safe halt, not permission to continue.
62
52
 
63
- ### `status`
53
+ ## Checks and publication
64
54
 
65
- Reads GitHub Issues and local runner state, then reports:
55
+ Checks are configured finite commands executed by the Runner. Arbitrary agent-proposed shell commands do not become Runner authority. A check result is bound into `CheckedChange`; any later Git, index, tracked-content, untracked-content, worktree, or check-policy drift invalidates proof.
66
56
 
67
- - issues eligible for autonomous work;
68
- - skipped issues and the reason they were skipped;
69
- - blocked or recoverable local state.
57
+ Only the Runner publishes. The implementation and proof processes cannot push, open a pull request, alter labels, or post comments. Publication is resumable and verifies exact repository, branch, commit, and remote postconditions.
70
58
 
71
- `status` is read-only. It does not mutate GitHub or launch Codex.
72
-
73
- ### `run`
74
-
75
- Executes one selected issue when its labels and state allow autonomous work.
76
-
77
- `run` supports both authorization modes:
78
-
79
- - `agent:auto` for one scoped implementation issue;
80
- - `agent:plan-auto` for parent planning and issue-tree execution.
81
-
82
- ### `daemon`
83
-
84
- Polls GitHub Issues for eligible autonomous work. Scoped `agent:auto` issues can
85
- run concurrently up to the daemon concurrency limit when their runner metadata
86
- declares non-overlapping ownership. `agent:plan-auto` parent runs are exclusive.
87
-
88
- The daemon applies the configured issue selection policy after safety filters.
89
- By default, priority labels sort eligible issues and issue number is the
90
- deterministic tie-breaker.
91
-
92
- Parallel scoped issue selection uses the issue body section
93
- `## codex-orchestrator metadata` and its `Ownership:` bullet list. Issues without
94
- that metadata are treated as unknown ownership and run one at a time. Two scoped
95
- issues cannot share a batch when their ownership entries are the same path or
96
- match each other as supported path globs.
97
-
98
- After polling, the daemon can clean up runner-owned worktrees whose pull
99
- requests have already been merged. Dirty, blocked, active, or unpublished
100
- worktrees are preserved.
101
-
102
- ### `acceptance-proof validate`
103
-
104
- Validates the machine-readable Acceptance Proof report shape from a local file.
105
- Proof agents use this command before returning their final JSON, and the runner
106
- uses the same report contract when it reads `acceptance-proof-report.json`.
107
-
108
- ## Issue Authorization Model
109
-
110
- The runner only starts work that is explicitly authorized.
111
-
112
- Default labels:
113
-
114
- - `agent:auto` authorizes one standalone scoped implementation run;
115
- - `agent:plan-auto` authorizes parent planning and child issue execution;
116
- - `agent:child` marks child issues that belong to an autonomous parent tree
117
- and is not a standalone authorization label;
118
- - `agent:running` means a runner has claimed the issue;
119
- - `agent:blocked` means maintainer input or manual recovery is needed;
120
- - `agent:manual` reserves the issue for human work;
121
- - `agent:review` means the result is ready for human review.
122
-
123
- Issues are skipped when they are closed, manual, blocked, already running,
124
- already in review, or otherwise not authorized by policy.
125
-
126
- Child issues are not inferred from ordinary GitHub links, milestones, project
127
- fields, or casual references. They must carry the configured child label and the
128
- runner-owned parent marker. Child issues do not use `agent:auto`; the parent
129
- `agent:plan-auto` flow owns child execution through the marker, child label, and
130
- AFK/HITL metadata.
59
+ ## Acceptance Proof
131
60
 
132
- ## Scoped Issue Run
61
+ Acceptance Proof receives the issue snapshot, frozen criteria, and nominal checked-change capability. It runs in a separate contained Codex process and writes only proof-owned artifacts.
133
62
 
134
- For an `agent:auto` issue, the runner follows this lifecycle:
63
+ The Runner validates:
135
64
 
136
- 1. Load config and validate policy.
137
- 2. Fetch the issue from GitHub.
138
- 3. Check labels and state.
139
- 4. Claim the issue with the running label.
140
- 5. Create a runner-owned branch and git worktree.
141
- 6. Build a prompt from the issue, config, and scoped implementation workflow.
142
- 7. Run Codex CLI in the issue worktree.
143
- 8. Read the Codex completion report.
144
- 9. Collect the full local change set.
145
- 10. Run configured validation checks.
146
- 11. Run acceptance proof when required.
147
- 12. Evaluate quality gates and deny rules.
148
- 13. Optionally run one report/evidence repair for safe runner-owned evidence gaps.
149
- 14. Optionally run bounded rework for machine-checkable blockers.
150
- 15. Optionally run Fresh-Context Review.
151
- 16. Write durable run evidence.
152
- 17. Push the branch.
153
- 18. Open a draft pull request.
154
- 19. Post the review report and move the issue to review.
65
+ - exact report schema and criterion IDs;
66
+ - artifact root containment, size, hash, UTF-8, and freshness;
67
+ - credentials in every text artifact;
68
+ - host identity and publication type for public artifacts;
69
+ - no product diff during proof;
70
+ - browser workflow and viewport evidence when visual;
71
+ - exact Android or iOS lease ownership for mobile evidence;
72
+ - unchanged checked-change freshness after proof.
155
73
 
156
- If a blocking condition is found, the runner does not publish the result. It
157
- marks the issue blocked, preserves useful local evidence, and reports the
158
- reason.
74
+ Command output and static inspection may remain local and include machine paths. They are not public evidence. Screenshots and sanitized generated summaries may be publishable when their stricter checks pass.
159
75
 
160
- ## Parent Planning and Child Waves
76
+ ## Setup and cutover
161
77
 
162
- `agent:plan-auto` is for larger work that should be planned before
163
- implementation.
78
+ `setup` creates or verifies V2 config. `--prepare-labels` performs only the requested GitHub label preparation. `doctor` and `status` are read-only inspections.
164
79
 
165
- The parent flow can:
80
+ Recognized earlier config is parsed only by the bounded cutover reader. `setup --fresh` acquires both ownership fences, proves no active old claims, saves immutable backup evidence, and publishes V2 config last. The old runtime never executes as part of this process.
166
81
 
167
- - ask Codex to produce or update the PRD;
168
- - break the parent into child implementation issues;
169
- - review the breakdown;
170
- - triage child issues;
171
- - identify which children are safe for autonomous execution;
172
- - run children in dependency-aware waves;
173
- - merge successful child branches into one integration branch;
174
- - validate the integration branch;
175
- - open one integration draft PR.
176
-
177
- Parallel child execution is bounded by `runner.maxParallelChildren`. Parallel
178
- standalone scoped execution is bounded by `runner.maxParallelScopedIssues` or
179
- the daemon `--concurrency` override. Child and standalone work use separate
180
- worktrees so concurrent runs do not share a mutable workspace.
181
-
182
- ## Full Change-Set Awareness
183
-
184
- The runner evaluates the whole result of an agent run:
185
-
186
- - local commits;
187
- - staged files;
188
- - unstaged files;
189
- - untracked files.
190
-
191
- This matters because Codex may be allowed to create local commits. Those commits
192
- are still treated as untrusted agent output until the runner validates them.
193
-
194
- The runner owns external publication:
195
-
196
- - pushing branches;
197
- - opening draft PRs;
198
- - moving labels;
199
- - posting comments;
200
- - merging child branches into integration branches;
201
- - publishing packages or deploying.
202
-
203
- If agent output attempts to bypass those boundaries, the run is blocked.
204
-
205
- ## Validation Checks
206
-
207
- Configured checks live in `.codex-orchestrator/config.json`.
208
-
209
- Typical checks include commands such as:
210
-
211
- ```json
212
- {
213
- "checks": {
214
- "test": "npm test",
215
- "typecheck": "npm run typecheck"
216
- }
217
- }
218
- ```
219
-
220
- Setup and runtime config loading adapt package-owned default `npm run <script>`
221
- checks to the target `package.json`: unsupported default npm checks are omitted
222
- when `checksPolicy.missingNpmScript` is `skip`, while custom checks are
223
- preserved. Repositories can make missing scripts fail with
224
- `checksPolicy.missingNpmScript`.
225
-
226
- For repositories with existing lint debt, `checksPolicy.lintBaseline.mode` can
227
- be set to `touched-only`. In that mode, a repo-wide lint failure can be
228
- downgraded when a separate touched-files lint command passes.
229
-
230
- In scoped child publishability, failed configured checks are recorded as
231
- residual-risk warnings instead of blocking publication when the completion
232
- report already carries the agent's focused validation and proof evidence. This
233
- keeps unrelated repo-wide baseline failures visible without making small scoped
234
- work brittle. Failed validation that the agent reports as its own proof still
235
- blocks publication, and parent integration configured checks can still block the
236
- parent handoff.
237
-
238
- ## Review Gates
239
-
240
- Review gates are runner-enforced checks that decide whether a result can be
241
- published for human review.
242
-
243
- The quality gate can require:
244
-
245
- - strict TDD red-to-green evidence;
246
- - a changed test file when runtime code changed;
247
- - code review evidence;
248
- - cleanup review evidence for larger runtime changes.
249
-
250
- TDD proof can be reported as structured validation evidence inside the existing
251
- completion-report `validation[]` array:
252
- `evidence.kind: "tdd-red-green"` with a failed red command and a passed green
253
- command. Legacy summary text is still accepted as a fallback, but structured
254
- evidence is the primary path.
255
-
256
- Runtime and test paths are configurable through:
257
-
258
- - `reviewGates.quality.runtimeChangedPathGlobs`;
259
- - `reviewGates.quality.testChangedPathGlobs`.
260
-
261
- The acceptance proof gate can require runner-owned proof artifacts when issue
262
- text or changed paths indicate UI, API, worker, CLI, or smoke-verifiable work.
263
- `reviewGates.acceptanceProof` is canonical; `reviewGates.visualProof` remains a
264
- configuration migration adapter for existing screenshot and mobile proof policy.
265
-
266
- The risk-routing gate checks declared review metadata instead of inferring risk
267
- with an LLM. `reviewGates.riskRouting` defaults to enabled `warn` mode so older
268
- repositories surface findings without unexpected publication blocks. In
269
- `block` mode, the same findings become publication blockers.
270
-
271
- For scoped runs, risk routing checks the completion report `reviewHandoff`:
272
-
273
- - required handoff fields must be present and non-empty;
274
- - `agentVerifiedChecks` must identify checks the agent completed before handoff;
275
- - `maintainerOnlyChecks` may be empty, but every listed item must include
276
- `reasonAgentCouldNotVerify`, and runnable commands or code-inspection checks
277
- belong in validation/proof evidence instead of maintainer-only work;
278
- - low-risk claims must use an allowed low-risk flow;
279
- - configured `riskyChangedPathGlobs` can flag low-risk claims that changed
280
- risky paths;
281
- - high-risk claims require passed code-review validation when
282
- `highRiskRequiresCodeReview` is true.
283
-
284
- Low-risk routing never weakens existing quality, acceptance proof, visual proof,
285
- deny, or configured-check gates. It can only add warnings or blockers.
286
- Scoped risk-routing blockers are retryable only when
287
- `loopPolicy.rework.retryableBlockers` explicitly includes
288
- `risk-routing-policy`.
289
-
290
- For parent `agent:plan-auto` runs, risk routing checks the planning report after
291
- it is read and before parent content or child issues are mutated. Parent
292
- `sizeRisk` must partition every child stable id exactly once across
293
- `small`, `medium`, and `high`; `parentReviewHandoff` must include risks, proof
294
- strategy, and human review focus. In warn mode, findings render under
295
- `Risk routing warnings` in the parent PR body and review report while execution
296
- continues. In block mode, the parent stops at that point and does not create
297
- child issues, execute children, create a draft PR, or attempt parent planning
298
- rework.
82
+ ## Live validation
299
83
 
300
- ## Acceptance Proof
84
+ Local validation is `npm run typecheck`, `npm test`, and `npm pack --dry-run --json`. Build removes `dist` first so deleted modules cannot leak into tests or tarballs.
301
85
 
302
- Acceptance proof is intentionally runner-owned. Codex can implement product
303
- behavior, but the runner decides whether proof is required, starts the proof
304
- phase after implementation, validates the proof report, and makes the final
305
- publishability decision. Runtime config loading still preserves package-owned
306
- visual proof behavior for older configs where visual proof is enabled but no
307
- runner command is set, but screenshot-only command success is not sufficient for
308
- Acceptance Proof.
309
-
310
- Adaptive Acceptance Proof is the canonical proof model. Instead of treating a
311
- screenshot or a final agent sentence as enough evidence, the runner can launch a
312
- separate `acceptance-proof` Codex phase with the issue, changed files,
313
- implementation evidence, and repository proof policy. Repositories opt into that
314
- adaptive Codex proof session by configuring `codex.profiles.acceptance-proof`;
315
- existing runner-owned visual/mobile proof commands remain evidence producers, not
316
- standalone pass conditions. The adaptive phase can navigate a browser, inspect
317
- mobile UI state, run API or CLI checks, inspect logs, or create a focused
318
- live-smoke check for observable product behavior. The proof phase writes
319
- artifacts under the runner-owned proof directory and writes a machine-readable
320
- `acceptance-proof-report.json`.
321
-
322
- The gate is selected when `reviewGates.acceptanceProof.enabled` is true and
323
- either:
324
-
325
- - the issue title or body matches `reviewGates.acceptanceProof.issueTextPatterns`;
326
- or
327
- - the implementation changed a path matched by
328
- `reviewGates.acceptanceProof.changedPathGlobs`.
329
-
330
- The proof phase is not an implementation phase. It has no publication authority
331
- and must not edit GitHub issues, labels, comments, branches, pull requests,
332
- releases, or deployments. If a proof script needs repair, edits must stay inside
333
- `reviewGates.acceptanceProof.proofOwnedPathGlobs`. Product-code changes during
334
- proof are blockers, even when the proof report claims success.
335
-
336
- The proof report has three top-level outcomes:
337
-
338
- - `passed` means every required acceptance criterion has `status: "passed"`,
339
- `confidence: "high"`, and at least one artifact reference.
340
- - `needs-rework` means proof found missing or uncertain product behavior and
341
- returns a concrete rework request for the next implementation attempt.
342
- - `blocked` means proof could not continue safely, for example because the
343
- environment is missing required credentials or tooling.
344
-
345
- The runner validates the report independently. It rejects malformed JSON, empty
346
- criteria, low or medium confidence, failed or unknown criteria, missing artifact
347
- references, artifact paths that do not exist, and forbidden product-code diffs
348
- from the proof phase.
349
-
350
- Adaptive proof prompts include a minimal report template and require the proof
351
- agent to validate the report with `codex-orchestrator acceptance-proof validate
352
- --report "$CODEX_ORCHESTRATOR_PROOF_REPORT_PATH"` before returning the final
353
- JSON. If an adaptive proof report is structurally invalid, the runner may ask
354
- the proof phase to repair the report once; repeated schema failure blocks rather
355
- than consuming another product implementation rework attempt.
356
-
357
- For UI proof, the proof report must satisfy the UI Evidence Contract. Screenshot
358
- or UI-dump artifacts must be mapped to:
359
-
360
- - the exact user workflow under test, including the relevant entrypoint and
361
- create/edit/detail context;
362
- - viewport coverage, with wide desktop required for web layout proof and mobile
363
- required when the issue or acceptance criteria mention responsive or mobile
364
- behavior;
365
- - artifact freshness, so the report identifies the current post-run artifact
366
- rather than an old or intermediate screenshot;
367
- - visual layout review for spacing, padding, clipping, overlap, alignment, and
368
- the specific visual complaint being verified;
369
- - user-facing copy review, including absence of rejected implementation terms
370
- when copy is part of the acceptance path;
371
- - source inputs that show how the proof derived task-specific checks from issue
372
- criteria, implementation evidence, reproduction signals, runtime validation,
373
- and any Manual QA Plan content.
374
-
375
- If authentication is required and smoke or admin credentials are available
376
- through configured environment variables, UI proof should use the real sign-in
377
- flow. Session or cookie seeding is allowed only when the report records why the
378
- normal UI login path is unavailable or irrelevant to the acceptance criteria.
379
-
380
- This borrows workflow discipline from UI proof systems such as Symphony:
381
- user-facing changes should have an end-to-end UI walkthrough, a reproduction
382
- signal when one exists, runtime/media evidence for app-touching work, and Manual
383
- QA Plan expectations when provided. Codex Orchestrator enforces those inputs
384
- through the runner-validated Proof Report rather than requiring Symphony's
385
- Linear workpad or PR media workflow.
386
-
387
- When proof returns `needs-rework`, the runner feeds the rework request back into
388
- the bounded implementation loop. The maximum number of implementation-plus-proof
389
- iterations is controlled by `reviewGates.acceptanceProof.maxIterations`; the
390
- runner keeps the issue claimed while the loop continues. A successful proof can
391
- continue to the normal publishability gates and draft PR handoff. A terminal
392
- proof blocker marks the issue blocked and preserves the proof prompt, report
393
- path, artifact directory, validation line, residual risks, and blocker summary in
394
- runner evidence.
395
-
396
- Child Codex processes receive a mobile-device guard directory at the front of
397
- `PATH`. The guard blocks direct device/emulator control through `adb`,
398
- `emulator`, Flutter device-control subcommands, and `xcrun simctl`. Adaptive
399
- proof Codex phases keep that guard, so they can inspect and verify behavior
400
- without independently owning shared devices. Runner-owned mobile proof commands
401
- use the shared mobile lease described below.
402
-
403
- The proof phase often runs browser automation, such as Playwright, but the same
404
- contract applies to non-visual proof. A live-smoke proof can exercise an API,
405
- worker, CLI, or other observable behavior and save the command output as a
406
- `smoke-output` artifact.
407
-
408
- Implementation agents declare the intended proof mode in the scoped completion
409
- report `proofPlan`. Supported modes are `none`, `non-visual-smoke`, `cli`,
410
- `api`, `worker`, `browser-visual`, and `mobile-visual`. The child agent must
411
- choose the narrowest mode that proves the issue; this is an implementation
412
- intent signal, not proof by itself. The runner remains the authority and
413
- validates that plan against the issue `Proof Strategy` before publication.
414
- Changed files and issue-text patterns decide whether Acceptance Proof applies;
415
- under `Proof Strategy: auto`, they are routing hints rather than proof-mode
416
- requirements.
417
-
418
- For accepted non-visual modes, the runner uses a report-validation proof path
419
- instead of dispatching browser or mobile proof. Report validation checks the
420
- completion report itself:
421
-
422
- - `proofPlan.validationCommands` must contain non-empty command strings, and
423
- each command must exactly match a passed `validation[].command`;
424
- - `proofPlan.requiredArtifacts` must contain non-empty artifact targets, and
425
- each target must exactly match a reported artifact `path` or `url`;
426
- - `reviewHandoff.proofByAcceptanceCriteria` must map the evidence to the
427
- acceptance criteria.
428
-
429
- If those checks pass, the acceptance proof evidence records
430
- `completion-report:proofPlan` and `completion-report:artifacts` as the proof
431
- source. If they fail, publication blocks and the next implementation attempt must
432
- repair the report or provide real evidence. A non-visual `proofPlan` cannot
433
- downgrade an explicit `visual`, `browser-visual`, or `mobile-visual` issue
434
- strategy. Under `auto`, however, frontend or mobile paths do not independently
435
- create a visual requirement: a non-visual refactor with mapped CLI, API, worker,
436
- or smoke evidence remains on report validation. Issue generators should emit an
437
- explicit non-`auto` strategy when acceptance criteria actually require browser
438
- or device behavior. Once a non-visual plan is accepted, the legacy visual review
439
- gate cannot re-infer a screenshot requirement from changed paths, including when
440
- `visualProof.requireWhenDesirable` is enabled.
441
-
442
- For browser, mobile, and adaptive proof phases, the runner provides environment
443
- variables for:
444
-
445
- - issue number;
446
- - artifact directory;
447
- - proof directory;
448
- - Playwright profile directory;
449
- - worktree path;
450
- - changed files;
451
- - target root and shared state directory when the runner knows them;
452
- - mobile device lock directory for runner-owned Android proof.
453
-
454
- Proof artifacts created under the proof directory are attached to the PR and
455
- issue review report. Supported artifact types include screenshots, UI dumps,
456
- logs, smoke outputs, and other explicit artifacts. Screenshots remain supported
457
- for visual proof, but screenshot existence alone is not sufficient: each required
458
- criterion must map to high-confidence artifact evidence in the proof report, and
459
- UI artifacts must satisfy the UI Evidence Contract.
460
-
461
- Scoped issue review comments render a concise human digest first: outcome,
462
- changed-file count, proof status, key artifacts, review focus, and audit links.
463
- Full validation details, policy suggestions, and proof records remain in the
464
- durable run summary, proof report, and log artifacts instead of being duplicated
465
- as a long issue-comment transcript.
466
-
467
- Visual proof reporting separates desire from capability. UI-like issue text or
468
- changed frontend paths can make visual proof desirable, but the runner only emits
469
- missing-screenshot artifact warnings when a runner-owned provider is configured
470
- and has not reported a tooling/provider capability gap. If proof is desirable
471
- but no command, device, emulator, or platform tooling is available, the review
472
- report records a capability note instead of an actionable-looking artifact
473
- warning. Repositories that intentionally want visual-desirable work to block
474
- review-ready publication until proof is produced can set
475
- `reviewGates.visualProof.requireWhenDesirable` to `true`.
476
-
477
- Setup now uses the package-owned
478
- `codex-orchestrator visual-proof auto --issue ${issueNumber}` command. Auto
479
- dispatch uses one shared policy owner after a visual proof plan has been selected:
480
- web/frontend paths route to browser proof, while Android, iOS, Flutter, and
481
- mobile app paths remain device-backed. Those path matches do not convert an
482
- accepted non-visual plan into visual proof. For runner-owned command proof, the
483
- validated `proofPlan.mode` is passed to `visual-proof auto` and is authoritative;
484
- path inference remains only a fallback for direct command use without a validated
485
- plan.
486
- When acceptance proof is required but the changed paths are backend/API/CLI-only
487
- and visual proof is not desirable, auto proof does not force a browser or mobile
488
- target; the runner validates the child completion report `proofPlan`, validation
489
- lines, artifacts, and review handoff instead. Acceptance-proof command selection
490
- uses only the canonical acceptance-proof policy; `visualProof` command settings
491
- are not treated as Acceptance Proof compatibility input.
492
-
493
- For web UI work, `codex-orchestrator visual-proof browser` reads a proof-owned
494
- browser scenario, drives Playwright Core against an explicit base URL, and
495
- writes screenshots, DOM snapshots, console logs, network failure logs, a run
496
- summary, and `acceptance-proof-report.json` under the runner proof directory.
497
- Before downloading a browser, the command first uses an explicit
498
- `CODEX_ORCHESTRATOR_BROWSER_EXECUTABLE_PATH` when provided, then looks for an
499
- installed Chrome, Chromium, or Edge executable. If no installed browser is
500
- available, Playwright's existing browser cache is tried; only a missing-browser
501
- launch failure triggers `playwright-core install chromium` and one retry.
502
- Scenarios are versioned and must map criteria to named screenshot or DOM
503
- checkpoints. Missing scenarios, malformed scenarios, missing Playwright/browser
504
- runtime, blocked auth metadata, or browser launch failures produce blocked
505
- proof. Assertion failures produce `needs-rework`. Console and network failures
506
- are always recorded and can be configured as blockers through
507
- `reviewGates.acceptanceProof.browserProof`.
508
-
509
- For mobile UI work, the auto command selects the package-owned mobile proof
510
- path. The mobile command detects Flutter, native Android, and native iOS
511
- projects. It tries
512
- Android first when an Android target exists, resolving SDK tools from
513
- environment variables, `PATH`, and the default macOS, Linux, and Windows SDK
514
- locations. Android proof takes a runner-owned mobile device lease under the
515
- shared state directory before selecting a connected device, starting an AVD, or
516
- using adb, so parallel issue work cannot race over one emulator. If Android
517
- tooling or devices are unavailable on macOS and an iOS target exists, it falls
518
- back to the iOS simulator. Native iOS projects go directly through Xcode
519
- simulator tooling with a writable DerivedData path. Repos that need a specific
520
- Flutter launch config, flavor, Gradle install task, package name, iOS scheme, or
521
- bundle id pass that through command flags or `CODEX_ORCHESTRATOR_*` environment
522
- variables. Missing mobile tooling or no usable device is reported as a concrete
523
- warning instead of a release blocker by itself.
524
-
525
- ## Loop Policy
526
-
527
- Loop Policy controls runner-owned automation around retries and evidence.
528
-
529
- It includes:
530
-
531
- - issue selection priority labels and tie-breaker;
532
- - bounded rework attempts;
533
- - retryable blocker types;
534
- - Fresh-Context Review;
535
- - Durable Run Summaries;
536
- - non-mutating Policy Suggestions.
537
-
538
- Bounded rework is limited to machine-checkable blockers such as missing or
539
- invalid completion reports, incomplete progress after an exact idle timeout, no
540
- changed files, parent integration configured-check failures, or missing
541
- quality-gate evidence.
542
- `ReworkDecision` classifies each blocked attempt as `retry`, `exhausted`, or
543
- `hard-block` from typed `RunnerBlocker` evidence. Legacy reason strings still go
544
- through one compatibility adapter, but runner-owned gates should emit typed
545
- blockers so wording changes do not change retry behavior. Retry uses zero-based
546
- attempts: attempt `0` is the original run, and retry continues only while
547
- `attempt < maxAttempts`.
548
-
549
- Before implementation rework, publishability may run bounded evidence repair:
550
-
551
- - Missing or invalid completion reports can be repaired once after the runner has
552
- proven non-empty safe changed files, deny policy, scope isolation, and
553
- publication boundaries.
554
- - Missing review-gate evidence such as TDD, cleanup/code-review, or scoped
555
- `reviewHandoff` can be repaired once after changed files, configured checks,
556
- and acceptance proof have already passed.
557
- - Repair sessions write only the original completion report path. They cannot
558
- edit product files, create commits, mutate GitHub, weaken deny/scope gates, or
559
- bypass configured checks, acceptance proof, or review gates.
560
- - The runner captures `HEAD` and a content fingerprint of the protected worktree
561
- changes before and after repair. If `HEAD` changes, or protected content
562
- changes, repair terminal-blocks. When the report path is inside the worktree,
563
- only that exact normalized path is excluded from the protected fingerprint.
564
- - Completion-report and evidence repair attempts are recorded in durable
565
- summaries, blocked reports, and review-ready handoff evidence with prompt,
566
- report, log, status, and blocker keys.
567
-
568
- Exact idle timeouts use runner-classified blockers, not raw Codex exit strings.
569
- The runner emits one only when all of these are true:
570
-
571
- - Codex exits with code `124` and stdout or stderr contains an exact line
572
- `Command idle timed out after <positive integer>ms.`;
573
- - the scoped completion report is missing;
574
- - runner-owned publication has not been violated.
575
-
576
- When the collected change set is empty, the blocker is
577
- `idle-timeout-before-change`. Its default retry starts once from the clean
578
- worktree and preserves that reason in the rework prompt and terminal evidence.
579
- This is distinct from `no-changed-files`, which means Codex produced a normal
580
- completion report but did not implement a change.
581
-
582
- When the change set contains files, the runner additionally requires that
583
- changed paths do not match denied path policy and scope isolation has no
584
- blockers. A safe non-empty change set becomes `incomplete-after-progress`, and
585
- the retry continues from the existing worktree.
586
-
587
- If the same idle timeout produced a valid completion report, publishability
588
- continues through the normal report-based path. If the report is invalid, paths
589
- are denied or out of scope, publication was violated, or the exit is a generic
590
- command timeout or arbitrary exit code `124`, the runner keeps the existing
591
- hard blocker. Idle recovery runs only when `loopPolicy.rework.retryableBlockers`
592
- includes the corresponding typed key and the bounded rework budget has not been
593
- exhausted. Terminal blocked or exhausted evidence preserves the collected
594
- `changedFiles` when a change set was available, so
595
- maintainers can see what partial work the retry decision was based on.
596
- Runtime config loading backfills `idle-timeout-before-change` so existing target
597
- configs receive this package-owned recovery policy without requiring a setup
598
- rewrite.
599
-
600
- Hard blockers always stop publication. These include denied paths,
601
- runner-owned publication violations, destructive database/cache actions,
602
- production deploy/release actions, unknown Codex exits, and required Figma MCP
603
- failures. Optional Figma MCP failures are retryable when configured; the next
604
- attempt disables optional Figma MCP while required Figma access remains a hard
605
- dependency.
606
-
607
- Figma MCP routing is configured with optional and required issue-text patterns.
608
- Optional matches add Figma MCP as helpful context; required matches treat design
609
- access as part of the issue contract. Legacy `issueTextPatterns` are migrated to
610
- optional patterns by setup/config compatibility handling.
611
-
612
- Fresh-Context Review runs a separate Codex session with the issue, diff, and
613
- validation evidence. It does not reuse the implementation transcript. In the
614
- current config model, the mode is advisory; repositories can choose whether
615
- high-confidence policy violations block publication.
616
-
617
- Durable Run Summaries record the outcome, confirmed facts, validation, blockers,
618
- residual risks, next action, and policy suggestions. They reference existing
619
- logs and reports; they do not replace them.
620
-
621
- Policy Suggestions are report-only. They never edit prompts, config, labels, or
622
- issue state.
623
-
624
- ## Deny Rules
625
-
626
- Deny rules block publication when the agent result touches forbidden areas or
627
- attempts unsafe actions.
628
-
629
- The default policy can block:
630
-
631
- - secret files;
632
- - destructive database or cache actions;
633
- - production deploy or release actions;
634
- - additional repository-defined path globs.
635
-
636
- These rules are evaluated before a result is published.
637
-
638
- ## Durable State and Recovery
639
-
640
- The runner keeps local state so interrupted work can be inspected and recovered.
641
-
642
- Durable evidence can include:
643
-
644
- - agent output;
645
- - completion reports;
646
- - validation results;
647
- - skipped checks;
648
- - blocked reasons;
649
- - visual artifacts;
650
- - run summaries;
651
- - preserved worktrees.
652
-
653
- The runner preserves worktrees when deleting them would hide useful evidence,
654
- for example when they are dirty, blocked, active, or unpublished.
655
-
656
- ### Interrupted Scoped Handoff Recovery
657
-
658
- The main recovery case is an interrupted scoped issue run. This can happen when
659
- Codex already wrote a completed report and left valid local changes in the
660
- issue worktree, but the outer runner stopped before it pushed the branch,
661
- opened the draft PR, posted the review report, and moved the issue from
662
- `agent:running` to `agent:review`.
663
-
664
- Recovery is runner-owned. It does not ask Codex to implement the issue again.
665
- Instead, the runner treats the preserved worktree and completion report as the
666
- candidate output, then runs the same publication gates used by a normal scoped
667
- handoff.
668
-
669
- ```mermaid
670
- flowchart TD
671
- A["status / daemon / targeted run --issue"] --> B["Read runner-state.json"]
672
- B --> C["Fetch matching GitHub issue"]
673
- C --> D{"Local metadata proves ownership?"}
674
- D -- "no" --> E["unknown-or-foreign: report only"]
675
- D -- "yes" --> F{"Live runner still plausible?"}
676
- F -- "yes" --> G["active: do not mutate"]
677
- F -- "no" --> H{"Completed report + base evidence?"}
678
- H -- "yes" --> I["completed-pending-handoff"]
679
- I --> J["Reuse worktree and completed report"]
680
- J --> K["Run normal publishability gates"]
681
- K --> L{"Gates pass?"}
682
- L -- "yes" --> M["Push branch, create/reuse draft PR"]
683
- M --> N["agent:running -> agent:review, post report, clear local run"]
684
- L -- "no" --> O["agent:blocked with recovery evidence"]
685
- H -- "no" --> P{"Stale runner-owned failure?"}
686
- P -- "yes" --> O
687
- P -- "no" --> E
688
- ```
689
-
690
- The local run metadata must match the GitHub issue and the preserved workspace:
691
- issue number, mode, branch, worktree path, report path, session id, and base
692
- evidence. New scoped runs also record a runner lease with host, process id, and
693
- timestamps. Daemon recovery mutates GitHub only when that lease is stale and the
694
- same-host process is gone. If the process still looks alive, the host is
695
- unknown, or the metadata is incomplete, recovery stays read-only.
696
-
697
- Targeted `run --issue <number>` can recover a legacy interrupted run when the
698
- local context snapshot contains the base SHA and the operator explicitly picked
699
- that issue. This is how old runs that predate lease metadata can still be
700
- finished without allowing the daemon to mutate them automatically.
701
-
702
- Recoverable runs are classified with explicit states:
703
-
704
- - `active` means a live runner may still own the issue, so nothing changes.
705
- - `completed-pending-handoff` means the completed report, worktree, branch, and
706
- base evidence are sufficient to retry runner-owned publication.
707
- - `failed-pending-block` means the stale runner-owned run cannot satisfy
708
- publication preconditions and should be moved to `agent:blocked` with concrete
709
- evidence. Missing completion reports get one bounded recovery retry first when
710
- `missing-completion-report` is configured as retryable, the stale attempt has
711
- remaining rework budget, same-host stale ownership is proven, and the branch
712
- has no committed, staged, unstaged, or untracked changes since the recovered
713
- base SHA. If any of those checks fail, recovery blocks instead of resetting or
714
- building on unreported work.
715
- - `unknown-or-foreign` means ownership or safety cannot be proven, so the runner
716
- does not mutate GitHub.
717
-
718
- When a matching open draft PR already exists for the branch and base, recovery
719
- verifies those refs and completes the remaining label, comment, lifecycle, and
720
- local-state cleanup instead of creating a duplicate PR. Blocked recovery uses a
721
- stable marker in the GitHub comment so repeated recovery attempts do not post
722
- the same blocked report again.
723
-
724
- Recovery is intentionally narrow. It does not scan every `agent:running` issue
725
- blindly, does not recover runs from another repository, does not recover
726
- plan-parent or tree-child publication in the scoped path, does not auto-merge,
727
- and does not rerun Codex just to finish a handoff. The package live-smoke suite
728
- is not part of the default recovery gate because it creates or updates real
729
- GitHub issues and pull requests.
730
-
731
- ### Plan-Auto Tree Recovery
732
-
733
- `agent:plan-auto` has its own tree recovery path because parent branches and
734
- child branches have different safety contracts than standalone scoped issues.
735
- Before creating the parent worktree, the runner classifies local tree evidence.
736
- A parent tree resumes only when runner metadata proves `plan-parent` ownership,
737
- the issue number, branch, worktree path, session, stale same-host lease, clean
738
- worktree, and configured base SHA all match. Ambiguous evidence, dirty
739
- worktrees, foreign hosts, active or unknown processes, missing base evidence,
740
- or branch drift hard-block with a stable recovery marker and preserve the local
741
- worktree.
742
-
743
- During child scheduling, a closed child can be treated as recovered only when
744
- the current GitHub child issue still has the child label and parent marker,
745
- tree-child runner metadata matches the parent, a current durable run summary is
746
- `review-ready`, and Git proves the child branch is already merged into the
747
- parent branch. Recovered children satisfy dependency ordering and render as
748
- recovered evidence in the parent handoff instead of being re-executed.
749
-
750
- Blocked children resume only when their tree-child metadata, existing branch and
751
- worktree, blocked durable summary, and `decideImplementationRework()` all prove
752
- that the next bounded rework attempt is allowed. The retry reuses the existing
753
- worktree, starts with the normal automatic rework prompt, and still passes
754
- through the usual publishability, quality, acceptance-proof, durable-summary,
755
- and parent integration gates.
756
-
757
- ## Prompt and Workflow System
758
-
759
- Workflows are configured in `config.json`.
760
-
761
- The default workflow set includes:
762
-
763
- - PRD creation or update;
764
- - issue breakdown;
765
- - breakdown review;
766
- - triage;
767
- - scoped implementation;
768
- - issue-tree orchestration.
769
-
770
- Each workflow points to either a package-owned fallback prompt or a compatible
771
- local skill/prompt copied during setup. This lets the package work out of the
772
- box while still allowing repositories to customize agent behavior.
773
-
774
- ## Skill Runtime V2 Bridge Fence
775
-
776
- The bridge generation keeps the current prompt and `codex exec` behavior but
777
- adds a target-scoped activity fence around daemon lifetime, targeted run/claim,
778
- and setup. Shared daemon/run holders may coexist; preparation and setup require
779
- exclusive ownership. Ownership metadata uses canonical target identity plus
780
- host, boot nonce, PID, and release token, and its generation increases whenever
781
- new runner activity is admitted. A stale same-host holder is reclaimed only
782
- when PID/boot evidence proves that owner is gone; foreign or ambiguous owners
783
- block.
784
-
785
- `setup --prepare-skill-runtime-v2` verifies the installed
786
- `bridge-runtime.json`, inspects supported Darwin or Linux processes, requires
787
- an empty legacy runner-state union, and queries GitHub for every open issue with
788
- the configured running label while holding the exclusive fence. It then writes
789
- one fsynced canonical `prepared-generation.json` beneath the configured state
790
- directory. GitHub read failure, relative daemon targets, process identity
791
- ambiguity, active local state, or a package hash mismatch fail closed without
792
- publishing generation evidence.
793
-
794
- The bridge can read and preserve an empty state-v2 envelope while config remains
795
- v1, but it stores only legacy run records in that envelope. It does not perform
796
- the structural migration, change transport, or disable target workflow prompts.
797
- The structural phase must start later from an actually released bridge commit
798
- and must verify the canonical prepared generation and exact package hash before
799
- any config-v2 write.
800
-
801
- ## Config Surface
802
-
803
- The top-level config areas are:
804
-
805
- - `github` for owner, repo, label preparation, and label definitions;
806
- - `runner` for workspace root, child concurrency, state directory, local commit
807
- policy, and worktree cleanup;
808
- - `codex` for Codex CLI command, args, timeouts, and prompt/report env vars;
809
- - `project` for config and prompt directories;
810
- - `workflows` for prompt or skill routing;
811
- - `checks` and `checksPolicy` for validation commands;
812
- - `reviewGates` for quality, risk-routing, and acceptance proof requirements;
813
- - `loopPolicy` for issue selection, rework, review, summaries, and suggestions;
814
- - `deny` for secret and unsafe-action protection;
815
- - `branches` for branch templates;
816
- - `pullRequests` for PR title templates;
817
- - `issueClassification` for promotion criteria and clarification behavior.
818
-
819
- Runtime state must not be committed as config. The schema rejects known runtime
820
- keys in committed config files.
821
-
822
- ## Current Boundaries
823
-
824
- The package currently focuses on local runner workflows:
825
-
826
- - explicit one-off runs;
827
- - daemon polling;
828
- - project-local config;
829
- - runner-owned worktree cleanup;
830
- - GitHub Issues and Pull Requests;
831
- - Codex CLI as the agent backend.
832
-
833
- Hosted infrastructure, non-GitHub issue trackers, and non-Codex agents are not
834
- part of the current package, although the code keeps adapter boundaries for
835
- future expansion.
86
+ The default live smoke packs and installs the exact candidate bytes in a temporary consumer and uses a scratch GitHub repository. Its compact release profile proves package installation, one normal default Codex run, browser evidence, and a safety-negative path. Cleanup verifies that run-owned issues, pull requests, branches, labels, and temporary directories are absent.