@defrex/autobuild 1.0.1 → 1.1.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 (186) hide show
  1. package/README.md +6 -6
  2. package/SPEC.md +360 -229
  3. package/docs/answering-blocked-builds.md +2 -2
  4. package/docs/architecture.md +155 -45
  5. package/docs/assets/headline-wide.png +0 -0
  6. package/docs/builds.md +4 -4
  7. package/docs/cli.md +4 -4
  8. package/docs/configuration-overview.md +4 -4
  9. package/docs/configuration.md +245 -210
  10. package/docs/dispatcher-hosting.md +2 -2
  11. package/docs/dispatcher.md +1 -1
  12. package/docs/forges.md +5 -5
  13. package/docs/getting-started.md +2 -2
  14. package/docs/glossary.md +6 -6
  15. package/docs/hosted-dispatcher.md +6 -3
  16. package/docs/hosted-service.md +16 -5
  17. package/docs/integration-overview.md +15 -15
  18. package/docs/integration-tree.md +45 -38
  19. package/docs/integration.md +6 -6
  20. package/docs/mcp.md +16 -15
  21. package/docs/{landing-policy.md → merge-policy.md} +42 -24
  22. package/docs/migration-1.0.md +17 -13
  23. package/docs/operating.md +41 -18
  24. package/docs/operator-api.md +91 -15
  25. package/docs/operator-surfaces.md +8 -4
  26. package/docs/overview.md +3 -3
  27. package/docs/remote-store-protocol.md +76 -11
  28. package/docs/remote-ticket-protocol.md +1 -1
  29. package/docs/restacking.md +54 -15
  30. package/docs/setup.md +41 -6
  31. package/docs/skills.md +1 -1
  32. package/docs/spec-standard.md +6 -6
  33. package/docs/ticket-dependencies.md +7 -7
  34. package/docs/tickets.md +8 -2
  35. package/docs/troubleshooting.md +2 -2
  36. package/docs/upgrading.md +8 -3
  37. package/docs/verification.md +60 -14
  38. package/package.json +7 -5
  39. package/packages/core/src/cli/binary-direct.ts +13 -1
  40. package/packages/core/src/cli/binary-lifecycle.ts +65 -2
  41. package/packages/core/src/cli/build-control.ts +83 -28
  42. package/packages/core/src/cli/context.ts +81 -38
  43. package/packages/core/src/cli/dashboard/facts.ts +2 -1
  44. package/packages/core/src/cli/dashboard/integration-detail.ts +8 -8
  45. package/packages/core/src/cli/dashboard/integration-row.ts +40 -13
  46. package/packages/core/src/cli/dashboard/landing-display.ts +25 -0
  47. package/packages/core/src/cli/dashboard/model.ts +56 -33
  48. package/packages/core/src/cli/dashboard/poll.ts +9 -3
  49. package/packages/core/src/cli/dashboard/render.ts +59 -37
  50. package/packages/core/src/cli/dashboard/target-distance.ts +14 -0
  51. package/packages/core/src/cli/dashboard/tree.ts +3 -2
  52. package/packages/core/src/cli/dispatch-args.ts +1 -1
  53. package/packages/core/src/cli/dispatch-frontend.ts +6 -3
  54. package/packages/core/src/cli/dispatch.ts +35 -9
  55. package/packages/core/src/cli/env.ts +4 -0
  56. package/packages/core/src/cli/help.ts +30 -23
  57. package/packages/core/src/cli/main.ts +24 -8
  58. package/packages/core/src/cli/node-verification-provenance.ts +1 -97
  59. package/packages/core/src/cli/publication-settlement.ts +43 -20
  60. package/packages/core/src/cli/repository-status.ts +20 -9
  61. package/packages/core/src/cli/status.ts +42 -5
  62. package/packages/core/src/cli/store-opening.ts +6 -1
  63. package/packages/core/src/cli/terminal.ts +22 -1
  64. package/packages/core/src/cli/terminals.ts +14 -10
  65. package/packages/core/src/cli/upgrade-landing.ts +70 -30
  66. package/packages/core/src/cli/upgrade.ts +3 -1
  67. package/packages/core/src/cli/wait.ts +15 -7
  68. package/packages/core/src/cli/watch-lifetime.ts +111 -0
  69. package/packages/core/src/cli/watch.ts +634 -511
  70. package/packages/core/src/config/effective-artifact.fixture.ts +27 -0
  71. package/packages/core/src/config/effective-artifact.ts +13 -0
  72. package/packages/core/src/config/landing.ts +1 -1
  73. package/packages/core/src/config/load.ts +21 -1
  74. package/packages/core/src/config/pipeline-source.ts +28 -0
  75. package/packages/core/src/config/reference-metadata.ts +2 -0
  76. package/packages/core/src/config/reference.ts +22 -7
  77. package/packages/core/src/config/schema.ts +86 -162
  78. package/packages/core/src/context-directory.ts +26 -0
  79. package/packages/core/src/distribution-packaging.ts +26 -5
  80. package/packages/core/src/events/catalog.ts +10 -2
  81. package/packages/core/src/events/globs.ts +1 -1
  82. package/packages/core/src/events/payloads.ts +70 -1
  83. package/packages/core/src/events/policy.ts +7 -0
  84. package/packages/core/src/events/repository.ts +2 -4
  85. package/packages/core/src/events/sessions.ts +6 -6
  86. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +571 -0
  87. package/packages/core/src/kernel/auto-merge.ts +2 -2
  88. package/packages/core/src/kernel/engine.ts +255 -26
  89. package/packages/core/src/kernel/generators/leaf-restack-log.ts +10 -0
  90. package/packages/core/src/kernel/integration-landing.ts +3 -3
  91. package/packages/core/src/kernel/integration-state.ts +27 -4
  92. package/packages/core/src/kernel/leaf-restack-state.ts +28 -3
  93. package/packages/core/src/kernel/log-index.ts +13 -1
  94. package/packages/core/src/kernel/node-landing.ts +8 -8
  95. package/packages/core/src/kernel/node-parent.ts +2 -2
  96. package/packages/core/src/kernel/node-restack-transaction.ts +1 -1
  97. package/packages/core/src/kernel/node-verification-context.ts +216 -0
  98. package/packages/core/src/kernel/phases.ts +1 -1
  99. package/packages/core/src/kernel/plan-verify-selection.ts +16 -0
  100. package/packages/core/src/kernel/publication-retry.ts +168 -0
  101. package/packages/core/src/kernel/reconcile-restack.ts +29 -1
  102. package/packages/core/src/kernel/reducer.ts +82 -5
  103. package/packages/core/src/kernel/target-distance.ts +45 -0
  104. package/packages/core/src/kernel/terminal-guard.ts +10 -1
  105. package/packages/core/src/kernel/verify-stage-state.ts +123 -0
  106. package/packages/core/src/kernel/verify-stages.ts +39 -0
  107. package/packages/core/src/ontology.ts +1 -0
  108. package/packages/core/src/operator/annotations.ts +6 -0
  109. package/packages/core/src/operator/control.ts +1 -1
  110. package/packages/core/src/operator/index.ts +1 -7
  111. package/packages/core/src/operator/landings.ts +5 -1
  112. package/packages/core/src/operator/presentation.ts +6 -1
  113. package/packages/core/src/operator/query.ts +14 -18
  114. package/packages/core/src/operator/registry.ts +17 -6
  115. package/packages/core/src/operator/sandbox-host.ts +64 -40
  116. package/packages/core/src/operator/sandbox.ts +3 -0
  117. package/packages/core/src/operator/ticket-source-backend.ts +3 -12
  118. package/packages/core/src/ports/forge/contract.ts +2 -2
  119. package/packages/core/src/ports/forge/git-rewrite.ts +25 -2
  120. package/packages/core/src/ports/forge/github-readiness.ts +2 -2
  121. package/packages/core/src/ports/forge/github.ts +26 -7
  122. package/packages/core/src/ports/forge/local-git.ts +4 -4
  123. package/packages/core/src/ports/forge/readiness.ts +1 -1
  124. package/packages/core/src/ports/forge-failure.ts +24 -0
  125. package/packages/core/src/ports/workspace/build-execution.ts +3 -1
  126. package/packages/core/src/ports/workspace/phase-scratch.ts +4 -3
  127. package/packages/core/src/ports/workspace/vercel-sandbox.ts +59 -39
  128. package/packages/core/src/processes/build-child.ts +6 -8
  129. package/packages/core/src/processes/build-execution-state.ts +8 -5
  130. package/packages/core/src/processes/build-runner.ts +522 -98
  131. package/packages/core/src/processes/dispatcher.ts +186 -101
  132. package/packages/core/src/processes/execution-no-progress.ts +8 -1
  133. package/packages/core/src/processes/phase-failure-budget.ts +1 -0
  134. package/packages/core/src/processes/publication-loss.ts +8 -2
  135. package/packages/core/src/processes/publication-state.ts +42 -4
  136. package/packages/core/src/processes/repo-view.ts +14 -0
  137. package/packages/core/src/processes/verify-cycle-config.ts +96 -0
  138. package/packages/core/src/{integration → scenarios}/harness.ts +330 -317
  139. package/packages/core/src/store/adapter.ts +1 -0
  140. package/packages/core/src/store/build-scope.ts +9 -0
  141. package/packages/core/src/store/contract.ts +113 -1
  142. package/packages/core/src/store/local/schema.ts +13 -0
  143. package/packages/core/src/store/local/store.ts +42 -0
  144. package/packages/core/src/store/memory.ts +47 -0
  145. package/packages/core/src/store/operator-presence.ts +21 -0
  146. package/packages/core/src/store/phase-session.ts +10 -0
  147. package/packages/core/src/store/reducer-value-shapes.json +5081 -4160
  148. package/packages/core/src/store/remote/client.ts +47 -1
  149. package/packages/core/src/store/remote/compatibility.ts +2 -0
  150. package/packages/core/src/store/remote/protocol.ts +4 -0
  151. package/packages/core/src/store/remote/version.ts +3 -1
  152. package/packages/core/src/store/retention.ts +2 -3
  153. package/packages/core/src/store/session-handle.ts +9 -0
  154. package/packages/core/src/store/streams/session-writer.ts +1 -1
  155. package/packages/core/src/store/types.ts +12 -2
  156. package/packages/core/src/testing/index.ts +11 -1
  157. package/packages/core/src/testing/temp-directories.ts +58 -0
  158. package/skills/code-review/SKILL.md +23 -9
  159. package/skills/finalize/SKILL.md +15 -7
  160. package/skills/guide/SKILL.md +253 -118
  161. package/skills/guide/references/integration-tree.md +45 -38
  162. package/skills/guide/references/{landing-policy.md → merge-policy.md} +42 -24
  163. package/skills/guide/references/migration-1.0.md +17 -13
  164. package/skills/guide/references/operator-api.md +91 -15
  165. package/skills/guide/references/remote-store-protocol.md +76 -11
  166. package/skills/guide/references/remote-ticket-protocol.md +1 -1
  167. package/skills/guide/references/restacking.md +54 -15
  168. package/skills/guide/references/setup.md +41 -6
  169. package/skills/guide/references/spec-standard.md +6 -6
  170. package/skills/guide/references/ticket-dependencies.md +7 -7
  171. package/skills/implement/SKILL.md +43 -17
  172. package/skills/operate/SKILL.md +117 -116
  173. package/skills/plan/SKILL.md +39 -13
  174. package/skills/plan-review/SKILL.md +15 -10
  175. package/skills/reconcile/SKILL.md +22 -3
  176. package/skills/spec/SKILL.md +19 -19
  177. package/skills/tickets/SKILL.md +9 -7
  178. package/templates/autobuild.toml +1 -1
  179. package/templates/hosted-service/package.json +2 -2
  180. package/packages/core/src/orchestrator/approvals.ts +0 -115
  181. package/packages/core/src/orchestrator/conversation.ts +0 -167
  182. package/packages/core/src/orchestrator/model.ts +0 -86
  183. package/packages/core/src/orchestrator/prompt.ts +0 -63
  184. package/packages/core/src/orchestrator/tools.ts +0 -117
  185. package/packages/core/src/orchestrator/turn-runner.ts +0 -457
  186. package/packages/core/src/processes/orchestrator-tick.ts +0 -360
@@ -15,12 +15,12 @@ This skill describes the *system*. It drives no phase and changes no files.
15
15
  ## The integration tree
16
16
 
17
17
  The configured `baseBranch` is the root. Work tickets are leaves; finite node
18
- builds collect child contributions, verify their exact head and parent, and land
18
+ builds collect child contributions, verify their exact head and parent, and merge
19
19
  under ordered policy. Targets freeze at claim; blockers are a separate graph.
20
20
  Idle nodes consume no runner capacity and empty nodes have no PR.
21
21
 
22
22
  - [Nodes, targets and the operating model](references/integration-tree.md)
23
- - [Landing policy, examples and forge requirements](references/landing-policy.md)
23
+ - [Merge policy, examples and forge requirements](references/merge-policy.md)
24
24
  - [Restacking, identity and recovery](references/restacking.md)
25
25
  - [Migration from 0.x](references/migration-1.0.md)
26
26
  - [Moving ticket sources](references/ticket-migration.md): recorded migrations preserve in-flight build continuity.
@@ -84,7 +84,7 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
84
84
  starts builds up to the top-level `capacity` bound.
85
85
  - **Ticket assets** — files or folders attached to a ticket (see
86
86
  [Ticket assets](#ticket-assets)) are frozen into the build at claim and
87
- appear under `.ab/assets/` in every phase, as inputs alongside the spec.
87
+ appear under `$AB_CONTEXT_DIR/assets/` in every phase, as inputs alongside the spec.
88
88
  A `design` asset is part of the contract: `plan`, `plan-review`, `implement`,
89
89
  `code-review`, and agent verify steps judge against it, as a contract on
90
90
  observable visual and reference outcomes, not on implementation. Other kinds
@@ -100,22 +100,25 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
100
100
  - **`implement ⇄ code-review`** — the implementer executes the approved plan,
101
101
  committing locally; a fresh reviewer reads the diff against spec and plan.
102
102
  Same loop shape.
103
- - **`verify:*`** — each step in `[verify].steps` runs as its own phase, in
104
- order. A failing step sends the build back to `implement` with the report;
105
- an explicit skip records why the step did not apply and advances.
103
+ - **`verify:*`** — ordered stages, each containing one or more step phases.
104
+ Members run concurrently and the next stage waits for every pass or skip.
105
+ A failed stage sends every failed report to `implement` after its siblings
106
+ settle; an optional `failFast` failure cancels unfinished siblings.
106
107
  - **`finalize`** — the agent writes the PR description; the kernel opens the
107
108
  PR. `[finalize].steps` run afterward and are failure-tolerant. A
108
109
  content-producing step commits selected files locally and finishes clean;
109
110
  the runner pushes the exact descendant SHA and confirms forge readback before recording success.
110
111
  - **Restacking and epilogue.** The kernel replays one net leaf change at verify
111
- entry and when its destination moves while awaiting landing. Clean replay
112
+ entry and when its destination moves while awaiting merge. Clean replay
112
113
  starts no agent; conflicts enter `reconcile`, then verification. The leaf
113
- terminates **merged** or **closed**. See the [replay reference](references/restacking.md).
114
+ terminates **merged** or **closed**. Transient leaf publication failures park
115
+ on a durable six-retry schedule, independently of agent phase attempts.
116
+ See the [replay reference](references/restacking.md).
114
117
 
115
- Integration builds use collect → verify → land → close, with demand-driven node restacking,
118
+ Integration builds use collect → verify → merge → close, with demand-driven node restacking,
116
119
  repair children and source-aware reconcile as needed. Their exact-head/parent
117
120
  verification differs from clean waiting leaf rewrites. See the
118
- [node lifecycle](references/integration-tree.md#collect-verify-and-land).
121
+ [node lifecycle](references/integration-tree.md#collect-verify-and-merge).
119
122
 
120
123
  **Review severity is proportion to the spec.** Both review loops rate a
121
124
  finding by what the defect costs against the spec's acceptance criteria and
@@ -133,7 +136,8 @@ criterion, or a stated invariant makes it material.
133
136
 
134
137
  **The grammar is fixed.** `verify:*` and `finalize:*` are the *only* extension
135
138
  points. There are no custom phases, no DAGs, no reordering — a repo extends
136
- autobuild by configuring verify and finalize steps, never by inventing stages.
139
+ Autobuild by configuring verify stages and serial finalize steps. Ordered verify
140
+ groups do not add workflow phases or arbitrary dependency graphs.
137
141
  If a request seems to need a new phase, say so rather than improvising one.
138
142
 
139
143
  **Observation harvest is not a build phase.** On each dispatch tick, dispatch
@@ -188,7 +192,7 @@ Naming inherits `[roles.default]` and can be overridden by `[roles.slug]`.
188
192
  ## Who does what
189
193
 
190
194
  The **operator** is the role driving Autobuild through `ab` or MCP, normally
191
- an agent. The **operator agent** takes that role; a human may drive the same
195
+ an agent. The **operator agent** operates the builds the repository's dispatcher dispatches, adopting new builds as they appear; a human may drive the same
192
196
  interface directly. The human is **you**, or the **maintainer**. Human actor
193
197
  identities and session ownership attribute authority to the authorizing account,
194
198
  not to the agent driving the tools.
@@ -245,9 +249,16 @@ The distinctions that change an administrator's answer:
245
249
  accepted or revived by detection; a newly prepared attempt must pass preflight.
246
250
  Compatible generations drain: the predecessor releases terminal
247
251
  input/rendering and repository authority, then supervises only captured local
248
- executions while the successor owns ticks and launches. Local and remote runners finish
252
+ executions while the successor owns ticks and launches. The presenting input
253
+ subscription reasserts raw termios on activation and every 100 ms, repairing
254
+ retired processes' exit-time restores on the next maintenance turn (subject
255
+ to event-loop delays). It cancels maintenance before release, suspension or
256
+ shutdown and restores prior raw/flow state, leaving the shell cooked. Local and remote runners finish
249
257
  their current phase, compare their immutable attach runtime with the accepted
250
258
  target using existing boundary facts, and durably request relaunch on mismatch.
259
+ Remote recovery confirms whole-sandbox stop before recording an execution end
260
+ or releasing its lease; command exit alone is insufficient. Stop failure defers
261
+ publication and replacement until teardown succeeds.
251
262
  Confirmed teardown has the neutral `relaunch` outcome; the current repository
252
263
  owner resumes from durable state on its runtime, even after an ownership gap.
253
264
  Equal or absent targets preserve normal execution. Unknown/incompatible
@@ -303,7 +314,28 @@ The distinctions that change an administrator's answer:
303
314
  notice, and restoring a valid file resumes reload. Scoped phase CLI processes
304
315
  still read the build worktree's branch-owned file. Dispatcher merge readiness,
305
316
  resume, and execution recovery use the runner's pinned commands, verify, and
306
- finalize configuration; builds without a pin retain the live fallback.
317
+ finalize configuration through the cycle capture's exact artifact revision.
318
+ At every verify-cycle entry, after restack or reconcile settles, the runner
319
+ reads `autobuild.toml` from the execution checkout at resolved `HEAD` (including
320
+ detached integration heads). `verify.config-captured` cites an immutable
321
+ `verify-cycle-config` artifact revision, checkout head, build-owned content
322
+ identity and truthful source metadata. Dirty worktree bytes carry
323
+ `worktree-dirty` without a commit. A settled stage boundary rechecks the
324
+ build-owned sections and the known source commit's ancestry. A change or
325
+ non-ancestor source records `verify.config-superseded` and starts a fresh cycle
326
+ before constructing any further member. Already launched siblings settle first.
327
+ A waiting leaf with completed verification retains its receipts after a clean
328
+ rewrite when build-owned config is unchanged, even when the rewrite replaces
329
+ the pin commit's ancestry. Changed config still supersedes while waiting; a
330
+ future verification cycle always captures fresh config before running steps.
331
+ Old pass/skip receipts cannot satisfy that cycle, and supersession creates no
332
+ failure or failure-budget charge. Unchanged config on a descendant head retains
333
+ its pin; every new cycle still rereads the checkout. Read, parse and Git evidence
334
+ failures block verification as infrastructure failures. Recovery and readiness
335
+ read the capture's exact revision, so a concurrent deployment reload cannot
336
+ replace its build-owned sections. Historical streams capture before further
337
+ verification. Deployment-owned reloads remain live; environments are not
338
+ re-provisioned.
307
339
  - **Workspaces** are provisioned per build and remain the locally reachable
308
340
  execution context for that build.
309
341
  - **Ticket providers** (`linear`, `file`) sit behind one port; the dispatcher
@@ -317,7 +349,7 @@ The distinctions that change an administrator's answer:
317
349
  successful content-producing finalize post-step. Reconcile alone uses an exact expected-head guarded rewrite after archiving every recorded Git tip under `refs/autobuild/archive/<slug>/<sha>`.
318
350
  `github` publishes through GitHub. `local-git` performs no remote/network/`gh`
319
351
  operation: durable PR records live under private Git refs, the review locator
320
- is `refs/heads/ab/<slug>`, and consent lands a local guarded, unsigned squash
352
+ is `refs/heads/ab/<slug>`, and consent merges a local guarded, unsigned squash
321
353
  whose message is the deposited PR description and whose author and committer
322
354
  come from the repository's ordinary Git identity. If Git cannot resolve that
323
355
  identity, the PR remains open with actionable `user.name` / `user.email`
@@ -421,9 +453,9 @@ credential. See [repository setup](references/setup.md#connect-a-project).
421
453
  Changing the store requires restarting dispatch.
422
454
 
423
455
 
424
- ### `[landing]`
456
+ ### `[merge]`
425
457
 
426
- Declare an ordered array of rules with `[[landing]]` headers. Each rule ANDs
458
+ Declare an ordered array of rules with `[[merge]]` headers. Each rule ANDs
427
459
  its predicates; the first match wins. Omitted predicates are wildcards.
428
460
  An unmatched leaf defaults to `auto`; an unmatched node defaults to `consent`.
429
461
  Rules are strict and blank predicates are rejected with their array index.
@@ -437,7 +469,7 @@ Rules are strict and blank predicates are rejected with their array index.
437
469
 
438
470
  Help the human choose policy around their release process. A solo team can
439
471
  use one catch-all `mode = "auto"` rule. A team requiring a human's review
440
- for every landing can use one catch-all `mode = "consent"` rule. For release
472
+ for every merge can use one catch-all `mode = "consent"` rule. For release
441
473
  nodes that collect work automatically but require a final click, put an
442
474
  `into = "root"`, `mode = "consent"` rule first, followed by a catch-all
443
475
  `mode = "auto"` rule. A broad rule placed first shadows narrower rules below
@@ -593,8 +625,9 @@ For example, set `afterReconcile = false` in `[verify]` and
593
625
 
594
626
  The kernel freezes the resolved ordered policy in
595
627
  `verify.reconcile-policy-captured` at the next engine action after reconcile
596
- completion. Live configuration changes apply at that boundary; a cycle already
597
- started keeps its policy through recovery. Historical cycles already started
628
+ completion. A cycle already started keeps its policy through recovery.
629
+ Configuration supersession starts a fresh cycle and captures a new policy for
630
+ its configured universe, retaining the original reconcile identity. Historical cycles already started
598
631
  without a captured policy retain the rerun-all behavior. Initial verification
599
632
  and verification after subsequent code review always use ordinary applicability.
600
633
  Policy exclusion precedes plan selection and paths, including `always = true`.
@@ -603,16 +636,17 @@ Enabled steps still follow plan selection and path rules. Excluded steps record
603
636
  and a reason naming the setting. Dashboards and PR summaries call this
604
637
  "skipped by post-reconcile policy"; it is never a pass. Forge-side required
605
638
  checks and branch protections still gate merge. For excluded steps, merged code
606
- is not re-verified, so breakage that only exists in the combination can land.
639
+ is not re-verified, so breakage that only exists in the combination can merge.
607
640
 
608
641
 
609
- `steps` orders the verify phases; each entry `"<step>"` becomes a
610
- `verify:<step>` phase and needs its own `[verify.<step>]` subtable. Those
642
+ `steps` orders stages: a name is a singleton, an array groups concurrent
643
+ members. Every name becomes a `verify:<step>` phase with its own table. Those
611
644
  subtables are part of this section — their fields are listed here.
612
645
 
613
646
  | Field | Default | Allowed / constraints | Effect |
614
647
  |---|---|---|---|
615
- | `steps` | `[]` | array of nonempty strings | Ordered configured universe of verify phases. Each name must have a matching `[verify.<step>]` table. |
648
+ | `steps` | `[]` | strings or nonempty arrays of names; no duplicate names | Ordered stages. Members start together; every pass or skip is required before the next stage. Each name needs a matching table. |
649
+ | `failFast` | `false` | optional boolean on either verify kind | A failure cancels unfinished members of its stage, then tears down and relaunches the whole execution before implement. |
616
650
  | `kind` | — | **required**, `"check"` \| `"agent"` | Discriminator. `check` is deterministic (command + pass/fail, never an agent); `agent` runs a skill that returns `pass`, `fail`, or `skip`. |
617
651
  | `command` | — | **required when `kind = "check"`**, nonempty string | Ref into `[commands]` — the key, not a shell string. Pass/fail is the command's exit status. |
618
652
  | `skill` | — | **required when `kind = "agent"`**, nonempty string | Installed skill name to run (e.g. a repository-authored `"verify-acceptance"`). |
@@ -620,6 +654,41 @@ subtables are part of this section — their fields are listed here.
620
654
  | `afterReconcile` | repository: `true`; step: inherited | boolean | Step override wins over `[verify].afterReconcile`; false skips this step after reconciliation only. |
621
655
  | `always` | — | optional boolean | `true` makes the step unconditional and mandatory (a plan cannot deselect it); `false` is equivalent to omission. |
622
656
 
657
+ ### Choosing verify stages
658
+
659
+ Run cheap gates early, and put deterministic checks before agents. Agent runs
660
+ spend model budget, and an agent examining software that cannot build can produce misleading reports. Group
661
+ independent failures to collect useful reports in one round trip. Keep steps
662
+ that share mutable ports, databases, output directories or caches apart unless
663
+ they are isolated; if they cannot run together in a developer terminal, they
664
+ cannot run together here. CPU demand multiplies by build `capacity`; no cap
665
+ limits stage size, so configuration is the entire concurrency budget.
666
+
667
+ Use `failFast` when a failure invalidates sibling results, or when a failing
668
+ step usually finishes much sooner than its siblings. Waiting costs the chance
669
+ of this failure multiplied by siblings' remaining time; it saves the chance of
670
+ an independent sibling failure multiplied by an implement/review/reverify round
671
+ trip. Decide using actual failure and duration history, including checks that
672
+ implementers already run before `done`. Give every agent its own inputs through
673
+ `$AB_CONTEXT_DIR`, never fixed `.ab/` paths; concurrent verifiers share the
674
+ workspace, not their context directories.
675
+
676
+ Default failure waits for all siblings, including an escalated verifier's
677
+ answer and rerun. Fail-fast cancellation supersedes only that occurrence's
678
+ agent escalation, including late raises/answers; it is no longer answer-required
679
+ and never delivers guidance into another occurrence. A cancelled member is not
680
+ run, never passing evidence. Whole-execution teardown and replacement add a
681
+ relaunch cost but prevent cancelled descendants from writing during implement.
682
+ Restart reruns only members without outcomes, keeping the same attempt and every
683
+ recorded outcome. One failed cycle spends one verify-attempt unit.
684
+
685
+ `verify.stage-failed` is the decisive full-feedback receipt. The legacy
686
+ `feedback.verify` object still names the first failed report; the implement
687
+ manifest also lists all reports and not-run cancellations through its receipt
688
+ reference, including on guidance rounds. Rounds without a referenced receipt
689
+ have no cancellation list. Finalize receives historical reports but no
690
+ `cancelledVerify` list; its evidence is the satisfied current cycle.
691
+
623
692
  A plan may begin with strict TOML front matter selecting the complete set of
624
693
  optional verification it warrants:
625
694
 
@@ -633,14 +702,32 @@ Names must already exist in `[verify].steps` with matching tables; duplicates,
633
702
  blanks, unknown names, malformed metadata, and omission of an `always = true`
634
703
  step make the planner's `ab done` fail before `plan.completed` is appended.
635
704
 
705
+ Repository-authored verify and finalize skills must run `ab context`, then read
706
+ `"$AB_CONTEXT_DIR/context.json"` and the inputs under `$AB_CONTEXT_DIR`.
707
+ Materialized keys are directory-relative; manifest path fields are workspace-relative.
708
+ Scratch output, downloaded references, probes, and temporary scripts belong under `.ab/`
709
+ (prefer the current `$AB_CONTEXT_DIR` when appropriate), never at the worktree
710
+ root, and must not be committed. Manifest-directed artifact paths remain authoritative.
711
+
712
+ Large scratch belongs under the session's `.ab/` directory (prefer `$AB_CONTEXT_DIR`),
713
+ not `/tmp`: this includes ad-hoc PostgreSQL data/cluster directories, Cargo target
714
+ directories, browser profiles, and database copies. Configure `PGDATA`,
715
+ `CARGO_TARGET_DIR`, and explicit browser profile paths for those resources.
716
+ Keep `TMPDIR` outside the worktree for test suites and commands that discover
717
+ repositories or configuration through parent directories, including focused tests
718
+ and Git probes. Do not relocate required installed tooling or retained evidence;
719
+ manifest-directed artifact paths remain authoritative. Never commit scratch.
720
+
721
+ Keep concurrent verifiers in their distinct context directories.
722
+
636
723
  An agent verify step is handed the build's pinned ticket assets under
637
- `.ab/assets/` (listed in `.ab/context.json`) as well as the spec. A verify skill
724
+ `$AB_CONTEXT_DIR/assets/` (listed in `$AB_CONTEXT_DIR/context.json`) as well as the spec. A verify skill
638
725
  should treat a `design` asset as part of the contract, a contract on observable
639
726
  visual and reference outcomes, not on implementation, and judge the result
640
727
  against it.
641
728
 
642
729
  Node `verify:*` context additionally exposes `nodeVerification`: the frozen
643
- range, a JSON index path, contribution build slugs, current stored ticket
730
+ range, a JSON index path, contribution build slugs, preparation-time stored ticket
644
731
  identities, event-authorized spec revisions and spec paths, and their commits.
645
732
  The index maps every commit in the range using build identity trailers,
646
733
  including earlier-cycle contributions and merge side history. Commits without
@@ -651,7 +738,14 @@ Their full messages express maintainer-authorized intent: judge quality and
651
738
  consistency, and never fail them solely for lacking a covering spec. Other node
652
739
  changes are authorized when covered by the node spec or the spec
653
740
  of the contribution introducing it; use the commit mapping to find that spec.
654
- Missing or ambiguous provenance fails hydration. Leaf context is unchanged.
741
+ The dispatcher collects these inputs with repository authority before launching
742
+ verification and atomically deposits a node-owned `node-verification-context`
743
+ artifact cited by exact revision in `integration.prepared`. Contributor specs
744
+ freeze at preparation; resumed and concurrent verifiers read the same cycle input.
745
+ Hydration reads only that node-owned artifact and grants no general contributor
746
+ read authority. Missing or ambiguous provenance prevents preparation; missing,
747
+ corrupt or mismatched prepared inputs fail hydration. Historical agent cycles
748
+ without a citation require a new integration cycle. Leaf context is unchanged.
655
749
 
656
750
  An agent verify step selects `[roles.<step>]` by its **logical step name** —
657
751
  the name in `[verify].steps`, not the skill it runs. An agent finalize
@@ -681,6 +775,13 @@ selection from the exact plan completion approved by `plan-review` is
681
775
  authoritative. A spec restart replaces it with the newly approved plan; a
682
776
  reconcile reuses it.
683
777
 
778
+ If the approved selection later names any step absent from the cycle's pinned
779
+ configured universe, the entire selection falls back to all configured optional
780
+ steps. The kernel records one observation per cycle and plan revision naming
781
+ the unknown steps. Mandatory steps, path applicability and post-reconcile policy
782
+ still apply. A valid selection continues to skip genuinely omitted optional
783
+ steps. Strict validation when depositing a new plan is unchanged.
784
+
684
785
  Cross-field rules the validator actually enforces — each is an **error**:
685
786
 
686
787
  - A step listed in `steps` with no `[verify.<step>]` table.
@@ -742,6 +843,9 @@ Ordinary silence, provider failures and session timeouts retain the runner's
742
843
  phase failure limit (`BuildRunnerOpts.maxPhaseAttempts`, default 2). This is
743
844
  an internal runner option, not an accepted `[policy]` TOML key. Reconcile
744
845
  execution and unchanged-base progress budgets retain their existing accounting.
846
+ Classified transient leaf restack/reconcile publication uses its own six-retry
847
+ budget and durable deadlines; answering `publication-retry-limit` resets only
848
+ that publication episode.
745
849
 
746
850
  ### `[finalize]`
747
851
 
@@ -977,7 +1081,8 @@ own-build-read deferral and its answer resets no phase failures; reconcile no-pr
977
1081
  while `round` remains occurrence scope. Answering a runner-failure cause re-arms
978
1082
  only its matching phase and round. The phase-level `verify-failure-limit` cause
979
1083
  explicitly re-arms all rounds for its verify target, while
980
- `reconcile-no-progress` and the setup-only cause reset no phase-runner failures.
1084
+ `reconcile-no-progress`, `publication-retry-limit` and the setup-only cause reset
1085
+ no phase-runner failures.
981
1086
  The closed cause map forces every future policy condition to choose one of these
982
1087
  semantics instead of inheriting behavior from a missing `round`. Runner failures
983
1088
  while checking progress or refreshing the base therefore remain counted after a
@@ -1044,7 +1149,7 @@ An explicit `readyLabels` value always wins for every source.
1044
1149
  `proposalState` is the one supported way to waive the grooming gate, and it is
1045
1150
  deliberately not `triageState`. Do not suggest pointing `triageState` at the
1046
1151
  ready state to get auto-dispatched proposals: `triageState` is also where a
1047
- spec-gate bounce lands, so a nonconforming ticket would be claimed, bounced,
1152
+ spec-gate bounce merges, so a nonconforming ticket would be claimed, bounced,
1048
1153
  and reclaimed on every tick. `proposalState` moves only what harvest files.
1049
1154
 
1050
1155
  Cross-field rules, each an **error**:
@@ -1090,23 +1195,21 @@ environment variable instead and say why.
1090
1195
 
1091
1196
  ### `[orchestrator]`
1092
1197
 
1093
- Gates the operator-agent feature (AUT-340, AUT-342): the persistent,
1094
- **credential-free** sandbox environment per session owner × repository that an
1095
- operator agent drives through the `sandbox.*` registry tools (`ab mcp`, and
1096
- every later binding), and — when the embedded orchestrator is enabled — the
1097
- turn runner that answers operator sessions and wakes on build attention
1098
- events. The whole table is **closed to unknown keys** and restart-classified:
1099
- changing it requires a dispatcher restart.
1198
+ Enables credential-free sandbox environments per session owner and repository,
1199
+ driven by external agents through `sandbox.*` tools. Operators run in external
1200
+ harnesses; the service never starts or resumes them. The table is strict and
1201
+ restart-classified.
1100
1202
 
1101
1203
  | Field | Default | Allowed / constraints | Effect |
1102
1204
  |---|---|---|---|
1103
- | `enabled` | `false` | boolean | Master gate. With the table absent or `enabled = false`, the sandbox tools are absent from every binding, no environment is ever provisioned, and no dispatcher tick or message post ever runs orchestrator code — a local dispatcher is inert even when enabled, because the turn runner exists only in the hosted deployment. |
1104
- | `model` | — (required when `enabled = true`) | nonblank provider-qualified string, same vocabulary as `[roles]` | The turn runner's model, resolved through the deployment's gateway credential; a leading `vercel-ai-gateway/` prefix is accepted and stripped. |
1105
- | `invocationBudgetSeconds` | `240` | positive integer, clamped to 300 | Wall-clock budget for one turn invocation. A larger value is clamped — not rejected — to the 300-second hosted function limit the runner executes under. |
1106
- | `approvals` | `["builds.control:abort", "builds.control:discard", "builds.answer:revise-spec", "sandbox.publish", "tickets.move:ready"]` | array of `tool` or `tool:qualifier` strings | Registry tool calls that suspend a turn until the human answers. Empty (`[]`) means none — autonomous operation. An entry naming an absent or unknown tool is **inert by design**, never an error. A qualified entry applies to one discriminator value only (`tickets.move:ready` approves moving a ticket to `ready`); for a tool without a discriminator, only the bare form matches. |
1107
- | `wake` | inherits the default | array of event-type globs | The attention events a **new** session wakes for. Absent inherits the legacy hosted wake event set including `integration.verification-failed`, independent of CLI watch defaults; an explicit `[]` means never wake — message-only. Each glob must match at least one build event type. Existing sessions never retroactively inherit; an explicit wake update always wins. |
1205
+ | `enabled` | `false` | boolean | Enables external sandbox tools, archive cleanup and dispatcher idle settlement. |
1108
1206
  | `sandbox` | — | strict subtable | The sandbox behavior knobs; absence reads as the defaults below. |
1109
1207
 
1208
+ The removed runner settings `model`, `invocationBudgetSeconds`, `approvals` and
1209
+ repository-default `wake` are rejected in new config. Historical effective
1210
+ config artifacts remain readable. New sessions have no inherited wake settings;
1211
+ explicit session wake writes are durable facts and do not execute turns.
1212
+
1110
1213
  `[orchestrator.sandbox]` fields:
1111
1214
 
1112
1215
  | Field | Default | Allowed / constraints | Effect |
@@ -1164,7 +1267,7 @@ retry an unchanged failed target. No registry credentials belong in these facts.
1164
1267
  ## Setup and upgrades
1165
1268
 
1166
1269
  For 0.x upgrades, first read the [migration reference](references/migration-1.0.md):
1167
- landing-policy conversion and resumed-build behavior are part of adoption.
1270
+ merge-policy conversion and resumed-build behavior are part of adoption.
1168
1271
 
1169
1272
  **`ab init <target> [--force]`** runs *outside* build sessions — it takes a
1170
1273
  repo path, needs no `AB_*` environment, and is safe to re-run. It:
@@ -1193,8 +1296,8 @@ repo path, needs no `AB_*` environment, and is safe to re-run. It:
1193
1296
  an acceptance check through a repository-owned agent verify skill in every
1194
1297
  repository. Wire an existing maintained end-to-end or browser test suite into an ordinary `check` step. If none exists, do not create one during setup. The acceptance check neither substitutes for nor seeds a suite. It completes `bun ab init --validate`, fixing failures
1195
1298
  and reviewing warnings. The human then starts `bun ab dispatch` and opens
1196
- their operator agent with `ab-operate` to create, groom, and shepherd the
1197
- first ticket.
1299
+ their operator agent with `ab-operate` to create and groom the first ticket,
1300
+ checking presence before taking the role; an existing operator picks up ready work.
1198
1301
  - It never overwrites config once the file exists, even with `--force`; a rerun
1199
1302
  launches or prints a prompt that asks the agent to review and improve it.
1200
1303
  - Idempotently adds the exact `.autobuild/` rule to the target's `.gitignore`,
@@ -1519,8 +1622,8 @@ assets are not moved and are not a fallback. Each has a kind and a name.
1519
1622
  `--revise-spec-from-ticket` pins again. `ab build asset get <slug> <kind>
1520
1623
  <name> <dest> [--rev <n>]` downloads what the build froze, also after it ends.
1521
1624
  - **Where phases find them.** `ab context` writes each pinned asset to
1522
- `.ab/assets/<kind>/<name>/` (a file asset is the single file inside that
1523
- directory) and lists them under `assets` in `.ab/context.json` with kind,
1625
+ `$AB_CONTEXT_DIR/assets/<kind>/<name>/` (a file asset is the single file inside that
1626
+ directory) and lists them under `assets` in `$AB_CONTEXT_DIR/context.json` with kind,
1524
1627
  name, revision, layout, size, and path. The key is absent when the build has
1525
1628
  none.
1526
1629
 
@@ -1575,20 +1678,22 @@ accepted completion clears its handoff banner. Takeover, an overdue deadline
1575
1678
  and an empty outstanding set do not complete a handoff. Multiple unfinished
1576
1679
  generations remain visible; cutover does not mark builds draining.
1577
1680
 
1578
- Integration list rows show parent commit distance (current or unknown when appropriate),
1579
- name the destination and show children landed out of the
1681
+ Terminal list headers show `slug → destination +N` with dim distance; work
1682
+ steps follow immediately. Integration progress retains its bar and child counts.
1683
+ Web views keep their layout and share the suffix vocabulary.
1684
+ Integration list rows show children merged out of the
1580
1685
  known total, with the remainder split into building and queued. Cancelled
1581
1686
  children are excluded. Missing or diagnostic-bearing observations show
1582
1687
  `children unknown`; a successful empty enumeration shows `no children yet`.
1583
- The five list steps are `spec`, `open`, `collect`, `verify`, and `land`, with
1584
- verification progress or failure and the landing mode in parentheses. Before
1688
+ The five list steps are `spec`, `open`, `collect`, `verify`, and `merge`, with
1689
+ verification progress or failure and the merge mode in parentheses. Before
1585
1690
  a policy decision, label-dependent modes may read `policy pending`. A current
1586
1691
  verified node adds `verified`. Only restack conflicts, current verification
1587
1692
  failures (file a repair child targeting the node), and readiness awaiting
1588
- consent add a list alert. Consent names `l` and `ab land <slug>`. Branch,
1693
+ consent add a list alert. Consent names `l` and `ab merge <slug>`. Branch,
1589
1694
  restack state and conflicting files remain in detail, along with every child's
1590
- ticket id, title and live phase (or queued/landed), open-first counts, verification
1591
- steps and current outcomes, repair instructions, and the landing rule. Cancelled
1695
+ ticket id, title and live phase (or queued/merged), open-first counts, verification
1696
+ steps and current outcomes, repair instructions, and the merge rule. Cancelled
1592
1697
  children are omitted; historical missing titles or filenames are explicit.
1593
1698
  The operator web app uses the same facts as text, without a graphical bar.
1594
1699
 
@@ -1664,10 +1769,10 @@ through repaint, re-sort, and row appearance/disappearance. The legend is
1664
1769
  contextual: every row offers navigation and quit; global offers `h harvest`,
1665
1770
  `i intake`, `p pause all`, and `r resume all`; `Harvest` offers `p resume`
1666
1771
  for ordinary failure or `p acknowledge` for exhaustion/escalation only when
1667
- available. Selected builds offer `l land` and `o hold`, subject to command
1772
+ available. Selected builds offer `l merge` and `o hold`, subject to command
1668
1773
  eligibility, plus the state-specific `p pause`, `p cancel pause`, or `r resume`
1669
- action; queued builds offer `d discard`. Land requires readiness; hold may be
1670
- recorded before readiness. There is no repository landing toggle.
1774
+ action; queued builds offer `d discard`. Merge requires readiness; hold may be
1775
+ recorded before readiness. There is no repository merge toggle.
1671
1776
 
1672
1777
  A running build reads `PAUSING` after `p` appends its pause request and before
1673
1778
  the live session stops and the kernel records its suspension. Pause interrupts
@@ -1720,14 +1825,14 @@ itself, so an already-paused repository shows `repository PAUSED` and `(held)`
1720
1825
  on its first paint; clearing the hold removes both on the next poll. The hold
1721
1826
  survives a restart and is not defeated by re-running `ab dispatch`.
1722
1827
 
1723
- `[[landing]]` rules in `autobuild.toml` determine landing policy. The
1828
+ `[[merge]]` rules in `autobuild.toml` determine merge policy. The
1724
1829
  dispatcher records an immutable decision when each candidate becomes ready.
1725
1830
  No rules means leaf auto / node consent. There is no claim-time default
1726
- seeding or fan-out over existing builds. `ab land <slug>` supplies consent to
1727
- that landing and frozen destination; it survives replacement heads until hold
1831
+ seeding or fan-out over existing builds. `ab merge <slug>` supplies consent to
1832
+ that merge and frozen destination; it survives replacement heads until hold
1728
1833
  or completion. `ab hold <slug>` suppresses policy and withdraws consent.
1729
1834
  The old `--auto-merge` / `--no-auto-merge` flags and `ab auto-merge` command
1730
- are retired and return actionable errors; use landing rules and hold/land.
1835
+ are retired and return actionable errors; use merge rules and hold/merge.
1731
1836
 
1732
1837
  Global-row `h` re-reads the repository journal and appends the existing human
1733
1838
  pause/resume request. The newest pending command determines the next target, so
@@ -1751,14 +1856,14 @@ settles every exhaustion barrier. Exhaustion and escalation remain terminal.
1751
1856
  Escalation's row is dismissed only by a post-terminal human resume request
1752
1857
  followed by its later kernel acknowledgement, never by the request alone.
1753
1858
 
1754
- Every build row renders a `landing <state>` token. Cyan requested means
1859
+ Every build row renders a `merge <state>` token. Cyan requested means
1755
1860
  authorized but not yet applied natively; green enabled means the native request
1756
1861
  is armed; yellow cancelling means cancellation is in flight; dim off means no
1757
1862
  authorization. A recorded consent decision waiting for an operator reads
1758
- `landing awaiting consent`; an explicit hold reads `landing held`.
1863
+ `merge awaiting consent`; an explicit hold reads `merge held`.
1759
1864
  There is no red comparison with a repository default. Row and detail merge
1760
1865
  explanations distinguish a pending policy decision, consent, and hold, and name
1761
- `ab land <slug>` / `ab hold <slug>` where appropriate.
1866
+ `ab merge <slug>` / `ab hold <slug>` where appropriate.
1762
1867
  Merge conflicts recover automatically: the gate defers, the pipeline re-enters
1763
1868
  reconcile, and verify re-runs before consent is re-examined — the reconcile
1764
1869
  step on the build row is the only indication, and uncomputed mergeability
@@ -1783,9 +1888,9 @@ to the build's event log and apply the same write-time checks.
1783
1888
  | Resume | `ab resume <slug> [--store <ref>]` | Select a `PAUSED` build and press `r`. | `build.resume-requested` |
1784
1889
  | Pause all | `ab pause --all [--store <ref>] [--json]` | Select the global row and press `p`. | `dispatcher.pause-set` (first), `dispatcher.intake-set`, then one `build.pause-requested` per `RUNNING` build |
1785
1890
  | Resume all | `ab resume --all [--store <ref>] [--json]` | Select the global row and press `r`. | `dispatcher.pause-set` (first), `dispatcher.intake-set`, then one `build.resume-requested` per `PAUSED` build |
1786
- | Consent to landing | `ab land <slug> [--store <ref>]` | Select a ready build and press `l`. | `build.land-requested`, then `landing.command-acknowledged` |
1891
+ | Consent to merge | `ab merge <slug> [--store <ref>]` | Select a ready build and press `l`. | `build.land-requested`, then `landing.command-acknowledged` |
1787
1892
  | Restack node | `ab restack <node> [--store <ref>]` | CLI/tool request; normal safety gates apply. | `node.restack-requested`, then `node.restack-satisfied` |
1788
- | Hold landing | `ab hold <slug> [--store <ref>]` | Select a build and press `o`, including before readiness. | `build.hold-requested`, then `landing.command-acknowledged` after native cancellation |
1893
+ | Hold merge | `ab hold <slug> [--store <ref>]` | Select a build and press `o`, including before readiness. | `build.hold-requested`, then `landing.command-acknowledged` after native cancellation |
1789
1894
  | Answer blockers with guidance | `ab answer <slug> <text> [--store <ref>]` | Select a blocked build, press `r`, enter text, then Enter. | One `escalation.answered` with `resolution: guidance` per applicable blocker. |
1790
1895
  | Retry blockers without guidance | `ab answer <slug> [--store <ref>]` | Open the same `r` field and press Enter empty or whitespace-only. | One `escalation.answered` with `resolution: retry` per applicable blocker. |
1791
1896
  | Dismiss cited finding chains | `ab answer <slug> --dismiss [--store <ref>]` | CLI only; build detail names the command. | One `escalation.answered` with `resolution: dismiss-finding` per blocker that cites a real review finding. |
@@ -1799,7 +1904,7 @@ setters, not toggles, so the values the command names are the values the
1799
1904
  repository holds afterwards — and each per-build request is a compare-and-set
1800
1905
  against a freshly reduced log, so a rerun adds no second pending pause and
1801
1906
  never cancels one already in flight. Pause first is what makes every surviving
1802
- prefix of a failed walk at least as quiesced as asked: once it lands, no queued
1907
+ prefix of a failed walk at least as quiesced as asked: once it merges, no queued
1803
1908
  build is launchable, whatever else fails after it. Output names every build that
1804
1909
  received a request, the hold, and the intake value written; `--json` emits that
1805
1910
  same summary for a script. A walk that fails partway exits nonzero and reports
@@ -1849,7 +1954,7 @@ and delivered as authoritative guidance. With no text (or only whitespace), it
1849
1954
  requests a bare retry and supplies no agent guidance. Verify has two explicit
1850
1955
  answer routes: guidance answering an agent verifier's own `ab escalate` returns
1851
1956
  to that same `verify:<step>` on `verify.started.feedback` and materializes as
1852
- `.ab/guidance.json`; the cited start carries it durably across any pre-launch
1957
+ `$AB_CONTEXT_DIR/guidance.json`; the cited start carries it durably across any pre-launch
1853
1958
  recovery, and the matching `session.started` consumes it once after launch.
1854
1959
  Guidance answering the policy escalation after exhausted failed verify reports
1855
1960
  instead goes to `implement` and outranks the pending report. A bare retry on either path carries
@@ -1872,18 +1977,20 @@ after the winner is delivered. Destinations remain independent, and a new
1872
1977
  answer recorded after an earlier delivery is eligible for the next appropriate
1873
1978
  run. `finalize` and `reconcile` receive their own answers on their next attempt.
1874
1979
  In each of these routed cases, `ab context`
1875
- writes the answer to `.ab/guidance.json` in the build's workspace, and the
1980
+ writes the answer to `$AB_CONTEXT_DIR/guidance.json` in the build's workspace, and the
1876
1981
  receiving skill treats it as authoritative feedback for that round or attempt.
1877
- A producer round's feedback is exclusive: on a guidance round
1878
- `.ab/guidance.json` replaces the reviewer's findings or a routed-back verify
1879
- failure, so the answer has to carry what the agent needs. A bare retry writes no
1880
- `.ab/guidance.json` and displaces nothing: the resumed round still gets whatever
1982
+ A producer round has one immediate feedback kind: on a guidance round,
1983
+ `$AB_CONTEXT_DIR/guidance.json` takes precedence over findings or the legacy
1984
+ single-report feedback. A referenced `verifyStageFailure` receipt remains
1985
+ available alongside guidance, with every failed report and cancelled/not-run
1986
+ member; it is not erased by feedback precedence. A bare retry writes no
1987
+ `$AB_CONTEXT_DIR/guidance.json` and displaces nothing: the resumed round still gets whatever
1881
1988
  the loop was already routing, such as the last review round's findings.
1882
1989
 
1883
1990
  `--dismiss` is per escalation. It answers only blockers that cite at least one
1884
1991
  real plan-review or code-review finding; blockers with no such citation remain
1885
1992
  open. A dismissed finding id means a human retired that disagreement. The next
1886
- reviewer receives `.ab/dismissed-findings.json`, must not re-raise the finding,
1993
+ reviewer receives `$AB_CONTEXT_DIR/dismissed-findings.json`, must not re-raise the finding,
1887
1994
  and must use a fresh id without `persists` if a genuinely different problem
1888
1995
  touches the same code. Dismissal settles a chain, not a file or the reviewer's
1889
1996
  ability to report new problems.
@@ -1909,24 +2016,24 @@ Each kernel `spec.revised` records the exact artifact and operator identity
1909
2016
  Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
1910
2017
  The node recollects and verifies the new revision, including on the same head
1911
2018
  and parent after a failed cycle. Earlier cycles remain historical evidence
1912
- and cannot block or authorize landing under the replacement. Children keep
2019
+ and cannot block or authorize merge under the replacement. Children keep
1913
2020
  their specs, claims and targets; contributions are not restarted.
1914
2021
  Active verification/reconcile or writer work, restack/reparent work, pause,
1915
- pending controls, landing intent and ended PRs refuse the no-escalation path.
2022
+ pending controls, merge intent and ended PRs refuse the no-escalation path.
1916
2023
  A concurrent state change refuses publication with a retry explanation;
1917
2024
  uncited artifacts are inert. Leaves still require an open escalation and
1918
2025
  restart from `plan`.
1919
2026
 
1920
2027
  Every command requires an applicable target in this repository. Pause and
1921
2028
  resume require an active build; abort and hold also accept queued builds.
1922
- Land requires a ready candidate and cannot bypass verification or merge gates;
2029
+ Merge requires a ready candidate and cannot bypass verification or merge gates;
1923
2030
  `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
1924
2031
  aborted, or otherwise inapplicable target is an error and gets no new event. Attribution uses `USER`, then `USERNAME`, then the
1925
2032
  same stable fallback on both surfaces. These commands run sessionless and
1926
2033
  accept `--store <ref>` with the usual explicit flag > `AB_STORE` > `[store] url` > repository
1927
2034
  local precedence. If nonblank `AB_SESSION` and matching `AB_BUILD` identify the
1928
2035
  caller's own phase build, the command refuses it; a phase cannot pause, resume,
1929
- hold, land, answer, or abort itself. `ab pause --all` and `ab resume --all`
2036
+ hold, merge, answer, or abort itself. `ab pause --all` and `ab resume --all`
1930
2037
  accept `--store` on the same precedence and are refused for the same reason
1931
2038
  whenever `AB_SESSION` and `AB_BUILD` are both nonblank — the caller's own build
1932
2039
  is inside the walk.
@@ -1940,7 +2047,7 @@ it. Startup still recovers actionable builds and delivers pending operator
1940
2047
  commands, but it never records an answer or re-arms a budget.
1941
2048
 
1942
2049
  Durable repository intake has launch-flag setters and a global-row toggle.
1943
- Landing policy is configured through ordered rules, with per-landing hold/land
2050
+ Merge policy is configured through ordered rules, with per-merge hold/merge
1944
2051
  commands; no writable repository auto-merge default remains.
1945
2052
  Abort is available through both its CLI command and the confirmed build-row/detail
1946
2053
  `a` key. Global-row `h` owns the durable harvest gate. Global-row `p`/`r` and
@@ -1968,7 +2075,7 @@ and are safe to run at any time.
1968
2075
  (`intake`, default `true`) and repository-wide pause (`paused`, default
1969
2076
  `false`), alongside dispatcher and infrastructure status. Its historical
1970
2077
  `defaultAutoMerge` field remains an inert compatibility value; it is not
1971
- claim-time policy or a writable setting. Landing decisions and command state
2078
+ claim-time policy or a writable setting. Merge decisions and command state
1972
2079
  are queried on the build. A repository with no journal row uses the defaults
1973
2080
  without creating a row. Human output is the default. `--json` emits one bare
1974
2081
  object including the canonical `repo`, and `--store` follows the usual explicit
@@ -2011,7 +2118,7 @@ changes — falling back to the local workspace's `autobuild.toml` only when no
2011
2118
  deposit exists; the decision is reported unavailable only when neither source
2012
2119
  can supply a configuration, and that message names the missing artifact kind
2013
2120
  rather than a workspace path.
2014
- Observations are shown without `--events`; for `forge = "local-git"`, this is where a deferred landing
2121
+ Observations are shown without `--events`; for `forge = "local-git"`, this is where a deferred merge
2015
2122
  names uncommitted work that collides with the squash. Autobuild leaves that work
2016
2123
  untouched and later dispatcher ticks retry automatically after the operator
2017
2124
  resolves it. `--events <n>` appends the newest `n` event envelopes in
@@ -2019,10 +2126,14 @@ chronological order — the fastest way to see what a build actually just did.
2019
2126
 
2020
2127
  Verify progress covers the **current cycle** — the results since the latest
2021
2128
  code-review approve or reconcile. Implement and reconcile change the code, so a
2022
- new cycle re-runs from the first step and earlier results describe code that no
2129
+ new cycle re-runs from the first stage and earlier results describe code that no
2023
2130
  longer exists. An empty step list next to `attempt 1` therefore means the cycle
2024
2131
  restarted, not that verify never ran. A skip renders as `SKIP` with its reason;
2025
2132
  JSON exposes `outcome: "skipped"` and `reason`, never a synthetic pass.
2133
+ Concurrent stages name every running verifier. Cancelled steps are shown as not
2134
+ run with their fail-fast cause; `ab wait --for phase=verify:<step>` matches any
2135
+ running member. Superseded escalation history remains available without an
2136
+ answer-required or blocked effect.
2026
2137
  `--json` and `--store <ref>` work the same here.
2027
2138
 
2028
2139
  Use `ab builds` to find the build; use `ab build status` to understand it.
@@ -2071,7 +2182,7 @@ closes, its finalized document is a repository-scoped `stream:<id>` artifact,
2071
2182
  and `ab artifact download stream:<id>` retrieves it; the stream form is an
2072
2183
  operator-only read (ambient phase identity fails closed).
2073
2184
 
2074
- **`ab watch [<slug>...] [--repository] [--event <glob>]... [--since <cursor>]
2185
+ **`ab watch [<slug>...] [--repository] [--operator] [--event <glob>]... [--since <cursor>]
2075
2186
  [--timeout <dur>] [--interval <dur>] [--count <n>] [--json] [--store <ref>]`**
2076
2187
  streams matching events as they land instead of answering once. With no slug it
2077
2188
  follows every nonterminal build in the repository — a build created while the
@@ -2092,7 +2203,7 @@ The default watch reports actionable conditions only:
2092
2203
  - Build `build.merge-decision`: a finalized open PR
2093
2204
  with a recorded consent decision awaiting consent, an explicit hold, or a
2094
2205
  current actionable merge-gate deferral. Policy decisions not yet recorded and
2095
- authorized landings awaiting application are silent. One merge decision is reported per build/PR.
2206
+ authorized merges awaiting application are silent. One merge decision is reported per build/PR.
2096
2207
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
2097
2208
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
2098
2209
  `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
@@ -2164,7 +2275,10 @@ invocation hides the holder start or the latest stop. Other state reads retain
2164
2275
  their bounded semantics.
2165
2276
 
2166
2277
  Repository-following `ab watch` additionally emits a read-only `dispatcher.lost`
2167
- observation when an observed lease expires without a matching stop. JSON carries
2278
+ observation when an observed lease expires without a matching stop or validated
2279
+ successor takeover. A completed ownership transfer suppresses predecessor loss
2280
+ even while its sessions drain; a handoff without takeover still reports loss on
2281
+ expiry. Successor loss and upgrade-failure/rollback attention remain independent. JSON carries
2168
2282
  `observation` instead of `event`, with run, observedAt, leaseExpiresAt and available
2169
2283
  identity, plus the usual repo/build/state/cursor fields. It invents no durable
2170
2284
  sequence or actor. Retain the cursor to avoid repeat reports across invocations.
@@ -2187,38 +2301,32 @@ and an appended matching event is delivered within about a second of its
2187
2301
  append rather than at the next tick — while `--interval` (default 5 seconds)
2188
2302
  still bounds the spacing between a stream's request starts, so a quiet stream
2189
2303
  costs roughly one request per 25 seconds and a chatty one no more than one
2190
- request per interval. The command is read-only — it appends no
2191
- event, takes no lease, creates no record, and starts no work — and deciding
2304
+ request per interval. Without `--operator`, the command is read-only. Neither form appends an event,
2305
+ takes a lease or starts work. Only flagged watches write advisory liveness, and deciding
2192
2306
  what to do about a blocker or a merge stays with the caller, not the command.
2193
2307
  Inside a phase, only the ambient build may be watched.
2194
2308
 
2195
- Two recipes cover the common harnesses. First, a line-per-notification tool
2196
- that re-arms periodically (Claude Code's Monitor tool expires after at most 30
2197
- minutes): the cursor is what makes each re-arming lossless — persist the final
2198
- `{"cursor": …}` line and pass it back through `--since` next time:
2199
-
2200
- ```sh
2201
- last=$(cat .ab-watch.cursor 2>/dev/null || true)
2202
- ab watch --json --timeout 30m ${last:+--since "$last"} \
2203
- | awk '/^\{"cursor":/ { cursor = $0; next } { print } \
2204
- END { if (cursor != "") print cursor > ".ab-watch.cursor" }'
2205
- ```
2206
-
2207
- Second, a plain shell loop — the same resume discipline wrapped in `while`:
2208
-
2209
- ```sh
2210
- while :; do
2211
- last=$(cat .ab-watch.cursor 2>/dev/null || true)
2212
- ab watch --json --timeout 30m ${last:+--since "$last"} \
2213
- | while IFS= read -r line; do
2214
- case $line in
2215
- '{"cursor":'* ) printf '%s\n' "$line" > .ab-watch.cursor ;;
2216
- * ) echo "$line" ;; # one JSON record per matching event
2217
- esac
2218
- done
2219
- sleep 1
2220
- done
2221
- ```
2309
+ For a standing operator loop, first check `ab repository status --json` for
2310
+ live `operator.registrations`. Report another live operator rather than registering
2311
+ unless the human directs otherwise. Arm `ab watch --operator --json` with no slugs;
2312
+ re-arm with `ab watch --operator --json --since <watch-cursor>` using only that
2313
+ standing watch's own final or record cursor. Reconcile active and newly dispatched
2314
+ builds after arming and on timeout. Keep watching after initially queued work ends.
2315
+ `ab wait` neither renews presence nor carries registration identity. Separate
2316
+ unflagged diagnostic watches and waits must not replace the monitor or its cursor.
2317
+
2318
+ `--operator` is advisory and permits multiple registrations. It rejects named
2319
+ slugs, even with `--repository`, and any ambient build or scoped session. Heartbeats
2320
+ run every 30 seconds independently of polling; orderly exits renew once more.
2321
+ Presence expires five minutes after the last successful heartbeat. SIGINT,
2322
+ SIGTERM, SIGHUP and stdout EPIPE attempt one withdrawal within about two seconds,
2323
+ after cancelling and draining pending heartbeats. Failures report on stderr and
2324
+ fall back to TTL expiry; an unsupported remote route falls back silently. SIGKILL
2325
+ still relies on TTL expiry. Timeout/count completion keeps presence for re-arming. Reusing its flagged watch cursor preserves the registration
2326
+ ID and original start time across re-arms, re-registering after withdrawal. Unflagged resumes remain read-only.
2327
+ Repository status lists live registrations with ID, host, PID, start, heartbeat
2328
+ and heartbeat age, or an empty list. Human status prints one operator summary.
2329
+ MCP registration and dashboard presence are deferred.
2222
2330
 
2223
2331
  **`ab wait [<slug>...] (--for <condition> | --event <glob>)... [--since <cursor>]
2224
2332
  [--timeout <dur>] [--interval <dur>] [--json] [--store <ref>]`** is the blocking
@@ -2318,7 +2426,7 @@ no run. The dispatch header always shows its acknowledged `harvest ON/OFF` gate
2318
2426
  and global `h` controls it. The optional, non-color-only `Harvest` row omits the
2319
2427
  internal run id and represents one deterministically selected open run or
2320
2428
  unresolved attention; its contextual `p` issues the repository-wide resume or
2321
- acknowledgement; `l` / `o` landing controls apply only to builds.
2429
+ acknowledgement; `l` / `o` merge controls apply only to builds.
2322
2430
 
2323
2431
  ### Status, durable progress, and lease health are separate
2324
2432
 
@@ -2409,7 +2517,7 @@ default, when you need to know what this repo's version says).
2409
2517
  | `ab-code-review` | `code-review` phase | Fresh skeptic: review the implementation diff against spec and plan, same verdict vocabulary. |
2410
2518
  | `ab-reconcile` | `reconcile` phase (epilogue) | Resolve a kernel-prepared single-change replay onto a frozen refreshed base; the kernel archives evidence and publishes with an exact expected-head guard. |
2411
2519
  | `ab-finalize` | `finalize` phase | Write the PR description for a green build; the kernel opens the PR. |
2412
- | `ab-operate` | outside the pipeline; model-invocable | The operator agent’s operating manual, for any agent: file and groom tickets, watch builds with a resumable `ab watch` / `ab wait` loop, answer escalations, pause, resume, abort, control landing consent and holds, and keep going until every shepherded build is merged, closed, or aborted. Also read by the hosted turn runner as its system prompt (registry tools, approval and budget suspension, wake turns). |
2520
+ | `ab-operate` | outside the pipeline; model-invocable | The operator agent’s operating manual, for any agent: file and groom tickets, operate the builds the repository's dispatcher dispatches with a registered `ab watch --operator` loop, answer escalations, pause, resume, abort, control merge consent and holds, and adopt new builds until the human ends or hands off the role. MCP presence is deferred. |
2413
2521
 
2414
2522
  Autobuild installs 12 skills. Everything except `ab-spec`, `ab-tickets`,
2415
2523
  `ab-guide`, and `ab-operate` carries `disable-model-invocation: true` — do not
@@ -2463,6 +2571,20 @@ and `tickets.unblock` with the revision from `tickets.get` or `tickets.list`.
2463
2571
 
2464
2572
  ## Forge failure recovery
2465
2573
 
2574
+ Leaf restack and reconcile publication retry classified transient forge or transport
2575
+ failures six times after the initial attempt, waiting 30, 60, 120, 240, 300 and
2576
+ 300 seconds. `publication.retry-scheduled` records the operation, frozen rewrite
2577
+ identity, episode anchor, failure ordinal, last error and absolute retry time;
2578
+ restart resumes that schedule without rerunning the resolver. These retries do
2579
+ not consume `maxPhaseAttempts`. A seventh transient failure records
2580
+ `publication.retry-exhausted` and raises `publication-retry-limit`, naming the last
2581
+ error and six retries. Answering that escalation opens a fresh publication episode
2582
+ for the same retained intent without resetting agent phase failures. Pending
2583
+ publication keeps its workspace through backoff and unresolved exhaustion.
2584
+ Classified rate limits retain repository cooldown and consume no publication
2585
+ retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
2586
+ errors retain their existing behavior.
2587
+
2466
2588
  Janitor failures are durable per-build episodes. Eligible failures retry after
2467
2589
  30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
2468
2590
  Skipped polls preserve the episode across restart. After
@@ -2473,7 +2595,7 @@ clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
2473
2595
  A classified forge rate limit records repository degradation with `resetAt`.
2474
2596
  Forge work waits during cooldown; passing the deadline permits a recovery
2475
2597
  request, and only success clears degradation. A further limit extends cooldown.
2476
- Native landing application failures keep candidate-specific retry eligibility,
2598
+ Native merge application failures keep candidate-specific retry eligibility,
2477
2599
  including automatic decisions without a human command. Retries recheck consent,
2478
2600
  holds, verification and the exact candidate. Uncertain enables remain pending
2479
2601
  until cancellation can be confirmed after cooldown. Publication retries reuse
@@ -2497,7 +2619,7 @@ using exact-resource ETags; authenticated 304s spare the REST primary quota.
2497
2619
  Adapter caches are bounded and restart/eviction falls back to fresh reads.
2498
2620
  Writes, including Git publication and rewrites, invalidate observations before
2499
2621
  attempting the mutation so acknowledgement reads remain fresh. Leaf PR polling
2500
- keeps its existing cadence. Readiness and landing inspections remain fresh.
2622
+ keeps its existing cadence. Readiness and merge inspections remain fresh.
2501
2623
 
2502
2624
  For node cadence, durable wakes, restart behavior and CLI evidence, see
2503
2625
  [node polling and status](references/integration-tree.md#polling-and-status).
@@ -2508,11 +2630,24 @@ primary quota, REST 304s and GraphQL calls. Transport failures and historical or
2508
2630
  legacy observations can remain unclassified; absent fields never imply zero.
2509
2631
  Shared requests are attributed to their first requester; cache hits count zero.
2510
2632
 
2633
+ Work target distance is advisory `target.distance` telemetry, sampled during
2634
+ normal target polls from exact build/target tips, never at render time. It
2635
+ counts destination commits absent from the build head (`BUILD..TARGET`).
2636
+ Detail target/Parent fields use the same suffix. Missing/stale samples display `+?`; zero and merged/closed states
2637
+ omit the suffix. This measurement never changes merge or restack decisions.
2638
+
2511
2639
  ### Requesting node freshness
2512
2640
 
2513
2641
  `ab restack <node>` and `builds.restack {repo, slug}` record durable demand.
2514
2642
  Paused or blocked nodes wait for normal safety gates; leaves, terminal nodes
2515
2643
  and unopened nodes are refused. Collecting nodes may intentionally trail their
2516
- parent; both dashboards show its commit distance, current, or unknown.
2644
+ parent; both dashboards show `+N` beside the destination, no suffix when
2645
+ current, or `+?` when unknown. Merged/closed builds omit the suffix.
2517
2646
  See [restacking timing and recovery](references/restacking.md) for the five
2518
2647
  automatic and explicit demand points, minimal presence paths and upgrade behavior.
2648
+
2649
+ ### `[landing]`
2650
+
2651
+ Deprecated config spelling for `[merge]` / `[[merge]]`; see the
2652
+ [compatibility notes](references/merge-policy.md#deprecated-spellings). Never
2653
+ declare both spellings, including empty arrays. `ab upgrade` migrates this key.