@defrex/autobuild 1.4.2 → 1.6.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 (218) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +512 -101
  3. package/bin/ab-dispatch-kernel.ts +1 -0
  4. package/docs/accounts.md +9 -0
  5. package/docs/agent-runtimes.md +1 -0
  6. package/docs/answering-blocked-builds.md +7 -3
  7. package/docs/architecture.md +313 -130
  8. package/docs/assets/headline-wide.png +0 -0
  9. package/docs/build-store.md +33 -3
  10. package/docs/cli.md +2 -1
  11. package/docs/configuration-overview.md +9 -0
  12. package/docs/configuration.md +217 -106
  13. package/docs/dispatcher-hosting.md +19 -3
  14. package/docs/dispatcher.md +11 -6
  15. package/docs/glossary.md +1 -1
  16. package/docs/integration-overview.md +2 -2
  17. package/docs/integration-tree.md +91 -28
  18. package/docs/merge-policy.md +28 -9
  19. package/docs/operating.md +1 -1
  20. package/docs/operator-api.md +57 -20
  21. package/docs/operator-surfaces.md +1 -1
  22. package/docs/plugin-authoring.md +89 -8
  23. package/docs/remote-store-protocol.md +39 -11
  24. package/docs/remote-ticket-protocol.md +126 -12
  25. package/docs/restacking.md +24 -6
  26. package/docs/seams.md +2 -2
  27. package/docs/setup.md +19 -13
  28. package/docs/spec-standard.md +2 -1
  29. package/docs/ticket-dependencies.md +26 -8
  30. package/docs/ticket-migration.md +70 -7
  31. package/docs/ticket-sources.md +82 -5
  32. package/docs/tickets.md +34 -2
  33. package/docs/troubleshooting.md +3 -3
  34. package/docs/verification.md +5 -5
  35. package/docs/website.md +8 -0
  36. package/docs/workspaces.md +1 -1
  37. package/package.json +4 -3
  38. package/packages/core/src/accounts/hosted-readiness.ts +21 -0
  39. package/packages/core/src/cli/attention.ts +3 -0
  40. package/packages/core/src/cli/build-control.ts +36 -12
  41. package/packages/core/src/cli/connect.ts +9 -18
  42. package/packages/core/src/cli/context.ts +44 -0
  43. package/packages/core/src/cli/dashboard/configuration.ts +11 -0
  44. package/packages/core/src/cli/dashboard/model.ts +51 -11
  45. package/packages/core/src/cli/dashboard/poll.ts +14 -0
  46. package/packages/core/src/cli/dashboard/queue.ts +21 -0
  47. package/packages/core/src/cli/dashboard/render.ts +43 -22
  48. package/packages/core/src/cli/dispatch-frontend.ts +63 -30
  49. package/packages/core/src/cli/dispatch-mode.ts +35 -16
  50. package/packages/core/src/cli/dispatch-preflight.ts +4 -1
  51. package/packages/core/src/cli/dispatch-repository-feed.ts +40 -11
  52. package/packages/core/src/cli/dispatch-tickets.ts +47 -0
  53. package/packages/core/src/cli/dispatch-upgrade-controller.ts +3 -0
  54. package/packages/core/src/cli/dispatch.ts +522 -145
  55. package/packages/core/src/cli/help.ts +63 -24
  56. package/packages/core/src/cli/init-hosted-accounts.ts +54 -0
  57. package/packages/core/src/cli/init-readiness-remote.ts +16 -3
  58. package/packages/core/src/cli/init-validation.ts +144 -42
  59. package/packages/core/src/cli/issue-links.ts +67 -0
  60. package/packages/core/src/cli/main.ts +32 -15
  61. package/packages/core/src/cli/pr-summary-publication.ts +38 -7
  62. package/packages/core/src/cli/publication-settlement.ts +36 -24
  63. package/packages/core/src/cli/repo-lease.ts +225 -0
  64. package/packages/core/src/cli/repository-status.ts +203 -49
  65. package/packages/core/src/cli/status.ts +42 -4
  66. package/packages/core/src/cli/terminals.ts +37 -2
  67. package/packages/core/src/cli/ticket-editor.ts +20 -6
  68. package/packages/core/src/cli/ticket.ts +264 -46
  69. package/packages/core/src/cli/triage-count-sampler.ts +59 -0
  70. package/packages/core/src/cli/wait.ts +4 -1
  71. package/packages/core/src/cli/watch.ts +19 -4
  72. package/packages/core/src/config/live.ts +45 -4
  73. package/packages/core/src/config/load.ts +9 -0
  74. package/packages/core/src/config/pipeline-source.ts +6 -2
  75. package/packages/core/src/config/ready-assignee.ts +86 -0
  76. package/packages/core/src/config/schema.ts +202 -38
  77. package/packages/core/src/distribution-packaging.ts +1 -1
  78. package/packages/core/src/events/catalog.ts +7 -0
  79. package/packages/core/src/events/compatibility.ts +2 -1
  80. package/packages/core/src/events/payloads.ts +85 -0
  81. package/packages/core/src/events/policy.ts +10 -0
  82. package/packages/core/src/events/repository.ts +93 -28
  83. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +237 -230
  84. package/packages/core/src/kernel/build-identity.ts +12 -0
  85. package/packages/core/src/kernel/change-presence.ts +139 -6
  86. package/packages/core/src/kernel/dispatch-capacity.ts +189 -19
  87. package/packages/core/src/kernel/dispatch-status.ts +10 -1
  88. package/packages/core/src/kernel/dispatch-upgrade.ts +104 -5
  89. package/packages/core/src/kernel/engine.ts +17 -8
  90. package/packages/core/src/kernel/finalize-pr-rejection.ts +95 -0
  91. package/packages/core/src/kernel/generators/build-log.ts +9 -0
  92. package/packages/core/src/kernel/generators/repository-journals.ts +15 -1
  93. package/packages/core/src/kernel/harvest.ts +4 -1
  94. package/packages/core/src/kernel/incremental-fixtures.ts +1 -0
  95. package/packages/core/src/kernel/integration-completeness.ts +104 -17
  96. package/packages/core/src/kernel/integration-landing.ts +17 -0
  97. package/packages/core/src/kernel/integration-state.ts +17 -0
  98. package/packages/core/src/kernel/issue-keywords.ts +202 -0
  99. package/packages/core/src/kernel/janitor-failure.ts +96 -5
  100. package/packages/core/src/kernel/kernel-git.ts +87 -0
  101. package/packages/core/src/kernel/landing-readiness.ts +25 -17
  102. package/packages/core/src/kernel/leaf-restack-state.ts +4 -2
  103. package/packages/core/src/kernel/log-index.ts +1 -1
  104. package/packages/core/src/kernel/node-issue-links.ts +142 -0
  105. package/packages/core/src/kernel/node-landing.ts +2 -1
  106. package/packages/core/src/kernel/node-parent.ts +6 -0
  107. package/packages/core/src/kernel/node-restack-transaction.ts +2 -0
  108. package/packages/core/src/kernel/pr-summary.ts +24 -0
  109. package/packages/core/src/kernel/read-deferrals.ts +75 -12
  110. package/packages/core/src/kernel/read-facts.ts +32 -1
  111. package/packages/core/src/kernel/reconcile-restack.ts +1 -1
  112. package/packages/core/src/kernel/reducer-registry.ts +37 -2
  113. package/packages/core/src/kernel/reducer.ts +147 -5
  114. package/packages/core/src/kernel/ticket-preparation.ts +16 -0
  115. package/packages/core/src/kernel/verify-budget.ts +43 -0
  116. package/packages/core/src/operator/index.ts +3 -1
  117. package/packages/core/src/operator/presentation.ts +3 -0
  118. package/packages/core/src/operator/protocol.ts +38 -2
  119. package/packages/core/src/operator/query.ts +69 -29
  120. package/packages/core/src/operator/registry.ts +47 -26
  121. package/packages/core/src/operator/tickets.ts +77 -10
  122. package/packages/core/src/plugin-sdk/index.ts +13 -0
  123. package/packages/core/src/plugins/manifest.ts +1 -1
  124. package/packages/core/src/plugins/registry.ts +1 -0
  125. package/packages/core/src/ports/forge/contract.ts +69 -0
  126. package/packages/core/src/ports/forge/create.ts +5 -0
  127. package/packages/core/src/ports/forge/fake.ts +184 -3
  128. package/packages/core/src/ports/forge/git-rewrite.ts +4 -2
  129. package/packages/core/src/ports/forge/github.ts +175 -38
  130. package/packages/core/src/ports/forge/local-git.ts +14 -0
  131. package/packages/core/src/ports/forge/readiness.ts +10 -0
  132. package/packages/core/src/ports/forge-failure.ts +43 -0
  133. package/packages/core/src/ports/runner/claude.ts +7 -1
  134. package/packages/core/src/ports/runner/codex.ts +7 -2
  135. package/packages/core/src/ports/runner/native-cli-fixture.ts +2 -1
  136. package/packages/core/src/ports/runner/pi.ts +7 -1
  137. package/packages/core/src/ports/runner/runtime.ts +3 -0
  138. package/packages/core/src/ports/runner/start-prompt.ts +37 -0
  139. package/packages/core/src/ports/tickets/contract.ts +320 -7
  140. package/packages/core/src/ports/tickets/create.ts +89 -20
  141. package/packages/core/src/ports/tickets/fake.ts +18 -0
  142. package/packages/core/src/ports/tickets/file-codec.ts +20 -0
  143. package/packages/core/src/ports/tickets/file.ts +43 -1
  144. package/packages/core/src/ports/tickets/github-fake.ts +1123 -0
  145. package/packages/core/src/ports/tickets/github-issues.ts +431 -0
  146. package/packages/core/src/ports/tickets/github-validators.ts +194 -0
  147. package/packages/core/src/ports/tickets/github.ts +2029 -0
  148. package/packages/core/src/ports/tickets/hosted-index.ts +34 -3
  149. package/packages/core/src/ports/tickets/issue-links.ts +86 -0
  150. package/packages/core/src/ports/tickets/lifecycle.ts +60 -4
  151. package/packages/core/src/ports/tickets/linear.ts +66 -6
  152. package/packages/core/src/ports/tickets/migration.ts +290 -68
  153. package/packages/core/src/ports/tickets/operations.ts +98 -12
  154. package/packages/core/src/ports/tickets/priority.ts +55 -0
  155. package/packages/core/src/ports/tickets/remote-protocol.ts +195 -29
  156. package/packages/core/src/ports/tickets/remote.ts +188 -13
  157. package/packages/core/src/ports/tickets/revision.ts +22 -1
  158. package/packages/core/src/ports/tickets/states.ts +43 -0
  159. package/packages/core/src/ports/tickets/tree.ts +58 -12
  160. package/packages/core/src/ports/tickets/update.ts +12 -2
  161. package/packages/core/src/ports/types.ts +194 -9
  162. package/packages/core/src/ports/workspace/commit-preservation.ts +163 -25
  163. package/packages/core/src/ports/workspace/git-worktree.ts +6 -2
  164. package/packages/core/src/ports/workspace/harvest-execution.ts +4 -2
  165. package/packages/core/src/ports/workspace/vercel-sandbox.ts +121 -27
  166. package/packages/core/src/processes/build-runner.ts +101 -22
  167. package/packages/core/src/processes/dispatcher.ts +1046 -372
  168. package/packages/core/src/processes/execution-no-progress.ts +7 -0
  169. package/packages/core/src/processes/harvest-child.ts +4 -2
  170. package/packages/core/src/processes/harvest-execution-state.ts +104 -0
  171. package/packages/core/src/processes/harvest-runner.ts +263 -25
  172. package/packages/core/src/processes/harvest.ts +5 -8
  173. package/packages/core/src/processes/tick-publication.ts +12 -2
  174. package/packages/core/src/processes/ticket-scan-schedule.ts +78 -0
  175. package/packages/core/src/processes/workspace-preservation.ts +36 -1
  176. package/packages/core/src/runtime-identity.ts +10 -2
  177. package/packages/core/src/scenarios/harness.ts +149 -35
  178. package/packages/core/src/store/adapter.ts +7 -1
  179. package/packages/core/src/store/contract.ts +83 -2
  180. package/packages/core/src/store/digest.ts +32 -1
  181. package/packages/core/src/store/reduced-reads.ts +10 -0
  182. package/packages/core/src/store/reducer-value-shapes.json +4471 -3427
  183. package/packages/core/src/store/remote/protocol.ts +2 -0
  184. package/packages/core/src/store/remote/released-clients.json +22 -0
  185. package/packages/core/src/store/remote/released-reducer-values/1.5.0.json +26924 -0
  186. package/packages/core/src/store/remote/released-reducer-values/1.6.0.json +27173 -0
  187. package/packages/core/src/store/remote/released-reducer-values/index.ts +4 -0
  188. package/packages/core/src/store/repo-state-events.ts +2 -0
  189. package/packages/core/src/store/types.ts +5 -0
  190. package/packages/core/src/testing/dispatch-read-budget.ts +729 -123
  191. package/packages/core/src/testing/index.ts +18 -1
  192. package/packages/core/src/testing/presence-history.ts +79 -0
  193. package/packages/core/src/testing/reduced-read-budget.ts +1424 -33
  194. package/packages/core/src/testing/upgrade-generations.ts +77 -0
  195. package/skills/code-review/SKILL.md +4 -3
  196. package/skills/finalize/SKILL.md +18 -2
  197. package/skills/guide/SKILL.md +417 -143
  198. package/skills/guide/references/accounts.md +9 -0
  199. package/skills/guide/references/integration-tree.md +91 -28
  200. package/skills/guide/references/merge-policy.md +28 -9
  201. package/skills/guide/references/operator-api.md +57 -20
  202. package/skills/guide/references/plugin-authoring.md +89 -8
  203. package/skills/guide/references/remote-store-protocol.md +39 -11
  204. package/skills/guide/references/remote-ticket-protocol.md +126 -12
  205. package/skills/guide/references/restacking.md +24 -6
  206. package/skills/guide/references/setup.md +19 -13
  207. package/skills/guide/references/spec-standard.md +2 -1
  208. package/skills/guide/references/ticket-dependencies.md +26 -8
  209. package/skills/guide/references/ticket-migration.md +70 -7
  210. package/skills/harvest-review/SKILL.md +4 -3
  211. package/skills/implement/SKILL.md +20 -1
  212. package/skills/operate/SKILL.md +149 -35
  213. package/skills/plan/SKILL.md +1 -1
  214. package/skills/reconcile/SKILL.md +5 -4
  215. package/skills/spec/SKILL.md +15 -2
  216. package/skills/tickets/SKILL.md +116 -37
  217. package/templates/autobuild.toml +5 -0
  218. package/templates/hosted-service/package.json +2 -2
@@ -80,14 +80,23 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
80
80
  verifiable acceptance criteria, explicit out-of-scope, and evidence — and
81
81
  dispatches. Generated work cannot leave Triage un-groomed. The dispatcher
82
82
  claims tickets that pass the `[tickets]` ready
83
- gate, chooses a short immutable slug from the final conforming spec, and
84
- starts builds up to the top-level `capacity` bound.
83
+ gate — urgent tickets first, then normal ones, each in the source's order —
84
+ chooses a short immutable slug from the final conforming spec, and
85
+ starts builds up to the top-level `capacity` bound, after slots reserved for
86
+ integration nodes awaiting verification or reconcile and for finished builds
87
+ waiting to re-verify or reconcile. `capacity` counts builds running work: a
88
+ build that finished its pipeline holds no slot while it waits for a merge
89
+ decision, though it keeps its workspace until it merges or closes. Priority
90
+ never preempts a running build.
85
91
  - **Failed preparation.** Durable preparation facts protect the claim-to-build
86
92
  interval. Caught failures return tickets to Ready (invalid specs to Triage),
87
93
  after exact build-ownership readback. Unresolved attempts stay withheld and
88
94
  retry before intake, even at full capacity or with intake disabled. Unsafe
89
95
  ownership or externally changed/missing tickets end automatic recovery with
90
- a diagnostic `abandoned` resolution, leaving the ticket unchanged. See
96
+ a diagnostic `abandoned` resolution, reported once in that tick's dispatcher
97
+ diagnostics and once as default `ab watch` repository attention, leaving the
98
+ ticket unchanged. The resolution records whether the claim was confirmed; an
99
+ unconfirmed claim's provider outcome is unknown. See
91
100
  [Ticket preparation recovery](references/restacking.md#ticket-preparation-before-build-creation).
92
101
  - **Ticket assets** — files or folders attached to a ticket (see
93
102
  [Ticket assets](#ticket-assets)) are frozen into the build at claim and
@@ -116,7 +125,11 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
116
125
  A failed stage sends every failed report to `implement` after its siblings
117
126
  settle; an optional `failFast` failure cancels unfinished siblings.
118
127
  - **`finalize`** — the agent writes the PR description; the kernel opens the
119
- PR. `[finalize].steps` run afterward and are failure-tolerant. A
128
+ PR, sealing the build's [issue links](#issue-links-in-builds) first and
129
+ writing their `Closes #N` / `Refs #N` lines when the forge supports them
130
+ (a node child's own PR gets `Refs` lines only; its closing lines go into the
131
+ root node's PR).
132
+ `[finalize].steps` run afterward and are failure-tolerant. A
120
133
  content-producing step commits selected files locally and finishes clean;
121
134
  the runner pushes the exact descendant SHA and confirms forge readback before recording success.
122
135
  - **Restacking and epilogue.** The kernel replays one net leaf change at verify
@@ -198,10 +211,17 @@ terminal.
198
211
 
199
212
  **Slug naming is not a phase.** For each new build, a tool-free one-shot call
200
213
  proposes a lowercase kebab base of at most three meaningful spec-derived words.
201
- The dispatcher owns a hard deadline, strict validation, and store-wide `-2`,
202
- `-3`, … collision suffixes. Absence or any failure falls back to the first
203
- three words of the kebab-cased title, so naming never blocks dispatch. The slug
204
- and `ab/<slug>` branch are chosen once; existing builds are never renamed.
214
+ The dispatcher owns a hard deadline, strict validation, and `-2`, `-3`, …
215
+ collision suffixes that skip both this store's slugs and `ab/` or `ab-node/`
216
+ build branches already on the remote, checked once at claim time. A forge
217
+ without that capability deduplicates against the store only and says so in a
218
+ startup warning. A missing or failed model proposal falls back to the first
219
+ three words of the kebab-cased title, so the proposal never blocks dispatch.
220
+ The branch check is not optional: if a remote lookup fails, or the base and its
221
+ `-2` … `-100` suffixes are all taken, the claim fails, no build is created, and
222
+ the ticket is handed back to ready for a later tick. The slug
223
+ and `ab/<slug>` (or `ab-node/<slug>` for a node) branch are chosen once;
224
+ existing builds are never renamed.
205
225
  Naming inherits `[roles.default]` and can be overridden by `[roles.slug]`.
206
226
 
207
227
  ## Who does what
@@ -370,7 +390,7 @@ The distinctions that change an administrator's answer:
370
390
  re-provisioned.
371
391
  - **Workspaces** are provisioned per build and remain the locally reachable
372
392
  execution context for that build.
373
- - **Ticket providers** (`linear`, `file`) sit behind one port; the dispatcher
393
+ - **Ticket providers** (`file`, `linear`, `hosted`, `github`) sit behind one port; the dispatcher
374
394
  does not know which is configured.
375
395
  - **Forge operations and pushes are kernel-side plumbing.** Agents commit
376
396
  locally and never push, never touch a remote, never open the PR. The forge
@@ -378,15 +398,24 @@ The distinctions that change an administrator's answer:
378
398
  confirmation. Local implementation publication failures write no completion or
379
399
  pending request and leave the same session retryable. A push
380
400
  happens at the implement terminal boundary or after the runner validates a
381
- successful content-producing finalize post-step. Reconcile alone uses an exact expected-head guarded rewrite after archiving every recorded Git tip under `refs/autobuild/archive/<slug>/<sha>`.
401
+ successful content-producing finalize post-step. History rewrites (reconcile,
402
+ leaf verify-entry and waiting restacks, and node restacks on demand; see
403
+ [restacking](references/restacking.md)) replace a branch only with an exact
404
+ expected-head guard after archiving every recorded Git tip under
405
+ `refs/autobuild/archive/<slug>/<sha>`.
382
406
  `github` publishes through GitHub. `local-git` performs no remote/network/`gh`
383
- operation: durable PR records live under private Git refs, the review locator
384
- is `refs/heads/ab/<slug>`, and consent merges a local guarded, unsigned squash
385
- whose message is the deposited PR description and whose author and committer
386
- come from the repository's ordinary Git identity. If Git cannot resolve that
387
- identity, the PR remains open with actionable `user.name` / `user.email`
388
- guidance and later dispatcher ticks retry. Without consent it remains open for
389
- ordinary `git diff` inspection; it has no review UI or image host.
407
+ operation: durable PR records live under private Git refs, and the review
408
+ locator is `refs/heads/ab/<slug>`. Once merge authorization (auto or consent;
409
+ see [merge policy](references/merge-policy.md)) applies, a root-target leaf
410
+ lands as a local guarded, unsigned squash whose message is the deposited PR
411
+ description and whose author and committer come from the repository's
412
+ ordinary Git identity; node children and local-git root nodes land by guarded
413
+ fast-forward instead (see [merge methods](references/merge-policy.md#merge-methods)).
414
+ `local-git` writes no issue keyword lines; a build's issue links stay in build
415
+ state. If Git cannot resolve the squash identity, the PR remains open with
416
+ actionable `user.name` / `user.email` guidance and later dispatcher ticks
417
+ retry. Until authorized it remains open for ordinary `git diff` inspection; it
418
+ has no review UI or image host.
390
419
 
391
420
  For moving a project between sources, follow the [ticket migration procedure](references/ticket-migration.md).
392
421
 
@@ -445,6 +474,14 @@ by sequence. It contains scheduling metadata only, never counts or lifecycle
445
474
  state, and is distinct from reducer checkpoints. Missing or stale metadata
446
475
  falls back to the recorded fact and can cause one safe extra scan without
447
476
  reconstructing history. Successful unchanged scans advance this cache only.
477
+ While less than one interval has elapsed since the recorded fact's
478
+ measurement, with unchanged readiness and criteria fingerprints and no
479
+ admission following an observation measurement, a tick defers without reading
480
+ the cache, because the cache only acknowledges that measurement or a later one.
481
+ If the wall clock moved backwards, a cache entry dated later than the current
482
+ clock is therefore consulted only once that window ends, at most one scan
483
+ interval after the recorded measurement; the dispatcher then treats it as a
484
+ clock rollback, rescans, and resets the cache to the current clock.
448
485
 
449
486
 
450
487
  ### Root scalars
@@ -456,7 +493,7 @@ under the preceding table.
456
493
  |---|---|---|---|
457
494
  | `baseBranch` | `"main"` | nonempty string | The branch builds branch from and target with their PR; what `reconcile` replays the build change onto. |
458
495
  | `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. |
459
- | `capacity` | `1` | positive integer | Maximum concurrent builds for this repository. |
496
+ | `capacity` | `1` | positive integer | Maximum builds running work at once for this repository; builds parked for a merge decision hold no slot. |
460
497
  | `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. |
461
498
  | `plugins` | `[]` | array of unique nonblank module specifiers | Trusted Bun plugin modules loaded before dispatch, `ab ticket`, and scoped phase wiring. |
462
499
 
@@ -617,7 +654,8 @@ start no agent. Keep runtime installation out of `commands.setup`. Pi over
617
654
  `vercel-ai-gateway/...` uses `AI_GATEWAY_API_KEY`; never copy Pi state or Pi OAuth refresh tokens. Claude Code can select named [accounts](references/accounts.md): subscription tokens or region-bound Kimi Code keys stay on the dispatcher, with placeholders in the guest and exact-host/header egress transforms. Use the unmodified runtime, your own subscription and ordinary individual usage. Provision Claude/Kimi credentials manually; Autobuild never invokes `claude setup-token`. Codex can explicitly select a ChatGPT Plus/Pro account authorized with `bun ab accounts login NAME [--local|--project]`; exactly one dispatcher or hosted refreshing secret owns its renewal. The clone identity is upload-pack-only and
618
655
  scrubbed from Git config before an agent starts. Agents cannot push. Remote phase terminals deposit a durable
619
656
  publication request and park; that successful `ab done` is the one terminal and
620
- must not be repeated. After VM stop and lease release, the local kernel
657
+ must not be repeated. An implement round with no commits over its contribution
658
+ base escalates at `implement` instead of requesting publication. After VM stop and lease release, the local kernel
621
659
  publishes the exact SHA/branch through a temporary narrow firewall transform,
622
660
  verifies it, and performs PR work locally. Ordinary completion deletes the VM.
623
661
  Branch config, installed skills, relative/package plugins, setup, and phase CLI
@@ -637,8 +675,8 @@ likes.
637
675
  `setup` is special by convention: it runs after workspace provision and after a
638
676
  sandbox rehydrate. Failures are durable, remain visible in build status and the
639
677
  dashboard, and retry up to `[policy].maxSetupAttempts`; exhaustion raises a
640
- setup-targeted escalation without manufacturing a pipeline phase or verdict. A
641
- human answer re-arms the budget, and a later successful `runner.attached` clears
678
+ setup-targeted escalation without manufacturing a pipeline phase or verdict. An
679
+ answer from your operator agent or you re-arms the budget, and a later successful `runner.attached` clears
642
680
  the current error. Values are never evaluated as config — they are handed to a
643
681
  shell as written.
644
682
 
@@ -771,26 +809,14 @@ should treat a `design` asset as part of the contract, a contract on observable
771
809
  visual and reference outcomes, not on implementation, and judge the result
772
810
  against it.
773
811
 
774
- Node `verify:*` context additionally exposes `nodeVerification`: the frozen
775
- range, a JSON index path, contribution build slugs, preparation-time stored ticket
776
- identities, event-authorized spec revisions and spec paths, and their commits.
777
- The index maps every commit in the range using build identity trailers,
778
- including earlier-cycle contributions and merge side history. Commits without
779
- an identity are listed as unattributed (a mechanical classification). The manifest
780
- and index also expose `handPushedCommits: [{sha, originalSha, message}]` for owned
781
- hand-pushed commits in the frozen range, preserving original identity across restacks.
782
- Their full messages express maintainer-authorized intent: judge quality and
783
- consistency, and never fail them solely for lacking a covering spec. Other node
784
- changes are authorized when covered by the node spec or the spec
785
- of the contribution introducing it; use the commit mapping to find that spec.
786
- The dispatcher collects these inputs with repository authority before launching
787
- verification and atomically deposits a node-owned `node-verification-context`
788
- artifact cited by exact revision in `integration.prepared`. Contributor specs
789
- freeze at preparation; resumed and concurrent verifiers read the same cycle input.
790
- Hydration reads only that node-owned artifact and grants no general contributor
791
- read authority. Missing or ambiguous provenance prevents preparation; missing,
792
- corrupt or mismatched prepared inputs fail hydration. Historical agent cycles
793
- without a citation require a new integration cycle. Leaf context is unchanged.
812
+ Node `verify:*` context additionally exposes `nodeVerification`: frozen
813
+ contribution specs, a commit provenance index and owned `handPushedCommits`,
814
+ prepared by the dispatcher for the exact cycle. Judge hand-pushed commits on
815
+ their messages and other changes against the node spec or the introducing
816
+ contribution's spec. See
817
+ [node verification context](references/integration-tree.md#node-verification-context)
818
+ for the fields, the authorization rule, and preparation and failure behavior.
819
+ Leaf context is unchanged.
794
820
 
795
821
  An agent verify step selects `[roles.<step>]` by its **logical step name** —
796
822
  the name in `[verify].steps`, not the skill it runs. An agent finalize
@@ -862,7 +888,10 @@ masks another step's failure. For leaves, failures return the build to `implemen
862
888
  consume `[policy].maxVerifyAttempts` once per distinct failed cycle since the
863
889
  latest spec revision. Passing target-movement cycles cost zero; cycle identifiers
864
890
  remain monotonic across restacks and reconciles. Skips retain the cycle's attempt number
865
- without consuming that budget.
891
+ without consuming that budget. The budget is build-wide, not per step: its policy
892
+ escalation lists each counted failed attempt with its failed steps, says a step
893
+ failed in every counted cycle only when it did, and otherwise names the latest
894
+ failed cycle's steps. The escalation targets the last failed `verify:<step>`.
866
895
 
867
896
 
868
897
  Classified session deferrals consume no phase failures. Unsupported decisive
@@ -875,14 +904,21 @@ authorization.
875
904
  When the scoped `ab context` initial own-build read fails, the CLI best-effort
876
905
  writes `session.build-read-failed` with exact session, phase, round, operation
877
906
  `context`, reason `own-build-read`, and diagnostic. A valid terminal from that
878
- session wins if the agent recovers. Otherwise settlement records `phase.deferred`
907
+ session, or from its native continuation, wins if the agent recovers; a
908
+ continuation inherits its predecessor's pending deferral, so a chain parks at
909
+ most once. A later successful own-build read in the same session records
910
+ `session.build-read-recovered`, which a newer classified failure invalidates. A
911
+ finalize post-step, which has no terminal, settles as recovered only with that
912
+ evidence and a completed turn, and the kernel then records its
913
+ `finalize.step-completed`. Otherwise settlement records `phase.deferred`
879
914
  and `phase.deferral-escalated`, immediately projecting ordinary blocked attention.
880
915
  The raise cites `own-build-read:<evidenceSeq>`; replay repairs either settlement
881
916
  crash gap before launching another agent. An `escalation.answered` retry or
882
917
  guidance authorizes one fresh session without resetting genuine phase failures;
883
918
  a new classified failure parks again. There are zero automatic paid retries
884
919
  after this deferral. If evidence cannot be written, ordinary recovery applies;
885
- agent output and `no-terminal` alone never classify a read failure.
920
+ agent output and `no-terminal` alone never classify a read failure or settle
921
+ one as recovered.
886
922
 
887
923
  A kernel store write rejected with HTTP 413 raises `StoreWriteTooLargeError`
888
924
  and records `phase.failed {willRetry:false}` on its first attempt, including
@@ -902,11 +938,21 @@ non-destructive execution fence for the exact workspace and execution generation
902
938
  It preserves unpublished branch commits and distinct detached producer candidates
903
939
  under immutable `refs/autobuild/archive/<build>/<sha>` refs, verifies their exact
904
940
  readback, and records `workspace.commits-preserved` before cleanup. Replacement
905
- provisioning restores those exact refs before starting an agent. Preservation
941
+ provisioning restores those exact refs before starting an agent, reading them
942
+ from the local repository with the local-git forge and fetching each exact ref
943
+ from the remote otherwise. A preserved
944
+ branch head that the build's latest 64 replaced heads cover, as the replaced
945
+ head itself or one of its ancestors, is kept only as archived objects: it is
946
+ never preserved or restored as the branch, and provisioning records the skip as
947
+ `restorationSkipped` on `workspace.provisioned`. Rewrites older than that bound,
948
+ and unpublished divergent branch work, are still refused. Preservation
906
949
  never advances the public build branch. A confirmed absent environment, or one
907
950
  that exists without a provisioned checkout, records `workspace.commits-lost`,
908
951
  naming known candidates and explicitly noting that any additional unpublished
909
- SHAs could not be inspected. Unknown fencing, inspection, transport, or
952
+ SHAs could not be inspected. An environment that never started executing holds
953
+ no unpublished work: objects its checkout lacks mean nothing to preserve, so
954
+ cleanup records `workspace.commits-preserved` carrying forward earlier preserved
955
+ heads, then releases and replaces it. Unknown fencing, inspection, transport, or
910
956
  receipt-write outcomes leave the workspace and snapshots intact. A workspace
911
957
  flagged by `workspace.cleanup-required` is never launched into: the dispatcher
912
958
  releases it and provisions the next generation. A preservation or release
@@ -1087,7 +1133,7 @@ consumed by the core `plan` phase, and nothing is reported.
1087
1133
  | Field | Default | Allowed / constraints | Effect |
1088
1134
  |---|---|---|---|
1089
1135
  | `runtime` | — | required on `default`; otherwise optional, nonempty string | Runtime for this role. A child that omits it inherits `[roles.default].runtime`. Must name a registered runtime. |
1090
- | `account` | Named billing account; inherits independently on primaries and alternates. Omission selects the sole Claude subscription account for a Claude route. |
1136
+ | `account` | — | optional, nonblank string naming a declared `[accounts]` entry whose kind matches the route's runtime | Named billing account for this role; inherits independently on primaries and alternates. Omission selects the sole Claude subscription account for a Claude route. |
1091
1137
  | `model` | — | optional, nonempty string | Model for this role. A role that omits it inherits `[roles.default].model`; when neither names a model, a Claude route selecting a Kimi Code account uses `kimi-for-coding`, and every other route uses its runtime's own default. |
1092
1138
  | `args` | `[]` | optional, array of nonempty strings | Ordered extra CLI argv tokens for every phase and tool-free one-shot invocation. Omitted ⇒ inherit `[roles.default].args`; a set list, including `[]`, replaces it wholesale. Each string is one token, without shell parsing. Model and parsed protocol/output-mode spellings are rejected eagerly; Claude routes with a selected account additionally reject `--settings`, `--setting-sources`, and `--bare` because Autobuild owns their authentication settings. Codex routes selecting a ChatGPT subscription account additionally reject `-c`, `--config`, `--profile`, `-p`, `--enable`, and `--disable` because Autobuild owns their provider and configuration routing. |
1093
1139
  | `extensions` | no effect | deprecated optional array of nonempty strings | Compatibility-only field. Dispatch warns for each declaring role and directs migration to `args`. |
@@ -1133,9 +1179,15 @@ outcome.
1133
1179
  Each attempt starts from the primary. Overload, rate-limit, 5xx, timeout,
1134
1180
  transport, unknown provider failures, and quota/usage/billing exhaustion try
1135
1181
  alternates in order without consuming extra phase attempts. Authentication,
1136
- permission, and local runtime-configuration failures do not. Every target has
1137
- its own session/transcript; a continuation fallback starts fresh from durable
1138
- context. Selection is not sticky, so the next phase, continuation, or retry
1182
+ permission, and local runtime-configuration failures do not, with one
1183
+ exception: a target whose runtime CLI executable is not installed falls through
1184
+ to the next declared alternate, so the phase runs on the first declared target
1185
+ whose CLI is present. An installed CLI with an unsupported version still stops
1186
+ the chain, as does every other local runtime-configuration failure. When no
1187
+ declared target has its CLI installed, the phase ends in one non-retried
1188
+ `configuration` failure carrying the last target's missing-CLI message. Every
1189
+ target has its own session/transcript; a continuation fallback starts fresh
1190
+ from durable context. Selection is not sticky, so the next phase, continuation, or retry
1139
1191
  starts from the primary. A suspended Harvest turn first retries its recorded
1140
1192
  route, then tries the remaining configured targets in order. Its substitution
1141
1193
  and failure evidence retain configured indexes even when that order starts at
@@ -1170,16 +1222,19 @@ nonnegative integer so zero can disable that trigger.
1170
1222
  | Field | Default | Allowed / constraints | Effect |
1171
1223
  |---|---|---|---|
1172
1224
  | `upgradeDrainSeconds` | `900` | positive integer | Local generation drain deadline from handoff start; hot-reloaded while draining. |
1225
+ | `dispatchLeaseTimeoutSeconds` | `60` | positive integer, greater than `dispatchLeaseRenewalSeconds` | How long the repository dispatch lease survives without renewal. A dispatcher that stalls longer reclaims it on waking unless another dispatcher took it, in which case it stops as `superseded`; a standby takes over a dead holder within this bound. Adopted at the dispatcher's next tick. |
1226
+ | `dispatchLeaseRenewalSeconds` | `20` | positive integer, less than `dispatchLeaseTimeoutSeconds` | Interval between repository dispatch lease renewals; adopted together with the timeout. Configuration with renewal at or above the timeout is refused when it loads. |
1173
1227
  | `sessionBudgetSeconds` | `3600` | positive integer | Active-time bound for each build agent session unless its logical role overrides it; native continuation retains accumulated time and excludes suspension. |
1174
- | `stallRounds` | `3` | positive integer | The same finding surviving this many review rounds auto-escalates to a human — the anti-loop guard. |
1228
+ | `stallRounds` | `3` | positive integer | The same finding surviving this many review rounds auto-escalates for external judgment — the anti-loop guard. |
1175
1229
  | `maxVerifyAttempts` | `3` | positive integer | Caps distinct failed verify cycles since the latest spec revision; passed and skipped cycles cost zero. |
1176
1230
  | `maxDispatchAttempts` | `3` | positive integer | Caps consecutive dispatch failures before a setup-targeted `dispatch-failure-limit` escalation. |
1177
- | `maxSetupAttempts` | `3` | positive integer | Caps consecutive `[commands].setup` failures before a setup-targeted human escalation. |
1178
- | `maxInfrastructureAttempts` | `3` | positive integer | Caps consecutive remote provider lifecycle failures before a setup-targeted human escalation; a `retry` answer re-arms the budget. |
1231
+ | `maxSetupAttempts` | `3` | positive integer | Caps consecutive `[commands].setup` failures before a setup-targeted policy escalation. |
1232
+ | `maxInfrastructureAttempts` | `3` | positive integer | Caps consecutive remote provider lifecycle failures before a setup-targeted policy escalation; a `retry` answer re-arms the budget. |
1179
1233
  | `maxReconcileAttempts` | `3` | positive integer | Caps completed reconciles that leave the PR conflicted against an unchanged authoritative base. Moving-base races do not consume the budget. |
1180
1234
  | `maxReviewRounds` | `6` | positive integer | Default `maxRounds` for the `plan ⇄ plan-review` and `implement ⇄ code-review` convergence loops. When that cap parks a build, `ab answer <slug> --review-round-ceiling <n>` may replace it for only the escalation's loop and current spec revision. |
1181
1235
  | `harvestThreshold` | `5` | positive integer | Newly unclaimed `observation.recorded` occurrences required to start one repository harvest run. |
1182
1236
  | `janitorFailureAttentionSeconds` | `600` | positive integer | Consecutive janitor failure duration before build attention. |
1237
+ | `janitorFailureEscalationSeconds` | `3600` | positive integer | Consecutive janitor failure duration before the build raises one escalation; the janitor keeps retrying. |
1183
1238
  | `nodeIdleAfterSeconds` | `600` | positive integer | Quiet period before opened integration nodes enter idle polling. |
1184
1239
  | `nodeIdlePollSeconds` | `120` | positive integer | Interval between idle node checks; durable activity wakes the next tick. |
1185
1240
  | `janitorBackoffMaxSeconds` | `300` | positive integer | Cap on exponential janitor retry delay, starting at 30 seconds. |
@@ -1260,15 +1315,17 @@ state eligible.
1260
1315
  | `source` | — | **required**, nonblank builtin or plugin registration name | Which provider backs all ticket operations. Unknown names report every available builtin and plugin source. |
1261
1316
  | `readyLabels` | — (source-aware) | optional; array of nonempty strings | A ticket must carry **every** listed label to be dispatchable. `[]` = **no label gate**. Absent uses the source default below. |
1262
1317
  | `url` | selected build service | HTTPS URL (loopback HTTP allowed), no userinfo/query/fragment; hosted only | Ticket service independent of builds; required for local builds. |
1263
- | `readyState` | hosted: `ready` | non-blank string; required for other sources | The one workflow state a ticket must sit in to be dispatchable. Linear matches exactly and case-sensitively; file matches it case-insensitively to a state directory (`ready` → `ready/`). There is no any-state mode. |
1264
- | `readyAssignee` | — | optional; `"me"` or an email; `linear` only | Also require the ticket to be assigned to that Linear user (`me` = owner of `LINEAR_API_KEY`); unassigned tickets are never ready. |
1265
- | `teamKey` | — | required by `linear` and `hosted`, forbidden by `file`, allowed for plugins | The Linear team key (e.g. `"ENG"`), the captured prefix for new hosted ticket ids (`ENG-1`), or a plugin configuration field. Hosted numbers are project-local and continue across prefix changes; legacy ids remain aliases and readable inputs are case-insensitive. |
1266
- | `claimedState` | — | optional nonempty string; forbidden by `file`, allowed for plugins | Workflow state `claim()` moves a ticket to when a build starts. |
1267
- | `doneState` | hosted: `"done"` | optional nonblank string | Project completion state and merged-ticket transition; hosted tickets only. |
1268
- | `createState` | — | optional, nonempty string | Default state for new tickets when a create does not name one. Absent = the provider's default (Linear: the team's default, e.g. Backlog; file: Triage). |
1269
- | `triageState` | — | optional, nonempty string | State the dispatcher hands tickets back to for human triage — spec-gate bounces, aborted builds, closed-unmerged PRs. Absent = Linear: Backlog; hosted: triage; file/plugin: Triage. Must name a state the tracker actually has — a Linear team only has "Triage" when its triage feature is enabled. |
1318
+ | `readyState` | hosted, github: `ready` | non-blank string; required for other sources | The one workflow state a ticket must sit in to be dispatchable. Linear matches exactly and case-sensitively; file matches it case-insensitively to a state directory (`ready` → `ready/`); github matches the `autobuild:<state>` label ignoring case. There is no any-state mode. |
1319
+ | `readyAssignee` | — | optional; sources that declare the capability: `linear` (`"me"` or an email), `github` (`"me"` or a username, managed-user `name_shortcode` logins included), declaring plugins; refused for `file`/`hosted` | Also require the ticket to be assigned to that user; unassigned tickets are never ready. `me` is the credential owner: of `LINEAR_API_KEY` for `linear`, of the GitHub token for `github`. A `github` issue with several assignees matches any one of them. |
1320
+ | `teamKey` | — | required by `linear` and `hosted`, forbidden by `file` and `github`, allowed for plugins | The Linear team key (e.g. `"ENG"`), the captured prefix for new hosted ticket ids (`ENG-1`), or a plugin configuration field. Hosted numbers are project-local and continue across prefix changes; legacy ids remain aliases and readable inputs are case-insensitive. |
1321
+ | `claimedState` | hosted, github: `doing` | optional nonempty string; forbidden by `file`, allowed for plugins | Workflow state `claim()` moves a ticket to when a build starts. |
1322
+ | `doneState` | hosted, github: `"done"` | optional nonblank string | Project completion state and merged-ticket transition; hosted and github tickets only. A github ticket is done when its issue is closed as completed. |
1323
+ | `createState` | — | optional, nonempty string | Default state for new tickets when a create does not name one. Absent = the provider's default (Linear: the team's default, e.g. Backlog; file: Triage; github: triage). |
1324
+ | `triageState` | — | optional, nonempty string | State the dispatcher hands tickets back to for human triage — spec-gate bounces, aborted builds, closed-unmerged PRs. Absent = Linear: Backlog; hosted, github: triage; file/plugin: Triage. Must name a state the tracker actually has — a Linear team only has "Triage" when its triage feature is enabled. |
1270
1325
  | `proposalState` | — | optional, nonempty string | State observation harvest files approved proposals into. Absent = the resolved `triageState`, which keeps the human grooming gate. Setting it to `readyState` waives that gate: harvested proposals dispatch without being read. Keep it distinct from `triageState` — see below. |
1271
- | `dir` | file: `.autobuild/tickets`; plugin: — | optional nonempty string; forbidden by `linear`, allowed for plugins | Root holding file state directories, or an existing plugin configuration field. |
1326
+ | `backlogState` | — | optional nonblank string; every source | State that holds deliberately deferred work: the backlog role. Recommended (`ab init` writes `"backlog"` for file, hosted and github); unset means the role does not exist. Must differ, case-insensitively, from the ready, claimed, done, triage and proposal states and from `rejectedState`. |
1327
+ | `rejectedState` | — | optional nonblank string; every source | State that holds considered-and-declined work: the rejected role. Recommended (`ab init` writes `"rejected"` for file, hosted and github). On github it is an issue closed as not planned or duplicate. A ticket in it never resolves a blocker, even if the source counts it complete, and never keeps a node incomplete. Same distinctness rule. |
1328
+ | `dir` | file: `.autobuild/tickets`; plugin: — | optional nonempty string; forbidden by `linear`, `hosted` and `github`, allowed for plugins | Root holding file state directories, or an existing plugin configuration field. |
1272
1329
 
1273
1330
  `readyLabels` is the only source-aware readiness default. Dispatch resolves it
1274
1331
  as follows:
@@ -1276,6 +1333,7 @@ as follows:
1276
1333
  | `[tickets].source` | `readyLabels` absent |
1277
1334
  |---|---|
1278
1335
  | `"linear"` | `["autobuild"]` — the historical label narrowing |
1336
+ | `"github"` | `["autobuild"]` — the same narrowing, as an issue label |
1279
1337
  | `"file"` | `[]` — no label narrowing; `readyState` selects the directory |
1280
1338
  | plugin | `[]` — no host-imposed label convention |
1281
1339
 
@@ -1290,6 +1348,12 @@ and reclaimed on every tick. `proposalState` moves only what harvest files.
1290
1348
  Cross-field rules, each an **error**:
1291
1349
 
1292
1350
  - `source = "linear"` without `teamKey`; or with `dir` set.
1351
+ - `source = "github"` with `teamKey`, `dir` or `url` set. The forge
1352
+ repository is the tracker, so no other key is required.
1353
+ - `readyAssignee` on a source that doesn't declare the capability (`file`,
1354
+ `hosted`, or a plugin source without it). The error names the source; for a
1355
+ plugin it comes at startup and `ab init --validate`, after plugins load, and
1356
+ a live reload that adds it is rejected.
1293
1357
  - `source = "file"` with `teamKey` or `claimedState` set. `dir` is **optional**
1294
1358
  here — absent means the default above, which is why the schema leaves it
1295
1359
  optional rather than giving it a `.default()`: that is what keeps the
@@ -1305,7 +1369,8 @@ Cross-field rules, each an **error**:
1305
1369
  The file tracker is **directory-per-state**: `<dir>/<state>/<id>.md`, where
1306
1370
  every directory directly under the root is a state: the four lifecycle
1307
1371
  directories `triage/ ready/ doing/ done/` (always present, created on first use)
1308
- plus any others the repository adds, such as `icebox/`. A state exists when its
1372
+ plus the configured backlog and rejected role states (created on the first role
1373
+ move) and any others the repository adds. A state exists when its
1309
1374
  directory exists; state names match directories case-insensitively, and a name
1310
1375
  with no directory is an error listing those that exist. The directory *is* the
1311
1376
  state, so a transition or
@@ -1322,8 +1387,59 @@ explicit `dir` is the user's and is left alone. Operator agents and humans drive
1322
1387
  through the source-agnostic `ab ticket` commands rather than running `mv` or
1323
1388
  `mkdir` by hand; `ab ticket state create` makes a new state.
1324
1389
 
1390
+ The `github` source reads the issues of the forge repository, the GitHub
1391
+ repository `origin` names. Ticket ids are issue numbers (`123` or `#123`), and
1392
+ pull requests are never tickets. An open issue with one `autobuild:<state>`
1393
+ label is in that state; an open issue with none is in triage, so issues filed
1394
+ on GitHub arrive there; an open issue with two or more is excluded with a
1395
+ diagnostic naming it and its labels. Closed as completed, or closed with no
1396
+ recorded reason, is done. Closed as not planned or duplicate is the rejected
1397
+ state, or a fixed `not-planned` state when `rejectedState` is unset, which is
1398
+ never ready, never resolves a blocker and cannot be moved into. Reopening an
1399
+ issue on GitHub returns it to triage: the first read strips a stale pre-reopen
1400
+ state label. That check reads the issue's last 100 label and reopen events, so
1401
+ an issue whose deciding event is older is excluded with a diagnostic until its
1402
+ state label is removed and re-added. Blockers are native GitHub issue
1403
+ dependencies; a blocker in another repository never resolves. The ticket's own
1404
+ issue is always a `closes` link. Links to other issues show on GitHub as
1405
+ `autobuild-link:<intent> #<n>` labels, one repository label per linked issue
1406
+ and intent, never deleted when unused; state and link labels are never ticket
1407
+ labels, and writes naming them are refused. The `autobuild:proposal` and
1408
+ `autobuild:aborted` labels that harvest and abort apply are ordinary labels,
1409
+ so `proposal` and `aborted` cannot be states. Dispatcher notices post as issue
1410
+ comments, but tickets carry no comment history, so `ab ticket show` lists none;
1411
+ export and import read it explicitly.
1412
+ Assets live in the BuildStore. A node is an issue with the exact `node` label,
1413
+ and a ticket targets a node by being a sub-issue of the node's issue; a parent
1414
+ without that label, or in another repository, is grouping that gives no target
1415
+ and is left untouched (see [integration trees](references/integration-tree.md)).
1416
+ There are no guarded writes. Export and import are supported, and
1417
+ import remaps every id to a new issue number (see the
1418
+ [ticket migration procedure](references/ticket-migration.md)). Dispatcher reads are conditional requests whose validators
1419
+ live under the local state root and are evicted after 7 days unused, so an
1420
+ unchanged repository costs a tick no primary rate-limit budget. Rate limits
1421
+ surface as the ticket-source rate-limit error. A keyed create needs
1422
+ `idempotencyKeyReservedAt`, the earliest time the key could first have been
1423
+ used; harvest supplies it. Drive all of it through `ab ticket`, never by
1424
+ hand-editing state or link labels.
1425
+
1426
+ State counts from the `github` source are display-only: each `countStates` or
1427
+ `listStates` call sends one fresh GraphQL request, plus one more per further
1428
+ page of 100 `autobuild:` labels, and nothing is cached; done and rejected follow GitHub's search-index lag. Three cases
1429
+ approximate. A stale reopen label counts in its label's state until the first
1430
+ read strips it. An issue with two or more state labels counts once in each of
1431
+ them; the first read reports it, and counts correct once its labels are fixed.
1432
+ A closure that predates GitHub's close reasons reads as done but may count as
1433
+ rejected or `not-planned`, and never heals. Ticket reads, readiness and blocker
1434
+ resolution are always exact.
1435
+
1325
1436
  **Secrets never live in this file.** `LINEAR_API_KEY` and plugin-declared
1326
1437
  `requiredEnv` credentials are environment variables (a local `.env` works).
1438
+ The `github` source reuses the forge credential: `GITHUB_TOKEN`, then `GH_TOKEN`,
1439
+ then the gh CLI's `gh auth login`. It needs Issues read and write, and Metadata
1440
+ read, on the repository, and a user token's user needs triage or write access,
1441
+ because GitHub silently drops label changes below that. The source fails such a
1442
+ write with a permission error, and `ab init --validate` reports it.
1327
1443
  Missing plugin credentials name both the selected source and every missing
1328
1444
  variable. If a user asks you to put an API key in `autobuild.toml`, use the
1329
1445
  environment variable instead and say why.
@@ -1394,8 +1510,13 @@ the authoritative base commit using packaged-content and production-lock equalit
1394
1510
  without modifying operator or build worktrees. Equal-content advances still record
1395
1511
  the latest resolved target SHA. Compatible generations overlap through the durable draining handoff described above. `--once`, origin-mode and direct hot
1396
1512
  presentation modes bypass automatic adoption. Operator stop wins over cutover.
1397
- Repository status exposes per-run resolved target, upgrade target, failure and handoff facts, both
1398
- generations, takeover, outstanding draining builds and deadline;
1513
+ Repository status shows the current upgrade condition: the live handoff (both
1514
+ generations, takeover, outstanding draining builds and deadline), the current
1515
+ generation's resolved target and latest outcome, and the latest settled outcome
1516
+ from an earlier generation. A failure that a later different resolved target or a
1517
+ later generation replaced is marked `(superseded)` and needs no action. The
1518
+ `upgrades` value keeps a bounded window of 16 recent runs; full upgrade history
1519
+ stays in the repository journal;
1399
1520
  `dispatcher.upgrade-failed` and `dispatcher.runtime-rolled-back` are actionable attention. Status also exposes the last rollback and current-lineage hold. Unrelated base commits do not
1400
1521
  retry an unchanged failed target. No registry credentials belong in these facts.
1401
1522
 
@@ -1611,6 +1732,26 @@ while worktrees and default file tickets remain under the repository-default
1611
1732
  `.autobuild/` directory. The dispatcher passes its normalized selection to
1612
1733
  every agent session as `AB_STORE`.
1613
1734
 
1735
+ ### Several dispatchers on one repository
1736
+
1737
+ One repository driven by several dispatchers — for example each engineer
1738
+ running `ab dispatch` locally — should share one store: connect every
1739
+ dispatcher to the same service with `ab connect`. Assignee gating
1740
+ (`[tickets].readyAssignee`) divides tickets between dispatchers but not
1741
+ store-owned state. Separate local stores each see only their own builds:
1742
+
1743
+ - **Nodes are owned by one store.** A child ticket can target only a node built
1744
+ in its own store; elsewhere it stays queued with `target node … is being
1745
+ built by another store`.
1746
+ - **Harvest observations are split.** Each store harvests only its own builds'
1747
+ observations.
1748
+ - **No shared build history.** `ab builds`, status, dashboards and the operator
1749
+ API show only the local store's builds.
1750
+ - **Branch collisions are only partly guarded.** A dispatcher skips any slug
1751
+ whose `ab/` or `ab-node/` branch already exists on the remote (when its forge
1752
+ supports `remoteBranchExists`), but two stores that claim the same name
1753
+ before either pushes can still collide.
1754
+
1614
1755
  ## Connect a project
1615
1756
 
1616
1757
  From a checkout with an origin remote, run `ab connect https://YOUR_ORIGIN`.
@@ -1692,14 +1833,15 @@ Do not present self-hosting to users as a supported product feature.
1692
1833
 
1693
1834
  The sessionless `ab ticket` namespace constructs whichever TicketSource the
1694
1835
  repository's `[tickets]` table selects. These forms therefore work unchanged
1695
- with Linear and the file tracker, without provider-specific API/MCP calls:
1836
+ with the file tracker, Linear, hosted tickets and GitHub issues, without
1837
+ provider-specific API/MCP calls:
1696
1838
 
1697
- - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--json]`
1839
+ - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--issues N[:refs],...] [--priority urgent|normal] [--json]`
1698
1840
  files a ticket. Without `--state`, the source uses `[tickets].createState` or
1699
1841
  its own default. A named state is passed through unchanged and the selected
1700
1842
  source validates it before creating anything. Blocker ids belong to the same
1701
1843
  source and are also checked before the single create call.
1702
- - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--json]`
1844
+ - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--issues N[:refs],...] [--priority urgent|normal] [--json]`
1703
1845
  partially replaces editable fields. At least one editable flag is required;
1704
1846
  `--json` alone is not an update.
1705
1847
  - `ab ticket block <id> <blocker-id[,blocker-id...]> [--json]` adds one or more
@@ -1712,21 +1854,26 @@ with Linear and the file tracker, without provider-specific API/MCP calls:
1712
1854
  criteria apply; every requested label must match.
1713
1855
  - `ab ticket show <id> [--json]` reads one complete ticket. Human output includes
1714
1856
  labeled metadata and the body verbatim, so it can read a stored spec back.
1715
- - `ab ticket move <id> <state> [--json]` transitions one ticket and reports its
1716
- post-transition value.
1857
+ - `ab ticket move <id> (<state> | --role triage|ready|backlog|rejected) [--json]`
1858
+ transitions one ticket and reports its post-transition value. `--role`
1859
+ resolves the configured native name; an unconfigured backlog or rejected role
1860
+ is refused naming its key, never mapped to a same-named state, and a source
1861
+ that creates states creates the role state on first use.
1717
1862
  - `ab ticket states [--json]` lists every state of the configured source:
1718
- lifecycle states first (triage, ready, doing, done), then custom states
1719
- alphabetically. Each row has the state name, the roles it plays under the
1720
- current config (create, ready, claimed, triage, proposal, done, or none), its
1721
- ticket count, and its purpose when set. `--json` emits one bare array of
1863
+ role-holding states in workflow order (triage, create, proposal, backlog,
1864
+ ready, claimed, done, rejected), then the rest. Each row has the state name,
1865
+ the roles it plays under the current config (or none), its ticket count, and
1866
+ its purpose when set. `--json` emits one bare array of
1722
1867
  `{name, roles, tickets, about?}`.
1723
1868
  - `ab ticket state create <name> [--about <text>] [--json]` makes a state, for
1724
- example `icebox`. It is idempotent: an existing state is reported as already
1869
+ example `needs-design`. It is idempotent: an existing state is reported as already
1725
1870
  existing, and `--about` (one line) records or replaces its purpose. A name is
1726
1871
  one to forty lowercase letters, digits, and hyphens starting with a letter,
1727
1872
  and may not match an existing state case-insensitively. There is no rename or
1728
- delete. Only the file source supports `states` and `state create`; other
1729
- sources exit nonzero naming the source and the unsupported operation.
1873
+ delete. The file, hosted and github sources support `states` and `state create`
1874
+ (github states are `autobuild:<state>` labels, and the purpose is the label
1875
+ description); other sources exit nonzero naming the source and the
1876
+ unsupported operation.
1730
1877
 
1731
1878
  State names and ids are source-local. For block and unblock, the first id is the
1732
1879
  ticket being changed and the comma-separated second operand names its blockers.
@@ -1742,7 +1889,7 @@ to a ticket that has already been claimed into a build does not stop that build.
1742
1889
  For dependent tickets, follow the
1743
1890
  [safe blocker-filing workflow](references/ticket-dependencies.md): determine the
1744
1891
  intended final destination, stage outside ready, verify all blocker relationships,
1745
- and move to ready last. Direct Linear creates the issue and its blockers
1892
+ and move to ready last. Direct Linear and GitHub create the issue and its blockers
1746
1893
  in separate requests; one `create --blocked-by` call is not atomic publication.
1747
1894
  Harvest's creation reservations cover Harvest only, not interactive CLI creates.
1748
1895
  Dependency order and JSON id extraction are still required, but do not alone
@@ -1750,14 +1897,31 @@ prevent an active dispatcher from claiming a partially created ready ticket.
1750
1897
 
1751
1898
  Update is partial: omitted fields remain untouched, including labels, assignee,
1752
1899
  and provider metadata. `--labels` is a complete replacement and an explicitly
1753
- empty value (`--labels ''`) clears the list. Supplied title/body values must be
1900
+ empty value (`--labels ''`) clears the list. `--issues` records the forge issues
1901
+ a ticket addresses: `N` (intent `closes`, the default) when the ticket fully
1902
+ resolves the issue, `N:refs` when it only partly addresses it. Attach the
1903
+ originating issue whenever a ticket comes from one. A build freezes the links
1904
+ when it claims the ticket and turns them into PR and commit keywords; see
1905
+ [issue links in builds](#issue-links-in-builds). On update `--issues` is a
1906
+ complete replacement and `--issues ''` clears it. A source that cannot store
1907
+ issue links refuses any write naming them, names itself, and writes nothing.
1908
+ `--priority urgent` makes the dispatcher claim the ticket before normal ready
1909
+ work, each class in source order; blockers and every other gate still apply,
1910
+ and it never preempts a running build. `--priority normal` (the default)
1911
+ removes urgency. The file, hosted and Linear sources store priority (Linear as
1912
+ its native Urgent; `normal` clears only Urgent and leaves other Linear priorities
1913
+ alone); plugin sources without the capability read every ticket as normal,
1914
+ refuse `urgent` naming themselves and writing nothing, and accept `normal`
1915
+ as a no-op. JSON
1916
+ ticket output always includes `priority`, and list output marks urgent tickets.
1917
+ Supplied title/body values must be
1754
1918
  nonblank. State is intentionally not an update field — `transition()` remains its sole owner —
1755
1919
  and every validation or unknown-ticket error occurs before
1756
1920
  mutation and names the offending field or id. `--body` always names a file; a
1757
1921
  missing file fails before a source write.
1758
1922
 
1759
- Quote multiword Linear states, for example `"In Progress"`; file states are
1760
- case-insensitive on input and canonical on output. The adapters validate
1923
+ Quote multiword Linear states, for example `"In Progress"`; file and github
1924
+ states are case-insensitive on input and canonical on output. The adapters validate
1761
1925
  transitions, so an invalid state fails with the
1762
1926
  source's known states. A missing id fails nonzero with an error naming both the
1763
1927
  id and configured source.
@@ -1767,6 +1931,8 @@ subcommands accept `--json`, which emits one bare JSON value and no prose: a
1767
1931
  `Ticket[]` for `list`, and the complete resulting `Ticket` for `create`,
1768
1932
  `update`, `block`, `unblock`, `show`, or `move`.
1769
1933
 
1934
+ Paged operator ticket listings may use the optional API 1.9 `TicketSource.listPage(criteria, page)` capability; without it, the operator reads the full listing and slices it. Native errors propagate. CLI ticket lists and dispatcher ready scans remain exhaustive through `listReady`/`listAll`. PostgreSQL pages natively; file, Linear, GitHub and remote `HostedTicketSource` retain fallback. The POST list-ready protocol stays exhaustive. See the [custom source contract](references/plugin-authoring.md) for types and contract coverage.
1935
+
1770
1936
  ### Ticket assets
1771
1937
 
1772
1938
  A ticket asset is a file or folder attached to a ticket: a design export,
@@ -1790,8 +1956,8 @@ assets are not moved and are not a fallback. Each has a kind and a name.
1790
1956
  Hosted revisions are copied into immutable snapshots in the build store,
1791
1957
  preserving revision numbers and allowing reads without the ticket service.
1792
1958
  Old pins without snapshots keep reading their original ticket rows. A
1793
- later attach or remove leaves a running build alone; a human answer with
1794
- `--revise-spec-from-ticket` pins again. `ab build asset get <slug> <kind>
1959
+ later attach or remove leaves a running build alone; an answer from your operator
1960
+ agent or you with `--revise-spec-from-ticket` pins again. `ab build asset get <slug> <kind>
1795
1961
  <name> <dest> [--rev <n>]` downloads what the build froze, also after it ends.
1796
1962
  - **Where phases find them.** `ab context` writes each pinned asset to
1797
1963
  `$AB_CONTEXT_DIR/assets/<kind>/<name>/` (a file asset is the single file inside that
@@ -1804,6 +1970,50 @@ static files when the ticket is groomed, so no build converts a link. The spec
1804
1970
  cites it by kind and name. See [the lifecycle](#the-lifecycle) for how phases
1805
1971
  judge against it.
1806
1972
 
1973
+ ### Issue links in builds
1974
+
1975
+ A ticket's [issue links](#source-agnostic-ticket-operations) reach the forge
1976
+ through the build that claims it:
1977
+
1978
+ - **Frozen at claim.** `build.created` records the links. Later ticket edits
1979
+ and spec revisions leave a running build's links alone.
1980
+ - **Where phases find them.** `ab context` lists them under `issueLinks` in
1981
+ `$AB_CONTEXT_DIR/context.json` with each effective `intent` and any
1982
+ `downgradeReason`, and the derived `ticket.md` gains an `- issues:` line. The
1983
+ key is absent when the build has none. `ab build status` shows an `issues:`
1984
+ line, and `--json` carries `issueLinks` and `issueLinksSealed`.
1985
+ - **Downgrade.** An agent that finds the build only partly resolves a
1986
+ `closes` issue runs `ab issue downgrade <N> --reason <text>`. The issue
1987
+ becomes `refs` and the reason is recorded. Downgrading a `refs` or unlinked
1988
+ issue is refused, and nothing can upgrade a link.
1989
+ - **Sealed at finalize.** Before the kernel opens the PR it seals the links
1990
+ (remote finalize is sealed by its publication request). A downgrade after
1991
+ the seal is refused and changes nothing; use `ab escalate` instead.
1992
+ - **What is written.** On a leaf aimed at the configured base branch, a forge
1993
+ that declares issue-closing support (GitHub) ends the PR body with one
1994
+ `Closes #N` or `Refs #N` line per link, ascending by issue number, whatever
1995
+ the description says. The landed squash commit, including forge auto-merge,
1996
+ carries the same paragraph before its trailer block (`Co-authored-by`,
1997
+ `Autobuild-Build`). Any closing keyword aimed at a `refs` issue in the PR
1998
+ title, body or landing message, including `owner/name#N` and issue URLs for
1999
+ the same repository, is rewritten to `refs`, so prose can't close it. Merging
2000
+ closes each `closes` issue and leaves each `refs` issue open with a back-link.
2001
+ - **Through a node.** GitHub closes issues only from the default branch, so a
2002
+ leaf aimed at an integration node, and a nested node's PR into its parent,
2003
+ end their PR body with one `Refs #N` line per linked issue, whatever its
2004
+ intent, so each issue shows the PR without closing; their landed commits
2005
+ carry no lines. When a leaf lands, its effective links, downgrades included,
2006
+ are recorded on the node; a nested node passes its own links merged with its
2007
+ children's union up to its parent the same way. The root node's PR into the default
2008
+ branch gets the closing lines for the node's own links and every
2009
+ contribution, kept current as children land and refreshed before the kernel
2010
+ lands it. Merging the node, by the kernel or a human, closes them. A downgrade by any child
2011
+ makes that issue `Refs`; otherwise any child's `closes` makes it `Closes`.
2012
+ Child commits keep their own messages and carry no lines.
2013
+ - **What is not.** `local-git`, the fake forge and other forges without the
2014
+ capability record links and downgrades but write no lines; the build still
2015
+ succeeds.
2016
+
1807
2017
  ## Retrieving build artifacts
1808
2018
 
1809
2019
  `ab artifact download <build> <kind>[@rev] --output <file> [--store <ref>]`
@@ -1834,21 +2044,16 @@ in-session `put|get` still require ambient phase auth.
1834
2044
 
1835
2045
  ## Dispatch dashboard
1836
2046
 
1837
- A plain `ab dispatch` reads dispatch placement once before starting local execution.
1838
- For a hosted project it opens the Store-only viewer automatically, displaying
1839
- `viewer · dispatched by <host>` from the placement origin (including a nondefault
1840
- port). `--once`, `--plain`, and `--interval` retain their viewer meanings.
1841
- `--takeover` explicitly dispatches locally, with a warning that it can displace
1842
- the hosted dispatcher; it cannot be combined with `--viewer`. Startup intake
1843
- flags require `--takeover` when placement selects viewer.
1844
-
1845
- An unreadable placement fails closed with a typed error naming the cause:
1846
- use `--viewer` to watch or `--takeover` to dispatch locally. Both explicit modes
1847
- skip placement discovery. Older services without the capability and projects
1848
- with unknown or nonhosted placement retain local dispatch behavior. Local stores
1849
- need no placement request. Origin mode (`--repository` or `AB_REPOSITORY`) and
1850
- hosted cron dispatch bypass this check. Placement is a startup snapshot, not a
1851
- liveness probe or a polling input.
2047
+ How a plain `ab dispatch` chooses between the viewer and local execution for a
2048
+ hosted project — placement discovery, `--takeover`, explicit `--viewer`, and
2049
+ the fail-closed behavior when placement is unreadable — is described once in
2050
+ [hosted dispatch and local viewing](references/setup.md#hosted-dispatch-and-local-viewing).
2051
+
2052
+ The viewer reads its dashboard from the Store; its one ticket-source read is
2053
+ the header's triage count, through the source's optional `countStates`.
2054
+ The `github` source answers it with one fresh GraphQL request, plus one per
2055
+ further page of 100 `autobuild:` labels, and caches nothing; see its display-only
2056
+ count notes under `[tickets]`.
1852
2057
 
1853
2058
  Humans may run `ab dispatch --viewer` from a local checkout to watch dispatch
1854
2059
  elsewhere without taking a lease or starting any dispatch work. The optional
@@ -1856,12 +2061,15 @@ elsewhere without taking a lease or starting any dispatch work. The optional
1856
2061
  `viewer · dispatched by <label>`. Plain/non-TTY output prints the same at startup
1857
2062
  and emits state changes. `--once` reads one snapshot; `--interval <s>` sets the
1858
2063
  viewer polling cadence. Startup intake flags and explicit `--repository` are
1859
- rejected. Without a durable effective configuration the viewer waits.
2064
+ rejected. With no recorded dispatcher run the viewer says no dispatcher has run
2065
+ for this project yet; with a run whose effective configuration is not yet
2066
+ durable it waits.
1860
2067
 
1861
- Viewer uses the Store-only frontend with canonical repository facts for status,
2068
+ Viewer uses the dispatch frontend with canonical repository facts for status,
1862
2069
  settings, harvest and migrations, bypassing the dispatch presentation event feed
1863
2070
  and its checkpoints. Fresh viewers reuse server reductions; idle refreshes read
1864
- zero event rows. It has no child, lease, execution wiring or upgrade-release timer.
2071
+ zero event rows. Its one ticket-source read is the header's triage count, at
2072
+ most once per 60 s. It has no child, lease, execution wiring or upgrade-release timer.
1865
2073
  All existing shared-store controls remain: merge/hold, build/global pause/resume,
1866
2074
  blocked feedback/retry, intake/harvest gates, harvest resume/acknowledgement,
1867
2075
  queued discard and confirmed abort. Navigation/session inspection also remain.
@@ -1896,30 +2104,49 @@ The five list steps are `spec`, `open`, `collect`, `verify`, and `merge`, with
1896
2104
  verification progress or failure and the merge mode in parentheses. Before
1897
2105
  a policy decision, label-dependent modes may read `policy pending`. A current
1898
2106
  verified node adds `verified`. Only restack conflicts, current verification
1899
- failures (file a repair child targeting the node), and readiness awaiting
1900
- consent add a list alert. Consent names `l` and `ab merge <slug>`. Branch,
2107
+ failures (file a repair child targeting the node), a node waiting for a runner
2108
+ slot ahead of new ticket claims, and readiness awaiting consent add a list
2109
+ alert. Consent names `l` and `ab merge <slug>`. Branch,
1901
2110
  restack state and conflicting files remain in detail, along with every child's
1902
2111
  ticket id, title and live phase (or queued/merged), open-first counts, verification
1903
2112
  steps and current outcomes, repair instructions, and the merge rule. Cancelled
1904
2113
  children are omitted; historical missing titles or filenames are explicit.
2114
+ A work build that finished its pipeline and must re-verify or reconcile shows
2115
+ the same slot-wait alert on its row, and `ab builds` appends it to the phase.
1905
2116
 
1906
2117
 
1907
- On a TTY, execution-mode `ab dispatch` renders one fixed interactive frame anchored at the
1908
- terminal's first row. Its header remains on that top row as frame height changes
1909
- and after a resize; unused rows remain below. On exit, the final frame is copied
2118
+ On a TTY, execution-mode `ab dispatch` renders one fixed interactive frame that fills the
2119
+ terminal's height. Its header stays on the top row, the legend or prompt panel
2120
+ is pinned to the bottom rows, and the build list fills the space between and
2121
+ scrolls within it, following the selection; after a resize the legend moves to
2122
+ the new bottom. On exit, the final frame is copied
1910
2123
  to the normal screen and remains in scrollback. Its always-present two-line
1911
2124
  process-global header has a selectable `Autobuild` summary with the repository
1912
2125
  basename followed by the compact counters
1913
- `queue <depth> | active <current>/<limit> | observations <current>/<limit>`.
1914
- `queue` is the ready-ticket queue depth; `active` is the current
1915
- nonterminal-build count against root `capacity`; and `observations` is the count
1916
- of recorded observation occurrences not yet claimed by a Harvest snapshot
1917
- against `policy.harvestThreshold`. The Store-only interactive frontend refreshes
1918
- that display value directly from the BuildStore; a failed refresh retains the
1919
- last successful count, shows a diagnostic, and appends no transport event.
2126
+ `triage <count> | queue <depth> | active <current>/<limit>`, the same three
2127
+ main counts the web operator app shows. `triage` is the number of tickets in
2128
+ the configured triage state (`[tickets].triageState`, or the source's default).
2129
+ The dispatcher samples it at most once per 60 s, outside dispatcher ticks,
2130
+ only for an interactive dashboard, through one bounded state-count read
2131
+ (`countStates`), never a ticket listing; it reads no events, and each tick
2132
+ publishes the last good sample. It shows `–`
2133
+ when the source has no bounded state counts (Linear) or no sample has succeeded
2134
+ yet; a failed read keeps the last value, appends nothing, and never fails the
2135
+ tick. The interactive frontend of a local dispatch takes it from the
2136
+ dispatcher's published status and never reads the ticket source. A viewer
2137
+ (`ab dispatch --viewer`, or the default placement for hosted dispatch) reads
2138
+ the configured source's bounded state count itself, at most once per 60 s
2139
+ while it runs. It keeps its last good value through failed reads and through
2140
+ headless ticks that publish no count, and shows `–` until its first read
2141
+ succeeds or when the source has no state counts (Linear). `queue` is the
2142
+ ready-ticket queue depth, and `active` is occupied capacity (every unfinished
2143
+ build, plus finished builds running work again) against root `capacity`. Observation pressure is not a header counter: the
2144
+ Harvest row shows a run's observations, and `ab harvest status` reports
2145
+ Harvest state.
1920
2146
  The execution-mode frontend checkpoints dashboard facts, the latest run start and the sampled
1921
2147
  lease holder's start; identity history stays partial and missing holders use a
1922
- bounded per-run lookup. Unchanged written/refused checkpoints are not uploaded
2148
+ bounded per-run lookup. Without a usable checkpoint, startup and recovery seed
2149
+ from the canonical reduced repository value, never the journal. Unchanged written/refused checkpoints are not uploaded
1923
2150
  again. Dirty saves run at most once per 30 seconds; transient failures retry
1924
2151
  without new events after 30, 60, 120, 240, then 300 seconds (capped). Teardown
1925
2152
  forces only dirty state. An equal-cursor refusal leaves correlation recoverable
@@ -1938,7 +2165,9 @@ action confirmations are suppressed in the interactive frame. The latest true
1938
2165
  warning or error instead appears on a conditional row below the header, aligned
1939
2166
  to the title; when none exists, that row consumes no space. A blank line
1940
2167
  separates the global section from the first body row, and another separates the
1941
- body from the legend or feedback controls. The duplicate startup banner is
2168
+ body from the legend or feedback controls. When the list overflows, it shows
2169
+ whole builds with `N more above` and `and N more below` notices, each separated
2170
+ from the builds by one blank line. The duplicate startup banner is
1942
2171
  suppressed; `--plain` and non-TTY output remain line-oriented and unchanged. A
1943
2172
  satisfied verify skip carries the literal `skipped` qualifier, so it remains
1944
2173
  distinct from a pass without color. Every nonterminal build has a row,
@@ -2064,7 +2293,7 @@ and offers `p resume`. Exhaustion remains red, says `recovery exhausted — huma
2064
2293
  attention required`, shows stopped step/pending count, and offers `p
2065
2294
  acknowledge`; escalation also offers `p acknowledge`. A request awaiting
2066
2295
  acknowledgement has no duplicate action. Row `p` never pauses the gate. When the
2067
- gate is off it writes nothing and directs the operator to global `h`; the
2296
+ gate is off it writes nothing and directs you to global `h`; the
2068
2297
  eventual shared human acknowledgement reopens every ordinary parked run and
2069
2298
  settles every exhaustion barrier. Exhaustion and escalation remain terminal.
2070
2299
  Escalation's row is dismissed only by a post-terminal human resume request
@@ -2118,7 +2347,7 @@ setters, not toggles, so the values the command names are the values the
2118
2347
  repository holds afterwards — and each per-build request is a compare-and-set
2119
2348
  against a freshly reduced log, so a rerun adds no second pending pause and
2120
2349
  never cancels one already in flight. Pause first is what makes every surviving
2121
- prefix of a failed walk at least as quiesced as asked: once it merges, no queued
2350
+ prefix of a failed walk at least as quiesced as asked: once it is recorded, no queued
2122
2351
  build is launchable, whatever else fails after it. Output names every build that
2123
2352
  received a request, the hold, and the intake value written; `--json` emits that
2124
2353
  same summary for a script. A walk that fails partway exits nonzero and reports
@@ -2157,7 +2386,7 @@ inserts a line break — as does `Shift+Enter` in terminals that report it
2157
2386
  distinctly — `Backspace` deletes at the caret, `Left`/`Right`/`Up`/`Down` and
2158
2387
  `Home`/`End` move the caret rather than the dashboard's row selection, and
2159
2388
  `Escape` cancels without writing. Line breaks survive submission, so the
2160
- guidance the agent receives keeps the operator's line structure. Pasting
2389
+ guidance the agent receives keeps the line structure as typed. Pasting
2161
2390
  multi-line text inserts all of it in one step in terminals that support
2162
2391
  bracketed paste; where they do not, a paste still submits at its first line
2163
2392
  break.
@@ -2244,7 +2473,10 @@ spec and its publication is confirmed.
2244
2473
  Every command requires an applicable target in this repository. Pause and
2245
2474
  resume require an active build; abort and hold also accept queued builds.
2246
2475
  Merge requires a ready candidate and cannot bypass verification or merge gates;
2247
- `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
2476
+ a merge that is not ready is refused with code `merge-not-ready` (or
2477
+ `node-incomplete` for an incomplete node) and a reason. A refusal records no
2478
+ merge consent and no landing; a node's live completeness check may still save
2479
+ an `integration.observed` diagnostic before it refuses. `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
2248
2480
  aborted, or otherwise inapplicable target is an error and gets no new event. Attribution uses `USER`, then `USERNAME`, then the
2249
2481
  same stable fallback on both surfaces. These commands run sessionless and
2250
2482
  accept `--store <ref>` with the usual explicit flag > `AB_STORE` > `[store] url` > repository
@@ -2258,10 +2490,12 @@ is inside the walk.
2258
2490
  These commands request normal kernel work; they do not wake a runner, operate
2259
2491
  the forge, or bypass the lease sweep. Resume is therefore an attempt, not a
2260
2492
  guarantee: if the condition still fails, a phase may raise a new escalation and
2261
- block again. Every open escalation, including all policy and setup causes,
2262
- survives `ab dispatch` and `ab dispatch --once` startup until a human answers
2263
- it. Startup still recovers actionable builds and delivers pending operator
2264
- commands, but it never records an answer or re-arms a budget.
2493
+ block again. Every open phase and policy escalation, including all setup causes,
2494
+ survives `ab dispatch` and `ab dispatch --once` startup until your operator agent or you
2495
+ answer it. A janitor escalation is the exception: ordinary janitor retries continue
2496
+ across startup, a successful attempt closes it unanswered, and a bare retry only
2497
+ brings the next attempt forward. Startup still recovers actionable builds and
2498
+ delivers pending operator commands, but it never records an answer or re-arms a budget.
2265
2499
 
2266
2500
  Durable repository intake has launch-flag setters and a global-row toggle.
2267
2501
  Merge policy is configured through ordered rules, with per-merge hold/merge
@@ -2301,6 +2535,10 @@ repository-local precedence. The command uses the same reducer as the
2301
2535
  dispatcher and dashboard, writes no state, claims no ticket, attaches no runner,
2302
2536
  and starts no dispatcher work. Dispatcher identity includes the held run’s recorded
2303
2537
  runtime; historical starts without metadata display `runtime unrecorded`.
2538
+ It also lists the latest ticket scan's dependency diagnostics (`queue:` lines,
2539
+ `dependencyDiagnostics` in JSON), including tickets held because their target
2540
+ node is being built by another store, and dispatcher startup warnings
2541
+ (`warningLines`).
2304
2542
 
2305
2543
  **`ab builds`** summarizes this repository's builds, one row each. It reports
2306
2544
  **active** builds by default — `running`, `paused`, `blocked` — because those
@@ -2419,17 +2657,28 @@ The default watch reports actionable conditions only:
2419
2657
  - `integration.verification-failed`: failed node verification, once per prepared cycle, with failed steps, verified head and parent, and guidance to file a repair child targeting the node. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled.
2420
2658
 
2421
2659
  - `build.janitor-failing`: a build has failed janitor attempts for the configured attention threshold. A successful attempt clears it.
2660
+ - `build.janitor-escalated`: a build's janitor failure episode outlasted the escalation threshold and raised one escalation. The janitor keeps retrying; a successful attempt closes it unanswered, and a bare retry answer attempts on the next tick.
2422
2661
  - `dispatcher.forge-persistent`: forge degradation remains after a post-reset retry tick; recovery clears the episode.
2423
2662
 
2424
2663
  - Build `escalation.raised` or `phase.deferral-escalated`: an operator answer
2425
2664
  is required. A read deferral asks for CLI/store repair before retry or guidance.
2665
+ A `build.janitor-escalated` escalation needs no answer to recover; a bare
2666
+ retry answer only brings the next attempt forward.
2426
2667
  - Build `build.merge-decision`: a finalized open PR
2427
2668
  with a recorded consent decision awaiting consent, an explicit hold, or a
2428
2669
  current actionable merge-gate deferral. Policy decisions not yet recorded and
2429
2670
  authorized merges awaiting application are silent. One merge decision is reported per build/PR.
2430
2671
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
2431
2672
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
2432
- `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
2673
+ `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
2674
+ `dispatcher.kernel-git-unavailable`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
2675
+ - Repository `ticket-preparation.resolved` with outcome `abandoned`: automatic
2676
+ preparation recovery stopped and left the ticket unchanged. The line names the
2677
+ ticket, attempt and recorded reason; the payload's `claimed` says whether the
2678
+ claim was confirmed. An unconfirmed claim's provider outcome is unknown, and
2679
+ events written before `claimed` existed report the certainty as not recorded.
2680
+ Each abandonment reports once as it lands; a fresh watch does not replay
2681
+ historical ones, and nothing clears or acknowledges it.
2433
2682
  - `dispatcher.ticket-source-persistent`: degradation past its advertised
2434
2683
  reset time, once a tick started at or after reset has completed or failed
2435
2684
  with the episode still open; crossing reset alone is silent. Without a reset,
@@ -2559,8 +2808,11 @@ after cancelling and draining pending heartbeats. Failures report on stderr and
2559
2808
  fall back to TTL expiry; an unsupported remote route falls back silently. SIGKILL
2560
2809
  still relies on TTL expiry. Timeout/count completion keeps presence for re-arming. Reusing its flagged watch cursor preserves the registration
2561
2810
  ID and original start time across re-arms, re-registering after withdrawal. Unflagged resumes remain read-only.
2562
- Repository status lists live registrations with ID, host, PID, start, heartbeat
2563
- and heartbeat age, or an empty list. Human status prints one operator summary.
2811
+ CLI repository status reports `operator.presence: "loaded"` and lists live
2812
+ registrations with ID, host, PID, start, heartbeat and heartbeat age, or an empty
2813
+ list. MCP `repository.status` and HTTP status do not load presence and report
2814
+ `operator.presence: "unavailable"` with no registrations; that is not evidence of
2815
+ absence. Human status prints one operator summary.
2564
2816
  MCP registration and dashboard presence are deferred.
2565
2817
 
2566
2818
  **`ab wait [<slug>...] (--for <condition> | --event <glob>)... [--since <cursor>]
@@ -2632,11 +2884,12 @@ ab wait --for blocked --json my-build # exit 0: record says why; 2: it ended;
2632
2884
  Second, a plain blocking call — Codex, Pi, and the shell only expose "run a
2633
2885
  command and wait": run it in the turn and read the record when it returns.
2634
2886
 
2635
- The same split governs `ab watch`, which streams and does not exit when it
2636
- emits a record. Run an unbounded watch only under a monitor that wakes the
2637
- agent on each output line. Under exit-only notification, bound it with
2638
- `--count 1` so the first record ends the command, then re-arm from its
2639
- trailing cursor.
2887
+ `ab watch` streams and does not exit when it emits a record, so an operator's
2888
+ standing watch must run under a line-streaming monitor (such as Claude Code's
2889
+ Monitor tool) whenever the harness has one, with `--timeout` below any monitor
2890
+ kill deadline so it exits with a resumable cursor; `--count 1` with re-arming
2891
+ is only the fallback for harnesses that wake the agent solely on exit. See
2892
+ `ab-operate` for the full procedure.
2640
2893
 
2641
2894
  The loop pattern ties the two together: wait, act on the record (answer the
2642
2895
  escalation, inspect the build, merge the PR), then wait again, passing the
@@ -2757,7 +3010,7 @@ default, when you need to know what this repo's version says).
2757
3010
  | Skill | Place in the lifecycle | Purpose |
2758
3011
  |---|---|---|
2759
3012
  | `ab-spec` | Before a build exists | Design a feature spec-first through conversation, or flesh out a ticket to the spec standard. The human-interactive surface; takes a ticket, not a build slug. **Model-invocable.** |
2760
- | `ab-tickets` | Before a build exists | Drive this repo's local file tracker: create a ticket, report the backlog, groom or move one between the lifecycle directories (`triage/ ready/ doing/ done/`) and any repository-defined states, including the icebox. The agent-facing surface on the tracker — use it instead of `mv`. **Model-invocable.** |
3013
+ | `ab-tickets` | Before a build exists | Drive this repo's local file tracker: create a ticket, report the backlog, groom or move one between the lifecycle directories (`triage/ ready/ doing/ done/`) and any repository-defined states, and move work by role (`--role backlog` for the icebox, `--role rejected` for declined work). The agent-facing surface on the tracker — use it instead of `mv`. **Model-invocable.** |
2761
3014
  | `ab-guide` | Outside the pipeline | This skill: reference for the lifecycle, config surface, setup/upgrade behavior, and the installed skills. Its editable `references/setup.md` guides the init handoff. **Model-invocable.** |
2762
3015
  | `ab-harvest` | harvest `synthesize` step | Continue the producer across review rounds: cluster the claimed structured observations and author typed spec-standard create/join/suppress proposals. Runner-only. |
2763
3016
  | `ab-harvest-review` | harvest `review` step | Fresh adversarial reviewer for proposal coverage, semantic dedup, spec quality, and evidence; returns `approve`/`revise`/`escalate`. Runner-only. |
@@ -2786,19 +3039,24 @@ Every ticket read includes an opaque `revision`. Pass it as `expectedRevision`
2786
3039
  `move`, `block` and `unblock`. A stale write fails without changing anything and
2787
3040
  reports the current revision. Omission preserves unguarded behavior. Blocker
2788
3041
  checks cover the entire batch. Dispatcher moves remain unguarded and change the
2789
- revision. Sources without guarded writes, including Linear, refuse supplied
2790
- revisions rather than ignoring them.
3042
+ revision. Sources without guarded writes, including Linear and GitHub, refuse
3043
+ supplied revisions rather than ignoring them.
2791
3044
 
2792
3045
  `ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
2793
3046
  frontmatter and a Markdown body. Only title, body and labels are editable;
2794
- kind, target, id, blockers, creation key and reference comments are read-only. It saves only
2795
- changed fields with the opening revision. Unchanged or formatting-only edits
3047
+ kind, target, id, blockers, issue links, priority, creation key and reference comments are read-only. It saves only
3048
+ changed fields with the opening revision. Sources without guarded writes,
3049
+ including Linear and GitHub, re-read the ticket immediately before an
3050
+ unguarded write and refuse a changed revision, with the no-lock race window of file checks. Unchanged or formatting-only edits
2796
3051
  write nothing. On conflict, invalid input or editor failure, the error names an
2797
3052
  absolute file path containing the edited text. Read the current ticket and
2798
3053
  reapply the intended changes before retrying; conflicts are never merged.
2799
3054
 
2800
- File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets
2801
- and state; reverting identical content restores its fingerprint. File checks
3055
+ File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
3056
+ state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
3057
+ fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
3058
+ including the ticket's own issue; GitHub tickets carry no comments. Reverting
3059
+ identical content restores its fingerprint. File checks
2802
3060
  re-read immediately before writing, with the existing no-lock race window.
2803
3061
  Direct file edits and state-directory moves change revisions. File revisions also
2804
3062
  cover structured comments and portable attachments. Legacy file comments change
@@ -2859,10 +3117,28 @@ errors retain their existing behavior.
2859
3117
 
2860
3118
  Janitor failures are durable per-build episodes. Eligible failures retry after
2861
3119
  30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
2862
- Skipped polls preserve the episode across restart. After
2863
- `policy.janitorFailureAttentionSeconds` (600 by default), `build.janitor-failing`
2864
- notifies default watchers and appears on the build row. A successful attempt
2865
- clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
3120
+ A classified forge rate limit is repository cooldown, not a janitor failure:
3121
+ neither the first limited response nor the cooldown that follows starts an
3122
+ episode or records an attempt, so a build that only waits out cooldown never
3123
+ escalates. Skipped polls preserve the episode across restart. Both thresholds
3124
+ below are wall-clock from the episode's first failed attempt and are checked
3125
+ when an attempt fails, so cooldown inside an episode that already started still
3126
+ counts. After `policy.janitorFailureAttentionSeconds` (600 by default),
3127
+ `build.janitor-failing` notifies default watchers and appears on the build row.
3128
+ After `policy.janitorFailureEscalationSeconds` (3600 by default), the build
3129
+ raises one escalation through `build.janitor-escalated`, naming the failing
3130
+ operation, the last error, the failed attempt count and when the episode
3131
+ started. The build is then blocked and shows wherever open escalations show.
3132
+ The janitor keeps retrying on its backoff underneath; a successful attempt
3133
+ clears the attention, closes the escalation unanswered and the build continues.
3134
+ Answering it with a bare retry makes the janitor attempt on its next tick. An
3135
+ episode raises at most one escalation; a new episode after recovery can raise
3136
+ another. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
3137
+ A dispatcher that cannot execute Git for kernel node work (a missing or
3138
+ unloadable `git` for the bare clone) records no janitor failures. It records
3139
+ one durable `dispatcher.kernel-git-unavailable` repository condition, node work
3140
+ waits, and `dispatcher.kernel-git-recovered` closes the condition once a clone
3141
+ succeeds.
2866
3142
 
2867
3143
  A classified forge rate limit records repository degradation with `resetAt`.
2868
3144
  Forge work waits during cooldown; passing the deadline permits a recovery
@@ -2964,5 +3240,3 @@ ticket numbering from 1. Old credentials remain invalid with 401; independently
2964
3240
  repository-established requests receive 403 project not registered. See
2965
3241
  [project deletion](references/operator-api.md#permanent-project-deletion) for
2966
3242
  generation-bound preview tokens and API semantics.
2967
-
2968
- Paged operator ticket listings may use the optional API 1.9 `TicketSource.listPage(criteria, page)` capability; without it, the operator reads the full listing and slices it. Native errors propagate. CLI ticket lists and dispatcher ready scans remain exhaustive through `listReady`/`listAll`. PostgreSQL pages natively; file, Linear and remote `HostedTicketSource` retain fallback. The POST list-ready protocol stays exhaustive. See the [custom source contract](references/plugin-authoring.md) for types and contract coverage.