@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
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tickets
3
- description: Work this repo's local ticket tracker — create or edit a ticket, amend blockedBy dependencies, report the backlog, triage the inbox, move work between the lifecycle directories and any repository-defined states such as the icebox, or answer "what's the status of ticket X". Use whenever the user asks about tickets, blockers, the backlog, or wants something queued for autobuild to build.
3
+ description: Work this repo's local ticket tracker — create or edit a ticket, amend blockedBy dependencies, report the backlog, triage the inbox, move work between lifecycle roles (triage, backlog/icebox, ready, rejected) and any repository-defined states, or answer "what's the status of ticket X". Use whenever the user asks about tickets, blockers, the backlog, or wants something queued for autobuild to build.
4
4
  ---
5
5
 
6
6
  # /tickets
@@ -28,7 +28,8 @@ and targets while the node recollects and verifies the new revision, including
28
28
  on the same head after failure. See
29
29
  [iterating inside a node](../ab-guide/references/integration-tree.md#iterating-inside-a-node)
30
30
  and [revision restrictions](../ab-guide/references/integration-tree.md#operator-node-spec-revisions).
31
- Open children keep the node incomplete; completed nodes close admission.
31
+ Open children keep the node incomplete, including triage, backlog and ready
32
+ children; a rejected child does not. Completed nodes close admission.
32
33
 
33
34
  For node lifecycle, target validation and source-specific storage, read
34
35
  [nodes and targets](../ab-guide/references/integration-tree.md). When filing
@@ -65,27 +66,34 @@ that directory instead), holding the four lifecycle state directories plus any o
65
66
  dispatcher uses. Any other directory is a repository-defined state: the
66
67
  dispatcher never moves tickets into it and never dispatches from it unless
67
68
  `autobuild.toml` names it (for example `readyState` or `proposalState`).
69
+ The optional backlog and rejected roles are directories too, named by
70
+ `[tickets].backlogState` and `rejectedState` (`ab init` writes `backlog` and
71
+ `rejected`); the dispatcher never claims from or moves into them.
68
72
 
69
73
  ```
70
74
  .autobuild/tickets/
71
- triage/ # filed, not groomed — the inbox
72
- ready/ # groomed; file lifecycle-state gate satisfied
73
- doing/ # claimed; preparing or running a build
74
- done/ # merged
75
- icebox/ # example of a repo-added state, present only once created
75
+ triage/ # filed, not groomed — the inbox
76
+ ready/ # groomed; file lifecycle-state gate satisfied
77
+ doing/ # claimed; preparing or running a build
78
+ done/ # merged
79
+ backlog/ # the backlog role once configured and first used
80
+ rejected/ # the rejected role once configured and first used
76
81
  ```
77
82
 
83
+ "Building" is the claimed role, `doing/` for this tracker. It is not a role you
84
+ move work into: the dispatcher moves a ticket there when it claims it.
85
+
78
86
  **A ticket's state is the directory it is in.** There is no `state` field
79
87
  anywhere. Do not try to change a ticket's state by editing the file.
80
88
 
81
89
  Each ticket is `<id>.md`: TOML frontmatter between `+++` fences carrying `id`
82
- and `title` (and optional `labels` and `blockedBy`), then the body — which is
90
+ and `title` (and optional `labels`, `blockedBy`, `issueLinks` and `priority`), then the body — which is
83
91
  the spec.
84
92
 
85
93
  ## Create a ticket
86
94
 
87
95
  ```
88
- ab ticket create "Rate-limit auth endpoints" --body spec.md [--labels bug,api] [--blocked-by file-1,file-2]
96
+ ab ticket create "Rate-limit auth endpoints" --body spec.md [--labels bug,api] [--blocked-by file-1,file-2] [--issues 824,820:refs] [--priority urgent]
89
97
  ```
90
98
 
91
99
  It lands in `triage/` and prints the new id. `--body` is a file, and its
@@ -94,11 +102,14 @@ contents are the spec — write it to the complete
94
102
  the conversational way to get there). A ticket whose body isn't a conforming
95
103
  spec gets bounced back to `triage/` by the dispatcher rather than built.
96
104
  Blocker ids are source-local; every blocker must exist before creation
97
- succeeds.
105
+ succeeds. When the ticket originates from a forge issue, attach it with
106
+ `--issues`: `N` (intent `closes`, the default) when the ticket fully resolves
107
+ the issue, `N:refs` when it only partly addresses it. `--priority urgent` makes
108
+ the dispatcher claim it before normal ready work; omit it for normal.
98
109
 
99
110
  For dependencies on any source, follow the
100
111
  [safe blocker-filing workflow](../ab-guide/references/ticket-dependencies.md).
101
- Direct Linear record blockers after creating the issue, so a ready
112
+ Direct Linear and GitHub record blockers after creating the issue, so a ready
102
113
  issue can be claimed before `create --blocked-by` returns. Stage dependents in a
103
114
  known non-ready state, verify all blockers with `ab ticket show --json`, then use
104
115
  `ab ticket move` to publish the intended ready destination. Do not use the local
@@ -112,12 +123,18 @@ Use the configured TicketSource rather than hand-editing frontmatter/body:
112
123
  ab ticket update file-3 --body spec.md
113
124
  ab ticket update file-3 --title "New title" --labels bug,api
114
125
  ab ticket update file-3 --labels ''
126
+ ab ticket update file-3 --issues 824:refs
127
+ ab ticket update file-3 --priority urgent
115
128
  ab ticket block file-3 file-1
116
129
  ab ticket unblock file-3 file-1
117
130
  ```
118
131
 
119
132
  Update is partial: omitted fields stay untouched, while an explicitly empty
120
- `--labels` clears labels. It cannot change state. For block/unblock the first
133
+ `--labels` clears labels. `--issues` replaces the whole set of issue links and
134
+ `--issues ''` clears it. `--priority urgent|normal` sets the dispatch class;
135
+ the file tracker writes `priority = "urgent"` and removes the key for normal. A
136
+ source that cannot store priority refuses `urgent`, names itself, and writes
137
+ nothing; `normal` succeeds there. It cannot change state. For block/unblock the first
121
138
  id is the ticket being edited; the second is its blocker. Both are safe to
122
139
  retry, and adding validates the blocker exists and is not the ticket itself.
123
140
 
@@ -132,9 +149,10 @@ ls .autobuild/tickets/doing # what's building right now
132
149
  The filename is the id. For a title, read the file's frontmatter. To report
133
150
  the whole backlog, cover every state — lifecycle and custom — via
134
151
  `ab ticket states` or by listing every directory under the tracker root, so the
135
- report includes `icebox/` and any other category. `ab ticket list` without
136
- filters shows only the ready state, regardless of custom states, so it is not a
137
- backlog report.
152
+ report includes the backlog and rejected states and any other category. The
153
+ roles column of `ab ticket states` names which states hold `backlog` and
154
+ `rejected`. `ab ticket list` without filters shows only the ready state,
155
+ regardless of other states, so it is not a backlog report.
138
156
 
139
157
  ## Groom / transition a ticket
140
158
 
@@ -163,13 +181,21 @@ another move to `ready/`, subject to the remaining dispatch gates and available
163
181
  capacity. Blocker edits must use the source-agnostic `ab ticket block` and
164
182
  `ab ticket unblock` commands shown above.
165
183
 
184
+ With a free slot the dispatcher claims eligible urgent tickets first, then
185
+ normal ones, each in source order; a blocked urgent ticket waits while normal
186
+ work proceeds, and urgency never stops a running build. To expedite a ticket,
187
+ mark it urgent rather than moving other tickets out of `ready/`.
188
+
166
189
  When the dispatcher claims an eligible file ticket, it moves it to `doing/`,
167
190
  then to `done/` on merge or back to `triage/` if the build aborts or the spec
168
191
  bounces. A caught failure before build creation returns it to configured Ready
169
192
  after safe ownership checks; unfinished recovery stays durably tracked and
170
193
  withheld from another claim. Uncertain ownership or externally changed/missing
171
- tickets end automatic recovery with an `abandoned` resolution, leaving the
172
- ticket unchanged for operator inspection. See [preparation recovery](../ab-guide/references/restacking.md#ticket-preparation-before-build-creation).
194
+ tickets end automatic recovery with an `abandoned` resolution, reported once
195
+ in that tick's dispatcher diagnostics and once as default `ab watch`
196
+ repository attention, leaving the ticket unchanged for operator inspection.
197
+ The resolution records whether the claim was confirmed; an unconfirmed claim's
198
+ provider outcome is unknown, so the ticket may or may not sit in `doing/`. See [preparation recovery](../ab-guide/references/restacking.md#ticket-preparation-before-build-creation).
173
199
 
174
200
  **Don't hand-move anything out of `doing/`** — dispatch preparation or a build owns it. If you need to
175
201
  stop a build, that's `ab` (or a human), not `mv`.
@@ -183,17 +209,42 @@ role for the builds the repository's dispatcher dispatches. Explicit human
183
209
  instructions override these defaults; non-ready filing needs no watch. See
184
210
  [After filing](../ab-spec/SKILL.md#after-filing-check-operator-presence).
185
211
 
186
- ## Icebox
212
+ ## Backlog (icebox)
187
213
 
188
- `icebox/` is work deliberately deferred, groomed or not, that nothing
189
- dispatches from. The first time it is needed, create it:
214
+ The backlog role holds work deliberately deferred, groomed or not, that nothing
215
+ dispatches from. "Ice it", "icebox" and "backlog" all mean this role. Move by
216
+ role, so you never need the repository's native name:
190
217
 
191
218
  ```
192
- ab ticket state create icebox --about "Deferred on purpose; nothing dispatches from here"
219
+ ab ticket move file-3 --role backlog
193
220
  ```
194
221
 
195
- Move a ticket in with `ab ticket move file-3 icebox`. To revive one, move it to
196
- `triage/` when it needs regrooming, or to `ready/` when its spec still holds.
222
+ A source that creates states creates the role state on first use. To revive a
223
+ ticket, use `--role triage` when it needs regrooming, or `--role ready` when its
224
+ spec still holds.
225
+
226
+ ## Rejected
227
+
228
+ The rejected role holds work that was considered and declined. "Reject" and
229
+ "won't do" mean this role:
230
+
231
+ ```
232
+ ab ticket move file-3 --role rejected
233
+ ```
234
+
235
+ A rejected ticket never resolves a blocker: tickets it blocks stay unclaimed,
236
+ and `ab ticket show` marks it `(rejected)`. A rejected child no longer keeps its
237
+ node incomplete. Moving it back to triage, backlog or ready restores ordinary
238
+ behavior with no other step.
239
+
240
+ ## When a role is not configured
241
+
242
+ Both roles are optional. When the repository has not set the key, the move is
243
+ refused with a message naming it (`[tickets].backlogState` or
244
+ `[tickets].rejectedState`). Tell the human, and recommend setting the key to the
245
+ state that should hold that work, for example `backlogState = "backlog"`. Do not
246
+ invent a custom state in its place, and do not move to a state that only shares
247
+ the role's name: without the key, that state holds no role.
197
248
 
198
249
  ## Triage the backlog
199
250
 
@@ -203,8 +254,9 @@ To run a pass over `triage/`:
203
254
  2. For each ticket in `triage/`, read it with `ab ticket show <id>` and judge
204
255
  whether its body meets the
205
256
  [spec standard](../ab-guide/references/spec-standard.md).
206
- 3. Move it to `ready/` if it conforms and should be built; to `icebox/` if it
207
- should wait; to another existing category if one fits; otherwise leave it in
257
+ 3. Move it with `--role ready` if it conforms and should be built,
258
+ `--role backlog` if it should wait, or `--role rejected` if it won't be
259
+ done; to another existing category if one fits; otherwise leave it in
208
260
  `triage/` and tell the user why.
209
261
  4. Report every move to the user in the session — id, title, destination, and
210
262
  reason. A move leaves no comment on the ticket, so the report is the only
@@ -215,12 +267,14 @@ To run a pass over `triage/`:
215
267
  Run `ab ticket states` before creating anything. Reuse an existing state whose
216
268
  purpose fits. Create a new one only for a recurring reason that no existing
217
269
  state covers, with a lowercase hyphenated noun name and a one-line `--about`
218
- purpose. `icebox` is the first worked example; `rejected` is a second:
270
+ purpose:
219
271
 
220
272
  ```
221
- ab ticket state create rejected --about "Considered and declined; kept for the record"
273
+ ab ticket state create needs-design --about "Waiting on a design decision"
222
274
  ```
223
275
 
276
+ Deferred and declined work belong to the backlog and rejected roles, never to an
277
+ invented state; see [When a role is not configured](#when-a-role-is-not-configured).
224
278
  Never invent a second ready, doing, or done state, never move anything out of
225
279
  `doing/`, and never create states for a build's internal progress — the
226
280
  lifecycle belongs to the dispatcher. Remember that `ab ticket list` without
@@ -251,11 +305,28 @@ guidance: state and labels live in Linear. The source-agnostic `ab ticket block`
251
305
  and `ab ticket unblock` commands still edit blocker relationships through the
252
306
  configured source.
253
307
 
308
+ No GitHub lifecycle UI either. When `[tickets] source = "github"`, tickets are
309
+ the repository's issues and ids are issue numbers (`123` or `#123`). State
310
+ lives on GitHub as one `autobuild:<state>` label on an open issue (none means
311
+ triage) and as the closing reason (completed is done, not planned is the
312
+ rejected role). Issue links to other issues are `autobuild-link:<intent> #<n>`
313
+ labels, and blockers are native issue dependencies. Use `ab ticket move` and
314
+ `--issues` rather than editing those labels on GitHub, and never leave two state
315
+ labels on one issue: it drops out of listings until one is removed. A node is
316
+ an issue with the exact `node` label, and a ticket's target is the node whose
317
+ sub-issue it is; another parent is plain grouping and gives no target. Set them
318
+ with `ab ticket create --kind`/`--target` and `ab ticket update --kind`,
319
+ `--target` or `--no-target`; sub-issues and `node` labels changed on GitHub are
320
+ read the same way. `ab ticket state create` makes the `autobuild:<state>` label, with the purpose
321
+ as its description, and refuses an existing name as hosted creation does. GitHub
322
+ tickets carry no comment history, so `ab ticket show` lists none; only
323
+ `ab ticket export` and `import` read it.
324
+
254
325
  ## Hosted ticket states
255
326
 
256
327
  For `[tickets].source = "hosted"`, states are project-owned service data.
257
328
  Run `ab ticket states` before creating a state, and reuse an existing purpose
258
- when it fits. `ab ticket state create icebox --about "Deferred work"` creates
329
+ when it fits. `ab ticket state create needs-design --about "Waiting on design"` creates
259
330
  an empty state with an optional one-line, nonblank purpose. Custom names use
260
331
  one to forty lowercase letters, digits, or hyphens, starting with a letter.
261
332
  Hosted creation refuses an existing name in any letter case and never replaces
@@ -265,9 +336,12 @@ Use `ab ticket create --state <name>`, `ab ticket move <id> <name>`, and
265
336
  `ab ticket list --state <name>` with any existing state. Unknown states are
266
337
  refused with the available names. Configured states are added automatically;
267
338
  former configuration roles remain custom states with their tickets intact.
268
- Listing puts the configured triage, ready, doing, and done roles first, then
269
- other states alphabetically, including empty states and purposes. Configured
270
- names keep their spelling; lookup prefers an exact match, then a unique
339
+ Listing puts role-holding states first in workflow order (triage, backlog,
340
+ ready, claimed, done, rejected), then other states, including empty states and
341
+ purposes. Move by role with `ab ticket move <id> --role backlog|rejected|triage|ready`
342
+ exactly as for the file source; MCP `tickets.move` takes the same roles. A role
343
+ mapped onto an existing state, such as `backlogState = "icebox"`, keeps that
344
+ state and its tickets. Configured names keep their spelling; lookup prefers an exact match, then a unique
271
345
  case-insensitive match. States belong to one project.
272
346
 
273
347
  The directory `ls` and `mv` instructions above apply only to the file source.
@@ -281,19 +355,24 @@ Every ticket read includes an opaque `revision`. Pass it as `expectedRevision`
281
355
  `move`, `block` and `unblock`. A stale write fails without changing anything and
282
356
  reports the current revision. Omission preserves unguarded behavior. Blocker
283
357
  checks cover the entire batch. Dispatcher moves remain unguarded and change the
284
- revision. Sources without guarded writes, including Linear, refuse supplied
285
- revisions rather than ignoring them.
358
+ revision. Sources without guarded writes, including Linear and GitHub, refuse
359
+ supplied revisions rather than ignoring them.
286
360
 
287
361
  `ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
288
362
  frontmatter and a Markdown body. Only title, body and labels are editable;
289
- kind, target, id, blockers, creation key and reference comments are read-only. It saves only
290
- changed fields with the opening revision. Unchanged or formatting-only edits
363
+ kind, target, id, blockers, issue links, priority, creation key and reference comments are read-only. It saves only
364
+ changed fields with the opening revision. Sources without guarded writes,
365
+ including Linear and GitHub, re-read the ticket immediately before an
366
+ unguarded write and refuse a changed revision, with the no-lock race window of file checks. Unchanged or formatting-only edits
291
367
  write nothing. On conflict, invalid input or editor failure, the error names an
292
368
  absolute file path containing the edited text. Read the current ticket and
293
369
  reapply the intended changes before retrying; conflicts are never merged.
294
370
 
295
- File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets
296
- and state; reverting identical content restores its fingerprint. File checks
371
+ File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
372
+ state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
373
+ fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
374
+ including the ticket's own issue; GitHub tickets carry no comments. Reverting
375
+ identical content restores its fingerprint. File checks
297
376
  re-read immediately before writing, with the existing no-lock race window.
298
377
  Direct file edits and state-directory moves change revisions. File comments
299
378
  change the body and revision; separate hosted comments do not. Hosted revisions
@@ -37,3 +37,8 @@ harvestThreshold = 5
37
37
  [tickets]
38
38
  source = "file"
39
39
  readyState = "ready"
40
+ # Optional, recommended lifecycle roles: deferred and declined work.
41
+ # Keep both for source = "file", "hosted" or "github"; a Linear team maps them
42
+ # to its own workflow names instead. Remove either to go without that role.
43
+ backlogState = "backlog"
44
+ rejectedState = "rejected"
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.4.2",
8
- "@defrex/autobuild": "1.4.2",
7
+ "@defrex/autobuild-hosted-store-service": "1.6.0",
8
+ "@defrex/autobuild": "1.6.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"