oh-my-copilot 5.18.2 → 5.19.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 (326) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +206 -104
  4. package/bridge/__pycache__/gyoshu_bridge.cpython-314.pyc +0 -0
  5. package/bridge/claude-md-coordinator.cjs +2 -2
  6. package/bridge/cli.cjs +7155 -4471
  7. package/bridge/mcp-server.cjs +2470 -1027
  8. package/bridge/runtime-cli.cjs +102 -12
  9. package/bridge/team-mcp.cjs +100 -11
  10. package/bridge/team.js +100 -11
  11. package/dist/budget/ledger.d.ts +5 -0
  12. package/dist/budget/ledger.d.ts.map +1 -1
  13. package/dist/budget/ledger.js +2 -1
  14. package/dist/budget/ledger.js.map +1 -1
  15. package/dist/cli/commands/__tests__/factory-forge-cli.test.js +3 -3
  16. package/dist/cli/commands/__tests__/factory-forge-cli.test.js.map +1 -1
  17. package/dist/cli/commands/__tests__/factory-init.test.js +239 -17
  18. package/dist/cli/commands/__tests__/factory-init.test.js.map +1 -1
  19. package/dist/cli/commands/__tests__/factory-run-cli.test.js +103 -2
  20. package/dist/cli/commands/__tests__/factory-run-cli.test.js.map +1 -1
  21. package/dist/cli/commands/factory-board.d.ts +9 -0
  22. package/dist/cli/commands/factory-board.d.ts.map +1 -0
  23. package/dist/cli/commands/factory-board.js +34 -0
  24. package/dist/cli/commands/factory-board.js.map +1 -0
  25. package/dist/cli/commands/factory-check.d.ts +1 -0
  26. package/dist/cli/commands/factory-check.d.ts.map +1 -1
  27. package/dist/cli/commands/factory-check.js +2 -1
  28. package/dist/cli/commands/factory-check.js.map +1 -1
  29. package/dist/cli/commands/factory-poll.d.ts +9 -0
  30. package/dist/cli/commands/factory-poll.d.ts.map +1 -0
  31. package/dist/cli/commands/factory-poll.js +34 -0
  32. package/dist/cli/commands/factory-poll.js.map +1 -0
  33. package/dist/cli/commands/factory-setup.d.ts +2 -0
  34. package/dist/cli/commands/factory-setup.d.ts.map +1 -1
  35. package/dist/cli/commands/factory-setup.js +9 -3
  36. package/dist/cli/commands/factory-setup.js.map +1 -1
  37. package/dist/cli/commands/factory.d.ts +61 -18
  38. package/dist/cli/commands/factory.d.ts.map +1 -1
  39. package/dist/cli/commands/factory.js +325 -53
  40. package/dist/cli/commands/factory.js.map +1 -1
  41. package/dist/factory/__tests__/check-run.test.js +37 -96
  42. package/dist/factory/__tests__/check-run.test.js.map +1 -1
  43. package/dist/factory/__tests__/enqueue-ado.test.d.ts +2 -0
  44. package/dist/factory/__tests__/enqueue-ado.test.d.ts.map +1 -0
  45. package/dist/factory/__tests__/enqueue-ado.test.js +375 -0
  46. package/dist/factory/__tests__/enqueue-ado.test.js.map +1 -0
  47. package/dist/factory/__tests__/enqueue.test.d.ts +2 -0
  48. package/dist/factory/__tests__/enqueue.test.d.ts.map +1 -0
  49. package/dist/factory/__tests__/enqueue.test.js +470 -0
  50. package/dist/factory/__tests__/enqueue.test.js.map +1 -0
  51. package/dist/factory/__tests__/heal-ado.test.d.ts +2 -0
  52. package/dist/factory/__tests__/heal-ado.test.d.ts.map +1 -0
  53. package/dist/factory/__tests__/heal-ado.test.js +237 -0
  54. package/dist/factory/__tests__/heal-ado.test.js.map +1 -0
  55. package/dist/factory/__tests__/listener.test.js +27 -9
  56. package/dist/factory/__tests__/listener.test.js.map +1 -1
  57. package/dist/factory/__tests__/map-frontier.test.js +68 -0
  58. package/dist/factory/__tests__/map-frontier.test.js.map +1 -1
  59. package/dist/factory/__tests__/map-ingest.test.js +4 -3
  60. package/dist/factory/__tests__/map-ingest.test.js.map +1 -1
  61. package/dist/factory/__tests__/poll-ado.test.d.ts +2 -0
  62. package/dist/factory/__tests__/poll-ado.test.d.ts.map +1 -0
  63. package/dist/factory/__tests__/poll-ado.test.js +263 -0
  64. package/dist/factory/__tests__/poll-ado.test.js.map +1 -0
  65. package/dist/factory/__tests__/poll.test.d.ts +2 -0
  66. package/dist/factory/__tests__/poll.test.d.ts.map +1 -0
  67. package/dist/factory/__tests__/poll.test.js +748 -0
  68. package/dist/factory/__tests__/poll.test.js.map +1 -0
  69. package/dist/factory/board/__tests__/board-ado.test.d.ts +2 -0
  70. package/dist/factory/board/__tests__/board-ado.test.d.ts.map +1 -0
  71. package/dist/factory/board/__tests__/board-ado.test.js +194 -0
  72. package/dist/factory/board/__tests__/board-ado.test.js.map +1 -0
  73. package/dist/factory/board/__tests__/board.test.d.ts +2 -0
  74. package/dist/factory/board/__tests__/board.test.d.ts.map +1 -0
  75. package/dist/factory/board/__tests__/board.test.js +287 -0
  76. package/dist/factory/board/__tests__/board.test.js.map +1 -0
  77. package/dist/factory/board/collect.d.ts +145 -0
  78. package/dist/factory/board/collect.d.ts.map +1 -0
  79. package/dist/factory/board/collect.js +330 -0
  80. package/dist/factory/board/collect.js.map +1 -0
  81. package/dist/factory/board/render.d.ts +12 -0
  82. package/dist/factory/board/render.d.ts.map +1 -0
  83. package/dist/factory/board/render.js +93 -0
  84. package/dist/factory/board/render.js.map +1 -0
  85. package/dist/factory/check/__tests__/ado.test.js +14 -1
  86. package/dist/factory/check/__tests__/ado.test.js.map +1 -1
  87. package/dist/factory/check/__tests__/cli.test.js +38 -0
  88. package/dist/factory/check/__tests__/cli.test.js.map +1 -1
  89. package/dist/factory/check/__tests__/rules.test.js +72 -2
  90. package/dist/factory/check/__tests__/rules.test.js.map +1 -1
  91. package/dist/factory/check/cli.d.ts +34 -6
  92. package/dist/factory/check/cli.d.ts.map +1 -1
  93. package/dist/factory/check/cli.js +56 -34
  94. package/dist/factory/check/cli.js.map +1 -1
  95. package/dist/factory/check/rules.d.ts +11 -3
  96. package/dist/factory/check/rules.d.ts.map +1 -1
  97. package/dist/factory/check/rules.js +18 -5
  98. package/dist/factory/check/rules.js.map +1 -1
  99. package/dist/factory/check/score.d.ts +22 -2
  100. package/dist/factory/check/score.d.ts.map +1 -1
  101. package/dist/factory/check/score.js +55 -1
  102. package/dist/factory/check/score.js.map +1 -1
  103. package/dist/factory/enqueue.d.ts +195 -0
  104. package/dist/factory/enqueue.d.ts.map +1 -0
  105. package/dist/factory/enqueue.js +788 -0
  106. package/dist/factory/enqueue.js.map +1 -0
  107. package/dist/factory/heal/cli.d.ts +34 -2
  108. package/dist/factory/heal/cli.d.ts.map +1 -1
  109. package/dist/factory/heal/cli.js +88 -19
  110. package/dist/factory/heal/cli.js.map +1 -1
  111. package/dist/factory/heal/history.d.ts +12 -6
  112. package/dist/factory/heal/history.d.ts.map +1 -1
  113. package/dist/factory/heal/history.js +16 -6
  114. package/dist/factory/heal/history.js.map +1 -1
  115. package/dist/factory/heal/implement.d.ts +3 -1
  116. package/dist/factory/heal/implement.d.ts.map +1 -1
  117. package/dist/factory/heal/implement.js +1 -0
  118. package/dist/factory/heal/implement.js.map +1 -1
  119. package/dist/factory/heal/run.d.ts +3 -0
  120. package/dist/factory/heal/run.d.ts.map +1 -1
  121. package/dist/factory/heal/run.js +1 -1
  122. package/dist/factory/heal/run.js.map +1 -1
  123. package/dist/factory/listener.d.ts +13 -17
  124. package/dist/factory/listener.d.ts.map +1 -1
  125. package/dist/factory/listener.js +37 -63
  126. package/dist/factory/listener.js.map +1 -1
  127. package/dist/factory/map-frontier.d.ts +8 -1
  128. package/dist/factory/map-frontier.d.ts.map +1 -1
  129. package/dist/factory/map-frontier.js +65 -5
  130. package/dist/factory/map-frontier.js.map +1 -1
  131. package/dist/factory/map-ingest.d.ts.map +1 -1
  132. package/dist/factory/map-ingest.js +12 -1
  133. package/dist/factory/map-ingest.js.map +1 -1
  134. package/dist/factory/poll.d.ts +308 -0
  135. package/dist/factory/poll.d.ts.map +1 -0
  136. package/dist/factory/poll.js +677 -0
  137. package/dist/factory/poll.js.map +1 -0
  138. package/dist/factory/run/__tests__/engine.ado.test.js +157 -8
  139. package/dist/factory/run/__tests__/engine.ado.test.js.map +1 -1
  140. package/dist/factory/run/__tests__/engine.outcome.test.d.ts +2 -0
  141. package/dist/factory/run/__tests__/engine.outcome.test.d.ts.map +1 -0
  142. package/dist/factory/run/__tests__/engine.outcome.test.js +223 -0
  143. package/dist/factory/run/__tests__/engine.outcome.test.js.map +1 -0
  144. package/dist/factory/run/__tests__/engine.test.js +91 -0
  145. package/dist/factory/run/__tests__/engine.test.js.map +1 -1
  146. package/dist/factory/run/__tests__/units.test.js +299 -2
  147. package/dist/factory/run/__tests__/units.test.js.map +1 -1
  148. package/dist/factory/run/engine.d.ts +11 -3
  149. package/dist/factory/run/engine.d.ts.map +1 -1
  150. package/dist/factory/run/engine.js +145 -22
  151. package/dist/factory/run/engine.js.map +1 -1
  152. package/dist/factory/run/exec.d.ts +32 -4
  153. package/dist/factory/run/exec.d.ts.map +1 -1
  154. package/dist/factory/run/exec.js +120 -15
  155. package/dist/factory/run/exec.js.map +1 -1
  156. package/dist/factory/run/outcome.d.ts +31 -0
  157. package/dist/factory/run/outcome.d.ts.map +1 -0
  158. package/dist/factory/run/outcome.js +70 -0
  159. package/dist/factory/run/outcome.js.map +1 -0
  160. package/dist/factory/run/review-output.d.ts +6 -1
  161. package/dist/factory/run/review-output.d.ts.map +1 -1
  162. package/dist/factory/run/review-output.js +13 -3
  163. package/dist/factory/run/review-output.js.map +1 -1
  164. package/dist/factory/run/state.d.ts +2 -0
  165. package/dist/factory/run/state.d.ts.map +1 -1
  166. package/dist/factory/run/state.js.map +1 -1
  167. package/dist/factory/setup/__tests__/pipeline-pick.test.d.ts +2 -0
  168. package/dist/factory/setup/__tests__/pipeline-pick.test.d.ts.map +1 -0
  169. package/dist/factory/setup/__tests__/pipeline-pick.test.js +84 -0
  170. package/dist/factory/setup/__tests__/pipeline-pick.test.js.map +1 -0
  171. package/dist/factory/setup/__tests__/setup.test.js +1 -0
  172. package/dist/factory/setup/__tests__/setup.test.js.map +1 -1
  173. package/dist/factory/setup/detect.js +1 -1
  174. package/dist/factory/setup/detect.js.map +1 -1
  175. package/dist/factory/setup/pipeline-pick.d.ts +25 -0
  176. package/dist/factory/setup/pipeline-pick.d.ts.map +1 -0
  177. package/dist/factory/setup/pipeline-pick.js +55 -0
  178. package/dist/factory/setup/pipeline-pick.js.map +1 -0
  179. package/dist/factory/setup/write.d.ts +6 -0
  180. package/dist/factory/setup/write.d.ts.map +1 -1
  181. package/dist/factory/setup/write.js +3 -1
  182. package/dist/factory/setup/write.js.map +1 -1
  183. package/dist/factory/watchdog.d.ts +3 -2
  184. package/dist/factory/watchdog.d.ts.map +1 -1
  185. package/dist/factory/watchdog.js +5 -4
  186. package/dist/factory/watchdog.js.map +1 -1
  187. package/dist/factory/watchdog.test.js +19 -4
  188. package/dist/factory/watchdog.test.js.map +1 -1
  189. package/dist/forge/__tests__/config.test.js +51 -0
  190. package/dist/forge/__tests__/config.test.js.map +1 -1
  191. package/dist/forge/__tests__/gh-argv-baseline.chain.test.js +2 -2
  192. package/dist/forge/__tests__/gh-argv-baseline.chain.test.js.map +1 -1
  193. package/dist/forge/__tests__/gh-argv-baseline.factory.test.js +6 -4
  194. package/dist/forge/__tests__/gh-argv-baseline.factory.test.js.map +1 -1
  195. package/dist/forge/__tests__/gh-argv-baseline.tracker-writes.test.d.ts +2 -0
  196. package/dist/forge/__tests__/gh-argv-baseline.tracker-writes.test.d.ts.map +1 -0
  197. package/dist/forge/__tests__/gh-argv-baseline.tracker-writes.test.js +100 -0
  198. package/dist/forge/__tests__/gh-argv-baseline.tracker-writes.test.js.map +1 -0
  199. package/dist/forge/ado/__tests__/acceptance-scripts.test.js +360 -30
  200. package/dist/forge/ado/__tests__/acceptance-scripts.test.js.map +1 -1
  201. package/dist/forge/ado/__tests__/adapter.test.js +18 -3
  202. package/dist/forge/ado/__tests__/adapter.test.js.map +1 -1
  203. package/dist/forge/ado/__tests__/ci.test.d.ts +2 -0
  204. package/dist/forge/ado/__tests__/ci.test.d.ts.map +1 -0
  205. package/dist/forge/ado/__tests__/ci.test.js +271 -0
  206. package/dist/forge/ado/__tests__/ci.test.js.map +1 -0
  207. package/dist/forge/ado/__tests__/routes.test.js +24 -5
  208. package/dist/forge/ado/__tests__/routes.test.js.map +1 -1
  209. package/dist/forge/ado/__tests__/tracker-writes.test.d.ts +8 -0
  210. package/dist/forge/ado/__tests__/tracker-writes.test.d.ts.map +1 -0
  211. package/dist/forge/ado/__tests__/tracker-writes.test.js +377 -0
  212. package/dist/forge/ado/__tests__/tracker-writes.test.js.map +1 -0
  213. package/dist/forge/ado/__tests__/world.d.ts +4 -0
  214. package/dist/forge/ado/__tests__/world.d.ts.map +1 -1
  215. package/dist/forge/ado/__tests__/world.js +3 -2
  216. package/dist/forge/ado/__tests__/world.js.map +1 -1
  217. package/dist/forge/ado/checks.d.ts +25 -2
  218. package/dist/forge/ado/checks.d.ts.map +1 -1
  219. package/dist/forge/ado/checks.js +47 -23
  220. package/dist/forge/ado/checks.js.map +1 -1
  221. package/dist/forge/ado/ci.d.ts +13 -0
  222. package/dist/forge/ado/ci.d.ts.map +1 -0
  223. package/dist/forge/ado/ci.js +134 -0
  224. package/dist/forge/ado/ci.js.map +1 -0
  225. package/dist/forge/ado/guard.d.ts +19 -6
  226. package/dist/forge/ado/guard.d.ts.map +1 -1
  227. package/dist/forge/ado/guard.js +52 -11
  228. package/dist/forge/ado/guard.js.map +1 -1
  229. package/dist/forge/ado/index.d.ts +7 -1
  230. package/dist/forge/ado/index.d.ts.map +1 -1
  231. package/dist/forge/ado/index.js +16 -3
  232. package/dist/forge/ado/index.js.map +1 -1
  233. package/dist/forge/ado/reviews.d.ts +9 -1
  234. package/dist/forge/ado/reviews.d.ts.map +1 -1
  235. package/dist/forge/ado/reviews.js +45 -1
  236. package/dist/forge/ado/reviews.js.map +1 -1
  237. package/dist/forge/ado/routes.d.ts +35 -5
  238. package/dist/forge/ado/routes.d.ts.map +1 -1
  239. package/dist/forge/ado/routes.js +181 -9
  240. package/dist/forge/ado/routes.js.map +1 -1
  241. package/dist/forge/ado/tracker.d.ts +13 -2
  242. package/dist/forge/ado/tracker.d.ts.map +1 -1
  243. package/dist/forge/ado/tracker.js +139 -3
  244. package/dist/forge/ado/tracker.js.map +1 -1
  245. package/dist/forge/ado/wiql.d.ts +2 -0
  246. package/dist/forge/ado/wiql.d.ts.map +1 -1
  247. package/dist/forge/ado/wiql.js +6 -0
  248. package/dist/forge/ado/wiql.js.map +1 -1
  249. package/dist/forge/body-file.d.ts +17 -0
  250. package/dist/forge/body-file.d.ts.map +1 -0
  251. package/dist/forge/body-file.js +59 -0
  252. package/dist/forge/body-file.js.map +1 -0
  253. package/dist/forge/config.d.ts +3 -1
  254. package/dist/forge/config.d.ts.map +1 -1
  255. package/dist/forge/config.js +37 -2
  256. package/dist/forge/config.js.map +1 -1
  257. package/dist/forge/github/__tests__/argv-parity.test.js +17 -1
  258. package/dist/forge/github/__tests__/argv-parity.test.js.map +1 -1
  259. package/dist/forge/github/gh.d.ts +6 -0
  260. package/dist/forge/github/gh.d.ts.map +1 -1
  261. package/dist/forge/github/gh.js +2 -0
  262. package/dist/forge/github/gh.js.map +1 -1
  263. package/dist/forge/github/reviews.d.ts +2 -0
  264. package/dist/forge/github/reviews.d.ts.map +1 -1
  265. package/dist/forge/github/reviews.js +6 -0
  266. package/dist/forge/github/reviews.js.map +1 -1
  267. package/dist/forge/github/tracker.d.ts +20 -4
  268. package/dist/forge/github/tracker.d.ts.map +1 -1
  269. package/dist/forge/github/tracker.js +59 -5
  270. package/dist/forge/github/tracker.js.map +1 -1
  271. package/dist/forge/types.d.ts +108 -2
  272. package/dist/forge/types.d.ts.map +1 -1
  273. package/dist/forge/types.js +8 -0
  274. package/dist/forge/types.js.map +1 -1
  275. package/dist/graph/schema.d.ts +10 -10
  276. package/dist/hooks/session-end/__tests__/chain-enqueuer.test.js +156 -35
  277. package/dist/hooks/session-end/__tests__/chain-enqueuer.test.js.map +1 -1
  278. package/dist/hooks/session-end/__tests__/check-evidence.test.js +4 -4
  279. package/dist/hooks/session-end/__tests__/check-evidence.test.js.map +1 -1
  280. package/dist/hooks/session-end/__tests__/copilot-liveness.test.js +3 -3
  281. package/dist/hooks/session-end/__tests__/copilot-liveness.test.js.map +1 -1
  282. package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.js +3 -3
  283. package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.js.map +1 -1
  284. package/dist/hooks/session-end/__tests__/routing.test.js +36 -1
  285. package/dist/hooks/session-end/__tests__/routing.test.js.map +1 -1
  286. package/dist/hooks/session-end/__tests__/spawn-next.test.js +96 -5
  287. package/dist/hooks/session-end/__tests__/spawn-next.test.js.map +1 -1
  288. package/dist/hooks/session-end/__tests__/worker.test.js +38 -2
  289. package/dist/hooks/session-end/__tests__/worker.test.js.map +1 -1
  290. package/dist/hooks/session-end/chain-enqueuer.d.ts.map +1 -1
  291. package/dist/hooks/session-end/chain-enqueuer.js +22 -2
  292. package/dist/hooks/session-end/chain-enqueuer.js.map +1 -1
  293. package/dist/hooks/session-end/routing.d.ts +14 -0
  294. package/dist/hooks/session-end/routing.d.ts.map +1 -1
  295. package/dist/hooks/session-end/routing.js +25 -0
  296. package/dist/hooks/session-end/routing.js.map +1 -1
  297. package/dist/hooks/session-end/spawn-next.d.ts +20 -2
  298. package/dist/hooks/session-end/spawn-next.d.ts.map +1 -1
  299. package/dist/hooks/session-end/spawn-next.js +72 -5
  300. package/dist/hooks/session-end/spawn-next.js.map +1 -1
  301. package/dist/smoke/__tests__/copilot-chain-scenario.test.js +2 -1
  302. package/dist/smoke/__tests__/copilot-chain-scenario.test.js.map +1 -1
  303. package/dist/smoke/copilot-chain-scenario.d.ts.map +1 -1
  304. package/dist/smoke/copilot-chain-scenario.js +5 -1
  305. package/dist/smoke/copilot-chain-scenario.js.map +1 -1
  306. package/dist/team/__tests__/worker-launch-ack.test.js +134 -5
  307. package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
  308. package/dist/team/worker-launch-ack.d.ts.map +1 -1
  309. package/dist/team/worker-launch-ack.js +19 -4
  310. package/dist/team/worker-launch-ack.js.map +1 -1
  311. package/docs/CLAUDE.md +1 -1
  312. package/docs/MIGRATION.md +26 -0
  313. package/docs/REFERENCE.md +187 -20
  314. package/docs/design/FACTORY-FINAL-DESIGN.md +1 -1
  315. package/docs/shipyard.md +17 -1
  316. package/package.json +2 -2
  317. package/plugin.json +1 -1
  318. package/scripts/ado-acceptance.mjs +309 -70
  319. package/scripts/lib/backlog-to-workitems.mjs +24 -21
  320. package/skills/ask-navigator/SKILL.md +5 -2
  321. package/skills/drydock/SKILL.md +2 -1
  322. package/skills/harbor/SKILL.md +17 -2
  323. package/skills/intent/SKILL.md +4 -0
  324. package/skills/launch/SKILL.md +35 -2
  325. package/skills/map/SKILL.md +2 -1
  326. package/skills/refit/SKILL.md +1 -0
package/docs/REFERENCE.md CHANGED
@@ -919,7 +919,22 @@ omg progress status --dir <dir> --json # latest event and state per age
919
919
 
920
920
  ### `omg factory`
921
921
 
922
- `omg factory init` seeds the project route table `.omg/factory-routes.json`, `omg factory listen` runs the HMAC-verified tracker intake daemon, and `omg factory status [--json]` is the read-only chain audit. A chain is a series of headless AFK links: when a link's session ends, the SessionEnd hook routes its `outcome:reason` through the route table and the detached SessionEnd worker spawns the next link. Guardrails apply per link: one active link per intent (serial lock) and a daily cap of 10 (`OMC_DAILY_CHAIN_LIMIT`).
922
+ `omg factory init` seeds the project route table `.omg/factory-routes.json`, `omg factory listen` runs the HMAC-verified tracker intake daemon, and `omg factory chain status [--json]` is the read-only chain audit (`omg factory status` stays as an alias; `omg factory run status <issue>` is the engine's run state). The chain is legacy and frozen: delivery goes through `omg factory run`. A chain is a series of headless AFK links: when a link's session ends, the SessionEnd hook routes its `outcome:reason` through the route table and the detached SessionEnd worker spawns the next link. Guardrails apply per link: one active link per intent (serial lock) and a daily cap of 10 (`OMC_DAILY_CHAIN_LIMIT`).
923
+
924
+ `omg factory init` seeds only the narrow starter table (`success:intake` → `harbor`). It refuses (exit 1, nothing written) unless `.omg/state/` and the yard's two faces, `CLAUDE.md` and `GLOSSARY.md` (seeded by `/oh-my-copilot:drydock`), exist; `docs/design/` is no longer required. An issue labeled `intake` makes the listener spawn a headless `/oh-my-copilot:harbor look at #<n>` session: tracker intake is harbor's job (verify, desk, signed dispositions), not intent's. The listener writes no labels on the issue (the old `needs-review` / `failed` labels are gone; harbor owns the labels). It keeps the issue pointer in the link's ledger so the stall watchdog can flag the issue: a link that stalls gets `harbor:for-maintainer` plus a comment (it used to get `harbor:need-info`, which harbor reads as "waiting on the reporter"). `--no-narrow`, which seeded the full `intake → intent → launch → diagnose` template, is retired: it exits 1 and writes nothing, because launch needs a live captain and no `diagnose` skill exists. Run launch in a session and deliver each issue with `omg factory run <issue>`. The listener answers a failed `check_suite` webhook with an audited `204` discard (`CI failures are healed from workflow_run`) and never starts a session. Only failed push runs of `ci.yml` on the dev branch are enqueued (via `workflow_run`) for the next `omg factory heal scan` (see `omg factory heal`); failures on other branches or workflows are no longer acted on by the listener, so run `omg factory heal scan` manually.
925
+
926
+ The SessionEnd chain fails closed on skills an AFK link cannot run. A route to a captain skill (`launch`, `ask-navigator`, `loft`, `drydock`: they hold human checkpoints) or a retired skill (`diagnose`) halts the chain: the decision and the stop marker read `route-retired:<skill>`, and nothing spawns. The skill is matched by its canonical name (trimmed, lower-case, without a leading `/` or a `plugin:` prefix), so `Diagnose` or `oh-my-copilot:launch` is refused too. A route to `intent` still spawns but records `route-deprecated:intent` first: tracker intake belongs to harbor. Any other skill must be a bundled skill or a project skill under `.copilot/skills`, `.omg/skills` or `.agents/skills`, named in lower case from `[a-z0-9_-]`; otherwise the chain halts with `route-unknown:<skill>`. A skill is named by its registered name, the `name` in its `SKILL.md` frontmatter (else its directory name): the bundled `plan` and `review` directories register as `omc-plan` and `omc-review`, so a route to `plan` halts with a `did you mean omc-plan` hint in the decision (a bare `/plan` is a native command). A bundled skill spawns as `/oh-my-copilot:<name>` on Copilot CLI, which registers plugin skills only under the plugin prefix, and as `/<name>` on Claude Code; a project skill spawns as `/<name>`. The spawn step applies the same rules again, so a queued job or a replayed closeout from before an upgrade cannot spawn a refused skill.
927
+
928
+ An existing table from the old full template is fixed with two `init` modes:
929
+
930
+ - `omg factory init --check` prints every route of `.omg/factory-routes.json` with its status (`ok`, `terminal`, `deprecated`, `captain`, `retired`, `unknown` when no bundled skill or project skill under `.copilot/skills`, `.omg/skills` or `.agents/skills` has that name, `invalid` when the enqueuer ignores the entry) and the replacement. It writes nothing and exits 1 when a captain or retired route would halt the chain or the table is not a JSON object, else 0. `--migrate` refuses a symlinked routes file.
931
+ - `omg factory init --migrate` writes the original to `.omg/factory-routes.json.bak-<UTC timestamp>` (never over an existing backup), then removes the captain and retired routes and turns `success:intake` → `intent` into `success:intake` → `harbor`. Every other entry is kept as it was. It asks first on a terminal; without one it needs `--yes` (exit 2 otherwise). A declined prompt exits 1 and writes nothing.
932
+
933
+ | Old route | Replacement |
934
+ |---|---|
935
+ | `success:intake` → `intent` | `success:intake` → `harbor` |
936
+ | `success:intent` → `launch` | none: run `/oh-my-copilot:launch` with the accepted intent |
937
+ | `success:launch` → `diagnose`, `failed:ci` → `diagnose` | none: `omg factory heal scan` |
923
938
 
924
939
  #### Factory chains on Copilot
925
940
 
@@ -934,10 +949,10 @@ The link's own SessionStart binds the link to its host session: the first sessio
934
949
  |---|---|
935
950
  | `chainLink`, `host`, `createdAt`, `parentLink` | Written at spawn: the link id, `copilot` or `claude`, and the link that spawned it. |
936
951
  | `boundSessionId`, `boundAt` | Copilot only: the host session that started the link. |
937
- | `closedAt`, `hostSessionId`, `endReason`, `outcome`, `decision`, `enqueuedChain` | Written once by the link's SessionEnd. The watchdog skips a closed ledger only when its decision advanced the chain or left a stop marker (`enqueued`, `chain-terminal`, `chain-loop-capped`, `human-gate`, `no-route` on failure); a link dropped by a guardrail, an invalid ledger, or an error is still flagged. |
952
+ | `closedAt`, `hostSessionId`, `endReason`, `outcome`, `decision`, `enqueuedChain` | Written once by the link's SessionEnd. The watchdog skips a closed ledger only when its decision advanced the chain or left a stop marker (`enqueued`, `chain-terminal`, `chain-loop-capped`, `human-gate`, `route-retired:<skill>`, `route-unknown:<skill>`, `no-route` on failure); a link dropped by a guardrail, an invalid ledger, or an error is still flagged. |
938
953
  | `maxStageVisits` | Stage-visit cap, carried from the first ledger to every later link (default 2, values above 99 clamp to 99). |
939
954
 
940
- Copilot's SessionEnd reason for a finished `-p` link is `complete` (CLI 1.0.91), which counts as `success` alongside Claude's `other`, `prompt_input_exit`, and `logout`; route keys such as `success:*` match both hosts. When OMC runs from a dev plugin root (`omg --plugin-dir`, which sets `OMC_PLUGIN_ROOT`), Copilot links also get `--plugin-dir <root>`, and the SessionEnd worker forwards `OMC_PLUGIN_ROOT`, so every link loads the same plugin. The root is dropped when it overlaps the link's working directory, because an AFK link may write there and could rewrite the plugin's hooks; a chain over the plugin's own repo needs the plugin installed. On Windows a root containing `%` is dropped as well. Limitation: Copilot fires `sessionEnd` after every turn, also in `-p` mode, so a link that a Stop hook keeps going into a second turn hands off after its first turn. The closed ledger stops later turns from enqueuing again, but the next link may start while this one still runs. A single-prompt link is not affected. `omg factory status` lists each intent's links in spawn order with host, link id, and closeout, for example `环 2 link-2 [copilot] link=<id> 已结束 success→chain-loop-capped session=<host session>`.
955
+ Copilot's SessionEnd reason for a finished `-p` link is `complete` (CLI 1.0.91), which counts as `success` alongside Claude's `other`, `prompt_input_exit`, and `logout`; route keys such as `success:*` match both hosts. When OMC runs from a dev plugin root (`omg --plugin-dir`, which sets `OMC_PLUGIN_ROOT`), Copilot links also get `--plugin-dir <root>`, and the SessionEnd worker forwards `OMC_PLUGIN_ROOT`, so every link loads the same plugin. The root is dropped when it overlaps the link's working directory, because an AFK link may write there and could rewrite the plugin's hooks; a chain over the plugin's own repo needs the plugin installed. On Windows a root containing `%` is dropped as well. Limitation: Copilot fires `sessionEnd` after every turn, also in `-p` mode, so a link that a Stop hook keeps going into a second turn hands off after its first turn. The closed ledger stops later turns from enqueuing again, but the next link may start while this one still runs. A single-prompt link is not affected. `omg factory chain status` lists each intent's links in spawn order with host, link id, and closeout, for example `环 2 link-2 [copilot] link=<id> 已结束 success→chain-loop-capped session=<host session>`.
941
956
 
942
957
  #### `omg factory run` (experimental)
943
958
 
@@ -948,6 +963,7 @@ The engine is deterministic code that owns every transition. LLM work happens on
948
963
  ```bash
949
964
  omg factory run <issue> [--json] # start, or resume at the recorded phase
950
965
  omg factory run <issue> --dry-run # read the issue and plan and print the next step; no state, lanes or pushes
966
+ omg factory run --next [--parent <spec>] [--json] # run the first runnable item in omg factory check order
951
967
  omg factory run status <issue> [--json] # the persisted state, read-only; --json adds integrityOk and runCredits
952
968
  omg factory run cancel <issue> [--json] # ask the running engine to cancel its lane and stop; keeps the PR, branch and worktrees
953
969
  omg factory run clean <issue> [--json] # remove the worktrees and local branches of a merged or cancelled run
@@ -960,6 +976,8 @@ omg factory run clean <issue> [--json] # remove the worktrees and local branc
960
976
  | `1` | A failure: an engine step failed, or the state is `failed` |
961
977
  | `2` | A usage error, such as a missing issue number, or `status` for an issue with no run |
962
978
 
979
+ `omg factory run --next` picks the first `runnable` item in `omg factory check` order (priority, then id) among the children of `--parent <spec>`, or else the `factory.intake.source` items, and runs it. A run parked at `blocked-by` is picked again, and resumed, once its dependencies are satisfied; a finished or otherwise active run, or an item whose factory PR is open or merged, is never picked. With nothing runnable it prints the bucket counts and exits 0.
980
+
963
981
  `omg factory run` without `--dry-run` is itself the opt-in to live, billed lanes; no `OMG_COPILOT_RUN_ALLOW` is needed. The first Ctrl+C or SIGTERM cancels the lane after the current poll. A second one exits at once, and the next run treats the lane as lost.
964
982
 
965
983
  ##### Phases
@@ -975,7 +993,7 @@ any phase ─cancel─→ cancelled any phase ─gate─→ awaiting-hu
975
993
 
976
994
  | Phase | What the engine does |
977
995
  |---|---|
978
- | `intake` | Reads the issue with `gh issue view`. A closed issue ends the run as `cancelled`. An open PR that already uses the factory branch stops at `pr-exists`. |
996
+ | `intake` | Reads the issue with `gh issue view`. A closed issue ends the run as `cancelled`. An open PR that already uses the factory branch stops at `pr-exists`. A `Depends on #n` / `Blocked by #n` line (GitHub) or a Predecessor link (Azure DevOps) whose item is not satisfied stops at `blocked-by`; satisfied means closed, its factory PR merged into the base, or its factory run `merged`. An item that depends on itself stops at `blocked-by` with `blocked-by:self`. |
979
997
  | `plan` | Resolves the spec. An `omg-plan: <repo path>` line wins. It counts in the body when the issue's author owns the repository or has commented as an owner, member or collaborator, and in a comment by an owner, member or collaborator. The plan file is read from the base branch. Otherwise the issue body counts when it has an `Acceptance criteria` heading. |
980
998
  | `implement` | One write lane at `origin/<base>`. The prompt carries the issue and the plan and says to commit, not push. The lane must leave at least one commit that descends from its start. |
981
999
  | `publish` | The engine pushes the lane head to `refs/heads/factory/issue-<n>` with a plain refspec. The first publish opens a draft PR with `Closes #<n>` and starts ship state with implementer `factory-impl-<n>`. Before pushing, the engine re-reads the remote branch and the PR, so a crash between push and record repeats nothing. |
@@ -1045,7 +1063,8 @@ Merge is always human. There is no `factory.merge` key and no auto mode, and the
1045
1063
  - **Fresh context.** Each review is a new session in its own worktree at the head, on `copilot_run`'s `review` profile, which cannot write files or commit.
1046
1064
  - **Contract.** The lane's final message must end with exactly one fenced `json` block: `verdict` (`approve` or `request-changes`), `sha` (the 40-hex head), `findings` (each with `severity` `blocker`, `major`, `minor` or `nit`, a `summary`, and optional `file` and `line`) and optional `notes` of at most 500 characters.
1047
1065
  - **Fail closed.** No block, two blocks, text after the block, a wrong sha, bad fields, an edited worktree or a moved PR head make the review `invalid`, and no verdict is recorded. An `approve` with a `blocker` or `major` finding counts as `request-changes`.
1048
- - **Posting.** The engine posts the findings as one PR comment, so the merge gate sees filtered findings next to the diff.
1066
+ - **Posting.** The engine posts the findings as one PR comment, so the merge gate sees filtered findings next to the diff. A two-axis review adds an `Axis` column.
1067
+ - **Two-axis review.** When the base commit has `docs/standards/`, the review runs on two axes, reported separately and never ranked against each other. The `spec` axis checks the diff against the plan: missing or partial requirements, behavior nobody asked for, and requirements that look implemented but look wrong. The `standards` axis checks the diff against the matching `docs/standards/` volume. The prompt lists the volumes, and the lane reads them at the base commit (`git show <base>:<path>`), not from the head that the diff may change. Every finding must carry `axis` (`spec` or `standards`); a missing or unknown axis makes the review `invalid`. A `blocker` or `major` on either axis fails the verdict, and the fix lane sees each finding's axis. The engine lists the standards at the base, never at the reviewed head, so a PR cannot switch the second axis on or off. Without `docs/standards/` on the base, the prompt is the single-axis one and `axis` is ignored.
1049
1068
 
1050
1069
  ##### Configuration
1051
1070
 
@@ -1237,6 +1256,7 @@ omg smoke copilot --tier 2 --scenario sandbox-lane # review, write and cana
1237
1256
 
1238
1257
  ```bash
1239
1258
  omg factory check [<id>...] [--json] # the given ids, or the items of factory.intake.source
1259
+ omg factory check --parent <spec> [--json] # the spec's children (GitHub `- [ ] #n` task list | ADO child links)
1240
1260
  omg factory check --source label:factory # label:<name> | milestone:<name> | wiql-query:<guid> |
1241
1261
  # board-column:<team>/<board>/<column> | area-tag:<area path>#<tag>
1242
1262
  omg factory check --limit 20 # read at most 20 items from the source (1..200; default factory.intake.limit)
@@ -1250,10 +1270,12 @@ The rules are evaluated in order, and the first one that matches sets the bucket
1250
1270
  | `closed` | blocked | The item is closed (GitHub `CLOSED`, or an ADO Completed/Removed state). |
1251
1271
  | `wrong-type` | blocked | The ADO type is not in `factory.intake.itemTypes`, or the GitHub id is a pull request. |
1252
1272
  | `run-finished:<phase>` | blocked | A factory run for the item is merged, cancelled or failed. The engine never restarts one. |
1253
- | `run-active:<phase>[/<gate>]` | blocked | Any other factory run for the item exists. |
1273
+ | `run-active:<phase>[/<gate>]` | blocked | Any other factory run for the item exists. A run parked at `intake` / `blocked-by` is not counted: the rules below re-read its dependencies, so it becomes `runnable` once they are satisfied. |
1254
1274
  | `pr-exists` | blocked | An open PR already uses `factory/issue-<n>`. A PR from a fork counts too, because the engine's `pr-exists` gate counts it. |
1275
+ | `merged` | blocked | A PR from `factory/issue-<n>` was already merged into the base. The item stays open when the base is not the default branch, so it is not run again. |
1255
1276
  | `branch-exists` | blocked | `origin/factory/issue-<n>` exists without an open PR (`git ls-remote`). The engine would stop at `head-moved-externally`. |
1256
- | `depends-on:#n,…` | blocked | An item it depends on is still open. A dependency that is a PR counts as resolved once it is merged or closed. |
1277
+ | `blocked-by:self` | blocked | The item depends on itself (a `Depends on` / `Blocked by` line naming its own number). |
1278
+ | `depends-on:#n,…` | blocked | An item it depends on is unfinished. A dependency is satisfied when it is closed, when a PR from its `factory/issue-<n>` branch was merged into the base (`ship.base`), or when its factory run is `merged`. The merged PR counts because `Closes #n` does not close the issue when the base is not the default branch. A dependency that is a GitHub PR counts as resolved once it is merged; a PR closed without merging does not. On Azure DevOps a work item that cannot be read is never looked up as a PR, because work items and PRs number separately there. A dependency that cannot be read stays unsatisfied. |
1257
1279
  | `needs-split` | blocked | It has open children, is an ADO Epic or Feature, or has the GitHub label `epic`. |
1258
1280
  | `no-plan` | needs-plan | There is no trusted `omg-plan:` line, no `Acceptance criteria` heading, and no ADO Acceptance Criteria. |
1259
1281
  | `plan-missing` | needs-plan | The `omg-plan:` path is not repo-relative, or is missing or empty on `origin/<base>`. |
@@ -1267,13 +1289,154 @@ Results are sorted by bucket, then by priority, then by id. Priority is the ADO
1267
1289
 
1268
1290
  `--mark` touches only runnable items that do not already carry the marker (GitHub label, ADO tag; default `factory-ready`). The marker is compared without regard to case. On GitHub the label must already exist: when it is missing, the check exits `5` and tells you to run `omg factory setup`, because check never creates labels. It asks before writing. Without a terminal, or with `--json`, it needs `--yes`. The guard allows the label write only after you confirm.
1269
1291
 
1270
- `--json` prints `{ schemaVersion: 1, ok, forge, repo, source, counts, items, mark, warnings }`. Each item is `{ id, title, url, bucket, reasons, detail, priority, planSource }`. `reasons` holds the exact reason code (empty when the item is runnable), and `planSource` is `omg-plan`, `issue-body` or `ado-acceptance`. `mark` is `{ marker, requested, confirmed, marked, alreadyMarked, failed }`.
1292
+ `--parent <spec>` checks the children of a spec item instead of ids or the intake source: on GitHub the issues in the spec body's task list (`- [ ] #n`), on Azure DevOps the work items linked as children. It cannot be combined with ids, `--source` or `--limit`. A child names its spec with a `Part of #<spec>` line on GitHub or a parent link on Azure DevOps; the adapters read that as the item's parent.
1293
+
1294
+ **Tracker writes (`omg factory enqueue`).** The GitHub tracker can create items, edit them and find them by their `shipyard-key: <spec>/<key>` footer line. Only `omg factory enqueue` uses these writes. The factory guard allows them only when the caller passes the enqueue write context; `omg factory run` and `omg factory check` never do, so for them all three shapes stay refused. Each write is one exact shape:
1295
+
1296
+ ```bash
1297
+ gh issue create --repo <host>/<owner>/<name> --title <title> --body-file <file> [--label <l>]...
1298
+ gh issue edit <n> --repo <host>/<owner>/<name> --title <title> --body-file <file> [--add-label <l>]... [--remove-label <l>]...
1299
+ gh issue list --repo <host>/<owner>/<name> --search '"shipyard-key: <spec>/" in:body' --state all --json number,body --limit <1..1000>
1300
+ ```
1301
+
1302
+ - `--repo` must be the configured forge repository. Any other repository, `-R`, or a missing `--repo` is refused.
1303
+ - The body is passed only through `--body-file`, never inline. The file must sit directly in the directory the caller writes bodies to.
1304
+ - Labels come from the caller's allowlist (the intake label and `priority:p0`…`priority:p3`), each label once, at most four per write. A `factory:*` label is always refused. On an edit, every `--add-label` comes before every `--remove-label`.
1305
+ - Extra flags, reordered flags and a different `--state`, `--json` or search are refused. `gh api`, `gh search`, and `gh issue close|delete|transfer|lock|reopen` stay refused. Nothing touches pull requests or merges.
1306
+ - A search hit counts only when its body has exactly one key line for that spec, and the same key is still there when the issue is read again with `gh issue view`. Trust and parent are left to the caller.
1307
+
1308
+ **Azure DevOps tracker writes (`omg factory enqueue` on Azure DevOps).** The Azure DevOps tracker can create work items, update them, link them and find them by their `shipyard-key:` footer. Only `omg factory enqueue` uses these writes, and the factory guard allows them only with the enqueue write context. Every call is `az devops invoke` (REST 7.1, `application/json-patch+json`):
1309
+
1310
+ | Write | Route | JSON-patch paths |
1311
+ |---|---|---|
1312
+ | create | `wit/workItems` `POST` ([docs](https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/create?view=azure-devops-rest-7.1)), `type` = one of `factory.intake.itemTypes` (the first one) | `add` only: `System.Title`, `System.Description`, `Microsoft.VSTS.Common.AcceptanceCriteria`, `Microsoft.VSTS.Common.Priority`, `System.Tags`, `System.AreaPath` |
1313
+ | update, link | `wit/workItems` `PATCH` ([docs](https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?view=azure-devops-rest-7.1)), starting with `test /rev` | `add` only: the four fields above, `System.Tags`, and `/relations/-` |
1314
+ | find by key | `wit/wiql` `POST` (a read) | `[System.Description] CONTAINS 'shipyard-key: <spec>/'`, then each hit is read and must hold exactly one key line for that spec |
1315
+
1316
+ - A link is `{ rel, url }` with `rel` either `System.LinkTypes.Hierarchy-Reverse` (parent) or `System.LinkTypes.Dependency-Reverse` (predecessor), the links `parent` and `dependsOn` read back, and `url` a work item of the forge org. Other link types, attributes, removing or replacing a link, and a second parent are refused. An existing link is not written again.
1317
+ - Description and acceptance criteria are HTML the adapter builds: every character escaped, lines joined with `<br>`, the criteria as a `<ul>` list. The guard accepts only escaped text, `<div>`, `<br>`, `<ul>`, `<li>` and the entities `&amp; &lt; &gt; &quot; &#39;`, so no link, image or attribute gets through. Control characters (other than tab) and bidi controls are refused.
1318
+ - Titles are one line of visible text, at most 255 characters, with no control or format characters and no leading `-`.
1319
+ - Tags never start with `factory:`, `harbor:` or `-`, and contain no `,`, `;` or control characters. A new work item carries only allowlisted tags. An update keeps the item's other tags.
1320
+ - The area path (from an `area-tag` intake source) must be the forge project or under it. Priority is 1 to 4.
1321
+ - The body file is read like a GitHub one: a regular file with one link, at most 65536 characters. `--in-file` may not contain `:` after the drive letter, because that would name an NTFS alternate data stream. `omg factory run`, `omg factory check` and `omg ship` refuse the create route and every tracker path.
1322
+
1323
+ #### `omg factory board` (experimental)
1324
+
1325
+ `omg factory board` shows intake items, their factory runs and their tracker stages in one view. It works the same on GitHub and Azure DevOps, and it is strictly read-only: it runs on `omg factory check`'s read guard with no marker, so every tracker or forge write (a gh edit, comment or PR call, an az POST or PATCH other than the WIQL query the `area-tag` and `board-column` sources run) is refused, and it writes no local state.
1326
+
1327
+ ```bash
1328
+ omg factory board [--json] # the items of factory.intake.source, plus runs in flight
1329
+ omg factory board --parent <spec> [--json] # the spec's children, as omg factory check --parent
1330
+ omg factory board --source <spec> [--limit n]
1331
+ omg factory board --no-check # no check rules: one batched tracker read for the live stages
1332
+ ```
1333
+
1334
+ - **Columns.** `backlog` holds the items without a run, by check bucket (runnable, needs-plan, blocked) with the reason. Every other item sits in the column of its run's expected tracker stage: queued, building, reviewing, verifying, ready-to-merge, done, blocked or cancelled. A run parked at the engine's `blocked-by` gate shows in `blocked` with the gate's reason. With `factory.progress` configured, the column titles are the mapped label (GitHub), or the column or state (Azure DevOps).
1335
+ - **Rows.** Phase or `awaiting-human: <gate>`, the running lane, AI credits spent, the PR (`#n` on GitHub, `!n` on Azure DevOps), the head, and the latest `omg ship` verdict for the PR.
1336
+ - **Live stage.** The progress label on GitHub; on Azure DevOps the board column, else the state, mapped back through `factory.progress.stages`. When several stages match, the recorded one wins.
1337
+ - **Flags.** `drift`: the live stage is not the one the run recorded (a human moved the card). `unsynced`: the recorded stage is not the expected one (a progress write failed or is pending). `seal!`: the run state fails its integrity check, is unreadable, or has no seal at all (`integrity: 'none'`, a legacy state), so do not act on it. `stale`: a run that is not finished and not at a gate has not changed for 24 hours.
1338
+ - **Runs not in the intake source.** Runs in flight whose key is not in the source (a run started with an explicit id, a ci-heal `heal-<sig8>` run) get their own section. Finished runs outside the source are not shown.
1339
+ - **`--no-check`** skips the check rules (no comment, plan or PR reads). On Azure DevOps the items are read with one `GET wit/workitems?ids=…&fields=…&errorPolicy=omit` per 200 ids; on GitHub with one `gh issue view` per item.
1340
+ - **`--json`** (schemaVersion 1): `{ schemaVersion, ok, forge, repo, source, parent, columns: [{ stage, title, items }], outside, warnings }`. Each row has `id`, `title`, `url`, optional `error`, `check` (`{ bucket, priority, reasons, detail }`; absent with `--no-check`), `run` (including `gate: { name, reason }` when the run is parked at a gate), `stage` (`expected`, `recorded`, `live`), `liveText`, `flags` and `gates`. Tracker and state text is plain (ANSI and control characters removed).
1341
+ - **Exit codes:** `0` shown; `1` an item could not be read (`read-failed`); `2` usage; `5` incompatible (an unsupported remote or forge, or no intake source and no runs).
1342
+
1343
+ #### `omg factory poll` (experimental)
1344
+
1345
+ `omg factory poll` is a foreground polling loop for GitHub and Azure DevOps. Use it where webhooks cannot reach you: Azure DevOps service hooks need a public HTTPS endpoint, and `omg factory listen` takes GitHub webhooks only. A tick's reads never start a session or a lane (only the opt-in auto-start in step 5 starts a run), and never write to the tracker or the forge: forge calls run on `omg factory check`'s read guard with no marker, and the heal scan on the heal guard. It writes local state only: `.omg/state/factory-poll.json` and `.omg/state/factory-poll-audit.jsonl` (never through a symbolic link). The heal tick also writes heal state under its `scan.lock`, and the heal scan records in the ledger directory outside the repository.
1346
+
1347
+ ```bash
1348
+ omg factory poll [--interval 5m] [--once] [--no-heal] [--no-intake] [--no-prs] [--json]
1349
+ ```
1350
+
1351
+ One tick, in this order:
1352
+
1353
+ 1. **Heal.** Only when the forge has the heal capability (GitHub; Azure DevOps with `factory.heal.pipeline`): `omg factory heal scan`, which classifies new red CI runs into heal state. A tick never runs `heal run` or `heal approve`, because diagnosis lanes are billed. On Azure DevOps the tick uses `heal scan`'s own wiring: it reads only the builds of `factory.heal.pipeline` (the read guard pins `definitions` to it), with GETs only. Without a pipeline the tick is skipped with `heal scan`'s message.
1354
+ 2. **Intake.** Reads `factory.intake.source` and compares the ids with `seen` in the poll file. Each new id is checked with `omg factory check`'s rules and audited as `intake-new` with its bucket. Nothing is started here: run it with `omg factory run <id>`, or turn on `factory.intake.autoStart` (step 5).
1355
+ 3. **PRs.** For every run in flight with a PR: a PR a human completed or abandoned prints the command that records it (`omg factory run <id>`, or `omg factory heal approve <sig8>` for a ci-heal run). On Azure DevOps the active and pending text threads are counted. ADO's system threads and the factory's own comments are left out: every PR comment the factory posts on Azure Repos ends with the hidden line `<!-- omg-factory: comment -->`. The author does not count, so threads you write by hand are counted even when the factory runs as your own `az` login. Review comments never start a lane.
1356
+ 4. **Board.** The `omg factory board` rows that changed since the previous tick (all rows on the first tick), read without the check rules. With `--json`, each tick prints one JSON object on one line (schemaVersion 1): `{ tick, at, forge, repo, heal, intake, prs, board, idle, autoStart, rateLimited, errors, warnings, nextIntervalMs }`. `idle` is true when no engine owns the repository, no run is in flight (a run parked at a gate does not count) and every run state is readable. It is advisory: it is read without the engine's repository owner lock, so a consumer that starts a run must still take that lock and skip the tick when it is refused.
1357
+ 5. **Auto-start** (off by default). With `factory.intake.autoStart: true`, an idle tick starts one `omg factory run --next --json` and waits for it to end. It starts only when all of these hold:
1358
+ - the tick is idle, and no run state is unreadable or fails its integrity seal (such a state could hide a run in flight);
1359
+ - the intake read succeeded and the tick was not rate-limited;
1360
+ - poll's claim of the engine's run lock succeeds. `idle` is only advisory, so poll claims the lock atomically right before the start, the same way an engine does. A refusal skips the tick and is not an error. Poll then releases the lock, and the run's own claim is the binding one: an engine that starts in between makes the run refuse, so two engines never run;
1361
+ - there is budget headroom: the `factory.run` limits resolve (the run's own per-lane AI-credit cap check), and the AI credits in the budget ledger are below `budget.softLimit`.
1362
+
1363
+ The budget gate fails closed. It reads `budget.softLimit` from the user config at its default location, then from `.copilot/omg.jsonc` committed on the base branch (the same trusted layers as `autoStart`). The working-tree `.copilot/omg.jsonc` can only lower it, the same tighten-only rule as `factory.run`. Each of these blocks the start, with the reason in the tick's `autoStart`:
1364
+ - no trusted `budget.softLimit` ("autoStart needs budget.softLimit (user config or base branch)"), or an invalid one;
1365
+ - a budget ledger that exists but is corrupt or not a version-1 ledger (a missing ledger counts as empty);
1366
+ - `OMC_BUDGET_GOVERNOR=0`: with the governor off, poll starts no run.
1367
+
1368
+ A run you type yourself (`omg factory run`) never reads this gate; its budget behaviour is unchanged.
1369
+
1370
+ The child has a wall-clock limit: past it poll sends SIGTERM, then SIGKILL after a 2 min grace. On POSIX the child leads its own process group and both signals go to the group, so its lane children die with it. On Windows the timeout kill reaches only the engine process, not its lanes. A tick warns "budget ledger <path> disappeared; spend restarts at 0" when a ledger an earlier tick saw is gone.
1371
+
1372
+ The tick's `autoStart` field is `{ started: false, reason }`, or `{ started: true, parsed, next, exitCode, message }`: `next` is the item the run took (`null` when nothing was runnable) and `exitCode` is the run's exit code. `parsed` is false when the run's stdout held no outcome (empty, truncated past 4 MiB, or not one of its `--json` documents). `next` then means nothing: the text output prints `outcome unreadable`, and the audit's `auto-start-done` record carries `outcome: "unreadable"` instead of `next`. Otherwise the text output prints an `auto-start:` line with the same facts, and the audit gets `auto-start` and `auto-start-done` records. At most one run starts per tick. Poll never starts the listener chain, `heal run` or `heal approve`.
1373
+
1374
+ The run is a child `omg` process with the same node and CLI entry, in the repository root. It takes the engine's guard, run lock, `factory.run` limits and forge config exactly as if you had typed `omg factory run --next`, and its progress goes to stderr. The tick's reads stay on the read guard, which still refuses `omg`. While the run lasts, no tick runs.
1375
+ - **Signals.** Poll forwards its stop signals to the run, which stops after its current poll; a second signal ends both at once. On Linux and macOS the run has its own process group, so Ctrl+C reaches it once, through poll. On Windows it shares the console, which delivers Ctrl+C to it directly, so poll forwards only SIGTERM.
1376
+ - **Time limit.** The run gets `maxRunWallTimeMinutes + laneTimeoutMinutes + gatesTimeoutMinutes + 30 min` of wall-clock time (from `factory.run`; 6.5 h with the defaults). The engine checks its wall time only between steps, so one run can overrun it by one lane or one gates phase. The 30 min cover git and forge calls. Past the limit the run gets SIGTERM, then SIGKILL 2 min later, and the tick reports the outcome as unreadable.
1377
+
1378
+ `factory.intake.autoStart` is read only from the user config at its default location and from `.copilot/omg.jsonc` committed on the base branch. One key covers GitHub and Azure DevOps. A working-tree value that differs from the base branch is ignored with a warning, the same rule as `factory.progress` and `factory.heal.pipeline`, because a lane could otherwise switch on unattended billed runs.
1379
+
1380
+ The working-tree `factory.intake.source` and `factory.intake.limit` (and `factory.check.*`) still apply. A file in the working tree therefore steers which item an unattended start picks. `omg factory check`'s rules still decide what is runnable, and the switch and the budget come only from the trusted layers.
1381
+
1382
+ - **Interval.** The default is 5 min and the floor is 2 min (Azure DevOps allows 200 TSTU per sliding 5 minutes per user). A tick that hits the rate limit (`TF400733`, HTTP 429) doubles the wait, up to 60 min. The next clean tick resets it. `az devops invoke` shows no `Retry-After` header, so this backoff is the only control.
1383
+ - **One poller per repository.** The poll file records the owner's pid and host, and the owner writes a `beatAt` heartbeat each tick. A second poller, including `--once`, is refused while the first runs; the refusal names the poll file to delete if no poller runs. An owner whose process has died on this host, or whose heartbeat is older than 2 h (twice the 60 min ceiling), is taken over.
1384
+ - **Config.** The poller resolves the forge and intake config once, at start, including `factory.intake.autoStart` and the budget gate's `budget.softLimit` and `factory.run` layers. Only the heal config and the budget ledger are read again each tick. Restart the poller after config changes.
1385
+ - **Stopping.** SIGINT or SIGTERM ends the loop after the current tick. A second signal exits at once.
1386
+ - **Exit codes:** `0` stopped by a signal, or a clean `--once` tick; `1` a read failed in the `--once` tick, or another poller runs; `2` usage (a bad `--interval`); `5` incompatible.
1387
+
1388
+ #### `omg factory enqueue`
1389
+
1390
+ ```bash
1391
+ omg factory enqueue --spec <id> --file <tickets.json> [--dry-run] [--json]
1392
+ ```
1393
+
1394
+ Pushes launch's C3-approved tickets to the tracker as children of the spec issue or work item (shipyard ↔ factory design §3.2–§3.4), on GitHub and Azure DevOps. Launch writes the ticket file to its scratchpad, runs `--dry-run`, shows the output at C3, then runs it again without `--dry-run`.
1395
+
1396
+ ```json
1397
+ {
1398
+ "schemaVersion": 1,
1399
+ "spec": 412,
1400
+ "tickets": [
1401
+ {
1402
+ "key": "auth-token-refresh",
1403
+ "title": "Refresh tokens before expiry",
1404
+ "body": "## Context\n…",
1405
+ "acceptance": ["`TokenStore.refresh()` runs when < 60 s remain"],
1406
+ "blockedBy": ["token-store-port", "#123"],
1407
+ "priority": 2
1408
+ }
1409
+ ]
1410
+ }
1411
+ ```
1412
+
1413
+ - `key` is `[a-z0-9-]{3,60}` and unique in the file. `title` is one line. `acceptance` holds 1 to `factory.check.maxAcceptanceItems` one-line items, and they can't all be vague. `blockedBy` holds keys in the file or `#<n>` for an existing issue. `priority` (optional) is 1..4 and becomes the `priority:p<n-1>` label. `--spec` must match `spec`.
1414
+ - The command refuses with exit 2, and writes nothing, on: an unknown field, a duplicate key, a `blockedBy` cycle or unknown reference, too many or all-vague AC items, control or format characters (such as bidi overrides) in the text, a rendered body over `factory.check.maxBodyChars`, a spec that is closed, isn't an issue of the forge repository or whose author isn't an owner, member or collaborator, a `#n` that does not exist, or two trusted issues holding the same key.
1415
+ - Each ticket becomes an issue whose body is the ticket body, then `## Acceptance criteria` with a checkbox per item, then a `<!-- shipyard:edges -->` section (`Part of #<spec>` and one `Blocked by #n` per edge), then the footer `shipyard-key: <spec>/<key>`. It gets the intake label (when `factory.intake.source` is a label) and the priority label. The spec body gets a `<!-- shipyard:tickets -->` task list (`- [ ] #n`) that `omg factory check --parent` reads. A box ticked there stays ticked.
1416
+ - **Model-written text is neutralized** before it is posted from your account. @-mentions, `#n`, `GH-n` and cross-repository `owner/repo#n` references and issue/PR/discussion URLs (also bare `www.` ones) go into code spans, so nobody is notified and no backlink appears on another issue. `<!--` is escaped as `&lt;!--`, so an unclosed comment can't hide the acceptance criteria, edges or key from a reader. `omg-plan:` and `shipyard-key:` are escaped (`omg-plan\:`), as are `Acceptance criteria` headings, `Depends on`/`Blocked by`/`Part of #n` lines and task-list `- [ ] #n` lines, so ticket text can't become a trusted plan link, a second key, an edge or a child.
1417
+ - **Idempotent.** A key counts only on an issue by a trusted author (owner, member or collaborator) whose `Part of #<spec>` line names the spec. Holders are found by the key search and among the spec's task-list children; the task list is rewritten right after each create, because GitHub search is eventually consistent. After a partial failure, an immediate re-run may still need a short wait. Keys on other issues are listed under `ignored` and don't count, so an outside issue can't claim a key. Each ticket is then `created`, `unchanged` (no write), `updated` (title, body or labels changed), or `kept-claimed` (never edited) when the issue is closed, has a factory run state, has an open or merged `factory/issue-<n>` PR, or has that branch on origin. A key that is in the tracker but not in the file is reported as `orphaned`. It stays open and stays in the spec's task list, so the captain decides whether to close it.
1418
+ - Edges are written in a second pass, once every new issue has its number.
1419
+ - **On Azure DevOps** each ticket becomes a work item of the first `factory.intake.itemTypes` type. `System.Description` is the ticket body plus the `shipyard-key:` footer, escaped into HTML by the adapter. The criteria go into `Microsoft.VSTS.Common.AcceptanceCriteria` as an HTML list and the priority into `Microsoft.VSTS.Common.Priority`. The parent is a `System.LinkTypes.Hierarchy-Reverse` link to the spec, added right after the create, and each edge is a `System.LinkTypes.Dependency-Reverse` link to the predecessor, added once every id is known. The spec itself is never edited: its children are its `Hierarchy-Forward` links. An `area-tag` intake source gives a new work item its tag and area path. A `board-column` or `wiql-query` source gets a warning, because enqueue never sets a board column or a state. A link is never removed: when the file drops an edge, enqueue warns and leaves the link for the captain. Trust is the creator's `uniqueName` in `factory.forge.azureDevOps.trustedAuthors`, read from the user config only. With that list empty, enqueue refuses. The spec, every `#n` edge and every key holder must be work items of the forge project. A key holder by a trusted creator with no parent (its parent link failed after the create) is adopted and linked: a trusted, in-project work item that carries this spec's key footer but has no parent counts as a holder, and enqueue edits it and links it to the spec. A key holder outside the forge project is ignored. Model text loses its mention and link signs: `@` before a name or `<GUID>`, and `#` or `!` before a number, become the fullwidth `@`, `#` and `!`, so no mention, work item link or pull request link forms. Markup such as `<a data-vss-mention>` can't form at all, because every `<` is escaped. `omg-plan:`, `shipyard-key:` and `Acceptance criteria` headings are escaped as on GitHub.
1420
+ - Body files are written to a fresh temporary directory outside the worktree (enqueue refuses if the temporary directory is inside it), then removed. gh reads the guard's own copy of each file.
1421
+ - **The mark step.** After the writes, enqueue runs `omg factory check <ids> --mark --yes` over this file's created, updated and unchanged issues only, which adds `factory.intake.marker` to the runnable ones. Orphans and any other task-list line of the spec are never marked. The dry run lists these mark candidates. The launch C3 signature is the confirmation for the issues, the intake label and the marker, so harbor's accept step doesn't apply these labels. The marker label must already exist (`omg factory setup`).
1422
+ - `--dry-run` prints every planned write (title, labels and the exact body; new issues show as `#<key>` in edges; on Azure DevOps also the criteria, the priority and the links to add) and writes nothing. The guard refuses any create or edit during a dry run.
1423
+ - `--json` prints `{ schemaVersion: 1, ok, dryRun, spec: { id, taskList, planned? }, items, ignored, mark, warnings }`. Each item is `{ key, id, action, bucket, reasons, markCandidate }`, plus `planned` on a dry run. `bucket` and `reasons` come from the mark step's check.
1424
+ - Calls: every gh and git read is one of `omg factory check`'s shapes. Writes are the three tracker write shapes above, plus check's marker edit in the mark step. Nothing closes, deletes or merges anything.
1425
+
1426
+ | Exit code | Meaning |
1427
+ |---|---|
1428
+ | 0 | enqueued (or planned, with `--dry-run`) |
1429
+ | 1 | a tracker read or write failed, or the mark step did (re-run: it is idempotent) |
1430
+ | 2 | usage, or a refused ticket file (nothing written) |
1431
+ | 5 | incompatible: no forge, or an unsupported one |
1432
+
1433
+ `--json` prints `{ schemaVersion: 1, ok, forge, repo, source, counts, items, mark, warnings }` (`source` is `null` for ids and `--parent`). Each item is `{ id, title, url, bucket, reasons, detail, priority, planSource }`. `reasons` holds the exact reason code (empty when the item is runnable), and `planSource` is `omg-plan`, `issue-body` or `ado-acceptance`. `mark` is `{ marker, requested, confirmed, marked, alreadyMarked, failed }`.
1271
1434
 
1272
1435
  | Exit code | Meaning |
1273
1436
  |---|---|
1274
1437
  | `0` | The check ran (whatever the buckets), including a `--mark` you declined |
1275
1438
  | `1` | An item is `read-failed`, a marker write failed, or the setup itself failed (for example the label list) |
1276
- | `2` | A usage error: a bad id, `--source` or limit; no ids and no intake source; or `--mark` without `--yes` when there is no terminal or with `--json` |
1439
+ | `2` | A usage error: a bad id, `--parent`, `--source` or limit; `--parent` with ids, `--source` or `--limit`; no ids and no intake source; or `--mark` without `--yes` when there is no terminal or with `--json` |
1277
1440
  | `5` | Incompatible: the forge config does not match the origin remote, the remote is neither GitHub nor Azure DevOps, this build has no adapter for the forge, or the `--mark` label does not exist |
1278
1441
 
1279
1442
  #### `omg factory heal` (experimental)
@@ -1290,6 +1453,7 @@ omg factory heal close <sig8> [--json] # close a heal run parked at he
1290
1453
  ```
1291
1454
 
1292
1455
  - **Candidates:** a red push run on the integration branch, or one failure signature on PR runs of two or more head branches in 72 hours. Cancelled, skipped and in-progress runs never count. Jobs in `factory.heal.ignoreJobs` never count. The defaults are "No Committed Build Artifacts" and "Version Consistency Check".
1456
+ - **Azure Pipelines:** on an Azure DevOps forge the CI history is the builds of the definition `factory.heal.pipeline: { definitionId }` names. Set it in the base branch's `.copilot/omg.jsonc`, not in the user config: the user config is shared across repositories and wins over the base branch, so a user-config definition can build another repository. Builds of another repository, push builds of another branch and builds of a tag are dropped. Without the key every `heal` command refuses (exit 3) and names it; `omg factory setup --heal-pipeline <id>` writes it. Every az call heal makes is a GET of the forge repository (the guard's `read` policy, with the context built from the same config as the CI reads). The ci-heal run of `heal approve` reads the repository url from the forge, opens its draft PR without a work item link, links the CI runs to their `_build/results` pages, and parks at the human merge with the head-pinned merge body, as `omg factory run` does on Azure DevOps.
1293
1457
  - **Signature:** each failed job contributes its name and its sorted failing tests. A job with no failing test contributes its failing step and its first `##[error]` line, normalized. The sha256 of the job signatures is the dedupe key, and its first 8 hex characters are the `sig8`.
1294
1458
  - **Classes:** the classifier checks, in order, infra patterns, the known-flaky list at `origin/<base>`, the dev history and an environment diff. The diff covers image, image version, runner, git, node and npm. When the environment changed and the red sha adds no code the green sha lacks, the class is `env-change`. A sha that is green on one image version and red on another is also `env-change`. The other classes are `infra`, `known-flaky`, `intermittent`, `regression`, `regression-or-env` and `unknown`.
1295
1459
  - **State and limits:** each signature is stored in `.omg/state/factory/heal/<sig8>.json`. A run is counted once per signature. The fixed limits are one open heal run and one recorded rerun per signature. The user config sets `factory.heal.dailyRuns` (default 3) and `factory.heal.dailyDebugLanes` (default 4). The project config can only lower them. Over a limit, a signature is queued as `blocked: rate-limit`.
@@ -1317,7 +1481,7 @@ omg factory setup --intake label:factory --yes --json # non-interactive (no TTY
1317
1481
  omg factory setup --forge azure-devops --org contoso --project Web --repo web-app \
1318
1482
  --intake wiql-query:<guid> | board-column:"Web Team/Stories/Ready" | area-tag:"Web\Factory#factory" \
1319
1483
  [--item-types "User Story,Bug"] [--progress default|none|<file.json>] [--board "Web Team/Stories"] \
1320
- [--trusted-author owner@example.com] [--scope project|user] [--dry-run] [--yes] [--json]
1484
+ [--trusted-author owner@example.com] [--heal-pipeline <definitionId>|none] [--scope project|user] [--dry-run] [--yes] [--json]
1321
1485
  omg factory setup --intake label:factory | milestone:v5.18 ... # GitHub
1322
1486
  ```
1323
1487
 
@@ -1325,7 +1489,8 @@ omg factory setup --intake label:factory | milestone:v5.18 ... # GitHub
1325
1489
  2. **Auth.** On GitHub this runs `gh auth status --hostname <host>`. On Azure DevOps it checks `az extension show --name azure-devops`, then `az account show` or a set `AZURE_DEVOPS_EXT_PAT`, then reads the project and the repository. A failure exits 3 and prints the command that fixes it. Nothing an auth command prints is shown, so no token reaches the output.
1326
1490
  3. **Intake.** On GitHub the source is a label or an open milestone. GitHub Projects v2 is not supported yet. On Azure DevOps it is a flat saved query (its GUID), a board column (`<team>/<board>/<column>`), or an area path plus a tag (`<area>#<tag>`). Each value is checked against the forge, and an unknown query, milestone, board, column or area exits 5. On Azure DevOps, `--item-types` must name existing types. Without it, the defaults that exist in the project are used.
1327
1491
  4. **Progress.** `default` on GitHub is the `factory:<stage>` label family. On Azure DevOps it maps nothing, so you map columns and states yourself. `none` turns progress off. A file holds `{ "enabled"?: boolean, "stages": { "<stage>": { "label" | "column" | "state": "…" } } }`. On Azure DevOps a column must be on the board: either the intake board, or the board given with `--board <team>/<board>`. A state must exist for every item type. A Completed or Removed state is allowed only for `done`, and `blocked` and `cancelled` never change the state. A validation failure exits 5. On GitHub, missing intake and progress labels are created with `gh label create <name> --color 7c7c7c` only after confirmation or `--yes`. This reuses the harbor label helper of `omg intake`.
1328
- 5. **Write.** The wizard edits with `jsonc-parser`, so comments and every other key stay as they were. It prints the diff and asks before writing; `--yes` confirms without asking. An edit that would change anything but `factory.forge`, `factory.intake` and `factory.progress` (or `trustedAuthors` in the user config) is refused, so the `ship.*` safety keys never move. A config with duplicate keys, a `factory` that is not an object, or a symlinked `.copilot/omg.jsonc` (or `.copilot` directory) is refused with exit 5; a leading UTF-8 BOM is kept. The forge identity, intake and progress always go to `.copilot/omg.jsonc`, whatever `--scope` says. That file is protected, so the engine reads its `forge.*` and `progress.*` only from `<base>` once the file is committed there. The user config at its default location is shared by every repository, so it gets only `factory.forge.azureDevOps.trustedAuthors` (`--trusted-author`); `--scope user` is accepted and only notes this. The config is written before any missing label is created. The result must pass the same resolver the engine uses.
1492
+ **Heal pipeline (Azure DevOps, optional).** On a TTY the wizard offers `none` and the build definitions of the forge repository; `--heal-pipeline <id>|none` answers without one, and without either nothing is asked or written. The definitions are read with `repositoryId` set to the GUID that `git.repositories.GET` answers for the forge repository, and a definition whose own repository is another one (or not Azure Repos Git) is dropped, so an id outside that list exits 5. The pick goes to `.copilot/omg.jsonc` as `factory.heal.pipeline` and counts once that file is committed on `<base>`.
1493
+ 5. **Write.** The wizard edits with `jsonc-parser`, so comments and every other key stay as they were. It prints the diff and asks before writing; `--yes` confirms without asking. An edit that would change anything but `factory.forge`, `factory.intake`, `factory.progress` and `factory.heal.pipeline` (or `trustedAuthors` in the user config) is refused, so the `ship.*` safety keys never move. A config with duplicate keys, a `factory` that is not an object, or a symlinked `.copilot/omg.jsonc` (or `.copilot` directory) is refused with exit 5; a leading UTF-8 BOM is kept. The forge identity, intake and progress always go to `.copilot/omg.jsonc`, whatever `--scope` says. That file is protected, so the engine reads its `forge.*` and `progress.*` only from `<base>` once the file is committed there. The user config at its default location is shared by every repository, so it gets only `factory.forge.azureDevOps.trustedAuthors` (`--trusted-author`); `--scope user` is accepted and only notes this. The config is written before any missing label is created. The result must pass the same resolver the engine uses.
1329
1494
  6. **Preview.** The wizard lists the source's first 10 items through the forge adapter and the engine's guard. For now each row says `readiness: run omg factory check`. A forge without an adapter in this build loses only the preview. The wizard also reports any `omg factory init` prerequisites that are missing. Those are needed only for the chain route table.
1330
1495
 
1331
1496
  - **Non-interactive:** `--yes`, `--json` or no TTY takes every answer from flags. A missing `--intake`, or a missing `--yes` without `--dry-run`, exits 2 and names the missing flags.
@@ -1333,7 +1498,7 @@ omg factory setup --intake label:factory | milestone:v5.18 ... # GitHub
1333
1498
  - **Guard:** every forge call goes through a setup allowlist. On GitHub it allows `gh auth status`, `gh label list`, `gh label create` with the fixed color, and one GET of this repository's open milestones. On Azure DevOps it allows `az devops invoke` GETs of routes in `src/forge/ado/routes.ts`. Each GET is pinned to the detected org and project, uses the route's API version and `--detect false`, and has no `--in-file`, `--debug` or `--verbose`.
1334
1499
  - **JSON:** `{ exitCode, forge, auth, config, written: <paths>|null, diffs, labels: { missing, created }, prerequisites, preview, previewError?, notes, error? }`.
1335
1500
  - **Exit codes:** `0` written or dry run, `2` usage error, `3` auth or Azure DevOps extension missing, `5` incompatible (unsupported forge, mismatch, unknown query, state validation failed), `1` other failures.
1336
- - **Listener:** `omg factory listen` receives GitHub webhooks only. It refuses when the origin remote or the user config's `factory.forge.kind` is `azure-devops`.
1501
+ - **Listener:** `omg factory listen` receives GitHub webhooks only. It refuses when the origin remote or the user config's `factory.forge.kind` is `azure-devops`, and points at `omg factory poll`.
1337
1502
 
1338
1503
  #### Live acceptance on Azure DevOps (maintainers)
1339
1504
 
@@ -1341,22 +1506,24 @@ Three scripts in the repository (not in the package) test the factory against a
1341
1506
 
1342
1507
  ```bash
1343
1508
  node scripts/ado-acceptance.mjs --org https://dev.azure.com/<org> --source C:/Code/ExcavatorTrek \
1344
- [--phase preflight|create|exercise|heal-drill|capture|cleanup|all] [--run <runId>] \
1345
- [--pool <self-hosted pool> | --hosted] [--with-lanes] [--project-id <guid>] [--dry-run]
1509
+ [--phase preflight|create|enqueue|exercise|heal-drill|capture|cleanup|all] [--run <runId>] \
1510
+ [--pool <self-hosted pool> | --hosted] [--with-lanes] [--project-id <guid>] [--yes] [--dry-run]
1346
1511
  ```
1347
1512
 
1348
1513
  - **Run:** each run makes one private Agile project named `omg-acc-<yyyymmddHHMM>` (UTC). Its manifest is `~/.omg/acceptance/<runId>.json`. It records every created id and is written before each create. The clone, the OMC recording (`OMG_ADO_RECORD_DIR`) and the capture are kept in `~/.omg/acceptance/<runId>/`. Later phases take `--run`; without it they use the newest manifest.
1349
- - **Phases:** `all` runs `preflight`, `create`, `exercise` and `capture`. `heal-drill` and `cleanup` run only by name.
1514
+ - **Phases:** `all` runs `preflight`, `create`, `enqueue`, `exercise` and `capture`. Together they walk the shipyard–factory flow: a spec, its tickets through `omg factory enqueue`, and `omg factory run --next --parent <spec>`. `heal-drill` and `cleanup` run only by name.
1350
1515
  - `preflight` checks az, the `azure-devops` extension, the login, the org, a clean `--source` and the agent pools. It is read-only.
1351
- - `create` makes the project. It clones `--source` with `git clone --no-local`, commits `azure-pipelines.yml` on `main`, and pushes `main` and the other branches to the new, empty repository (no force). It then creates the `ci` pipeline and one User Story per `## EXC-NNN` ticket of `BACKLOG.md`. Each story gets its acceptance criteria and the tag `factory`, and every `Depends on:` becomes a predecessor link. It runs `omg factory setup` and pushes `.copilot/omg.jsonc`. Last, after every direct push, it creates a blocking build policy on `main` (a branch with required policies refuses direct pushes without bypass permission). It adds no `trustedAuthors`.
1352
- - `exercise` runs `omg factory check --json`, `omg factory board --json` and `omg factory run <first runnable> --dry-run`.
1516
+ - `create` makes the project. It clones `--source` with `git clone --no-local`, commits `azure-pipelines.yml` on `main`, and pushes `main` and the other branches to the new, empty repository (no force). It then creates the `ci` pipeline and the spec, a Feature work item without the `factory` tag (so it is never intake). The manifest records the spec's id and its creator's `uniqueName`. It runs `omg factory setup` and pushes `.copilot/omg.jsonc`. Last, after every direct push, it creates a blocking build policy on `main` (a branch with required policies refuses direct pushes without bypass permission). It adds no `trustedAuthors`.
1517
+ - `enqueue` hands the tickets to the factory as launch does at C3. On Azure DevOps, enqueue trusts only the `uniqueName`s in the user config's `factory.forge.azureDevOps.trustedAuthors`. When the spec's creator is not listed, the phase prints the user config path and the list before and after, and asks (`--yes` answers yes). The manifest records the name before `omg factory setup --trusted-author <list> --scope user` writes it. A no writes nothing and stops. The phase then turns each `## EXC-NNN` ticket of `BACKLOG.md` into a ticket of `<runId>/tickets.json`: key `exc-nnn`, its acceptance criteria, and each `Depends on:` ticket that the backlog defines as `blockedBy`. It runs `omg factory enqueue --spec <spec> --file <tickets.json> --dry-run --json` and prints the plan. The signature is the next question: on a yes it runs the same command without `--dry-run`. Enqueue creates the User Stories as children of the spec, with the predecessor links, the `factory` tag and the intake marker. A second `--dry-run` must find every ticket `unchanged`.
1518
+ - `exercise` runs `omg factory check --json`, `omg factory check --parent <spec> --json`, `omg factory board --json` and `omg factory run --next --parent <spec> --dry-run --json`. It checks that `check --parent` lists every ticket, that each ticket with a predecessor is `blocked` with `depends-on:#<predecessor>`, and that `--next` picks a runnable ticket.
1353
1519
  - `heal-drill` pushes a failing test to `main` and waits up to 20 minutes for its build. It then runs `omg factory heal scan` and `heal run <sig8> --dry-run`, and reverts the test with a new commit. It disables the build policy (`az repos policy build update --enabled false`) around each of its two pushes and enables it again right after.
1354
1520
  - `capture` runs `ado-capture.mjs` and `ado-fixture-diff.mjs` on the recording.
1355
- - `cleanup` deletes the project with `az devops project delete`. Azure DevOps soft-deletes it, so it can be restored for 28 days. Cleanup also removes the clone.
1356
- - **Credits:** without `--with-lanes` nothing spends Copilot credits. With it, `exercise` also runs `omg factory run <id>` (capped by the `factory.run` limits, which it prints first) and `omg factory poll --once`, then checks the recording: a draft PR linked to the item, gates read from policy evaluations, the run parked at `awaiting-human: merge`, and the PR never `completed`. `heal-drill` with `--with-lanes` also runs `heal run <sig8>` (one debugger lane) and, when that succeeds, `heal approve` (the ci-heal run).
1521
+ - `cleanup` deletes the project with `az devops project delete`, and with it the spec and the tickets. Azure DevOps soft-deletes it, so it can be restored for 28 days. Cleanup also removes the clone. It prints the `trustedAuthors` this run added and the user config they are in. It never edits the user config, so remove them yourself if they should not stay trusted.
1522
+ - **Credits:** without `--with-lanes` nothing spends Copilot credits. With it, `exercise` also runs `omg factory run --next --parent <spec> --json` (capped by the `factory.run` limits, which it prints first), `omg factory poll --once` and `check --parent` again. It then checks the recording and the outcome: the real run took the dry run's pick, a draft PR linked to the item, gates read from policy evaluations, the run parked at `awaiting-human: merge`, the merge gate comment on the item, the rollup line `- #<n> ready to merge: <PR url>` on the spec, no edit of the spec work item, the item no longer runnable, and its dependents still blocked. `heal-drill` with `--with-lanes` also runs `heal run <sig8>` (one debugger lane) and, when that succeeds, `heal approve` (the ci-heal run).
1523
+ - **No merge:** the factory never merges. `exercise` and `heal-drill` both end with `az repos pr list --status completed`, and any completed PR in the run's repository fails the phase.
1357
1524
  - **Agents:** the pipeline uses the self-hosted pool `Default` unless you pass `--pool <name>`. A self-hosted agent is free for one job, but you must register it in the org. `--hosted` uses Microsoft-hosted `ubuntu-latest`, which needs the org linked to an Azure subscription. Without an agent, builds stay queued, and `heal-drill` cannot finish.
1358
1525
  - **Cleanup guard:** cleanup needs `--org`, equal to the manifest's org, and deletes only the project id in that run's manifest. Every az call asks for `--output json`, so an unreadable `az devops project show` refuses too. It refuses when the manifest's project name lacks the `omg-acc-` prefix or is not the run id, when `--project-id` differs from the manifest, when `az devops project show` names another project, and when `<runId>/` or its clone is a symlink or a junction.
1359
- - **Dry run:** `--dry-run` prints the exact argv of every command, and every file it would write, for any phase. It runs nothing, not even read-only commands, and writes nothing.
1526
+ - **Dry run:** `--dry-run` prints the exact argv of every command, and every file it would write, for any phase. It runs nothing, not even read-only commands, and writes nothing. It prints the questions it would ask, and the user-config change, without asking.
1360
1527
 
1361
1528
  `node scripts/ado-capture.mjs --org https://dev.azure.com/<org> --project <p> --repo <r> [--moment <label>] [--work-items <ids>] [--prs <ids>] [--builds <ids>] [--out <dir>]` needs only node and az, so it can run on another computer. It makes GETs only, through `az devops invoke` (and `az --version`, `az extension show`). It writes fixtures in the format of `src/forge/ado/__tests__/fixtures.ts` into `<out>/<moment>/`, plus the text form of failed build logs, the resource table and the az environment. It also writes `<out>/manifest.json` with SHA-256s. Run it once per moment (for example `draft`, `ready`, `second-push`, `red-build`).
1362
1529
 
@@ -46,7 +46,7 @@ Humans sit only at the graded gates; everything between gates runs AFK.
46
46
  - **Issue webhook** ✅ — listener daemon: HMAC, repo whitelist, intake label gate, serial.
47
47
  - **Cron** ✅ — `omg intake schedule` (host-native timer, no daemon) → headless sweep.
48
48
  - **Session end** ✅ — chain enqueuer: reason → outcome → route table → next link.
49
- - **CI failure** ⚠️ **to build** — check-run failure webhook → listener route → diagnose/fix session (`diagnose:ci-failure` route entry). Same HMAC/whitelist path as issue intake.
49
+ - **CI failure** ✅ — `workflow_run` webhook → listener enqueues failed push runs of `ci.yml` on the dev branch → next `omg factory heal scan` processes them (no `diagnose` session; `check_suite` failures are discarded). Failures on other branches/workflows need a manual `omg factory heal scan`.
50
50
  - **Narrow starter loop** ⚠️ **to build** — `omg factory init --narrow`: one cron trigger + one session type + one reviewable PR (the "one lint rule a night" shape). The start-small configuration ships as the default; the full-pipeline route table is the widening, gated on the narrow loop's review track record.
51
51
 
52
52
  ### 3.2 Chain layer
package/docs/shipyard.md CHANGED
@@ -127,10 +127,26 @@ The cross-cutting express surfaces — **diagram** and **show-me** — are calla
127
127
 
128
128
  Shipyard corrects itself through its file-backed paper trail; `/oh-my-copilot:drydock --check` audits harness drift. These skills do not add a separate findings store, shipped/wontfixed state machine, hidden ledger, or `sy check`/`context-lint` commands.
129
129
 
130
+ ## Shipyard and the factory
131
+
132
+ The shipyard skills decide **what and why**, with the captain signing. `omg factory` (a CLI, not a skill) delivers **how**: unattended, with sandboxed lanes, protected paths, a credit budget, and gates enforced in code. Merges stay human — the engine parks every PR at `awaiting-human: merge`. The handoff between the two is code, not prose:
133
+
134
+ | Stage | Owner | The captain signs | Code enforces |
135
+ | --- | --- | --- | --- |
136
+ | Intake | `harbor` (the factory listener starts `look at #<n>`); routes accepted work, a single slice included, to `launch` and never runs `enqueue` | accept / reject, standing rules | `omg factory check <n> --json` as a read-only fact |
137
+ | Requirements | `intent` / `ask-navigator` / `loft` | intent accept, W1/W2, loft reaction | — |
138
+ | Spec + tickets | `launch` Phases 1–3 | C2, C3 on the `omg factory enqueue --dry-run` output | `enqueue`: schema, cycles, idempotency by `shipyard-key:`; the mark step |
139
+ | Delivery | `omg factory run --next --parent <spec>` | every merge, every `awaiting-human` gate | lanes, sandbox, budget, gates, one engine per repository |
140
+ | CI repair on the base | `omg factory heal` | `heal approve`, the merge | classification, caps |
141
+ | Closeout | `launch` Phase 5 | C5 | `omg factory check --parent <spec> --json` shows every child closed or merged |
142
+
143
+ Launch picks factory mode when `omg factory check --parent <spec>` works on a GitHub forge; otherwise, or with `--team`, it delivers through Team as before. Harbor and the navigator stay GitHub-only this cycle, and `enqueue` supports GitHub only. The legacy SessionEnd chain is frozen to one `intake → harbor` hop; `omg factory init --check` reports old routes and `--migrate` rewrites them.
144
+
130
145
  ## When to reach for what
131
146
 
132
147
  - one-point fix → `execute` directly (no shipyard ceremony)
133
- - multi-step feature → `launch`
148
+ - multi-step feature → `launch` (delivers through `omg factory` when one is configured)
149
+ - runnable tracker items waiting for unattended delivery → `omg factory run --next` yourself
134
150
  - foggy effort (destination unclear, questions not yet stateable) → `ask-navigator` first; it hands back a mission brief
135
151
  - external requests piling up (issues, bug reports, PRs) → `harbor` sweeps the intake and hands over a signature queue
136
152
  - new repo, or a repo where knowledge lives in heads → `drydock` first
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-copilot",
3
- "version": "5.18.2",
3
+ "version": "5.19.2",
4
4
  "description": "Multi-agent orchestration system for Copilot CLI - Inspired by oh-my-opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -168,5 +168,5 @@
168
168
  "publishConfig": {
169
169
  "access": "public"
170
170
  },
171
- "gitHead": "6aefc1e4ebb1db46bea55ecc541452ba45538398"
171
+ "gitHead": "d48a413a46eb31031952ef702250edf2e50cfc32"
172
172
  }
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-copilot",
3
- "version": "5.18.2",
3
+ "version": "5.19.2",
4
4
  "description": "Multi-agent orchestration system for GitHub Copilot CLI",
5
5
  "author": {
6
6
  "name": "oh-my-copilot contributors"