@defrex/autobuild 1.8.1 → 1.10.0

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 (429) hide show
  1. package/README.md +3 -3
  2. package/SPEC.md +1602 -134
  3. package/bin/ab-dispatch-generation.ts +2 -0
  4. package/docs/agent-runtimes.md +30 -3
  5. package/docs/answering-blocked-builds.md +15 -7
  6. package/docs/architecture.md +320 -53
  7. package/docs/builds.md +5 -0
  8. package/docs/cli.md +7 -1
  9. package/docs/configuration-overview.md +1 -0
  10. package/docs/configuration.md +515 -49
  11. package/docs/dispatcher-hosting.md +4 -0
  12. package/docs/dispatcher.md +17 -3
  13. package/docs/forges.md +1 -1
  14. package/docs/getting-started.md +1 -1
  15. package/docs/integration-overview.md +4 -2
  16. package/docs/integration-tree.md +102 -11
  17. package/docs/merge-policy.md +70 -14
  18. package/docs/migration-1.0.md +2 -1
  19. package/docs/operating.md +53 -4
  20. package/docs/operator-api.md +128 -16
  21. package/docs/optimization-nodes.md +1042 -0
  22. package/docs/overview.md +1 -1
  23. package/docs/plugin-authoring.md +50 -13
  24. package/docs/remote-store-protocol.md +46 -7
  25. package/docs/remote-ticket-protocol.md +50 -2
  26. package/docs/restacking.md +102 -10
  27. package/docs/seams.md +2 -2
  28. package/docs/setup.md +16 -3
  29. package/docs/skills.md +4 -2
  30. package/docs/spec-standard.md +2 -1
  31. package/docs/ticket-dependencies.md +5 -0
  32. package/docs/ticket-migration.md +4 -2
  33. package/docs/ticket-sources.md +30 -12
  34. package/docs/tickets.md +15 -6
  35. package/docs/troubleshooting.md +3 -2
  36. package/docs/verification.md +18 -6
  37. package/docs/workspaces.md +3 -1
  38. package/package.json +4 -3
  39. package/packages/core/src/accounts/chatgpt-oauth.ts +7 -5
  40. package/packages/core/src/cli/attempt.ts +103 -0
  41. package/packages/core/src/cli/attention.ts +11 -1
  42. package/packages/core/src/cli/binary-direct.ts +52 -1
  43. package/packages/core/src/cli/binary.ts +5 -3
  44. package/packages/core/src/cli/build-control.ts +328 -66
  45. package/packages/core/src/cli/context.ts +268 -15
  46. package/packages/core/src/cli/dashboard/detail.ts +26 -2
  47. package/packages/core/src/cli/dashboard/facts.ts +40 -3
  48. package/packages/core/src/cli/dashboard/integration-detail.ts +7 -2
  49. package/packages/core/src/cli/dashboard/landing-display.ts +24 -3
  50. package/packages/core/src/cli/dashboard/model.ts +127 -33
  51. package/packages/core/src/cli/dashboard/objective-row.ts +189 -0
  52. package/packages/core/src/cli/dashboard/render.ts +49 -3
  53. package/packages/core/src/cli/dashboard/reopen-display.ts +39 -0
  54. package/packages/core/src/cli/dashboard/tree.ts +12 -1
  55. package/packages/core/src/cli/dispatch-frontend.ts +9 -1
  56. package/packages/core/src/cli/dispatch-launch-stop.ts +55 -0
  57. package/packages/core/src/cli/dispatch-launcher.ts +26 -44
  58. package/packages/core/src/cli/dispatch-repository-feed.ts +1 -1
  59. package/packages/core/src/cli/dispatch.ts +136 -5
  60. package/packages/core/src/cli/env.ts +42 -0
  61. package/packages/core/src/cli/help.ts +212 -11
  62. package/packages/core/src/cli/init-agent.ts +4 -1
  63. package/packages/core/src/cli/init-readiness-remote.ts +3 -2
  64. package/packages/core/src/cli/init-validation.ts +2 -2
  65. package/packages/core/src/cli/init.ts +3 -2
  66. package/packages/core/src/cli/judge-entry.ts +82 -0
  67. package/packages/core/src/cli/judge.ts +233 -0
  68. package/packages/core/src/cli/landings.ts +3 -2
  69. package/packages/core/src/cli/main.ts +412 -143
  70. package/packages/core/src/cli/measurement-text.ts +19 -0
  71. package/packages/core/src/cli/objective.ts +154 -0
  72. package/packages/core/src/cli/publication-settlement.ts +106 -22
  73. package/packages/core/src/cli/repo-lease.ts +1 -0
  74. package/packages/core/src/cli/repository-status.ts +179 -19
  75. package/packages/core/src/cli/status.ts +195 -17
  76. package/packages/core/src/cli/store-opening.ts +4 -0
  77. package/packages/core/src/cli/terminals.ts +205 -8
  78. package/packages/core/src/cli/ticket-start.ts +53 -0
  79. package/packages/core/src/cli/ticket.ts +68 -2
  80. package/packages/core/src/cli/upgrade-agent.ts +12 -8
  81. package/packages/core/src/cli/wait.ts +8 -2
  82. package/packages/core/src/cli/watch.ts +1325 -628
  83. package/packages/core/src/config/create-labels.ts +23 -0
  84. package/packages/core/src/config/live.ts +3 -0
  85. package/packages/core/src/config/load.ts +19 -0
  86. package/packages/core/src/config/pipeline-source.ts +1 -3
  87. package/packages/core/src/config/roles.ts +182 -73
  88. package/packages/core/src/config/schema.ts +226 -9
  89. package/packages/core/src/events/catalog.ts +41 -3
  90. package/packages/core/src/events/compatibility.ts +7 -1
  91. package/packages/core/src/events/payloads.ts +610 -1
  92. package/packages/core/src/events/policy.ts +62 -0
  93. package/packages/core/src/events/repository.ts +147 -21
  94. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +1512 -199
  95. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/0ab2a90d0305dc9d.json.gz +0 -0
  96. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/10a4657408d4e121.json.gz +0 -0
  97. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1152a2e97ee81728.json.gz +0 -0
  98. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/13ca84752c5f8b54.json.gz +0 -0
  99. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1411d1cdbdd9911e.json.gz +0 -0
  100. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1444fe1fa7fc802c.json.gz +0 -0
  101. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1491ac0600349391.json.gz +0 -0
  102. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1921f86f752428c9.json.gz +0 -0
  103. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1972c1d66008ef6b.json.gz +0 -0
  104. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/19e8e43e7f3f1a06.json.gz +0 -0
  105. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/20a85c143c3e8164.json.gz +0 -0
  106. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/21ce2c0bf58318e1.json.gz +0 -0
  107. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/293dcb3a94fb3470.json.gz +0 -0
  108. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2ab7436356267118.json.gz +0 -0
  109. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2d084641735caaff.json.gz +0 -0
  110. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3237bcecf68e5db9.json.gz +0 -0
  111. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/33d0cc593610e56f.json.gz +0 -0
  112. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3451ed2136dcc356.json.gz +0 -0
  113. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/358ec8693f2237e6.json.gz +0 -0
  114. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/35cf9ccc4478b2d2.json.gz +0 -0
  115. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3649e7bd1203f154.json.gz +0 -0
  116. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/378da6dece82202a.json.gz +0 -0
  117. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/38c75099d9191471.json.gz +0 -0
  118. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/398952f1f01db1a3.json.gz +0 -0
  119. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3b64d352d56c9121.json.gz +0 -0
  120. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3dc486226c05372d.json.gz +0 -0
  121. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/431c9bb2ee8838e0.json.gz +0 -0
  122. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4400dffca929e2f0.json.gz +0 -0
  123. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/49064fc079964a5c.json.gz +0 -0
  124. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4edded75f17742f4.json.gz +0 -0
  125. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4f00c0f2c8afd159.json.gz +0 -0
  126. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516a5a7aadf97587.json.gz +0 -0
  127. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516dc6ea85d67cd7.json.gz +0 -0
  128. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/584e2ba74608e051.json.gz +0 -0
  129. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/59ffaa6974094c72.json.gz +0 -0
  130. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5bb43afb121674c6.json.gz +0 -0
  131. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5f0ca42af862c4ee.json.gz +0 -0
  132. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6118031132db9bfc.json.gz +0 -0
  133. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63107a8d58776b63.json.gz +0 -0
  134. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63546b08d4d6fa11.json.gz +0 -0
  135. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/643d70429ce03dad.json.gz +0 -0
  136. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/677ea92572c29082.json.gz +0 -0
  137. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6ae5bf60504d6467.json.gz +0 -0
  138. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6efdc8defc75fccb.json.gz +0 -0
  139. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/71c53d33f09d8204.json.gz +0 -0
  140. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7267ca2757cffba7.json.gz +0 -0
  141. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/76b7d4244082b3f9.json.gz +0 -0
  142. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7749f918c6f10968.json.gz +0 -0
  143. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7833e42d16301424.json.gz +0 -0
  144. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7d4edad0614adaf1.json.gz +0 -0
  145. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/837365898d04f45a.json.gz +0 -0
  146. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/85f9f0c921b8b5bb.json.gz +0 -0
  147. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8879f57a24733897.json.gz +0 -0
  148. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/88cb9e71bdec972d.json.gz +0 -0
  149. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8a0cd6dd06cc155e.json.gz +0 -0
  150. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8aa9ca8609dc051d.json.gz +0 -0
  151. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8c8640255bd61658.json.gz +0 -0
  152. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8cc15eb1807c0157.json.gz +0 -0
  153. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8ced97c44bc0af3a.json.gz +0 -0
  154. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8d4144004720b9f8.json.gz +0 -0
  155. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8db633ead1807f8b.json.gz +0 -0
  156. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8e42cdbd0994ab0c.json.gz +0 -0
  157. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9011d0f6ff955ef9.json.gz +0 -0
  158. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/916ebc5433801c41.json.gz +0 -0
  159. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9539b995af5c54a9.json.gz +0 -0
  160. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/95f391bfd7b7dbd7.json.gz +0 -0
  161. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9613e8fa568a9281.json.gz +0 -0
  162. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9a68f8753bd9038d.json.gz +0 -0
  163. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9b25e58227080094.json.gz +0 -0
  164. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9ee3919fbd4f9458.json.gz +0 -0
  165. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a04a34cc2717147b.json.gz +0 -0
  166. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a0b32c12e4e6edb6.json.gz +0 -0
  167. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a55218252707bdd3.json.gz +0 -0
  168. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a732fd08b31522a6.json.gz +0 -0
  169. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a9d206a01f9039e5.json.gz +0 -0
  170. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/abf7fe3c92c82f2d.json.gz +0 -0
  171. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ac928b04842c00db.json.gz +0 -0
  172. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/af953392d81911da.json.gz +0 -0
  173. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0d877c44810ecb0.json.gz +0 -0
  174. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0f7c6ebb2db57fc.json.gz +0 -0
  175. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b905c22ec17eed31.json.gz +0 -0
  176. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/bce0c54e865f4b79.json.gz +0 -0
  177. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c68b7ee2e2610f30.json.gz +0 -0
  178. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c7f7e0378aeea237.json.gz +0 -0
  179. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c98cb1659eb142b6.json.gz +0 -0
  180. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ca830adf06ed55a1.json.gz +0 -0
  181. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cb3a219f33e437ca.json.gz +0 -0
  182. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cf1e0c0d82567e0c.json.gz +0 -0
  183. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d008d86d9ff77b30.json.gz +0 -0
  184. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d1432a819d8e48c5.json.gz +0 -0
  185. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d185ed6aa9192aff.json.gz +0 -0
  186. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d873fad29d6c7e55.json.gz +0 -0
  187. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/db84b12316e2da4a.json.gz +0 -0
  188. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ddf6dc967d898767.json.gz +0 -0
  189. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/dfc64de6e7bfc0a0.json.gz +0 -0
  190. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e2f18fa32fe1f6d0.json.gz +0 -0
  191. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e37393fed29e84c5.json.gz +0 -0
  192. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e6a8585e2a054ff6.json.gz +0 -0
  193. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e7e9e327baca6903.json.gz +0 -0
  194. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e86447af0571672c.json.gz +0 -0
  195. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ea819202d22122e5.json.gz +0 -0
  196. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb4535585f2e84f6.json.gz +0 -0
  197. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb7ddd5319d09e27.json.gz +0 -0
  198. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eca4959b2b87ae15.json.gz +0 -0
  199. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ee10d7959ec4843c.json.gz +0 -0
  200. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ef1b68347966ab26.json.gz +0 -0
  201. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f3e55425cc41f230.json.gz +0 -0
  202. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f40042c1cdb9fd43.json.gz +0 -0
  203. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f48466215c790a3f.json.gz +0 -0
  204. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f5b9ace9b59351e7.json.gz +0 -0
  205. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fa8f1475a55be935.json.gz +0 -0
  206. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fb21116a15d0b1f1.json.gz +0 -0
  207. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fe95444fbeabe592.json.gz +0 -0
  208. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/09bf0a1611d07363.json +984 -0
  209. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/10eac4988d66e161.json +1067 -0
  210. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/1a436b5fb45aee3e.json +1116 -0
  211. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/249db6f7a41f90e2.json +161 -0
  212. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/25dcb2fb6eaa83f4.json +858 -0
  213. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/2e1bdc763924616f.json +4932 -0
  214. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/30e9dabce3c4263d.json +399 -0
  215. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/4898ef339c68fa36.json +83 -0
  216. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/51816c0ffa62af6e.json +417 -0
  217. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/561bf45320062a44.json +83 -0
  218. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5672d0233085d050.json +84 -0
  219. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5e39f42cbdbf35ef.json +163 -0
  220. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/7771a7a2250f9964.json +868 -0
  221. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/881c491321bec99a.json +1074 -0
  222. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/965f25c3af1d2cdc.json +160 -0
  223. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9b76d89da575ca90.json +20 -0
  224. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9eb485320a72a9ff.json +233 -0
  225. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a60448c01016135e.json +18 -0
  226. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a6584fb61b6679bd.json +97 -0
  227. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c88365c25b3186d3.json +543 -0
  228. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e8f0481b23f90056.json +711 -0
  229. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/ee55782ed40ebbac.json +110 -0
  230. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fc5082fac8167f3d.json +98 -0
  231. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fd55c329cfe921cc.json +1069 -0
  232. package/packages/core/src/kernel/attempt-creation-key.ts +20 -0
  233. package/packages/core/src/kernel/attempt-settlement.ts +125 -0
  234. package/packages/core/src/kernel/auto-merge-default.ts +1 -3
  235. package/packages/core/src/kernel/auto-merge.ts +34 -3
  236. package/packages/core/src/kernel/dispatch-capacity.ts +312 -38
  237. package/packages/core/src/kernel/dispatch-placement.ts +1 -1
  238. package/packages/core/src/kernel/dispatch-settings.ts +1 -4
  239. package/packages/core/src/kernel/dispatch-status.ts +3 -5
  240. package/packages/core/src/kernel/dispatch-upgrade.ts +1 -1
  241. package/packages/core/src/kernel/engine.ts +109 -13
  242. package/packages/core/src/kernel/forge-checks.ts +140 -0
  243. package/packages/core/src/kernel/forge-health.ts +2 -2
  244. package/packages/core/src/kernel/generated-files.ts +43 -0
  245. package/packages/core/src/kernel/generated-regeneration.ts +254 -0
  246. package/packages/core/src/kernel/generators/build-log.ts +30 -2
  247. package/packages/core/src/kernel/generators/optimization-log.ts +578 -0
  248. package/packages/core/src/kernel/generators/panel-log.ts +133 -0
  249. package/packages/core/src/kernel/generators/repository-journals.ts +18 -0
  250. package/packages/core/src/kernel/guarded-forge.ts +76 -11
  251. package/packages/core/src/kernel/harvest.ts +1 -4
  252. package/packages/core/src/kernel/head-paths.ts +4 -1
  253. package/packages/core/src/kernel/history-retention.ts +337 -0
  254. package/packages/core/src/kernel/incremental-fixtures.ts +6 -0
  255. package/packages/core/src/kernel/incremental.ts +14 -4
  256. package/packages/core/src/kernel/integration-landing.ts +64 -13
  257. package/packages/core/src/kernel/integration-stack.ts +123 -20
  258. package/packages/core/src/kernel/integration-state.ts +39 -2
  259. package/packages/core/src/kernel/janitor-failure.ts +2 -0
  260. package/packages/core/src/kernel/kernel-git.ts +1 -1
  261. package/packages/core/src/kernel/landing-measurement.ts +275 -0
  262. package/packages/core/src/kernel/landing-readiness.ts +2 -0
  263. package/packages/core/src/kernel/landing-state.ts +76 -1
  264. package/packages/core/src/kernel/leaf-restack-state.ts +17 -1
  265. package/packages/core/src/kernel/log-index-value.ts +2 -0
  266. package/packages/core/src/kernel/log-index.ts +81 -3
  267. package/packages/core/src/kernel/measurement.ts +406 -0
  268. package/packages/core/src/kernel/mixed-version.ts +6 -3
  269. package/packages/core/src/kernel/node-landing.ts +92 -18
  270. package/packages/core/src/kernel/node-restack-state.ts +27 -1
  271. package/packages/core/src/kernel/node-restack-transaction.ts +80 -23
  272. package/packages/core/src/kernel/node-verification-context.ts +14 -4
  273. package/packages/core/src/kernel/open-pr-backpressure-state.ts +24 -0
  274. package/packages/core/src/kernel/open-pr-backpressure.ts +133 -0
  275. package/packages/core/src/kernel/optimization-admission.ts +249 -0
  276. package/packages/core/src/kernel/optimization.ts +774 -0
  277. package/packages/core/src/kernel/panel.ts +225 -0
  278. package/packages/core/src/kernel/phases.ts +42 -6
  279. package/packages/core/src/kernel/pr-attachments.ts +4 -16
  280. package/packages/core/src/kernel/pr-summary.ts +2 -2
  281. package/packages/core/src/kernel/read-deferrals.ts +2 -2
  282. package/packages/core/src/kernel/read-facts.ts +69 -31
  283. package/packages/core/src/kernel/reconcile-restack.ts +352 -103
  284. package/packages/core/src/kernel/reducer-identity.ts +659 -0
  285. package/packages/core/src/kernel/reducer-registry.ts +37 -3
  286. package/packages/core/src/kernel/reducer-revisions.ts +50 -0
  287. package/packages/core/src/kernel/reducer.ts +208 -9
  288. package/packages/core/src/kernel/reopen-state.ts +48 -0
  289. package/packages/core/src/kernel/reopen.ts +143 -0
  290. package/packages/core/src/kernel/replay-retention.ts +208 -39
  291. package/packages/core/src/kernel/repository-attention.ts +1 -1
  292. package/packages/core/src/kernel/service-facts.ts +19 -7
  293. package/packages/core/src/kernel/terminal-guard.ts +13 -5
  294. package/packages/core/src/kernel/ticket-handbacks.ts +1 -1
  295. package/packages/core/src/kernel/ticket-migrations.ts +1 -1
  296. package/packages/core/src/kernel/ticket-preparation.ts +1 -1
  297. package/packages/core/src/kernel/ticket-source-health.ts +1 -1
  298. package/packages/core/src/kernel/ticket-starts.ts +118 -0
  299. package/packages/core/src/kernel/ticket-wait.ts +37 -2
  300. package/packages/core/src/kernel/verify-diff-base.ts +62 -0
  301. package/packages/core/src/kernel/verify-stage-state.ts +1 -0
  302. package/packages/core/src/kernel/verify-stages.ts +41 -1
  303. package/packages/core/src/objective.ts +532 -0
  304. package/packages/core/src/ontology.ts +49 -6
  305. package/packages/core/src/operator/annotations.ts +35 -4
  306. package/packages/core/src/operator/control.ts +2 -1
  307. package/packages/core/src/operator/index.ts +12 -0
  308. package/packages/core/src/operator/optimization.ts +307 -0
  309. package/packages/core/src/operator/protocol.ts +30 -1
  310. package/packages/core/src/operator/query.ts +15 -1
  311. package/packages/core/src/operator/registry.ts +219 -13
  312. package/packages/core/src/operator/requests.ts +25 -2
  313. package/packages/core/src/operator/ticket-start.ts +152 -0
  314. package/packages/core/src/operator/tickets.ts +3 -2
  315. package/packages/core/src/plugin-sdk/index.ts +9 -1
  316. package/packages/core/src/plugins/registry.ts +1 -0
  317. package/packages/core/src/ports/forge/contract.ts +9 -0
  318. package/packages/core/src/ports/forge/fake.ts +151 -10
  319. package/packages/core/src/ports/forge/git-rewrite.ts +38 -5
  320. package/packages/core/src/ports/forge/github-readiness.ts +1 -1
  321. package/packages/core/src/ports/forge/github-squash-message.ts +89 -0
  322. package/packages/core/src/ports/forge/github-transport.ts +186 -1
  323. package/packages/core/src/ports/forge/github.ts +846 -239
  324. package/packages/core/src/ports/forge/readiness.ts +15 -3
  325. package/packages/core/src/ports/forge-failure.ts +22 -0
  326. package/packages/core/src/ports/forge-request-context.ts +23 -1
  327. package/packages/core/src/ports/forge-telemetry.ts +16 -0
  328. package/packages/core/src/ports/runner/antigravity.ts +1071 -0
  329. package/packages/core/src/ports/runner/claude.ts +6 -1
  330. package/packages/core/src/ports/runner/codex.ts +11 -2
  331. package/packages/core/src/ports/runner/contract.ts +25 -1
  332. package/packages/core/src/ports/runner/fake.ts +2 -2
  333. package/packages/core/src/ports/runner/native-cli-fixture.ts +40 -5
  334. package/packages/core/src/ports/runner/native-process-fixture.ts +4 -1
  335. package/packages/core/src/ports/runner/pi.ts +23 -7
  336. package/packages/core/src/ports/runner/production.ts +19 -2
  337. package/packages/core/src/ports/runner/session-env.ts +65 -5
  338. package/packages/core/src/ports/runner/start-prompt.ts +6 -4
  339. package/packages/core/src/ports/tickets/contract.ts +4 -2
  340. package/packages/core/src/ports/tickets/github.ts +20 -5
  341. package/packages/core/src/ports/tickets/hosted-index.ts +6 -1
  342. package/packages/core/src/ports/tickets/labels.ts +21 -0
  343. package/packages/core/src/ports/tickets/linear.ts +33 -0
  344. package/packages/core/src/ports/tickets/migration.ts +2 -0
  345. package/packages/core/src/ports/tickets/priority.ts +11 -0
  346. package/packages/core/src/ports/tickets/remote-protocol.ts +71 -6
  347. package/packages/core/src/ports/tickets/remote.ts +138 -16
  348. package/packages/core/src/ports/tickets/tree.ts +17 -4
  349. package/packages/core/src/ports/types.ts +145 -7
  350. package/packages/core/src/ports/workspace/builtin-capabilities.ts +7 -4
  351. package/packages/core/src/ports/workspace/commit-preservation.ts +182 -64
  352. package/packages/core/src/ports/workspace/create.ts +3 -0
  353. package/packages/core/src/ports/workspace/git-worktree.ts +13 -1
  354. package/packages/core/src/ports/workspace/vercel-sandbox.ts +242 -61
  355. package/packages/core/src/processes/build-execution-state.ts +5 -6
  356. package/packages/core/src/processes/build-runner.ts +1435 -132
  357. package/packages/core/src/processes/dispatch-failure-budget.ts +1 -1
  358. package/packages/core/src/processes/dispatcher-selectors.ts +15 -13
  359. package/packages/core/src/processes/dispatcher.ts +2874 -266
  360. package/packages/core/src/processes/execution-no-progress.ts +38 -1
  361. package/packages/core/src/processes/execution-settlement.ts +2 -6
  362. package/packages/core/src/processes/harvest-execution-state.ts +2 -6
  363. package/packages/core/src/processes/harvest-runner.ts +7 -2
  364. package/packages/core/src/processes/hook-command.ts +125 -0
  365. package/packages/core/src/processes/hook-webhook.ts +144 -0
  366. package/packages/core/src/processes/hooks.ts +740 -0
  367. package/packages/core/src/processes/infrastructure-failure-budget.ts +1 -3
  368. package/packages/core/src/processes/judge-launcher.ts +38 -0
  369. package/packages/core/src/processes/measurement-runner.ts +235 -0
  370. package/packages/core/src/processes/optimization-merges.ts +101 -0
  371. package/packages/core/src/processes/optimization-stop.ts +179 -0
  372. package/packages/core/src/processes/panel-runner.ts +756 -0
  373. package/packages/core/src/processes/phase-failure-budget.ts +1 -0
  374. package/packages/core/src/processes/publication-state.ts +1 -4
  375. package/packages/core/src/processes/repo-view.ts +77 -5
  376. package/packages/core/src/processes/sandbox-state.ts +1 -4
  377. package/packages/core/src/processes/tick-state.ts +1 -3
  378. package/packages/core/src/processes/workspace-preservation.ts +67 -9
  379. package/packages/core/src/scenarios/harness.ts +19 -8
  380. package/packages/core/src/store/contract.ts +72 -0
  381. package/packages/core/src/store/digest.ts +89 -7
  382. package/packages/core/src/store/judge-authority.ts +161 -0
  383. package/packages/core/src/store/phase-session.ts +226 -4
  384. package/packages/core/src/store/reduced-reads.ts +10 -0
  385. package/packages/core/src/store/reducer-value-shapes.json +17254 -11861
  386. package/packages/core/src/store/remote/client.ts +12 -2
  387. package/packages/core/src/store/remote/credentials.ts +31 -1
  388. package/packages/core/src/store/remote/index.ts +8 -0
  389. package/packages/core/src/store/remote/protocol.ts +38 -0
  390. package/packages/core/src/store/remote/released-clients.json +22 -0
  391. package/packages/core/src/store/remote/released-reducer-values/1.10.0.json +34439 -0
  392. package/packages/core/src/store/remote/released-reducer-values/1.9.0.json +29475 -0
  393. package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -14
  394. package/packages/core/src/store/remote/token.ts +13 -4
  395. package/packages/core/src/store/repo-state-events.ts +9 -8
  396. package/packages/core/src/store/retention.ts +16 -2
  397. package/packages/core/src/store/session-reducer.ts +1 -4
  398. package/packages/core/src/store/ticket-assets.ts +1 -3
  399. package/packages/core/src/store/types.ts +9 -0
  400. package/packages/core/src/testing/dispatch-read-budget.ts +70 -0
  401. package/packages/core/src/testing/git-config-isolation.ts +25 -0
  402. package/packages/core/src/testing/index.ts +14 -0
  403. package/packages/core/src/testing/reduced-read-budget.ts +3950 -54
  404. package/skills/code-review/SKILL.md +16 -0
  405. package/skills/finalize/SKILL.md +10 -4
  406. package/skills/guide/SKILL.md +464 -83
  407. package/skills/guide/references/integration-tree.md +102 -11
  408. package/skills/guide/references/merge-policy.md +70 -14
  409. package/skills/guide/references/migration-1.0.md +2 -1
  410. package/skills/guide/references/operator-api.md +128 -16
  411. package/skills/guide/references/optimization-nodes.md +1042 -0
  412. package/skills/guide/references/plugin-authoring.md +50 -13
  413. package/skills/guide/references/remote-store-protocol.md +46 -7
  414. package/skills/guide/references/remote-ticket-protocol.md +50 -2
  415. package/skills/guide/references/restacking.md +102 -10
  416. package/skills/guide/references/setup.md +16 -3
  417. package/skills/guide/references/spec-standard.md +2 -1
  418. package/skills/guide/references/ticket-dependencies.md +5 -0
  419. package/skills/guide/references/ticket-migration.md +4 -2
  420. package/skills/implement/SKILL.md +51 -1
  421. package/skills/judge/SKILL.md +43 -0
  422. package/skills/operate/SKILL.md +267 -32
  423. package/skills/plan/SKILL.md +18 -0
  424. package/skills/plan-review/SKILL.md +15 -1
  425. package/skills/propose/SKILL.md +121 -0
  426. package/skills/reconcile/SKILL.md +21 -2
  427. package/skills/spec/SKILL.md +30 -4
  428. package/skills/tickets/SKILL.md +44 -5
  429. package/templates/hosted-service/package.json +2 -2
@@ -258,7 +258,7 @@ Changing the store requires restarting dispatch.
258
258
 
259
259
  Parsing is strict. Unknown top-level keys or tables, unknown fields in a known
260
260
  table, fields from the wrong step variant, malformed values, and dangling
261
- command references are errors. The open maps are `[accounts]`, `[commands]`, `[roles]`,
261
+ command references are errors. The open maps are `[accounts]`, `[commands]`, `[hooks]`, `[roles]`,
262
262
  `[profiles]`, `[profiles.<name>.roles]`, `[workspace.config]`, `[workspace.config.runtimeProvisioning]`,
263
263
  `[verify.<step>]`, and `[finalize.<step>]`. Autobuild
264
264
  validates repository-defined command, role, and step entries.
@@ -321,8 +321,8 @@ the branch head never carried the file — the deposit records the source
321
321
  `worktree-dirty` with no commit. The build still runs the worktree bytes, but
322
322
  provenance declines to attribute them to any commit. **Deployment-owned** sections — `[accounts]`, `[roles]`
323
323
  (runtime, model, account, args, alternates, per-role `sessionBudgetSeconds`),
324
- `[profiles]` and `[policy]` — keep flowing live. **Dispatcher-owned** sections (`baseBranch`,
325
- `capacity`, `ticketScanIntervalSeconds`, `forge`, `plugins`, `pr`, `tickets`, `orchestrator`) configure the
324
+ `[profiles]`, `[policy]` and `[[generated]]` — keep flowing live. **Dispatcher-owned** sections (`baseBranch`,
325
+ `capacity`, `ticketScanIntervalSeconds`, `forge`, `plugins`, `pr`, `tickets`, `orchestrator`, `hooks`) configure the
326
326
  dispatcher itself and are never interpreted by the build runner.
327
327
 
328
328
  Consequently, an accepted base-branch reload re-deposits only the
@@ -341,9 +341,12 @@ identity and truthful source metadata. Dirty worktree bytes carry
341
341
  build-owned sections and the known source commit's ancestry. A change or
342
342
  non-ancestor source records `verify.config-superseded` and starts a fresh cycle
343
343
  before constructing any further member. Already launched siblings settle first.
344
- A waiting leaf with completed verification retains its receipts after a clean
345
- rewrite when build-owned config is unchanged, even when the rewrite replaces
346
- the pin commit's ancestry. Changed config still supersedes while waiting; a
344
+ A leaf awaiting merge with completed verification retains its receipts after a
345
+ clean rewrite when build-owned config is unchanged, even when the rewrite
346
+ replaces the pin commit's ancestry. A clean wait-resume restack after a verify
347
+ or finalize ticket wait is different: it starts a new verification cycle on the
348
+ resumed base even when config is unchanged, and the earlier results cannot
349
+ satisfy it. Changed config still supersedes while waiting; a
347
350
  future verification cycle always captures fresh config before running steps.
348
351
  Old pass/skip receipts cannot satisfy that cycle, and supersession creates no
349
352
  failure or failure-budget charge. Unchanged config on a descendant head retains
@@ -378,6 +381,7 @@ These fields hot-reload:
378
381
  | `capacity` | Next dispatcher tick. |
379
382
  | `[pr]` | Next build creation. |
380
383
  | `[merge]` (ordered `[[merge]]` rules) | Dispatcher-owned policy; next new readiness decision. Existing decisions retain their sampled rule. |
384
+ | `[generated]` | Next restack replay that conflicts. The declarations come from the dispatcher's live snapshot, not the build's branch. |
381
385
  | `[commands]` | Next setup, verify check, or finalize check selected for a build whose OWN branch carries it. Dispatcher readiness, resume, and recovery use the same pin. A base-branch reload does not retarget an in-flight build. |
382
386
  | `[verify]` and `[finalize]` | Next engine step selection for a build whose OWN branch carries it. Dispatcher readiness, resume, and recovery use the same pin. An approved plan's selection applies unless unknown names require default-all fallback, and a base-branch reload does not retarget an in-flight build. |
383
387
  | `[workspace]` provider and config (including `provisioning`) | Next launch of a build whose OWN branch carries it. A base-branch reload never re-provisions an in-flight build. |
@@ -385,10 +389,11 @@ These fields hot-reload:
385
389
  | `[roles]` | Next agent invocation for that role. Runtime, model, args, alternates, and the session budget are captured together and delivered live. |
386
390
  | `[profiles]` | Next agent session of a build that selected the profile; builds without it are unaffected. A build's selected profile name never changes after claim. |
387
391
  | `[upgrade]` | Cancels preparation when disabled; automatic target checks every 60 seconds. |
392
+ | `[hooks]` | After the next dispatcher tick: an added hook starts at its baseline, a removed one stops, and a changed one resumes from its saved progress. |
388
393
  | `[policy]` | Next policy, convergence, or agent-session boundary, delivered live. A running session keeps its captured budget. |
389
394
  | `tickets.readyLabels`, `tickets.readyState`, `tickets.readyAssignee` | Next ready-ticket scan. |
390
395
  | `tickets.triageState`, `tickets.proposalState` | Next dispatcher handback or harvest filing boundary. |
391
- | `tickets.createAssignee` | Next ticket create, including the next harvest filing. |
396
+ | `tickets.createAssignee`, `tickets.createLabels` | Next ticket create, including the next harvest filing. |
392
397
  | `tickets.backlogState`, `tickets.rejectedState` | Next role move, ready-ticket scan, or node completeness observation. |
393
398
 
394
399
  Adapter selectors and factory inputs are constructed once and require a
@@ -443,7 +448,7 @@ any table header.
443
448
  - **Required:** Optional
444
449
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
445
450
 
446
- **Description:** Builds running work at once for this repository. A build that finished its pipeline holds no slot while it waits for a merge decision, nor does a build waiting on other tickets; either is admitted ahead of new claims when it must run again. Other unfinished paused and blocked work retains slots. Node reconcile and verification exclude their own blocked/paused descendants at admission; new claims use total occupancy. See [integration capacity](integration-tree.md).
451
+ **Description:** Builds running work at once for this repository. A build that finished its pipeline holds no slot while it waits for a merge decision, nor does a build waiting on other tickets; either is admitted ahead of normal ticket claims when it must run again, urgent work first (see [slot admission order](dispatcher.md#slot-admission-order)). Other unfinished paused and blocked work retains slots. Node reconcile and verification exclude their own blocked/paused descendants at admission; new claims use total occupancy. See [integration capacity](integration-tree.md).
447
452
 
448
453
  **Constraints:** safe integer; > 0
449
454
 
@@ -1422,8 +1427,15 @@ generation does. A named sandbox left without the completion marker, for example
1422
1427
  after a provision timeout, is flagged `cleanup-required` and never launched into.
1423
1428
  The dispatcher releases it automatically, recording an empty
1424
1429
  `workspace.commits-lost` when no checkout exists, or `workspace.commits-preserved`
1425
- when a checkout that never started executing lacks its objects, and provisions
1426
- the next generation.
1430
+ (`workspace.commits-retained` when an earlier head is a store copy) when a
1431
+ checkout that never started executing lacks its objects, and provisions
1432
+ the next generation. A sandbox whose provisioning a dispatcher teardown cut off
1433
+ is different: the next invocation verifies it and finishes it in the same
1434
+ generation. If it cannot be finished, it is released and replaced without
1435
+ consuming `maxInfrastructureAttempts`. A bounded dispatcher invocation does not
1436
+ start provisioning with less than about 150 s of budget left; it records
1437
+ `provisioningDeferred` in the tick report and leaves the build to the next
1438
+ invocation.
1427
1439
 
1428
1440
  The representative actual-provider check is opt-in and must point at an
1429
1441
  independent consuming repository whose `autobuild.toml` selects the universal
@@ -1525,6 +1537,92 @@ referenced by a configured check. A check's `command` value is the key in this
1525
1537
  map, not an inline shell command. The kernel passes the mapped string to a shell
1526
1538
  as written.
1527
1539
 
1540
+ ## `[[generated]]`
1541
+
1542
+ An optional ordered array of generated-file declarations. Each entry names the
1543
+ files a deterministic command rebuilds and that command. Omitting the table
1544
+ declares nothing, and restacks behave exactly as they do without it.
1545
+
1546
+ <!-- configuration-reference:generated -->
1547
+
1548
+ #### `generated`
1549
+
1550
+ **TOML key:** `generated`
1551
+
1552
+ - **Type:** `array of strict table`
1553
+ - **Default:** `omitted`
1554
+ - **Required:** Optional
1555
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
1556
+
1557
+ **Description:** Generated files that a declared command rebuilds. Restack replays that conflict only in these files are regenerated instead of reconciled by an agent.
1558
+
1559
+ **Constraints:** A path selector string may be declared by only one entry.
1560
+
1561
+ #### `generated[].paths`
1562
+
1563
+ **TOML key:** `generated[].paths`
1564
+
1565
+ - **Type:** `array of string`
1566
+ - **Default:** `omitted`
1567
+ - **Required:** Required
1568
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
1569
+
1570
+ **Description:** Generated files this entry owns. When selectors of several entries match a file, the first entry in declaration order owns it.
1571
+
1572
+ **Constraints:** minimum length 1; Each item: Positive repository-relative globs with literal characters, *, ?, and whole-segment ** only. No NUL, absolute paths, backslashes, negation, empty or traversal segments, character classes, brace expansion or extglobs.
1573
+
1574
+ #### `generated[].command`
1575
+
1576
+ **TOML key:** `generated[].command`
1577
+
1578
+ - **Type:** `string`
1579
+ - **Default:** `omitted`
1580
+ - **Required:** Required
1581
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
1582
+
1583
+ **Description:** Shell command, run with `sh -c` from the workspace root after `[commands].setup`, that rebuilds every file this entry owns.
1584
+
1585
+ **Constraints:** command must be a nonblank shell command
1586
+
1587
+ <!-- configuration-reference:/generated -->
1588
+
1589
+ <!-- config-fragment:generated -->
1590
+ ```toml
1591
+ [[generated]]
1592
+ paths = ["src/schema/shapes.json"]
1593
+ command = "bun tools/shapes.ts"
1594
+
1595
+ [[generated]]
1596
+ paths = ["site/snapshots/**"]
1597
+ command = "bun run snapshots"
1598
+ ```
1599
+
1600
+ When a restack replays one change onto a moved target and every conflicted path
1601
+ is owned by a declaration, the kernel resolves the conflict without an agent. It
1602
+ starts each conflicted file from the target's side, runs the owning commands
1603
+ from the workspace root (after `[commands].setup` has run there), stages the
1604
+ result and commits it as that change's replay. This applies to a leaf build's
1605
+ automatic restack and to every item of a node restack. The rules:
1606
+
1607
+ - `paths` uses the same selector grammar as `[verify.<step>].paths`. When the
1608
+ selectors of several entries match a file, the first entry in declaration
1609
+ order owns it. A selector string declared by two entries is rejected.
1610
+ - `command` is a shell string run with `sh -c`. Each owning command runs once
1611
+ per replay, in declaration order. It must write only paths the declarations
1612
+ cover and must leave the Git index unchanged: the kernel stages the declared
1613
+ output itself. Writing anything else, staging changes, exiting non-zero, or
1614
+ leaving conflict markers fails the regeneration, and the replay falls back to
1615
+ an ordinary agent reconcile.
1616
+ - A failed regeneration commits nothing. The workspace returns to the recorded
1617
+ conflict and an ordinary reconcile session resolves it, with the failure
1618
+ reason in its context. A replay that also conflicts in undeclared files goes
1619
+ to the agent as well; its context lists the generated files and their
1620
+ commands, and the agent rebuilds them with the command instead of
1621
+ hand-merging them.
1622
+
1623
+ See [Generated-file conflicts](restacking.md#generated-file-conflicts) for the
1624
+ recorded facts and how status reports them.
1625
+
1528
1626
  ## `[verify]` and `[verify.<step>]`
1529
1627
 
1530
1628
  Post-reconcile verification defaults to enabled: `[verify].afterReconcile = true`.
@@ -1803,6 +1901,13 @@ Cross-field validation rejects:
1803
1901
  - a check whose command is absent from `[commands]`;
1804
1902
  - fields from the other kind, unknown fields, and malformed selectors.
1805
1903
 
1904
+ A `check` command runs with `AB_VERIFY_BASE` set to the verify diff base: the
1905
+ commit [path applicability](#path-applicability) diffs from on a leaf, or the
1906
+ integration cycle parent on a node. It is absent outside a build, under an
1907
+ older runtime, and for a leaf with no provisioned base, so a check that needs
1908
+ it must handle its absence. See
1909
+ [what a check command receives](verification.md#what-a-check-command-receives).
1910
+
1806
1911
  `always = true` does not make malformed `paths` acceptable: all supplied
1807
1912
  selectors are validated even though the mandatory step will not use them for
1808
1913
  applicability.
@@ -2160,7 +2265,7 @@ session starts, with a copyable table and all registered runtime names.
2160
2265
  - **Required:** Optional
2161
2266
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
2162
2267
 
2163
- **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Pi ids are provider-qualified.
2268
+ **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Antigravity uses unqualified `gemini-*`, `claude-*` or `gpt-*` slugs; Pi ids are provider-qualified.
2164
2269
 
2165
2270
  **Constraints:** minimum length 1; Omission inherits the base model, otherwise uses the selected runtime default. Must be compatible with that runtime.
2166
2271
 
@@ -2251,7 +2356,7 @@ session starts, with a copyable table and all registered runtime names.
2251
2356
  - **Required:** Optional
2252
2357
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
2253
2358
 
2254
- **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Pi ids are provider-qualified.
2359
+ **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Antigravity uses unqualified `gemini-*`, `claude-*` or `gpt-*` slugs; Pi ids are provider-qualified.
2255
2360
 
2256
2361
  **Constraints:** minimum length 1; Omission inherits the base model, otherwise uses the selected runtime default. Must be compatible with that runtime.
2257
2362
 
@@ -2317,7 +2422,9 @@ model uses the default for its own selected account and runtime. Each configured
2317
2422
  one argv token; Autobuild does not shell-expand it. The narrow rejected set is
2318
2423
  derived from the model and machine-readable protocol options each adapter emits:
2319
2424
  Claude rejects `-p`/`--print`, `--output-format`, and `--model`; Codex rejects
2320
- `--json` and `--model`/`-m`; Pi rejects `--mode` and `--model`. Claude and Codex
2425
+ `--json` and `--model`/`-m`; Pi rejects `--mode` and `--model`; Antigravity
2426
+ rejects `-p`/`--print`/`--prompt`, `--output-format`, `--input-format`, and
2427
+ `--model`. Claude and Codex
2321
2428
  also reject a standalone `--` because Autobuild owns and appends that structural
2322
2429
  separator immediately before their positional prompt. Claude routes with a selected
2323
2430
  account additionally reject `--settings`, `--setting-sources`, and `--bare`
@@ -2328,7 +2435,11 @@ configuration routing. This includes using `-c` to set reasoning effort. Routes
2328
2435
  without an account retain the existing argument behavior. Those option spellings,
2329
2436
  `--option=value` forms, compact documented short aliases, and the exact affected
2330
2437
  prompt separator join the eager aggregated startup error with a
2331
- role/runtime-specific diagnostic. Every other option passes through without
2438
+ role/runtime-specific diagnostic. Antigravity also owns conversation
2439
+ selection: a role argument naming `--conversation`, `--continue`/`-c`, or
2440
+ `--prompt-interactive`/`-i`, including `--option=value` forms, is not an eager
2441
+ startup error but fails each turn as a configuration failure before `agy`
2442
+ launches. Every other option passes through without
2332
2443
  Autobuild validation, including sandbox, approval, session, tool, skill,
2333
2444
  thinking, extension, lifecycle, unknown options, and arguments that merely
2334
2445
  contain two hyphens, even when they supplement another occurrence emitted by the
@@ -2336,8 +2447,8 @@ adapter. Unknown fields,
2336
2447
  runtimes, and incompatible models in any indexed entry join the aggregated
2337
2448
  eager startup error; they never first surface during an outage.
2338
2449
 
2339
- Three runtimes ship: `claude`, `codex`, and `pi`; `ab plugin list` projects all
2340
- three as builtin agent runtimes, and trusted plugins may register additional
2450
+ Four runtimes ship: `claude`, `codex`, `pi`, and `antigravity`; `ab plugin list`
2451
+ projects all four as builtin agent runtimes, and trusted plugins may register additional
2341
2452
  names. The `pi` runtime requires a locally installed Pi CLI version 0.84.3 or
2342
2453
  newer and uses that installation's login and model catalog through headless RPC;
2343
2454
  Autobuild does not install Pi. `ab init` reports a missing or older executable
@@ -2348,7 +2459,9 @@ validation and event attribution. With no configured or inherited model, a Claud
2348
2459
  route selecting a Kimi Code account uses `kimi-for-coding`. Other routes use their
2349
2460
  runtime's declared default when present: Claude and Codex delegate to their local
2350
2461
  CLI's selected default, while Pi declares `kimi-coding/k3`. Codex accepts unqualified `gpt-*`
2351
- ids. Pi ids remain provider-qualified—including the independent
2462
+ ids. Antigravity accepts unqualified `gemini-*`, `claude-*` and `gpt-*` slugs,
2463
+ delegates an omitted model to its local `agy` default, and declares no tool-free
2464
+ one-shot. Pi ids remain provider-qualified—including the independent
2352
2465
  `openai-codex/*` route—and `ab models [query]` looks them up. Pi always passes
2353
2466
  `--no-extensions` to disable ambient package discovery and loads the Autobuild
2354
2467
  bridge explicitly. Repeatable `--extension <path>` tokens in `args` supplement
@@ -2364,11 +2477,12 @@ opt-in:
2364
2477
  `AB_RUN_LIVE_PORT_CONTRACTS=1 AB_CODEX_CONTRACT_MODEL=gpt-… bun test packages/core/src/ports/runner/codex.live.integration.test.ts`.
2365
2478
 
2366
2479
  Core agent phases route by phase name (`plan`, `plan-review`, `implement`,
2367
- `code-review`, `finalize`, and `reconcile`). Agent verify steps and agent
2480
+ `code-review`, `finalize`, `reconcile`, and an optimization node's `propose`). Agent verify steps and agent
2368
2481
  finalize post-steps both route by their logical step name. The verify step's
2369
2482
  configured skill name remains a deprecated alias for existing configurations
2370
2483
  and will be removed in a future release. Repository judgments use `harvest` and
2371
- `harvest-review`; `slug` and `upgrade` configure tool-free one-shot judgments.
2484
+ `harvest-review`; each judge session of an optimization objective's judge panel
2485
+ uses `judge`; `slug` and `upgrade` configure tool-free one-shot judgments.
2372
2486
  Arbitrary additional role keys are accepted, but only a name selected by one of
2373
2487
  these routes affects a session.
2374
2488
 
@@ -2380,7 +2494,11 @@ session or changes which runtime and model run. `kind = "check"` steps start no
2380
2494
  session and so are not a route: naming a role after one does not make it
2381
2495
  consumed. It is reported only when that check step is its sole apparent route —
2382
2496
  a check step named `plan` leaves `[roles.plan]` consumed by the core `plan`
2383
- phase, and nothing is reported.
2497
+ phase, and nothing is reported. `[profiles.<name>.roles.<role>]` entries are
2498
+ reported the same way, named by their profile table, against the profile's own
2499
+ list of valid keys. A profile entry on `slug`, `upgrade`, `harvest` or
2500
+ `harvest-review` counts as unconsumed, because those sessions never use a
2501
+ profile.
2384
2502
 
2385
2503
  Resolver construction validates `default`, every declared role, and every
2386
2504
  alternate eagerly and aggregates all unknown-runtime and incompatible-model
@@ -2403,7 +2521,10 @@ policy, so final quota/usage/billing exhaustion parks immediately while a final
2403
2521
  availability failure consumes one existing bounded attempt. `session.started`
2404
2522
  records each selected runtime/model and substitution cause, and an exhausted
2405
2523
  failure records every tried target and verbatim error for policy escalation.
2406
- The chain applies to core phases, agent verify/finalize steps, and Harvest.
2524
+ The chain applies to core phases, agent verify/finalize steps, Harvest, and
2525
+ the judge sessions of a judge panel. A judge's alternate runs in the same judge
2526
+ root and order; its start is `panel.judge-started` rather than
2527
+ `session.started`, and only the chain's last failure counts toward the judge.
2407
2528
  Tool-free one-shot completions such as slug and upgrade use only the primary.
2408
2529
 
2409
2530
  For build sessions, the kernel starts the captured role budget after the durable
@@ -2458,8 +2579,12 @@ session. If a reload removes the profile, those builds continue on the
2458
2579
  repository roles and `ab build status` reports the profile as no longer
2459
2580
  configured. Duplicate labels, a blank label, and an entry whose effective
2460
2581
  runtime, model, args or account is invalid are refused at load, by
2461
- `ab init --validate`, and on live reload. Sessions outside a build (`slug`,
2462
- `upgrade`, `harvest`, `harvest-review`) never use a profile.
2582
+ `ab init --validate`, and on live reload. Judge sessions are build sessions, so
2583
+ the build's profile applies to them. Sessions outside a build (`slug`,
2584
+ `upgrade`, `harvest`, `harvest-review`) never use a profile. As for
2585
+ `[roles]`, `ab dispatch` warns at startup for a profile entry nothing requests,
2586
+ a deprecated skill-name key, or deprecated `extensions`, naming the
2587
+ `[profiles.<name>.roles.<role>]` table to change.
2463
2588
 
2464
2589
  <!-- configuration-reference:profiles -->
2465
2590
 
@@ -2563,7 +2688,7 @@ runtime, model, args or account is invalid are refused at load, by
2563
2688
  - **Required:** Optional
2564
2689
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
2565
2690
 
2566
- **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Pi ids are provider-qualified.
2691
+ **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Antigravity uses unqualified `gemini-*`, `claude-*` or `gpt-*` slugs; Pi ids are provider-qualified.
2567
2692
 
2568
2693
  **Constraints:** minimum length 1; Omission inherits the base model, otherwise uses the selected runtime default. Must be compatible with that runtime.
2569
2694
 
@@ -2654,7 +2779,7 @@ runtime, model, args or account is invalid are refused at load, by
2654
2779
  - **Required:** Optional
2655
2780
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
2656
2781
 
2657
- **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Pi ids are provider-qualified.
2782
+ **Description:** Select the exact model. Codex uses unqualified `gpt-*`; Antigravity uses unqualified `gemini-*`, `claude-*` or `gpt-*` slugs; Pi ids are provider-qualified.
2658
2783
 
2659
2784
  **Constraints:** minimum length 1; Omission inherits the base model, otherwise uses the selected runtime default. Must be compatible with that runtime.
2660
2785
 
@@ -2688,8 +2813,22 @@ runtime, model, args or account is invalid are refused at load, by
2688
2813
 
2689
2814
  ## `[policy]`
2690
2815
 
2691
- Optional. Every field receives its own default. All are positive integers except
2692
- `harvestMaxDrift`, which is nonnegative so zero can disable that trigger.
2816
+ Optional. Every field receives its own default unless noted. All are positive
2817
+ integers except `harvestMaxDrift`, which is nonnegative so zero can disable that
2818
+ trigger, and the open-PR backpressure keys: `maxOpenPrs` has no default (unset
2819
+ disables backpressure), `resumeOpenPrs` is a nonnegative integer that defaults
2820
+ to `maxOpenPrs - 1` and may not exceed it, and `excludeHeldOpenPrs` is a boolean
2821
+ that defaults to `false`.
2822
+
2823
+ While open unmerged root PRs (leaves and integration nodes; not children of a
2824
+ node) reach `maxOpenPrs`, the dispatcher makes no new ordinary ready-queue
2825
+ claim of a `normal`-priority ticket until the count drops to `resumeOpenPrs`. Reaching `maxOpenPrs` takes
2826
+ precedence: when `resumeOpenPrs` equals `maxOpenPrs`, intake stays paused at
2827
+ that count and resumes once the count falls below it. Urgent claims, in-flight
2828
+ builds, reconciles and landings continue; capacity is unchanged. Every `ab start`
2829
+ (`tickets.start`) tier bypasses backpressure for its one ticket, still subject to
2830
+ capacity and repository pause. `ab repository
2831
+ status` reports the state as `capacity.backpressure`.
2693
2832
 
2694
2833
  <!-- configuration-reference:policy -->
2695
2834
 
@@ -2819,7 +2958,7 @@ Optional. Every field receives its own default. All are positive integers except
2819
2958
  - **Required:** Optional
2820
2959
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
2821
2960
 
2822
- **Description:** Bound consecutive provision/start/wait/cleanup failures before a setup-targeted policy escalation; a `retry` answer from your operator agent or you re-arms this budget.
2961
+ **Description:** Bound consecutive provision/start/wait/cleanup failures before a setup-targeted policy escalation; a `retry` answer from your operator agent or you re-arms this budget. Provisioning abandoned at a recorded dispatcher teardown never consumes it.
2823
2962
 
2824
2963
  **Constraints:** safe integer; > 0
2825
2964
 
@@ -2940,6 +3079,45 @@ Optional. Every field receives its own default. All are positive integers except
2940
3079
 
2941
3080
  **Constraints:** safe integer; ≥ 0
2942
3081
 
3082
+ #### `policy.maxOpenPrs`
3083
+
3084
+ **TOML key:** `policy.maxOpenPrs`
3085
+
3086
+ - **Type:** `number`
3087
+ - **Default:** `omitted`
3088
+ - **Required:** Optional
3089
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3090
+
3091
+ **Description:** Open unmerged root build PRs (leaves and integration nodes) at which the dispatcher stops ordinary ready-queue claims of `normal`-priority tickets. In-flight work, reconciles, landings, `urgent` claims and every `ab start` (`tickets.start`) request continue, subject to capacity and repository pause. Unset disables open-PR backpressure.
3092
+
3093
+ **Constraints:** safe integer; > 0
3094
+
3095
+ #### `policy.resumeOpenPrs`
3096
+
3097
+ **TOML key:** `policy.resumeOpenPrs`
3098
+
3099
+ - **Type:** `number`
3100
+ - **Default:** `omitted`
3101
+ - **Required:** Optional
3102
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3103
+
3104
+ **Description:** Open root PR count at or below which paused `normal` intake resumes; defaults to `maxOpenPrs - 1`. Reaching `maxOpenPrs` takes precedence, so when this equals `maxOpenPrs` intake stays paused at that count and resumes once the count falls below `maxOpenPrs`. Inert without `maxOpenPrs`.
3105
+
3106
+ **Constraints:** safe integer; ≥ 0; Must not exceed `maxOpenPrs`.
3107
+
3108
+ #### `policy.excludeHeldOpenPrs`
3109
+
3110
+ **TOML key:** `policy.excludeHeldOpenPrs`
3111
+
3112
+ - **Type:** `boolean`
3113
+ - **Default:** `false`
3114
+ - **Required:** Optional
3115
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3116
+
3117
+ **Description:** Leave PRs whose active landing command is `hold` out of the open-PR backpressure count. Inert without `maxOpenPrs`.
3118
+
3119
+ **Constraints:** None beyond the input type.
3120
+
2943
3121
  <!-- configuration-reference:/policy -->
2944
3122
 
2945
3123
  Dispatch failures share a `[policy].maxDispatchAttempts` budget (default 3) across
@@ -3131,6 +3309,19 @@ state. Within a present table, `source` is required; `hosted` and `github` defau
3131
3309
 
3132
3310
  **Constraints:** [tickets].createAssignee must be a nonblank value with no surrounding whitespace; Allowed for github ("me" or a GitHub username) and plugin sources that declare assignees. Refused for file, hosted and linear.
3133
3311
 
3312
+ #### `tickets.createLabels`
3313
+
3314
+ **TOML key:** `tickets.createLabels`
3315
+
3316
+ - **Type:** `array of string`
3317
+ - **Default:** `omitted`
3318
+ - **Required:** Optional
3319
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3320
+
3321
+ **Description:** Add these labels to every ticket Autobuild creates (`ab ticket create`, operator `tickets.create`, harvest proposals, optimization attempts), unioned with any labels the create names.
3322
+
3323
+ **Constraints:** Omission or [] adds none. Refused on github for `autobuild:<state>` and `autobuild-link:` labels and `node`, and on linear for `node`. On hosted, the ticket service must support createLabels in the published ticket policy. Ordinary labels: a name also in readyLabels, or covered by the github/linear default ["autobuild"], makes every Autobuild-filed ticket pass the label gate. `ab ticket import` never applies them.; Each item: [tickets].createLabels entries must be nonblank label names with no surrounding whitespace
3324
+
3134
3325
  #### `tickets.teamKey`
3135
3326
 
3136
3327
  **TOML key:** `tickets.teamKey`
@@ -3192,7 +3383,7 @@ state. Within a present table, `source` is required; `hosted` and `github` defau
3192
3383
  - **Required:** Optional
3193
3384
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3194
3385
 
3195
- **Description:** State used for spec-gate bounces, aborts (unless `ab abort --to ready` with a ticket that meets the spec standard), and closed-unmerged PRs.
3386
+ **Description:** State used for spec-gate bounces, aborts (unless `ab abort --to ready` with a ticket that meets the spec standard), and closed-unmerged PRs. An optimization attempt never returns here: an abort or closed PR settles it `aborted` and moves its ticket to rejectedState.
3196
3387
 
3197
3388
  **Constraints:** minimum length 1; state must be nonblank; Omission resolves to Backlog for Linear, triage for hosted and github, Triage for file/plugin sources.
3198
3389
 
@@ -3231,9 +3422,9 @@ state. Within a present table, `source` is required; `hosted` and `github` defau
3231
3422
  - **Required:** Optional
3232
3423
  - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3233
3424
 
3234
- **Description:** State that holds considered-and-declined work (the rejected role). A rejected ticket never resolves a blocker and never keeps a node incomplete. Optional and recommended.
3425
+ **Description:** State that holds considered-and-declined work (the rejected role). A rejected ticket never resolves a blocker and never keeps a node incomplete. Optional and recommended; an optimization node requires it and is refused at dispatch without it, and the dispatcher moves each attempt that settles no-improvement, declined, stopped or aborted into it.
3235
3426
 
3236
- **Constraints:** minimum length 1; state must be nonblank; Optional for every source, no default; `ab init` writes it for new configurations. On github it maps to an issue closed as not planned. Must differ from the ready, claimed, done, triage and proposal states and from backlogState (case-insensitive).
3427
+ **Constraints:** minimum length 1; state must be nonblank; Optional for every source, no default, but required to open an optimization node; `ab init` writes it for new configurations. On github it maps to an issue closed as not planned. Must differ from the ready, claimed, done, triage and proposal states and from backlogState (case-insensitive).
3237
3428
 
3238
3429
  #### `tickets.dir`
3239
3430
 
@@ -3304,11 +3495,19 @@ shares its name is an ordinary custom state. `ab ticket move <id> --role
3304
3495
  backlog` (or `rejected`, `triage`, `ready`) moves a ticket by role; a role the
3305
3496
  repository has not configured is refused with the key to set, and a source that
3306
3497
  creates states creates the role state on first use. The dispatcher never claims
3307
- from, moves into, or files proposals into either state. A rejected ticket never
3498
+ from, moves into, or files proposals into either state, with one exception: an
3499
+ optimization attempt that settles `no-improvement`, `declined`, `stopped` or
3500
+ `aborted` (including an operator abort) moves to the rejected role instead of
3501
+ triage. An `accepted` attempt, or a merged attempt an operator released as
3502
+ `merged-unmeasured`, stays done. A rejected ticket never
3308
3503
  resolves a blocker, even where the source natively counts it complete (a Linear
3309
3504
  `Canceled` state mapped to rejected), and a rejected node child no longer keeps
3310
3505
  its node incomplete. Moving the ticket out of the state restores ordinary
3311
- behavior.
3506
+ behavior. An [optimization node](optimization-nodes.md) needs the rejected role for
3507
+ the attempts it rejects, so it requires `rejectedState`, with no inferred
3508
+ default: without it the dispatcher refuses to open the node and returns the
3509
+ ticket to triage. Ordinary nodes and
3510
+ work tickets never require it.
3312
3511
 
3313
3512
  Source-specific validation is strict:
3314
3513
 
@@ -3567,6 +3766,241 @@ receive no credential. The dispatcher retains idle settlement but never
3567
3766
  constructs a turn runner. Tools stay gated by `[orchestrator].enabled` and the
3568
3767
  registry's closed-table filtering; external harnesses own approvals.
3569
3768
 
3769
+ ## `[hooks]`
3770
+
3771
+ A hook is a named, observe-only consumer of the same records `ab watch --json`
3772
+ prints. The lease-holding dispatcher delivers each record that matches a
3773
+ hook's filter to the hook's command or URL, one record per delivery, so tooling can
3774
+ react to escalations, merges awaiting consent, or tickets handed back without
3775
+ keeping its own `ab watch` process alive. A hook cannot change any build's state,
3776
+ phase, verdict or merge decision; gating belongs to `[verify]`, `[finalize]` and
3777
+ `[[merge]]`.
3778
+
3779
+ <!-- configuration-reference:hooks -->
3780
+
3781
+ #### `hooks`
3782
+
3783
+ **TOML key:** `hooks`
3784
+
3785
+ - **Type:** `table`
3786
+ - **Default:** `{}`
3787
+ - **Required:** Optional
3788
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3789
+
3790
+ **Description:** Named observe-only hooks: the dispatcher delivers each matching watch record to a command or URL, in order and at least once.
3791
+
3792
+ **Constraints:** Entry names: nonempty
3793
+
3794
+ #### `hooks.<name>`
3795
+
3796
+ **TOML key:** `hooks.<name>`
3797
+
3798
+ - **Type:** `strict table`
3799
+ - **Default:** `omitted`
3800
+ - **Required:** Required
3801
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3802
+
3803
+ **Description:** Named observe-only hook delivered matching watch records by the dispatcher.
3804
+
3805
+ **Constraints:** Hook names use ASCII letters, digits, ., _ and -. Exactly one of command or url. A url hook requires secretEnv naming a set, nonempty variable in the dispatcher environment. The hosted dispatcher rejects command hooks and delivers url hooks.
3806
+
3807
+ #### `hooks.<name>.command`
3808
+
3809
+ **TOML key:** `hooks.<name>.command`
3810
+
3811
+ - **Type:** `string`
3812
+ - **Default:** `omitted`
3813
+ - **Required:** Optional
3814
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3815
+
3816
+ **Description:** Shell command run from the repository checkout once per record, with the record as one JSON line on stdin. Exit status 0 within the timeout is success. Set exactly one of command or url.
3817
+
3818
+ **Constraints:** hook command must be nonblank
3819
+
3820
+ #### `hooks.<name>.url`
3821
+
3822
+ **TOML key:** `hooks.<name>.url`
3823
+
3824
+ - **Type:** `string`
3825
+ - **Default:** `omitted`
3826
+ - **Required:** Optional
3827
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3828
+
3829
+ **Description:** HTTPS endpoint that receives each record as a signed JSON POST; http only to loopback. A 2xx response within the timeout is success; redirects are not followed.
3830
+
3831
+ **Constraints:** Absolute HTTPS URL; HTTP allowed only to loopback (localhost, 127.0.0.0/8, [::1]). No credentials or fragment. Query strings are kept.
3832
+
3833
+ #### `hooks.<name>.secretEnv`
3834
+
3835
+ **TOML key:** `hooks.<name>.secretEnv`
3836
+
3837
+ - **Type:** `string`
3838
+ - **Default:** `omitted`
3839
+ - **Required:** Optional
3840
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3841
+
3842
+ **Description:** Name of the dispatcher environment variable holding the HMAC signing secret; required with url. The value never appears in config, events, status or logs.
3843
+
3844
+ **Constraints:** matches /^[A-Za-z_][A-Za-z0-9_]*$/
3845
+
3846
+ #### `hooks.<name>.events`
3847
+
3848
+ **TOML key:** `hooks.<name>.events`
3849
+
3850
+ - **Type:** `array of string`
3851
+ - **Default:** `omitted`
3852
+ - **Required:** Optional
3853
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3854
+
3855
+ **Description:** Event globs with `ab watch --event` grammar, validated against the build and repository catalogs. Absent means the default attention filter of `ab watch`.
3856
+
3857
+ **Constraints:** minimum length 1; Each item: event globs must be nonblank
3858
+
3859
+ #### `hooks.<name>.timeoutSeconds`
3860
+
3861
+ **TOML key:** `hooks.<name>.timeoutSeconds`
3862
+
3863
+ - **Type:** `number`
3864
+ - **Default:** `30`
3865
+ - **Required:** Optional
3866
+ - **Reload:** Hot: next dispatcher action captures the accepted value. A running invocation keeps its captured values.
3867
+
3868
+ **Description:** Seconds one delivery may take (a command run or a request) before it is stopped and counted as a failure.
3869
+
3870
+ **Constraints:** safe integer; > 0; ≤ 3600
3871
+
3872
+ <!-- configuration-reference:/hooks -->
3873
+
3874
+ <!-- config-fragment -->
3875
+ ```toml
3876
+ [hooks.notify]
3877
+ command = "./tools/notify.sh"
3878
+
3879
+ [hooks.audit]
3880
+ command = "cat >> .autobuild/audit.jsonl"
3881
+ events = ["escalation.*", "ticket.handed-back", "hook.*"]
3882
+ timeoutSeconds = 10
3883
+
3884
+ [hooks.relay]
3885
+ url = "https://hooks.example.com/autobuild"
3886
+ secretEnv = "RELAY_HOOK_SECRET"
3887
+ ```
3888
+
3889
+ **Names and validation.** Hook names use ASCII letters, digits, `.`, `_` and
3890
+ `-`. Each `[hooks.<name>]` table is declared once and sets exactly one target:
3891
+ a `command` or a `url`. A `url` must use `https`, or `http` only to a loopback
3892
+ host (`localhost`, `127.0.0.0/8`, `[::1]`), and may not carry credentials or a
3893
+ fragment. A url hook needs `secretEnv`, the name of the environment variable
3894
+ holding its signing secret; `secretEnv` is rejected on a command hook. The
3895
+ dispatcher checks that the variable is set and not blank in its own
3896
+ environment, and the error names the variable, never a value. Each `events`
3897
+ entry uses the `ab watch --event` grammar and must match an event type in the
3898
+ build or repository catalog, or `dispatcher.lost`; a glob that matches nothing
3899
+ is rejected. Every error names the hook, at startup and on reload.
3900
+
3901
+ **Default filter.** A hook without `events` receives exactly `ab watch`'s default
3902
+ attention set: the build attention events, conflicted restacks, the derived
3903
+ `build.consent-ready` and `build.merge-decision` observations, repository
3904
+ attention including `hook.failing`, `hook.recovered` and `hook.skipped`, the
3905
+ derived persistent-failure observations, and `dispatcher.lost`. Supplying
3906
+ `events` replaces that set entirely, as `--event` does.
3907
+
3908
+ **The record.** A command runs with `sh -c` from the repository checkout. Its
3909
+ stdin carries one record as a single JSON line, identical to the line `ab watch
3910
+ --json` prints for the same event under the same filter, including derived
3911
+ records. The environment is the dispatcher's, without build or session
3912
+ identity variables, plus `AB_HOOK=<name>`.
3913
+
3914
+ ```json
3915
+ {"id":"build:add-login-7f3a:12","build":"add-login-7f3a","event":{"build":"add-login-7f3a","seq":12,"type":"escalation.raised","payload":{"id":"esc_4","question":"Which auth store?"},"…":"…"},"state":{"status":"blocked","phase":"implement","…":"…"},"cursor":"v1.…"}
3916
+ ```
3917
+
3918
+ `id` is the record's stable identity: `build:<slug>:<seq>` for a build event,
3919
+ `repo:<seq>` for a repository event, `<observation type>:<identity>` for a derived
3920
+ observation, and `dispatcher.lost:<run>`. `cursor` is the hook's position after
3921
+ the record and is a valid `ab watch --since` cursor.
3922
+
3923
+ **Delivery guarantee.** For a command, exit status 0 within `timeoutSeconds` is
3924
+ success; anything else, including a timeout, is failure, and the command's whole
3925
+ process group is killed. For a URL, a 2xx response within `timeoutSeconds` is
3926
+ success; any other status, a redirect, a timeout or a connection error is
3927
+ failure. Each hook receives its records in order, one invocation at a
3928
+ time: a record is not delivered until the previous one succeeded. Delivery is
3929
+ at least once — a consumer can see a record again after a restart or a failed
3930
+ attempt — so deduplicate by `id`. Each hook has its own loop outside the
3931
+ dispatch tick; one hook's failures or slowness never delay another hook, a tick,
3932
+ or a build.
3933
+
3934
+ **Progress.** Each hook's position is durable, keyed by its name, and survives
3935
+ dispatcher restarts, hot upgrades and config reloads: delivery resumes after the
3936
+ last successful record. Changing a hook's command or filter resumes from its
3937
+ saved position. A hook with a new name starts when it is first loaded and does
3938
+ not replay history, so renaming a hook starts it fresh; re-adding a removed name
3939
+ resumes where it stopped. If a hook falls so far behind that its undelivered
3940
+ history can no longer be read, it resumes from the current position and records
3941
+ `hook.skipped` with the skipped ranges. `ab dispatch --once` makes one delivery
3942
+ pass per hook and stops at the first failure; the next invocation retries.
3943
+
3944
+ **Webhook delivery.** A url hook receives one `POST` per record. The body is the
3945
+ record line without its trailing newline, sent as `Content-Type:
3946
+ application/json` with `User-Agent: autobuild-hook`, and these headers:
3947
+
3948
+ | Header | Value |
3949
+ | --- | --- |
3950
+ | `Autobuild-Hook` | The hook name. |
3951
+ | `Autobuild-Delivery` | The record `id`, the same on every redelivery. Deduplicate on it. |
3952
+ | `Autobuild-Timestamp` | Unix seconds when this attempt was sent. |
3953
+ | `Autobuild-Signature` | `v1=` and the lowercase hex HMAC-SHA256 of `<timestamp>.<body>`, keyed by the secret's UTF-8 bytes. |
3954
+
3955
+ Redirects are not followed, the response body is ignored, and failure text
3956
+ records only the status or the kind of error, never the URL, headers, body or
3957
+ secret.
3958
+
3959
+ **Verifying a signature.** A receiver recomputes the HMAC over the timestamp
3960
+ header, a `.`, and the raw request body, compares it in constant time, and
3961
+ rejects a timestamp too far from its own clock so a captured request cannot be
3962
+ replayed later. Five minutes is a reasonable tolerance.
3963
+
3964
+ ```ts
3965
+ import { createHmac, timingSafeEqual } from 'node:crypto'
3966
+
3967
+ const TOLERANCE_SECONDS = 5 * 60
3968
+
3969
+ export async function verifyAutobuildHook(request: Request, secret: string): Promise<string> {
3970
+ const timestamp = request.headers.get('autobuild-timestamp') ?? ''
3971
+ const signature = request.headers.get('autobuild-signature') ?? ''
3972
+ const body = await request.text() // the raw body, before any JSON parsing
3973
+ const expected = `v1=${createHmac('sha256', secret).update(`${timestamp}.${body}`).digest('hex')}`
3974
+ const age = Math.abs(Date.now() / 1000 - Number(timestamp))
3975
+ if (
3976
+ !(age <= TOLERANCE_SECONDS) ||
3977
+ signature.length !== expected.length ||
3978
+ !timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
3979
+ )
3980
+ throw new Error('invalid Autobuild hook signature')
3981
+ return body // JSON.parse(body) is the record; skip it if Autobuild-Delivery was already handled
3982
+ }
3983
+ ```
3984
+
3985
+ As a test vector, the secret `example-secret`, timestamp `1794909600` and body
3986
+ `{"id":"c1.0"}` sign to
3987
+ `v1=8c513d8d2b28c00d3c4f56b8afacc447ba1bd294e1df5f1b60b0ea1fe7d57a54`.
3988
+
3989
+ **Failures and status.** A failed delivery is retried with increasing delay, up
3990
+ to one minute between attempts. After five minutes of continuous failure the
3991
+ dispatcher records `hook.failing` with the hook name and latest error, once per
3992
+ failure episode; the first later success records `hook.recovered`. `ab
3993
+ repository status` lists each configured hook with its last successful delivery,
3994
+ its pending backlog or "caught up", and whether it is failing.
3995
+
3996
+ **Hosted dispatchers.** Command hooks need a dispatcher that can run local
3997
+ commands. The hosted dispatcher rejects a configured command hook as a config
3998
+ error naming the hook; it is never silently ignored. Url hooks work on local and
3999
+ hosted dispatchers alike: the variable `secretEnv` names must be set in the
4000
+ environment of whichever dispatcher delivers them. Each hosted invocation makes
4001
+ one delivery pass, and a delivery still in flight at the invocation's deadline
4002
+ is stopped and redelivered by the next one.
4003
+
3570
4004
  ## Complete example
3571
4005
 
3572
4006
  The following deliberately exercises every fixed table and both verify/finalize
@@ -3649,6 +4083,9 @@ maxReconcileAttempts = 3
3649
4083
  maxReviewRounds = 6
3650
4084
  harvestThreshold = 5
3651
4085
  harvestMaxDrift = 3
4086
+ # maxOpenPrs = 12
4087
+ # resumeOpenPrs = 9
4088
+ # excludeHeldOpenPrs = false
3652
4089
 
3653
4090
  [tickets]
3654
4091
  source = "file"
@@ -3658,6 +4095,11 @@ createState = "Triage"
3658
4095
  triageState = "Triage"
3659
4096
  proposalState = "Triage"
3660
4097
  dir = "tickets"
4098
+
4099
+ [hooks.notify]
4100
+ command = "./tools/notify.sh"
4101
+ events = ["escalation.*", "ticket.handed-back"]
4102
+ timeoutSeconds = 10
3661
4103
  ```
3662
4104
 
3663
4105
  This repository's [`autobuild.toml`](../autobuild.toml) is another worked
@@ -3669,10 +4111,13 @@ On the first `ab init [target]`, when `autobuild.toml` is absent, Autobuild
3669
4111
  writes a valid stack-neutral skeleton. Deterministic init code does not inspect
3670
4112
  package manifests, infer commands, or ask a fixed adapter survey. It vendors the
3671
4113
  editable skills, records their pristine bases, updates `.gitignore`, and probes
3672
- every registered runtime for executable/authentication usability.
4114
+ every registered runtime for executable/authentication usability. The
4115
+ Antigravity probe makes one minimal headless request per configured model, in
4116
+ an empty temporary directory, because a model listing does not prove
4117
+ authentication; it spends a few tokens.
3673
4118
 
3674
4119
  Init reports every probe result and chooses a setup launcher from the fixed
3675
- product preference `claude`, then `codex`, then `pi`. That choice only starts
4120
+ product preference `claude`, then `codex`, then `pi`, then `antigravity`. That choice only starts
3676
4121
  setup; the temporary `[roles.default].runtime` skeleton value does not constrain
3677
4122
  the role runtimes or models the setup agent ultimately configures. When a
3678
4123
  shipped runtime is usable, no Claude discovery conflict remains, and both stdin
@@ -3755,7 +4200,7 @@ pre-attempt index and reports the original Git failure; merged worktree files
3755
4200
  remain in place and the merge's exit status is unchanged. Upgrade never pushes
3756
4201
  or rewrites history.
3757
4202
 
3758
- Autobuild now installs 12 skills; only `ab-spec`, `ab-tickets`, `ab-guide`,
4203
+ Autobuild now installs 14 skills; only `ab-spec`, `ab-tickets`, `ab-guide`,
3759
4204
  and `ab-operate` are model-invocable. The setup reference is an ordinary support file in the
3760
4205
  editable/pristine `ab-guide` tree and participates in the same three-way
3761
4206
  upgrade merge as every other vendored file.
@@ -3785,7 +4230,7 @@ poll. Editing TOML cannot change them.
3785
4230
 
3786
4231
  | Setting | Fresh-repository default | Controls | Scope |
3787
4232
  |---|---:|---|---|
3788
- | Ticket intake | on | `ab dispatch --intake` / `--no-intake`; `i` on the dashboard's global row, and `p` (pause all) / `r` (resume all) on that row or their sessionless equivalents `ab pause --all` / `ab resume --all`, which turn intake off and on as part of quiescing the repository | When off, skip only new ticket list/claim/dispatch work. Janitor work, lease recovery, in-flight builds, and harvesting continue. Turning intake off does not hold builds the repository has already accepted — that is the repository pause below. |
4233
+ | Ticket intake | on | `ab dispatch --intake` / `--no-intake`; `i` on the dashboard's global row, and `p` (pause all) / `r` (resume all) on that row or their sessionless equivalents `ab pause --all` / `ab resume --all`, which turn intake off and on as part of quiescing the repository | When off, skip only ordinary ready-queue listing, claims, and dispatch. A pending `ab start` (`tickets.start`) request still claims its one named ticket while intake is off, subject to repository pause, capacity, and the usual ticket gates. Janitor work, lease recovery, in-flight builds, and harvesting continue. Turning intake off does not hold builds the repository has already accepted — that is the repository pause below. |
3789
4234
  | Repository pause | off | `p` (pause all) / `r` (resume all) on the dashboard's global row, or `ab pause --all` / `ab resume --all` | While on, the dashboard controls line shows `repository PAUSED`, and each held queued row shows `(held)` while retaining its literal `QUEUED` status. No dispatcher tick attaches a runner to such a build — recovery, startup resume, and the lease sweep all skip them. Running builds are parked by the per-build pauses the same command writes; the janitor still settles aborts and discards. |
3790
4235
  | Harvest gate | on | `h` on the dashboard's global row | Pauses or resumes repository observation harvesting. The header shows the kernel-acknowledged gate, not merely a pending keypress. |
3791
4236
 
@@ -3828,6 +4273,8 @@ real process environment—even an empty string—wins over `.env`.
3828
4273
  Variables such as `AB_BUILD`, `AB_PHASE`, `AB_SESSION`, and the harvest-session
3829
4274
  identity tuple are runner-owned ambient authorization. You should not
3830
4275
  set or copy them into `.env`; the runner stamps them for each session.
4276
+ Likewise the runner sets `AB_VERIFY_BASE` for each `check` verify command, and
4277
+ clears any inherited value when the build has no base.
3831
4278
 
3832
4279
  Forge and agent credentials remain adapter-owned. The `local-git` forge uses no
3833
4280
  credentials or network access: it keeps durable PR records under private Git
@@ -3863,7 +4310,11 @@ the existing text-download projection.
3863
4310
  [ChatGPT subscriptions](accounts.md#chatgpt-subscriptions);
3864
4311
  - Pi sessions use Pi's provider authentication: start `pi` and run `/login`
3865
4312
  inside the interactive session, or, for non-interactive use, supply the
3866
- provider credentials Pi supports (such as provider API keys in the environment).
4313
+ provider credentials Pi supports (such as provider API keys in the environment);
4314
+ - Antigravity sessions invoke the local `agy` CLI with its ambient
4315
+ authentication: sign in by running `agy` interactively, export
4316
+ `GEMINI_API_KEY` with `modelProvider = "gemini"` in Antigravity's settings, or
4317
+ set `AGY_ADC_AUTH=true` after `gcloud auth application-default login`.
3867
4318
 
3868
4319
  No provider API key, GitHub token, or remote-store bearer token belongs in
3869
4320
  `autobuild.toml`.
@@ -3905,9 +4356,12 @@ that runtime serves.
3905
4356
  In plain/non-TTY mode, `tick: idle` means the pass recorded no dispatcher
3906
4357
  action. Check the gates in this order:
3907
4358
 
3908
- 1. **Durable intake:** the dashboard header must show intake on, or explicitly
3909
- run a future dispatcher with `--intake`. Intake off skips the ready scan
3910
- even when tickets exist.
4359
+ 1. **Durable intake:** for ordinary ready-queue work, the dashboard header must
4360
+ show intake on, or explicitly run a future dispatcher with `--intake`.
4361
+ Intake off skips the ready scan even when tickets exist. To run one ticket
4362
+ without opening the whole queue, use `ab start <ticket-id>` instead; its
4363
+ pending request and settled outcome appear in `ab repository status` and
4364
+ `ab watch`.
3911
4365
  2. **Repository pause:** a pause all holds every queued build, so the dashboard
3912
4366
  controls line shows `repository PAUSED` and an existing held build shows
3913
4367
  `(held)` beside its literal `QUEUED` status. Intake off alone shows neither
@@ -3925,8 +4379,9 @@ action. Check the gates in this order:
3925
4379
  builds and builds blocked on a question—uses a slot. A build that has
3926
4380
  finished its pipeline and waits for a merge decision holds none, and neither
3927
4381
  does a build waiting on other tickets. One that must re-verify or reconcile,
3928
- or whose ticket wait ended, is admitted ahead of new claims and reserves a
3929
- slot while it waits. Inspect `ab repository status`, `ab builds --queued` and
4382
+ or whose ticket wait ended, is admitted ahead of normal claims and reserves a
4383
+ slot while it waits; urgent work goes first (see
4384
+ [slot admission order](dispatcher.md#slot-admission-order)). Inspect `ab repository status`, `ab builds --queued` and
3930
4385
  `ab build status <slug>` rather than looking only for a live process.
3931
4386
  7. **Duplicate work:** a ready ticket already represented by an active build is
3932
4387
  deliberately excluded from the queue.
@@ -4001,14 +4456,23 @@ readiness provenance. See [merge policy](merge-policy.md) for examples,
4001
4456
  merge methods and forge capability requirements.
4002
4457
 
4003
4458
  `ab hold <slug>` durably suppresses merge and revokes previous consent, even
4004
- before readiness. `ab merge <slug>` requires readiness, clears hold, and consents
4459
+ before readiness; `--reason <text>` records why (1–2000 characters after
4460
+ trimming), shown wherever the hold is until a later hold or merge replaces it.
4461
+ `ab merge <slug>` requires readiness, clears hold, and consents
4005
4462
  to this build/node merge into its effective destination. Consent survives head
4006
4463
  replacement, clean restacking, verification and re-finalization until another
4007
- hold or completion. Consent given under a rule with `paths` or `within`
4008
- predicates is revoked when a reconcile's own edits (its recorded resolution)
4009
- touch a file those predicates match; `landing.consent-revoked` raises default
4464
+ hold, reopen or completion. Consent given under a rule with `paths` or `within`
4465
+ predicates is revoked when a reconcile's own edits, or a leaf restack's
4466
+ generated-file regeneration, touch a file those predicates match (the recorded
4467
+ resolution, not upstream-only changes); `landing.consent-revoked` raises default
4010
4468
  attention naming the files and both heads, and the build returns to the consent
4011
4469
  queue for its new head. Accepted node reparenting revokes consent; holds survive.
4470
+ Accepted reopening of a settled, unmerged leaf revokes consent immediately; a
4471
+ hold survives. See [Send a finished build back](operating.md#send-a-finished-build-back)
4472
+ for the command and for asynchronous cancellation of an armed native auto-merge.
4473
+ Failing forge CI at a finished leaf's live PR head raises default
4474
+ `pr.checks-failed` attention once per head and failing set; it is reported, not
4475
+ acted on, and unreadable CI is unknown rather than green or red.
4012
4476
  It is consent to the merge, not approval of an immutable diff.
4013
4477
  The optional `ab merge <slug> --head <sha>` (operator `head`) refuses with
4014
4478
  `head-mismatch`, recording nothing, unless `<sha>` (full or at least seven
@@ -4033,8 +4497,10 @@ uses the no-rules fallback.
4033
4497
 
4034
4498
  Native auto-merge is reconciled on every janitor poll against durable desired
4035
4499
  merge state. While a consented request is armed and the build is eligible, each
4036
- poll also reads the forge's armed merge method and message (one GraphQL query
4037
- on GitHub). A request with a different method, headline, body or
4500
+ poll also reads the forge's armed merge method and message (on GitHub, the PR
4501
+ read the poll already made plus one conditional repository settings read; a
4502
+ PR's commit messages are read only when the squash settings need them, and are
4503
+ cached per commit set, so a moved head or base re-reads them). A request with a different method, headline, body or
4038
4504
  `Autobuild-Build` trailer, including one a human enabled, is replaced under the
4039
4505
  consent and gate guards before it counts as applied. A matching request costs
4040
4506
  no mutation, consent read or event. It is disabled while held, unauthorized, unready, or replacement