@defrex/autobuild 1.4.1 → 1.5.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 (201) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +440 -95
  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 +2 -1
  7. package/docs/architecture.md +290 -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 +166 -101
  13. package/docs/dispatcher-hosting.md +19 -3
  14. package/docs/dispatcher.md +9 -4
  15. package/docs/integration-overview.md +2 -2
  16. package/docs/integration-tree.md +91 -28
  17. package/docs/merge-policy.md +28 -9
  18. package/docs/operator-api.md +43 -18
  19. package/docs/operator-surfaces.md +1 -1
  20. package/docs/plugin-authoring.md +85 -8
  21. package/docs/remote-store-protocol.md +25 -7
  22. package/docs/remote-ticket-protocol.md +126 -12
  23. package/docs/restacking.md +20 -6
  24. package/docs/seams.md +2 -2
  25. package/docs/setup.md +19 -13
  26. package/docs/spec-standard.md +2 -1
  27. package/docs/ticket-dependencies.md +26 -8
  28. package/docs/ticket-migration.md +70 -7
  29. package/docs/ticket-sources.md +82 -5
  30. package/docs/tickets.md +34 -2
  31. package/docs/troubleshooting.md +2 -2
  32. package/docs/verification.md +5 -5
  33. package/docs/website.md +8 -0
  34. package/docs/workspaces.md +1 -1
  35. package/package.json +5 -4
  36. package/packages/core/src/accounts/hosted-readiness.ts +21 -0
  37. package/packages/core/src/cli/attention.ts +1 -0
  38. package/packages/core/src/cli/build-control.ts +36 -12
  39. package/packages/core/src/cli/connect.ts +9 -18
  40. package/packages/core/src/cli/context.ts +44 -0
  41. package/packages/core/src/cli/dashboard/configuration.ts +11 -0
  42. package/packages/core/src/cli/dashboard/model.ts +40 -10
  43. package/packages/core/src/cli/dashboard/queue.ts +21 -0
  44. package/packages/core/src/cli/dashboard/render.ts +40 -22
  45. package/packages/core/src/cli/dispatch-frontend.ts +63 -30
  46. package/packages/core/src/cli/dispatch-mode.ts +35 -16
  47. package/packages/core/src/cli/dispatch-repository-feed.ts +40 -11
  48. package/packages/core/src/cli/dispatch.ts +154 -47
  49. package/packages/core/src/cli/help.ts +59 -22
  50. package/packages/core/src/cli/init-hosted-accounts.ts +54 -0
  51. package/packages/core/src/cli/init-readiness-remote.ts +16 -3
  52. package/packages/core/src/cli/init-validation.ts +144 -42
  53. package/packages/core/src/cli/issue-links.ts +67 -0
  54. package/packages/core/src/cli/main.ts +32 -15
  55. package/packages/core/src/cli/pr-summary-publication.ts +38 -7
  56. package/packages/core/src/cli/publication-settlement.ts +36 -24
  57. package/packages/core/src/cli/repository-status.ts +201 -49
  58. package/packages/core/src/cli/status.ts +41 -3
  59. package/packages/core/src/cli/terminals.ts +37 -2
  60. package/packages/core/src/cli/ticket-editor.ts +20 -6
  61. package/packages/core/src/cli/ticket.ts +264 -46
  62. package/packages/core/src/cli/triage-count-sampler.ts +59 -0
  63. package/packages/core/src/cli/watch.ts +4 -0
  64. package/packages/core/src/config/live.ts +45 -4
  65. package/packages/core/src/config/load.ts +9 -0
  66. package/packages/core/src/config/pipeline-source.ts +6 -2
  67. package/packages/core/src/config/ready-assignee.ts +86 -0
  68. package/packages/core/src/config/schema.ts +164 -36
  69. package/packages/core/src/distribution-packaging.ts +1 -1
  70. package/packages/core/src/events/catalog.ts +5 -0
  71. package/packages/core/src/events/compatibility.ts +2 -1
  72. package/packages/core/src/events/payloads.ts +70 -0
  73. package/packages/core/src/events/policy.ts +8 -0
  74. package/packages/core/src/events/repository.ts +91 -28
  75. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +41 -0
  76. package/packages/core/src/kernel/build-identity.ts +12 -0
  77. package/packages/core/src/kernel/change-presence.ts +139 -6
  78. package/packages/core/src/kernel/dispatch-capacity.ts +80 -14
  79. package/packages/core/src/kernel/dispatch-status.ts +10 -1
  80. package/packages/core/src/kernel/dispatch-upgrade.ts +104 -5
  81. package/packages/core/src/kernel/engine.ts +4 -2
  82. package/packages/core/src/kernel/finalize-pr-rejection.ts +95 -0
  83. package/packages/core/src/kernel/generators/repository-journals.ts +15 -1
  84. package/packages/core/src/kernel/harvest.ts +4 -1
  85. package/packages/core/src/kernel/integration-completeness.ts +104 -17
  86. package/packages/core/src/kernel/integration-landing.ts +17 -0
  87. package/packages/core/src/kernel/integration-state.ts +17 -0
  88. package/packages/core/src/kernel/issue-keywords.ts +202 -0
  89. package/packages/core/src/kernel/janitor-failure.ts +11 -0
  90. package/packages/core/src/kernel/kernel-git.ts +87 -0
  91. package/packages/core/src/kernel/landing-readiness.ts +25 -17
  92. package/packages/core/src/kernel/log-index.ts +1 -1
  93. package/packages/core/src/kernel/node-issue-links.ts +142 -0
  94. package/packages/core/src/kernel/node-parent.ts +6 -0
  95. package/packages/core/src/kernel/node-restack-transaction.ts +2 -0
  96. package/packages/core/src/kernel/pr-summary.ts +24 -0
  97. package/packages/core/src/kernel/read-deferrals.ts +75 -12
  98. package/packages/core/src/kernel/read-facts.ts +32 -1
  99. package/packages/core/src/kernel/reconcile-restack.ts +1 -1
  100. package/packages/core/src/kernel/reducer-registry.ts +31 -1
  101. package/packages/core/src/kernel/reducer.ts +90 -2
  102. package/packages/core/src/kernel/ticket-preparation.ts +12 -0
  103. package/packages/core/src/kernel/verify-budget.ts +43 -0
  104. package/packages/core/src/operator/index.ts +3 -1
  105. package/packages/core/src/operator/presentation.ts +3 -0
  106. package/packages/core/src/operator/protocol.ts +38 -2
  107. package/packages/core/src/operator/query.ts +66 -29
  108. package/packages/core/src/operator/registry.ts +47 -26
  109. package/packages/core/src/operator/tickets.ts +77 -10
  110. package/packages/core/src/plugin-sdk/index.ts +13 -0
  111. package/packages/core/src/plugins/manifest.ts +1 -1
  112. package/packages/core/src/plugins/registry.ts +1 -0
  113. package/packages/core/src/ports/forge/contract.ts +69 -0
  114. package/packages/core/src/ports/forge/create.ts +5 -0
  115. package/packages/core/src/ports/forge/fake.ts +184 -3
  116. package/packages/core/src/ports/forge/git-rewrite.ts +4 -2
  117. package/packages/core/src/ports/forge/github.ts +175 -38
  118. package/packages/core/src/ports/forge/local-git.ts +14 -0
  119. package/packages/core/src/ports/forge/readiness.ts +10 -0
  120. package/packages/core/src/ports/forge-failure.ts +43 -0
  121. package/packages/core/src/ports/runner/claude.ts +7 -1
  122. package/packages/core/src/ports/runner/codex.ts +7 -2
  123. package/packages/core/src/ports/runner/native-cli-fixture.ts +2 -1
  124. package/packages/core/src/ports/runner/pi.ts +7 -1
  125. package/packages/core/src/ports/runner/runtime.ts +3 -0
  126. package/packages/core/src/ports/runner/start-prompt.ts +37 -0
  127. package/packages/core/src/ports/tickets/contract.ts +320 -7
  128. package/packages/core/src/ports/tickets/create.ts +72 -17
  129. package/packages/core/src/ports/tickets/fake.ts +18 -0
  130. package/packages/core/src/ports/tickets/file-codec.ts +20 -0
  131. package/packages/core/src/ports/tickets/file.ts +43 -1
  132. package/packages/core/src/ports/tickets/github-fake.ts +1123 -0
  133. package/packages/core/src/ports/tickets/github-issues.ts +431 -0
  134. package/packages/core/src/ports/tickets/github-validators.ts +194 -0
  135. package/packages/core/src/ports/tickets/github.ts +2029 -0
  136. package/packages/core/src/ports/tickets/hosted-index.ts +34 -3
  137. package/packages/core/src/ports/tickets/issue-links.ts +86 -0
  138. package/packages/core/src/ports/tickets/lifecycle.ts +60 -4
  139. package/packages/core/src/ports/tickets/linear.ts +66 -6
  140. package/packages/core/src/ports/tickets/migration.ts +290 -68
  141. package/packages/core/src/ports/tickets/operations.ts +98 -12
  142. package/packages/core/src/ports/tickets/priority.ts +55 -0
  143. package/packages/core/src/ports/tickets/remote-protocol.ts +195 -29
  144. package/packages/core/src/ports/tickets/remote.ts +188 -13
  145. package/packages/core/src/ports/tickets/revision.ts +22 -1
  146. package/packages/core/src/ports/tickets/states.ts +43 -0
  147. package/packages/core/src/ports/tickets/tree.ts +58 -12
  148. package/packages/core/src/ports/tickets/update.ts +12 -2
  149. package/packages/core/src/ports/types.ts +194 -11
  150. package/packages/core/src/ports/workspace/commit-preservation.ts +135 -13
  151. package/packages/core/src/ports/workspace/git-worktree.ts +3 -1
  152. package/packages/core/src/ports/workspace/vercel-sandbox.ts +132 -27
  153. package/packages/core/src/processes/build-runner.ts +99 -21
  154. package/packages/core/src/processes/dispatcher.ts +1080 -533
  155. package/packages/core/src/processes/execution-no-progress.ts +5 -0
  156. package/packages/core/src/processes/harvest-runner.ts +17 -8
  157. package/packages/core/src/processes/harvest.ts +5 -8
  158. package/packages/core/src/processes/tick-publication.ts +12 -2
  159. package/packages/core/src/processes/ticket-scan-schedule.ts +78 -0
  160. package/packages/core/src/processes/workspace-preservation.ts +37 -2
  161. package/packages/core/src/runtime-identity.ts +10 -2
  162. package/packages/core/src/scenarios/harness.ts +4 -0
  163. package/packages/core/src/store/adapter.ts +7 -1
  164. package/packages/core/src/store/contract.ts +83 -2
  165. package/packages/core/src/store/digest.ts +32 -1
  166. package/packages/core/src/store/reducer-value-shapes.json +4187 -3391
  167. package/packages/core/src/store/remote/protocol.ts +2 -0
  168. package/packages/core/src/store/remote/released-clients.json +22 -0
  169. package/packages/core/src/store/remote/released-reducer-values/1.5.0.json +26924 -0
  170. package/packages/core/src/store/remote/released-reducer-values/index.ts +2 -0
  171. package/packages/core/src/store/repo-state-events.ts +2 -0
  172. package/packages/core/src/store/types.ts +5 -0
  173. package/packages/core/src/testing/dispatch-read-budget.ts +729 -123
  174. package/packages/core/src/testing/index.ts +18 -1
  175. package/packages/core/src/testing/presence-history.ts +79 -0
  176. package/packages/core/src/testing/reduced-read-budget.ts +1197 -31
  177. package/packages/core/src/testing/upgrade-generations.ts +77 -0
  178. package/skills/code-review/SKILL.md +4 -3
  179. package/skills/finalize/SKILL.md +18 -2
  180. package/skills/guide/SKILL.md +382 -139
  181. package/skills/guide/references/accounts.md +9 -0
  182. package/skills/guide/references/integration-tree.md +91 -28
  183. package/skills/guide/references/merge-policy.md +28 -9
  184. package/skills/guide/references/operator-api.md +43 -18
  185. package/skills/guide/references/plugin-authoring.md +85 -8
  186. package/skills/guide/references/remote-store-protocol.md +25 -7
  187. package/skills/guide/references/remote-ticket-protocol.md +126 -12
  188. package/skills/guide/references/restacking.md +20 -6
  189. package/skills/guide/references/setup.md +19 -13
  190. package/skills/guide/references/spec-standard.md +2 -1
  191. package/skills/guide/references/ticket-dependencies.md +26 -8
  192. package/skills/guide/references/ticket-migration.md +70 -7
  193. package/skills/harvest-review/SKILL.md +4 -3
  194. package/skills/implement/SKILL.md +20 -1
  195. package/skills/operate/SKILL.md +103 -28
  196. package/skills/plan/SKILL.md +1 -1
  197. package/skills/reconcile/SKILL.md +5 -4
  198. package/skills/spec/SKILL.md +15 -2
  199. package/skills/tickets/SKILL.md +114 -37
  200. package/templates/autobuild.toml +5 -0
  201. package/templates/hosted-service/package.json +2 -2
@@ -80,14 +80,18 @@ 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. Priority never preempts
87
+ a running build.
85
88
  - **Failed preparation.** Durable preparation facts protect the claim-to-build
86
89
  interval. Caught failures return tickets to Ready (invalid specs to Triage),
87
90
  after exact build-ownership readback. Unresolved attempts stay withheld and
88
91
  retry before intake, even at full capacity or with intake disabled. Unsafe
89
92
  ownership or externally changed/missing tickets end automatic recovery with
90
- a diagnostic `abandoned` resolution, leaving the ticket unchanged. See
93
+ a diagnostic `abandoned` resolution, reported once in that tick's dispatcher
94
+ diagnostics, leaving the ticket unchanged. See
91
95
  [Ticket preparation recovery](references/restacking.md#ticket-preparation-before-build-creation).
92
96
  - **Ticket assets** — files or folders attached to a ticket (see
93
97
  [Ticket assets](#ticket-assets)) are frozen into the build at claim and
@@ -116,7 +120,11 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
116
120
  A failed stage sends every failed report to `implement` after its siblings
117
121
  settle; an optional `failFast` failure cancels unfinished siblings.
118
122
  - **`finalize`** — the agent writes the PR description; the kernel opens the
119
- PR. `[finalize].steps` run afterward and are failure-tolerant. A
123
+ PR, sealing the build's [issue links](#issue-links-in-builds) first and
124
+ writing their `Closes #N` / `Refs #N` lines when the forge supports them
125
+ (a node child's own PR gets `Refs` lines only; its closing lines go into the
126
+ root node's PR).
127
+ `[finalize].steps` run afterward and are failure-tolerant. A
120
128
  content-producing step commits selected files locally and finishes clean;
121
129
  the runner pushes the exact descendant SHA and confirms forge readback before recording success.
122
130
  - **Restacking and epilogue.** The kernel replays one net leaf change at verify
@@ -198,10 +206,17 @@ terminal.
198
206
 
199
207
  **Slug naming is not a phase.** For each new build, a tool-free one-shot call
200
208
  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.
209
+ The dispatcher owns a hard deadline, strict validation, and `-2`, `-3`, …
210
+ collision suffixes that skip both this store's slugs and `ab/` or `ab-node/`
211
+ build branches already on the remote, checked once at claim time. A forge
212
+ without that capability deduplicates against the store only and says so in a
213
+ startup warning. A missing or failed model proposal falls back to the first
214
+ three words of the kebab-cased title, so the proposal never blocks dispatch.
215
+ The branch check is not optional: if a remote lookup fails, or the base and its
216
+ `-2` … `-100` suffixes are all taken, the claim fails, no build is created, and
217
+ the ticket is handed back to ready for a later tick. The slug
218
+ and `ab/<slug>` (or `ab-node/<slug>` for a node) branch are chosen once;
219
+ existing builds are never renamed.
205
220
  Naming inherits `[roles.default]` and can be overridden by `[roles.slug]`.
206
221
 
207
222
  ## Who does what
@@ -370,7 +385,7 @@ The distinctions that change an administrator's answer:
370
385
  re-provisioned.
371
386
  - **Workspaces** are provisioned per build and remain the locally reachable
372
387
  execution context for that build.
373
- - **Ticket providers** (`linear`, `file`) sit behind one port; the dispatcher
388
+ - **Ticket providers** (`file`, `linear`, `hosted`, `github`) sit behind one port; the dispatcher
374
389
  does not know which is configured.
375
390
  - **Forge operations and pushes are kernel-side plumbing.** Agents commit
376
391
  locally and never push, never touch a remote, never open the PR. The forge
@@ -378,15 +393,24 @@ The distinctions that change an administrator's answer:
378
393
  confirmation. Local implementation publication failures write no completion or
379
394
  pending request and leave the same session retryable. A push
380
395
  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>`.
396
+ successful content-producing finalize post-step. History rewrites (reconcile,
397
+ leaf verify-entry and waiting restacks, and node restacks on demand; see
398
+ [restacking](references/restacking.md)) replace a branch only with an exact
399
+ expected-head guard after archiving every recorded Git tip under
400
+ `refs/autobuild/archive/<slug>/<sha>`.
382
401
  `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.
402
+ operation: durable PR records live under private Git refs, and the review
403
+ locator is `refs/heads/ab/<slug>`. Once merge authorization (auto or consent;
404
+ see [merge policy](references/merge-policy.md)) applies, a root-target leaf
405
+ lands as a local guarded, unsigned squash whose message is the deposited PR
406
+ description and whose author and committer come from the repository's
407
+ ordinary Git identity; node children and local-git root nodes land by guarded
408
+ fast-forward instead (see [merge methods](references/merge-policy.md#merge-methods)).
409
+ `local-git` writes no issue keyword lines; a build's issue links stay in build
410
+ state. If Git cannot resolve the squash identity, the PR remains open with
411
+ actionable `user.name` / `user.email` guidance and later dispatcher ticks
412
+ retry. Until authorized it remains open for ordinary `git diff` inspection; it
413
+ has no review UI or image host.
390
414
 
391
415
  For moving a project between sources, follow the [ticket migration procedure](references/ticket-migration.md).
392
416
 
@@ -445,6 +469,14 @@ by sequence. It contains scheduling metadata only, never counts or lifecycle
445
469
  state, and is distinct from reducer checkpoints. Missing or stale metadata
446
470
  falls back to the recorded fact and can cause one safe extra scan without
447
471
  reconstructing history. Successful unchanged scans advance this cache only.
472
+ While less than one interval has elapsed since the recorded fact's
473
+ measurement, with unchanged readiness and criteria fingerprints and no
474
+ admission following an observation measurement, a tick defers without reading
475
+ the cache, because the cache only acknowledges that measurement or a later one.
476
+ If the wall clock moved backwards, a cache entry dated later than the current
477
+ clock is therefore consulted only once that window ends, at most one scan
478
+ interval after the recorded measurement; the dispatcher then treats it as a
479
+ clock rollback, rescans, and resets the cache to the current clock.
448
480
 
449
481
 
450
482
  ### Root scalars
@@ -617,7 +649,8 @@ start no agent. Keep runtime installation out of `commands.setup`. Pi over
617
649
  `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
650
  scrubbed from Git config before an agent starts. Agents cannot push. Remote phase terminals deposit a durable
619
651
  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
652
+ must not be repeated. An implement round with no commits over its contribution
653
+ base escalates at `implement` instead of requesting publication. After VM stop and lease release, the local kernel
621
654
  publishes the exact SHA/branch through a temporary narrow firewall transform,
622
655
  verifies it, and performs PR work locally. Ordinary completion deletes the VM.
623
656
  Branch config, installed skills, relative/package plugins, setup, and phase CLI
@@ -637,8 +670,8 @@ likes.
637
670
  `setup` is special by convention: it runs after workspace provision and after a
638
671
  sandbox rehydrate. Failures are durable, remain visible in build status and the
639
672
  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
673
+ setup-targeted escalation without manufacturing a pipeline phase or verdict. An
674
+ answer from your operator agent or you re-arms the budget, and a later successful `runner.attached` clears
642
675
  the current error. Values are never evaluated as config — they are handed to a
643
676
  shell as written.
644
677
 
@@ -771,26 +804,14 @@ should treat a `design` asset as part of the contract, a contract on observable
771
804
  visual and reference outcomes, not on implementation, and judge the result
772
805
  against it.
773
806
 
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.
807
+ Node `verify:*` context additionally exposes `nodeVerification`: frozen
808
+ contribution specs, a commit provenance index and owned `handPushedCommits`,
809
+ prepared by the dispatcher for the exact cycle. Judge hand-pushed commits on
810
+ their messages and other changes against the node spec or the introducing
811
+ contribution's spec. See
812
+ [node verification context](references/integration-tree.md#node-verification-context)
813
+ for the fields, the authorization rule, and preparation and failure behavior.
814
+ Leaf context is unchanged.
794
815
 
795
816
  An agent verify step selects `[roles.<step>]` by its **logical step name** —
796
817
  the name in `[verify].steps`, not the skill it runs. An agent finalize
@@ -862,7 +883,10 @@ masks another step's failure. For leaves, failures return the build to `implemen
862
883
  consume `[policy].maxVerifyAttempts` once per distinct failed cycle since the
863
884
  latest spec revision. Passing target-movement cycles cost zero; cycle identifiers
864
885
  remain monotonic across restacks and reconciles. Skips retain the cycle's attempt number
865
- without consuming that budget.
886
+ without consuming that budget. The budget is build-wide, not per step: its policy
887
+ escalation lists each counted failed attempt with its failed steps, says a step
888
+ failed in every counted cycle only when it did, and otherwise names the latest
889
+ failed cycle's steps. The escalation targets the last failed `verify:<step>`.
866
890
 
867
891
 
868
892
  Classified session deferrals consume no phase failures. Unsupported decisive
@@ -875,14 +899,21 @@ authorization.
875
899
  When the scoped `ab context` initial own-build read fails, the CLI best-effort
876
900
  writes `session.build-read-failed` with exact session, phase, round, operation
877
901
  `context`, reason `own-build-read`, and diagnostic. A valid terminal from that
878
- session wins if the agent recovers. Otherwise settlement records `phase.deferred`
902
+ session, or from its native continuation, wins if the agent recovers; a
903
+ continuation inherits its predecessor's pending deferral, so a chain parks at
904
+ most once. A later successful own-build read in the same session records
905
+ `session.build-read-recovered`, which a newer classified failure invalidates. A
906
+ finalize post-step, which has no terminal, settles as recovered only with that
907
+ evidence and a completed turn, and the kernel then records its
908
+ `finalize.step-completed`. Otherwise settlement records `phase.deferred`
879
909
  and `phase.deferral-escalated`, immediately projecting ordinary blocked attention.
880
910
  The raise cites `own-build-read:<evidenceSeq>`; replay repairs either settlement
881
911
  crash gap before launching another agent. An `escalation.answered` retry or
882
912
  guidance authorizes one fresh session without resetting genuine phase failures;
883
913
  a new classified failure parks again. There are zero automatic paid retries
884
914
  after this deferral. If evidence cannot be written, ordinary recovery applies;
885
- agent output and `no-terminal` alone never classify a read failure.
915
+ agent output and `no-terminal` alone never classify a read failure or settle
916
+ one as recovered.
886
917
 
887
918
  A kernel store write rejected with HTTP 413 raises `StoreWriteTooLargeError`
888
919
  and records `phase.failed {willRetry:false}` on its first attempt, including
@@ -902,11 +933,24 @@ non-destructive execution fence for the exact workspace and execution generation
902
933
  It preserves unpublished branch commits and distinct detached producer candidates
903
934
  under immutable `refs/autobuild/archive/<build>/<sha>` refs, verifies their exact
904
935
  readback, and records `workspace.commits-preserved` before cleanup. Replacement
905
- provisioning restores those exact refs before starting an agent. Preservation
906
- never advances the public build branch. A confirmed absent environment records
907
- `workspace.commits-lost`, naming known candidates and explicitly noting that any
908
- additional unpublished SHAs could not be inspected. Unknown fencing, inspection,
909
- transport, or receipt-write outcomes leave the workspace and snapshots intact.
936
+ provisioning restores those exact refs before starting an agent. A preserved
937
+ branch head that the build's latest 64 replaced heads cover, as the replaced
938
+ head itself or one of its ancestors, is kept only as archived objects: it is
939
+ never preserved or restored as the branch, and provisioning records the skip as
940
+ `restorationSkipped` on `workspace.provisioned`. Rewrites older than that bound,
941
+ and unpublished divergent branch work, are still refused. Preservation
942
+ never advances the public build branch. A confirmed absent environment, or one
943
+ that exists without a provisioned checkout, records `workspace.commits-lost`,
944
+ naming known candidates and explicitly noting that any additional unpublished
945
+ SHAs could not be inspected. An environment that never started executing holds
946
+ no unpublished work: objects its checkout lacks mean nothing to preserve, so
947
+ cleanup records `workspace.commits-preserved` carrying forward earlier preserved
948
+ heads, then releases and replaces it. Unknown fencing, inspection, transport, or
949
+ receipt-write outcomes leave the workspace and snapshots intact. A workspace
950
+ flagged by `workspace.cleanup-required` is never launched into: the dispatcher
951
+ releases it and provisions the next generation. A preservation or release
952
+ failure is recorded against its build, as an infrastructure failure or janitor
953
+ attention, and never stops the dispatcher from advancing other builds.
910
954
  Fencing is revalidated after restart; a saved receipt alone never authorizes
911
955
  cleanup of a newer execution. Current recovery notes are linked by the session
912
956
  manifest's `workspaceRecovery` field. Recovery notes apply to the next session
@@ -1082,7 +1126,7 @@ consumed by the core `plan` phase, and nothing is reported.
1082
1126
  | Field | Default | Allowed / constraints | Effect |
1083
1127
  |---|---|---|---|
1084
1128
  | `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. |
1085
- | `account` | Named billing account; inherits independently on primaries and alternates. Omission selects the sole Claude subscription account for a Claude route. |
1129
+ | `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. |
1086
1130
  | `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. |
1087
1131
  | `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. |
1088
1132
  | `extensions` | no effect | deprecated optional array of nonempty strings | Compatibility-only field. Dispatch warns for each declaring role and directs migration to `args`. |
@@ -1128,9 +1172,15 @@ outcome.
1128
1172
  Each attempt starts from the primary. Overload, rate-limit, 5xx, timeout,
1129
1173
  transport, unknown provider failures, and quota/usage/billing exhaustion try
1130
1174
  alternates in order without consuming extra phase attempts. Authentication,
1131
- permission, and local runtime-configuration failures do not. Every target has
1132
- its own session/transcript; a continuation fallback starts fresh from durable
1133
- context. Selection is not sticky, so the next phase, continuation, or retry
1175
+ permission, and local runtime-configuration failures do not, with one
1176
+ exception: a target whose runtime CLI executable is not installed falls through
1177
+ to the next declared alternate, so the phase runs on the first declared target
1178
+ whose CLI is present. An installed CLI with an unsupported version still stops
1179
+ the chain, as does every other local runtime-configuration failure. When no
1180
+ declared target has its CLI installed, the phase ends in one non-retried
1181
+ `configuration` failure carrying the last target's missing-CLI message. Every
1182
+ target has its own session/transcript; a continuation fallback starts fresh
1183
+ from durable context. Selection is not sticky, so the next phase, continuation, or retry
1134
1184
  starts from the primary. A suspended Harvest turn first retries its recorded
1135
1185
  route, then tries the remaining configured targets in order. Its substitution
1136
1186
  and failure evidence retain configured indexes even when that order starts at
@@ -1166,11 +1216,11 @@ nonnegative integer so zero can disable that trigger.
1166
1216
  |---|---|---|---|
1167
1217
  | `upgradeDrainSeconds` | `900` | positive integer | Local generation drain deadline from handoff start; hot-reloaded while draining. |
1168
1218
  | `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. |
1169
- | `stallRounds` | `3` | positive integer | The same finding surviving this many review rounds auto-escalates to a human — the anti-loop guard. |
1219
+ | `stallRounds` | `3` | positive integer | The same finding surviving this many review rounds auto-escalates for external judgment — the anti-loop guard. |
1170
1220
  | `maxVerifyAttempts` | `3` | positive integer | Caps distinct failed verify cycles since the latest spec revision; passed and skipped cycles cost zero. |
1171
1221
  | `maxDispatchAttempts` | `3` | positive integer | Caps consecutive dispatch failures before a setup-targeted `dispatch-failure-limit` escalation. |
1172
- | `maxSetupAttempts` | `3` | positive integer | Caps consecutive `[commands].setup` failures before a setup-targeted human escalation. |
1173
- | `maxInfrastructureAttempts` | `3` | positive integer | Caps consecutive remote provider lifecycle failures before a setup-targeted human escalation; a `retry` answer re-arms the budget. |
1222
+ | `maxSetupAttempts` | `3` | positive integer | Caps consecutive `[commands].setup` failures before a setup-targeted policy escalation. |
1223
+ | `maxInfrastructureAttempts` | `3` | positive integer | Caps consecutive remote provider lifecycle failures before a setup-targeted policy escalation; a `retry` answer re-arms the budget. |
1174
1224
  | `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. |
1175
1225
  | `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. |
1176
1226
  | `harvestThreshold` | `5` | positive integer | Newly unclaimed `observation.recorded` occurrences required to start one repository harvest run. |
@@ -1255,15 +1305,17 @@ state eligible.
1255
1305
  | `source` | — | **required**, nonblank builtin or plugin registration name | Which provider backs all ticket operations. Unknown names report every available builtin and plugin source. |
1256
1306
  | `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. |
1257
1307
  | `url` | selected build service | HTTPS URL (loopback HTTP allowed), no userinfo/query/fragment; hosted only | Ticket service independent of builds; required for local builds. |
1258
- | `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. |
1259
- | `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. |
1260
- | `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. |
1261
- | `claimedState` | — | optional nonempty string; forbidden by `file`, allowed for plugins | Workflow state `claim()` moves a ticket to when a build starts. |
1262
- | `doneState` | hosted: `"done"` | optional nonblank string | Project completion state and merged-ticket transition; hosted tickets only. |
1263
- | `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). |
1264
- | `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. |
1308
+ | `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. |
1309
+ | `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. |
1310
+ | `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. |
1311
+ | `claimedState` | hosted, github: `doing` | optional nonempty string; forbidden by `file`, allowed for plugins | Workflow state `claim()` moves a ticket to when a build starts. |
1312
+ | `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. |
1313
+ | `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). |
1314
+ | `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. |
1265
1315
  | `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. |
1266
- | `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. |
1316
+ | `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`. |
1317
+ | `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. |
1318
+ | `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. |
1267
1319
 
1268
1320
  `readyLabels` is the only source-aware readiness default. Dispatch resolves it
1269
1321
  as follows:
@@ -1271,6 +1323,7 @@ as follows:
1271
1323
  | `[tickets].source` | `readyLabels` absent |
1272
1324
  |---|---|
1273
1325
  | `"linear"` | `["autobuild"]` — the historical label narrowing |
1326
+ | `"github"` | `["autobuild"]` — the same narrowing, as an issue label |
1274
1327
  | `"file"` | `[]` — no label narrowing; `readyState` selects the directory |
1275
1328
  | plugin | `[]` — no host-imposed label convention |
1276
1329
 
@@ -1285,6 +1338,12 @@ and reclaimed on every tick. `proposalState` moves only what harvest files.
1285
1338
  Cross-field rules, each an **error**:
1286
1339
 
1287
1340
  - `source = "linear"` without `teamKey`; or with `dir` set.
1341
+ - `source = "github"` with `teamKey`, `dir` or `url` set. The forge
1342
+ repository is the tracker, so no other key is required.
1343
+ - `readyAssignee` on a source that doesn't declare the capability (`file`,
1344
+ `hosted`, or a plugin source without it). The error names the source; for a
1345
+ plugin it comes at startup and `ab init --validate`, after plugins load, and
1346
+ a live reload that adds it is rejected.
1288
1347
  - `source = "file"` with `teamKey` or `claimedState` set. `dir` is **optional**
1289
1348
  here — absent means the default above, which is why the schema leaves it
1290
1349
  optional rather than giving it a `.default()`: that is what keeps the
@@ -1300,7 +1359,8 @@ Cross-field rules, each an **error**:
1300
1359
  The file tracker is **directory-per-state**: `<dir>/<state>/<id>.md`, where
1301
1360
  every directory directly under the root is a state: the four lifecycle
1302
1361
  directories `triage/ ready/ doing/ done/` (always present, created on first use)
1303
- plus any others the repository adds, such as `icebox/`. A state exists when its
1362
+ plus the configured backlog and rejected role states (created on the first role
1363
+ move) and any others the repository adds. A state exists when its
1304
1364
  directory exists; state names match directories case-insensitively, and a name
1305
1365
  with no directory is an error listing those that exist. The directory *is* the
1306
1366
  state, so a transition or
@@ -1317,8 +1377,59 @@ explicit `dir` is the user's and is left alone. Operator agents and humans drive
1317
1377
  through the source-agnostic `ab ticket` commands rather than running `mv` or
1318
1378
  `mkdir` by hand; `ab ticket state create` makes a new state.
1319
1379
 
1380
+ The `github` source reads the issues of the forge repository, the GitHub
1381
+ repository `origin` names. Ticket ids are issue numbers (`123` or `#123`), and
1382
+ pull requests are never tickets. An open issue with one `autobuild:<state>`
1383
+ label is in that state; an open issue with none is in triage, so issues filed
1384
+ on GitHub arrive there; an open issue with two or more is excluded with a
1385
+ diagnostic naming it and its labels. Closed as completed, or closed with no
1386
+ recorded reason, is done. Closed as not planned or duplicate is the rejected
1387
+ state, or a fixed `not-planned` state when `rejectedState` is unset, which is
1388
+ never ready, never resolves a blocker and cannot be moved into. Reopening an
1389
+ issue on GitHub returns it to triage: the first read strips a stale pre-reopen
1390
+ state label. That check reads the issue's last 100 label and reopen events, so
1391
+ an issue whose deciding event is older is excluded with a diagnostic until its
1392
+ state label is removed and re-added. Blockers are native GitHub issue
1393
+ dependencies; a blocker in another repository never resolves. The ticket's own
1394
+ issue is always a `closes` link. Links to other issues show on GitHub as
1395
+ `autobuild-link:<intent> #<n>` labels, one repository label per linked issue
1396
+ and intent, never deleted when unused; state and link labels are never ticket
1397
+ labels, and writes naming them are refused. The `autobuild:proposal` and
1398
+ `autobuild:aborted` labels that harvest and abort apply are ordinary labels,
1399
+ so `proposal` and `aborted` cannot be states. Dispatcher notices post as issue
1400
+ comments, but tickets carry no comment history, so `ab ticket show` lists none;
1401
+ export and import read it explicitly.
1402
+ Assets live in the BuildStore. A node is an issue with the exact `node` label,
1403
+ and a ticket targets a node by being a sub-issue of the node's issue; a parent
1404
+ without that label, or in another repository, is grouping that gives no target
1405
+ and is left untouched (see [integration trees](references/integration-tree.md)).
1406
+ There are no guarded writes. Export and import are supported, and
1407
+ import remaps every id to a new issue number (see the
1408
+ [ticket migration procedure](references/ticket-migration.md)). Dispatcher reads are conditional requests whose validators
1409
+ live under the local state root and are evicted after 7 days unused, so an
1410
+ unchanged repository costs a tick no primary rate-limit budget. Rate limits
1411
+ surface as the ticket-source rate-limit error. A keyed create needs
1412
+ `idempotencyKeyReservedAt`, the earliest time the key could first have been
1413
+ used; harvest supplies it. Drive all of it through `ab ticket`, never by
1414
+ hand-editing state or link labels.
1415
+
1416
+ State counts from the `github` source are display-only: each `countStates` or
1417
+ `listStates` call sends one fresh GraphQL request, plus one more per further
1418
+ page of 100 `autobuild:` labels, and nothing is cached; done and rejected follow GitHub's search-index lag. Three cases
1419
+ approximate. A stale reopen label counts in its label's state until the first
1420
+ read strips it. An issue with two or more state labels counts once in each of
1421
+ them; the first read reports it, and counts correct once its labels are fixed.
1422
+ A closure that predates GitHub's close reasons reads as done but may count as
1423
+ rejected or `not-planned`, and never heals. Ticket reads, readiness and blocker
1424
+ resolution are always exact.
1425
+
1320
1426
  **Secrets never live in this file.** `LINEAR_API_KEY` and plugin-declared
1321
1427
  `requiredEnv` credentials are environment variables (a local `.env` works).
1428
+ The `github` source reuses the forge credential: `GITHUB_TOKEN`, then `GH_TOKEN`,
1429
+ then the gh CLI's `gh auth login`. It needs Issues read and write, and Metadata
1430
+ read, on the repository, and a user token's user needs triage or write access,
1431
+ because GitHub silently drops label changes below that. The source fails such a
1432
+ write with a permission error, and `ab init --validate` reports it.
1322
1433
  Missing plugin credentials name both the selected source and every missing
1323
1434
  variable. If a user asks you to put an API key in `autobuild.toml`, use the
1324
1435
  environment variable instead and say why.
@@ -1389,8 +1500,13 @@ the authoritative base commit using packaged-content and production-lock equalit
1389
1500
  without modifying operator or build worktrees. Equal-content advances still record
1390
1501
  the latest resolved target SHA. Compatible generations overlap through the durable draining handoff described above. `--once`, origin-mode and direct hot
1391
1502
  presentation modes bypass automatic adoption. Operator stop wins over cutover.
1392
- Repository status exposes per-run resolved target, upgrade target, failure and handoff facts, both
1393
- generations, takeover, outstanding draining builds and deadline;
1503
+ Repository status shows the current upgrade condition: the live handoff (both
1504
+ generations, takeover, outstanding draining builds and deadline), the current
1505
+ generation's resolved target and latest outcome, and the latest settled outcome
1506
+ from an earlier generation. A failure that a later different resolved target or a
1507
+ later generation replaced is marked `(superseded)` and needs no action. The
1508
+ `upgrades` value keeps a bounded window of 16 recent runs; full upgrade history
1509
+ stays in the repository journal;
1394
1510
  `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
1395
1511
  retry an unchanged failed target. No registry credentials belong in these facts.
1396
1512
 
@@ -1606,6 +1722,26 @@ while worktrees and default file tickets remain under the repository-default
1606
1722
  `.autobuild/` directory. The dispatcher passes its normalized selection to
1607
1723
  every agent session as `AB_STORE`.
1608
1724
 
1725
+ ### Several dispatchers on one repository
1726
+
1727
+ One repository driven by several dispatchers — for example each engineer
1728
+ running `ab dispatch` locally — should share one store: connect every
1729
+ dispatcher to the same service with `ab connect`. Assignee gating
1730
+ (`[tickets].readyAssignee`) divides tickets between dispatchers but not
1731
+ store-owned state. Separate local stores each see only their own builds:
1732
+
1733
+ - **Nodes are owned by one store.** A child ticket can target only a node built
1734
+ in its own store; elsewhere it stays queued with `target node … is being
1735
+ built by another store`.
1736
+ - **Harvest observations are split.** Each store harvests only its own builds'
1737
+ observations.
1738
+ - **No shared build history.** `ab builds`, status, dashboards and the operator
1739
+ API show only the local store's builds.
1740
+ - **Branch collisions are only partly guarded.** A dispatcher skips any slug
1741
+ whose `ab/` or `ab-node/` branch already exists on the remote (when its forge
1742
+ supports `remoteBranchExists`), but two stores that claim the same name
1743
+ before either pushes can still collide.
1744
+
1609
1745
  ## Connect a project
1610
1746
 
1611
1747
  From a checkout with an origin remote, run `ab connect https://YOUR_ORIGIN`.
@@ -1687,14 +1823,15 @@ Do not present self-hosting to users as a supported product feature.
1687
1823
 
1688
1824
  The sessionless `ab ticket` namespace constructs whichever TicketSource the
1689
1825
  repository's `[tickets]` table selects. These forms therefore work unchanged
1690
- with Linear and the file tracker, without provider-specific API/MCP calls:
1826
+ with the file tracker, Linear, hosted tickets and GitHub issues, without
1827
+ provider-specific API/MCP calls:
1691
1828
 
1692
- - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--json]`
1829
+ - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--issues N[:refs],...] [--priority urgent|normal] [--json]`
1693
1830
  files a ticket. Without `--state`, the source uses `[tickets].createState` or
1694
1831
  its own default. A named state is passed through unchanged and the selected
1695
1832
  source validates it before creating anything. Blocker ids belong to the same
1696
1833
  source and are also checked before the single create call.
1697
- - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--json]`
1834
+ - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--issues N[:refs],...] [--priority urgent|normal] [--json]`
1698
1835
  partially replaces editable fields. At least one editable flag is required;
1699
1836
  `--json` alone is not an update.
1700
1837
  - `ab ticket block <id> <blocker-id[,blocker-id...]> [--json]` adds one or more
@@ -1707,21 +1844,26 @@ with Linear and the file tracker, without provider-specific API/MCP calls:
1707
1844
  criteria apply; every requested label must match.
1708
1845
  - `ab ticket show <id> [--json]` reads one complete ticket. Human output includes
1709
1846
  labeled metadata and the body verbatim, so it can read a stored spec back.
1710
- - `ab ticket move <id> <state> [--json]` transitions one ticket and reports its
1711
- post-transition value.
1847
+ - `ab ticket move <id> (<state> | --role triage|ready|backlog|rejected) [--json]`
1848
+ transitions one ticket and reports its post-transition value. `--role`
1849
+ resolves the configured native name; an unconfigured backlog or rejected role
1850
+ is refused naming its key, never mapped to a same-named state, and a source
1851
+ that creates states creates the role state on first use.
1712
1852
  - `ab ticket states [--json]` lists every state of the configured source:
1713
- lifecycle states first (triage, ready, doing, done), then custom states
1714
- alphabetically. Each row has the state name, the roles it plays under the
1715
- current config (create, ready, claimed, triage, proposal, done, or none), its
1716
- ticket count, and its purpose when set. `--json` emits one bare array of
1853
+ role-holding states in workflow order (triage, create, proposal, backlog,
1854
+ ready, claimed, done, rejected), then the rest. Each row has the state name,
1855
+ the roles it plays under the current config (or none), its ticket count, and
1856
+ its purpose when set. `--json` emits one bare array of
1717
1857
  `{name, roles, tickets, about?}`.
1718
1858
  - `ab ticket state create <name> [--about <text>] [--json]` makes a state, for
1719
- example `icebox`. It is idempotent: an existing state is reported as already
1859
+ example `needs-design`. It is idempotent: an existing state is reported as already
1720
1860
  existing, and `--about` (one line) records or replaces its purpose. A name is
1721
1861
  one to forty lowercase letters, digits, and hyphens starting with a letter,
1722
1862
  and may not match an existing state case-insensitively. There is no rename or
1723
- delete. Only the file source supports `states` and `state create`; other
1724
- sources exit nonzero naming the source and the unsupported operation.
1863
+ delete. The file, hosted and github sources support `states` and `state create`
1864
+ (github states are `autobuild:<state>` labels, and the purpose is the label
1865
+ description); other sources exit nonzero naming the source and the
1866
+ unsupported operation.
1725
1867
 
1726
1868
  State names and ids are source-local. For block and unblock, the first id is the
1727
1869
  ticket being changed and the comma-separated second operand names its blockers.
@@ -1737,7 +1879,7 @@ to a ticket that has already been claimed into a build does not stop that build.
1737
1879
  For dependent tickets, follow the
1738
1880
  [safe blocker-filing workflow](references/ticket-dependencies.md): determine the
1739
1881
  intended final destination, stage outside ready, verify all blocker relationships,
1740
- and move to ready last. Direct Linear creates the issue and its blockers
1882
+ and move to ready last. Direct Linear and GitHub create the issue and its blockers
1741
1883
  in separate requests; one `create --blocked-by` call is not atomic publication.
1742
1884
  Harvest's creation reservations cover Harvest only, not interactive CLI creates.
1743
1885
  Dependency order and JSON id extraction are still required, but do not alone
@@ -1745,14 +1887,31 @@ prevent an active dispatcher from claiming a partially created ready ticket.
1745
1887
 
1746
1888
  Update is partial: omitted fields remain untouched, including labels, assignee,
1747
1889
  and provider metadata. `--labels` is a complete replacement and an explicitly
1748
- empty value (`--labels ''`) clears the list. Supplied title/body values must be
1890
+ empty value (`--labels ''`) clears the list. `--issues` records the forge issues
1891
+ a ticket addresses: `N` (intent `closes`, the default) when the ticket fully
1892
+ resolves the issue, `N:refs` when it only partly addresses it. Attach the
1893
+ originating issue whenever a ticket comes from one. A build freezes the links
1894
+ when it claims the ticket and turns them into PR and commit keywords; see
1895
+ [issue links in builds](#issue-links-in-builds). On update `--issues` is a
1896
+ complete replacement and `--issues ''` clears it. A source that cannot store
1897
+ issue links refuses any write naming them, names itself, and writes nothing.
1898
+ `--priority urgent` makes the dispatcher claim the ticket before normal ready
1899
+ work, each class in source order; blockers and every other gate still apply,
1900
+ and it never preempts a running build. `--priority normal` (the default)
1901
+ removes urgency. The file, hosted and Linear sources store priority (Linear as
1902
+ its native Urgent; `normal` clears only Urgent and leaves other Linear priorities
1903
+ alone); plugin sources without the capability read every ticket as normal,
1904
+ refuse `urgent` naming themselves and writing nothing, and accept `normal`
1905
+ as a no-op. JSON
1906
+ ticket output always includes `priority`, and list output marks urgent tickets.
1907
+ Supplied title/body values must be
1749
1908
  nonblank. State is intentionally not an update field — `transition()` remains its sole owner —
1750
1909
  and every validation or unknown-ticket error occurs before
1751
1910
  mutation and names the offending field or id. `--body` always names a file; a
1752
1911
  missing file fails before a source write.
1753
1912
 
1754
- Quote multiword Linear states, for example `"In Progress"`; file states are
1755
- case-insensitive on input and canonical on output. The adapters validate
1913
+ Quote multiword Linear states, for example `"In Progress"`; file and github
1914
+ states are case-insensitive on input and canonical on output. The adapters validate
1756
1915
  transitions, so an invalid state fails with the
1757
1916
  source's known states. A missing id fails nonzero with an error naming both the
1758
1917
  id and configured source.
@@ -1762,6 +1921,8 @@ subcommands accept `--json`, which emits one bare JSON value and no prose: a
1762
1921
  `Ticket[]` for `list`, and the complete resulting `Ticket` for `create`,
1763
1922
  `update`, `block`, `unblock`, `show`, or `move`.
1764
1923
 
1924
+ 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.
1925
+
1765
1926
  ### Ticket assets
1766
1927
 
1767
1928
  A ticket asset is a file or folder attached to a ticket: a design export,
@@ -1785,8 +1946,8 @@ assets are not moved and are not a fallback. Each has a kind and a name.
1785
1946
  Hosted revisions are copied into immutable snapshots in the build store,
1786
1947
  preserving revision numbers and allowing reads without the ticket service.
1787
1948
  Old pins without snapshots keep reading their original ticket rows. A
1788
- later attach or remove leaves a running build alone; a human answer with
1789
- `--revise-spec-from-ticket` pins again. `ab build asset get <slug> <kind>
1949
+ later attach or remove leaves a running build alone; an answer from your operator
1950
+ agent or you with `--revise-spec-from-ticket` pins again. `ab build asset get <slug> <kind>
1790
1951
  <name> <dest> [--rev <n>]` downloads what the build froze, also after it ends.
1791
1952
  - **Where phases find them.** `ab context` writes each pinned asset to
1792
1953
  `$AB_CONTEXT_DIR/assets/<kind>/<name>/` (a file asset is the single file inside that
@@ -1799,6 +1960,50 @@ static files when the ticket is groomed, so no build converts a link. The spec
1799
1960
  cites it by kind and name. See [the lifecycle](#the-lifecycle) for how phases
1800
1961
  judge against it.
1801
1962
 
1963
+ ### Issue links in builds
1964
+
1965
+ A ticket's [issue links](#source-agnostic-ticket-operations) reach the forge
1966
+ through the build that claims it:
1967
+
1968
+ - **Frozen at claim.** `build.created` records the links. Later ticket edits
1969
+ and spec revisions leave a running build's links alone.
1970
+ - **Where phases find them.** `ab context` lists them under `issueLinks` in
1971
+ `$AB_CONTEXT_DIR/context.json` with each effective `intent` and any
1972
+ `downgradeReason`, and the derived `ticket.md` gains an `- issues:` line. The
1973
+ key is absent when the build has none. `ab build status` shows an `issues:`
1974
+ line, and `--json` carries `issueLinks` and `issueLinksSealed`.
1975
+ - **Downgrade.** An agent that finds the build only partly resolves a
1976
+ `closes` issue runs `ab issue downgrade <N> --reason <text>`. The issue
1977
+ becomes `refs` and the reason is recorded. Downgrading a `refs` or unlinked
1978
+ issue is refused, and nothing can upgrade a link.
1979
+ - **Sealed at finalize.** Before the kernel opens the PR it seals the links
1980
+ (remote finalize is sealed by its publication request). A downgrade after
1981
+ the seal is refused and changes nothing; use `ab escalate` instead.
1982
+ - **What is written.** On a leaf aimed at the configured base branch, a forge
1983
+ that declares issue-closing support (GitHub) ends the PR body with one
1984
+ `Closes #N` or `Refs #N` line per link, ascending by issue number, whatever
1985
+ the description says. The landed squash commit, including forge auto-merge,
1986
+ carries the same paragraph before its trailer block (`Co-authored-by`,
1987
+ `Autobuild-Build`). Any closing keyword aimed at a `refs` issue in the PR
1988
+ title, body or landing message, including `owner/name#N` and issue URLs for
1989
+ the same repository, is rewritten to `refs`, so prose can't close it. Merging
1990
+ closes each `closes` issue and leaves each `refs` issue open with a back-link.
1991
+ - **Through a node.** GitHub closes issues only from the default branch, so a
1992
+ leaf aimed at an integration node, and a nested node's PR into its parent,
1993
+ end their PR body with one `Refs #N` line per linked issue, whatever its
1994
+ intent, so each issue shows the PR without closing; their landed commits
1995
+ carry no lines. When a leaf lands, its effective links, downgrades included,
1996
+ are recorded on the node; a nested node passes its own links merged with its
1997
+ children's union up to its parent the same way. The root node's PR into the default
1998
+ branch gets the closing lines for the node's own links and every
1999
+ contribution, kept current as children land and refreshed before the kernel
2000
+ lands it. Merging the node, by the kernel or a human, closes them. A downgrade by any child
2001
+ makes that issue `Refs`; otherwise any child's `closes` makes it `Closes`.
2002
+ Child commits keep their own messages and carry no lines.
2003
+ - **What is not.** `local-git`, the fake forge and other forges without the
2004
+ capability record links and downgrades but write no lines; the build still
2005
+ succeeds.
2006
+
1802
2007
  ## Retrieving build artifacts
1803
2008
 
1804
2009
  `ab artifact download <build> <kind>[@rev] --output <file> [--store <ref>]`
@@ -1829,21 +2034,16 @@ in-session `put|get` still require ambient phase auth.
1829
2034
 
1830
2035
  ## Dispatch dashboard
1831
2036
 
1832
- A plain `ab dispatch` reads dispatch placement once before starting local execution.
1833
- For a hosted project it opens the Store-only viewer automatically, displaying
1834
- `viewer · dispatched by <host>` from the placement origin (including a nondefault
1835
- port). `--once`, `--plain`, and `--interval` retain their viewer meanings.
1836
- `--takeover` explicitly dispatches locally, with a warning that it can displace
1837
- the hosted dispatcher; it cannot be combined with `--viewer`. Startup intake
1838
- flags require `--takeover` when placement selects viewer.
1839
-
1840
- An unreadable placement fails closed with a typed error naming the cause:
1841
- use `--viewer` to watch or `--takeover` to dispatch locally. Both explicit modes
1842
- skip placement discovery. Older services without the capability and projects
1843
- with unknown or nonhosted placement retain local dispatch behavior. Local stores
1844
- need no placement request. Origin mode (`--repository` or `AB_REPOSITORY`) and
1845
- hosted cron dispatch bypass this check. Placement is a startup snapshot, not a
1846
- liveness probe or a polling input.
2037
+ How a plain `ab dispatch` chooses between the viewer and local execution for a
2038
+ hosted project — placement discovery, `--takeover`, explicit `--viewer`, and
2039
+ the fail-closed behavior when placement is unreadable — is described once in
2040
+ [hosted dispatch and local viewing](references/setup.md#hosted-dispatch-and-local-viewing).
2041
+
2042
+ The viewer reads its dashboard from the Store; its one ticket-source read is
2043
+ the header's triage count, through the source's optional `countStates`.
2044
+ The `github` source answers it with one fresh GraphQL request, plus one per
2045
+ further page of 100 `autobuild:` labels, and caches nothing; see its display-only
2046
+ count notes under `[tickets]`.
1847
2047
 
1848
2048
  Humans may run `ab dispatch --viewer` from a local checkout to watch dispatch
1849
2049
  elsewhere without taking a lease or starting any dispatch work. The optional
@@ -1851,12 +2051,15 @@ elsewhere without taking a lease or starting any dispatch work. The optional
1851
2051
  `viewer · dispatched by <label>`. Plain/non-TTY output prints the same at startup
1852
2052
  and emits state changes. `--once` reads one snapshot; `--interval <s>` sets the
1853
2053
  viewer polling cadence. Startup intake flags and explicit `--repository` are
1854
- rejected. Without a durable effective configuration the viewer waits.
2054
+ rejected. With no recorded dispatcher run the viewer says no dispatcher has run
2055
+ for this project yet; with a run whose effective configuration is not yet
2056
+ durable it waits.
1855
2057
 
1856
- Viewer uses the Store-only frontend with canonical repository facts for status,
2058
+ Viewer uses the dispatch frontend with canonical repository facts for status,
1857
2059
  settings, harvest and migrations, bypassing the dispatch presentation event feed
1858
2060
  and its checkpoints. Fresh viewers reuse server reductions; idle refreshes read
1859
- zero event rows. It has no child, lease, execution wiring or upgrade-release timer.
2061
+ zero event rows. Its one ticket-source read is the header's triage count, at
2062
+ most once per 60 s. It has no child, lease, execution wiring or upgrade-release timer.
1860
2063
  All existing shared-store controls remain: merge/hold, build/global pause/resume,
1861
2064
  blocked feedback/retry, intake/harvest gates, harvest resume/acknowledgement,
1862
2065
  queued discard and confirmed abort. Navigation/session inspection also remain.
@@ -1891,30 +2094,47 @@ The five list steps are `spec`, `open`, `collect`, `verify`, and `merge`, with
1891
2094
  verification progress or failure and the merge mode in parentheses. Before
1892
2095
  a policy decision, label-dependent modes may read `policy pending`. A current
1893
2096
  verified node adds `verified`. Only restack conflicts, current verification
1894
- failures (file a repair child targeting the node), and readiness awaiting
1895
- consent add a list alert. Consent names `l` and `ab merge <slug>`. Branch,
2097
+ failures (file a repair child targeting the node), a node waiting for a runner
2098
+ slot ahead of new ticket claims, and readiness awaiting consent add a list
2099
+ alert. Consent names `l` and `ab merge <slug>`. Branch,
1896
2100
  restack state and conflicting files remain in detail, along with every child's
1897
2101
  ticket id, title and live phase (or queued/merged), open-first counts, verification
1898
2102
  steps and current outcomes, repair instructions, and the merge rule. Cancelled
1899
2103
  children are omitted; historical missing titles or filenames are explicit.
1900
2104
 
1901
2105
 
1902
- On a TTY, execution-mode `ab dispatch` renders one fixed interactive frame anchored at the
1903
- terminal's first row. Its header remains on that top row as frame height changes
1904
- and after a resize; unused rows remain below. On exit, the final frame is copied
2106
+ On a TTY, execution-mode `ab dispatch` renders one fixed interactive frame that fills the
2107
+ terminal's height. Its header stays on the top row, the legend or prompt panel
2108
+ is pinned to the bottom rows, and the build list fills the space between and
2109
+ scrolls within it, following the selection; after a resize the legend moves to
2110
+ the new bottom. On exit, the final frame is copied
1905
2111
  to the normal screen and remains in scrollback. Its always-present two-line
1906
2112
  process-global header has a selectable `Autobuild` summary with the repository
1907
2113
  basename followed by the compact counters
1908
- `queue <depth> | active <current>/<limit> | observations <current>/<limit>`.
1909
- `queue` is the ready-ticket queue depth; `active` is the current
1910
- nonterminal-build count against root `capacity`; and `observations` is the count
1911
- of recorded observation occurrences not yet claimed by a Harvest snapshot
1912
- against `policy.harvestThreshold`. The Store-only interactive frontend refreshes
1913
- that display value directly from the BuildStore; a failed refresh retains the
1914
- last successful count, shows a diagnostic, and appends no transport event.
2114
+ `triage <count> | queue <depth> | active <current>/<limit>`, the same three
2115
+ main counts the web operator app shows. `triage` is the number of tickets in
2116
+ the configured triage state (`[tickets].triageState`, or the source's default).
2117
+ The dispatcher samples it at most once per 60 s, outside dispatcher ticks,
2118
+ only for an interactive dashboard, through one bounded state-count read
2119
+ (`countStates`), never a ticket listing; it reads no events, and each tick
2120
+ publishes the last good sample. It shows `–`
2121
+ when the source has no bounded state counts (Linear) or no sample has succeeded
2122
+ yet; a failed read keeps the last value, appends nothing, and never fails the
2123
+ tick. The interactive frontend of a local dispatch takes it from the
2124
+ dispatcher's published status and never reads the ticket source. A viewer
2125
+ (`ab dispatch --viewer`, or the default placement for hosted dispatch) reads
2126
+ the configured source's bounded state count itself, at most once per 60 s
2127
+ while it runs. It keeps its last good value through failed reads and through
2128
+ headless ticks that publish no count, and shows `–` until its first read
2129
+ succeeds or when the source has no state counts (Linear). `queue` is the
2130
+ ready-ticket queue depth, and `active` is the current nonterminal-build count
2131
+ against root `capacity`. Observation pressure is not a header counter: the
2132
+ Harvest row shows a run's observations, and `ab harvest status` reports
2133
+ Harvest state.
1915
2134
  The execution-mode frontend checkpoints dashboard facts, the latest run start and the sampled
1916
2135
  lease holder's start; identity history stays partial and missing holders use a
1917
- bounded per-run lookup. Unchanged written/refused checkpoints are not uploaded
2136
+ bounded per-run lookup. Without a usable checkpoint, startup and recovery seed
2137
+ from the canonical reduced repository value, never the journal. Unchanged written/refused checkpoints are not uploaded
1918
2138
  again. Dirty saves run at most once per 30 seconds; transient failures retry
1919
2139
  without new events after 30, 60, 120, 240, then 300 seconds (capped). Teardown
1920
2140
  forces only dirty state. An equal-cursor refusal leaves correlation recoverable
@@ -1933,7 +2153,9 @@ action confirmations are suppressed in the interactive frame. The latest true
1933
2153
  warning or error instead appears on a conditional row below the header, aligned
1934
2154
  to the title; when none exists, that row consumes no space. A blank line
1935
2155
  separates the global section from the first body row, and another separates the
1936
- body from the legend or feedback controls. The duplicate startup banner is
2156
+ body from the legend or feedback controls. When the list overflows, it shows
2157
+ whole builds with `N more above` and `and N more below` notices, each separated
2158
+ from the builds by one blank line. The duplicate startup banner is
1937
2159
  suppressed; `--plain` and non-TTY output remain line-oriented and unchanged. A
1938
2160
  satisfied verify skip carries the literal `skipped` qualifier, so it remains
1939
2161
  distinct from a pass without color. Every nonterminal build has a row,
@@ -2059,7 +2281,7 @@ and offers `p resume`. Exhaustion remains red, says `recovery exhausted — huma
2059
2281
  attention required`, shows stopped step/pending count, and offers `p
2060
2282
  acknowledge`; escalation also offers `p acknowledge`. A request awaiting
2061
2283
  acknowledgement has no duplicate action. Row `p` never pauses the gate. When the
2062
- gate is off it writes nothing and directs the operator to global `h`; the
2284
+ gate is off it writes nothing and directs you to global `h`; the
2063
2285
  eventual shared human acknowledgement reopens every ordinary parked run and
2064
2286
  settles every exhaustion barrier. Exhaustion and escalation remain terminal.
2065
2287
  Escalation's row is dismissed only by a post-terminal human resume request
@@ -2113,7 +2335,7 @@ setters, not toggles, so the values the command names are the values the
2113
2335
  repository holds afterwards — and each per-build request is a compare-and-set
2114
2336
  against a freshly reduced log, so a rerun adds no second pending pause and
2115
2337
  never cancels one already in flight. Pause first is what makes every surviving
2116
- prefix of a failed walk at least as quiesced as asked: once it merges, no queued
2338
+ prefix of a failed walk at least as quiesced as asked: once it is recorded, no queued
2117
2339
  build is launchable, whatever else fails after it. Output names every build that
2118
2340
  received a request, the hold, and the intake value written; `--json` emits that
2119
2341
  same summary for a script. A walk that fails partway exits nonzero and reports
@@ -2152,7 +2374,7 @@ inserts a line break — as does `Shift+Enter` in terminals that report it
2152
2374
  distinctly — `Backspace` deletes at the caret, `Left`/`Right`/`Up`/`Down` and
2153
2375
  `Home`/`End` move the caret rather than the dashboard's row selection, and
2154
2376
  `Escape` cancels without writing. Line breaks survive submission, so the
2155
- guidance the agent receives keeps the operator's line structure. Pasting
2377
+ guidance the agent receives keeps the line structure as typed. Pasting
2156
2378
  multi-line text inserts all of it in one step in terminals that support
2157
2379
  bracketed paste; where they do not, a paste still submits at its first line
2158
2380
  break.
@@ -2239,6 +2461,8 @@ spec and its publication is confirmed.
2239
2461
  Every command requires an applicable target in this repository. Pause and
2240
2462
  resume require an active build; abort and hold also accept queued builds.
2241
2463
  Merge requires a ready candidate and cannot bypass verification or merge gates;
2464
+ a merge that is not ready is refused with code `merge-not-ready` (or
2465
+ `node-incomplete` for an incomplete node) and a reason, and records nothing;
2242
2466
  `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
2243
2467
  aborted, or otherwise inapplicable target is an error and gets no new event. Attribution uses `USER`, then `USERNAME`, then the
2244
2468
  same stable fallback on both surfaces. These commands run sessionless and
@@ -2254,8 +2478,8 @@ These commands request normal kernel work; they do not wake a runner, operate
2254
2478
  the forge, or bypass the lease sweep. Resume is therefore an attempt, not a
2255
2479
  guarantee: if the condition still fails, a phase may raise a new escalation and
2256
2480
  block again. Every open escalation, including all policy and setup causes,
2257
- survives `ab dispatch` and `ab dispatch --once` startup until a human answers
2258
- it. Startup still recovers actionable builds and delivers pending operator
2481
+ survives `ab dispatch` and `ab dispatch --once` startup until your operator agent or you
2482
+ answer it. Startup still recovers actionable builds and delivers pending operator
2259
2483
  commands, but it never records an answer or re-arms a budget.
2260
2484
 
2261
2485
  Durable repository intake has launch-flag setters and a global-row toggle.
@@ -2296,6 +2520,10 @@ repository-local precedence. The command uses the same reducer as the
2296
2520
  dispatcher and dashboard, writes no state, claims no ticket, attaches no runner,
2297
2521
  and starts no dispatcher work. Dispatcher identity includes the held run’s recorded
2298
2522
  runtime; historical starts without metadata display `runtime unrecorded`.
2523
+ It also lists the latest ticket scan's dependency diagnostics (`queue:` lines,
2524
+ `dependencyDiagnostics` in JSON), including tickets held because their target
2525
+ node is being built by another store, and dispatcher startup warnings
2526
+ (`warningLines`).
2299
2527
 
2300
2528
  **`ab builds`** summarizes this repository's builds, one row each. It reports
2301
2529
  **active** builds by default — `running`, `paused`, `blocked` — because those
@@ -2424,7 +2652,8 @@ The default watch reports actionable conditions only:
2424
2652
  authorized merges awaiting application are silent. One merge decision is reported per build/PR.
2425
2653
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
2426
2654
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
2427
- `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
2655
+ `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
2656
+ `dispatcher.kernel-git-unavailable`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
2428
2657
  - `dispatcher.ticket-source-persistent`: degradation past its advertised
2429
2658
  reset time, once a tick started at or after reset has completed or failed
2430
2659
  with the episode still open; crossing reset alone is silent. Without a reset,
@@ -2554,8 +2783,11 @@ after cancelling and draining pending heartbeats. Failures report on stderr and
2554
2783
  fall back to TTL expiry; an unsupported remote route falls back silently. SIGKILL
2555
2784
  still relies on TTL expiry. Timeout/count completion keeps presence for re-arming. Reusing its flagged watch cursor preserves the registration
2556
2785
  ID and original start time across re-arms, re-registering after withdrawal. Unflagged resumes remain read-only.
2557
- Repository status lists live registrations with ID, host, PID, start, heartbeat
2558
- and heartbeat age, or an empty list. Human status prints one operator summary.
2786
+ CLI repository status reports `operator.presence: "loaded"` and lists live
2787
+ registrations with ID, host, PID, start, heartbeat and heartbeat age, or an empty
2788
+ list. MCP `repository.status` and HTTP status do not load presence and report
2789
+ `operator.presence: "unavailable"` with no registrations; that is not evidence of
2790
+ absence. Human status prints one operator summary.
2559
2791
  MCP registration and dashboard presence are deferred.
2560
2792
 
2561
2793
  **`ab wait [<slug>...] (--for <condition> | --event <glob>)... [--since <cursor>]
@@ -2627,11 +2859,12 @@ ab wait --for blocked --json my-build # exit 0: record says why; 2: it ended;
2627
2859
  Second, a plain blocking call — Codex, Pi, and the shell only expose "run a
2628
2860
  command and wait": run it in the turn and read the record when it returns.
2629
2861
 
2630
- The same split governs `ab watch`, which streams and does not exit when it
2631
- emits a record. Run an unbounded watch only under a monitor that wakes the
2632
- agent on each output line. Under exit-only notification, bound it with
2633
- `--count 1` so the first record ends the command, then re-arm from its
2634
- trailing cursor.
2862
+ `ab watch` streams and does not exit when it emits a record, so an operator's
2863
+ standing watch must run under a line-streaming monitor (such as Claude Code's
2864
+ Monitor tool) whenever the harness has one, with `--timeout` below any monitor
2865
+ kill deadline so it exits with a resumable cursor; `--count 1` with re-arming
2866
+ is only the fallback for harnesses that wake the agent solely on exit. See
2867
+ `ab-operate` for the full procedure.
2635
2868
 
2636
2869
  The loop pattern ties the two together: wait, act on the record (answer the
2637
2870
  escalation, inspect the build, merge the PR), then wait again, passing the
@@ -2752,7 +2985,7 @@ default, when you need to know what this repo's version says).
2752
2985
  | Skill | Place in the lifecycle | Purpose |
2753
2986
  |---|---|---|
2754
2987
  | `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.** |
2755
- | `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.** |
2988
+ | `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.** |
2756
2989
  | `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.** |
2757
2990
  | `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. |
2758
2991
  | `ab-harvest-review` | harvest `review` step | Fresh adversarial reviewer for proposal coverage, semantic dedup, spec quality, and evidence; returns `approve`/`revise`/`escalate`. Runner-only. |
@@ -2781,19 +3014,24 @@ Every ticket read includes an opaque `revision`. Pass it as `expectedRevision`
2781
3014
  `move`, `block` and `unblock`. A stale write fails without changing anything and
2782
3015
  reports the current revision. Omission preserves unguarded behavior. Blocker
2783
3016
  checks cover the entire batch. Dispatcher moves remain unguarded and change the
2784
- revision. Sources without guarded writes, including Linear, refuse supplied
2785
- revisions rather than ignoring them.
3017
+ revision. Sources without guarded writes, including Linear and GitHub, refuse
3018
+ supplied revisions rather than ignoring them.
2786
3019
 
2787
3020
  `ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
2788
3021
  frontmatter and a Markdown body. Only title, body and labels are editable;
2789
- kind, target, id, blockers, creation key and reference comments are read-only. It saves only
2790
- changed fields with the opening revision. Unchanged or formatting-only edits
3022
+ kind, target, id, blockers, issue links, priority, creation key and reference comments are read-only. It saves only
3023
+ changed fields with the opening revision. Sources without guarded writes,
3024
+ including Linear and GitHub, re-read the ticket immediately before an
3025
+ unguarded write and refuse a changed revision, with the no-lock race window of file checks. Unchanged or formatting-only edits
2791
3026
  write nothing. On conflict, invalid input or editor failure, the error names an
2792
3027
  absolute file path containing the edited text. Read the current ticket and
2793
3028
  reapply the intended changes before retrying; conflicts are never merged.
2794
3029
 
2795
- File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets
2796
- and state; reverting identical content restores its fingerprint. File checks
3030
+ File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
3031
+ state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
3032
+ fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
3033
+ including the ticket's own issue; GitHub tickets carry no comments. Reverting
3034
+ identical content restores its fingerprint. File checks
2797
3035
  re-read immediately before writing, with the existing no-lock race window.
2798
3036
  Direct file edits and state-directory moves change revisions. File revisions also
2799
3037
  cover structured comments and portable attachments. Legacy file comments change
@@ -2854,10 +3092,17 @@ errors retain their existing behavior.
2854
3092
 
2855
3093
  Janitor failures are durable per-build episodes. Eligible failures retry after
2856
3094
  30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
2857
- Skipped polls preserve the episode across restart. After
3095
+ A classified forge rate limit is repository cooldown, not a janitor failure:
3096
+ neither the first limited response nor the cooldown that follows starts or ages
3097
+ an episode. Skipped polls preserve the episode across restart. After
2858
3098
  `policy.janitorFailureAttentionSeconds` (600 by default), `build.janitor-failing`
2859
3099
  notifies default watchers and appears on the build row. A successful attempt
2860
3100
  clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
3101
+ A dispatcher that cannot execute Git for kernel node work (a missing or
3102
+ unloadable `git` for the bare clone) records no janitor failures. It records
3103
+ one durable `dispatcher.kernel-git-unavailable` repository condition, node work
3104
+ waits, and `dispatcher.kernel-git-recovered` closes the condition once a clone
3105
+ succeeds.
2861
3106
 
2862
3107
  A classified forge rate limit records repository degradation with `resetAt`.
2863
3108
  Forge work waits during cooldown; passing the deadline permits a recovery
@@ -2959,5 +3204,3 @@ ticket numbering from 1. Old credentials remain invalid with 401; independently
2959
3204
  repository-established requests receive 403 project not registered. See
2960
3205
  [project deletion](references/operator-api.md#permanent-project-deletion) for
2961
3206
  generation-bound preview tokens and API semantics.
2962
-
2963
- 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.