@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
@@ -40,11 +40,12 @@ not author proposals or touch tickets.
40
40
  ```sh
41
41
  ab harvest verdict approve --notes .ab/harvest-review.md
42
42
  ab harvest verdict revise --notes .ab/harvest-review.md --findings .ab/findings.json
43
- ab harvest verdict escalate --notes .ab/harvest-review.md --reason "the human question"
43
+ ab harvest verdict escalate --notes .ab/harvest-review.md --reason "the question"
44
44
  ```
45
45
 
46
- Use `escalate` only when evidence or product intent requires human judgment,
47
- not as a substitute for a precise revision finding.
46
+ Use `escalate` only when evidence or product intent requires external judgment
47
+ from the operator agent or a human, not as a substitute for a precise revision
48
+ finding.
48
49
 
49
50
  ## Writing findings
50
51
 
@@ -72,6 +72,13 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
72
72
  terminal command besides `ab escalate`. If it reports a validation error,
73
73
  fix what it names and run it again.
74
74
 
75
+ An empty contribution is refused: when HEAD has no commits over the
76
+ recorded contribution base, `ab done` publishes nothing and instead records
77
+ an implement escalation naming both SHAs. That escalation is this session's
78
+ terminal; stop and run no further terminal. Commit intended changes before
79
+ running `ab done`. If you conclude the spec needs no code change, that is a
80
+ question for the operator: run `ab escalate` with the reason instead.
81
+
75
82
  ## Ground rules for this phase
76
83
 
77
84
  - **The spec bounds your work.** When you spot something outside its scope —
@@ -84,11 +91,23 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
84
91
  ab observe --kind followup "…"
85
92
  ```
86
93
 
94
+ - **Downgrade a linked issue you only partly resolve.** When the manifest
95
+ lists `issueLinks` and the spec leaves part of a `closes` issue undone, record
96
+ it so the PR (or, for a child of a node, the root node's PR) writes `Refs #N`
97
+ instead of `Closes #N`:
98
+
99
+ ```
100
+ ab issue downgrade 824 --reason "<what remains>"
101
+ ```
102
+
103
+ The reason shows in `ab build status`. Downgrades are one-way, and they are
104
+ refused once finalize seals the links.
105
+
87
106
  - **Handle feedback before anything else.** A round with feedback carries
88
107
  exactly one kind, named by `$AB_CONTEXT_DIR/context.json`'s `feedback` field:
89
108
  `findings` → resolve every finding in `$AB_CONTEXT_DIR/findings.json`; findings you
90
109
  dodge come back marked as persisting, and a chain that stays persistent
91
- goes to a human. `verify` → address every failed report listed in the manifest's
110
+ escalates for external judgment. `verify` → address every failed report listed in the manifest's
92
111
  `verifyReports` (or the historical single report) under `$AB_CONTEXT_DIR/verify/`.
93
112
  `cancelledVerify` lists unfinished steps as not run with their fail-fast cause;
94
113
  cancellation is never a pass. A stage receipt can remain available alongside
@@ -11,7 +11,9 @@ work to merge. Any external agent can take the role through the CLI or MCP.
11
11
  Filing sessions check presence before taking the role; with a live operator,
12
12
  they leave operating context in the ticket and stop. Explicit human instructions
13
13
  always override that default. Presence is advisory, permits concurrent operators,
14
- and grants no exclusive authority. MCP presence registration is deferred.
14
+ and grants no exclusive authority. MCP presence registration is deferred, and MCP
15
+ `repository.status` reports `operator.presence: "unavailable"`, which never means
16
+ no operator is present.
15
17
 
16
18
  The operator agent is not a build phase: it never runs pipeline steps, never
17
19
  edits the repository, and never touches a build's checkout. Its reach is the
@@ -81,7 +83,9 @@ the same resolved working directory.
81
83
 
82
84
  ### Check presence before registering
83
85
 
84
- Run `ab repository status --json` and inspect `operator.registrations`. If another
86
+ Run `ab repository status --json` and inspect `operator.registrations`, which the
87
+ CLI loads (`operator.presence: "loaded"`); only a loaded empty list means no live
88
+ operator. If another
85
89
  live operator is present, tell the human and do not become a second operator
86
90
  unless directed. Otherwise arm a repository-wide `ab watch --operator --json`.
87
91
  A flagged watch writes only mutable liveness, never events or a lease.
@@ -162,22 +166,33 @@ satisfied only by new events. Conditions include `attention`,
162
166
  condition, 3 timeout, 4 interrupted. On 3 and 4 with `--json`, the output is a
163
167
  bare `{"cursor": …}` to resume from.
164
168
 
165
- An unbounded watch streams: it prints each record and keeps running, so it
166
- does not exit when a build blocks. Match how you run it to how your harness
167
- wakes you:
168
-
169
- - **Woken on each new output line** (a monitor that streams stdout, such as
170
- Claude Code's Monitor tool): run the standing watch unbounded there and act
171
- on every line as it arrives.
172
- - **Woken only when a command exits** (a background shell such as Claude
173
- Code's background Bash, or a plain blocking call): never run an unbounded
174
- watch this way, because its records sit unread until it exits. Add
175
- `--count 1` so the watch exits on its first record:
169
+ A watch without `--count` streams: it prints each record the moment the
170
+ attention arises and keeps running, so it does not exit when a build blocks.
171
+ Reacting to events means reading that output as it is written, not when the
172
+ command exits. Run it accordingly:
173
+
174
+ - **The harness offers a line-streaming monitor** (one that delivers each
175
+ stdout line as it arrives, such as Claude Code's Monitor tool): the standing
176
+ watch must run there, acting on every line as it arrives. Running it under
177
+ an exit-only facility instead, such as Claude Code's background Bash or a
178
+ blocking call, is wrong whenever such a monitor is available, even with
179
+ `--count 1`.
180
+ - **The monitor kills its command at a hard deadline** (Claude Code's Monitor
181
+ allows at most 30 minutes): pass `--timeout` shorter than that deadline, for
182
+ example `ab watch --operator --json --timeout 29m [--since <watch-cursor>]`
183
+ under a 30-minute Monitor. The watch's own 30-minute default would race the
184
+ kill. A killed watch never prints its trailing `{"cursor": …}` line; a
185
+ timed-out one does, so re-arm at once with `--since <watch-cursor>` from it.
186
+ - **Fallback: the harness has no line-streaming monitor at all** (for example
187
+ Codex, Pi, or a plain shell, which wake you only when a command exits):
188
+ never run the watch without `--count` there, because its records sit unread
189
+ until it exits. Add `--count 1` so the watch exits on its first record:
176
190
  `ab watch --operator --json --count 1 [--since <watch-cursor>]`. Act on the
177
191
  record, then re-arm at once from the trailing cursor line. Presence survives
178
192
  the re-arm gap.
179
193
 
180
- `ab wait` exits on its first match, so it suits either kind. Use precisely the
194
+ `ab wait` exits on its first match, so it suits either kind of facility for
195
+ one-off waits. Use precisely the
181
196
  same resolved invocation and working directory as foreground commands,
182
197
  including inside background shells and harness monitors. Do not rely on a
183
198
  shell alias or function that those facilities may lose. Never block a
@@ -229,8 +244,10 @@ Neither a loss observation nor a later retry authorizes dispatcher intervention.
229
244
  Operate the builds the repository's dispatcher dispatches, including new builds
230
245
  that appear after you arm. Finishing the initially queued set is no reason to stop.
231
246
 
232
- 1. Check presence as above, then arm `ab watch --operator --json` with no slugs,
233
- adding `--count 1` if your harness wakes you only on exit. Retain its own
247
+ 1. Check presence as above, then arm `ab watch --operator --json` with no slugs
248
+ under your harness's line-streaming monitor, with `--timeout` below that
249
+ monitor's kill deadline (see *Watch for attention events*); add `--count 1`
250
+ only in the no-monitor fallback. Retain its own
234
251
  cursor and re-arm with
235
252
  `ab watch --operator --json --since <watch-cursor>`. If it reports
236
253
  `cursor-too-old`, re-arm without `--since`, reconcile status and acknowledge
@@ -248,7 +265,8 @@ that appear after you arm. Finishing the initially queued set is no reason to st
248
265
 
249
266
  Use `ab wait` and named unflagged watches only as separate diagnostics. They
250
267
  cannot replace the registered monitor or its cursor. In MCP, use the existing
251
- registry monitoring tools; operator presence is not exposed there.
268
+ registry monitoring tools; operator presence is not exposed there, and its
269
+ `repository.status` marks presence `unavailable` rather than absent.
252
270
 
253
271
  ### Inspect
254
272
 
@@ -257,8 +275,9 @@ registry monitoring tools; operator presence is not exposed there.
257
275
  attaches with runtime identity, and recent events. Historical runtime is null
258
276
  in JSON and unrecorded in human output.
259
277
  - `ab repository status` — the repository's derived status, including the lease
260
- holder’s recorded runtime version, commit, and source kind/location. Historical
261
- runtime is null in JSON and unrecorded in human output.
278
+ holder’s recorded runtime version, commit, and source kind/location, and the
279
+ latest scan's queue diagnostics and startup warnings. Historical runtime is
280
+ null in JSON and unrecorded in human output.
262
281
  - `ab artifact` — fetch one artifact's bytes.
263
282
 
264
283
  Read events with a cursor or a small `--events` count; logs are long.
@@ -288,7 +307,9 @@ Read events with a cursor or a small `--events` count; logs are long.
288
307
  Read the matched policy, readiness, acknowledged command and gate deferral in
289
308
  build status before acting. Work the consent queue by checking completeness
290
309
  and current verification, then issuing merge for the chosen merge. A merge
291
- acknowledgement accepts consent; it never promises that gates passed.
310
+ acknowledgement accepts consent; it never promises that gates passed. A
311
+ `merge-not-ready` or `node-incomplete` refusal records nothing; re-read
312
+ status and act on the stated reason.
292
313
  - Configure ordered `[[merge]]` rules for project policy through ab-guide.
293
314
  Repository auto-merge defaults and per-build auto-merge toggles are retired.
294
315
 
@@ -300,10 +321,28 @@ explicitly choose root or a node, evaluate the repository's effective merge
300
321
  policy, and explain the merge flow to the human. Ask when intent is unclear.
301
322
 
302
323
  `ab ticket create|update|block|unblock|list|show|move|states` file, edit, and
303
- move tickets; the `ab-tickets` skill covers the tracker's details. Moving a
324
+ move tickets; the `ab-tickets` skill covers the tracker's details. A ticket
325
+ filed from a forge issue carries it with `--issues N` (`closes`), or
326
+ `--issues N:refs` when the work only partly addresses it. Moving a
304
327
  ticket into the ready state sends it to dispatch — do that only when the
305
328
  ticket genuinely conforms and the human's intent is clear.
306
329
 
330
+ The dispatcher claims urgent ready tickets before normal ones, each in source
331
+ order. To expedite a ticket, such as a fix for a stuck build, mark it urgent
332
+ with `--priority urgent` on create or update; never move other ready tickets
333
+ out of ready to make room. Urgency never preempts a running build, and a blocked
334
+ urgent ticket still waits on its blockers. A source that cannot store priority
335
+ refuses `urgent` and names itself; tell the human.
336
+
337
+ Move tickets by lifecycle role rather than by native state name:
338
+ `ab ticket move <id> --role triage|ready|backlog|rejected`. "Ice it",
339
+ "icebox" and "backlog" mean `--role backlog` (deferred work); "reject" and
340
+ "won't do" mean `--role rejected` (declined work, which never unblocks its
341
+ dependents and no longer holds a node open). Both roles are optional: when the
342
+ move is refused naming `[tickets].backlogState` or `rejectedState`, tell the
343
+ human and recommend setting that key rather than inventing a custom state.
344
+ "Building" is the claimed role the dispatcher sets on claim, not a move target.
345
+
307
346
  ### What the CLI does not offer
308
347
 
309
348
  The registry has operator notes, harvest control, and `discard`, which have no
@@ -344,7 +383,8 @@ Your tools are the operator registry. The read-only ones are always safe:
344
383
  - `builds.events` — one build's event log from a cursor (use a cursor; logs
345
384
  are long).
346
385
  - `builds.artifact` — one artifact's bytes, base64-encoded.
347
- - `repository.status` — the repository's derived status.
386
+ - `repository.status` — the repository's derived status. Its `operator.presence`
387
+ is `unavailable`: it does not load presence, so it is not evidence of absence.
348
388
  - `harvest.status` — the observation workflow's current state.
349
389
 
350
390
  The mutating ones carry the human's authority — prefer the narrowest
@@ -360,10 +400,19 @@ that does the job, and say what you are doing before you do it:
360
400
  resumes under the revised spec and its publication is confirmed.
361
401
  - `tickets.list`, `tickets.get` — read the ticket queue and one ticket. A long
362
402
  queue pages with `limit`, `offset` and `order`; `total` counts every match.
363
- - `tickets.create` — file a new ticket from a conversation.
403
+ - `tickets.create` — file a new ticket from a conversation. A ticket filed
404
+ from a forge issue carries it in `issueLinks` as `{issue}` (intent `closes`,
405
+ the default) or `{issue, intent: "refs"}` when the work only partly
406
+ addresses it. `priority: "urgent"` dispatches it before normal ready work.
364
407
  - `tickets.update`, `tickets.block`, `tickets.unblock` — edit fields and
365
- blocker relations.
366
- - `tickets.move` — move a ticket between workflow states. Moving a ticket
408
+ blocker relations. `issueLinks` on update replaces the whole set;
409
+ `priority` (`urgent` or `normal`) expedites a ticket instead of moving other
410
+ ready tickets aside, and a source that cannot store it refuses `urgent` with
411
+ `code: "priority-unsupported"`.
412
+ - `tickets.move` — move a ticket between workflow states, by native `state`
413
+ or by lifecycle `role` (`triage`, `ready`, `backlog`, `rejected`; give
414
+ exactly one). Use `role` for deferring and declining work, with the same
415
+ phrases and unconfigured-role handling as the CLI. Moving a ticket
367
416
  into the ready state sends it to dispatch — do that only when the ticket
368
417
  genuinely conforms and the human's intent is clear.
369
418
  - `notes.read`, `notes.write` — the operator-notes artifact: durable,
@@ -401,7 +450,10 @@ Treat every default-watch record as a call to act:
401
450
  and reason, including a rejected protocol-write preflight. The running generation stays active; the same failed input is
402
451
  suppressed until target or selected-store compatibility evidence changes or a fresh operator launch. Report
403
452
  launcher-contract changes or disabled automatic upgrades as manual restart
404
- needs. Agents still never manage the process.
453
+ needs. Agents still never manage the process. Status shows a failure as
454
+ current only until a later different resolved target, a later successful
455
+ preparation or handoff, or a later generation supersedes it; a failure marked
456
+ `(superseded)` needs no action.
405
457
  - Automatic runtime rollback: repository status names the failed and restored
406
458
  runtimes and effective hold. Three failed exits within ten minutes of takeover
407
459
  restore one previous cached runtime; preflight failures do not count. The failed
@@ -447,6 +499,10 @@ Stop and ask the human — in plain streamed text — whenever:
447
499
  - You would be guessing about product direction, priorities, or scope.
448
500
  - A tool refusal repeats and you cannot resolve it with the tools you have.
449
501
  - The attention event is one you cannot act on with the tools you have at all.
502
+ - A queue diagnostic says a target node is being built by another store, or a
503
+ startup warning says cross-store branch protection is unavailable. Don't
504
+ retarget or reclaim; tell the human the repository's dispatchers should
505
+ share one store (`ab connect`).
450
506
 
451
507
  Filing a ticket is acting — do it when the request is concrete. Default to
452
508
  resolving attention yourself within these boundaries; ask the human only
@@ -514,7 +570,8 @@ Select a queue build in the terminal and use `l merge` or `o hold`, or run
514
570
  `ab merge <slug>` / `ab hold <slug>`. MCP uses `builds.control` with action `merge`
515
571
  or `hold`. Hold is available before readiness and suppresses automatic merge.
516
572
  Merge rechecks readiness and live node completeness, so act on failures by
517
- refreshing the facts. Open children keep a node collecting. When integration
573
+ refreshing the facts. Open children keep a node collecting; a child moved to
574
+ the rejected role no longer does. When integration
518
575
  verification fails, file a repair child targeting that node and let it merge
519
576
  before retrying the node cycle.
520
577
 
@@ -571,12 +628,30 @@ Classified rate limits retain repository cooldown and consume no publication
571
628
  retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
572
629
  errors retain their existing behavior.
573
630
 
631
+ When the forge refuses a dispatcher-side finalize PR create with a
632
+ non-transient, non-rate-limit answer, such as a 4xx validation error or
633
+ GitHub's "No commits between" 422, the build raises one `finalize` escalation
634
+ (`policy`, `non-retryable-phase-failure`) whose question quotes the forge, the
635
+ HTTP status and its message. It consumes no `maxInfrastructureAttempts` and
636
+ needs no provider cleanup, and the dispatcher makes no further attempt while it
637
+ is open. Compare the branch with its base first. A bare retry re-attempts the
638
+ PR create once, a repeat refusal raises a new escalation, and abort ends the
639
+ build. An implement round with no commits over its base escalates at
640
+ `implement` instead; answer it with guidance, a spec revision, or abort.
641
+
574
642
  Janitor failures are durable per-build episodes. Eligible failures retry after
575
643
  30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
576
- Skipped polls preserve the episode across restart. After
644
+ A classified forge rate limit is repository cooldown, not a janitor failure:
645
+ neither the first limited response nor the cooldown that follows starts or ages
646
+ an episode. Skipped polls preserve the episode across restart. After
577
647
  `policy.janitorFailureAttentionSeconds` (600 by default), `build.janitor-failing`
578
648
  notifies default watchers and appears on the build row. A successful attempt
579
649
  clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
650
+ A dispatcher that cannot execute Git for kernel node work (a missing or
651
+ unloadable `git` for the bare clone) records no janitor failures. It records
652
+ one durable `dispatcher.kernel-git-unavailable` repository condition, node work
653
+ waits, and `dispatcher.kernel-git-recovered` closes the condition once a clone
654
+ succeeds.
580
655
 
581
656
  A classified forge rate limit records repository degradation with `resetAt`.
582
657
  Forge work waits during cooldown; passing the deadline permits a recovery
@@ -169,7 +169,7 @@ On any round that proceeds rather than escalates, deposit a fresh
169
169
  ## If the spec is the problem
170
170
 
171
171
  If the spec is contradictory, unbuildable, or wrong — do not plan around it.
172
- Park the build for a human:
172
+ Park the build for external judgment from the operator agent or a human:
173
173
 
174
174
  ```
175
175
  ab escalate "…the question, concretely…" --refs "$AB_CONTEXT_DIR/spec.md"
@@ -97,10 +97,11 @@ that the spec does not settle. Do not guess away either side's behavior:
97
97
  ab escalate "The target changes the session-token format but the build keys its limiter on the old format. Which behavior should the limiter adopt?" --refs src/auth.ts
98
98
  ```
99
99
 
100
- A human answer in guidance is authoritative while the spec remains the contract.
101
- If they cannot both be satisfied, escalate the contradiction. Reconcile has no
102
- code-review round; risky resolutions need human judgment. The only successful
103
- terminal commands are `ab done` and `ab escalate`.
100
+ An operator answer in guidance is authoritative while the spec remains the
101
+ contract. If they cannot both be satisfied, escalate the contradiction.
102
+ Reconcile has no code-review round; escalate risky resolutions for external
103
+ judgment. The only successful terminal commands are `ab done` and
104
+ `ab escalate`.
104
105
 
105
106
  Read the manifest path printed by `ab context`. Its `materialized` keys are
106
107
  relative to `contextDir`: join them to locate collision-adjusted inputs.
@@ -111,10 +111,23 @@ from the ticket. If grooming named no destination, omit `--state`; the create
111
111
  then uses `[tickets].createState`, or the ticket source's own default when that
112
112
  setting is absent.
113
113
 
114
+ When the work originates from a forge issue, attach it at creation and still
115
+ cite it in Evidence: `--issues 824` when the ticket fully resolves the issue
116
+ (intent `closes`, the default), or `--issues 824:refs` when it only partly
117
+ addresses it. Separate several with commas. A source that cannot store issue
118
+ links refuses the create and names itself; file again without `--issues` and
119
+ keep the Evidence citation.
120
+
121
+ When grooming established that the ticket must go next — for example a fix
122
+ that unblocks a stuck build — create it with `--priority urgent` so the
123
+ dispatcher claims it before normal ready work. Otherwise omit the flag; normal
124
+ is the default. A source that cannot store priority refuses the create and
125
+ names itself; file it normal and tell the human so the operator can expedite it.
126
+
114
127
  When the explicitly named destination equals `[tickets].readyState`, tell the
115
128
  human in the completion response that the ticket may be claimed by the next
116
129
  dispatch once the repository's label, dependency, intake, capacity, and other
117
- readiness gates are satisfied. Before ready filing, follow
130
+ readiness gates are satisfied, after any urgent ready tickets. Before ready filing, follow
118
131
  [After filing: check operator presence](#after-filing-check-operator-presence):
119
132
  with a live operator, say the existing operator will pick it up; without one,
120
133
  say you will operate it. The human's explicit instructions override either default.
@@ -122,7 +135,7 @@ say you will operate it. The human's explicit instructions override either defau
122
135
  If grooming established prerequisites, follow the complete
123
136
  [safe blocker-filing workflow](../ab-guide/references/ticket-dependencies.md).
124
137
  A single `ab ticket create --blocked-by` invocation does not publish atomically:
125
- Linear exposes the issue before separate blocker writes.
138
+ Linear and GitHub expose the issue before separate blocker writes.
126
139
  For a ready destination, create in a known non-ready staging state, pass all
127
140
  blockers at creation, read back and verify them, then move to ready last. The
128
141
  human's requested final placement still wins; temporary staging needs no new