@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
@@ -86,23 +86,32 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
86
86
  because grooming the node's objective and budget is the dispatch decision for
87
87
  them (see [optimization nodes](references/optimization-nodes.md#proposer-phase)). The dispatcher
88
88
  claims tickets that pass the `[tickets]` ready
89
- gate — urgent tickets first, then normal ones, each in the source's order —
89
+ gate — by level, `urgent`, `high`, `normal`, then `low`, each level in the
90
+ source's order —
90
91
  chooses a short immutable slug from the final conforming spec, and
91
92
  starts builds up to the top-level `capacity` bound, after slots reserved for
92
93
  integration nodes awaiting verification, reconcile or propose, for finished builds
93
- waiting to re-verify or reconcile, and for builds whose ticket wait ended.
94
- Free slots go to `manual` start requests, then urgent waiting work, then
95
- urgent start requests and urgent tickets, then normal waiting work, then
96
- normal start requests and normal tickets; a build takes its ticket's priority at
97
- claim, and `ab priority <slug> urgent|normal` changes an active build's
98
- priority. An optimization node's attempts claim at the node's current
99
- priority instead, so `ab priority <node> urgent` speeds up its attempts
94
+ waiting to re-verify or reconcile, and for builds resuming after an answered
95
+ escalation, a resumed pause or an ended ticket wait.
96
+ Free slots go to `manual` start requests, then, for each level from
97
+ urgent to low, that level's waiting work, then its start requests and
98
+ ready tickets. A build takes its ticket's level, decided at claim (a
99
+ non-`manual` start request sets the request's level instead), and
100
+ `ab priority <slug> urgent|high|normal|low` changes an active build's
101
+ level. An optimization node's attempts claim at the node's current
102
+ level instead, so `ab priority <node> urgent` speeds up its attempts
100
103
  claimed afterwards. Priority orders free slots only.
101
- `capacity` counts builds running work: a build that finished its pipeline
102
- holds no slot while it waits for a merge decision, though it keeps its
103
- workspace until it merges or closes. Priority never preempts a running build.
104
+ `capacity` counts slots. A build takes one by admission and holds it while
105
+ Autobuild owes its next move, runner or not. It holds none while it waits on
106
+ the outside world (paused, blocked on a question, waiting for a merge
107
+ decision, merge gates or other tickets), though it keeps its workspace. A
108
+ question does not release the slot while work Autobuild started goes on:
109
+ other steps of its verify stage, or a recorded launch and its execution.
110
+ Such a build keeps its slot through the answer and requests nothing. When
111
+ a wait ends it waits for a slot again ahead of ticket claims at its level, so
112
+ occupancy never exceeds `capacity`. Priority never preempts a running build.
104
113
  With `[policy].maxOpenPrs` set, open-PR backpressure pauses new ordinary
105
- normal-priority claims (not `ab start` requests) once that many root PRs are open and unmerged, until
114
+ claims of `high`, `normal` and `low` tickets (not `ab start` requests) once that many root PRs are open and unmerged, until
106
115
  the count drains to `resumeOpenPrs` (below `maxOpenPrs` when the two are
107
116
  equal); urgent claims and in-flight work continue, and capacity is
108
117
  unchanged.
@@ -127,8 +136,8 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
127
136
  It ends the wait (cause `unresolvable`), shows in the default attention
128
137
  filter, and its answer resumes the declaring phase like a wait answer. An
129
138
  operator may still end a wait early by answering its escalation (cause
130
- `operator`). The build then takes a slot
131
- ahead of normal ticket claims (urgent work first). If its target moved, it first restacks onto the
139
+ `operator`). A build whose runner has stopped then waits as a `resume`
140
+ request and takes a slot ahead of ticket claims at its level (higher levels first). If its target moved, it first restacks onto the
132
141
  target's current head (published work is replayed as one change, and a
133
142
  conflict reconciles first unless it is confined to declared `[generated]`
134
143
  files, which the kernel regenerates; with nothing published, the branch fast-forwards
@@ -139,7 +148,7 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
139
148
  except that a verify or finalize wait whose restack replayed cleanly
140
149
  re-verifies every step from the first, at a new attempt, before finalize or
141
150
  merge. `ab build status` shows a `waiting on:` line naming the tickets,
142
- and `ab builds` and both dashboards show the build as `waiting` on them.
151
+ and `ab builds` and both dashboards show the build as `WAITING` on them.
143
152
  Node builds cannot declare waits.
144
153
  - **Failed preparation.** Durable preparation facts protect the claim-to-build
145
154
  interval. Caught failures return tickets to Ready (invalid specs to Triage),
@@ -193,7 +202,9 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
193
202
  starts no agent; conflicts enter `reconcile`, then verification, except
194
203
  that conflicts only in declared [`[generated]`](#generated) files are
195
204
  regenerated by their commands with no agent. A clean
196
- replay after a verify or finalize wait re-verifies on the restacked base. The leaf
205
+ replay after a verify or finalize wait re-verifies on the restacked base, and
206
+ a clean awaiting-merge restack of a root-targeting leaf re-runs the steps
207
+ opted in by `afterCleanRestack` before it lands. The leaf
197
208
  terminates **merged** or **closed**. Transient leaf publication failures park
198
209
  on a durable six-retry schedule, independently of agent phase attempts.
199
210
  See the [replay reference](references/restacking.md).
@@ -418,7 +429,12 @@ The distinctions that change an administrator's answer:
418
429
  Errors discard conditional state; unloadable targets retain the healthy
419
430
  predecessor reader fallback with the active query. Old peers still exchange
420
431
  full v1 answers. Polling remains 1 second idle / 250 ms pending, and cached
421
- answers still drive pending actions, child exits and recovery expiry.
432
+ answers still drive pending actions, child exits and recovery expiry. While
433
+ the active run's durably detected upgrade has no prepared target, failure,
434
+ request or handoff yet, the reader reports it as advisory `preparing` and the
435
+ launcher checks every 50 ms, at most 600 times per detection, then returns to
436
+ the idle cadence. Older readers omit the field and keep the ordinary cadence;
437
+ operator shutdown ends any pause.
422
438
  Automatic upgrades default on: the kernel checks immediately and every
423
439
  60 seconds, resolving a declared Autobuild dependency and Bun lock from the same
424
440
  authoritative base-branch commit. Unpinned repositories reread the original
@@ -426,8 +442,9 @@ The distinctions that change an administrator's answer:
426
442
  sharing the dispatched repository's Git common directory selects source mode
427
443
  first; that eligibility and the initial packaged baseline stay frozen across
428
444
  successors. Source mode follows the forge-authoritative base commit, exported
429
- into private cache staging with a frozen-lockfile, script-free dependency
430
- install. The immutable runtime records the exact commit. Adoption compares
445
+ into private cache staging with a frozen-lockfile, script-free install of the
446
+ root package's production dependencies only; each must resolve inside the
447
+ export. The immutable runtime records the exact commit. Adoption compares
431
448
  actual packaged contents and production-reachable lock records, so same-version
432
449
  changes adopt while excluded-file and unrelated workspace-lock advances do not.
433
450
  Shipped documentation counts as packaged content. The advisory successful
@@ -528,7 +545,11 @@ The distinctions that change an administrator's answer:
528
545
  before constructing any further member. Already launched siblings settle first.
529
546
  A waiting leaf with completed verification retains its receipts after a clean
530
547
  rewrite when build-owned config is unchanged, even when the rewrite replaces
531
- the pin commit's ancestry. Changed config still supersedes while waiting; a
548
+ the pin commit's ancestry. Two clean restacks instead start a new cycle that
549
+ the earlier receipts cannot satisfy: a root-targeting leaf's clean landing
550
+ restack whose frozen `afterCleanRestack` policy enables any step re-verifies
551
+ on the restacked base and head, and a clean wait-resume restack after a
552
+ verify or finalize ticket wait re-verifies on the resumed base. Changed config still supersedes while waiting; a
532
553
  future verification cycle always captures fresh config before running steps.
533
554
  Old pass/skip receipts cannot satisfy that cycle, and supersession creates no
534
555
  failure or failure-budget charge. Unchanged config on a descendant head retains
@@ -558,7 +579,9 @@ The distinctions that change an administrator's answer:
558
579
  per build, and the write proceeds; `history.retained` (leaf) and
559
580
  `node.history-retained` (node) record the non-forge outcomes. Workspace
560
581
  preservation of unpublished commits is strict: archive ref, else store copy
561
- (`workspace.commits-retained`), else the release is refused.
582
+ (`workspace.commits-retained`), else the release is refused. Abort cleanup
583
+ is the one exception: when preservation fails it records
584
+ `workspace.commits-lost` and releases.
562
585
  `github` publishes through GitHub. `local-git` performs no remote/network/`gh`
563
586
  operation: durable PR records live under private Git refs, and the review
564
587
  locator is `refs/heads/ab/<slug>`. Once merge authorization (auto or consent;
@@ -693,7 +716,7 @@ under the preceding table.
693
716
  |---|---|---|---|
694
717
  | `baseBranch` | `"main"` | nonempty string | The branch builds branch from and target with their PR; what `reconcile` replays the build change onto. |
695
718
  | `ticketScanIntervalSeconds` | `60` | positive integer seconds | Hot-reloaded ready scan cadence; tick spacing is the floor, and same-repository merge/completion/abort forces an early scan. |
696
- | `capacity` | `1` | positive integer | Maximum builds running work at once for this repository; builds parked for a merge decision or waiting on other tickets hold no slot. |
719
+ | `capacity` | `1` | positive integer | Slots for this repository. A build holds one from admission until it waits on a human, another ticket, the forge or its children, or ends; occupancy never exceeds it. |
697
720
  | `forge` | `"github"` | nonblank string | Selects shipped `github` or `local-git`, or a plugin-registered Forge adapter. `github` authenticates with `GITHUB_TOKEN`, then `GH_TOKEN`, then the gh CLI's stored login. |
698
721
  | `plugins` | `[]` | array of unique nonblank module specifiers | Trusted Bun plugin modules loaded before dispatch, `ab ticket`, and scoped phase wiring. |
699
722
 
@@ -868,6 +891,12 @@ must not be repeated. An implement round with no commits over its contribution
868
891
  base escalates at `implement` instead of requesting publication. After VM stop and lease release, the local kernel
869
892
  publishes the exact SHA/branch through a temporary narrow firewall transform,
870
893
  verifies it, and performs PR work locally. Ordinary completion deletes the VM.
894
+ The guest runner records its exit on the sandbox filesystem, so a session that
895
+ finished before its VM stopped still settles and publishes: recovery resumes a
896
+ stopped sandbox explicitly under `recoveryTimeoutMs` (default 120000, the cold
897
+ resume plus guest git and push), never past a hosted invocation's deadline, and
898
+ never stops one the provider already reports stopped. `operationTimeoutMs`
899
+ bounds each metadata acknowledgement.
871
900
  Branch config, installed skills, relative/package plugins, setup, and phase CLI
872
901
  commands resolve from the guest checkout, never dispatcher paths.
873
902
 
@@ -961,6 +990,19 @@ and a reason naming the setting. Dashboards and PR summaries call this
961
990
  checks and branch protections still gate merge. For excluded steps, merged code
962
991
  is not re-verified, so breakage that only exists in the combination can merge.
963
992
 
993
+ Clean-restack re-verification defaults to disabled: omitting
994
+ `[verify].afterCleanRestack` means `false`. An optional boolean
995
+ `[verify.<step>].afterCleanRestack` overrides it in either direction. When a
996
+ root-targeting leaf waiting to land restacks cleanly (including a
997
+ `[[generated]]` regeneration), opted-in steps re-run on the restacked head
998
+ before it lands; the rest record `skipped` with
999
+ `skipCause = "clean-restack-policy"` ("skipped by clean-restack policy").
1000
+ A failure routes through the ordinary repair loop. Opt in per step on cheap
1001
+ deterministic checks, for example `afterCleanRestack = true` in
1002
+ `[verify.lint]`: every target move under a waiting leaf re-runs them. Leaves
1003
+ targeting an integration node rely on the node's verification instead. See
1004
+ [Restacking](references/restacking.md#clean-restack-re-verification).
1005
+
964
1006
 
965
1007
  `steps` orders stages: a name is a singleton, an array groups concurrent
966
1008
  members. Every name becomes a `verify:<step>` phase with its own table. Those
@@ -975,6 +1017,7 @@ subtables are part of this section — their fields are listed here.
975
1017
  | `skill` | — | **required when `kind = "agent"`**, nonempty string | Installed skill name to run (e.g. a repository-authored `"verify-acceptance"`). |
976
1018
  | `paths` | — | optional nonempty array of positive repository-relative globs | Makes either step kind apply when any changed path matches any selector. Omitted means unconditional. |
977
1019
  | `afterReconcile` | repository: `true`; step: inherited | boolean | Step override wins over `[verify].afterReconcile`; false skips this step after reconciliation only. |
1020
+ | `afterCleanRestack` | repository: `false`; step: inherited | boolean | Step override wins over `[verify].afterCleanRestack`; true re-runs this step on the restacked head after a clean awaiting-landing restack of a root-targeting leaf, false records it skipped. |
978
1021
  | `always` | — | optional boolean | `true` makes the step unconditional and mandatory (a plan cannot deselect it); `false` is equivalent to omission. |
979
1022
 
980
1023
  ### Choosing verify stages
@@ -1094,9 +1137,10 @@ reconcile reuses it.
1094
1137
  If the approved selection later names any step absent from the cycle's pinned
1095
1138
  configured universe, the entire selection falls back to all configured optional
1096
1139
  steps. The kernel records one observation per cycle and plan revision naming
1097
- the unknown steps. Mandatory steps, path applicability and post-reconcile policy
1098
- still apply. A valid selection continues to skip genuinely omitted optional
1099
- steps. Strict validation when depositing a new plan is unchanged.
1140
+ the unknown steps. Mandatory steps, path applicability and post-reconcile and
1141
+ clean-restack policies still apply. A valid selection continues to skip
1142
+ genuinely omitted optional steps. Strict validation when depositing a new plan
1143
+ is unchanged.
1100
1144
 
1101
1145
  Cross-field rules the validator actually enforces — each is an **error**:
1102
1146
 
@@ -1207,14 +1251,19 @@ SHAs could not be inspected. An environment that never started executing holds
1207
1251
  no unpublished work: objects its checkout lacks mean nothing to preserve, so
1208
1252
  cleanup records `workspace.commits-preserved` (or `workspace.commits-retained`)
1209
1253
  carrying forward earlier preserved heads, then releases and replaces it. Unknown fencing, inspection, transport, or
1210
- receipt-write outcomes leave the workspace and snapshots intact. A workspace
1254
+ receipt-write outcomes leave the workspace and snapshots intact, except under
1255
+ abort cleanup, which records `workspace.commits-lost` and tears the workspace
1256
+ down. A workspace
1211
1257
  flagged by `workspace.cleanup-required` is never launched into: the dispatcher
1212
1258
  releases it and provisions the next generation. Provisioning cut off by a
1213
1259
  recorded dispatcher teardown is the exception: the next invocation asks the
1214
1260
  provider to verify and finish the same generation, and if it cannot, the
1215
1261
  replacement consumes no infrastructure attempt. A preservation or release
1216
1262
  failure is recorded against its build, as an infrastructure failure or janitor
1217
- attention, and never stops the dispatcher from advancing other builds.
1263
+ attention, and never stops the dispatcher from advancing other builds. The
1264
+ recorded error and the infrastructure-limit escalation name the failed recovery
1265
+ step: `resume`, `fence`, `preserve` or `cleanup`. Work cut short by a hosted
1266
+ invocation's deadline records nothing and retries on the next invocation.
1218
1267
  Fencing is revalidated after restart; a saved receipt alone never authorizes
1219
1268
  cleanup of a newer execution. Current recovery notes are linked by the session
1220
1269
  manifest's `workspaceRecovery` field. Recovery notes apply to the next session
@@ -1562,8 +1611,8 @@ backpressure keys `maxOpenPrs` (no default; unset disables backpressure),
1562
1611
  | `nodeIdlePollSeconds` | `120` | positive integer | Interval between idle node checks; durable activity wakes the next tick. |
1563
1612
  | `janitorBackoffMaxSeconds` | `300` | positive integer | Cap on exponential janitor retry delay, starting at 30 seconds. |
1564
1613
  | `harvestMaxDrift` | `3` | nonnegative integer | Other builds merged after the oldest unclaimed observation required to start a run; `0` disables drift. |
1565
- | `maxOpenPrs` | unset | positive integer | Open unmerged root PRs (leaves and integration nodes, not children of a node) at which the dispatcher stops claiming `normal`-priority tickets. Urgent claims, in-flight builds, reconciles and landings continue. Unset disables open-PR backpressure. |
1566
- | `resumeOpenPrs` | `maxOpenPrs - 1` | nonnegative integer, at most `maxOpenPrs` | Once engaged, normal claims stay paused until the open root PR count is at or below this. Reaching `maxOpenPrs` takes precedence, so when this equals `maxOpenPrs` claims resume once the count falls below it. Inert without `maxOpenPrs`. |
1614
+ | `maxOpenPrs` | unset | positive integer | Open unmerged root PRs (leaves and integration nodes, not children of a node) at which the dispatcher stops claiming `high`, `normal` and `low` tickets. Urgent claims, in-flight builds, reconciles and landings continue. Unset disables open-PR backpressure. |
1615
+ | `resumeOpenPrs` | `maxOpenPrs - 1` | nonnegative integer, at most `maxOpenPrs` | Once engaged, high, normal and low claims stay paused until the open root PR count is at or below this. Reaching `maxOpenPrs` takes precedence, so when this equals `maxOpenPrs` claims resume once the count falls below it. Inert without `maxOpenPrs`. |
1567
1616
  | `excludeHeldOpenPrs` | `false` | boolean | Leave PRs whose active landing command is `hold` out of the count. Inert without `maxOpenPrs`. |
1568
1617
 
1569
1618
  Dispatch failures share one budget across stages until runner attachment. At
@@ -2387,12 +2436,12 @@ repository's `[tickets]` table selects. These forms therefore work unchanged
2387
2436
  with the file tracker, Linear, hosted tickets and GitHub issues, without
2388
2437
  provider-specific API/MCP calls:
2389
2438
 
2390
- - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--issues N[:refs],...] [--priority urgent|normal] [--assignees a,b] [--json]`
2439
+ - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--issues N[:refs],...] [--priority urgent|high|normal|low] [--assignees a,b] [--json]`
2391
2440
  files a ticket. Without `--state`, the source uses `[tickets].createState` or
2392
2441
  its own default. A named state is passed through unchanged and the selected
2393
2442
  source validates it before creating anything. Blocker ids belong to the same
2394
2443
  source and are also checked before the single create call.
2395
- - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--issues N[:refs],...] [--priority urgent|normal] [--assignees a,b] [--json]`
2444
+ - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--issues N[:refs],...] [--priority urgent|high|normal|low] [--assignees a,b] [--json]`
2396
2445
  partially replaces editable fields. At least one editable flag is required;
2397
2446
  `--json` alone is not an update.
2398
2447
  - `ab ticket block <id> <blocker-id[,blocker-id...]> [--json]` adds one or more
@@ -2471,19 +2520,29 @@ when it claims the ticket and turns them into PR and commit keywords; see
2471
2520
  [issue links in builds](#issue-links-in-builds). On update `--issues` is a
2472
2521
  complete replacement and `--issues ''` clears it. A source that cannot store
2473
2522
  issue links refuses any write naming them, names itself, and writes nothing.
2474
- `--priority urgent` makes the dispatcher claim the ticket before normal ready
2475
- work, each class in source order, and ahead of normal builds waiting for a
2476
- slot; blockers and every other gate still apply, and it never preempts a
2477
- running build. The claimed build keeps that priority; `ab priority <slug>
2478
- urgent|normal` changes an existing build's priority without touching its ticket.
2479
- An optimization attempt ignores its ticket's priority and claims at its node's
2480
- current priority. `--priority normal` (the default)
2481
- removes urgency. The file, hosted and Linear sources store priority (Linear as
2482
- its native Urgent; `normal` clears only Urgent and leaves other Linear priorities
2483
- alone); plugin sources without the capability read every ticket as normal,
2484
- refuse `urgent` naming themselves and writing nothing, and accept `normal`
2485
- as a no-op. JSON
2486
- ticket output always includes `priority`, and list output marks urgent tickets.
2523
+ `--priority` takes `urgent`, `high`, `normal` (the default) or `low`; any
2524
+ other value is refused before anything is written, and an update without it
2525
+ leaves the level alone. Harvest files proposals at `normal`.
2526
+
2527
+ - **Dispatch.** Ready work is claimed by level, `urgent` first and `low`
2528
+ last, each level in source order, and each level goes ahead of lower-level
2529
+ builds waiting for a slot. Blockers and every other gate still apply, and
2530
+ nothing preempts a running build. Only urgent bypasses open-PR backpressure.
2531
+ - **Builds.** A build takes its ticket's level.
2532
+ `ab priority <slug> urgent|high|normal|low` changes an existing build's
2533
+ level without touching its ticket. An optimization attempt ignores its
2534
+ ticket's priority and claims at its node's current level.
2535
+ - **Storage.** File frontmatter `priority = "<level>"` (no key for normal);
2536
+ hosted stores all four. Linear maps Urgent, High and Low to the matching
2537
+ levels and Medium or No priority to `normal`; writing `normal` sets No
2538
+ priority only on an Urgent, High or Low issue. GitHub and plugin sources
2539
+ without the capability store one label, `priority:urgent`, `priority:high`
2540
+ or `priority:low` (none for normal), matched case-insensitively, highest
2541
+ wins. Priority labels show as `priority`, never in `labels`; `--labels`,
2542
+ label filters and `readyLabels`/`createLabels` entries naming one are
2543
+ refused, and labels replacements keep them.
2544
+ - **Output.** JSON ticket output always names one of the four levels, and
2545
+ list output marks every level other than normal.
2487
2546
  `--assignees a,b` names usernames, or `me` for the owner of the source's
2488
2547
  credential, on a source that stores assignees (GitHub). On create it replaces
2489
2548
  the `[tickets].createAssignee` default and `--assignees ''` files the ticket
@@ -2693,19 +2752,52 @@ verification progress or failure and the merge mode in parentheses. Before
2693
2752
  a policy decision, label-dependent modes may read `policy pending`. A current
2694
2753
  verified node adds `verified`. Only restack conflicts, current verification
2695
2754
  failures (file a repair child targeting the node), a node waiting for a runner
2696
- slot ahead of normal ticket claims, and readiness awaiting consent add a list
2755
+ slot ahead of ticket claims at its level, and readiness awaiting consent add a list
2697
2756
  alert. Consent names `l` and `ab merge <slug>`. Branch,
2698
2757
  restack state and conflicting files remain in detail, along with every child's
2699
2758
  ticket id, title and live phase (or queued/merged), open-first counts, verification
2700
2759
  steps and current outcomes, repair instructions, and the merge rule. Cancelled
2701
2760
  children are omitted; historical missing titles or filenames are explicit.
2702
- A work build that finished its pipeline and must re-verify or reconcile, or
2703
- whose ticket wait ended (`resume`), shows the same slot-wait alert on its row,
2704
- and `ab builds` appends it to the phase. A build whose only open escalation is
2705
- its open ticket wait shows `WAITING` and a yellow (amber on the web)
2761
+ A work build waiting for a slot, one that finished its pipeline and must
2762
+ re-verify or reconcile or one resuming after an answered escalation, a resumed
2763
+ pause or an ended ticket wait (`resume`), reads teal `QUEUED` with its request
2764
+ as the note (`resume`, `urgent reconcile`), shows the same
2765
+ slot-wait alert on its row, and `ab builds` appends it to the phase. A build
2766
+ whose only open escalation is its open ticket wait shows amber `WAITING` with
2767
+ an `on <ids>` note and a yellow (amber on the web)
2706
2768
  `waiting on <ids> — <reason>` line, distinct from a red `BLOCKED` question;
2707
2769
  `r` / RESUME answers the wait and ends it early.
2708
2770
 
2771
+ **Status words.** Every nonterminal build row on both dashboards, `ab builds`
2772
+ and `ab build status` shows one word from one closed vocabulary. Its color says
2773
+ whether the build holds a slot: every green word holds one, teal `QUEUED` has
2774
+ requested one, and every other word holds none. The word says why, and a short
2775
+ parenthesized note beside it (`merge decision`) says which case. The header's
2776
+ `active <occupied>/<limit>` counts the green rows.
2777
+
2778
+ | Color | Slot | Word | Shown when |
2779
+ |---|---|---|---|
2780
+ | green | held | `RUNNING` | a runner is working |
2781
+ | green | held | `STARTING` | no runner works yet: provisioning a newly claimed build, a relaunch, spec publication, an upgrade drain, a suspended session |
2782
+ | green | held | `PAUSING` | a pause was requested and the runner is still stopping |
2783
+ | green | held | `ABORTING` | an abort was requested and the runner is still stopping |
2784
+ | teal | requested | `QUEUED` | parked work waiting for admission; the note names the request (`resume`, `reconcile`, `verification`, `reopen`, `propose`) and marks urgent, high and low waiters |
2785
+ | amber | none | `WAITING` | a finished pipeline waiting for a merge decision (`merge decision`) or on hold (`on hold`), an entered ticket wait (`on <ids>`), or a `revise-spec` answer waiting for its revision (`spec revision`) |
2786
+ | amber | none | `MERGING` | a finished pipeline with merge consent, waiting for merge gates or the forge |
2787
+ | amber | none | `PAUSED` | an acknowledged pause |
2788
+ | amber | none | `COLLECTING` | an integration build collecting child work |
2789
+ | red | none | `BLOCKED` | an open escalation other than a ticket wait's own, or a failed node verification waiting for a repair child; the note `done` marks a completed build whose open escalation awaits acknowledgement |
2790
+ | dim | none | `CLEANING` | abort cleanup |
2791
+
2792
+ `BLOCKED` outranks `PAUSED`. Only a build holding a slot shows `PAUSING` or
2793
+ `ABORTING`; a build without one keeps its word until the pause or abort is
2794
+ acknowledged. A resumed pause reads `QUEUED` with a `resume` note until it is
2795
+ admitted again. The reducer's lifecycle statuses (`queued`, `running`, `collecting`, …)
2796
+ are not display words: a newly claimed `queued` build reads `STARTING`, and a
2797
+ settled `running` build reads `WAITING` or `MERGING`. The Harvest row is never
2798
+ green: `HARVESTING` (teal) while it works, `PAUSED` or `SUSPENDED` (amber)
2799
+ while stopped, `ESCALATED` or `FAILED` (red) when it needs a human.
2800
+
2709
2801
 
2710
2802
  On a TTY, execution-mode `ab dispatch` renders one fixed interactive frame that fills the
2711
2803
  terminal's height. Its header stays on the top row, the legend or prompt panel
@@ -2733,9 +2825,13 @@ headless ticks that publish no count, and shows `–` until its first read
2733
2825
  succeeds or when the source has no state counts (Linear). `queue` is the
2734
2826
  ready-ticket queue depth measured by the latest completed ticket scan,
2735
2827
  whichever dispatcher run recorded it (0 before any scan), so an overlapping
2736
- run that starts and yields cannot displace it. `active` is occupied capacity (every unfinished
2737
- build except one waiting on tickets, plus finished builds running work again)
2738
- against root `capacity`. Observation pressure is not a header counter: the
2828
+ run that starts and yields cannot displace it. `active` is occupied capacity (builds holding a
2829
+ slot; paused and waiting builds, and blocked ones with nothing still working
2830
+ on them, hold none) against root `capacity`.
2831
+ Each build's `slot` in `ab builds`, `ab build status` and the dashboard rows,
2832
+ and `capacity.slots` in `ab repository status`, report the per-build state
2833
+ behind that count: held, requested (with its request) or none; a missing value
2834
+ is unknown, never none. Observation pressure is not a header counter: the
2739
2835
  Harvest row shows a run's observations, and `ab harvest status` reports
2740
2836
  Harvest state.
2741
2837
  The execution-mode frontend checkpoints only the latest run start and the sampled
@@ -2767,11 +2863,15 @@ from the builds by one blank line. The duplicate startup banner is
2767
2863
  suppressed; `--plain` and non-TTY output remain line-oriented and unchanged. A
2768
2864
  satisfied verify skip carries the literal `skipped` qualifier, so it remains
2769
2865
  distinct from a pass without color. Every nonterminal build has a row,
2770
- including `queued` builds that have not attached a runner. A queued row shows
2771
- its ticket, slug, literal `QUEUED` status, and either the pending dispatch
2772
- boundary or the latest durable `dispatch.failed` stage, attempt, and error.
2773
- While the repository hold is set, only queued rows gain a yellow `(held)`
2774
- modifier beside `QUEUED`; intake being off without that hold shows neither
2866
+ including `queued` builds that have not attached a runner. A done build with an
2867
+ open escalation (a post-landing integration audit, or a question still open
2868
+ when abort cleanup completed) also has a row, red `BLOCKED` with the note
2869
+ `done` and its question, holding no slot, until `ab answer` acknowledges it. A newly claimed
2870
+ build holds its slot from the claim, so its row shows its ticket, slug, green
2871
+ `STARTING` status, and either the pending dispatch boundary or the latest
2872
+ durable `dispatch.failed` stage, attempt, and error.
2873
+ While the repository hold is set, only these queued rows gain a yellow `(held)`
2874
+ modifier beside `STARTING`; intake being off without that hold shows neither
2775
2875
  `repository PAUSED` nor `(held)`.
2776
2876
 
2777
2877
  A build row previews each unresolved blocker and setup error as at most three
@@ -2813,35 +2913,38 @@ eligibility, plus the state-specific `p pause`, `p cancel pause`, or `r resume`
2813
2913
  action; queued builds offer `d discard`. Merge requires readiness; hold may be
2814
2914
  recorded before readiness. There is no repository merge toggle.
2815
2915
 
2816
- A running build reads `PAUSING` after `p` appends its pause request and before
2817
- the live session stops and the kernel records its suspension. Pause interrupts
2916
+ A running build that holds its slot reads `PAUSING` after `p` appends its pause
2917
+ request and before the live session stops and the kernel records its
2918
+ suspension; a build without a slot, such as one waiting for its merge
2919
+ decision, keeps its word until the acknowledgement. Pause interrupts
2818
2920
  live agent work immediately; resume continues where it stopped when supported,
2819
2921
  while remote or unsupported sessions rerun fresh with a recorded fallback reason.
2820
2922
  Without a live agent, acknowledgement still waits for a safe boundary. During
2821
2923
  that window `p` appends
2822
- the opposing resume request, cancels the stale pause, and projects the build
2823
- back to `RUNNING`. The cancelling resume holds back nothing, including merge
2924
+ the opposing resume request, cancels the stale pause, and the build
2925
+ reads its previous word again. The cancelling resume holds back nothing, including merge
2824
2926
  readiness and janitor retry backoff. An acknowledged paused build offers only `r resume` and reads
2825
- `RESUMING` until the kernel acknowledges that request; there is no gesture to
2927
+ `QUEUED` with a `resume` note until it is admitted to a slot again; there is no gesture to
2826
2928
  cancel a pending resume. Blocked takes visual precedence, including when the
2827
2929
  build is also operator-paused, and `r` opens the existing feedback field. Keys
2828
2930
  that are not offered for the current build state are no-ops and append no
2829
2931
  control event.
2830
2932
 
2831
2933
  Global-row `p` is the repository-wide version — the same walk `ab pause --all`
2832
- runs sessionless: it durably holds every `QUEUED` build, turns intake off, and
2833
- appends `build.pause-requested` to every `RUNNING` build, so the repository
2934
+ runs sessionless: it durably holds every queued build, turns intake off, and
2935
+ appends `build.pause-requested` to every running build, so the repository
2834
2936
  comes to rest before a machine, terminal, or dispatcher restart. The hold is the `dispatcher.pause-set` repository fact, written before
2835
2937
  the intake fact; while it is set no dispatcher tick attaches a runner to a
2836
2938
  queued build, whether through interrupted-dispatch recovery, startup resume, or
2837
- the lease sweep. The per-build walk skips `PAUSING` — the bulk control never
2838
- cancels a pending pause, unlike build-row `p` — and skips `QUEUED`, `PAUSED`,
2839
- `RESUMING`, and `BLOCKED` without error; queued builds are covered by the hold
2939
+ the lease sweep. The per-build walk skips a build whose pause is already
2940
+ pending — the bulk control never cancels a pending pause, unlike build-row
2941
+ `p` — and skips queued, paused, resume-pending, and blocked builds without
2942
+ error; queued builds are covered by the hold
2840
2943
  instead. Global-row `r` reverses all of it: the hold released,
2841
- `build.resume-requested` on every `PAUSED` build (including builds paused by
2944
+ `build.resume-requested` on every paused build (including builds paused by
2842
2945
  hand beforehand), and intake back on. A released queued build becomes
2843
2946
  launchable again on the next ordinary tick, with no further operator action. `r`
2844
- does not touch `BLOCKED` builds, whose blockers still need the per-build `r`
2947
+ does not touch blocked builds, whose blockers still need the per-build `r`
2845
2948
  feedback field. Both report the affected build count, the hold, and the new
2846
2949
  intake value on the notice row. One carve-out remains: the harvest gate is
2847
2950
  independent, so a harvest session can still start after a bulk pause (`h` stops
@@ -2893,7 +2996,10 @@ as builds; its internal run id is not shown. One row selects the oldest
2893
2996
  unresolved ordinary failure, exhaustion, or escalation attention before the
2894
2997
  oldest open run, so later running/completed work cannot hide it. Completed runs,
2895
2998
  an idle paused repository, acknowledged recovery exhaustion, and dismissed
2896
- escalation have no row. A paused open run freezes and reads `PAUSED`. Ordinary
2999
+ escalation have no row. A working run reads teal `HARVESTING`; a harvest run
3000
+ never holds a slot, so it is never green. A paused open run freezes and reads
3001
+ amber `PAUSED`, and a suspended one `SUSPENDED`. Escalation reads red
3002
+ `ESCALATED`. Ordinary
2897
3003
  failure reads red `FAILED`, marks the stopped step, shows automatic progress,
2898
3004
  and offers `p resume`. Exhaustion remains red, says `recovery exhausted — human
2899
3005
  attention required`, shows stopped step/pending count, and offers `p
@@ -2938,17 +3044,17 @@ to the build's event log and apply the same write-time checks.
2938
3044
  | Intent | CLI | Dashboard | Durable event(s) |
2939
3045
  |---|---|---|---|
2940
3046
  | Discard interrupted dispatch | — | Select a queued build and press `d`. | `build.discard-requested` |
2941
- | Pause | `ab pause <slug> [--store <ref>]` | Select a `RUNNING` build and press `p`; press `p` again while `PAUSING` to cancel the pending pause. | `build.pause-requested`; cancellation reuses `build.resume-requested` |
2942
- | Resume | `ab resume <slug> [--store <ref>]` | Select a `PAUSED` build and press `r`. | `build.resume-requested` |
2943
- | Pause all | `ab pause --all [--store <ref>] [--json]` | Select the global row and press `p`. | `dispatcher.pause-set` (first), `dispatcher.intake-set`, then one `build.pause-requested` per `RUNNING` build |
2944
- | Resume all | `ab resume --all [--store <ref>] [--json]` | Select the global row and press `r`. | `dispatcher.pause-set` (first), `dispatcher.intake-set`, then one `build.resume-requested` per `PAUSED` build |
3047
+ | Pause | `ab pause <slug> [--store <ref>]` | Select a running build and press `p`; press `p` again while its pause is pending to cancel it. | `build.pause-requested`; cancellation reuses `build.resume-requested` |
3048
+ | Resume | `ab resume <slug> [--store <ref>]` | Select a paused build and press `r`. | `build.resume-requested` |
3049
+ | Pause all | `ab pause --all [--store <ref>] [--json]` | Select the global row and press `p`. | `dispatcher.pause-set` (first), `dispatcher.intake-set`, then one `build.pause-requested` per running build |
3050
+ | Resume all | `ab resume --all [--store <ref>] [--json]` | Select the global row and press `r`. | `dispatcher.pause-set` (first), `dispatcher.intake-set`, then one `build.resume-requested` per paused build |
2945
3051
  | Consent to merge | `ab merge <slug> [--head <sha>] [--store <ref>]` | Select a ready build and press `l`. | `build.land-requested`, then `landing.command-acknowledged` |
2946
3052
  | Restack node | `ab restack <node> [--store <ref>]` | CLI/tool request; normal safety gates apply. | `node.restack-requested`, then `node.restack-satisfied` |
2947
3053
  | Show or revise an objective | `ab objective <node> [--threshold n] [--epsilon n\|n%] [--max-attempts n] [--max-hours n] [--plateau n] [--stop-mode abort\|drain] [--concurrency n] [--json] [--store <ref>]` | CLI/tool request (`optimization.revise`); without flags it only shows the effective objective and progress. Running attempts are unaffected; revised stop rules apply on the next tick. | `optimization.objective-revised` |
2948
3054
  | Stop an optimization node | `ab objective <node> --stop [--drain\|--abort] [--json] [--store <ref>]` | CLI/tool request (`optimization.stop`). Without a flag the objective's stop mode applies (abort by default). Final, and not merge consent. | `optimization.stopped`; dispatcher `build.abort-requested` per aborted attempt, then `attempt.settled` |
2949
3055
  | Settle an unmeasured merge | `ab objective <node> --settle-unmeasured <proposal\|build> --policy release-unmeasured [--note <text>] [--json] [--store <ref>]` | CLI/tool request (`optimization.settle-unmeasured`). Only for an attempt listed as an unmeasured merge; releases its slot once, never as accepted. | `attempt.settled {outcome: merged-unmeasured}` |
2950
3056
  | Hold merge | `ab hold <slug> [--reason <text>] [--store <ref>]` | Select a build and press `o`, including before readiness. | `build.hold-requested` (optional `reason`), then `landing.command-acknowledged` after native cancellation |
2951
- | Set build priority | `ab priority <slug> urgent\|normal [--store <ref>]` | CLI/tool request (`builds.control` action `priority`); changes only the build's slot-admission order, never its ticket, and never preempts running work. On an optimization node it also sets the tier its attempts claim in afterwards. A build priority is only `urgent` or `normal`; `ab start`'s `manual` tier is admission-only. | `build.priority-set` |
3057
+ | Set build priority | `ab priority <slug> urgent\|high\|normal\|low [--store <ref>]` | CLI/tool request (`builds.control` action `priority`); changes only the build's slot-admission level, never its ticket, and never preempts running work. On an optimization node it also sets the level its attempts claim at afterwards. `ab start`'s `manual` tier is admission-only, never a build level. | `build.priority-set` |
2952
3058
  | Answer blockers with guidance | `ab answer <slug> <text> [--store <ref>]` | Select a blocked build, press `r`, enter text, then Enter. | One `escalation.answered` with `resolution: guidance` per applicable blocker. |
2953
3059
  | Retry blockers without guidance | `ab answer <slug> [--store <ref>]` | Open the same `r` field and press Enter empty or whitespace-only. | One `escalation.answered` with `resolution: retry` per applicable blocker. |
2954
3060
  | Dismiss cited finding chains | `ab answer <slug> --dismiss [--store <ref>]` | CLI only; build detail names the command. | One `escalation.answered` with `resolution: dismiss-finding` per blocker that cites a real review finding. |
@@ -2956,7 +3062,7 @@ to the build's event log and apply the same write-time checks.
2956
3062
  | Revise spec from a file | `ab answer <slug> --revise-spec <file> [--store <ref>]` | CLI only; build detail names the command. | For leaves, human `escalation.answered` then kernel `spec.revised`; eligible nodes publish `spec.revised` with operator provenance. |
2957
3063
  | Re-import revised ticket spec | `ab answer <slug> --revise-spec-from-ticket [--store <ref>]` | CLI only; build detail names the command. | The same leaf answer or direct node `spec.revised` protocol. |
2958
3064
  | Reopen a finished leaf | `ab reopen <slug> [--feedback <text>] [--revise-spec <file> \| --revise-spec-from-ticket] [--store <ref>]` | CLI/tool request (`builds.reopen`); only for a leaf waiting for its merge decision. Feedback alone returns to implement; a spec revision restarts from plan; the PR and branch are kept. | `build.reopened`; with a spec, kernel `spec.revised` with operator provenance |
2959
- | Start one ticket | `ab start <ticket-id> [--priority manual\|urgent\|normal] [--cancel] [--json] [--store <ref>]` | CLI/tool request (`tickets.start`, optional `priority`); works while intake is off or open-PR backpressure is engaged, takes a free slot in its priority's admission tier, and claims no other ticket. | `ticket.start-requested {priority}` (or `ticket.start-cancelled`), then one dispatcher `ticket.start-settled` with its outcome and priority |
3065
+ | Start one ticket | `ab start <ticket-id> [--priority manual\|urgent\|high\|normal\|low] [--cancel] [--json] [--store <ref>]` | CLI/tool request (`tickets.start`, optional `priority`); works while intake is off or open-PR backpressure is engaged, takes a free slot in its priority's admission tier, and claims no other ticket. | `ticket.start-requested {priority, level?}` (or `ticket.start-cancelled`), then one dispatcher `ticket.start-settled` with its outcome and tier |
2960
3066
  | Abort | `ab abort <slug> [--to triage\|ready] [--reason <text>] [--store <ref>]` | Select any non-terminal build and press `a`, then Enter to confirm (Escape cancels); the dashboard aborts to triage. | `build.abort-requested`, then repository `ticket.handed-back` after cleanup moves the ticket (an optimization attempt instead settles `aborted` and its ticket moves to the rejected role) |
2961
3067
 
2962
3068
  `ab start <ticket-id>` is for working one ticket while intake stays off — a
@@ -2980,15 +3086,15 @@ say why it could not start. While pending, the request is listed by
2980
3086
  withdraws it.
2981
3087
 
2982
3088
  `--priority` picks the request's slot-admission tier. `manual`, the default, goes
2983
- ahead of every waiting build and ticket claim, urgent ones included. `urgent`
2984
- waits for urgent parked work (nodes and finished or waiting builds that must
2985
- run again), then goes ahead of urgent ready tickets and all normal work.
2986
- `normal` waits for normal parked work and urgent claims, then goes ahead of
2987
- normal ready tickets. A pending request reserves its slot ahead of the tiers it
3089
+ ahead of every waiting build and ticket claim, urgent ones included. A level
3090
+ tier, `urgent`, `high`, `normal` or `low`, waits for waiting work at that level
3091
+ or above (nodes and finished or waiting builds that must run again) and for
3092
+ every higher level's claims, then goes ahead of that level's ready tickets and
3093
+ all lower-level work. A pending request reserves its slot ahead of the tiers it
2988
3094
  outranks until it settles or is cancelled. Every tier bypasses intake off and
2989
3095
  open-PR backpressure for the named ticket only, and none preempts a running
2990
- build. The claimed build is `urgent` when the request was `urgent` and
2991
- otherwise keeps its ticket's priority; `manual` is never a build priority.
3096
+ build. The claimed build takes the request's level, or its ticket's level for
3097
+ a `manual` request; `manual` is never a build level.
2992
3098
 
2993
3099
  The two `--all` forms and the global-row keys are one walk behind two surfaces.
2994
3100
  The repository pause is written first and intake second, both absolutely —
@@ -3017,12 +3123,16 @@ cancellation signal and the runner acknowledges the request. Its execution
3017
3123
  supervisor signals the local runner leader and waits for it to finish persistence
3018
3124
  and exit, then reaps remaining descendants with bounded TERM-then-KILL cleanup.
3019
3125
  Only then does it release the lease. Graceful dispatcher shutdown likewise waits
3020
- for runner suspension without a wall-clock force-exit deadline.
3126
+ for runner suspension without a wall-clock force-exit deadline. A queued, paused
3127
+ or blocked build with no live execution is acknowledged by the dispatcher
3128
+ directly, without provisioning a workspace or starting a runner.
3021
3129
  The dispatcher defers cleanup while that lease is live, then performs the
3022
3130
  checkpointed, retry-safe cleanup: close an open unmerged PR, release the workspace,
3023
3131
  delete the exact remote and local build branches, preserve existing ticket labels
3024
3132
  while adding `autobuild:aborted`, hand the ticket back, and post an abort notice
3025
- before completing as `abandoned`. The ticket moves once, straight to its
3133
+ before completing as `abandoned`. Releasing the workspace tries to preserve
3134
+ unpublished commits; when it cannot, it records them as lost
3135
+ (`workspace.commits-lost`) instead of stalling. The ticket moves once, straight to its
3026
3136
  destination: configured Triage by default, or `[tickets].readyState` with
3027
3137
  `ab abort --to ready` (or the registry's `to: "ready"`), with its `blockedBy`
3028
3138
  list unchanged, so a build waiting on other work gives up its slot and
@@ -3159,8 +3269,11 @@ Merge requires a ready candidate and cannot bypass verification or merge gates;
3159
3269
  a merge that is not ready is refused with code `merge-not-ready` (or
3160
3270
  `node-incomplete` for an incomplete node) and a reason. A refusal records no
3161
3271
  merge consent and no landing; a node's live completeness check may still save
3162
- an `integration.observed` diagnostic before it refuses. `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
3163
- aborted, or otherwise inapplicable target is an error and gets no new event. Attribution uses `USER`, then `USERNAME`, then the
3272
+ an `integration.observed` diagnostic before it refuses. `ab answer` requires an open escalation except for eligible node spec revisions. On a done
3273
+ build with an open escalation, such as a post-landing integration audit, guidance or a bare
3274
+ answer only acknowledges it: status stays done, nothing resumes, and every other answer form is
3275
+ refused. A stale, missing, aborted, or otherwise inapplicable target, or a done build with nothing
3276
+ open, is an error and gets no new event. Attribution uses `USER`, then `USERNAME`, then the
3164
3277
  same stable fallback on both surfaces. These commands run sessionless and
3165
3278
  accept `--store <ref>` with the usual explicit flag > `AB_STORE` > `[store] url` > repository
3166
3279
  local precedence. If nonblank `AB_SESSION` and matching `AB_BUILD` identify the
@@ -3224,7 +3337,11 @@ runtime; historical starts without metadata display `runtime unrecorded`.
3224
3337
  With `[policy].maxOpenPrs` configured and a dispatcher holding the
3225
3338
  repository, an `open-PR backpressure:` line (`capacity.backpressure` in JSON:
3226
3339
  `active`, `openPrs`, `maxOpenPrs`, `resumeOpenPrs`, `excludeHeld`) says whether
3227
- normal intake is paused; the dispatcher records
3340
+ high, normal and low intake is paused. With a readable held configuration, a `slots:` line
3341
+ after `capacity:` groups the builds the dispatcher counts as `held`,
3342
+ `requested` (with each request and an `urgent`, `high` or `low` marker) and `none`
3343
+ (`capacity.slots` in JSON, by slug); `occupied` counts the held entries. The
3344
+ dispatcher records
3228
3345
  `dispatcher.open-pr-backpressure-engaged` and `-cleared` only on transitions.
3229
3346
  It also lists the latest ticket scan's ticket and dependency diagnostics
3230
3347
  (`queue:` lines, `ticketDiagnostics` and `dependencyDiagnostics` in JSON),
@@ -3242,7 +3359,15 @@ are the ones something can still be done about. `HEARTBEAT` is mutable runner
3242
3359
  liveness; `PROGRESS` is the age of the latest durable event. A literal
3243
3360
  `diverged` suffix means a nonterminal build still holds a live lease but its
3244
3361
  heartbeat is at least one hour newer than its latest event. It is a visibility
3245
- signal, not a stalled/dead verdict.
3362
+ signal, not a stalled/dead verdict. `SLOT` (`slot` in JSON) is the build's
3363
+ slot state by the rules the dispatcher admits work by: `held`,
3364
+ `requested <request>` with an `urgent`, `high` or `low` suffix, or `none`; `—`
3365
+ for a done build. `unknown`, or no `slot` in JSON, is an older server's answer;
3366
+ never read it as `none`. `STATUS` prints the build's status word with its note
3367
+ (see "Status words"), and JSON adds it as `statusWord` while `status` stays
3368
+ the reducer's lifecycle status, which the filters below select on. On an
3369
+ interactive terminal `ab builds` and `ab build status` color the word with its
3370
+ tone; piped, redirected or under `--json` they print it plain.
3246
3371
 
3247
3372
  | Flag | Effect |
3248
3373
  |---|---|
@@ -3258,7 +3383,8 @@ or `--all` before concluding a build doesn't exist.
3258
3383
  **`ab build status <slug>`** details one build: unresolved escalations, open
3259
3384
  sessions, chronological durable observations, verify progress for the current
3260
3385
  cycle, PR lifecycle, latest event, durable progress age, heartbeat, and lease.
3261
- Every runner attach appears chronologically with its recorded runtime (version,
3386
+ A nonterminal build's `slot:` line (`slot` in JSON) reports its slot state as
3387
+ `ab builds` does. Every runner attach appears chronologically with its recorded runtime (version,
3262
3388
  commit, source kind/location), or `runtime unrecorded` for historical attaches;
3263
3389
  JSON exposes nullable runtime in `runnerAttaches`. Phases belong to the preceding
3264
3390
  attach boundary. A build created with a [role profile](#profiles) shows a
@@ -3397,7 +3523,9 @@ The default watch reports actionable conditions only:
3397
3523
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
3398
3524
  `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
3399
3525
  `dispatcher.kernel-git-unavailable`, `forge.credential-limited`, abnormal
3400
- `dispatcher.run-stopped`, and `dispatcher.lost`. A `forge.credential-limited`
3526
+ `dispatcher.run-stopped`, and `dispatcher.lost`. A one-tick run whose tick
3527
+ failed and was reported stops normally, with exit code 1 and the error, so a
3528
+ single blip is not attention. A `forge.credential-limited`
3401
3529
  line names the process whose GitHub request was rate-limited outside the
3402
3530
  dispatcher's credential (unauthenticated, with why, or on that process's own
3403
3531
  credential) and its reset; dispatcher forge work continues.
@@ -3432,9 +3560,12 @@ The default watch reports actionable conditions only:
3432
3560
  with the episode still open; crossing reset alone is silent. Without a reset,
3433
3561
  the deadline is 15 minutes after onset. Repeated evidence never postpones
3434
3562
  the deadline; recovery ends the episode.
3435
- - `dispatcher.tick-failure-persistent`: continuously failing completed ticks
3436
- for five minutes in one run. A successful tick, new run, or matching stop
3437
- ends the episode. Source grace and cooldown-driven failures do not start
3563
+ - `dispatcher.tick-failure-persistent`: continuously failing ticks for five
3564
+ minutes, across consecutive runs, including one-tick hosted runs. Any
3565
+ completed tick ends the episode, as does a clean, abnormal or forced stop of
3566
+ the run that last failed. A new run does not, nor does a one-tick run's normal
3567
+ stop after its failed tick. The observation keeps the first failure's time and
3568
+ names the latest failing run and error. Source grace and cooldown-driven failures do not start
3438
3569
  this clock; after grace, the first qualifying failure starts a new five-minute
3439
3570
  interval. Each persistence episode is reported once. Repository read failures
3440
3571
  fail the watch tick and retry on the next tick; repeated failures use this
@@ -3471,7 +3602,11 @@ silently baselines historical direct events and merge decisions, but retains
3471
3602
  active repository timers. A no-slug watch follows each build announced in the
3472
3603
  journal after its position from the build's first event; cursors carry
3473
3604
  creations still in preparation, and a cursor from an earlier release, which
3474
- carries none, baselines a build whose creation was selected before it. Reconcile existing conditions through status after
3605
+ carries none, baselines a build whose creation was selected before it. A watch retires a terminal, settled build (no pending cleanup, reclaim, open
3606
+ execution or integration audit) once its events through settlement are
3607
+ delivered: it leaves tracking and every later cursor, so a re-armed cursor
3608
+ stays proportional to active builds. Named builds are never retired. Following
3609
+ a build reads only events after its position, with no per-poll reduced read. Reconcile existing conditions through status after
3475
3610
  arming the watch. Named watches still end when every named build is terminal;
3476
3611
  learn their outcomes from status reconciliation at exit.
3477
3612
 
@@ -3532,7 +3667,10 @@ before any record. A store read that fails after the watch has started is
3532
3667
  reported on stderr once per failing read source — locally the poll cycle is
3533
3668
  one source, while against an `http(s)` store each tracked stream and the
3534
3669
  discovery pass carries its own failure streak — and retried without
3535
- duplicating or skipping any event.
3670
+ duplicating or skipping any event. A reducer incompatibility
3671
+ (`incompatible reducer …`: this CLI cannot represent the service's reduced
3672
+ value) is never retried: the watch exits 1 at once with upgrade advice and
3673
+ never reconstructs the value from history.
3536
3674
  Against a local store the default cadence polls every 1 second. Against an
3537
3675
  `http(s)` store each tracked stream long-polls instead — one held request per
3538
3676
  stream waits up to 25 seconds for the next event, requests run concurrently,
@@ -3582,7 +3720,8 @@ terminal set keeps waiting for a build to appear), named slugs target exactly
3582
3720
  those builds, and an unknown slug is an error before waiting begins. Inside a
3583
3721
  phase, only the ambient build may be waited on.
3584
3722
 
3585
- At least one `--for <condition>` or `--event <glob>` is required. The condition
3723
+ At least one `--for <condition>` or `--event <glob>` is required. The conditions
3724
+ are lifecycle statuses, not the dashboards' status words. The condition
3586
3725
  vocabulary is closed: `blocked`, `paused`, `running`, `collecting`, `done`, `aborted`,
3587
3726
  `terminal` (done or aborted), `pr=open`, `pr=merged`, `pr=closed`,
3588
3727
  `pr=conflicted`, `phase=<phase>` (a core phase — `plan`, `plan-review`,
@@ -3625,7 +3764,9 @@ cursor behavior as 3). The default poll interval and `--interval` match
3625
3764
  per failing read source — locally the poll cycle is one source, while
3626
3765
  against an `http(s)` store each tracked build and the discovery pass carries
3627
3766
  its own failure streak — and retried without missing or duplicating a
3628
- condition. The command is
3767
+ condition. A reducer incompatibility (`incompatible reducer …`) is not
3768
+ retried: the wait exits 1 at once with upgrade advice and never reconstructs
3769
+ the value from history. The command is
3629
3770
  read-only — it appends no event, takes no lease, and creates no record — and
3630
3771
  deciding what to do about a match stays with the caller's skill.
3631
3772
 
@@ -3667,8 +3808,8 @@ sequence positions, inclusive at head minus 1,000. Keep the cursor on normal
3667
3808
  re-arms and ordinary reducer upgrades. Typed `cursor-too-old` names the oldest
3668
3809
  servable cursor: re-arm without `--since`, reconcile repository/build status,
3669
3810
  and acknowledge the lost historical gap. Never fall back to cursor zero.
3670
- Checkpoint integrity errors are terminal; retired seed generations require an
3671
- upgrade/restart and fresh attachment. Explicit MCP `builds.events` history is
3811
+ Checkpoint integrity errors and reducer incompatibilities are terminal; retired
3812
+ seed generations require an upgrade/restart and fresh attachment. Explicit MCP `builds.events` history is
3672
3813
  paged at 256 events with `cursor` and `hasMore`; follow every continuation.
3673
3814
  MCP `repository.events` is a connected agent's repository attention watch: it
3674
3815
  reads at most 256 journal positions after its cursor, with an optional wait of
@@ -3676,7 +3817,8 @@ at most 30 seconds, and by default returns exactly the repository records this
3676
3817
  default watch reports. Its cursor advances past filtered events; omit it once
3677
3818
  for a baseline, and treat `cursor-too-old` as above. MCP `repository.attention`
3678
3819
  returns the current attention digest, every item naming its resolving tool,
3679
- with the same cursor rules.
3820
+ with the same cursor rules. Its escalations include done builds whose
3821
+ open escalation awaits acknowledgement.
3680
3822
 
3681
3823
  **`ab harvest status [--events N] [--json] [--store <ref>]`** projects the
3682
3824
  **`ab harvest status [--events N] [--json] [--store <ref>]`** projects the
@@ -3843,8 +3985,8 @@ absolute file path containing the edited text. Read the current ticket and
3843
3985
  reapply the intended changes before retrying; conflicts are never merged.
3844
3986
 
3845
3987
  File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
3846
- state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
3847
- fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
3988
+ state and any priority other than normal; file revisions also cover nonempty issue links. GitHub revisions
3989
+ fingerprint kind, target, title, body, canonical label/blocker sets (priority labels included), state and issue links,
3848
3990
  including the ticket's own issue; GitHub tickets carry no comments. Reverting
3849
3991
  identical content restores its fingerprint. File checks
3850
3992
  re-read immediately before writing, with the existing no-lock race window.