@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
@@ -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,19 @@ 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, leaving the ticket unchanged for
196
+ operator inspection. See [preparation recovery](../ab-guide/references/restacking.md#ticket-preparation-before-build-creation).
173
197
 
174
198
  **Don't hand-move anything out of `doing/`** — dispatch preparation or a build owns it. If you need to
175
199
  stop a build, that's `ab` (or a human), not `mv`.
@@ -183,17 +207,42 @@ role for the builds the repository's dispatcher dispatches. Explicit human
183
207
  instructions override these defaults; non-ready filing needs no watch. See
184
208
  [After filing](../ab-spec/SKILL.md#after-filing-check-operator-presence).
185
209
 
186
- ## Icebox
210
+ ## Backlog (icebox)
187
211
 
188
- `icebox/` is work deliberately deferred, groomed or not, that nothing
189
- dispatches from. The first time it is needed, create it:
212
+ The backlog role holds work deliberately deferred, groomed or not, that nothing
213
+ dispatches from. "Ice it", "icebox" and "backlog" all mean this role. Move by
214
+ role, so you never need the repository's native name:
190
215
 
191
216
  ```
192
- ab ticket state create icebox --about "Deferred on purpose; nothing dispatches from here"
217
+ ab ticket move file-3 --role backlog
193
218
  ```
194
219
 
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.
220
+ A source that creates states creates the role state on first use. To revive a
221
+ ticket, use `--role triage` when it needs regrooming, or `--role ready` when its
222
+ spec still holds.
223
+
224
+ ## Rejected
225
+
226
+ The rejected role holds work that was considered and declined. "Reject" and
227
+ "won't do" mean this role:
228
+
229
+ ```
230
+ ab ticket move file-3 --role rejected
231
+ ```
232
+
233
+ A rejected ticket never resolves a blocker: tickets it blocks stay unclaimed,
234
+ and `ab ticket show` marks it `(rejected)`. A rejected child no longer keeps its
235
+ node incomplete. Moving it back to triage, backlog or ready restores ordinary
236
+ behavior with no other step.
237
+
238
+ ## When a role is not configured
239
+
240
+ Both roles are optional. When the repository has not set the key, the move is
241
+ refused with a message naming it (`[tickets].backlogState` or
242
+ `[tickets].rejectedState`). Tell the human, and recommend setting the key to the
243
+ state that should hold that work, for example `backlogState = "backlog"`. Do not
244
+ invent a custom state in its place, and do not move to a state that only shares
245
+ the role's name: without the key, that state holds no role.
197
246
 
198
247
  ## Triage the backlog
199
248
 
@@ -203,8 +252,9 @@ To run a pass over `triage/`:
203
252
  2. For each ticket in `triage/`, read it with `ab ticket show <id>` and judge
204
253
  whether its body meets the
205
254
  [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
255
+ 3. Move it with `--role ready` if it conforms and should be built,
256
+ `--role backlog` if it should wait, or `--role rejected` if it won't be
257
+ done; to another existing category if one fits; otherwise leave it in
208
258
  `triage/` and tell the user why.
209
259
  4. Report every move to the user in the session — id, title, destination, and
210
260
  reason. A move leaves no comment on the ticket, so the report is the only
@@ -215,12 +265,14 @@ To run a pass over `triage/`:
215
265
  Run `ab ticket states` before creating anything. Reuse an existing state whose
216
266
  purpose fits. Create a new one only for a recurring reason that no existing
217
267
  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:
268
+ purpose:
219
269
 
220
270
  ```
221
- ab ticket state create rejected --about "Considered and declined; kept for the record"
271
+ ab ticket state create needs-design --about "Waiting on a design decision"
222
272
  ```
223
273
 
274
+ Deferred and declined work belong to the backlog and rejected roles, never to an
275
+ invented state; see [When a role is not configured](#when-a-role-is-not-configured).
224
276
  Never invent a second ready, doing, or done state, never move anything out of
225
277
  `doing/`, and never create states for a build's internal progress — the
226
278
  lifecycle belongs to the dispatcher. Remember that `ab ticket list` without
@@ -251,11 +303,28 @@ guidance: state and labels live in Linear. The source-agnostic `ab ticket block`
251
303
  and `ab ticket unblock` commands still edit blocker relationships through the
252
304
  configured source.
253
305
 
306
+ No GitHub lifecycle UI either. When `[tickets] source = "github"`, tickets are
307
+ the repository's issues and ids are issue numbers (`123` or `#123`). State
308
+ lives on GitHub as one `autobuild:<state>` label on an open issue (none means
309
+ triage) and as the closing reason (completed is done, not planned is the
310
+ rejected role). Issue links to other issues are `autobuild-link:<intent> #<n>`
311
+ labels, and blockers are native issue dependencies. Use `ab ticket move` and
312
+ `--issues` rather than editing those labels on GitHub, and never leave two state
313
+ labels on one issue: it drops out of listings until one is removed. A node is
314
+ an issue with the exact `node` label, and a ticket's target is the node whose
315
+ sub-issue it is; another parent is plain grouping and gives no target. Set them
316
+ with `ab ticket create --kind`/`--target` and `ab ticket update --kind`,
317
+ `--target` or `--no-target`; sub-issues and `node` labels changed on GitHub are
318
+ read the same way. `ab ticket state create` makes the `autobuild:<state>` label, with the purpose
319
+ as its description, and refuses an existing name as hosted creation does. GitHub
320
+ tickets carry no comment history, so `ab ticket show` lists none; only
321
+ `ab ticket export` and `import` read it.
322
+
254
323
  ## Hosted ticket states
255
324
 
256
325
  For `[tickets].source = "hosted"`, states are project-owned service data.
257
326
  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
327
+ when it fits. `ab ticket state create needs-design --about "Waiting on design"` creates
259
328
  an empty state with an optional one-line, nonblank purpose. Custom names use
260
329
  one to forty lowercase letters, digits, or hyphens, starting with a letter.
261
330
  Hosted creation refuses an existing name in any letter case and never replaces
@@ -265,9 +334,12 @@ Use `ab ticket create --state <name>`, `ab ticket move <id> <name>`, and
265
334
  `ab ticket list --state <name>` with any existing state. Unknown states are
266
335
  refused with the available names. Configured states are added automatically;
267
336
  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
337
+ Listing puts role-holding states first in workflow order (triage, backlog,
338
+ ready, claimed, done, rejected), then other states, including empty states and
339
+ purposes. Move by role with `ab ticket move <id> --role backlog|rejected|triage|ready`
340
+ exactly as for the file source; MCP `tickets.move` takes the same roles. A role
341
+ mapped onto an existing state, such as `backlogState = "icebox"`, keeps that
342
+ state and its tickets. Configured names keep their spelling; lookup prefers an exact match, then a unique
271
343
  case-insensitive match. States belong to one project.
272
344
 
273
345
  The directory `ls` and `mv` instructions above apply only to the file source.
@@ -281,19 +353,24 @@ Every ticket read includes an opaque `revision`. Pass it as `expectedRevision`
281
353
  `move`, `block` and `unblock`. A stale write fails without changing anything and
282
354
  reports the current revision. Omission preserves unguarded behavior. Blocker
283
355
  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.
356
+ revision. Sources without guarded writes, including Linear and GitHub, refuse
357
+ supplied revisions rather than ignoring them.
286
358
 
287
359
  `ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
288
360
  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
361
+ kind, target, id, blockers, issue links, priority, creation key and reference comments are read-only. It saves only
362
+ changed fields with the opening revision. Sources without guarded writes,
363
+ including Linear and GitHub, re-read the ticket immediately before an
364
+ unguarded write and refuse a changed revision, with the no-lock race window of file checks. Unchanged or formatting-only edits
291
365
  write nothing. On conflict, invalid input or editor failure, the error names an
292
366
  absolute file path containing the edited text. Read the current ticket and
293
367
  reapply the intended changes before retrying; conflicts are never merged.
294
368
 
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
369
+ File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
370
+ state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
371
+ fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
372
+ including the ticket's own issue; GitHub tickets carry no comments. Reverting
373
+ identical content restores its fingerprint. File checks
297
374
  re-read immediately before writing, with the existing no-lock race window.
298
375
  Direct file edits and state-directory moves change revisions. File comments
299
376
  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.1",
8
- "@defrex/autobuild": "1.4.1",
7
+ "@defrex/autobuild-hosted-store-service": "1.5.0",
8
+ "@defrex/autobuild": "1.5.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"