@defrex/autobuild 1.9.0 → 1.11.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 (537) hide show
  1. package/README.md +3 -3
  2. package/SPEC.md +2232 -175
  3. package/bin/ab-dispatch-generation.ts +5 -1
  4. package/docs/accounts.md +2 -1
  5. package/docs/agent-runtimes.md +30 -3
  6. package/docs/answering-blocked-builds.md +35 -7
  7. package/docs/architecture.md +436 -63
  8. package/docs/build-store.md +10 -7
  9. package/docs/builds.md +5 -0
  10. package/docs/cli.md +40 -2
  11. package/docs/configuration-overview.md +5 -1
  12. package/docs/configuration.md +649 -74
  13. package/docs/dispatcher.md +79 -6
  14. package/docs/forges.md +8 -1
  15. package/docs/getting-started.md +1 -1
  16. package/docs/integration-overview.md +4 -2
  17. package/docs/integration-tree.md +102 -11
  18. package/docs/merge-policy.md +30 -14
  19. package/docs/migration-1.0.md +2 -1
  20. package/docs/operating.md +36 -6
  21. package/docs/operator-api.md +251 -20
  22. package/docs/operator-surfaces.md +85 -0
  23. package/docs/optimization-nodes.md +1100 -0
  24. package/docs/overview.md +1 -1
  25. package/docs/plugin-authoring.md +83 -13
  26. package/docs/remote-store-protocol.md +137 -17
  27. package/docs/remote-ticket-protocol.md +90 -2
  28. package/docs/restacking.md +119 -15
  29. package/docs/seams.md +2 -2
  30. package/docs/setup.md +27 -4
  31. package/docs/skills.md +4 -2
  32. package/docs/spec-standard.md +2 -1
  33. package/docs/ticket-dependencies.md +15 -3
  34. package/docs/ticket-migration.md +4 -2
  35. package/docs/ticket-sources.md +54 -14
  36. package/docs/tickets.md +21 -6
  37. package/docs/troubleshooting.md +11 -2
  38. package/docs/verification.md +15 -3
  39. package/docs/workspaces.md +6 -1
  40. package/package.json +9 -5
  41. package/packages/core/src/accounts/chatgpt-oauth.ts +7 -5
  42. package/packages/core/src/cli/accounts.ts +7 -2
  43. package/packages/core/src/cli/attempt.ts +103 -0
  44. package/packages/core/src/cli/attention.ts +11 -2
  45. package/packages/core/src/cli/binary-direct.ts +54 -1
  46. package/packages/core/src/cli/binary-lifecycle.ts +2 -1
  47. package/packages/core/src/cli/binary.ts +5 -3
  48. package/packages/core/src/cli/build-control.ts +407 -67
  49. package/packages/core/src/cli/context.ts +272 -15
  50. package/packages/core/src/cli/dashboard/detail.ts +26 -2
  51. package/packages/core/src/cli/dashboard/facts.ts +89 -56
  52. package/packages/core/src/cli/dashboard/header.ts +101 -0
  53. package/packages/core/src/cli/dashboard/integration-detail.ts +7 -2
  54. package/packages/core/src/cli/dashboard/landing-display.ts +15 -2
  55. package/packages/core/src/cli/dashboard/model.ts +133 -66
  56. package/packages/core/src/cli/dashboard/objective-row.ts +221 -0
  57. package/packages/core/src/cli/dashboard/poll.ts +178 -76
  58. package/packages/core/src/cli/dashboard/render.ts +172 -227
  59. package/packages/core/src/cli/dashboard/reopen-display.ts +39 -0
  60. package/packages/core/src/cli/dashboard/row-text.ts +538 -0
  61. package/packages/core/src/cli/dashboard/timeline.ts +288 -0
  62. package/packages/core/src/cli/dashboard/tree.ts +12 -1
  63. package/packages/core/src/cli/dashboard/vocabulary.ts +188 -0
  64. package/packages/core/src/cli/dispatch-args.ts +44 -1
  65. package/packages/core/src/cli/dispatch-frontend.ts +29 -30
  66. package/packages/core/src/cli/dispatch-launch-stop.ts +73 -0
  67. package/packages/core/src/cli/dispatch-launcher.ts +41 -46
  68. package/packages/core/src/cli/dispatch-repository-feed.ts +1 -1
  69. package/packages/core/src/cli/dispatch-web.ts +155 -0
  70. package/packages/core/src/cli/dispatch.ts +216 -38
  71. package/packages/core/src/cli/env.ts +42 -0
  72. package/packages/core/src/cli/help.ts +293 -12
  73. package/packages/core/src/cli/init-agent.ts +4 -1
  74. package/packages/core/src/cli/init-readiness-remote.ts +3 -2
  75. package/packages/core/src/cli/init-validation.ts +5 -5
  76. package/packages/core/src/cli/init.ts +3 -2
  77. package/packages/core/src/cli/judge-entry.ts +82 -0
  78. package/packages/core/src/cli/judge.ts +233 -0
  79. package/packages/core/src/cli/landings.ts +3 -2
  80. package/packages/core/src/cli/main.ts +481 -148
  81. package/packages/core/src/cli/mcp.ts +35 -3
  82. package/packages/core/src/cli/measurement-text.ts +19 -0
  83. package/packages/core/src/cli/objective.ts +154 -0
  84. package/packages/core/src/cli/operator-preference.ts +57 -0
  85. package/packages/core/src/cli/publication-settlement.ts +106 -22
  86. package/packages/core/src/cli/repo-lease.ts +3 -0
  87. package/packages/core/src/cli/repo-state.ts +56 -6
  88. package/packages/core/src/cli/repository-status.ts +205 -56
  89. package/packages/core/src/cli/status.ts +275 -16
  90. package/packages/core/src/cli/store-opening.ts +4 -0
  91. package/packages/core/src/cli/terminal-restore.ts +32 -7
  92. package/packages/core/src/cli/terminals.ts +205 -8
  93. package/packages/core/src/cli/ticket-start.ts +53 -0
  94. package/packages/core/src/cli/ticket.ts +166 -38
  95. package/packages/core/src/cli/upgrade-agent.ts +12 -8
  96. package/packages/core/src/cli/wait.ts +22 -8
  97. package/packages/core/src/cli/watch.ts +361 -95
  98. package/packages/core/src/cli/web.ts +139 -0
  99. package/packages/core/src/config/create-labels.ts +23 -0
  100. package/packages/core/src/config/live.ts +101 -14
  101. package/packages/core/src/config/load.ts +61 -20
  102. package/packages/core/src/config/local.ts +212 -0
  103. package/packages/core/src/config/pipeline-source.ts +3 -3
  104. package/packages/core/src/config/reference.ts +18 -0
  105. package/packages/core/src/config/roles.ts +182 -73
  106. package/packages/core/src/config/schema.ts +157 -19
  107. package/packages/core/src/events/catalog.ts +43 -3
  108. package/packages/core/src/events/compatibility.ts +7 -1
  109. package/packages/core/src/events/payloads.ts +685 -1
  110. package/packages/core/src/events/policy.ts +63 -0
  111. package/packages/core/src/events/repository.ts +153 -27
  112. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +1797 -199
  113. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/017d8dd5bb6dd80b.json.gz +0 -0
  114. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/0ab2a90d0305dc9d.json.gz +0 -0
  115. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/10a4657408d4e121.json.gz +0 -0
  116. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1152a2e97ee81728.json.gz +0 -0
  117. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/13ca84752c5f8b54.json.gz +0 -0
  118. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1411d1cdbdd9911e.json.gz +0 -0
  119. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1444fe1fa7fc802c.json.gz +0 -0
  120. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1491ac0600349391.json.gz +0 -0
  121. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/178e12f1759b7552.json.gz +0 -0
  122. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1921f86f752428c9.json.gz +0 -0
  123. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/1972c1d66008ef6b.json.gz +0 -0
  124. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/19e8e43e7f3f1a06.json.gz +0 -0
  125. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/20a85c143c3e8164.json.gz +0 -0
  126. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/21ce2c0bf58318e1.json.gz +0 -0
  127. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/293dcb3a94fb3470.json.gz +0 -0
  128. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2ab7436356267118.json.gz +0 -0
  129. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/2d084641735caaff.json.gz +0 -0
  130. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3237bcecf68e5db9.json.gz +0 -0
  131. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/33d0cc593610e56f.json.gz +0 -0
  132. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3451ed2136dcc356.json.gz +0 -0
  133. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/358ec8693f2237e6.json.gz +0 -0
  134. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/35cf9ccc4478b2d2.json.gz +0 -0
  135. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3649e7bd1203f154.json.gz +0 -0
  136. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/378da6dece82202a.json.gz +0 -0
  137. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/38c75099d9191471.json.gz +0 -0
  138. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/398952f1f01db1a3.json.gz +0 -0
  139. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3b64d352d56c9121.json.gz +0 -0
  140. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/3dc486226c05372d.json.gz +0 -0
  141. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/431c9bb2ee8838e0.json.gz +0 -0
  142. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4400dffca929e2f0.json.gz +0 -0
  143. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/49064fc079964a5c.json.gz +0 -0
  144. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4932c70a2af97faf.json.gz +0 -0
  145. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4edded75f17742f4.json.gz +0 -0
  146. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4f00c0f2c8afd159.json.gz +0 -0
  147. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516a5a7aadf97587.json.gz +0 -0
  148. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/516dc6ea85d67cd7.json.gz +0 -0
  149. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/536085773daf6b58.json.gz +0 -0
  150. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/584e2ba74608e051.json.gz +0 -0
  151. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/59ffaa6974094c72.json.gz +0 -0
  152. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5bb43afb121674c6.json.gz +0 -0
  153. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/5f0ca42af862c4ee.json.gz +0 -0
  154. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6118031132db9bfc.json.gz +0 -0
  155. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63107a8d58776b63.json.gz +0 -0
  156. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/63546b08d4d6fa11.json.gz +0 -0
  157. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/643d70429ce03dad.json.gz +0 -0
  158. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/677ea92572c29082.json.gz +0 -0
  159. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6ae5bf60504d6467.json.gz +0 -0
  160. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6bd6275061aaffa5.json.gz +0 -0
  161. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6efdc8defc75fccb.json.gz +0 -0
  162. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/71c53d33f09d8204.json.gz +0 -0
  163. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7267ca2757cffba7.json.gz +0 -0
  164. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/76b7d4244082b3f9.json.gz +0 -0
  165. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7749f918c6f10968.json.gz +0 -0
  166. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7833e42d16301424.json.gz +0 -0
  167. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/7d4edad0614adaf1.json.gz +0 -0
  168. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/837365898d04f45a.json.gz +0 -0
  169. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/85f9f0c921b8b5bb.json.gz +0 -0
  170. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8879f57a24733897.json.gz +0 -0
  171. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/88cb9e71bdec972d.json.gz +0 -0
  172. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/89625654b02e9ac1.json.gz +0 -0
  173. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8a0cd6dd06cc155e.json.gz +0 -0
  174. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8aa9ca8609dc051d.json.gz +0 -0
  175. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8c8640255bd61658.json.gz +0 -0
  176. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8cc15eb1807c0157.json.gz +0 -0
  177. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8ced97c44bc0af3a.json.gz +0 -0
  178. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8d4144004720b9f8.json.gz +0 -0
  179. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8db633ead1807f8b.json.gz +0 -0
  180. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/8e42cdbd0994ab0c.json.gz +0 -0
  181. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9011d0f6ff955ef9.json.gz +0 -0
  182. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/916ebc5433801c41.json.gz +0 -0
  183. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9539b995af5c54a9.json.gz +0 -0
  184. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/95f391bfd7b7dbd7.json.gz +0 -0
  185. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9613e8fa568a9281.json.gz +0 -0
  186. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9a68f8753bd9038d.json.gz +0 -0
  187. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9b25e58227080094.json.gz +0 -0
  188. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/9ee3919fbd4f9458.json.gz +0 -0
  189. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a04a34cc2717147b.json.gz +0 -0
  190. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a0b32c12e4e6edb6.json.gz +0 -0
  191. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a55218252707bdd3.json.gz +0 -0
  192. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a732fd08b31522a6.json.gz +0 -0
  193. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a98af134be2da8a9.json.gz +0 -0
  194. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a9d206a01f9039e5.json.gz +0 -0
  195. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/abf7fe3c92c82f2d.json.gz +0 -0
  196. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ac928b04842c00db.json.gz +0 -0
  197. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/af953392d81911da.json.gz +0 -0
  198. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0d877c44810ecb0.json.gz +0 -0
  199. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b0f7c6ebb2db57fc.json.gz +0 -0
  200. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/b905c22ec17eed31.json.gz +0 -0
  201. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/bce0c54e865f4b79.json.gz +0 -0
  202. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c68b7ee2e2610f30.json.gz +0 -0
  203. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c7f7e0378aeea237.json.gz +0 -0
  204. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/c98cb1659eb142b6.json.gz +0 -0
  205. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ca830adf06ed55a1.json.gz +0 -0
  206. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cb3a219f33e437ca.json.gz +0 -0
  207. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/cf1e0c0d82567e0c.json.gz +0 -0
  208. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d008d86d9ff77b30.json.gz +0 -0
  209. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d1432a819d8e48c5.json.gz +0 -0
  210. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d185ed6aa9192aff.json.gz +0 -0
  211. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d5d5ccca80a893d8.json.gz +0 -0
  212. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d873fad29d6c7e55.json.gz +0 -0
  213. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/db84b12316e2da4a.json.gz +0 -0
  214. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ddf6dc967d898767.json.gz +0 -0
  215. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/dfc64de6e7bfc0a0.json.gz +0 -0
  216. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e2f18fa32fe1f6d0.json.gz +0 -0
  217. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e37393fed29e84c5.json.gz +0 -0
  218. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e6a8585e2a054ff6.json.gz +0 -0
  219. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e7e9e327baca6903.json.gz +0 -0
  220. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/e86447af0571672c.json.gz +0 -0
  221. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ea819202d22122e5.json.gz +0 -0
  222. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb4535585f2e84f6.json.gz +0 -0
  223. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eb7ddd5319d09e27.json.gz +0 -0
  224. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/eca4959b2b87ae15.json.gz +0 -0
  225. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ee10d7959ec4843c.json.gz +0 -0
  226. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/ef1b68347966ab26.json.gz +0 -0
  227. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f3e55425cc41f230.json.gz +0 -0
  228. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f40042c1cdb9fd43.json.gz +0 -0
  229. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f48466215c790a3f.json.gz +0 -0
  230. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f5b9ace9b59351e7.json.gz +0 -0
  231. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f8155387eb5f375c.json.gz +0 -0
  232. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fa8f1475a55be935.json.gz +0 -0
  233. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fb21116a15d0b1f1.json.gz +0 -0
  234. package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/fe95444fbeabe592.json.gz +0 -0
  235. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/09bf0a1611d07363.json +984 -0
  236. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/10eac4988d66e161.json +1067 -0
  237. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/1a436b5fb45aee3e.json +1116 -0
  238. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/249db6f7a41f90e2.json +161 -0
  239. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/25dcb2fb6eaa83f4.json +858 -0
  240. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/2e1bdc763924616f.json +4932 -0
  241. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/30e9dabce3c4263d.json +399 -0
  242. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/3c27f918b194e3b3.json +465 -0
  243. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/4898ef339c68fa36.json +83 -0
  244. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/51816c0ffa62af6e.json +417 -0
  245. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/561bf45320062a44.json +83 -0
  246. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5672d0233085d050.json +84 -0
  247. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/5e39f42cbdbf35ef.json +163 -0
  248. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/7771a7a2250f9964.json +868 -0
  249. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/79f0e0f4ccd43ba2.json +455 -0
  250. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/859c09edac738823.json +1086 -0
  251. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/881c491321bec99a.json +1074 -0
  252. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/965f25c3af1d2cdc.json +160 -0
  253. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9b76d89da575ca90.json +20 -0
  254. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9eb485320a72a9ff.json +233 -0
  255. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a283c1f3462b1cc1.json +81 -0
  256. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a60448c01016135e.json +18 -0
  257. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a6584fb61b6679bd.json +97 -0
  258. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a6e570fb126991ff.json +36 -0
  259. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a8acf22c968b6e3d.json +81 -0
  260. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/ba7b85895bf6698e.json +1153 -0
  261. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c88365c25b3186d3.json +543 -0
  262. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e8f0481b23f90056.json +711 -0
  263. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/ee55782ed40ebbac.json +110 -0
  264. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fc5082fac8167f3d.json +98 -0
  265. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fc66408cde0b6b04.json +637 -0
  266. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fd55c329cfe921cc.json +1069 -0
  267. package/packages/core/src/kernel/attempt-creation-key.ts +20 -0
  268. package/packages/core/src/kernel/attempt-settlement.ts +125 -0
  269. package/packages/core/src/kernel/auto-merge-default.ts +1 -3
  270. package/packages/core/src/kernel/auto-merge.ts +1 -3
  271. package/packages/core/src/kernel/build-roster.ts +230 -0
  272. package/packages/core/src/kernel/dispatch-capacity.ts +316 -40
  273. package/packages/core/src/kernel/dispatch-placement.ts +1 -1
  274. package/packages/core/src/kernel/dispatch-settings.ts +1 -4
  275. package/packages/core/src/kernel/dispatch-status.ts +3 -5
  276. package/packages/core/src/kernel/dispatch-upgrade.ts +1 -1
  277. package/packages/core/src/kernel/engine.ts +152 -18
  278. package/packages/core/src/kernel/execution-intervals.ts +61 -0
  279. package/packages/core/src/kernel/forge-checks.ts +140 -0
  280. package/packages/core/src/kernel/forge-health.ts +2 -2
  281. package/packages/core/src/kernel/generated-files.ts +43 -0
  282. package/packages/core/src/kernel/generated-regeneration.ts +254 -0
  283. package/packages/core/src/kernel/generators/build-log.ts +30 -2
  284. package/packages/core/src/kernel/generators/optimization-log.ts +679 -0
  285. package/packages/core/src/kernel/generators/panel-log.ts +133 -0
  286. package/packages/core/src/kernel/generators/repository-journals.ts +13 -0
  287. package/packages/core/src/kernel/guarded-forge.ts +76 -11
  288. package/packages/core/src/kernel/harvest.ts +1 -4
  289. package/packages/core/src/kernel/head-paths.ts +4 -1
  290. package/packages/core/src/kernel/history-retention.ts +337 -0
  291. package/packages/core/src/kernel/incremental-fixtures.ts +6 -0
  292. package/packages/core/src/kernel/incremental.ts +14 -4
  293. package/packages/core/src/kernel/integration-landing.ts +64 -13
  294. package/packages/core/src/kernel/integration-stack.ts +123 -20
  295. package/packages/core/src/kernel/integration-state.ts +39 -2
  296. package/packages/core/src/kernel/janitor-failure.ts +2 -0
  297. package/packages/core/src/kernel/kernel-git.ts +1 -1
  298. package/packages/core/src/kernel/landing-measurement.ts +275 -0
  299. package/packages/core/src/kernel/landing-readiness.ts +2 -0
  300. package/packages/core/src/kernel/landing-state.ts +20 -1
  301. package/packages/core/src/kernel/leaf-restack-base.ts +33 -7
  302. package/packages/core/src/kernel/leaf-restack-state.ts +99 -4
  303. package/packages/core/src/kernel/log-index-value.ts +2 -0
  304. package/packages/core/src/kernel/log-index.ts +100 -3
  305. package/packages/core/src/kernel/measurement.ts +406 -0
  306. package/packages/core/src/kernel/mixed-version.ts +6 -3
  307. package/packages/core/src/kernel/node-landing.ts +92 -18
  308. package/packages/core/src/kernel/node-restack-state.ts +27 -1
  309. package/packages/core/src/kernel/node-restack-transaction.ts +80 -23
  310. package/packages/core/src/kernel/node-verification-context.ts +14 -4
  311. package/packages/core/src/kernel/open-pr-backpressure-state.ts +24 -0
  312. package/packages/core/src/kernel/open-pr-backpressure.ts +133 -0
  313. package/packages/core/src/kernel/optimization-admission.ts +490 -0
  314. package/packages/core/src/kernel/optimization.ts +953 -0
  315. package/packages/core/src/kernel/panel.ts +225 -0
  316. package/packages/core/src/kernel/phase-failures.ts +121 -0
  317. package/packages/core/src/kernel/phases.ts +42 -6
  318. package/packages/core/src/kernel/pr-attachments.ts +4 -16
  319. package/packages/core/src/kernel/pr-summary.ts +2 -2
  320. package/packages/core/src/kernel/published-branch-head.ts +60 -0
  321. package/packages/core/src/kernel/read-deferrals.ts +2 -2
  322. package/packages/core/src/kernel/read-facts.ts +69 -31
  323. package/packages/core/src/kernel/reconcile-restack.ts +352 -103
  324. package/packages/core/src/kernel/reducer-identity.ts +659 -0
  325. package/packages/core/src/kernel/reducer-registry.ts +62 -9
  326. package/packages/core/src/kernel/reducer-revisions.ts +75 -0
  327. package/packages/core/src/kernel/reducer.ts +269 -11
  328. package/packages/core/src/kernel/reopen-state.ts +48 -0
  329. package/packages/core/src/kernel/reopen.ts +143 -0
  330. package/packages/core/src/kernel/replay-retention.ts +208 -39
  331. package/packages/core/src/kernel/repository-attention.ts +1 -1
  332. package/packages/core/src/kernel/rollup.ts +61 -0
  333. package/packages/core/src/kernel/service-facts.ts +19 -7
  334. package/packages/core/src/kernel/setup-streak.ts +38 -0
  335. package/packages/core/src/kernel/step-durations.ts +257 -0
  336. package/packages/core/src/kernel/target-observation.ts +6 -1
  337. package/packages/core/src/kernel/target-rewrite-recovery.ts +116 -0
  338. package/packages/core/src/kernel/terminal-guard.ts +13 -5
  339. package/packages/core/src/kernel/ticket-handbacks.ts +1 -1
  340. package/packages/core/src/kernel/ticket-migrations.ts +1 -1
  341. package/packages/core/src/kernel/ticket-preparation.ts +1 -1
  342. package/packages/core/src/kernel/ticket-source-health.ts +1 -1
  343. package/packages/core/src/kernel/ticket-starts.ts +118 -0
  344. package/packages/core/src/kernel/ticket-wait.ts +37 -2
  345. package/packages/core/src/kernel/verify-diff-base.ts +67 -0
  346. package/packages/core/src/kernel/verify-stage-state.ts +1 -0
  347. package/packages/core/src/kernel/verify-stages.ts +51 -1
  348. package/packages/core/src/objective.ts +532 -0
  349. package/packages/core/src/ontology.ts +54 -6
  350. package/packages/core/src/operator/agent-context-serve.ts +631 -0
  351. package/packages/core/src/operator/annotations.ts +105 -4
  352. package/packages/core/src/operator/attention.ts +470 -0
  353. package/packages/core/src/operator/canonical-skills.ts +35 -0
  354. package/packages/core/src/operator/cli-equivalents.ts +270 -0
  355. package/packages/core/src/operator/context-prompts.ts +61 -0
  356. package/packages/core/src/operator/control.ts +2 -1
  357. package/packages/core/src/operator/index.ts +61 -1
  358. package/packages/core/src/operator/landings.ts +28 -19
  359. package/packages/core/src/operator/optimization.ts +314 -0
  360. package/packages/core/src/operator/protocol.ts +33 -1
  361. package/packages/core/src/operator/query.ts +137 -73
  362. package/packages/core/src/operator/read-view.ts +5 -2
  363. package/packages/core/src/operator/registry.ts +625 -59
  364. package/packages/core/src/operator/requests.ts +45 -20
  365. package/packages/core/src/operator/sandbox-host.ts +107 -11
  366. package/packages/core/src/operator/sandbox-resolver.ts +253 -0
  367. package/packages/core/src/operator/sandbox.ts +778 -82
  368. package/packages/core/src/operator/ticket-asset-list.ts +77 -0
  369. package/packages/core/src/operator/ticket-assets.ts +167 -0
  370. package/packages/core/src/operator/ticket-start.ts +152 -0
  371. package/packages/core/src/operator/tickets.ts +36 -4
  372. package/packages/core/src/plugin-sdk/index.ts +24 -0
  373. package/packages/core/src/plugins/manifest.ts +1 -1
  374. package/packages/core/src/plugins/registry.ts +1 -0
  375. package/packages/core/src/ports/forge/contract.ts +9 -0
  376. package/packages/core/src/ports/forge/fake.ts +114 -2
  377. package/packages/core/src/ports/forge/git-blob.ts +15 -0
  378. package/packages/core/src/ports/forge/git-rewrite.ts +6 -4
  379. package/packages/core/src/ports/forge/github-readiness.ts +1 -1
  380. package/packages/core/src/ports/forge/github-transport.ts +156 -1
  381. package/packages/core/src/ports/forge/github.ts +388 -100
  382. package/packages/core/src/ports/forge/local-git.ts +61 -1
  383. package/packages/core/src/ports/forge/readiness.ts +15 -3
  384. package/packages/core/src/ports/forge-failure.ts +46 -0
  385. package/packages/core/src/ports/forge-request-context.ts +23 -1
  386. package/packages/core/src/ports/forge-telemetry.ts +16 -0
  387. package/packages/core/src/ports/runner/antigravity-test.fixture.ts +149 -0
  388. package/packages/core/src/ports/runner/antigravity.ts +1071 -0
  389. package/packages/core/src/ports/runner/claude-test.fixture.ts +71 -0
  390. package/packages/core/src/ports/runner/claude.ts +6 -1
  391. package/packages/core/src/ports/runner/codex-test.fixture.ts +63 -0
  392. package/packages/core/src/ports/runner/codex.ts +11 -2
  393. package/packages/core/src/ports/runner/contract.ts +25 -1
  394. package/packages/core/src/ports/runner/fake.ts +2 -2
  395. package/packages/core/src/ports/runner/native-cli-fixture.ts +40 -5
  396. package/packages/core/src/ports/runner/native-process-fixture.ts +4 -1
  397. package/packages/core/src/ports/runner/pi.ts +23 -7
  398. package/packages/core/src/ports/runner/production.ts +19 -2
  399. package/packages/core/src/ports/runner/session-env.ts +65 -5
  400. package/packages/core/src/ports/runner/start-prompt.ts +6 -4
  401. package/packages/core/src/ports/tickets/contract.ts +75 -2
  402. package/packages/core/src/ports/tickets/fake.ts +11 -0
  403. package/packages/core/src/ports/tickets/file.ts +18 -0
  404. package/packages/core/src/ports/tickets/github-fake.ts +136 -4
  405. package/packages/core/src/ports/tickets/github.ts +407 -35
  406. package/packages/core/src/ports/tickets/hosted-index.ts +16 -1
  407. package/packages/core/src/ports/tickets/labels.ts +21 -0
  408. package/packages/core/src/ports/tickets/linear.ts +163 -0
  409. package/packages/core/src/ports/tickets/migration.ts +2 -0
  410. package/packages/core/src/ports/tickets/priority.ts +20 -0
  411. package/packages/core/src/ports/tickets/remote-protocol.ts +105 -6
  412. package/packages/core/src/ports/tickets/remote.ts +203 -17
  413. package/packages/core/src/ports/tickets/search.ts +139 -0
  414. package/packages/core/src/ports/tickets/tree.ts +17 -4
  415. package/packages/core/src/ports/types.ts +202 -6
  416. package/packages/core/src/ports/workspace/builtin-capabilities.ts +16 -4
  417. package/packages/core/src/ports/workspace/commit-preservation.ts +182 -64
  418. package/packages/core/src/ports/workspace/create.ts +18 -1
  419. package/packages/core/src/ports/workspace/fake.ts +340 -12
  420. package/packages/core/src/ports/workspace/git-worktree.ts +846 -43
  421. package/packages/core/src/ports/workspace/operator-sandbox.ts +129 -12
  422. package/packages/core/src/ports/workspace/process-group.ts +48 -0
  423. package/packages/core/src/ports/workspace/vercel-sandbox.ts +1539 -221
  424. package/packages/core/src/processes/agent-context-assemble.ts +576 -0
  425. package/packages/core/src/processes/agent-context.ts +469 -0
  426. package/packages/core/src/processes/build-execution-state.ts +1 -3
  427. package/packages/core/src/processes/build-runner.ts +1982 -528
  428. package/packages/core/src/processes/dispatch-failure-budget.ts +1 -1
  429. package/packages/core/src/processes/dispatcher-selectors.ts +15 -13
  430. package/packages/core/src/processes/dispatcher.ts +3003 -308
  431. package/packages/core/src/processes/execution-no-progress.ts +40 -1
  432. package/packages/core/src/processes/execution-settlement.ts +2 -6
  433. package/packages/core/src/processes/harvest-execution-state.ts +2 -6
  434. package/packages/core/src/processes/harvest-runner.ts +7 -2
  435. package/packages/core/src/processes/infrastructure-failure-budget.ts +1 -3
  436. package/packages/core/src/processes/judge-launcher.ts +38 -0
  437. package/packages/core/src/processes/measurement-runner.ts +235 -0
  438. package/packages/core/src/processes/optimization-activity.ts +120 -0
  439. package/packages/core/src/processes/optimization-merges.ts +101 -0
  440. package/packages/core/src/processes/optimization-stop.ts +179 -0
  441. package/packages/core/src/processes/panel-runner.ts +756 -0
  442. package/packages/core/src/processes/phase-failure-budget.ts +2 -0
  443. package/packages/core/src/processes/publication-state.ts +1 -4
  444. package/packages/core/src/processes/repo-view.ts +154 -6
  445. package/packages/core/src/processes/sandbox-state.ts +54 -10
  446. package/packages/core/src/processes/tick-publication.ts +2 -0
  447. package/packages/core/src/processes/tick-state.ts +1 -3
  448. package/packages/core/src/processes/workspace-preparation.ts +76 -0
  449. package/packages/core/src/processes/workspace-preservation.ts +67 -9
  450. package/packages/core/src/scenarios/harness.ts +19 -13
  451. package/packages/core/src/store/account-redaction.ts +1 -0
  452. package/packages/core/src/store/adapter.ts +52 -1
  453. package/packages/core/src/store/agent-context.ts +432 -0
  454. package/packages/core/src/store/build-feed.ts +291 -0
  455. package/packages/core/src/store/build-scope.ts +19 -1
  456. package/packages/core/src/store/contract.ts +955 -14
  457. package/packages/core/src/store/digest.ts +104 -9
  458. package/packages/core/src/store/histogram.ts +113 -0
  459. package/packages/core/src/store/judge-authority.ts +161 -0
  460. package/packages/core/src/store/local/schema.ts +62 -0
  461. package/packages/core/src/store/local/store.ts +628 -22
  462. package/packages/core/src/store/local/ticket-asset-heads.ts +23 -0
  463. package/packages/core/src/store/memory.ts +461 -69
  464. package/packages/core/src/store/open-builds.ts +19 -0
  465. package/packages/core/src/store/phase-session.ts +256 -6
  466. package/packages/core/src/store/reduced-reads.ts +24 -4
  467. package/packages/core/src/store/reducer-value-shapes.json +18023 -11824
  468. package/packages/core/src/store/reducer-values.ts +6 -1
  469. package/packages/core/src/store/remote/client.ts +220 -4
  470. package/packages/core/src/store/remote/compatibility.ts +1 -1
  471. package/packages/core/src/store/remote/credentials.ts +31 -1
  472. package/packages/core/src/store/remote/index.ts +41 -0
  473. package/packages/core/src/store/remote/protocol.ts +107 -0
  474. package/packages/core/src/store/remote/released-clients.json +22 -0
  475. package/packages/core/src/store/remote/released-reducer-values/1.10.0.json +34439 -0
  476. package/packages/core/src/store/remote/released-reducer-values/1.11.0.json +35680 -0
  477. package/packages/core/src/store/remote/released-reducer-values/index.ts +20 -16
  478. package/packages/core/src/store/remote/token.ts +13 -4
  479. package/packages/core/src/store/repo-state-events.ts +6 -8
  480. package/packages/core/src/store/retention.ts +23 -1
  481. package/packages/core/src/store/rollups.ts +337 -0
  482. package/packages/core/src/store/session-handle.ts +20 -2
  483. package/packages/core/src/store/session-reducer.ts +1 -4
  484. package/packages/core/src/store/snapshots.ts +10 -0
  485. package/packages/core/src/store/ticket-assets.ts +1 -3
  486. package/packages/core/src/store/types.ts +117 -9
  487. package/packages/core/src/testing/dispatch-read-budget.ts +1162 -2
  488. package/packages/core/src/testing/git-config-isolation.ts +27 -0
  489. package/packages/core/src/testing/index.ts +40 -0
  490. package/packages/core/src/testing/memory-operator-sandbox.ts +346 -0
  491. package/packages/core/src/testing/reduced-read-budget.ts +5349 -153
  492. package/packages/core/src/web/analytics-source.ts +303 -0
  493. package/packages/core/src/web/assets/Atkinson-OFL.txt +93 -0
  494. package/packages/core/src/web/assets/AtkinsonHyperlegibleNext.latin.woff2 +0 -0
  495. package/packages/core/src/web/assets/JetBrains-OFL.txt +93 -0
  496. package/packages/core/src/web/assets/JetBrainsMono.latin.woff2 +0 -0
  497. package/packages/core/src/web/assets/app.css +1 -0
  498. package/packages/core/src/web/assets/app.js +9 -0
  499. package/packages/core/src/web/assets/manifest.json +31 -0
  500. package/packages/core/src/web/assets/theme.js +1 -0
  501. package/packages/core/src/web/bounded.ts +31 -0
  502. package/packages/core/src/web/http.ts +315 -0
  503. package/packages/core/src/web/hub.ts +160 -0
  504. package/packages/core/src/web/options.ts +38 -0
  505. package/packages/core/src/web/overview-source.ts +322 -0
  506. package/packages/core/src/web/page.ts +56 -0
  507. package/packages/core/src/web/protocol.ts +151 -0
  508. package/packages/core/src/web/read-only.ts +23 -0
  509. package/packages/core/src/web/repository-source.ts +35 -0
  510. package/packages/core/src/web/server.ts +97 -0
  511. package/skills/code-review/SKILL.md +26 -2
  512. package/skills/finalize/SKILL.md +10 -4
  513. package/skills/guide/SKILL.md +743 -123
  514. package/skills/guide/references/accounts.md +2 -1
  515. package/skills/guide/references/integration-tree.md +102 -11
  516. package/skills/guide/references/merge-policy.md +30 -14
  517. package/skills/guide/references/migration-1.0.md +2 -1
  518. package/skills/guide/references/operator-api.md +251 -20
  519. package/skills/guide/references/optimization-nodes.md +1100 -0
  520. package/skills/guide/references/plugin-authoring.md +83 -13
  521. package/skills/guide/references/remote-store-protocol.md +137 -17
  522. package/skills/guide/references/remote-ticket-protocol.md +90 -2
  523. package/skills/guide/references/restacking.md +119 -15
  524. package/skills/guide/references/setup.md +27 -4
  525. package/skills/guide/references/spec-standard.md +2 -1
  526. package/skills/guide/references/ticket-dependencies.md +15 -3
  527. package/skills/guide/references/ticket-migration.md +4 -2
  528. package/skills/implement/SKILL.md +74 -5
  529. package/skills/judge/SKILL.md +43 -0
  530. package/skills/operate/SKILL.md +374 -57
  531. package/skills/plan/SKILL.md +28 -4
  532. package/skills/plan-review/SKILL.md +24 -3
  533. package/skills/propose/SKILL.md +121 -0
  534. package/skills/reconcile/SKILL.md +21 -2
  535. package/skills/spec/SKILL.md +63 -11
  536. package/skills/tickets/SKILL.md +94 -9
  537. package/templates/hosted-service/package.json +2 -2
package/docs/overview.md CHANGED
@@ -35,7 +35,7 @@ Merge depends on the configured policy and merge gates. Conflicts are reconciled
35
35
 
36
36
  Autobuild fits repositories whose work can be stated as clear tickets and checked automatically.
37
37
 
38
- - **Requirements.** Bun, git, and your agent runtime (Claude Code, Codex CLI, or Pi) with its access and credentials.
38
+ - **Requirements.** Bun, git, and your agent runtime (Claude Code, Codex CLI, Pi, or Antigravity CLI) with its access and credentials.
39
39
  - **Throughput over latency.** Independent builds run side by side, but each one pays for planning, review, and verification. A small edit you need now is better done directly in your coding agent.
40
40
  - **Not a product owner.** It doesn't make product decisions or make vague tickets precise without your input; builds stop for answers, and your agent brings unresolved decisions back to you. If you can't state what done means, or your checks can't detect a broken change, fix grooming and verification first.
41
41
 
@@ -49,6 +49,8 @@ Declare served model prefixes and a default. Optional tool-free `oneShot` sits b
49
49
  - Provision an absolute, writable working copy for the requested branch; return durable base evidence.
50
50
  - Resume an intact branch non-destructively, never silently re-cut from a newer base. Rematerialize a lost copy. Make release idempotent.
51
51
  - Optional `provision.publication` supplies a durable confirmed SHA and known cache tips for authoritative readback and cache repair. Preserve unknown unpublished work.
52
+ - Optional `provision.fresh: { owner }` marks a build's first provision. A pre-existing branch of that name is not the build's work: never return it as the base unless you hold your own creation receipt for `owner` (stable across that build's retries). Cut from `baseBranch` and keep the old tip recoverable. Providers that ignore it rely on claim-time deduplication.
53
+ - Optional `localBranchExists(repo, branch)` reports a local `refs/heads/<branch>` in the checkout you create branches in, and throws when the probe fails. Dispatch calls it only at claim time and skips such a slug. Omit it when your branches aren't local; `remoteBranchExists` covers those.
52
54
 
53
55
  ### `forge`
54
56
 
@@ -73,6 +75,14 @@ Reconcile requires the optional grouped `Forge.rewrite` capability:
73
75
  expansion or a depth limit) restores missing commits and their missing ancestry,
74
76
  writes no shallow boundary, leaves an already-shallow repository's existing
75
77
  boundaries unchanged, and verifies the commits locally before returning.
78
+
79
+ Failure classes from `archive`:
80
+
81
+ | Failure | Throw | Kernel response |
82
+ |---|---|---|
83
+ | Refusal (namespace, permission, policy) | a plain `Error` | Leaf: BuildStore copy or warning, rewrite proceeds. Node: stops. |
84
+ | Immutable ref already names a different SHA | `ArchiveConflictError` (SDK, with `isArchiveConflict`) | Never retried, never a fallback |
85
+ | Transient transport or rate limit | `ForgeFailure` / `ForgeRequestDeferred` | Retried |
76
86
  3. Replace the explicit branch, leased on an explicit expected remote head.
77
87
 
78
88
  - Return `lease-mismatch` separately from transport, auth and policy failures.
@@ -81,6 +91,7 @@ Reconcile requires the optional grouped `Forge.rewrite` capability:
81
91
  - Never overwrite unknown work or fall back to merging, ordinary pushes, archive branches or tags.
82
92
  - Older forge plugins still load; reconcile refuses them actionably.
83
93
  - Remote workspace providers also need trusted `WorkspacePublication.rewrite` after guest teardown; ordinary `publish` can't publish a restack.
94
+ - `WorkspacePublication.rewrite` input may carry `retain({ exec, workspacePath, archive, ref, sha })`. When present, call it once per `archives` entry instead of `archive`, passing your trusted Git transport; it owns the leaf fallback and does not throw for a refusal. A provider that ignores it archives strictly.
84
95
 
85
96
  ### Destination observation and ancestry
86
97
 
@@ -99,7 +110,8 @@ another store opened. A throw during slug selection fails that claim: no build
99
110
  is created and the ticket is handed back to retry on a later tick, never named
100
111
  without the check. A throw while diagnosing a target node leaves the plain
101
112
  pending diagnostic. Without the capability, slugs are deduplicated against the
102
- local store only and the dispatcher records a startup warning.
113
+ local store, plus local branches when the workspace provider implements
114
+ `localBranchExists`, and the dispatcher records a startup warning.
103
115
 
104
116
  Stores may expose `getNodeRewrite(node, previousHead, beforePrevious)` as a bounded point
105
117
  lookup of a durable `node.rewritten` receipt. Built-in adapters index these
@@ -117,7 +129,10 @@ intervening forward gap still requires immutable ancestry proof.
117
129
 
118
130
  Remote providers expose trusted `WorkspacePublication.preserve` and
119
131
  `recoverCandidate`; local providers may supply `WorkspaceProvider.preservation`
120
- without changing the remote-publication discriminator. Missing capabilities fail
132
+ without changing the remote-publication discriminator. `recoverCandidate` may
133
+ receive `replayBase` and `targetBranch`: fetch the published target before
134
+ applying a thin replay pack whose base is missing, and return true for an
135
+ available leaf candidate even when archiving it is refused. Missing capabilities fail
121
136
  safely at destructive boundaries. `WorkspaceRecovery.fence(handle)` reports
122
137
  confirmed, absent, or unknown without deleting an environment or its snapshots.
123
138
  Only dispatcher-authorized reap follows the durable fence and preservation/loss
@@ -137,6 +152,16 @@ provider that ignores these fields stays safe. `preserve` also receives
137
152
  `neverExecuted` when no execution ever started in the environment: a missing
138
153
  base, `HEAD`, branch, or candidate object then means nothing to preserve rather
139
154
  than an error. A provider that ignores it stays strict, and cleanup fails safely.
155
+ `preserve` may also receive `retain({ exec, workspacePath, sha, base })`: when your
156
+ archive transport refuses a head's archive ref, call it with your trusted Git
157
+ transport. It keeps the head as a BuildStore copy and resolves to the copy's
158
+ exclusion base; record the head with that `storeBase` in place of `remoteRef`.
159
+ It throws when the head cannot be kept; rethrow so release is refused. A
160
+ provider that ignores it preserves strictly. A `restoration` head may name
161
+ `storeBase` instead of `remoteRef`. Then `provision` receives
162
+ `restoreStored({ exec, workspacePath, sha })`: when the commit is absent, call
163
+ it with your trusted transport, and fail provisioning when it resolves false.
164
+ The store is read dispatcher-side, so the guest never holds store credentials.
140
165
  Provision/start failures signal `WorkspaceCleanupRequired` rather than deleting
141
166
  or implicitly recreating an existing checkout. A confirmed `snapshot_not_found`
142
167
  lookup establishes filesystem absence, while retaining the stale name for
@@ -175,6 +200,7 @@ Optional `Forge.observeRequests(observer): () => void` returns a disposer and ca
175
200
 
176
201
  - Pass `ForgeRequestContext` with the build slug, or `{}` when unknown; the host fills missing attribution from its current build-scoped operation, else the request is repository/unattributed. Capture context before awaiting transport; notify after the outcome.
177
202
  - Credential discovery and skipped calls are not provider requests.
203
+ - Optionally add `rateLimit: { resource, limit, remaining, resetAt }` from the response's primary rate-limit headers (`resetAt` as an ISO timestamp), including on 304s and limited failures; omit it when the response carries none, and never make an extra request for it. The host carries the latest valid reading per resource in tick telemetry and `ab repository status`.
178
204
 
179
205
  | `outcome` | Request |
180
206
  |---|---|
@@ -205,6 +231,10 @@ Forge optimizations that don't change the required plugin API version:
205
231
 
206
232
  Invalidate observations before writes, including uncertain writes and Git pushes. Acknowledgement and readiness reads stay fresh. Branch and ref endpoints share normalized facts, never HTTP validators.
207
233
 
234
+ ### Forge CI
235
+
236
+ The optional **`inspectHeadChecks(workspacePath, sha)`** reports CI at exactly `sha` as `{kind: 'known', failing, pending}` or `{kind: 'unknown', reason}`. Report a failing set only when the provider proves it, and `unknown` when a listing is incomplete with no visible failure. Throw on transport, authorization, rate-limit or parse failure. The dispatcher treats a throw, or a forge without the capability, as unknown CI: never green, never red. Report the live PR head as `headSha` on an open `getPrState` result when the provider has it, so a moved head clears an older failure. Keep the read cheap; it runs on every janitor poll of a finished leaf.
237
+
208
238
  ### API versions
209
239
 
210
240
  A plugin relying on a capability declares an `apiVersion` range containing its version (for example `^1.5.0`). Legacy plugins without newer fields keep working.
@@ -217,6 +247,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
217
247
  - **1.8** Forge failure classification and request observers.
218
248
  - **1.9** Optional native ticket-source paging (`listPage`); older sources retain operator slicing.
219
249
  - **1.10** Optional ticket-source ready-assignee capability (`readyAssignee`, with `prepareReadyAssignee`, `readyAssigneeRefusal` and `describeReadyAssignee`); sources without it refuse `[tickets].readyAssignee`. Also optional targeted ticket listing (`listTargeting`); older tree sources are observed through `listAll`.
250
+ - **1.11** Optional ticket-source search (`search`); callers refuse sources without it and never fall back to a listing.
220
251
 
221
252
  ## 2. Create a repository-local module
222
253
 
@@ -525,8 +556,8 @@ An adapter opts in with `priority: true` and must persist
525
556
  return `priority: 'urgent'` on every read of an urgent ticket and omit the field
526
557
  otherwise, treat `normal` as clearing urgency, and include urgent priority in
527
558
  revisions. The dispatcher claims urgent ready tickets before normal ones, each in
528
- your listing order. Without the flag, every ticket reads as normal: the
529
- compatibility facade refuses a write naming `urgent` with
559
+ your listing order, and ahead of normal builds waiting for a slot. Without the
560
+ flag, every ticket reads as normal: the compatibility facade refuses a write naming `urgent` with
530
561
  `TicketPriorityUnsupported` before your methods run, drops a `normal` no-op
531
562
  (skipping the call when nothing else remains), and strips priority from reads.
532
563
 
@@ -537,6 +568,10 @@ must then honour `criteria.assignee` in `listReady` (and `listPage`, if
537
568
  implemented): only tickets assigned to that user are ready, and an unassigned
538
569
  ticket is never ready while it is set. `"me"` means the owner of the source's
539
570
  credential; any other value's forms are the source's to define and enforce.
571
+ `create` must also honour `options.readyAssignee`, which the dispatcher passes
572
+ when it files optimization attempts: assign the created ticket, or the ticket a
573
+ creation key adopts, to that user so the same `listReady` includes it, or fail
574
+ without recording the create.
540
575
  Without the flag, dispatcher startup, `ab init --validate` and live reloads
541
576
  refuse a configured `readyAssignee` with an error naming the source and plugin.
542
577
 
@@ -580,6 +615,11 @@ and request-free like `readyAssigneeRefusal`, and
580
615
  what `prepareReadyAssignee` resolved, so a dispatcher never resolves it in a
581
616
  tick.
582
617
 
618
+ Callers likewise union `[tickets].createLabels` into `labels`, so a draft's
619
+ labels are always exact. Every source already stores labels, so there is no
620
+ capability to declare; refuse any names your source reserves at `create`, as
621
+ for any other label.
622
+
583
623
  ## Optional ticket paging capability
584
624
 
585
625
  Native paging is an optional API 1.9 ticket-source capability:
@@ -600,15 +640,45 @@ Only paged operator listings select this capability. Sources without it retain
600
640
  the full-read fallback, which orders the listing before offset and limit: by
601
641
  default a stable urgent-first partition (urgent, then normal, each in source
602
642
  order), or for newest the reversed listing, which is newest filed first for
603
- sources that list in filing order (file, GitHub, Linear). The remote
604
- `HostedTicketSource` is the exception: the hosted list-ready protocol returns
605
- urgent tickets first and carries no filing time, so the client cannot see
606
- filing order, and its newest pages are reversed dispatch order whenever urgent
607
- tickets exist. Native errors propagate. Unpaged operator
608
- listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
609
- `listReady`/`listAll`. The hosted PostgreSQL source counts matches without
610
- bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
611
- `HostedTicketSource` retain fallback; the POST list-ready protocol stays exhaustive.
643
+ sources that list in filing order (file, GitHub, Linear). Native errors
644
+ propagate. Unpaged operator listings, CLI ticket lists and dispatcher ready
645
+ scans remain exhaustive through `listReady`/`listAll`. The hosted PostgreSQL
646
+ source counts matches without bodies and reads only the SQL-bounded window.
647
+ File, Linear and GitHub retain fallback; the remote `HostedTicketSource`
648
+ forwards pages to the service's native paging (`list-page`), falling back only
649
+ against a service predating it. The POST list-ready protocol stays exhaustive.
650
+
651
+ ## Optional ticket search capability
652
+
653
+ Text search is an optional API 1.11 ticket-source capability:
654
+ `search?(query: TicketSearchQuery): Promise<TicketSearchPage>`. The SDK exports
655
+ the types and the `TicketSearchCursorInvalid` and `TicketSearchUnsupported`
656
+ errors.
657
+
658
+ | Type | Fields |
659
+ | --- | --- |
660
+ | `TicketSearchQuery` | `text`, optional `state`, optional `labels`, `limit`, optional `cursor` |
661
+ | `TicketSearchHit` | `id`, `title`, optional `state`, `labels`, `kind`, optional `target` |
662
+ | `TicketSearchPage` | `tickets: TicketSearchHit[]`, optional `cursor`, `diagnostics` |
663
+
664
+ - **Matching.** A ticket matches when every whitespace-separated term of
665
+ `text` occurs, case-insensitively, in its title or body; each term may hit
666
+ either field. A provider-backed source may apply its provider's word matching
667
+ instead.
668
+ - **Filters.** `state` resolves as `listReady` resolves it; absent means every
669
+ state, including completed and rejected tickets. `labels` are ANDed.
670
+ - **Paging.** `limit` is positive and already bounded by the caller. `cursor`
671
+ is opaque and source-defined; return one only when more matches remain. Order
672
+ is source-defined and stable across pages. Reject a malformed or foreign
673
+ cursor with the SDK's `TicketSearchCursorInvalid(sourceName, cursor)`;
674
+ callers map it to the `search-cursor-invalid` refusal.
675
+ - **Cost.** Build each hit from the search read itself, never from a follow-up
676
+ read per result. A failure rejects; it never falls back to `listAll`.
677
+
678
+ Sources that cannot search omit the method. Callers (`tickets.search`,
679
+ `ab ticket search`) then refuse with `TicketSearchUnsupported`, naming the
680
+ source, before reading any ticket. The shared `describeTicketSourceContract`
681
+ suite checks declared search automatically and skips it otherwise.
612
682
 
613
683
  Hosted cooldown recording rejects observed reset deadlines beyond the 24-hour
614
684
  admission horizon explicitly; adapters must not shorten or invent a provider
@@ -534,7 +534,7 @@ client version window are unchanged.
534
534
 
535
535
  | Scope | Reducers with no arguments |
536
536
  | --- | --- |
537
- | Build | `executionNoProgress`, `summaryRequests`, `build`, `buildDigest`, `currentPrAttachments`, `pendingPrAttachmentReclaims`, `openExecution`, `lastExecutionOutcome`, `infrastructureFailureReset`, `openWorkspace`, `setupStreak`, `openBuildWorkspace`, `currentDeferralObservation`, `dashboardFacts`, `pinnedAssets`, `buildDelegation` |
537
+ | Build | `executionNoProgress`, `summaryRequests`, `build`, `buildDigest`, `currentPrAttachments`, `pendingPrAttachmentReclaims`, `openExecution`, `lastExecutionOutcome`, `infrastructureFailureReset`, `openWorkspace`, `setupStreak`, `openBuildWorkspace`, `currentDeferralObservation`, `dashboardFacts`, `buildTimeline`, `buildRosterEntry`, `pinnedAssets`, `buildDelegation` |
538
538
  | Repository | `dispatchPlacement`, `ticketPreparation`, `harvest`, `dispatchSettings`, `sandboxStates`, `openHarvestExecutions`, `hostedHarvestAuthority`, `autoMergeDefault`, `effectiveConfig`, `harvestDelegation` |
539
539
 
540
540
  | Reducer | Scope | Required arguments |
@@ -579,6 +579,40 @@ names retain their existing behavior. The value cache key format is versioned;
579
579
  checkpoints from the former publicly writable format are ignored and rebuilt
580
580
  from the log after upgrading.
581
581
 
582
+ ### Rollup values
583
+
584
+ `POST /repos/{repo}/rollup-values` answers a derived reducer: a value across the
585
+ repository's builds. The body is a named-value request of at most
586
+ 4 KiB, whose optional `read` record carries read-time arguments:
587
+
588
+ ```json
589
+ {"reducer":"stepDurations","args":{"outcome":"all"},"read":{"window":"30d"}}
590
+ ```
591
+
592
+ - `args` are key arguments: each combination, after defaults, is its own
593
+ rollup. `read` shapes only the finished value and never creates a key.
594
+ Named-value requests that carry `read` are `400 validation`.
595
+ - The response is the strict envelope `200 {"version", "cursor", "value"}`.
596
+ `cursor` is always `0`; `value.position` names the repository change
597
+ position the answer reflects.
598
+ - The server advances the rollup by the builds changed since its saved
599
+ position, serialized per key, and answers canonically. The client sends one
600
+ request and never reconstructs the value from events, the changed-builds
601
+ feed or build values.
602
+ - Rollups have no released projection catalog. A client requires the server's
603
+ `version` to equal its own; a different version, an absent route (`404` or
604
+ `405` from an older server), `400 validation` for a rollup the server does
605
+ not know (an older server), an invalid envelope or a value outside the
606
+ rollup's schema raises `ReducerValueIncompatibilityError`.
607
+ - Unknown rollup names, invalid arguments and extra fields are
608
+ `400 validation`. An unknown repository answers the empty value and creates
609
+ nothing. The operation is read-only authority, like `reducer-values`.
610
+
611
+ | Rollup | Key arguments | Read-time arguments | Value |
612
+ | --- | --- | --- | --- |
613
+ | `stepDurations` | `outcome`: `merged` (default) or `all`; `kind`: `leaf` (default), `node` or `all` | `window`: `24h`, `7d` (default), `30d` or `all` | `{"position": string, "window": string, "steps": [{"step", "count", "meanMs", "p50Ms", "p90Ms", "p99Ms", "totalMs"}]}`, steps in pipeline order with waits last |
614
+ | `buildRoster` | none | none | `{"position": string, "live": [{"slug", "kind", "createdAt"?}], "finished": [{"slug", "kind", "outcome", "completedAt"}]}`: every live build, oldest first; up to 10 of the newest finished builds, newest first, with `outcome` `merged`, `closed` or `aborted` |
615
+
582
616
  ### Reducer snapshots
583
617
 
584
618
  A reducer snapshot is one registered reducer's serialized state as of a log
@@ -639,7 +673,13 @@ no client retries it from zero or silently baselines it.
639
673
  `{version, cursor, value}`. The server owns the accumulator. It checks expiry
640
674
  before canonical catch-up, then returns a checkpoint including event N; clients
641
675
  read only events strictly after N. Missing historical positions or corrupt stored
642
- state return typed `checkpoint-integrity` (HTTP 500).
676
+ state return typed `checkpoint-integrity` (HTTP 500). Seed answers use the same
677
+ client identification and released-contract projection as `reducer-values`:
678
+ clients send the projection and catalog-identity headers, a published client
679
+ receives the seed projected onto its frozen release contract and stamped with
680
+ its released reducer version, and a seed that contract cannot represent is
681
+ returned canonical, so the client fails with its typed incompatibility error and
682
+ never replays events.
643
683
 
644
684
  During deployment overlap or rollback, a pre-checkpoint server may advance a
645
685
  valid canonical row without checkpoint coverage. Under the seed lock, the new
@@ -710,17 +750,20 @@ waits apply. There is no push transport; a held request is the whole mechanism.
710
750
  Repository journals are separate resources with independent event sequences,
711
751
  artifacts, and leases. `{repo}` is one percent-encoded repository id; encode
712
752
  embedded `/` characters. All resource routes authorize and require the
713
- repository to exist. An unknown repository returns `404 not-found` — with one
714
- carve-out: the build-digest batch read of this section is keyed to build
715
- records, not the repository journal record, so it authorizes the project credential
716
- but answers `200` (possibly empty) even for an unknown repository, a repository
717
- without a journal record, or a repository without builds.
753
+ repository to exist. An unknown repository returns `404 not-found` — except
754
+ for the build-record reads of this section (`change-position`, `builds`,
755
+ `changed-builds`, `build-page`, `build-digests`, `open-builds` and `rollup-values`), which are keyed
756
+ to build records, not the repository journal record, so they authorize the
757
+ project credential but answer `200` (possibly empty) even for an unknown
758
+ repository, a repository without a journal record, or a repository without
759
+ builds.
718
760
 
719
761
  | BuildStore operation | HTTP route | Request | Success |
720
762
  |---|---|---|---|
721
763
  | `ensureRepo` | `POST /repos` | `{"repo": string}` with a nonempty id | `200` + `RepositoryRecord`; idempotently returns the existing record |
722
764
  | `getRepo` | `GET /repos/{repo}` | none | `200` + `RepositoryRecord`; absent is `404` (the shipped client maps this to `null`) |
723
765
  | `appendRepo` | `POST /repos/{repo}/events` | event write | `201` + repository event envelope |
766
+ | `appendRepoIfCurrent` | `POST /repos/{repo}/events/conditional` | `{"expectedSeq": nonnegative integer, "event": event write}` | appended: `201` + repository event envelope; journal advanced: `200 null` (mirroring section 3's build compare-and-append). A server without the route answers `404`; callers report it and never fall back to an unconditional append |
724
767
  | `getRepoEvents` / `getRepositoryTail` | `GET /repos/{repo}/events?since={n}&through={n}&wait={s}` | optional `since` query value, parsed as in section 3; absence defaults to `0`. Optional `wait` in whole seconds, per the event-wait rules of section 3 | `200` + envelopes with `seq > since`, up to the frozen head; optional `through` caps the response at `seq <= through`; `409 cursor-too-old` below `max(0, head - 1000)` |
725
768
  | `getRepoStateEvents` | `GET /repos/{repo}/state-events` | none | `200` + the bounded repository-journal subset (AUT-489): every durable event type (`ticket-preparation.*`, `harvest.*`, `orchestrator.sandbox.*`, the three dispatcher setting types, and cross-generation handoff correlation facts: target-prepared, yield-requested, upgrade-failed, handoff-started, terminal-released, takeover, drain-deadline, drain-settled and handoff-completed) plus the latest-only `dispatcher.ticket-scan-completed` and `dispatcher.placement-set` facts and, when the journal has one, the tail from the latest `dispatcher.run-started`, in increasing sequence order; served inside the repository-existence gate like `GET events`, so an unknown repository is `404` |
726
769
  | `getReducerSnapshot` (repo scope) | `GET /repos/{repo}/snapshots/{reducer}?version={n}` | required `version` query value, a positive integer; `reducer` is a registry name (`^[A-Za-z][A-Za-z0-9._-]{0,63}$`) | `200` + `{"version", "cursor", "state"}` or `200 null` when absent, written by another reducer version, ahead of the journal's tail, or the repository has no journal record; an unknown repository is `404`, which the shipped client also maps to `null` |
@@ -729,11 +772,28 @@ without a journal record, or a repository without builds.
729
772
  | `putRepoArtifact` | `POST /repos/{repo}/artifacts` | artifact input | `201` + repository artifact metadata |
730
773
  | `getRepoArtifact` | `GET /repos/{repo}/artifacts?kind={kind}&rev={n}` | required nonempty `kind`; optional `rev` is parsed as in section 3 | `200` + artifact read; latest only when the `rev` parameter is absent; missing kind/revision is `200 null` |
731
774
  | `listRepoArtifacts` | `GET /repos/{repo}/artifact-list?kind={kind}` | optional `kind`; absence means all kinds | `200` + metadata ordered by kind and then increasing revision |
775
+ | `getRepoChangePosition` | `GET /repos/{repo}/change-position` | none | `200 {"position": string}`: the canonical unsigned decimal change position, `"0"` for an unknown repository. Positions are ordered: a later build creation, build event, repository event or repository lease holder change yields a strictly greater value, compared numerically |
776
+ | `listBuildsForRepo` | `GET /repos/{repo}/builds` | none | `200` + `BuildRecord[]` ordered by creation time, then slug |
777
+ | `listBuildsChangedSince` | `GET /repos/{repo}/changed-builds?since={p}` | required `since`, a canonical unsigned decimal no greater than 9223372036854775807; anything else is `400 validation` | `200 {"position": string, "builds": [{"slug": string, "position": string}]}`: the builds whose latest change position is greater than `since`, ascending by position and each once, with the repository head read in the same snapshot. Reads no event rows. An unknown repository answers `{"position": "0", "builds": []}` |
778
+ | `listBuildsPage` | `GET /repos/{repo}/build-page?limit={n}&cursor={c}&kind={k}&outcome=merged&activeSince={t}` | optional `limit`, a decimal integer from 1 to 100 (default 25); optional `cursor`, a `next` value this server issued for the same filters; optional `kind`, `leaf` or `node`; optional `outcome`, only `merged`; optional `activeSince`, an ISO instant with a zone. A bad limit, a malformed cursor, a cursor of the other order, or an empty or invalid filter is `400 validation` | `200 {"builds": BuildRecord[], "next": string \| null, "filters"?: {"kind"?, "outcome"?, "activeSince"?}}`: one page newest first by creation time, slug descending to break ties, with records as `builds` returns them; `next` is `null` on the last page. `kind` and `outcome` keep that order. `activeSince` keeps builds whose `updatedAt` is at or after it, ordered by `updatedAt` then slug, both descending, a superset of builds active in the window; a build written between two requests can appear twice or be skipped once, so dedupe by slug. A filtered answer echoes the normalized filters it applied as `filters`. Every page, filtered or not, costs at most `limit + 1` index entries and no event rows |
779
+ | `getReducerValue` (rollup scope) | `POST /repos/{repo}/rollup-values` | a named-value request with optional `read`; see [Rollup values](#rollup-values) | `200 {"version", "cursor": 0, "value"}`: the canonical rollup; an unknown repository answers the empty value |
732
780
  | `getRepoBuildDigests` | `GET /repos/{repo}/build-digests` | none | `200` + `BuildDigest[]`, one entry per build record of the repository (possibly empty), ordered by slug; handled before the repository-existence gate, so an unknown or journal-less repository answers `200 []` |
781
+ | `listOpenBuilds` | `GET /repos/{repo}/open-builds` | none | `200` + `[{"record", "digest"}]`, a build record and its `BuildDigest` for every open build of the repository (possibly empty), ordered by `createdAt` and then slug; handled before the repository-existence gate, so an unknown or journal-less repository answers `200 []` |
733
782
  | `claimRepoLease` | `POST /repos/{repo}/lease/claim` | claim request | `200 {"ok": boolean}` |
734
783
  | `heartbeatRepo` | `POST /repos/{repo}/lease/heartbeat` | holder request | `200 {"ok": boolean}` |
735
784
  | `releaseRepoLease` | `POST /repos/{repo}/lease/release` | holder request | `200 {"ok": true}`; a wrong holder is a successful no-op |
736
785
 
786
+ The `changed-builds` and `build-page` routes are additive and keep the
787
+ protocol version. A server on the same release line that lacks them answers
788
+ `501 unsupported-operation` or `404 not-found`; the shipped client reports
789
+ that as a typed `BuildFeedUnsupportedError` and never falls back to listing
790
+ builds or reading events. The `build-page` filters are additive too. A server
791
+ that predates them ignores the parameters and answers an unfiltered page
792
+ without `filters`, so the client requires an echo equal to the filters it sent
793
+ and otherwise raises `BuildFeedUnsupportedError` with capability
794
+ `buildPageFilters`. It never filters an unfiltered page client-side and never
795
+ retries without the filters.
796
+
737
797
  There is no repository-list operation. `ensureRepo` is the only repository
738
798
  creation operation and must not reset timestamps, events, artifacts, or lease
739
799
  state when the repository already exists. Event sequence numbering starts at 1
@@ -789,6 +849,35 @@ older service that omits `ticketWait` yields no automatic release: open waits
789
849
  then end only when an operator answers them, and the client never rebuilds the
790
850
  field from events.
791
851
 
852
+ `optimization` is present on every node digest and absent on a leaf's. It is
853
+ `false` for a plain node. For an optimization node it is a bounded summary of
854
+ the node's own optimization facts: `stopped?` and `measured?` (each `true` when
855
+ set), `inFlight`, `concurrency`, `attemptRoom?` (absent without an attempts
856
+ budget), `emptyProposals`, `openedAt`, `maxHours?`, `clock?: {activeMs,
857
+ spans, open, stoppedAt?, settled?}` (the active-hours clock: activity
858
+ compacted before the last batch, closed spans since, and the start time of
859
+ each open run), `proposal?: {request, deposited?: {ids, at}}`, and `wakeSeq?`
860
+ and `deferredSeq?`, the sequences of
861
+ the latest fact that can clear a proposer deferral and of the latest
862
+ `optimization.proposal-deferred`. A dispatcher selects nodes to request
863
+ proposals for, file proposals from and stop as exhausted from this member
864
+ alone. The member is additive and keeps the protocol version. A node digest
865
+ without it is an older service's answer: the client fails the proposer stage
866
+ and the attempt-creation hold closed with a typed capability error, proposing
867
+ nothing and withholding every ready ticket that carries a creation key for
868
+ that pass, and it never falls back to reading each node's facts. A node digest
869
+ whose signal lacks `clock` skips the hours condition of a proposal request,
870
+ which the build read then confirms.
871
+
872
+ `executionFacts` is present on every build digest: the count of the build's
873
+ `execution.started` and `execution.ended` facts. The dispatcher's
874
+ optimization activity pass compares it with what a node's clock has
875
+ accounted, and reads the build's served `executionIntervals` value, which
876
+ holds only the execution facts no node has acknowledged, only when it grew.
877
+ The member is additive and keeps the protocol version. A digest without it is
878
+ an older service's answer: the activity pass fails closed with a typed
879
+ capability error and never reads the build's events instead.
880
+
792
881
  The digest is derived from the event log on every call — the server persists
793
882
  nothing and there is no refresh step. Protocol version `3` reshaped the
794
883
  digest's `observations` from bare sequence numbers to `{seq, ts}` pairs and
@@ -802,6 +891,18 @@ This is the same discipline the transport's supported-window rules promise:
802
891
  wire shapes that independently implemented servers must reproduce update this
803
892
  document and the protocol version together.
804
893
 
894
+ An open build is one whose latest terminal fact is not `build.completed`:
895
+ queued, running, paused, blocked and settled-awaiting-merge builds, plus
896
+ aborted builds whose cleanup has not finished. The server maintains the set
897
+ in the same transaction that inserts a build or appends its
898
+ `build.completed`, `build.aborted` or `build.reopened`, so answering costs one
899
+ entry per open build and never grows with settled history. Operator reads of
900
+ active work use it. The route is additive and keeps the protocol version. A
901
+ server without it answers the generic `no route` `404`, or its
902
+ repository-existence gate's `unknown repo` `404` for a journal-less
903
+ repository; a client surfaces either as a typed capability error and never
904
+ answers from `build-digests` or the build list instead.
905
+
805
906
  The build-stream query, artifact, ordering, timestamp, and validation rules
806
907
  apply symmetrically to repository journals, including the event-read bounded
807
908
  wait of section 3.
@@ -1243,6 +1344,8 @@ machine authentication. Its strict target is one of:
1243
1344
 
1244
1345
  - `{kind: "build-runner", id}` for an existing build;
1245
1346
  - `{kind: "build-phase", id, session}` after its `session.started` fact;
1347
+ - `{kind: "build-judge", id, session, panel, judge}` from the build's own
1348
+ runner, after the judge's `panel.judge-started` fact;
1246
1349
  - `{kind: "harvest-runner", repo, id, execution, leaseHolder}` after trusted
1247
1350
  preparation has atomically claimed the scan and recorded
1248
1351
  `harvest.execution.authorized` for that run/execution and adopted holder;
@@ -1251,22 +1354,25 @@ machine authentication. Its strict target is one of:
1251
1354
 
1252
1355
  The response is `{token}` only. Project credentials can issue only within their
1253
1356
  registered project. A runner grant may issue only an exact phase grant within
1254
- its own lifecycle binding; phase grants cannot delegate. Unknown targets are
1357
+ its own lifecycle binding, and only a build-runner grant may issue a judge
1358
+ grant; phase and judge grants cannot delegate. Unknown targets are
1255
1359
  refused. Tokens and parent secrets never become artifacts, launch envelopes or
1256
1360
  execution facts. Local-store execution requires no exchange; remote execution
1257
1361
  fails closed when issuance fails.
1258
1362
 
1259
1363
  The signed strict shape is `{version: 2, delegation: {repo, kind, id, anchor,
1260
- session?, execution?, leaseHolder?}}`. `anchor` is the authoritative event
1261
- sequence; harvest grants additionally bind the authorized execution. Session
1262
- claims exist only on phase grants. No fixed `exp` applies to this shape:
1364
+ session?, execution?, leaseHolder?, panel?, judge?}}`. `anchor` is the
1365
+ authoritative event sequence; harvest grants additionally bind the authorized
1366
+ execution. Session claims exist only on phase and judge grants, and `panel` and
1367
+ `judge` only on judge grants. No fixed `exp` applies to this shape:
1263
1368
  signature/schema verification precedes registered-project and lifecycle checks
1264
1369
  on every request, with no authorization cache. Failure to read lifecycle state
1265
1370
  fails closed. Parent credential expiry does not expire an already-issued grant.
1266
1371
  Project removal refuses all its grants immediately.
1267
1372
 
1268
1373
  Build grants live until 60 seconds after durable build termination. Phase grants
1269
- also retire 60 seconds after their own session ends, whichever comes first.
1374
+ also retire 60 seconds after their own session ends, whichever comes first;
1375
+ judge grants retire 60 seconds after their `panel.judge-ended`.
1270
1376
  Harvest grants retire 60 seconds after their run stops or their authorized
1271
1377
  execution ends/releases; harvest phases additionally retire on session end.
1272
1378
  Durable harvest suspension immediately closes the phase grant, without a grace interval.
@@ -1279,7 +1385,20 @@ survive hours-long turns, parent expiry and dispatcher/service reconstruction.
1279
1385
  A durable ending never resurrects: recovered harvest work gets a new
1280
1386
  `harvest.execution.authorized` identity and token.
1281
1387
 
1282
- Delegated same-project reads remain available, including journals, artifacts,
1388
+ A judge grant is write-only. Every read is refused with 403, including reducer
1389
+ values, artifacts, snapshots, sessions, streams and build listings, and so is
1390
+ every ticket, operator and credential-issuance request. Its one permitted
1391
+ request is `POST /builds/<id>/events` carrying a single `panel.preferred`
1392
+ attributed to its own judge session, for its own panel, judge and session,
1393
+ while that session is open and has not already preferred. Every other write is
1394
+ refused. The server checks the session and appends in one conditional step, so
1395
+ concurrent requests from one judge session record at most one preference. A
1396
+ losing request is refused with 403 ("this judge already recorded its
1397
+ preference"), exactly as a sequential retry is. If the build keeps advancing
1398
+ through repeated attempts, the request fails with 409 `conflict` and writes
1399
+ nothing; it may be retried. Requests from other judge sessions are unaffected.
1400
+
1401
+ Other delegated grants keep same-project reads, including journals, artifacts,
1283
1402
  digests, bounded state, pinned assets and collections. Writes by a build grant
1284
1403
  are confined to its build's events/deposits/artifacts, snapshots, leases and
1285
1404
  streams. Phase grants also reject agent actors naming another session, while
@@ -1448,8 +1567,8 @@ Beyond leases, the backing store must maintain:
1448
1567
 
1449
1568
  - per-build and per-repository monotonically assigned event sequences starting
1450
1569
  at 1, preserving append order and continuity across server restarts;
1451
- - atomic build-stream conditional append, including a mutation-free stale
1452
- comparison result;
1570
+ - atomic build-stream and repository-journal conditional append, including a
1571
+ mutation-free stale comparison result;
1453
1572
  - server-assigned event, record, artifact, lease, and heartbeat times;
1454
1573
  - 0-based revisions independently per resource and artifact kind, including
1455
1574
  distinct concurrent assignments;
@@ -1520,8 +1639,9 @@ Four shipped behaviors do not add `BuildStore` routes:
1520
1639
  not a deeper backing-store transaction or migration check. The example shows anonymous health on the 1.3 line; an admitted same-line protocol-7 probe sees 7 instead.
1521
1640
 
1522
1641
  There is no push/WebSocket subscription protocol, repository listing, artifact
1523
- deletion, or server deployment API. The one repo-scoped batch read is the
1524
- build-digest route of section 4; no other batch-read route exists.
1642
+ deletion, or server deployment API. The repo-scoped batch reads are the
1643
+ build-digest and open-build routes of section 4; no other batch-read route
1644
+ exists.
1525
1645
 
1526
1646
  ## 12. Conformance
1527
1647
 
@@ -100,7 +100,8 @@ loads the project's durable independent ticket policy. Project authority publish
100
100
  version 1 policy through `POST /tickets/policy`, using the usual context/input
101
101
  envelope. The input contains only `version` and `tickets`: source, teamKey,
102
102
  readyState, triageState, claimedState, doneState, createState, proposalState,
103
- optional readyLabels, and the optional backlogState and rejectedState roles. URL,
103
+ optional readyLabels, the optional backlogState and rejectedState roles, and
104
+ optional createLabels (present only when nonempty). URL,
104
105
  secrets, and pipeline configuration are rejected.
105
106
  Only project or owner authority can publish. This does not append BuildStore
106
107
  history. Registration removal invalidates policy and grants from that registration.
@@ -137,6 +138,16 @@ policy read (`input: null`) includes the roles only with the header. Every
137
138
  `x-autobuild-ticket-policy-roles: 1`; a client publishing a role that receives
138
139
  `400` without it reports that the service predates policy roles.
139
140
 
141
+ `createLabels` is `[tickets].createLabels`: the service's own operator ticket
142
+ create (MCP and `POST …/tickets`) unions it into the labels a create names.
143
+ Clients that understand it send `x-autobuild-ticket-policy-create-labels: 1`,
144
+ independently of the roles header. With it, a publish is complete and omitting
145
+ `createLabels` removes it. Without it, as from every client released before the
146
+ field, a saved `createLabels` is kept, and a policy read omits it. Every
147
+ `/tickets/*` response carries `x-autobuild-ticket-policy-create-labels: 1`; a
148
+ client publishing `createLabels` that receives `400` without it reports that
149
+ the service predates createLabels in ticket policy.
150
+
140
151
  `[tickets] url` selects the ticket service independently of the build store;
141
152
  otherwise the selected remote build store is used. A local build store requires
142
153
  an explicit ticket URL. Credentials are resolved for that selected service.
@@ -172,6 +183,8 @@ The operation names and `input` values are:
172
183
  | `state-counts` | `{names: string[]}` (1–16) | `{name, tickets}[]` for the names that resolve |
173
184
  | `list-ready` | `{labels?: string[], state?: string}` | `TicketListing` |
174
185
  | `list-targeting` | `{nodeId: string}` | `TicketListing` of every state |
186
+ | `list-page` | `{criteria: {labels?, state?}, page: {limit, offset?, order?}}` | `TicketPageListing` (`{tickets, diagnostics, total}`) |
187
+ | `search` | `{text, state?, labels?, limit, cursor?}` | `{tickets: {id, title, state?, labels, kind, target?}[], cursor?, diagnostics}` |
175
188
  | `get` | `{id}` | `Ticket \| null` |
176
189
  | `claim` | `{id}` | `{claimed: boolean}` |
177
190
  | `comment` | `{id, body}` | `{ok: true}` |
@@ -426,7 +439,7 @@ response, including errors, carries `x-autobuild-ticket-priority: 1`.
426
439
 
427
440
  `list-ready` returns urgent tickets first, then normal ones, each class in filing
428
441
  order, for every client. Ordering happens within the existing listing; it adds no
429
- per-ticket reads.
442
+ per-ticket reads. `list-ready` stays exhaustive; paged reads use `list-page`.
430
443
 
431
444
  A service whose backing source cannot store priority refuses a write naming
432
445
  `urgent` with `409 { "kind": "conflict", "code": "priority-unsupported" }` before
@@ -434,3 +447,78 @@ anything is written. A service predating priority refuses the unknown field with
434
447
  `400` validation error and no capability header. Clients report both as
435
448
  `TicketPriorityUnsupported`. Current clients omit `normal` on create, so a plain
436
449
  create still works against such a service.
450
+
451
+ ## Paged listing
452
+
453
+ `list-page` answers one window of the tickets matching `criteria`, from the
454
+ backing source's native paging. `limit` and `offset` are nonnegative integers;
455
+ `offset` defaults to 0. `order` is `oldest` (the default), which is dispatch
456
+ order: urgent first, then normal, each in filing order. `newest` is newest filed
457
+ first, regardless of urgency. Offset and limit apply after ordering, so
458
+ consecutive windows traverse the listing with no omissions or duplicates.
459
+ `total` counts every match before slicing, also for a zero limit or an offset
460
+ past the end. The service returns the page in the order the source answered;
461
+ it does not re-sort it urgent-first. Cost follows the window, not the project's
462
+ ticket count.
463
+
464
+ A backing source without native paging answers `409` with
465
+ `code: "paging-unsupported"`. The service never slices a full listing instead.
466
+ `list-page` is an operator listing: it requires project or owner authority, and
467
+ ticket grants and harvest delegations receive `403`.
468
+
469
+ Every `/tickets/*` response, including errors, carries
470
+ `x-autobuild-ticket-paging: 1`. A current client declares `listPage` only after
471
+ a response from the service has carried that header. It settles the decision on
472
+ the response that already finishes source construction (the policy sync or the
473
+ targeted-listing probe), with no extra probe. An ok response without the header
474
+ means the service predates the operation. Against such a service the client
475
+ never declares `listPage`, and paged operator listings read `list-ready` and
476
+ slice it, as for any source without native paging. A `list-page` request that the
477
+ service later refuses with `404` or `400` and no header, or answers with
478
+ `paging-unsupported`, or answers with a page that contradicts the request (more
479
+ tickets than `limit`, a window beyond `total`, or a malformed body), fails with
480
+ `HostedTicketPagingError`. There is no fallback within that call. After a
481
+ refusal without the header, the client stops declaring `listPage`, so the next
482
+ listing takes the `list-ready` path by that explicit decision.
483
+
484
+ The capability is additive. It does not change the remote BuildStore protocol
485
+ version, and released clients, which never send `list-page`, are unaffected.
486
+
487
+ ## Search
488
+
489
+ `search` answers one page of compact hits from the backing source's own search,
490
+ for duplicate checks before filing:
491
+
492
+ - **Matching.** `text` is nonblank. Every whitespace-separated term must occur,
493
+ case-insensitively, in the title or the body; each term may hit either field.
494
+ `%`, `_` and `\` are literal. `state` resolves as in `list-ready` (exact, else
495
+ one case-insensitive match); `labels` are ANDed. Absent `state` searches every
496
+ state.
497
+ - **Paging.** `limit` is an integer from 1 to 100. Order is source-defined and
498
+ stable across pages: the PostgreSQL backend answers newest ticket number
499
+ first. `cursor` is opaque; pass the previous page's `cursor` with the same
500
+ text and filters. It is absent on the last page.
501
+ - **Hits.** `id`, `title`, `state`, `labels`, `kind` and `target` come from the
502
+ search read itself. Bodies are never returned, and there is no read per hit.
503
+ - **Refusals.** A backing source without search answers `409` with
504
+ `code: "search-unsupported"`. A malformed or foreign cursor answers `400` with
505
+ `code: "search-cursor-invalid"` and the `cursor`. Clients report them as
506
+ `TicketSearchUnsupported` and `TicketSearchCursorInvalid`. The service never
507
+ filters a full listing instead.
508
+ - **Authority.** `search` is an operator read: it requires project or owner
509
+ authority, and ticket grants and harvest delegations receive `403`.
510
+ - **Cost.** One request per page, answered by PostgreSQL in one bounded
511
+ statement. Cost follows the page, not the project's ticket count.
512
+
513
+ Every `/tickets/*` response, including errors, carries
514
+ `x-autobuild-ticket-search: 1`. A current client declares `search` only after a
515
+ response from the service has carried that header, settled on the response that
516
+ already finishes source construction, with no extra probe. Against a service
517
+ predating the operation (an ok response without the header) the client never
518
+ declares `search`, so callers refuse with `TicketSearchUnsupported` before any
519
+ request and nothing is listed. A `search` request that the service later refuses
520
+ with `404` or `400` and no header fails with `TicketSearchUnsupported`, with no
521
+ fallback, and the client stops declaring `search`.
522
+
523
+ The capability is additive. It does not change the remote BuildStore protocol
524
+ version, and released clients, which never send `search`, are unaffected.