@defrex/autobuild 1.9.0 → 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 (420) hide show
  1. package/README.md +3 -3
  2. package/SPEC.md +1512 -125
  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 +282 -39
  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 +268 -45
  11. package/docs/dispatcher.md +17 -3
  12. package/docs/forges.md +1 -1
  13. package/docs/getting-started.md +1 -1
  14. package/docs/integration-overview.md +4 -2
  15. package/docs/integration-tree.md +102 -11
  16. package/docs/merge-policy.md +30 -14
  17. package/docs/migration-1.0.md +2 -1
  18. package/docs/operating.md +32 -4
  19. package/docs/operator-api.md +117 -14
  20. package/docs/optimization-nodes.md +1042 -0
  21. package/docs/overview.md +1 -1
  22. package/docs/plugin-authoring.md +46 -12
  23. package/docs/remote-store-protocol.md +46 -7
  24. package/docs/remote-ticket-protocol.md +50 -2
  25. package/docs/restacking.md +99 -11
  26. package/docs/seams.md +2 -2
  27. package/docs/setup.md +13 -2
  28. package/docs/skills.md +4 -2
  29. package/docs/spec-standard.md +2 -1
  30. package/docs/ticket-dependencies.md +5 -0
  31. package/docs/ticket-migration.md +4 -2
  32. package/docs/ticket-sources.md +30 -12
  33. package/docs/tickets.md +15 -6
  34. package/docs/troubleshooting.md +3 -2
  35. package/docs/verification.md +11 -0
  36. package/docs/workspaces.md +3 -1
  37. package/package.json +3 -3
  38. package/packages/core/src/accounts/chatgpt-oauth.ts +7 -5
  39. package/packages/core/src/cli/attempt.ts +103 -0
  40. package/packages/core/src/cli/attention.ts +8 -1
  41. package/packages/core/src/cli/binary-direct.ts +52 -1
  42. package/packages/core/src/cli/binary.ts +5 -3
  43. package/packages/core/src/cli/build-control.ts +328 -66
  44. package/packages/core/src/cli/context.ts +268 -15
  45. package/packages/core/src/cli/dashboard/detail.ts +26 -2
  46. package/packages/core/src/cli/dashboard/facts.ts +40 -3
  47. package/packages/core/src/cli/dashboard/integration-detail.ts +7 -2
  48. package/packages/core/src/cli/dashboard/landing-display.ts +15 -2
  49. package/packages/core/src/cli/dashboard/model.ts +102 -27
  50. package/packages/core/src/cli/dashboard/objective-row.ts +189 -0
  51. package/packages/core/src/cli/dashboard/render.ts +47 -1
  52. package/packages/core/src/cli/dashboard/reopen-display.ts +39 -0
  53. package/packages/core/src/cli/dashboard/tree.ts +12 -1
  54. package/packages/core/src/cli/dispatch-frontend.ts +9 -1
  55. package/packages/core/src/cli/dispatch-launch-stop.ts +55 -0
  56. package/packages/core/src/cli/dispatch-launcher.ts +26 -44
  57. package/packages/core/src/cli/dispatch-repository-feed.ts +1 -1
  58. package/packages/core/src/cli/dispatch.ts +16 -4
  59. package/packages/core/src/cli/env.ts +42 -0
  60. package/packages/core/src/cli/help.ts +208 -11
  61. package/packages/core/src/cli/init-agent.ts +4 -1
  62. package/packages/core/src/cli/init-readiness-remote.ts +3 -2
  63. package/packages/core/src/cli/init-validation.ts +2 -2
  64. package/packages/core/src/cli/init.ts +3 -2
  65. package/packages/core/src/cli/judge-entry.ts +82 -0
  66. package/packages/core/src/cli/judge.ts +233 -0
  67. package/packages/core/src/cli/landings.ts +3 -2
  68. package/packages/core/src/cli/main.ts +412 -143
  69. package/packages/core/src/cli/measurement-text.ts +19 -0
  70. package/packages/core/src/cli/objective.ts +154 -0
  71. package/packages/core/src/cli/publication-settlement.ts +106 -22
  72. package/packages/core/src/cli/repo-lease.ts +1 -0
  73. package/packages/core/src/cli/repository-status.ts +113 -18
  74. package/packages/core/src/cli/status.ts +193 -15
  75. package/packages/core/src/cli/store-opening.ts +4 -0
  76. package/packages/core/src/cli/terminals.ts +205 -8
  77. package/packages/core/src/cli/ticket-start.ts +53 -0
  78. package/packages/core/src/cli/ticket.ts +68 -2
  79. package/packages/core/src/cli/upgrade-agent.ts +12 -8
  80. package/packages/core/src/cli/wait.ts +8 -2
  81. package/packages/core/src/cli/watch.ts +341 -91
  82. package/packages/core/src/config/create-labels.ts +23 -0
  83. package/packages/core/src/config/live.ts +2 -0
  84. package/packages/core/src/config/pipeline-source.ts +1 -3
  85. package/packages/core/src/config/roles.ts +182 -73
  86. package/packages/core/src/config/schema.ts +112 -9
  87. package/packages/core/src/events/catalog.ts +39 -3
  88. package/packages/core/src/events/compatibility.ts +7 -1
  89. package/packages/core/src/events/payloads.ts +588 -1
  90. package/packages/core/src/events/policy.ts +53 -0
  91. package/packages/core/src/events/repository.ts +107 -24
  92. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +1481 -199
  93. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/0ab2a90d0305dc9d.json.gz +0 -0
  94. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/10a4657408d4e121.json.gz +0 -0
  95. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1152a2e97ee81728.json.gz +0 -0
  96. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/13ca84752c5f8b54.json.gz +0 -0
  97. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1411d1cdbdd9911e.json.gz +0 -0
  98. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1444fe1fa7fc802c.json.gz +0 -0
  99. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1491ac0600349391.json.gz +0 -0
  100. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1921f86f752428c9.json.gz +0 -0
  101. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1972c1d66008ef6b.json.gz +0 -0
  102. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/19e8e43e7f3f1a06.json.gz +0 -0
  103. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/20a85c143c3e8164.json.gz +0 -0
  104. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/21ce2c0bf58318e1.json.gz +0 -0
  105. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/293dcb3a94fb3470.json.gz +0 -0
  106. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2ab7436356267118.json.gz +0 -0
  107. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2d084641735caaff.json.gz +0 -0
  108. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3237bcecf68e5db9.json.gz +0 -0
  109. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/33d0cc593610e56f.json.gz +0 -0
  110. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3451ed2136dcc356.json.gz +0 -0
  111. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/358ec8693f2237e6.json.gz +0 -0
  112. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/35cf9ccc4478b2d2.json.gz +0 -0
  113. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3649e7bd1203f154.json.gz +0 -0
  114. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/378da6dece82202a.json.gz +0 -0
  115. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/38c75099d9191471.json.gz +0 -0
  116. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/398952f1f01db1a3.json.gz +0 -0
  117. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3b64d352d56c9121.json.gz +0 -0
  118. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3dc486226c05372d.json.gz +0 -0
  119. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/431c9bb2ee8838e0.json.gz +0 -0
  120. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4400dffca929e2f0.json.gz +0 -0
  121. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/49064fc079964a5c.json.gz +0 -0
  122. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4edded75f17742f4.json.gz +0 -0
  123. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4f00c0f2c8afd159.json.gz +0 -0
  124. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516a5a7aadf97587.json.gz +0 -0
  125. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516dc6ea85d67cd7.json.gz +0 -0
  126. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/584e2ba74608e051.json.gz +0 -0
  127. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/59ffaa6974094c72.json.gz +0 -0
  128. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5bb43afb121674c6.json.gz +0 -0
  129. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5f0ca42af862c4ee.json.gz +0 -0
  130. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6118031132db9bfc.json.gz +0 -0
  131. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63107a8d58776b63.json.gz +0 -0
  132. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63546b08d4d6fa11.json.gz +0 -0
  133. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/643d70429ce03dad.json.gz +0 -0
  134. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/677ea92572c29082.json.gz +0 -0
  135. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6ae5bf60504d6467.json.gz +0 -0
  136. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6efdc8defc75fccb.json.gz +0 -0
  137. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/71c53d33f09d8204.json.gz +0 -0
  138. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7267ca2757cffba7.json.gz +0 -0
  139. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/76b7d4244082b3f9.json.gz +0 -0
  140. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7749f918c6f10968.json.gz +0 -0
  141. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7833e42d16301424.json.gz +0 -0
  142. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7d4edad0614adaf1.json.gz +0 -0
  143. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/837365898d04f45a.json.gz +0 -0
  144. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/85f9f0c921b8b5bb.json.gz +0 -0
  145. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8879f57a24733897.json.gz +0 -0
  146. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/88cb9e71bdec972d.json.gz +0 -0
  147. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8a0cd6dd06cc155e.json.gz +0 -0
  148. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8aa9ca8609dc051d.json.gz +0 -0
  149. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8c8640255bd61658.json.gz +0 -0
  150. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8cc15eb1807c0157.json.gz +0 -0
  151. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8ced97c44bc0af3a.json.gz +0 -0
  152. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8d4144004720b9f8.json.gz +0 -0
  153. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8db633ead1807f8b.json.gz +0 -0
  154. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8e42cdbd0994ab0c.json.gz +0 -0
  155. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9011d0f6ff955ef9.json.gz +0 -0
  156. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/916ebc5433801c41.json.gz +0 -0
  157. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9539b995af5c54a9.json.gz +0 -0
  158. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/95f391bfd7b7dbd7.json.gz +0 -0
  159. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9613e8fa568a9281.json.gz +0 -0
  160. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9a68f8753bd9038d.json.gz +0 -0
  161. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9b25e58227080094.json.gz +0 -0
  162. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9ee3919fbd4f9458.json.gz +0 -0
  163. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a04a34cc2717147b.json.gz +0 -0
  164. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a0b32c12e4e6edb6.json.gz +0 -0
  165. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a55218252707bdd3.json.gz +0 -0
  166. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a732fd08b31522a6.json.gz +0 -0
  167. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a9d206a01f9039e5.json.gz +0 -0
  168. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/abf7fe3c92c82f2d.json.gz +0 -0
  169. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ac928b04842c00db.json.gz +0 -0
  170. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/af953392d81911da.json.gz +0 -0
  171. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0d877c44810ecb0.json.gz +0 -0
  172. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0f7c6ebb2db57fc.json.gz +0 -0
  173. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b905c22ec17eed31.json.gz +0 -0
  174. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/bce0c54e865f4b79.json.gz +0 -0
  175. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c68b7ee2e2610f30.json.gz +0 -0
  176. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c7f7e0378aeea237.json.gz +0 -0
  177. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c98cb1659eb142b6.json.gz +0 -0
  178. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ca830adf06ed55a1.json.gz +0 -0
  179. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cb3a219f33e437ca.json.gz +0 -0
  180. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cf1e0c0d82567e0c.json.gz +0 -0
  181. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d008d86d9ff77b30.json.gz +0 -0
  182. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d1432a819d8e48c5.json.gz +0 -0
  183. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d185ed6aa9192aff.json.gz +0 -0
  184. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d873fad29d6c7e55.json.gz +0 -0
  185. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/db84b12316e2da4a.json.gz +0 -0
  186. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ddf6dc967d898767.json.gz +0 -0
  187. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/dfc64de6e7bfc0a0.json.gz +0 -0
  188. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e2f18fa32fe1f6d0.json.gz +0 -0
  189. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e37393fed29e84c5.json.gz +0 -0
  190. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e6a8585e2a054ff6.json.gz +0 -0
  191. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e7e9e327baca6903.json.gz +0 -0
  192. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e86447af0571672c.json.gz +0 -0
  193. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ea819202d22122e5.json.gz +0 -0
  194. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb4535585f2e84f6.json.gz +0 -0
  195. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb7ddd5319d09e27.json.gz +0 -0
  196. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eca4959b2b87ae15.json.gz +0 -0
  197. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ee10d7959ec4843c.json.gz +0 -0
  198. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ef1b68347966ab26.json.gz +0 -0
  199. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f3e55425cc41f230.json.gz +0 -0
  200. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f40042c1cdb9fd43.json.gz +0 -0
  201. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f48466215c790a3f.json.gz +0 -0
  202. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f5b9ace9b59351e7.json.gz +0 -0
  203. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fa8f1475a55be935.json.gz +0 -0
  204. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fb21116a15d0b1f1.json.gz +0 -0
  205. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fe95444fbeabe592.json.gz +0 -0
  206. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/09bf0a1611d07363.json +984 -0
  207. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/10eac4988d66e161.json +1067 -0
  208. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/1a436b5fb45aee3e.json +1116 -0
  209. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/249db6f7a41f90e2.json +161 -0
  210. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/25dcb2fb6eaa83f4.json +858 -0
  211. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/2e1bdc763924616f.json +4932 -0
  212. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/30e9dabce3c4263d.json +399 -0
  213. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/4898ef339c68fa36.json +83 -0
  214. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/51816c0ffa62af6e.json +417 -0
  215. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/561bf45320062a44.json +83 -0
  216. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5672d0233085d050.json +84 -0
  217. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5e39f42cbdbf35ef.json +163 -0
  218. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/7771a7a2250f9964.json +868 -0
  219. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/881c491321bec99a.json +1074 -0
  220. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/965f25c3af1d2cdc.json +160 -0
  221. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9b76d89da575ca90.json +20 -0
  222. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9eb485320a72a9ff.json +233 -0
  223. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a60448c01016135e.json +18 -0
  224. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a6584fb61b6679bd.json +97 -0
  225. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c88365c25b3186d3.json +543 -0
  226. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e8f0481b23f90056.json +711 -0
  227. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/ee55782ed40ebbac.json +110 -0
  228. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fc5082fac8167f3d.json +98 -0
  229. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fd55c329cfe921cc.json +1069 -0
  230. package/packages/core/src/kernel/attempt-creation-key.ts +20 -0
  231. package/packages/core/src/kernel/attempt-settlement.ts +125 -0
  232. package/packages/core/src/kernel/auto-merge-default.ts +1 -3
  233. package/packages/core/src/kernel/auto-merge.ts +1 -3
  234. package/packages/core/src/kernel/dispatch-capacity.ts +312 -38
  235. package/packages/core/src/kernel/dispatch-placement.ts +1 -1
  236. package/packages/core/src/kernel/dispatch-settings.ts +1 -4
  237. package/packages/core/src/kernel/dispatch-status.ts +3 -5
  238. package/packages/core/src/kernel/dispatch-upgrade.ts +1 -1
  239. package/packages/core/src/kernel/engine.ts +109 -13
  240. package/packages/core/src/kernel/forge-checks.ts +140 -0
  241. package/packages/core/src/kernel/forge-health.ts +2 -2
  242. package/packages/core/src/kernel/generated-files.ts +43 -0
  243. package/packages/core/src/kernel/generated-regeneration.ts +254 -0
  244. package/packages/core/src/kernel/generators/build-log.ts +30 -2
  245. package/packages/core/src/kernel/generators/optimization-log.ts +578 -0
  246. package/packages/core/src/kernel/generators/panel-log.ts +133 -0
  247. package/packages/core/src/kernel/guarded-forge.ts +76 -11
  248. package/packages/core/src/kernel/harvest.ts +1 -4
  249. package/packages/core/src/kernel/head-paths.ts +4 -1
  250. package/packages/core/src/kernel/history-retention.ts +337 -0
  251. package/packages/core/src/kernel/incremental-fixtures.ts +6 -0
  252. package/packages/core/src/kernel/incremental.ts +14 -4
  253. package/packages/core/src/kernel/integration-landing.ts +64 -13
  254. package/packages/core/src/kernel/integration-stack.ts +123 -20
  255. package/packages/core/src/kernel/integration-state.ts +39 -2
  256. package/packages/core/src/kernel/janitor-failure.ts +2 -0
  257. package/packages/core/src/kernel/kernel-git.ts +1 -1
  258. package/packages/core/src/kernel/landing-measurement.ts +275 -0
  259. package/packages/core/src/kernel/landing-readiness.ts +2 -0
  260. package/packages/core/src/kernel/landing-state.ts +20 -1
  261. package/packages/core/src/kernel/leaf-restack-state.ts +17 -1
  262. package/packages/core/src/kernel/log-index-value.ts +2 -0
  263. package/packages/core/src/kernel/log-index.ts +81 -3
  264. package/packages/core/src/kernel/measurement.ts +406 -0
  265. package/packages/core/src/kernel/mixed-version.ts +6 -3
  266. package/packages/core/src/kernel/node-landing.ts +92 -18
  267. package/packages/core/src/kernel/node-restack-state.ts +27 -1
  268. package/packages/core/src/kernel/node-restack-transaction.ts +80 -23
  269. package/packages/core/src/kernel/node-verification-context.ts +14 -4
  270. package/packages/core/src/kernel/open-pr-backpressure-state.ts +24 -0
  271. package/packages/core/src/kernel/open-pr-backpressure.ts +133 -0
  272. package/packages/core/src/kernel/optimization-admission.ts +249 -0
  273. package/packages/core/src/kernel/optimization.ts +774 -0
  274. package/packages/core/src/kernel/panel.ts +225 -0
  275. package/packages/core/src/kernel/phases.ts +42 -6
  276. package/packages/core/src/kernel/pr-attachments.ts +4 -16
  277. package/packages/core/src/kernel/pr-summary.ts +2 -2
  278. package/packages/core/src/kernel/read-deferrals.ts +2 -2
  279. package/packages/core/src/kernel/read-facts.ts +69 -31
  280. package/packages/core/src/kernel/reconcile-restack.ts +352 -103
  281. package/packages/core/src/kernel/reducer-identity.ts +659 -0
  282. package/packages/core/src/kernel/reducer-registry.ts +37 -3
  283. package/packages/core/src/kernel/reducer-revisions.ts +50 -0
  284. package/packages/core/src/kernel/reducer.ts +208 -9
  285. package/packages/core/src/kernel/reopen-state.ts +48 -0
  286. package/packages/core/src/kernel/reopen.ts +143 -0
  287. package/packages/core/src/kernel/replay-retention.ts +208 -39
  288. package/packages/core/src/kernel/repository-attention.ts +1 -1
  289. package/packages/core/src/kernel/service-facts.ts +19 -7
  290. package/packages/core/src/kernel/terminal-guard.ts +13 -5
  291. package/packages/core/src/kernel/ticket-handbacks.ts +1 -1
  292. package/packages/core/src/kernel/ticket-migrations.ts +1 -1
  293. package/packages/core/src/kernel/ticket-preparation.ts +1 -1
  294. package/packages/core/src/kernel/ticket-source-health.ts +1 -1
  295. package/packages/core/src/kernel/ticket-starts.ts +118 -0
  296. package/packages/core/src/kernel/ticket-wait.ts +37 -2
  297. package/packages/core/src/kernel/verify-diff-base.ts +62 -0
  298. package/packages/core/src/kernel/verify-stage-state.ts +1 -0
  299. package/packages/core/src/kernel/verify-stages.ts +41 -1
  300. package/packages/core/src/objective.ts +532 -0
  301. package/packages/core/src/ontology.ts +49 -6
  302. package/packages/core/src/operator/annotations.ts +35 -4
  303. package/packages/core/src/operator/control.ts +2 -1
  304. package/packages/core/src/operator/index.ts +12 -0
  305. package/packages/core/src/operator/optimization.ts +307 -0
  306. package/packages/core/src/operator/protocol.ts +30 -1
  307. package/packages/core/src/operator/query.ts +15 -1
  308. package/packages/core/src/operator/registry.ts +219 -13
  309. package/packages/core/src/operator/requests.ts +25 -2
  310. package/packages/core/src/operator/ticket-start.ts +152 -0
  311. package/packages/core/src/operator/tickets.ts +3 -2
  312. package/packages/core/src/plugin-sdk/index.ts +2 -0
  313. package/packages/core/src/plugins/registry.ts +1 -0
  314. package/packages/core/src/ports/forge/contract.ts +9 -0
  315. package/packages/core/src/ports/forge/fake.ts +23 -2
  316. package/packages/core/src/ports/forge/git-rewrite.ts +6 -4
  317. package/packages/core/src/ports/forge/github-readiness.ts +1 -1
  318. package/packages/core/src/ports/forge/github-transport.ts +156 -1
  319. package/packages/core/src/ports/forge/github.ts +306 -100
  320. package/packages/core/src/ports/forge/readiness.ts +15 -3
  321. package/packages/core/src/ports/forge-failure.ts +22 -0
  322. package/packages/core/src/ports/forge-request-context.ts +23 -1
  323. package/packages/core/src/ports/forge-telemetry.ts +16 -0
  324. package/packages/core/src/ports/runner/antigravity.ts +1071 -0
  325. package/packages/core/src/ports/runner/claude.ts +6 -1
  326. package/packages/core/src/ports/runner/codex.ts +11 -2
  327. package/packages/core/src/ports/runner/contract.ts +25 -1
  328. package/packages/core/src/ports/runner/fake.ts +2 -2
  329. package/packages/core/src/ports/runner/native-cli-fixture.ts +40 -5
  330. package/packages/core/src/ports/runner/native-process-fixture.ts +4 -1
  331. package/packages/core/src/ports/runner/pi.ts +23 -7
  332. package/packages/core/src/ports/runner/production.ts +19 -2
  333. package/packages/core/src/ports/runner/session-env.ts +65 -5
  334. package/packages/core/src/ports/runner/start-prompt.ts +6 -4
  335. package/packages/core/src/ports/tickets/contract.ts +4 -2
  336. package/packages/core/src/ports/tickets/github.ts +20 -5
  337. package/packages/core/src/ports/tickets/hosted-index.ts +6 -1
  338. package/packages/core/src/ports/tickets/labels.ts +21 -0
  339. package/packages/core/src/ports/tickets/linear.ts +33 -0
  340. package/packages/core/src/ports/tickets/migration.ts +2 -0
  341. package/packages/core/src/ports/tickets/priority.ts +11 -0
  342. package/packages/core/src/ports/tickets/remote-protocol.ts +71 -6
  343. package/packages/core/src/ports/tickets/remote.ts +138 -16
  344. package/packages/core/src/ports/tickets/tree.ts +17 -4
  345. package/packages/core/src/ports/types.ts +98 -4
  346. package/packages/core/src/ports/workspace/builtin-capabilities.ts +7 -4
  347. package/packages/core/src/ports/workspace/commit-preservation.ts +182 -64
  348. package/packages/core/src/ports/workspace/create.ts +3 -0
  349. package/packages/core/src/ports/workspace/git-worktree.ts +13 -1
  350. package/packages/core/src/ports/workspace/vercel-sandbox.ts +242 -61
  351. package/packages/core/src/processes/build-execution-state.ts +1 -3
  352. package/packages/core/src/processes/build-runner.ts +1435 -132
  353. package/packages/core/src/processes/dispatch-failure-budget.ts +1 -1
  354. package/packages/core/src/processes/dispatcher-selectors.ts +15 -13
  355. package/packages/core/src/processes/dispatcher.ts +2781 -242
  356. package/packages/core/src/processes/execution-no-progress.ts +36 -1
  357. package/packages/core/src/processes/execution-settlement.ts +2 -6
  358. package/packages/core/src/processes/harvest-execution-state.ts +2 -6
  359. package/packages/core/src/processes/harvest-runner.ts +7 -2
  360. package/packages/core/src/processes/infrastructure-failure-budget.ts +1 -3
  361. package/packages/core/src/processes/judge-launcher.ts +38 -0
  362. package/packages/core/src/processes/measurement-runner.ts +235 -0
  363. package/packages/core/src/processes/optimization-merges.ts +101 -0
  364. package/packages/core/src/processes/optimization-stop.ts +179 -0
  365. package/packages/core/src/processes/panel-runner.ts +756 -0
  366. package/packages/core/src/processes/phase-failure-budget.ts +1 -0
  367. package/packages/core/src/processes/publication-state.ts +1 -4
  368. package/packages/core/src/processes/repo-view.ts +77 -5
  369. package/packages/core/src/processes/sandbox-state.ts +1 -4
  370. package/packages/core/src/processes/tick-state.ts +1 -3
  371. package/packages/core/src/processes/workspace-preservation.ts +67 -9
  372. package/packages/core/src/scenarios/harness.ts +19 -8
  373. package/packages/core/src/store/contract.ts +44 -0
  374. package/packages/core/src/store/digest.ts +89 -7
  375. package/packages/core/src/store/judge-authority.ts +161 -0
  376. package/packages/core/src/store/phase-session.ts +226 -4
  377. package/packages/core/src/store/reduced-reads.ts +10 -0
  378. package/packages/core/src/store/reducer-value-shapes.json +17060 -12099
  379. package/packages/core/src/store/remote/client.ts +12 -2
  380. package/packages/core/src/store/remote/credentials.ts +31 -1
  381. package/packages/core/src/store/remote/index.ts +8 -0
  382. package/packages/core/src/store/remote/protocol.ts +38 -0
  383. package/packages/core/src/store/remote/released-clients.json +11 -0
  384. package/packages/core/src/store/remote/released-reducer-values/1.10.0.json +34439 -0
  385. package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -16
  386. package/packages/core/src/store/remote/token.ts +13 -4
  387. package/packages/core/src/store/repo-state-events.ts +6 -8
  388. package/packages/core/src/store/session-reducer.ts +1 -4
  389. package/packages/core/src/store/ticket-assets.ts +1 -3
  390. package/packages/core/src/store/types.ts +9 -0
  391. package/packages/core/src/testing/dispatch-read-budget.ts +70 -0
  392. package/packages/core/src/testing/git-config-isolation.ts +25 -0
  393. package/packages/core/src/testing/index.ts +13 -0
  394. package/packages/core/src/testing/reduced-read-budget.ts +3455 -34
  395. package/skills/code-review/SKILL.md +16 -0
  396. package/skills/finalize/SKILL.md +10 -4
  397. package/skills/guide/SKILL.md +383 -77
  398. package/skills/guide/references/integration-tree.md +102 -11
  399. package/skills/guide/references/merge-policy.md +30 -14
  400. package/skills/guide/references/migration-1.0.md +2 -1
  401. package/skills/guide/references/operator-api.md +117 -14
  402. package/skills/guide/references/optimization-nodes.md +1042 -0
  403. package/skills/guide/references/plugin-authoring.md +46 -12
  404. package/skills/guide/references/remote-store-protocol.md +46 -7
  405. package/skills/guide/references/remote-ticket-protocol.md +50 -2
  406. package/skills/guide/references/restacking.md +99 -11
  407. package/skills/guide/references/setup.md +13 -2
  408. package/skills/guide/references/spec-standard.md +2 -1
  409. package/skills/guide/references/ticket-dependencies.md +5 -0
  410. package/skills/guide/references/ticket-migration.md +4 -2
  411. package/skills/implement/SKILL.md +51 -1
  412. package/skills/judge/SKILL.md +43 -0
  413. package/skills/operate/SKILL.md +243 -28
  414. package/skills/plan/SKILL.md +18 -0
  415. package/skills/plan-review/SKILL.md +15 -1
  416. package/skills/propose/SKILL.md +121 -0
  417. package/skills/reconcile/SKILL.md +21 -2
  418. package/skills/spec/SKILL.md +30 -4
  419. package/skills/tickets/SKILL.md +44 -5
  420. package/templates/hosted-service/package.json +2 -2
@@ -25,7 +25,11 @@ disagree, the code is authoritative.
25
25
  forward. Pending operator commands remain actionable.
26
26
  3. **Ingesters propose, humans dispatch.** Nothing auto-generated passes
27
27
  Triage without a human grooming it to Ready, unless the repository waives
28
- that gate explicitly with `[tickets].proposalState`.
28
+ that gate explicitly with `[tickets].proposalState` for its own harvest.
29
+ An optimization node's attempts are the one other path: grooming the
30
+ node's objective, purpose, budget and stop policy is the dispatch decision
31
+ for the attempts its proposer files, so within that budget they go
32
+ straight to Ready. The gate still holds for all other generated work.
29
33
  4. **Every step leaves a paper trail** — queryable, not carried in the repo.
30
34
 
31
35
  ## Pipeline
@@ -146,11 +150,39 @@ wrappers over the same fold, so results cannot diverge, and a property test
146
150
  checks every split point of fixture and generated logs. The accumulator is plain
147
151
  JSON, so it survives a serialize-and-parse round trip. `advance` never mutates
148
152
  its input: it clones, then folds, so a state derived earlier is never disturbed
149
- by a later advance. Each reducer publishes a `version`; bump it whenever the
150
- accumulator shape or the fold semantics change, because a cached accumulator is
151
- only valid for the version that wrote it. `kernel/reducer-registry.ts` lists
152
- every reducer with its version, and its snapshot test fails when an accumulator
153
- shape changes without a bump. Current-state consumers use the typed persisted
153
+ by a later advance. Each reducer publishes a `version`, because a cached
154
+ accumulator is only valid for the version that wrote it. The version is derived,
155
+ never edited (`kernel/reducer-identity.ts`): a frozen legacy base, plus one for
156
+ each line naming the reducer's identity in the append-only revision ledger
157
+ `kernel/reducer-revisions.ts`, plus the versions of its declared parts. When an
158
+ accumulator shape or fold changes, `bun tools/reducer-revision.ts <shape|fold>
159
+ <identity> --reason "…"` appends a line with a random id. The ledger merges by
160
+ union (`.gitattributes`), so two branches that revise the same reducer combine
161
+ without a conflict into a version higher than either, and versions only grow.
162
+ Never delete a ledger line, even to revert: a lower version would be reduced
163
+ again on every read. The registry integration test's revision guard enforces
164
+ this against the verify base (`AB_VERIFY_BASE`): it fails a change that drops a
165
+ base ledger line, or under which any identity both commits construct derives a
166
+ lower version than the base's own code did, through the ledger, a frozen legacy
167
+ base or a part. A deregistered identity keeps its lines and is not compared.
168
+ `kernel/reducer-registry.ts` lists every reducer, and its
169
+ integration test checks the derivation and fails when an accumulator shape
170
+ changes without a revision. It also holds the identity records under
171
+ `kernel/__snapshots__/reducer-identity-records/`: per reducer identity and
172
+ revision set, the accumulator digest after each deterministic test corpus.
173
+ Every corpus a record has covered is kept in the content-addressed
174
+ `reducer-identity-corpora/` archive and stays checked under that identity, so
175
+ corpora may change freely while a fold change without a revision still fails.
176
+ `AB_UPDATE_REDUCER_SHAPES=1` on that test regenerates the shapes and adds one
177
+ new record file; record files are only ever added, never edited or deleted. One
178
+ state passes the records with a notice rather than silently: after revisions
179
+ combine through a clean restack and before anyone regenerates, the combined
180
+ identity has no record of its own. A base-relative clause catches a fold change
181
+ there: against the verify base (`AB_VERIFY_BASE`), a reducer whose change adds
182
+ no revision must fold every corpus as the base's records, or failing those the
183
+ base's own code, did. The clause is skipped, with a notice, in two cases: when
184
+ no base is supplied, and when the supplied base predates the revision ledger.
185
+ The revision guard skips, with its own notice, in the same two cases. Either way the identity-record checks above stay in force. Current-state consumers use the typed persisted
154
186
  read helpers in `store/reduced-reads.ts`; whole-array reducers remain pure
155
187
  reference projections for tests and explicit historical output.
156
188
 
@@ -211,6 +243,7 @@ Published clients with a recorded published catalog identity, or without a catal
211
243
  identity, receive answers projected onto their
212
244
  frozen released contracts in `store/remote/released-reducer-values/` and stamped
213
245
  with their released reducer versions, including projection-capable published clients.
246
+ The projection covers both named reducer values and historical stream seeds.
214
247
  `reducerValueForClient` omits optional `lastEvent` fields with newer event variants,
215
248
  including nested build state, and filters `seenTypes` to known event types while
216
249
  preserving canonical cursor, progress, and compatibility facts. An invalid envelope
@@ -327,16 +360,67 @@ identity for the finite `builds`, `build status`, and `artifact download` read
327
360
  shells: no identity retains operator authority, while any partial, malformed,
328
361
  shared-only, or mixed identity fails closed before Store opening. Remote
329
362
  references keep the existing token-backed client unchanged. Local references
330
- are wrapped by `packages/core/src/store/phase-session.ts`, which permits only the exact
363
+ are wrapped by `packages/core/src/store/phase-session.ts`, which permits the exact
331
364
  ambient build or repository resource (this is the phase-session wrapper, not the
332
365
  operator-session scope handle in `session-handle.ts`) and rejects
333
366
  agent-attributed event writes
334
- for any session other than `AB_SESSION`. The wrapper deliberately allows
367
+ for any session other than `AB_SESSION`. One read-only exception serves a
368
+ targeted build that is not itself a node, such as an optimization attempt or
369
+ another node child: it may read its target node's `buildReadFacts` value, its
370
+ own repository's `repositoryReadFacts` value and that repository's record, so
371
+ attempt context, harness protection and `--no-improvement` work in the session.
372
+ The grant is derived once per handle from the scoped build's own facts. Every
373
+ other foreign read, any unrelated build or repository, and every foreign write
374
+ remain refused. The wrapper deliberately allows
335
375
  non-agent actors because phase terminals also run trusted kernel plumbing in
336
376
  that CLI process; resource authority still applies to every operation. Generic
337
377
  sessionless opening remains unwrapped; only those three reads use the dedicated
338
378
  ambient-aware finite opener.
339
379
 
380
+ **Judge panels.** `packages/core/src/kernel/panel.ts` holds a judge panel's
381
+ pure half: each judge's A/B order, the candidate's score, the win rate with
382
+ ties counted as half, and the latest run's reduced state (`BuildState.panel`).
383
+ `packages/core/src/processes/panel-runner.ts` materializes each pending judge's
384
+ root outside any repository from a private Git directory over the workspace's
385
+ objects, pins every harness path, copies `ab-judge` from the harness pin and
386
+ removes that material before any session starts. It computes the protected
387
+ locations (workspace, checkout, Git common directory, main checkout, local
388
+ store), refuses a scratch base or root in one of them or inside any Git
389
+ repository with fail-closed discovery, writes the judge-only launcher, and
390
+ refuses an interpreter or runtime executable found only in a protected
391
+ location. Its loop reclaims dangling sessions, completes saved preferences and
392
+ launches each wave concurrently. `packages/core/src/cli/judge-entry.ts` is the
393
+ judge-only `ab`, bundled into one file by
394
+ `packages/core/src/processes/judge-launcher.ts`. `sessionEnv` in
395
+ `packages/core/src/ports/runner/session-env.ts` builds the judge's launch
396
+ environment, scrubbing every inherited value that names a protected location;
397
+ `judgeAmbientAliases` in `panel-runner.ts` first resolves inherited paths so a
398
+ symlinked spelling of one, or one embedded after a prefix such as `-I`, is
399
+ scrubbed too.
400
+ `BuildRunner.runPanel` records the run's kernel facts, the order in
401
+ `panel.judge-started` before each session, and `panel.judged` after it, and
402
+ commits a local judge's preference outbox. Its `runJudge` runs the `judge`
403
+ role's primary-first provider chain for one judge, opening a session stream
404
+ per judge session and closing it before `panel.judge-ended`; the panel loop
405
+ hands each launch a preflight that checks an alternate's executable against
406
+ the run's filtered `PATH` and protected locations before it starts. `BuildRunner.runMeasurement`
407
+ calls it for an attempt's panel measurement request, under the panel id `attemptPanelId`
408
+ derives in `packages/core/src/kernel/measurement.ts`, and records the win rate
409
+ in `attempt.sampled`; the dispatcher decides it against the node's current ε
410
+ there too (`decideSampledMeasurement`, `panelDecision`), and
411
+ `packages/core/src/kernel/landing-measurement.ts` classifies the recorded win
412
+ rate for landing. A judge session has no read authority: `packages/core/src/store/judge-authority.ts` is the shared rule (one
413
+ `panel.preferred` for its own panel, judge and session, while that session is
414
+ open). Its `appendJudgePreference` decides and appends in one conditional step
415
+ for every holder of the store: the hosted `build-judge` route, the kernel's
416
+ outbox commit and the local wrapper in `packages/core/src/store/phase-session.ts`.
417
+ `packages/core/src/cli/judge.ts` implements `ab judge context` (no store read)
418
+ and `ab judge prefer`, and any read command run with `AB_JUDGE` set fails
419
+ before opening a store. The node runner calls
420
+ `runPanel` for a panel node's starting self-comparison and for its progress
421
+ after each accepted attempt, selected by `baselineMeasurementDue` and
422
+ `progressMeasurementDue` in `packages/core/src/kernel/measurement.ts`.
423
+
340
424
  **Phase decisions.** `packages/core/src/kernel/phases.ts` owns the phase table,
341
425
  `packages/core/src/kernel/engine.ts` the deterministic transitions;
342
426
  `packages/core/src/processes/build-runner.ts` executes the decisions. Repeated phase starts
@@ -627,18 +711,23 @@ explicitly.
627
711
  `processes/workspace-preservation.ts` owns the non-destructive fence, immutable
628
712
  checkpoint and durable receipt ordering shared by both release paths in the
629
713
  dispatcher. `ports/workspace/commit-preservation.ts` inventories the unpublished
630
- change and restores exact refs, keeping detached producer objects separate from
631
- the named branch. Provider provisioning and start failures signal
714
+ change and restores exact refs or store copies, keeping detached producer objects
715
+ separate from the named branch. Provider provisioning and start failures signal
632
716
  `WorkspaceCleanupRequired`; they cannot delete an existing build checkout.
633
717
 
634
718
  Before releasing or replacing a build workspace, the dispatcher confirms a
635
719
  non-destructive execution fence for the exact workspace and execution generation.
636
720
  It preserves unpublished branch commits and distinct detached producer candidates
637
721
  under immutable `refs/autobuild/archive/<build>/<sha>` refs, verifies their exact
638
- readback, and records `workspace.commits-preserved` before cleanup. Replacement
639
- provisioning restores those exact refs before starting an agent, reading them
640
- from the local repository with the local-git forge and fetching each exact ref
641
- from the remote otherwise. A preserved
722
+ readback, and records `workspace.commits-preserved` before cleanup. Where the
723
+ forge refuses an archive ref, the head is kept as a BuildStore copy instead
724
+ and the receipt is the decisive `workspace.commits-retained`, whose heads each
725
+ name either `remoteRef` or `storeBase`; a head kept by neither refuses the
726
+ release. Replacement provisioning restores those exact commits before starting
727
+ an agent, reading archive refs from the local repository with the local-git forge
728
+ and fetching each exact ref from the remote otherwise, and restoring store copies
729
+ through a dispatcher-side callback on any host, so a remote guest never holds
730
+ store credentials. A preserved
642
731
  branch head that the build's latest 64 replaced heads cover, as the replaced
643
732
  head itself or one of its ancestors, is kept only as archived objects: it is
644
733
  never preserved or restored as the branch, and provisioning records the skip as
@@ -649,11 +738,14 @@ that exists without a provisioned checkout, records `workspace.commits-lost`,
649
738
  naming known candidates and explicitly noting that any additional unpublished
650
739
  SHAs could not be inspected. An environment that never started executing holds
651
740
  no unpublished work: objects its checkout lacks mean nothing to preserve, so
652
- cleanup records `workspace.commits-preserved` carrying forward earlier preserved
653
- heads, then releases and replaces it. Unknown fencing, inspection, transport, or
741
+ cleanup records `workspace.commits-preserved` (or `workspace.commits-retained`)
742
+ carrying forward earlier preserved heads, then releases and replaces it. Unknown fencing, inspection, transport, or
654
743
  receipt-write outcomes leave the workspace and snapshots intact. A workspace
655
744
  flagged by `workspace.cleanup-required` is never launched into: the dispatcher
656
- releases it and provisions the next generation. A preservation or release
745
+ releases it and provisions the next generation. Provisioning cut off by a
746
+ recorded dispatcher teardown is the exception: the next invocation asks the
747
+ provider to verify and finish the same generation, and if it cannot, the
748
+ replacement consumes no infrastructure attempt. A preservation or release
657
749
  failure is recorded against its build, as an infrastructure failure or janitor
658
750
  attention, and never stops the dispatcher from advancing other builds.
659
751
  Fencing is revalidated after restart; a saved receipt alone never authorizes
@@ -708,6 +800,29 @@ boundary in the reducer and log index, independently of reconcile identity.
708
800
  The advisory `pipeline.settled` fact records that the engine reached a leaf's
709
801
  `wait awaiting-pr`; `kernel/dispatch-capacity.ts` reads it so a finished build
710
802
  parked for its merge decision holds no slot.
803
+ Reopening a settled leaf (SPEC §15.7) spans the same seams. The shared
804
+ `cli/build-control.ts` control appends the human `build.reopened` and, for a
805
+ spec, publishes the kernel's operator `spec.revised`; `ab reopen` and the
806
+ `builds.reopen` tool call it. `kernel/reopen.ts` holds the reduced-state
807
+ predicates the control's refusals, the engine's `awaiting-spec` park, capacity's
808
+ `reopen` slot request, landing readiness, `ab context` (`reopen.json`) and the
809
+ status surfaces share. The log index's `codeRestartSeq` is the code half's
810
+ restart boundary, so the engine re-runs implement, review, verify and finalize
811
+ without special cases, and the terminal guard lets the re-run finalize and
812
+ verify attempts complete again.
813
+ Slot admission order (SPEC §12) is arithmetic in `kernel/dispatch-capacity.ts`:
814
+ waiting entries carry the build's reduced `priority` (`build.created`,
815
+ `build.priority-set`), `startClaimDemand` counts pending start requests by
816
+ tier, `reservedAhead` counts the manual requests ahead of an urgent waiter and
817
+ also the urgent reservations, urgent requests and the latest admission scan's
818
+ `urgentWaiting` ahead of a normal waiter, `intakeCapacity` gives ordinary urgent
819
+ and normal claims separate budgets, and `startCapacity` gives each start tier
820
+ its own. The
821
+ dispatcher's `leafAdmission`, `nodeHasCapacity` and proposer admission defer a
822
+ normal waiter that fits while claims can run; `dispatch` forces that tick's
823
+ admission scan once per deferral key, and `admitDeferredParked` retries the
824
+ deferred admissions through their generic paths only after the scan completed
825
+ its urgent decision.
711
826
  Ticket waits (SPEC §11) span four seams. `cli/terminals.ts` (`waitOn`, routed
712
827
  as `ab wait-on`) appends the agent's terminal `wait.requested`; the build
713
828
  digest marks it pending. The dispatcher's lease-sweep pass validates a pending
@@ -727,7 +842,9 @@ completes with `wait.published`; `serviceWaitRequest` enters the wait only
727
842
  after that. `waitResumeRestackCycle` in the same module is the engine's
728
843
  wait-resume restack predicate, decided ahead of the plan and code loops against
729
844
  `leafBaseInUse` (`kernel/leaf-restack-state.ts`), which target observation
730
- shares. The runner's `restack()` replays published work through the guarded
845
+ shares. `waitResumeReverifies` and `cleanWaitResumeCompletion` decide which
846
+ resumed completions open a new verify cycle (see "Leaf and reconcile restacking").
847
+ The runner's `restack()` replays published work through the guarded
731
848
  automatic restack, fast-forwards an unpublished branch that has no commits the
732
849
  target lacks and no uncommitted tracked changes (`advanceWaitResume`,
733
850
  `restack.advanced`) and otherwise fails without discarding local work, and first supersedes a reconcile occurrence whose session
@@ -763,7 +880,7 @@ dispatch is tolerated. `Ticket.creationKey` is the optional stable external
763
880
  create/adoption correlation, distinct from `Ticket.ref.id`; Linear projects its
764
881
  issue UUID and file/fake preserve their idempotency metadata through create,
765
882
  adoption, get, and list paths. Legacy/plugin tickets may omit it and dispatch
766
- unchanged. The ticket-source port optionally exposes `listPage(criteria, page)` for paged operator reads. PostgreSQL counts matches and applies SQL LIMIT/OFFSET; other sources retain exhaustive-read slicing. CLI and dispatcher reads stay exhaustive. See [ticket source contract](ticket-sources.md#writing-your-own).
883
+ unchanged. The ticket-source port optionally exposes `listPage(criteria, page)` for paged operator reads. PostgreSQL counts matches and applies SQL LIMIT/OFFSET; the remote hosted client forwards pages over the `list-page` ticket operation; other sources retain exhaustive-read slicing. CLI and dispatcher reads stay exhaustive. See [ticket source contract](ticket-sources.md#writing-your-own).
767
884
 
768
885
  The `github` source spans four modules. `ports/tickets/github.ts` is the
769
886
  adapter: REST over the forge's `GitHubRequest` transport and credential order,
@@ -798,7 +915,10 @@ operations fall back to the main checkout when `localPath` is absent.
798
915
  `packages/core/src/ports/workspace/git-worktree.ts` selects the branch-cut base once
799
916
  at first creation, fetching into a build-scoped private ref; re-provisioning
800
917
  resumes at the branch tip, so the first provisioning fact remains immutable
801
- original provenance. A remote workspace lost before its branch is published
918
+ original provenance. Both providers record the verified checked-out commit as
919
+ that base: the worktree's HEAD after creation, and for `vercel-sandbox.ts` the
920
+ guest's HEAD and build branch read back after a fresh checkout or a reuse of a
921
+ completed sandbox. A remote workspace lost before its branch is published
802
922
  can be freshly cut again; the latest `remote` or `local` provisioning base is
803
923
  the fallback review boundary, while `existing` facts only describe resumes.
804
924
  Each implementation terminal in `packages/core/src/cli/terminals.ts` records
@@ -851,7 +971,8 @@ read-only settings/policy inspection, keeping incomplete evidence unknown. Host
851
971
  init validation invokes the configured registry forge outside guest probes.
852
972
  Dispatch inspects after acquiring its repository lease and writes validated
853
973
  `dispatcher.forge-readiness-failed` facts once per run/check for known hard
854
- failures. `kernel/dispatch-status.ts` retains their typed collection across ticks
974
+ failures. `archive-refs` is a recommendation; historical facts naming it still
975
+ decode. `kernel/dispatch-status.ts` retains their typed collection across ticks
855
976
  and reloads; the independent frontend and operator query project the same warnings.
856
977
  `ab watch` follows these repository attention events for external orchestrators.
857
978
  See [setup](setup.md#forge-readiness) for requirements and access guidance.
@@ -906,6 +1027,14 @@ refreshed durable consent/engine eligibility precede any repair. Comparison
906
1027
  normalizes line endings and tolerates provider trimming of surrounding
907
1028
  headline whitespace and trailing body whitespace while preserving the
908
1029
  headline, body content, and squash method.
1030
+ On the same poll of a finished, open leaf, `checkPr` reads forge CI at the PR's
1031
+ live head through the optional `inspectHeadChecks` capability (GitHub: two
1032
+ ETag-conditional REST reads) and compares it with the reduced `ciFailure`
1033
+ already in hand, appending advisory `pr.checks-failed` or `pr.checks-cleared`
1034
+ only on a transition; an unchanged head reads no store rows. A read failure is
1035
+ unknown CI, never a janitor failure. `packages/core/src/kernel/forge-checks.ts`
1036
+ holds the pure classification, the failing-set digest and `currentCiFailure`,
1037
+ the selector every status surface and the attention predicates read.
909
1038
  `packages/core/src/kernel/issue-keywords.ts` composes a build's sealed issue
910
1039
  links into `Closes #N` / `Refs #N` lines, neutralizes closing keywords aimed at
911
1040
  `refs` issues, and places the keyword paragraph before the trailer block; a
@@ -964,8 +1093,10 @@ merge from both completing between polls.
964
1093
 
965
1094
  **Agent runtimes.** `packages/core/src/ports/runner/`: `runtime.ts` (capability-carrying
966
1095
  registry plus boundary validation), `routing.ts` (eager role resolver),
967
- `production.ts` (shipped Claude/Codex/Pi registrations), `codex.ts` (direct
968
- Codex `exec --json` subprocess protocol with native thread resume), `pi.ts` and
1096
+ `production.ts` (shipped Claude/Codex/Pi/Antigravity registrations), `codex.ts` (direct
1097
+ Codex `exec --json` subprocess protocol with native thread resume), `antigravity.ts`
1098
+ (direct `agy` stream-json subprocess, `--conversation` native resume, no
1099
+ one-shot), `pi.ts` and
969
1100
  `pi-rpc.ts` (the local pi CLI prerequisite/auth probe and long-lived headless
970
1101
  RPC protocol, minimum version 0.84.3), `one-shot.ts` (optional tool-free
971
1102
  non-phase completions — slug naming via `packages/core/src/cli/dispatch.ts`, skill-conflict
@@ -1092,7 +1223,14 @@ back to triage and records the requested role and missing parts. The
1092
1223
  `abort.ticket-returned` checkpoint commits the move and comment, then the
1093
1224
  repository `ticket.handed-back` report is appended before abandoned completion;
1094
1225
  once that report exists the dispatcher writes nothing more to the ticket, so it
1095
- is the safe boundary for a subsequent ticket move. Forge close/delete operations are
1226
+ is the safe boundary for a subsequent ticket move. An optimization attempt
1227
+ is the exception: cleanup settles it `aborted` on the node's log (or settles a
1228
+ merged attempt as a merge), skips the label, ticket move, comment,
1229
+ `abort.ticket-returned` checkpoint and `ticket.handed-back` report whatever
1230
+ the requested destination, and appends abandoned completion. The node's
1231
+ rejection sweep later moves the ticket to `tickets.rejectedState` and records
1232
+ `attempt.ticket-rejected` ([landing and
1233
+ settlement](optimization-nodes.md#landing-and-settlement)). Forge close/delete operations are
1096
1234
  optional API 1.2 capabilities so older plugins load but leave cleanup visibly due.
1097
1235
  AgentRunner failure causes and the exhaustion contract fixture are additive
1098
1236
  plugin API 1.3 surfaces; legacy failures without a cause retain permanent-bit
@@ -1354,6 +1492,16 @@ and `ab context` writes them under `$AB_CONTEXT_DIR/assets/`.
1354
1492
  through `repositoryReadFacts`; `processes/dispatcher.ts` retries them under the
1355
1493
  existing repository ownership before intake. This pre-record recovery differs
1356
1494
  from `dispatch.failed`, which completes an already established build.
1495
+ `kernel/ticket-starts.ts` reduces operator single-ticket start requests
1496
+ (`ticket.start-*`) and the durable canonical identities of hosted active builds
1497
+ (`ticket.identity-recorded`) into `repositoryReadFacts`. `operator/ticket-start.ts`
1498
+ is the one request/cancel seam behind `ab start` (`cli/ticket-start.ts`), the
1499
+ `tickets.start` tool and the HTTP start routes. The dispatcher's
1500
+ `honorStartRequests` stage runs twice per tick, for `manual` and `urgent`
1501
+ requests before intake and for `normal` requests after intake and the deferred
1502
+ parked admissions. It admits pending requests through `dispatch()` in its
1503
+ targeted mode, which skips the ready listing and scan checkpoint, budgets each
1504
+ ticket by its request's tier, but keeps every admission gate.
1357
1505
  `kernel/build-creation.ts` derives the keyed canonical slug that the dispatcher and
1358
1506
  the hosted server share. The optional `BuildStore.buildCreationIdentity` port says
1359
1507
  whether a store creates at the exact slug (method absent), at that derived slug for
@@ -1468,10 +1616,12 @@ protection permissions. The fixture creates and deletes temporary branches,
1468
1616
  PRs, comments, and a required-check protection rule; it never pushes to or
1469
1617
  merges into the default branch. Use a dedicated scratch repository only.
1470
1618
 
1471
- The deterministic Claude, Codex, and Pi adapter contracts run offline in every
1472
- normal test run. Their live registrations add real transport/authentication smoke
1473
- coverage for successful start, continue, end, environment refresh, managed CLI
1474
- execution, and one-shot completion:
1619
+ The deterministic Claude, Codex, Pi, and Antigravity adapter contracts run
1620
+ offline in every normal test run. Their live registrations add real
1621
+ transport/authentication smoke coverage for successful start, continue, end,
1622
+ environment refresh, managed CLI execution, and one-shot completion where the
1623
+ runtime declares it. Antigravity declares no one-shot, so its live run skips
1624
+ that block:
1475
1625
 
1476
1626
  ```sh
1477
1627
  AB_RUN_LIVE_PORT_CONTRACTS=1 \
@@ -1485,6 +1635,10 @@ bun test packages/core/src/ports/runner/codex.live.integration.test.ts
1485
1635
  AB_RUN_LIVE_PORT_CONTRACTS=1 \
1486
1636
  AB_PI_CONTRACT_MODEL=openai/gpt-… \
1487
1637
  bun test packages/core/src/ports/runner/pi.live.integration.test.ts
1638
+
1639
+ AB_RUN_LIVE_PORT_CONTRACTS=1 \
1640
+ AB_ANTIGRAVITY_CONTRACT_MODEL=gemini-… \
1641
+ bun test packages/core/src/ports/runner/antigravity.live.integration.test.ts
1488
1642
  ```
1489
1643
 
1490
1644
  Claude uses the locally installed Claude Code CLI and its configured login; the
@@ -1561,7 +1715,11 @@ process-scoped (`kernel/guarded-forge.ts`) and record only
1561
1715
  `forge.credential-limited`; the `dispatcher.forge-degraded` admission remains
1562
1716
  for runners pinned to older releases. This exception grants no repository administration,
1563
1717
  recovery, lease, or other journal writes. The agent-visible build-scoped Store
1564
- still denies repository writes. Ticket routes deny build grants and allow harvest grants only the reads and
1718
+ still denies repository writes. A build-judge grant, issued only by its
1719
+ build's runner after `panel.judge-started`, is write-only: the request guard
1720
+ refuses every read before any other route logic and admits one
1721
+ `panel.preferred` for its exact panel, judge and session while that session is
1722
+ open. Ticket routes deny build grants and allow harvest grants only the reads and
1565
1723
  runner filing operations they require. Ticket sources and assets are partitioned
1566
1724
  by the authenticated project.
1567
1725
 
@@ -1679,6 +1837,9 @@ compatibility facade. Metadata is excluded from hosted persistence/protocols.
1679
1837
 
1680
1838
  The product dispatcher owns the workspace-free node lifecycle:
1681
1839
  spec → node.opening → node.opened → collecting → complete → verify:* → consent → merge.
1840
+ An optimization node measures its starting value after opening and then
1841
+ repeats propose → collecting: an `ab-propose` session deposits proposals and
1842
+ the dispatcher files each as an attempt ticket targeting the node.
1682
1843
  The ordinary work pipeline is unchanged. `build.created` freezes kind, target
1683
1844
  ticket/build identity and resolved parent in `baseBranch`. Integration facts
1684
1845
  are projected by the shared reducer and digests, including collecting/empty
@@ -1716,11 +1877,27 @@ fetch of only that exact archive ref (without tags, configured refmap expansion
1716
1877
  depth limit) restores missing commits and their missing ancestry, writes no shallow
1717
1878
  boundary, leaves an already-shallow repository's existing boundaries unchanged, and
1718
1879
  verifies the commits locally before returning.
1880
+ `kernel/history-retention.ts` retains leaf history best effort: the archive ref
1881
+ where the forge accepts it, else a `history-objects-<sha>` BuildStore thin pack
1882
+ excluding the frozen target base (`kernel/replay-retention.ts`), else one
1883
+ build-scoped `history-unretained` observation; `history.retained` records store,
1884
+ target and unretained commits. Its readers restore from the local repository,
1885
+ the archive ref, store copies, then the published branches, and a commit
1886
+ retained nowhere redoes the work (`<id>-redo`, or candidate retirement). A
1887
+ refusal is a plain error; `ArchiveConflictError` (an immutable ref naming a
1888
+ different SHA) and classified transient failures never fall back. Node writes
1889
+ use the same order and record `node.history-retained`; node recovery restores
1890
+ reserved inputs before reading them and abandons a reservation whose inputs are
1891
+ kept nowhere. Workspace preservation (`preserveRetained`, `retainPreservedCopy`)
1892
+ is strict: archive ref, else store copy, else release is refused; a reused copy
1893
+ keeps its saved base, which preservation retains in turn and
1894
+ `restoreRetainedHead` follows to a bounded depth.
1719
1895
  GitHub uses explicit Git transport leases; local-git uses shared-database
1720
1896
  `update-ref` CAS without network calls. Exact authoritative readback acknowledges
1721
1897
  publication. Remote-backed local refs are caches refreshed without expected-old
1722
- CAS after confirmation, even if absent or recreated; checkout files are untouched. Trusted remote publication archives before
1723
- replacement after guest teardown; it never uses ordinary append-only publication
1898
+ CAS after confirmation, even if absent or recreated; checkout files are untouched. Trusted remote publication retains history before
1899
+ replacement after guest teardown, through the kernel's `retain` callback over the
1900
+ provider's Git transport; it never uses ordinary append-only publication
1724
1901
  for restacks. Prepared, replayed, intended and rewritten facts support recovery.
1725
1902
  A contended rewrite preserves the observed work and retries on the same base.
1726
1903
 
@@ -1736,17 +1913,29 @@ uncommitted tracked changes; a wait
1736
1913
  declared by an unintended reconcile occurrence on a moved target first abandons
1737
1914
  that occurrence with `reconcile.superseded`, then replays onto the new target
1738
1915
  (see Ticket waits above). `reconcile-restack.ts` shares collapse, detached replay,
1739
- archive-before-replacement and expected-head publication mechanics. Automatic
1916
+ retain-before-replacement and expected-head publication mechanics. Automatic
1740
1917
  transactions emit `restack.*`; clean completion never starts a reconcile cycle.
1741
1918
  Pre-PR conflicts adopt the prepared replay through ordinary reconcile. Initial
1742
1919
  verification remains mandatory; waiting conflicts use post-reconcile policy.
1920
+ A conflict confined to `[[generated]]` files is first regenerated in the runner:
1921
+ `kernel/generated-files.ts` classifies conflicted paths by declaration,
1922
+ `kernel/generated-regeneration.ts` runs the commands on the reproduced conflict
1923
+ and commits or restores it, and `reconcile-restack.ts` (leaf) and the build
1924
+ runner's node-conflict path (node items) record `restack.regenerated` and
1925
+ `node.item-regenerated`. The engine reads only those facts.
1743
1926
 
1744
1927
  The dispatcher observes targets without changing workspaces; execution ownership
1745
1928
  and session settlement fence mutation. Transaction targets stay frozen while
1746
1929
  later moves coalesce. `publication.requested` carries automatic transaction
1747
1930
  identity through trusted remote teardown and publication. The runner settles
1748
1931
  local resolver intent only after its session ends. Verification facts
1749
- cite the cycle's base/head. Clean waiting leaf rewrites preserve completed
1932
+ cite the cycle's base/head (`leafVerifiedRestack` in `kernel/verify-stages.ts`).
1933
+ A clean wait-resume `restack.completed` for a wait declared in `verify:*` or
1934
+ `finalize` is a verify cycle boundary: the log index records it as
1935
+ `waitResumeVerifyBoundary`, the reducer moves `verify.cycleSince`, and the
1936
+ engine's stage selection and cycle boundary both read it through
1937
+ `leafVerifyCycleInputs`. It is not a replay boundary, so the verify-entry
1938
+ restack does not run again. Clean awaiting-merge leaf rewrites preserve completed
1750
1939
  verification when build-owned config is unchanged, even when the old pin commit
1751
1940
  is no longer an ancestor. Changed config still supersedes while waiting.
1752
1941
  Ancestry gates cycles that run further steps; those cycles capture fresh config.
@@ -1881,7 +2070,13 @@ fast-forward shape against the frozen parent. Exact authoritative head readback
1881
2070
  or a durable confirmed receipt establishes publication; ancestry alone cannot
1882
2071
  acknowledge an unconfirmed candidate. Shared status vocabulary exposes provenance
1883
2072
  and mismatch attention in both frontends. Human forge merges remain observable
1884
- escape hatches independent of completeness and verification.
2073
+ escape hatches independent of completeness and verification. A recorded
2074
+ `integration.landed` ends node verification: `integrationAdmissible` and
2075
+ `decideNext` stop preparation and runner work, the session bracket and stage
2076
+ loop cancel agent members through their existing subscriptions, and `checkPr`
2077
+ withdraws a live verifier lease so the runner's next heartbeat aborts a running
2078
+ check. Settlement waits for the open execution to end. Preparation also skips a
2079
+ node whose comparison is empty.
1885
2080
 
1886
2081
  ### Merge authorization
1887
2082
 
@@ -2028,12 +2223,15 @@ polls read no receipts or event rows.
2028
2223
 
2029
2224
  A historical `publication.lost` does not prove that every copy of its candidate
2030
2225
  is gone. Recovery checks the exact branch and private archive refs and retained
2031
- replay objects first. An available candidate continues guarded publication.
2032
- A genuinely missing reconcile or automatic restack candidate records
2226
+ store copies first. Replay copies are read in either format (chunked manifest or
2227
+ legacy base64 pack); a thin pack whose base is missing fetches the published target
2228
+ first and applies with `git index-pack --fix-thin`. An available candidate is
2229
+ retained best effort before guarded publication continues; a refused archive does
2230
+ not block it. A genuinely missing reconcile or automatic restack candidate records
2033
2231
  `publication.candidate-retired`, abandons its obsolete request, and replays the
2034
2232
  producing operation with a fresh transaction identity. Its frozen target,
2035
2233
  reconcile occurrence or automatic trigger, cycle, and message survive. The
2036
- retired candidate is excluded from archive requirements unless independently
2234
+ retired candidate is excluded from retention requirements unless independently
2037
2235
  required by proven history. This reconstruction consumes no infrastructure
2038
2236
  attempt and no additional conflict occurrence; it needs no operator guidance.
2039
2237
  A bare retry also clears an existing infrastructure-limit escalation through
@@ -2090,6 +2288,11 @@ clears the attention, closes the escalation unanswered and the build continues.
2090
2288
  Answering it with a bare retry makes the janitor attempt on its next tick. An
2091
2289
  episode raises at most one escalation; a new episode after recovery can raise
2092
2290
  another. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
2291
+ A pending control the janitor can act on wakes it during backoff: an abort, a
2292
+ pause, a resume of a paused build, a queued discard or an unacknowledged landing
2293
+ command. A leaf's resume that only cancelled a never-acknowledged pause is not
2294
+ one and waits out the backoff; a node's janitor acknowledges every pending
2295
+ control itself, so any node command wakes it.
2093
2296
  A dispatcher that cannot execute Git for kernel node work (a missing or
2094
2297
  unloadable `git` for the bare clone) records no janitor failures. It records
2095
2298
  one durable `dispatcher.kernel-git-unavailable` repository condition, node work
@@ -2098,6 +2301,25 @@ succeeds.
2098
2301
 
2099
2302
  A rate limit the dispatcher classifies on its own authenticated request
2100
2303
  records repository degradation with `resetAt`.
2304
+ The built-in GitHub forge also treats a successful response, 304 included,
2305
+ that reports `x-ratelimit-remaining: 0` with a future reset at most 65 minutes
2306
+ away (one hour plus five minutes of clock skew) as that quota's limit.
2307
+ The response keeps its result, and the process's next
2308
+ request for the same quota (`core`, `graphql`, …) fails as that rate limit
2309
+ without being sent, so cooldown follows the rules here without an avoidable
2310
+ refusal. Other quotas are unaffected. A missing, malformed, past or
2311
+ implausible reset enters no cooldown, and no later response clears one early:
2312
+ only the reset passing, or an explicit `forge-clear`, does. After a clear, the
2313
+ next request goes to GitHub as a probe, and an actual limit restores the
2314
+ cooldown.
2315
+ The first limit of an episode records an ordinary `dispatcher.forge-degraded`,
2316
+ which wakes `ab watch` once. A later reset inside the unexpired episode extends
2317
+ the cooldown durably as a degradation marked `continued` that wakes nothing; an
2318
+ equal or earlier reset writes nothing. A limit after the reset has passed, or
2319
+ after recovery, opens a new episode. A rate-limited or unreadable response on
2320
+ landing, gate inspection or PR polling is a typed forge failure or an unproven
2321
+ state, never "no checks", "ungated", "closed" or "merged"; merge-freshness
2322
+ inspection defers instead of recording best-effort evidence.
2101
2323
  Forge work waits during cooldown; passing the deadline permits a recovery
2102
2324
  request; a successful probe records automatic recovery. An authorized operator
2103
2325
  may explicitly override erroneous recorded state with
@@ -2151,7 +2373,15 @@ using exact-resource ETags; authenticated 304s spare the REST primary quota.
2151
2373
  Adapter caches are bounded and restart/eviction falls back to fresh reads.
2152
2374
  Writes, including Git publication and rewrites, invalidate observations before
2153
2375
  attempting the mutation so acknowledgement reads remain fresh. Leaf PR polling
2154
- keeps its existing cadence. Readiness and merge inspections remain fresh.
2376
+ keeps its existing cadence. Gate branch and rules reads, merge-freshness
2377
+ protection and rulesets, landing, retarget and auto-merge PR reads, commit and
2378
+ history reads, merge-queue activity, summary-comment listing and branch
2379
+ existence revalidate the same way. Both caches hold the raw representation and
2380
+ every caller validates it with its own schema, so consumers of one resource
2381
+ share one request and one ETag; a representation that fails validation loses
2382
+ its ETag. Reads that must be fresh, including merge inspections, still reach
2383
+ GitHub every time, conditionally when an ETag is cached. Readiness diagnostics
2384
+ and post-mutation readbacks stay unconditional.
2155
2385
 
2156
2386
  For node cadence, durable wakes, restart behavior and CLI evidence, see
2157
2387
  [node polling and status](integration-tree.md#polling-and-status).
@@ -2162,6 +2392,18 @@ primary quota, REST 304s and GraphQL calls. Transport failures and historical or
2162
2392
  legacy observations can remain unclassified; absent fields never imply zero.
2163
2393
  Shared requests are attributed to their first requester; cache hits count zero.
2164
2394
 
2395
+ An adapter may also report the primary rate-limit headers a response carried
2396
+ (`resource`, `limit`, `remaining`, `resetAt`), including on 304s and limited
2397
+ failures; GitHub does. No extra `/rate_limit` request is made. Tick telemetry's
2398
+ optional `rateLimits` carries the latest reading per resource with its
2399
+ `observedAt`, at most eight resources and none older than a day, across ticks
2400
+ and dispatcher restarts, so a cooldown tick with no requests still reports the
2401
+ last known quota. Secondary limits carry no headers and appear only as the
2402
+ degradation. `ab repository status` shows them as `forgeRateLimit`: each
2403
+ reading, `stale` once its window has reset (current quota unknown), and
2404
+ `paused`/`pausedUntil` while the dispatcher's rate-limit cooldown holds forge
2405
+ landing and polling. Absent fields mean unknown, never full quota.
2406
+
2165
2407
  Ticket-source continuity is reduced by `kernel/ticket-migrations.ts` from durable
2166
2408
  repository `tickets.migration-recorded` facts. Import publishes only complete
2167
2409
  mappings; current-operation resolvers leave build records and old events intact.
@@ -2193,7 +2435,8 @@ pending controls, merge intent and ended PRs refuse the no-escalation path.
2193
2435
  A concurrent state change refuses publication with a retry explanation;
2194
2436
  uncited artifacts are inert. Leaves still require an open escalation and
2195
2437
  restart from `plan` after any unfinished reconcile resumes under the revised
2196
- spec and its publication is confirmed.
2438
+ spec and its publication is confirmed. A settled, unmerged leaf awaiting merge
2439
+ revises without an escalation through `ab reopen`.
2197
2440
 
2198
2441
  Verification stages are planned purely in `kernel/verify-stages.ts`, shared by
2199
2442
  leaf and integration decisions in `kernel/engine.ts`. The build runner keeps
package/docs/builds.md CHANGED
@@ -27,6 +27,8 @@ To change the contract, your operator agent answers an escalation with a revised
27
27
  bun ab answer <slug> --revise-spec revised-spec.md
28
28
  ```
29
29
 
30
+ A finished build waiting for its merge decision has no open escalation; `bun ab reopen <slug> --revise-spec revised-spec.md` revises it and restarts from planning on the same PR.
31
+
30
32
 
31
33
  ## Produce, then review
32
34
 
@@ -84,5 +86,8 @@ After finalize, Autobuild watches the destination until the PR merges or closes:
84
86
 
85
87
  - **Clean restack** onto a newer base is automatic; no agent runs.
86
88
  - **Conflicted replay** enters `reconcile`: an agent resolves the kernel-prepared change on a frozen refreshed base, then post-reconcile verification runs.
89
+ - **Generated-only conflict** — every conflicted path declared in `[[generated]]` — is first regenerated by its declared commands, with no agent session; a resolved replay then follows the clean-restack rules. A failed regeneration commits nothing and falls back to an ordinary reconcile. See [generated-file conflicts](restacking.md#generated-file-conflicts).
90
+
91
+ - **Reopen** sends a finished, unmerged build back into the pipeline when review asks for changes: `bun ab reopen <slug> --feedback <text>` re-enters implementation, and a spec revision re-enters planning. The branch and PR are kept, consent is revoked, and the build merges only after finalize runs again. A merged or closed PR needs a new ticket. See [Operating](operating.md#send-a-finished-build-back).
87
92
 
88
93
  See [integrating related work](integration-overview.md#one-identity-per-leaf-change) for replay details and the [dispatcher guide](dispatcher.md) for how builds run and resume.
package/docs/cli.md CHANGED
@@ -33,11 +33,15 @@ Run `bun ab <command>`; `bun ab help <command>` lists flags and subcommands. See
33
33
  - `mcp` — Serve the operator tools over stdio.
34
34
  - `pause` — Request a build or repository pause.
35
35
  - `resume` — Resume a paused build or repository.
36
+ - `start` — Ask the running dispatcher to start one ticket, even while intake is off. See [Operating](operating.md).
36
37
  - `answer` — Answer escalations or request a retry.
37
38
  - `abort` — Request irreversible build termination and cleanup.
38
39
  - `restack` — Request a node restack onto its current parent.
40
+ - `priority` — Set an active build's slot-admission priority: urgent or normal.
41
+ - `objective` — Show, revise or stop an optimization node's objective and progress.
39
42
  - `hold` — Hold a merge, withdrawing consent.
40
43
  - `merge` — Consent to a ready merge.
44
+ - `reopen` — Send a finished, unmerged build back to implement with feedback, or to plan with a revised spec.
41
45
  - `models` — Search Pi's model catalog.
42
46
  - `plugin` — Inspect, diagnose, and contract-test adapters.
43
47
  - `context` — Materialize the current phase's inputs.
@@ -48,9 +52,11 @@ Run `bun ab <command>`; `bun ab help <command>` lists flags and subcommands. See
48
52
  - `verdict` — Complete a review or verification phase.
49
53
  - `escalate` — Park the build with a question for external judgment.
50
54
  - `wait-on` — Park the build on other tickets without holding a slot; it ends when the tickets complete or an operator answers.
55
+ - `propose` — Complete an optimization node's propose phase with typed proposals, or none with a reason; the dispatcher files them as attempts.
51
56
  - `harvest` — Inspect or drive observation harvesting.
57
+ - `judge` — Read a judge panel session's context and record its one preference.
52
58
 
53
- Phase commands (`context`, `done`, `verdict`) use runner-scoped session authority: the runner starts phase agents, never your operator agent. See [Skills](skills.md).
59
+ Phase and judge commands (`context`, `done`, `verdict`, `propose`, `judge`) use runner-scoped session authority: the runner starts phase agents, never your operator agent. See [Skills](skills.md).
54
60
 
55
61
 
56
62
  Permanent hosted data removal is available on the web app's Projects page to
@@ -36,6 +36,7 @@ skill = "verify-acceptance" # repository-authored skill
36
36
  - **Verify**: command checks and agent verifiers. A build's plan selects optional steps.
37
37
  - **Finalize** post-steps run after PR creation, e.g. a changelog update. A failed post-step is recorded without failing a green build.
38
38
  - These are the only extension points; configuration can't add or reorder phases.
39
+ - **Generated files**: `[[generated]]` entries pair checked-in generated files with the command that rebuilds them. A restack whose conflicts are all in those files is regenerated by the command instead of an agent.
39
40
 
40
41
  See the [verification guide](verification.md).
41
42