@defrex/autobuild 1.11.1 → 1.13.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 (213) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +601 -203
  3. package/bin/ab-build-runner.ts +8 -0
  4. package/docs/answering-blocked-builds.md +32 -2
  5. package/docs/architecture.md +188 -57
  6. package/docs/assets/headline-wide.png +0 -0
  7. package/docs/cli.md +1 -1
  8. package/docs/configuration.md +120 -23
  9. package/docs/dispatcher.md +19 -8
  10. package/docs/integration-overview.md +1 -1
  11. package/docs/integration-tree.md +33 -18
  12. package/docs/merge-policy.md +7 -2
  13. package/docs/operating.md +5 -3
  14. package/docs/operator-api.md +48 -25
  15. package/docs/operator-surfaces.md +39 -3
  16. package/docs/optimization-nodes.md +10 -8
  17. package/docs/plugin-authoring.md +46 -18
  18. package/docs/remote-store-protocol.md +51 -12
  19. package/docs/remote-ticket-protocol.md +85 -38
  20. package/docs/restacking.md +48 -3
  21. package/docs/setup.md +2 -1
  22. package/docs/ticket-migration.md +2 -2
  23. package/docs/ticket-sources.md +23 -8
  24. package/docs/tickets.md +4 -4
  25. package/docs/troubleshooting.md +17 -2
  26. package/docs/verification.md +3 -1
  27. package/package.json +3 -3
  28. package/packages/core/src/cli/ambient-errors.ts +17 -0
  29. package/packages/core/src/cli/bounded-io.ts +174 -0
  30. package/packages/core/src/cli/build-control.ts +72 -6
  31. package/packages/core/src/cli/dashboard/actions.ts +4 -0
  32. package/packages/core/src/cli/dashboard/integration-row.ts +43 -19
  33. package/packages/core/src/cli/dashboard/model.ts +93 -29
  34. package/packages/core/src/cli/dashboard/poll.ts +231 -34
  35. package/packages/core/src/cli/dashboard/queue.ts +21 -10
  36. package/packages/core/src/cli/dashboard/render.ts +14 -37
  37. package/packages/core/src/cli/dashboard/row-text.ts +26 -8
  38. package/packages/core/src/cli/dashboard/tone-ansi.ts +39 -0
  39. package/packages/core/src/cli/dashboard/vocabulary.ts +165 -20
  40. package/packages/core/src/cli/dispatch-frontend.ts +2 -1
  41. package/packages/core/src/cli/dispatch-handoff.ts +41 -10
  42. package/packages/core/src/cli/dispatch-launch-contract.ts +5 -0
  43. package/packages/core/src/cli/dispatch-launcher-cadence.ts +80 -0
  44. package/packages/core/src/cli/dispatch-launcher.ts +9 -10
  45. package/packages/core/src/cli/dispatch-preflight.ts +12 -3
  46. package/packages/core/src/cli/dispatch-release-observer.ts +53 -0
  47. package/packages/core/src/cli/dispatch-runtime-cache.ts +204 -82
  48. package/packages/core/src/cli/dispatch-runtime-dependencies.ts +250 -43
  49. package/packages/core/src/cli/dispatch-tickets.ts +33 -12
  50. package/packages/core/src/cli/dispatch-upgrade-install.ts +36 -16
  51. package/packages/core/src/cli/dispatch-upgrade-source.ts +8 -2
  52. package/packages/core/src/cli/dispatch-yield-observer.ts +82 -0
  53. package/packages/core/src/cli/dispatch.ts +595 -149
  54. package/packages/core/src/cli/env.ts +2 -15
  55. package/packages/core/src/cli/help.ts +43 -28
  56. package/packages/core/src/cli/main.ts +11 -7
  57. package/packages/core/src/cli/production-store.ts +102 -0
  58. package/packages/core/src/cli/publication-settlement.ts +4 -0
  59. package/packages/core/src/cli/remote-poll.ts +22 -5
  60. package/packages/core/src/cli/repo-state.ts +2 -3
  61. package/packages/core/src/cli/repository-status.ts +44 -28
  62. package/packages/core/src/cli/sessionless-store.ts +26 -0
  63. package/packages/core/src/cli/status.ts +188 -47
  64. package/packages/core/src/cli/store-opening.ts +26 -57
  65. package/packages/core/src/cli/store-ref.ts +6 -1
  66. package/packages/core/src/cli/ticket-start.ts +3 -3
  67. package/packages/core/src/cli/ticket.ts +12 -11
  68. package/packages/core/src/cli/wait.ts +8 -28
  69. package/packages/core/src/cli/watch.ts +113 -50
  70. package/packages/core/src/config/reference-metadata.ts +7 -1
  71. package/packages/core/src/config/reference.ts +5 -2
  72. package/packages/core/src/config/schema.ts +51 -16
  73. package/packages/core/src/distribution-packaging.ts +156 -18
  74. package/packages/core/src/events/catalog-identity.ts +28 -0
  75. package/packages/core/src/events/catalog.ts +3 -9
  76. package/packages/core/src/events/compatibility.ts +2 -30
  77. package/packages/core/src/events/payloads.ts +85 -14
  78. package/packages/core/src/events/policy.ts +3 -0
  79. package/packages/core/src/events/repository.ts +15 -4
  80. package/packages/core/src/events/sessions.ts +1 -1
  81. package/packages/core/src/events/validation-error.ts +12 -0
  82. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +36 -0
  83. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/0a10010ee5cf2e47.json +577 -0
  84. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/227701361be6d1e0.json +490 -0
  85. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/3064e337cc75f8d6.json +310 -0
  86. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/76e5043bae7a80ab.json +86 -0
  87. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/87a917802870bbed.json +87 -0
  88. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9d85616e5b9e24c1.json +500 -0
  89. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a1e90a969d32a367.json +307 -0
  90. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c7c94fbe7f63cf07.json +84 -0
  91. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/da3bc91c49211eab.json +310 -0
  92. package/packages/core/src/kernel/auto-merge-default.ts +2 -1
  93. package/packages/core/src/kernel/capacity-build.ts +21 -0
  94. package/packages/core/src/kernel/clean-restack-policy.ts +40 -0
  95. package/packages/core/src/kernel/discard-in-flight.ts +13 -0
  96. package/packages/core/src/kernel/dispatch-capacity.ts +578 -235
  97. package/packages/core/src/kernel/done-escalations.ts +269 -0
  98. package/packages/core/src/kernel/engine.ts +30 -17
  99. package/packages/core/src/kernel/integration-landing.ts +24 -4
  100. package/packages/core/src/kernel/integration-stack.ts +39 -0
  101. package/packages/core/src/kernel/janitor-failure.ts +20 -1
  102. package/packages/core/src/kernel/log-index-value.ts +3 -0
  103. package/packages/core/src/kernel/log-index.ts +41 -2
  104. package/packages/core/src/kernel/measurement.ts +24 -0
  105. package/packages/core/src/kernel/open-pr-backpressure.ts +3 -3
  106. package/packages/core/src/kernel/read-facts.ts +8 -370
  107. package/packages/core/src/kernel/reducer-registry.ts +43 -125
  108. package/packages/core/src/kernel/reducer-revisions.ts +18 -0
  109. package/packages/core/src/kernel/reducer-value-entry.ts +98 -0
  110. package/packages/core/src/kernel/reducer-value-index.ts +75 -0
  111. package/packages/core/src/kernel/reducer.ts +84 -16
  112. package/packages/core/src/kernel/reopen-state.ts +10 -0
  113. package/packages/core/src/kernel/repository-attention.ts +14 -5
  114. package/packages/core/src/kernel/repository-read-facts.ts +375 -0
  115. package/packages/core/src/kernel/ticket-starts.ts +15 -4
  116. package/packages/core/src/kernel/verify-stage-state.ts +145 -3
  117. package/packages/core/src/kernel/verify-stages.ts +46 -7
  118. package/packages/core/src/operator/attention.ts +28 -3
  119. package/packages/core/src/operator/done-escalations.ts +38 -0
  120. package/packages/core/src/operator/presentation.ts +14 -1
  121. package/packages/core/src/operator/protocol.ts +8 -5
  122. package/packages/core/src/operator/query.ts +72 -57
  123. package/packages/core/src/operator/registry.ts +19 -15
  124. package/packages/core/src/operator/ticket-start.ts +8 -7
  125. package/packages/core/src/operator/tickets.ts +28 -9
  126. package/packages/core/src/plugin-sdk/index.ts +10 -0
  127. package/packages/core/src/plugins/manifest.ts +14 -1
  128. package/packages/core/src/ports/forge/create.ts +8 -0
  129. package/packages/core/src/ports/forge/github-transport.ts +5 -1
  130. package/packages/core/src/ports/forge/github.ts +3 -0
  131. package/packages/core/src/ports/tickets/contract.ts +147 -76
  132. package/packages/core/src/ports/tickets/create.ts +47 -7
  133. package/packages/core/src/ports/tickets/fake.ts +8 -4
  134. package/packages/core/src/ports/tickets/file-codec.ts +4 -3
  135. package/packages/core/src/ports/tickets/file.ts +7 -3
  136. package/packages/core/src/ports/tickets/github.ts +1 -0
  137. package/packages/core/src/ports/tickets/grants.ts +11 -3
  138. package/packages/core/src/ports/tickets/hosted-index.ts +5 -0
  139. package/packages/core/src/ports/tickets/linear.ts +28 -9
  140. package/packages/core/src/ports/tickets/migration.ts +4 -4
  141. package/packages/core/src/ports/tickets/operations.ts +4 -2
  142. package/packages/core/src/ports/tickets/priority-labels.ts +213 -0
  143. package/packages/core/src/ports/tickets/priority.ts +127 -21
  144. package/packages/core/src/ports/tickets/remote-protocol.ts +10 -0
  145. package/packages/core/src/ports/tickets/remote.ts +104 -11
  146. package/packages/core/src/ports/tickets/revision.ts +5 -3
  147. package/packages/core/src/ports/tickets/search.ts +9 -0
  148. package/packages/core/src/ports/tickets/tree.ts +8 -6
  149. package/packages/core/src/ports/types.ts +30 -15
  150. package/packages/core/src/ports/workspace/build-execution.ts +4 -0
  151. package/packages/core/src/ports/workspace/builtin-capabilities.ts +4 -0
  152. package/packages/core/src/ports/workspace/create.ts +16 -3
  153. package/packages/core/src/ports/workspace/execution-exit-marker.ts +41 -0
  154. package/packages/core/src/ports/workspace/fake.ts +15 -3
  155. package/packages/core/src/ports/workspace/recovery-step.ts +101 -0
  156. package/packages/core/src/ports/workspace/vercel-sandbox.ts +510 -145
  157. package/packages/core/src/processes/build-execution-state.ts +4 -0
  158. package/packages/core/src/processes/build-runner.ts +14 -1
  159. package/packages/core/src/processes/dispatcher.ts +777 -288
  160. package/packages/core/src/processes/execution-no-progress.ts +1 -0
  161. package/packages/core/src/processes/execution-settlement.ts +1 -0
  162. package/packages/core/src/processes/harvest-runner.ts +12 -7
  163. package/packages/core/src/processes/infrastructure-failure-budget.ts +7 -2
  164. package/packages/core/src/processes/invocation-budget.ts +176 -0
  165. package/packages/core/src/processes/publication-loss.ts +38 -3
  166. package/packages/core/src/processes/workspace-preservation.ts +86 -15
  167. package/packages/core/src/store/contract.ts +81 -3
  168. package/packages/core/src/store/event-reads.ts +30 -1
  169. package/packages/core/src/store/local/capabilities.ts +115 -0
  170. package/packages/core/src/store/local/store.ts +86 -56
  171. package/packages/core/src/store/reduced-reads.ts +32 -1
  172. package/packages/core/src/store/reducer-value-read.ts +235 -0
  173. package/packages/core/src/store/reducer-value-shapes.json +6722 -6475
  174. package/packages/core/src/store/reducer-value-validation.ts +181 -33
  175. package/packages/core/src/store/reducer-values.ts +36 -204
  176. package/packages/core/src/store/remote/client.ts +169 -29
  177. package/packages/core/src/store/remote/compatibility.ts +113 -56
  178. package/packages/core/src/store/remote/credentials.ts +4 -1
  179. package/packages/core/src/store/remote/protocol.ts +3 -0
  180. package/packages/core/src/store/remote/released-clients.json +22 -0
  181. package/packages/core/src/store/remote/released-reducer-values/1.12.0.json +35806 -0
  182. package/packages/core/src/store/remote/released-reducer-values/1.13.0.json +35966 -0
  183. package/packages/core/src/store/remote/released-reducer-values/index.ts +20 -16
  184. package/packages/core/src/store/remote/released-value-policy.ts +144 -0
  185. package/packages/core/src/store/remote/retry.ts +406 -0
  186. package/packages/core/src/store/rollup-lease.ts +41 -0
  187. package/packages/core/src/store/rollups.ts +7 -38
  188. package/packages/core/src/store/snapshots.ts +1 -1
  189. package/packages/core/src/testing/dispatch-read-budget.ts +409 -14
  190. package/packages/core/src/testing/import-graph.ts +78 -0
  191. package/packages/core/src/testing/index.ts +2 -0
  192. package/packages/core/src/testing/invocation-budget.ts +42 -0
  193. package/packages/core/src/testing/reduced-read-budget.ts +602 -40
  194. package/packages/core/src/testing/released-value-coverage.ts +423 -0
  195. package/packages/core/src/testing/slot-agreement.ts +52 -0
  196. package/packages/core/src/web/assets/app.js +5 -5
  197. package/packages/core/src/web/overview-source.ts +19 -6
  198. package/skills/guide/SKILL.md +245 -103
  199. package/skills/guide/references/integration-tree.md +33 -18
  200. package/skills/guide/references/merge-policy.md +7 -2
  201. package/skills/guide/references/operator-api.md +48 -25
  202. package/skills/guide/references/optimization-nodes.md +10 -8
  203. package/skills/guide/references/plugin-authoring.md +46 -18
  204. package/skills/guide/references/remote-store-protocol.md +51 -12
  205. package/skills/guide/references/remote-ticket-protocol.md +85 -38
  206. package/skills/guide/references/restacking.md +48 -3
  207. package/skills/guide/references/setup.md +2 -1
  208. package/skills/guide/references/ticket-migration.md +2 -2
  209. package/skills/operate/SKILL.md +114 -65
  210. package/skills/plan/SKILL.md +4 -3
  211. package/skills/spec/SKILL.md +9 -5
  212. package/skills/tickets/SKILL.md +25 -17
  213. package/templates/hosted-service/package.json +2 -2
@@ -122,7 +122,7 @@ record calls for action. It reports failed node verification, build escalations,
122
122
  harvest escalations/recovery exhaustion, automatic upgrade failures and runtime rollbacks, rejected configuration, reloads needing
123
123
  restart, abnormal dispatcher stops/loss, abandoned ticket preparations, ticket hand-backs (`ticket.handed-back`), single-ticket start settlements (`ticket.start-settled`), ticket-source and forge degradation past reset (15 minutes
124
124
  for ticket sources without reset), forge rate limits outside the dispatcher's credential
125
- (`forge.credential-limited`), configured hook failures and skips (`hook.*`), and five minutes of continuous tick failures. Advertised resets
125
+ (`forge.credential-limited`), configured hook failures and skips (`hook.*`), and five minutes of continuous tick failures across consecutive runs, including one-tick hosted runs. Remote store and hosted ticket requests retry transient unavailability briefly; a blip that outlasts the retries, including in hosted ticket policy sync, fails that tick without an abnormal stop. Advertised resets
126
126
  wait for a post-reset tick to finish before requiring action; ordinary recovery
127
127
  on that retry stays silent. Source grace and cooldown-driven failures do not
128
128
  start the tick-failure clock. When failure writes are unavailable, dispatch watch
@@ -152,8 +152,12 @@ registration identity. A separate unflagged diagnostic watch or wait must never
152
152
  replace the standing monitor or supply its resume cursor.
153
153
  Named diagnostic watches end when all named builds
154
154
  are terminal; add `--repository` for repository attention. With no slugs all
155
- active builds and repository attention are included. Reconcile status after
156
- arming because historical build attention is silently baselined.
155
+ active builds and repository attention are included. Once a build is terminal
156
+ and settled (no pending cleanup, reclaim, open execution or integration audit),
157
+ the watch delivers its events through settlement, then retires it from tracking
158
+ and later cursors, so re-arming never accumulates finished builds; named builds
159
+ are never retired. Reconcile status after arming because historical build
160
+ attention is silently baselined.
157
161
 
158
162
  Add an extra monitor only for an identified need, such as a human asking
159
163
  to hear when a particular build merges or an outcome triggering follow-up work.
@@ -164,7 +168,8 @@ An extra monitor supplements the default standing watch.
164
168
  `ab wait [<slug>...] (--for <condition> | --event <glob>) [--since <cursor>] [--json]`
165
169
  uses the same hosted resume window and expiry recovery as watch, and blocks until a condition holds and prints one record. `--for` state conditions
166
170
  are also satisfied immediately by a build already in that state; `--event` is
167
- satisfied only by new events. Conditions include `attention`,
171
+ satisfied only by new events. Conditions are lifecycle statuses, not the
172
+ dashboards' status words, and include `attention`,
168
173
  `blocked`, `paused`, `running`, `done`, `aborted`, `terminal`, `pr=merged`,
169
174
  `pr=closed`, `pr=conflicted`, and `phase=<phase>`. Exit codes: 0 satisfied,
170
175
  1 usage or store error, 2 every named build is terminal without satisfying a
@@ -203,6 +208,12 @@ including inside background shells and harness monitors. Do not rely on a
203
208
  shell alias or function that those facilities may lose. Never block a
204
209
  foreground command for their whole duration.
205
210
 
211
+ A watch or wait that exits 1 with `incompatible reducer …` means this CLI and
212
+ the service disagree on a reduced value. Retrying cannot fix it, so do not
213
+ re-arm in a loop. Align them, service first and then the project's Autobuild,
214
+ or run the CLI that matches the service, then re-arm. If you cannot align them,
215
+ report it to the human.
216
+
206
217
  Ticket-source degradation records mean dispatch intake cannot evaluate the source;
207
218
  existing builds may still advance. Inspect `ab repository status --json` for the
208
219
  active cause, operation, message, and expected reset. Reset times are advisory;
@@ -272,7 +283,7 @@ that appear after you arm. Finishing the initially queued set is no reason to st
272
283
  no build slug: inspect repository status. Re-arm from the standing watch's
273
284
  latest cursor, including its trailing cursor after a timeout or count exit.
274
285
  4. Report each merged, closed or aborted outcome and file or move tickets when
275
- warranted. A conflict or escalation requires action. Keep the standing watch
286
+ warranted. An escalation requires action. Keep the standing watch
276
287
  alive and keep discovering work until the human ends or hands off the role.
277
288
 
278
289
  Use `ab wait` and named unflagged watches only as separate diagnostics. They
@@ -283,20 +294,30 @@ is not exposed there, and its
283
294
 
284
295
  ### Inspect
285
296
 
286
- - `ab builds [--queued] [--all] [--json]` — builds and their effective status.
297
+ - `ab builds [--queued] [--all] [--json]` — builds and their status words.
287
298
  Active builds by default; `--queued` adds queued builds; `--all` is an
288
299
  explicit historical listing of every build, for when you were asked for
289
- history, not for routine reconciliation.
290
- A build parked on a ticket wait lists as `waiting`, with `waiting on <ids>`
291
- after its phase; in `--json` its `status` stays `blocked` and `wait` carries
292
- `state` and `tickets`.
293
- - `ab build status <slug> [--events N]` — one build's detail, chronological runner
294
- attaches with runtime identity, and recent events. Historical runtime is null
295
- in JSON and unrecorded in human output.
300
+ history, not for routine reconciliation. `STATUS` is the shared status word
301
+ with its note (`WAITING (merge decision)`, `QUEUED (resume)`); a green word
302
+ means the build holds a slot. In `--json`, `statusWord` carries the word,
303
+ tone and note while `status` stays the reducer's lifecycle status.
304
+ A build parked on a ticket wait lists as `WAITING (on <ids>)`, with
305
+ `waiting on <ids>` after its phase; in `--json` its `status` stays `blocked`
306
+ and `wait` carries `state` and `tickets`.
307
+ The `SLOT` column (`slot` in `--json`) says whether the build holds a slot,
308
+ has requested one (`resume`, `reconcile`, `verification`, `reopen` or
309
+ `propose`, maybe with its `urgent`, `high` or `low` level) or holds none, by the rules the dispatcher admits
310
+ work by. `unknown`, or no `slot`, means an older server; never read it as none.
311
+ - `ab build status <slug> [--events N]` — one build's detail, its `slot:` line
312
+ (`slot` in JSON), chronological runner attaches with runtime identity, and
313
+ recent events. Historical runtime is null in JSON and unrecorded in human
314
+ output.
296
315
  - `ab repository status` — the repository's derived status, including the lease
297
- holder’s recorded runtime version, commit, and source kind/location, and the
298
- latest scan's queue diagnostics and startup warnings, and each configured
299
- hook's last delivery, backlog and failure. Historical runtime is
316
+ holder’s recorded runtime version, commit, and source kind/location, the
317
+ latest scan's queue diagnostics and startup warnings, each configured
318
+ hook's last delivery, backlog and failure, and a `slots:` line after
319
+ `capacity:` grouping builds as held, requested or none (`capacity.slots` in
320
+ JSON; `occupied` counts its held entries). Historical runtime is
300
321
  null in JSON and unrecorded in human output.
301
322
  - `ab artifact` — fetch one artifact's bytes.
302
323
 
@@ -319,17 +340,25 @@ Read events with a cursor or a small `--events` count; logs are long.
319
340
  resumes under the revised spec and its publication is confirmed; a finished
320
341
  leaf waiting for its merge decision revises with `ab reopen`. Answering a
321
342
  ticket wait's escalation ends the wait early; the dispatcher ends it when its
322
- tickets complete (see ticket wait attention). Run
323
- `ab help answer` for the full menu.
343
+ tickets complete (see ticket wait attention). A blocked build holds no slot
344
+ once nothing is still working on it, and an answer does not give it one: it
345
+ waits as a `resume` request ahead of ticket claims at its level (higher
346
+ levels first) until a slot frees. A build whose other verify steps, launch or
347
+ execution still run keeps its slot through the answer and requests nothing.
348
+ On a done build it only acknowledges open escalations (for example, a
349
+ post-landing integration audit), leaving the build done; other forms are
350
+ refused. Run `ab help answer` for the full menu.
324
351
  - `ab pause <slug>` / `ab resume <slug>`; `ab pause --all` / `ab resume --all`
325
352
  hold and release the whole repository. Pause immediately interrupts live agent
326
353
  sessions and acknowledges after they stop. Resume continues the same native
327
354
  session where supported; remote or unsupported sessions rerun fresh, with a
328
355
  reason recorded in session.resume-fallback. Without a live agent (including
329
- check-only verify), pause still takes effect at the next boundary.
356
+ check-only verify), pause still takes effect at the next boundary. A paused
357
+ build holds no slot once the pause is acknowledged; resumed, it waits for a
358
+ slot ahead of ticket claims at its level like an answered build.
330
359
  - `ab abort <slug> [--to triage|ready] [--reason <text>]` — destructive:
331
360
  closes the PR, removes branches, and hands the ticket back to triage by
332
- default. To free a build's slot while it waits on other work, use
361
+ default. To send back a build that waits on other work, use
333
362
  `--to ready`: the ticket goes straight to ready with its blockers kept and
334
363
  redispatches once they merge, so it needs no second move. A ticket that no
335
364
  longer conforms to the spec standard falls back to triage, and the comment
@@ -352,13 +381,14 @@ Read events with a cursor or a small `--events` count; logs are long.
352
381
  blocked one), merged or closed PRs (file a new ticket), and pending abort or
353
382
  discard. Re-run `ab reopen` with the same arguments after an interrupted spec
354
383
  reopen; it completes the recorded one.
355
- - `ab start <ticket-id> [--priority manual|urgent|normal] [--cancel]` — ask
384
+ - `ab start <ticket-id> [--priority manual|urgent|high|normal|low] [--cancel]` — ask
356
385
  the running dispatcher to claim one ticket on its next tick with a free slot,
357
386
  even while intake is off or open-PR backpressure is engaged, and no other.
358
- The default `manual` priority goes ahead of all waiting work, urgent included;
359
- choose `urgent` when urgent waiting builds should still go first (the build
360
- is then urgent), or `normal` when the ticket should wait behind normal
361
- waiting builds and urgent tickets. Repeating it with another priority
387
+ The default `manual` priority goes ahead of all waiting work, urgent included,
388
+ and the build takes its ticket's level. Choose a level (`urgent`, `high`,
389
+ `normal` or `low`) when waiting builds at that level or above, and
390
+ higher-level tickets, should still go first; the build then takes that
391
+ level. Repeating it with another priority
362
392
  updates the pending request. Use it to work a backlog one ticket at a time, or to run a single fix,
363
393
  instead of turning intake on or moving other tickets out of ready. Every gate
364
394
  still applies (ready state, spec standard, resolved blockers, no active
@@ -416,27 +446,30 @@ filed from a forge issue carries it with `--issues N` (`closes`), or
416
446
  ticket into the ready state sends it to dispatch — do that only when the
417
447
  ticket genuinely conforms and the human's intent is clear.
418
448
 
419
- The dispatcher claims urgent ready tickets before normal ones, each in source
420
- order, and ahead of normal builds waiting for a slot to re-verify, reconcile or
421
- resume. To expedite a ticket, such as a fix for a stuck build, mark it urgent
422
- with `--priority urgent` on create or update; never move other ready tickets
423
- out of ready to make room. A claimed ticket's priority becomes its build's,
424
- except that an optimization node's attempts claim at the node's current
425
- priority; a claimed attempt keeps its own.
449
+ Ticket priority is `urgent`, `high`, `normal` (the default) or `low`. The
450
+ dispatcher claims ready tickets by level, urgent first and low last, each
451
+ level in source order and ahead of lower-level builds waiting for a slot to
452
+ re-verify, reconcile or resume. To expedite a ticket, such as a fix for a
453
+ stuck build, mark it `urgent` (an emergency) or `high` (ahead of routine work)
454
+ with `--priority` on create or update; mark background work `low`. Never move
455
+ other ready tickets out of ready to make room. A build takes its ticket's
456
+ level, except that an optimization node's attempts claim at the node's
457
+ current level; a claimed attempt keeps its own.
426
458
  To expedite a build that already exists — a waiting reconcile or re-verify
427
- that now blocks other work — run `ab priority <slug> urgent` (MCP:
459
+ that now blocks other work — run `ab priority <slug> urgent` or `high` (MCP:
428
460
  `builds.control` with action `priority` and `priority: "urgent"`); `normal`
429
- returns it to normal order. Free slots go to `manual` start requests, urgent
430
- waiting work, urgent tickets (urgent start requests first), normal waiting
431
- work, then normal tickets (normal start requests first); an `ab start`
432
- request goes ahead per its tier. Urgency never preempts a
433
- running build, and a blocked urgent ticket still waits on its blockers. A
434
- source that cannot store priority refuses `urgent` and names itself; tell the
435
- human.
461
+ returns it to normal order and `low` defers it. Free slots go to `manual`
462
+ start requests, then for each level from urgent to low, that level's waiting
463
+ work, then its start requests and ready tickets; an `ab start` request goes
464
+ ahead per its tier. Priority never preempts a running build, and a blocked
465
+ ticket still waits on its blockers. A
466
+ priority refusal comes only from a hosted service too old to store the
467
+ level; tell the human.
436
468
 
437
469
  When ready tickets sit unclaimed with free slots, check
438
470
  `capacity.backpressure` in `ab repository status --json`. While `active` is
439
- true, `[policy].maxOpenPrs` open-PR backpressure is pausing normal claims
471
+ true, `[policy].maxOpenPrs` open-PR backpressure is pausing claims of
472
+ `high`, `normal` and `low` tickets
440
473
  until the open root PR count drains to `resumeOpenPrs` (below `maxOpenPrs`
441
474
  when the two are equal); urgent tickets still dispatch. Relieve it by getting PRs merged or closed (or, where the repository
442
475
  sets `excludeHeldOpenPrs`, by holding them), not by raising `capacity`.
@@ -530,7 +563,9 @@ external harness belongs to that harness. Protocol session approval answers are
530
563
  ### Each round
531
564
 
532
565
  Begin every operator round with `repository.attention`. One call returns
533
- everything waiting on you: blocked builds with their open escalation questions,
566
+ everything waiting on you: blocked builds with their open escalation questions
567
+ (including done builds with an open escalation, which `builds.answer`
568
+ acknowledges while the build stays done),
534
569
  merges awaiting consent or held, repository attention events after your cursor,
535
570
  builds paused, stalled or failing verification, and dispatcher attention. Each
536
571
  item's `resolve` names the tool call that acts on it, primary first; `by:
@@ -578,7 +613,9 @@ that does the job, and say what you are doing before you do it:
578
613
  verifies; leaves require an escalation and restart from plan after any unfinished reconcile
579
614
  resumes under the revised spec and its publication is confirmed. Answering a
580
615
  ticket wait's escalation ends the wait early; the dispatcher ends it when its
581
- tickets complete.
616
+ tickets complete. On a done build it only acknowledges open escalations
617
+ (guidance or retry, for example a post-landing integration audit), leaving the
618
+ build done; other resolutions are refused.
582
619
  - `builds.reopen` — send a finished, unmerged leaf back with `feedback`, a spec
583
620
  `revision` (`{origin: "body" | "ticket", body}`, destructive — it replaces the
584
621
  spec), or both, exactly as `ab reopen` does. Feedback returns to implement; a
@@ -593,14 +630,16 @@ that does the job, and say what you are doing before you do it:
593
630
  - `tickets.create` — file a new ticket from a conversation. A ticket filed
594
631
  from a forge issue carries it in `issueLinks` as `{issue}` (intent `closes`,
595
632
  the default) or `{issue, intent: "refs"}` when the work only partly
596
- addresses it. `priority: "urgent"` dispatches it before normal ready work
597
- and normal waiting builds. Its `labels` are unioned with the repository's
633
+ addresses it. `priority` is `urgent`, `high`, `normal` (the default) or
634
+ `low`; ready work dispatches by level, urgent first, each level ahead of
635
+ lower-level waiting builds. Its `labels` are unioned with the repository's
598
636
  `[tickets].createLabels`, and harvest proposals carry them too.
599
637
  - `tickets.update`, `tickets.block`, `tickets.unblock` — edit fields and
600
638
  blocker relations. `issueLinks` on update replaces the whole set;
601
- `priority` (`urgent` or `normal`) expedites a ticket instead of moving other
602
- ready tickets aside, and a source that cannot store it refuses `urgent` with
603
- `code: "priority-unsupported"`.
639
+ `priority` (`urgent`, `high`, `normal` or `low`; omitted leaves it alone)
640
+ expedites a ticket instead of moving other ready tickets aside. Any other
641
+ value is refused. `code: "priority-unsupported"` comes only from a hosted
642
+ service, or a raw source, that cannot store the level.
604
643
  - `tickets.move` — move a ticket between workflow states, by native `state`
605
644
  or by lifecycle `role` (`triage`, `ready`, `backlog`, `rejected`; give
606
645
  exactly one). Use `role` for deferring and declining work, with the same
@@ -609,7 +648,7 @@ that does the job, and say what you are doing before you do it:
609
648
  genuinely conforms and the human's intent is clear.
610
649
  - `tickets.start` — ask the running dispatcher to start one ticket even while
611
650
  intake is off, as `ab start` does, with optional `priority` (`manual` by
612
- default, `urgent` or `normal`, chosen as for `ab start`); `cancel: true`
651
+ default, or `urgent`, `high`, `normal` or `low`, chosen as for `ab start`); `cancel: true`
613
652
  withdraws a pending request. The outcome arrives as `ticket.start-settled` in `repository.events`.
614
653
  - `tickets.asset.attach`, `tickets.asset.get`, `tickets.asset.remove` — attach,
615
654
  read and remove ticket assets with base64 bytes, as `ab ticket attach`,
@@ -705,9 +744,9 @@ Treat every default-watch record as a call to act:
705
744
  dispatcher.
706
745
  - Dispatcher loss, abnormal stop, restart-required reload, rejected config, or
707
746
  persistent tick failure: diagnose through repository status and report the
708
- condition to the human. Repository read failures fail the watch tick and
709
- retry on the next tick, using the existing five-minute persistent-failure
710
- attention. For validation failures, inspect the stored tick error for reducer,
747
+ condition to the human. Repository read failures and exhausted transient
748
+ store or ticket-service failures fail the tick and retry on the next tick,
749
+ using the existing five-minute persistent-failure attention. For validation failures, inspect the stored tick error for reducer,
711
750
  scope, cursor, field path, and running version/commit. Follow the ownership rules below before considering a new dispatcher.
712
751
  - Persistent source degradation: inspect the source cause and reset evidence,
713
752
  diagnose and report the continuing intake problem.
@@ -850,10 +889,10 @@ verification receipts and node children/completeness. Unknown completeness is
850
889
  not zero children. A changed head or parent must regain current verification;
851
890
  unfinished or automatically authorized candidates do not ask for attention.
852
891
  Queued and held candidates hold no capacity slot; one that must re-verify or
853
- reconcile waits for a slot ahead of normal ticket claims (urgent work first), so
892
+ reconcile waits for a slot ahead of ticket claims at its level (higher levels first), so
854
893
  a full repository delays it without failing it. A build waiting on other
855
- tickets holds no slot either, and takes one ahead of normal claims once its
856
- wait ends.
894
+ tickets, paused, or blocked on a question with nothing still working on it
895
+ holds no slot either, and takes one ahead of claims at its level once its wait ends.
857
896
 
858
897
  Select a queue build in the terminal and use `l merge` or `o hold`, or run
859
898
  `ab merge <slug>` / `ab hold <slug>`. MCP uses `builds.control` with action `merge`
@@ -871,18 +910,22 @@ the rejected role no longer does. When integration
871
910
  verification fails, file a repair child targeting that node and let it merge
872
911
  before retrying the node cycle.
873
912
 
874
- Watch for decisions and conflicts with `ab watch --operator --json`; save its opaque cursor
913
+ Watch for decisions and escalations with `ab watch --operator --json`; save its opaque cursor
875
914
  and resume with `ab watch --operator --since <watch-cursor> --json`. On
876
915
  `cursor-too-old`, re-arm without `--since`, reconcile status and acknowledge the
877
916
  unavailable historical gap. Default attention includes
878
- failed node verification (`integration.verification-failed`), node merges, node item conflicts, conflicted leaf replays, revoked protected consent (`landing.consent-revoked`), failing forge CI on a finished leaf (`pr.checks-failed`), optimization noise above ε (`optimization.noise-exceeded`) and derived
917
+ failed node verification (`integration.verification-failed`), node merges, revoked protected consent (`landing.consent-revoked`), failing forge CI on a finished leaf (`pr.checks-failed`), optimization noise above ε (`optimization.noise-exceeded`) and derived
879
918
  `build.consent-ready` observations, including already-ready merges on first
880
919
  repository-wide discovery. Readiness is identified by its durable
881
920
  entry position: resuming suppresses the same episode, while a new candidate or
882
921
  exit/re-entry can notify again. Explicit `--event` globs remain event-only.
922
+ Routine restack conflicts (node item conflicts, conflicted leaf replays) are
923
+ resolved automatically and stay silent; an unresolvable one arrives as an
924
+ escalation or `landing.consent-revoked`. Follow them explicitly with
925
+ `--event restack.replayed` or `--event node.item-conflicted`.
883
926
  Use `ab wait --for consent --for node-merged --for restack-conflicted --json`
884
927
  for one wake; state waits return immediately when already satisfied. `--for
885
- attention` also includes current failed node verification, consent readiness, janitor failure attention, an open janitor escalation and merge/conflict attention.
928
+ attention` also includes current failed node verification, consent readiness, janitor failure attention, an open janitor escalation and merge attention.
886
929
  Resume event backlogs with `--since <cursor>`; keep handling emitted records
887
930
  before interpreting terminal completion.
888
931
 
@@ -897,8 +940,9 @@ raise with its own event type.
897
940
 
898
941
  ### Ticket wait attention
899
942
 
900
- A build that `ab builds` and both dashboards show as `waiting` / `WAITING`,
901
- with an amber `waiting on <ids> — <reason>` line, is a ticket wait. It is not
943
+ A build that `ab builds` and both dashboards show as `WAITING` with an
944
+ `on <ids>` note, and an amber `waiting on <ids> — <reason>` line, is a ticket
945
+ wait. It is not
902
946
  a red blocker; its escalation question begins `Waiting on`. Its agent declared with `ab wait-on` that it cannot proceed until
903
947
  the named tickets complete, and the dispatcher recorded them in the build
904
948
  ticket's `blockedBy`. It holds no capacity slot and keeps its branch and
@@ -907,8 +951,8 @@ Drive the named tickets to completion: the dispatcher ends the wait on its
907
951
  first tick after every named ticket completes, with no answer needed, and a
908
952
  wait with some tickets still open stays in place. Answer sooner only when the
909
953
  needed work landed another way or the wait is mistaken; any answer ends the
910
- wait early. Either way the build then takes a
911
- slot ahead of normal ticket claims (urgent work first). If its target moved, it first restacks onto the
954
+ wait early. Either way the build then waits as a `resume` request and takes a
955
+ slot ahead of ticket claims at its level (higher levels first). If its target moved, it first restacks onto the
912
956
  target's current head, so the resumed phase sees the merged blockers;
913
957
  `ab build status` shows a `restack:` line with trigger `wait-resume`, and a
914
958
  conflicting restack shows as `reconcile` before the phase resumes (a conflict
@@ -994,9 +1038,9 @@ when to stop, and landing the result.
994
1038
  The dispatcher applies the change on its next tick, with no replanning and
995
1039
  running attempts untouched. Lowering the threshold to the current value, or a
996
1040
  budget to what is already spent, stops the node on that tick.
997
- - **Speed up its attempts** with `ab priority <node> urgent`: attempts claimed
998
- afterwards take the urgent tier. No slot is reserved and nothing running is
999
- preempted; attempts already claimed keep their priority.
1041
+ - **Speed up or defer its attempts** with `ab priority <node> urgent|high|normal|low`:
1042
+ attempts claimed afterwards take that level. No slot is reserved and nothing
1043
+ running is preempted; attempts already claimed keep their level.
1000
1044
  - **Stop it** with `ab objective <node> --stop` to take the progress so far.
1001
1045
  Without a flag the objective's stop mode applies, `abort` unless the objective
1002
1046
  says otherwise. `--stop --abort` cancels queued attempts and aborts running
@@ -1036,6 +1080,11 @@ required by proven history. This reconstruction consumes no infrastructure
1036
1080
  attempt and no additional conflict occurrence; it needs no operator guidance.
1037
1081
  A bare retry also clears an existing infrastructure-limit escalation through
1038
1082
  ordinary retry semantics. Unavailable inspection defers rather than proving loss.
1083
+ An infrastructure-limit escalation that says `at step resume` usually means a
1084
+ slow cold resume of a stopped sandbox: retry, or suggest raising
1085
+ `recoveryTimeoutMs` within the hosted invocation budget. `at step fence` or
1086
+ `at step cleanup` points at sandbox or provider state worth checking before a
1087
+ retry; `at step preserve` at the checkout, forge credentials or branch.
1039
1088
 
1040
1089
  Leaf restack and reconcile publication retry classified transient forge or transport
1041
1090
  failures six times after the initial attempt, waiting 30, 60, 120, 240, 300 and
@@ -124,9 +124,10 @@ verdict.
124
124
  If the approved selection later names any step absent from the cycle's pinned
125
125
  configured universe, the entire selection falls back to all configured optional
126
126
  steps. The kernel records one observation per cycle and plan revision naming
127
- the unknown steps. Mandatory steps, path applicability and post-reconcile policy
128
- still apply. A valid selection continues to skip genuinely omitted optional
129
- steps. Strict validation when depositing a new plan is unchanged.
127
+ the unknown steps. Mandatory steps, path applicability and post-reconcile and
128
+ clean-restack policies still apply. A valid selection continues to skip
129
+ genuinely omitted optional steps. Strict validation when depositing a new plan
130
+ is unchanged.
130
131
 
131
132
  ## What a plan contains
132
133
 
@@ -164,15 +164,19 @@ keep the Evidence citation.
164
164
 
165
165
  When grooming established that the ticket must go next — for example a fix
166
166
  that unblocks a stuck build — create it with `--priority urgent` so the
167
- dispatcher claims it before normal ready work and normal waiting builds, and
168
- claims it even while open-PR backpressure pauses normal intake. Otherwise omit
169
- the flag; normal is the default. A source that cannot store priority refuses
170
- the create and names itself; file it normal and tell the human so the operator can expedite it.
167
+ dispatcher claims it before all other ready work and lower-level waiting
168
+ builds, and claims it even while open-PR backpressure pauses other intake.
169
+ When grooming ranked it more or less important than routine work, use
170
+ `--priority high` (claimed ahead of routine work, without urgent's
171
+ backpressure bypass) or `--priority low` (claimed only when no higher-level
172
+ work wants the slot). Otherwise omit the flag; normal is the default. If the
173
+ create is refused with a priority error (a hosted service too old to store the
174
+ level), file it normal and tell the human so the operator can expedite it.
171
175
 
172
176
  When the explicitly named destination equals `[tickets].readyState`, tell the
173
177
  human in the completion response that the ticket may be claimed by the next
174
178
  dispatch once the repository's label, dependency, intake, capacity, and other
175
- readiness gates are satisfied, after any urgent ready tickets. Before ready filing, follow
179
+ readiness gates are satisfied, after any higher-level ready tickets. Before ready filing, follow
176
180
  [After filing: check operator presence](#after-filing-check-operator-presence):
177
181
  with a live operator, say the existing operator will pick it up; without one,
178
182
  say you will operate it. The human's explicit instructions override either default.
@@ -139,7 +139,7 @@ states the work could be in with `ab ticket list --state <state>` before
139
139
  filing.
140
140
 
141
141
  ```
142
- ab ticket create "Rate-limit auth endpoints" --body spec.md [--labels bug,api] [--blocked-by file-1,file-2] [--issues 824,820:refs] [--priority urgent] [--assignees alice,me]
142
+ ab ticket create "Rate-limit auth endpoints" --body spec.md [--labels bug,api] [--blocked-by file-1,file-2] [--issues 824,820:refs] [--priority urgent|high|normal|low] [--assignees alice,me]
143
143
  ```
144
144
 
145
145
  It lands in `triage/` and prints the new id. `--body` is a file, and its
@@ -150,8 +150,10 @@ spec gets bounced back to `triage/` by the dispatcher rather than built.
150
150
  Blocker ids are source-local; every blocker must exist before creation
151
151
  succeeds. When the ticket originates from a forge issue, attach it with
152
152
  `--issues`: `N` (intent `closes`, the default) when the ticket fully resolves
153
- the issue, `N:refs` when it only partly addresses it. `--priority urgent` makes
154
- the dispatcher claim it before normal ready work; omit it for normal.
153
+ the issue, `N:refs` when it only partly addresses it. `--priority` takes
154
+ `urgent`, `high`, `normal` (the default) or `low`; the dispatcher claims
155
+ ready work by level, so `urgent` goes before all other ready work and `low`
156
+ after it.
155
157
  `--assignees` assigns the ticket on a source that stores assignees (GitHub):
156
158
  usernames, or `me` for the owner of the GitHub credential. Without it, a
157
159
  configured `[tickets].createAssignee` assigns the ticket, and `--assignees ''`
@@ -207,10 +209,13 @@ ab ticket unblock file-3 file-1
207
209
 
208
210
  Update is partial: omitted fields stay untouched, while an explicitly empty
209
211
  `--labels` clears labels. `--issues` replaces the whole set of issue links and
210
- `--issues ''` clears it. `--priority urgent|normal` sets the dispatch class;
211
- the file tracker writes `priority = "urgent"` and removes the key for normal. A
212
- source that cannot store priority refuses `urgent`, names itself, and writes
213
- nothing; `normal` succeeds there. `--assignees` replaces the whole set of
212
+ `--issues ''` clears it. `--priority urgent|high|normal|low` sets the level and
213
+ omitting it leaves the level alone; any other value is refused before anything
214
+ is written. The file tracker writes `priority = "<level>"` and removes the key
215
+ for normal. GitHub and plugin sources without native priority store it as one
216
+ `priority:urgent`, `priority:high` or `priority:low` label, shown as the
217
+ ticket's priority, not among its labels; set it with `--priority`, never
218
+ `--labels`, which refuses priority labels. `--assignees` replaces the whole set of
214
219
  assignees, `--assignees ''` clears it, and omitting it leaves them alone;
215
220
  `ab ticket show` prints them and JSON reads carry an `assignees` array. Hand a
216
221
  GitHub ticket to someone else this way. A source that cannot store assignees
@@ -267,15 +272,18 @@ another move to `ready/`, subject to the remaining dispatch gates and available
267
272
  capacity. Blocker edits must use the source-agnostic `ab ticket block` and
268
273
  `ab ticket unblock` commands shown above.
269
274
 
270
- With a free slot the dispatcher claims eligible urgent tickets first, then
271
- normal ones, each in source order; urgent tickets also go ahead of normal
272
- builds waiting to re-verify, reconcile or resume. A blocked urgent ticket waits
273
- while normal work proceeds, and urgency never stops a running build. To
274
- expedite a ticket, mark it urgent rather than moving other tickets out of
275
- `ready/`. Editing a ticket's priority after it is claimed does not change its
276
- build; the operator runs `ab priority <slug> urgent` for that.
275
+ With a free slot the dispatcher claims eligible tickets by level, `urgent`,
276
+ `high`, `normal`, then `low`, each level in source order; each level also
277
+ goes ahead of lower-level builds waiting to re-verify, reconcile or resume.
278
+ Each build takes its ticket's level. A blocked ticket waits while
279
+ lower-level work proceeds, and priority never stops a running build. To
280
+ expedite a ticket, mark it `urgent` or `high` rather than moving other
281
+ tickets out of `ready/`. Editing a ticket's priority after it is claimed does
282
+ not change its build; the operator runs `ab priority <slug> <level>` for
283
+ that.
277
284
  When `[policy].maxOpenPrs` is set and that many root PRs are open and unmerged,
278
- open-PR backpressure pauses normal claims while urgent ones are still claimed.
285
+ open-PR backpressure pauses `high`, `normal` and `low` claims while urgent
286
+ ones are still claimed.
279
287
 
280
288
  When the dispatcher claims an eligible file ticket, it moves it to `doing/`,
281
289
  then to `done/` on merge or back to `triage/` if the build aborts (`ready/`
@@ -471,8 +479,8 @@ absolute file path containing the edited text. Read the current ticket and
471
479
  reapply the intended changes before retrying; conflicts are never merged.
472
480
 
473
481
  File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
474
- state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
475
- fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
482
+ state and any priority other than normal; file revisions also cover nonempty issue links. GitHub revisions
483
+ fingerprint kind, target, title, body, canonical label/blocker sets (priority labels included), state and issue links,
476
484
  including the ticket's own issue; GitHub tickets carry no comments. Reverting
477
485
  identical content restores its fingerprint. File checks
478
486
  re-read immediately before writing, with the existing no-lock race window.
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.11.1",
8
- "@defrex/autobuild": "1.11.1",
7
+ "@defrex/autobuild-hosted-store-service": "1.13.0",
8
+ "@defrex/autobuild": "1.13.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"