@defrex/autobuild 1.0.0 → 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
@@ -40,7 +40,7 @@ headers, or available backend.
40
40
  `[store] url` (in that precedence order, before the local default); the shipped client appends the routes below.
41
41
  - Every `/builds`, `/repos`, and `/sessions` request sends
42
42
  `X-Autobuild-Version` with the exact client package version and
43
- `X-Autobuild-Protocol-Version` with the remote protocol version (`4` in this
43
+ `X-Autobuild-Protocol-Version` with the remote protocol version (`6` in this
44
44
  distribution). Before authentication,
45
45
  body parsing, or resource lookup, the server validates the release-line window and known protocol identity.
46
46
  Unsupported or missing values receive `409 {"kind":"conflict","error":"…"}`;
@@ -473,7 +473,7 @@ requires. A held request's authentication, token scope, and version-skew rules
473
473
  are identical to the immediate form: a `401`, `403`, or `409` identity failure
474
474
  is answered immediately, never held.
475
475
 
476
- The parameter is purely additive in the version it landed in (protocol `2`,
476
+ The parameter is purely additive in the version it merged in (protocol `2`,
477
477
  where the event-wait rules were introduced): a server
478
478
  that ignores `wait` remains conforming — its immediate empty answers only raise
479
479
  the client's request rate — and a client that sends `wait` to such a server
@@ -514,13 +514,13 @@ creation operation and must not reset timestamps, events, artifacts, or lease
514
514
  state when the repository already exists. Event sequence numbering starts at 1
515
515
  for each repository independently of every build and other repository.
516
516
 
517
- A `BuildDigest` projects terminal, observation, and compact landing evidence
517
+ A `BuildDigest` projects terminal, observation, and compact merge evidence
518
518
  from one build's log:
519
519
 
520
520
  ```jsonc
521
521
  // BuildDigest
522
522
  {
523
- "integrationAuditPending": true, // optional: kernel landing audit requested, not yet settled
523
+ "integrationAuditPending": true, // optional: kernel merge audit requested, not yet settled
524
524
  "slug": "ab-fix-login-3",
525
525
  "terminal": "done", // optional: "done" | "aborted", omitted while the log has neither
526
526
  "observations": [ // ascending-seq pairs for the log's observation.recorded events
@@ -528,7 +528,7 @@ from one build's log:
528
528
  { "seq": 4, "ts": "2026-07-15T12:00:04.000Z" }
529
529
  ],
530
530
  "merged": "2026-07-15T12:00:06.000Z", // optional: ts of the log's latest pr.merged, omitted when none
531
- "mergedSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", // optional: that merge's actual landing SHA
531
+ "mergedSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", // optional: that merge's actual merge SHA
532
532
  "nodeContribution": { // optional: latest node.contribution-recorded payload
533
533
  "landing": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
534
534
  "head": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
@@ -539,7 +539,7 @@ from one build's log:
539
539
  ```
540
540
 
541
541
  The optional `mergedSha` and `nodeContribution` fields let admission index
542
- confirmed landing evidence without fetching every historical build's full facts.
542
+ confirmed merge evidence without fetching every historical build's full facts.
543
543
  A node contribution is usable only when its `landing` matches `mergedSha`;
544
544
  recording or recovering a contribution advances `readinessChangeSeq`. These
545
545
  members are additive: older peers can omit them, leaving presence unproven rather
@@ -687,6 +687,10 @@ authority:
687
687
 
688
688
  ## 5. Operator-session operations
689
689
 
690
+ Operator HTTP writes record facts only; they never start or resume an agent
691
+ turn. Historical turn events and streams retain their validation and read
692
+ contracts. External operator harnesses own execution and scheduling.
693
+
690
694
  Operator sessions are a third resource kind: durable orchestrator-conversation
691
695
  state keyed by repository and session owner (the human account in `operator`). They are hosted-only — local installs
692
696
  interact through the CLI and dashboard and never create one — but the resource
@@ -892,7 +896,7 @@ by this rule (their retention belongs to the open archival thread), and open
892
896
  streams are never pruned. A read of a stream whose chunks were pruned returns
893
897
  no chunks, `status: "closed"`, and the artifact reference.
894
898
 
895
- These additions were purely additive in the version they landed in (protocol
899
+ These additions were purely additive in the version they merged in (protocol
896
900
  `2`, where the stream routes were introduced), and a
897
901
  conforming server implements the stream routes together with this document's
898
902
  rules exactly as it does for the event and artifact routes.
@@ -1235,10 +1239,11 @@ Four shipped behaviors do not add `BuildStore` routes:
1235
1239
  - `RemoteBuildStore.close()` is a no-op. The remote server owns its backing
1236
1240
  store lifecycle; there is no close endpoint.
1237
1241
  - `GET /health` is outside the `BuildStore` interface. It is always open and
1238
- returns exactly `200 {"ok":true,"autobuildVersion":"<package>",
1239
- "protocolVersion":"4", "supportedClientRange":{"minVersion":"0.9.0",
1240
- "maxVersionExclusive":"0.12.0"}}`. It reports HTTP-process availability and identity,
1241
- not a deeper backing-store transaction or migration check.
1242
+ returns `200 {"ok":true,"autobuildVersion":"1.1.0",
1243
+ "protocolVersion":"6", "supportedClientRange":{"minVersion":"1.0.0",
1244
+ "maxVersionExclusive":"1.2.0"}}`. It reports HTTP-process availability and identity,
1245
+ not a deeper backing-store transaction or migration check. The example shows
1246
+ the target 1.1 release identity; the checkout still uses its installed package version.
1242
1247
 
1243
1248
  There is no push/WebSocket subscription protocol, repository listing, artifact
1244
1249
  deletion, or server deployment API. The one repo-scoped batch read is the
@@ -1337,3 +1342,63 @@ clients, retaining their decoders and the supported three-line window.
1337
1342
  fact: `{ identity, from, to, mapping }`, where mapping contains source ticket IDs
1338
1343
  and destination IDs. All migration facts survive dispatcher-run turnover.
1339
1344
  Conflicting identity reuse or source-qualified mappings fail replay closed.
1345
+
1346
+
1347
+ Browser lookup returns `{connection,assignment,organizations}`. `connection` may
1348
+ be null; `assignment` is `new` only when neither registry history nor retained
1349
+ assignment exists, otherwise `fixed`. Organizations are eligible `{id,name,membershipRole}`
1350
+ destinations for a new project (all for super users, actual memberships otherwise),
1351
+ empty for fixed reconnects or unknown codes. Context uses the same lookup limits,
1352
+ expiry, admission and foreign-project masking; it does not assign anything.
1353
+ The browser shows a chooser only with multiple destinations, disables approval
1354
+ with zero, and sends no destination for fixed reconnects. For one actual
1355
+ membership it preserves implicit selection; a super user with a sole eligible
1356
+ organization but no membership sends that ID explicitly.
1357
+
1358
+ Browser connection approval accepts optional `organizationId` in the decide JSON.
1359
+ A new project defaults to the approver's only actual membership; zero or multiple
1360
+ memberships require an explicit org, including for super users. Members can select
1361
+ their own orgs; super users can select any org. Registration, assignment and
1362
+ credential insertion commit atomically. Reconnect requires current project access
1363
+ and preserves its assignment; moving projects uses organization management only.
1364
+ Previously registered unassigned projects, whether active or removed, can be
1365
+ reconnected only by super users and remain unassigned. Any registry history
1366
+ distinguishes an existing project from a new one. Assigning its retained history
1367
+ to an organization requires the super-user management route after re-registration.
1368
+ Browser lookup and decisions hide foreign projects as unknown
1369
+ connections, even after resolution. Machine request/poll/cancel/status/revoke
1370
+ contracts and existing credentials are unchanged.
1371
+
1372
+ ## Operator presence
1373
+
1374
+ The presence collection uses `POST /repos/:repo/operator-presence` and `GET` of that collection.
1375
+ These require repository operator/admin authority; build, harvest and conversation
1376
+ credentials are rejected before presence lookup or mutation. No MCP tools are added.
1377
+
1378
+ POST accepts a strict `{id, host, pid, startedAt}` object: ID and host are nonblank
1379
+ strings of at most 256 characters, PID a positive safe integer, and startedAt a
1380
+ valid ISO timestamp. It atomically upserts `(repo,id)`, preserving the original
1381
+ start time, updating host/PID and stamping heartbeatAt from the adapter clock.
1382
+ Heartbeat never moves backward. The response is `{repo,id,host,pid,startedAt,heartbeatAt}`.
1383
+ GET returns those records ordered by ID, only where heartbeat age is less than
1384
+ 300,000ms; an unknown repository returns `[]` without creating anything. Neither
1385
+ collection operation appends events, claims leases or requires a repository journal. Expired
1386
+ rows can be renewed under the same ID. Multiple concurrent registrations coexist;
1387
+ this is advisory liveness, with no election, lock or singleton semantics.
1388
+
1389
+ Protocol 6 adds `DELETE /repos/:repo/operator-presence/:id`, with the same
1390
+ repository operator/admin authority and delegated credential refusal before lookup
1391
+ or mutation. The ID is one encoded segment with the same validation as POST.
1392
+ It returns `{ok:true}` even for an absent/expired ID or absent repository, removes
1393
+ only that repository/ID, and creates no journal, event or lease. A later POST
1394
+ re-registers the same ID. Watch withdrawal treats only 404/405 as an unsupported
1395
+ route and silently retains TTL expiry; authorization, transport and malformed
1396
+ success errors are diagnosed without failing the watch.
1397
+
1398
+ This checkout prepares protocol 6 for the next minor line, 1.1. Published
1399
+ v1.0.0/v1.0.1 shipped protocol 4; protocol 5 never shipped. The release identity
1400
+ table retains `1.0 -> 4`, and a 1.1/protocol-6 service admits those published
1401
+ clients. A 1.0 service does not admit 1.1 clients; route fallback never bypasses
1402
+ peer admission. Package versions remain unchanged during feature preparation;
1403
+ the maintainer's later minor release command owns the version bump. Patches
1404
+ within a published release line must keep its protocol identity.
@@ -332,7 +332,7 @@ This capability is independent of revision and comment capabilities and of the
332
332
  client version. Without it, both fields are projected away, preserving historical
333
333
  strict decoders. Current hosted clients send all three capability headers and
334
334
  default absent kind to `work`. Unfiltered listing includes all ticket states and
335
- empty nodes for `ab ticket tree`; dispatch and landing behavior are unchanged.
335
+ empty nodes for `ab ticket tree`; dispatch and merge behavior are unchanged.
336
336
 
337
337
  Completed ticket imports record `tickets.migration-recorded` in the selected
338
338
  BuildStore repository journal, with export identity, origin/destination adapter
@@ -19,19 +19,24 @@ Destination observations are durable `target.moved` facts, including while an
19
19
  agent runs. Verify-entry restack freezes a current base before verification;
20
20
  path selection excludes upstream-only paths. After finalize and post-steps,
21
21
  waiting leaves restack when the target moves. Node-target finalize contributions
22
- are canonicalized before guarded landing even when the target SHA is unchanged.
23
- Clean replay starts no agent. A clean waiting leaf rewrite preserves prior
24
- verification; reports retain their actual cycle base/head. Conflicted replay
25
- runs reconcile and verification, and initial verification cannot be skipped
26
- through post-reconcile policy.
22
+ are canonicalized before guarded merge even when the target SHA is unchanged.
23
+ Clean replay starts no agent. A clean waiting leaf rewrite preserves completed
24
+ verification when build-owned config is unchanged, even when replay replaces
25
+ the pin commit's ancestry. Reports retain their actual cycle base/head.
26
+ Changed config still starts a fresh verification cycle while waiting. Before
27
+ running further verification steps, cycles also require known pin ancestry;
28
+ a future cycle captures fresh config from its checkout. Configuration
29
+ supersession is separate from replay and reconcile. Conflicted replay runs
30
+ reconcile and verification, and initial verification cannot be skipped through
31
+ post-reconcile policy.
27
32
 
28
33
  Nodes observe parent movement durably but restack only on demand: before a
29
- complete nonempty node verifies; before landing if its parent moved; when queued
34
+ complete nonempty node verifies; before merge if its parent moved; when queued
30
35
  dependency presence requires an ancestor change; on `ab restack <node>`; or on
31
36
  accepted re-parenting. There is no eager mode or cadence option. Nested nodes
32
37
  need their own demand. Existing frozen transactions, including ones reserved
33
38
  before upgrade, finish first; later demand coalesces onto the latest parent.
34
- Leaves keep verify-entry and awaiting-landing restacks for every target.
39
+ Leaves keep verify-entry and awaiting-merge restacks for every target.
35
40
 
36
41
  For observation cadence, durable wakes and last-check evidence, see
37
42
  [node polling and status](integration-tree.md#polling-and-status).
@@ -48,11 +53,29 @@ and unopened nodes. Paused or blocked nodes wait for their normal safety gates.
48
53
  A request arriving during replay survives until its parent and required identities
49
54
  are covered. Re-parenting invalidates requests for the old destination.
50
55
 
51
- Both dashboards show `parent N commits ahead`, `parent current`, or
52
- `parent distance unknown`. Distance counts commits reachable from the observed
53
- parent but not the last confirmed contribution base; it is not elapsed time or
54
- poll count. Samples are invalidated by replay or re-parenting. A stale node
55
- cannot verify or land; inventory and child landings continue while it collects.
56
+ Both dashboards use `+N` beside the destination for commits it has that the
57
+ build lacks, no suffix when current, and `+?` when unknown. Merged and closed
58
+ builds omit the suffix. Terminal list rows put `→ destination +N` on the slug
59
+ line; work steps follow immediately and integration progress keeps only the
60
+ bar and child counts. Detail target/Parent fields use the same suffix.
61
+
62
+ Work distance counts destination commits absent from the sampled current build
63
+ head (`BUILD..TARGET`). It is advisory durable telemetry refreshed during normal
64
+ target polls, including when the build head changes. Unavailable or stale samples
65
+ are unknown; this observation does not change merge or restack decisions.
66
+
67
+ Integration parent distance counts commits reachable from the observed parent
68
+ but not the last confirmed contribution base; it is not elapsed time or poll
69
+ count. Samples are invalidated by replay or re-parenting. This freshness gate
70
+ applies to nodes: a stale node cannot verify or merge; inventory and child merges
71
+ continue while it collects.
72
+
73
+ Restack and reconcile publication reject tracked modifications with the existing
74
+ clean-worktree error. Nonignored untracked files do not block publication and
75
+ remain unpublished and untouched; each publication that encounters them records
76
+ a path-bearing `observation.recorded` followup, deduplicated by operation,
77
+ transaction, candidate SHA and exact path list on recovery. The phase-terminal
78
+ D5 clean-worktree rule for `ab done` remains unchanged.
56
79
 
57
80
  Before replacement the kernel publishes retained tips, displaced heads and the
58
81
  temporary change under immutable exact archive refs. `restack.*` facts record
@@ -80,7 +103,7 @@ Ordered source identities survive, and identities already reachable upstream
80
103
  are dropped. Untagged commits, including empty ones, are foreign.
81
104
 
82
105
  A separate node writer lease and durable reservation serialize restacks and
83
- child landings. Reservations freeze expected head, parent, contribution boundary,
106
+ child merges. Reservations freeze expected head, parent, contribution boundary,
84
107
  archives, changes and merge proofs. Lease expiry recovers the same operation,
85
108
  not a competing one. Prepared/conflicted/replayed item receipts, publication
86
109
  intent, proven replacement and settlement distinguish each recovery boundary.
@@ -108,10 +131,26 @@ identity refuses the whole restack. The branch and contribution boundary remain
108
131
  untouched and the integration build escalates with offending evidence. The kernel
109
132
  never preserves merge topology or decomposes an unsafe merge automatically.
110
133
 
111
- See [integration trees](integration-tree.md), [landing](landing-policy.md), and
134
+ See [integration trees](integration-tree.md), [merge](merge-policy.md), and
112
135
  [migration](migration-1.0.md).
113
136
 
114
137
  Native cancellation receipts are candidate- and operation-specific. Publication
115
138
  retries confirm forge state before reusing a receipt; external re-enables require
116
- another confirmed cancellation. Classified transient landing failures retain
139
+ another confirmed cancellation. Classified transient merge failures retain
117
140
  retry eligibility and recheck authorization after repository forge cooldown.
141
+
142
+ ## Leaf publication retry recovery
143
+
144
+ Leaf restack and reconcile publication retry classified transient forge or transport
145
+ failures six times after the initial attempt, waiting 30, 60, 120, 240, 300 and
146
+ 300 seconds. `publication.retry-scheduled` records the operation, frozen rewrite
147
+ identity, episode anchor, failure ordinal, last error and absolute retry time;
148
+ restart resumes that schedule without rerunning the resolver. These retries do
149
+ not consume `maxPhaseAttempts`. A seventh transient failure records
150
+ `publication.retry-exhausted` and raises `publication-retry-limit`, naming the last
151
+ error and six retries. Answering that escalation opens a fresh publication episode
152
+ for the same retained intent without resetting agent phase failures. Pending
153
+ publication keeps its workspace through backoff and unresolved exhaustion.
154
+ Classified rate limits retain repository cooldown and consume no publication
155
+ retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
156
+ errors retain their existing behavior.
package/docs/setup.md CHANGED
@@ -126,7 +126,8 @@ exits nonzero on failure. Then:
126
126
  6. Run `ab init --validate`. Fix every named failure, review warnings and unknowns, and rerun
127
127
  validation. Setup ends at successful validation. Ask the human to start
128
128
  `bun ab dispatch`, then open their coding agent at the repository root with
129
- `ab-operate` loaded to specify, create, groom, and shepherd the first ticket.
129
+ `ab-operate` loaded to specify, create and groom the first ticket. Check operator
130
+ presence before taking the role; an existing operator picks up ready work.
130
131
  The setup agent must not start dispatch itself.
131
132
 
132
133
  Validation is explicit and noninteractive. It does not dispatch, claim a
@@ -308,7 +309,7 @@ apart from the identity change, `ab dispatch` behaves as it did.
308
309
 
309
310
  A hosted-store deployment configures its web/auth variables once — see the
310
311
  hosted service README and the complete environment reference in the pinned
311
- distribution checkout: `BETTER_AUTH_URL`, `AB_WEB_ALLOWED_EMAILS`,
312
+ distribution checkout: `BETTER_AUTH_URL`, `AB_WEB_SUPER_USER_EMAILS`,
312
313
  and the optional `AB_WEB_MCP_RESOURCE` — the protected
313
314
  resource the hosted MCP server (docs/mcp.md) binds its OAuth tokens to,
314
315
  defaulting to `<BETTER_AUTH_URL>/mcp`. Set it only when a proxy or custom
@@ -380,7 +381,10 @@ and adding identity. SSH git spellings normalize to HTTPS; local paths and
380
381
  credential-bearing HTTPS URLs are rejected. Duplicate adds preserve metadata;
381
382
  remove is idempotent, and re-adding records a fresh addition.
382
383
 
383
- Every allowlisted signed-in user owns every registered project. The dashboard,
384
+ Super users can operate every registered project. Organization members can
385
+ operate only active projects assigned to their organizations; legacy unassigned
386
+ projects are visible only to super users. Membership is granted by normalized
387
+ email, including before first sign-in, and is rechecked on every request. The dashboard,
384
388
  MCP discovery and calls, and every operator API route consult current
385
389
  registration. Removal hides a project from all these surfaces and subsequent
386
390
  hosted dispatcher invocations; builds, events, artifacts and tickets remain,
@@ -410,10 +414,28 @@ A repository-owned agent-verify skill is a verifier, not a reviewer: it drives
410
414
  the running application and observes whether the spec's acceptance criteria
411
415
  hold. It does not inspect the diff for style or edit product code.
412
416
 
417
+ Repository-authored finalize skills also run `ab context` and read hydrated inputs
418
+ from `$AB_CONTEXT_DIR`, using the manifest for collision-adjusted paths.
419
+
413
420
  Its session instructions must preserve this contract:
414
421
 
415
- 1. Run `ab context`. The verifier receives `.ab/spec.md`, the configured step,
416
- the commit range, and, after escalation is answered, `.ab/guidance.json`.
422
+ Scratch output, downloaded references, probes, and temporary scripts belong under `.ab/`
423
+ (prefer the current `$AB_CONTEXT_DIR` when appropriate), never at the worktree
424
+ root, and must not be committed. Manifest-directed artifact paths remain authoritative.
425
+
426
+ Large scratch belongs under the session's `.ab/` directory (prefer `$AB_CONTEXT_DIR`),
427
+ not `/tmp`: this includes ad-hoc PostgreSQL data/cluster directories, Cargo target
428
+ directories, browser profiles, and database copies. Configure `PGDATA`,
429
+ `CARGO_TARGET_DIR`, and explicit browser profile paths for those resources.
430
+ Keep `TMPDIR` outside the worktree for test suites and commands that discover
431
+ repositories or configuration through parent directories, including focused tests
432
+ and Git probes. Do not relocate required installed tooling or retained evidence;
433
+ manifest-directed artifact paths remain authoritative. Never commit scratch.
434
+
435
+
436
+ 1. Run `ab context` and read `"$AB_CONTEXT_DIR/context.json"`. The verifier receives
437
+ `$AB_CONTEXT_DIR/spec.md`, the configured step,
438
+ the commit range, and, after escalation is answered, `$AB_CONTEXT_DIR/guidance.json`.
417
439
  Node verify sessions also receive `nodeVerification` in the context manifest:
418
440
  contribution specs and a provenance index mapping commits to the builds that
419
441
  introduced them. Read those specs through the manifest's allocated paths.
@@ -543,7 +565,7 @@ performs test pushes.
543
565
  Require **linear history** on protected root and node target branches to prevent
544
566
  merge commits from GitHub's update-branch action. On the configured root, enable
545
567
  **Require branches to be up to date before merging**, with nonempty required
546
- checks enforced for all merge actors. This makes root node landings fenced;
568
+ checks enforced for all merge actors. This makes root node merges fenced;
547
569
  without it they are best-effort. Both are recommendations, so missing settings
548
570
  produce warnings rather than hard failures.
549
571
 
@@ -567,3 +589,16 @@ access, revalidate and restart dispatch to refresh its startup diagnostics.
567
589
  Changing the connected ticket source does not itself migrate in-flight builds.
568
590
  Follow [ticket migration](ticket-migration.md), keeping the existing BuildStore
569
591
  and recording continuity before resuming build-related ticket writes.
592
+
593
+
594
+ The retired `AB_WEB_ALLOWED_EMAILS` variable is refused at startup, even if empty.
595
+ Replace it with `AB_WEB_SUPER_USER_EMAILS`; review the list because these identities
596
+ are deployment maintainers. Open Organizations from the account menu to create
597
+ the first organization, then Members to add people by email and choose an owner,
598
+ and Projects to assign legacy unassigned projects. The
599
+ [browser management contract](operator-api.md#organization-management-browser)
600
+ also documents the underlying HTTP routes. Super users alone
601
+ create orgs, set or clear the single owner, and assign or move projects. Owners
602
+ manage their org's members. Removing the last membership or super-user designation
603
+ revokes human access on the next request without re-login; existing project
604
+ credentials remain valid until revoked.
package/docs/skills.md CHANGED
@@ -29,7 +29,7 @@ Skills guide the agents that plan, implement, review and operate Autobuild, one
29
29
  | `ab-code-review` | Review the implementation against the contract independently |
30
30
  | `ab-finalize` | Write the pull request description after verification |
31
31
  | `ab-reconcile` | Resolve conflicts in a kernel-prepared replay onto a refreshed base |
32
- | `ab-operate` | External operator agent: file tickets, watch builds, answer escalations, control landing |
32
+ | `ab-operate` | External operator agent: operate the builds the repository's dispatcher dispatches, adopt new work, answer escalations and control merge |
33
33
  | `ab-tickets` | Read, create, groom and update tickets through the tracker interface |
34
34
  | `ab-harvest` | Turn claimed observations into ticket proposals |
35
35
  | `ab-harvest-review` | Review those proposals independently |
@@ -58,7 +58,7 @@ evidence is not.
58
58
 
59
59
  Every build pays a fixed cost no matter how small its diff: spec, plan and
60
60
  plan review, code review, the repository's full verify suite, finalize,
61
- landing, and a restack for everything queued behind it. Ten small tickets pay
61
+ merge, and a restack for everything queued behind it. Ten small tickets pay
62
62
  that cost ten times, and a blocker chain pays it in series. Prefer fewer,
63
63
  larger tickets: one ticket per coherent change, as large as one plan and one
64
64
  review pass can hold without the quality bar slipping.
@@ -68,7 +68,7 @@ or fix a reviewer can judge in a single pass, one plan can cover it without
68
68
  deferring a design decision to a later build, and its out-of-scope list is
69
69
  short and obvious. It is too big when its criteria fall into groups that share
70
70
  no behavior, when part of it waits on a decision nobody has made, or when its
71
- parts need different landing — one can ship now while another needs consent
71
+ parts need different merge — one can ship now while another needs consent
72
72
  or must wait.
73
73
 
74
74
  Do not split:
@@ -103,7 +103,7 @@ A cut at a seam pays twice:
103
103
 
104
104
  If no seam exists where the work divides, keep it as one ticket, or make the
105
105
  first ticket establish the contract with tests at the boundary and block the
106
- tickets on either side of it until it lands. After that, they can build
106
+ tickets on either side of it until it merges. After that, they can build
107
107
  concurrently.
108
108
 
109
109
  State the seam in each ticket as behavior, not structure: what the contract
@@ -117,7 +117,7 @@ a planner reading one ticket knows what its siblings own.
117
117
  A split feature takes as long as its longest blocker chain, not as long as
118
118
  its ticket count. A wave of independent tickets finishes in about one build's
119
119
  time; the same tickets in a chain take one build per link. Prefer cuts that
120
- let tickets start together. When one ticket must land first — usually the one
120
+ let tickets start together. When one ticket must merge first — usually the one
121
121
  that establishes a shared contract — keep it to that contract and its tests,
122
122
  so the wave behind it starts sooner, and fold nothing unrelated into it.
123
123
  Add a blocker only for a real prerequisite, never to express a preferred
@@ -143,10 +143,10 @@ Each kernel `spec.revised` records the exact artifact and operator identity
143
143
  Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
144
144
  The node recollects and verifies the new revision, including on the same head
145
145
  and parent after a failed cycle. Earlier cycles remain historical evidence
146
- and cannot block or authorize landing under the replacement. Children keep
146
+ and cannot block or authorize merge under the replacement. Children keep
147
147
  their specs, claims and targets; contributions are not restarted.
148
148
  Active verification/reconcile or writer work, restack/reparent work, pause,
149
- pending controls, landing intent and ended PRs refuse the no-escalation path.
149
+ pending controls, merge intent and ended PRs refuse the no-escalation path.
150
150
  A concurrent state change refuses publication with a retry explanation;
151
151
  uncited artifacts are inert. Leaves still require an open escalation and
152
152
  restart from `plan`.
@@ -62,25 +62,25 @@ and claims the ticket only after they resolve and other readiness gates pass.
62
62
 
63
63
  Read [nodes and targets](integration-tree.md) for lifecycle, validation and
64
64
  source storage, and [choosing a destination](integration-tree.md#choosing-a-destination)
65
- when filing a feature set. Blockers order work independently of landing targets;
66
- landing authorization follows the repository's matched policy.
65
+ when filing a feature set. Blockers order work independently of merge targets;
66
+ merge authorization follows the repository's matched policy.
67
67
 
68
68
  ## When a blocker resolves
69
69
 
70
70
  In a repository with nodes, a blocker that has a build resolves when its change
71
71
  is present in the dependent's target head (or the configured root branch).
72
72
  Source done state and aggregate blocker flags do not bypass this gate. A
73
- confirmed landing SHA reachable from the sampled target proves presence even
73
+ confirmed merge SHA reachable from the sampled target proves presence even
74
74
  without a build trailer. A node blocker requires its entire completed owned
75
75
  contribution, including nested changes and foreign commits, excluding inherited
76
76
  parent history. An empty completed contribution is satisfied; missing evidence,
77
77
  an open or aborted node, or ambiguous newest build generations remain queued.
78
78
  Older successful generations are never substituted for the newest build.
79
79
 
80
- - Same node: the blocking change lands directly into the target.
81
- - Ancestor: the change lands into an ancestor, then presence demand restacks only the required path to the target.
82
- - Sibling: the blocking node lands into their common ancestor, then presence demand reaches the target through the minimal ancestor path.
83
- - Descendant: the blocking node lands into the dependent's target ancestor.
80
+ - Same node: the blocking change merges directly into the target.
81
+ - Ancestor: the change merges into an ancestor, then presence demand restacks only the required path to the target.
82
+ - Sibling: the blocking node merges into their common ancestor, then presence demand reaches the target through the minimal ancestor path.
83
+ - Descendant: the blocking node merges into the dependent's target ancestor.
84
84
 
85
85
  Blockers that never had a build, and repositories without nodes, retain the
86
86
  source's done-state rule. Waiting tickets stay source work; diagnostics identify
package/docs/tickets.md CHANGED
@@ -48,6 +48,12 @@ The dispatcher claims only tickets in the ready state with the required labels a
48
48
  - **Blockers.** Unresolved prerequisite tickets keep it queued; they don't create a blocked build. With nodes, prerequisites with builds must be present at the sampled destination; see [integration and blocker presence](integration-overview.md).
49
49
  - **Destination and capacity.** Its target must accept new work, and a capacity slot must be free.
50
50
 
51
+ Before ready filing, the agent checks `ab repository status --json`. With live
52
+ `operator.registrations`, it records intent, rejected alternatives and out-of-scope
53
+ reasons in the ticket body, files, tells you the existing operator will pick it up,
54
+ and stops without a watch. Otherwise it takes the operator role for the builds the repository's dispatcher dispatches.
55
+ Your explicit instruction overrides either default; non-ready work needs no watch.
56
+
51
57
  At dispatch, Autobuild pins the spec, so later tracker edits don't change what reviewers approved. A deliberate revision goes through your operator agent answering an escalation, and restarts planning:
52
58
 
53
59
  ```sh
@@ -60,9 +66,9 @@ bun ab answer <slug> --revise-spec-from-ticket
60
66
  | Kind | Describes | Runs |
61
67
  |---|---|---|
62
68
  | Work | an individual change | the build pipeline |
63
- | Node | a finite integration point | collects related work, verifies it together, lands into its parent |
69
+ | Node | a finite integration point | collects related work, verifies it together, merges into its parent |
64
70
 
65
- Both kinds need conforming specs; a node's intent alone isn't a buildable contract. Set the kind with `ab ticket create` or `ab ticket update --kind work|node`. See [integrating related work](integration-overview.md) for targets, node admission and landing.
71
+ Both kinds need conforming specs; a node's intent alone isn't a buildable contract. Set the kind with `ab ticket create` or `ab ticket update --kind work|node`. See [integrating related work](integration-overview.md) for targets, node admission and merge.
66
72
 
67
73
  Outside signals and agent discoveries enter through [Intake and harvest](intake.md) as proposals, groomed before they become ready work.
68
74
 
@@ -71,7 +71,7 @@ bun ab harvest status
71
71
 
72
72
  **Symptom.** A build stops advancing, often after an interruption.
73
73
 
74
- **Cause.** Escalated, paused, waiting on landing gates, starting a runner, or recovering an expired lease. A quiet log isn't a crash.
74
+ **Cause.** Escalated, paused, waiting on merge gates, starting a runner, or recovering an expired lease. A quiet log isn't a crash.
75
75
 
76
76
  **Fix.** Inspect the build, reading status, progress and lease health separately:
77
77
 
@@ -103,7 +103,7 @@ See [answering blocked builds](operating.md#answer-and-pause). Preserve event lo
103
103
  **Cause.** Registration, allowed-user access, project credentials and dispatcher selection are separate gates.
104
104
 
105
105
  - **Registration.** Check the active PostgreSQL project registry; build or ticket data doesn't register a project.
106
- - **Access.** Every allowlisted user sees all active entries; verify sign-in separately from credentials.
106
+ - **Access.** Super users see all active entries; members see only their organizations’ projects; verify sign-in separately from credentials.
107
107
  - **Administration.** With deployment database credentials, an administrator runs `ab-hosted-store projects list`, `projects add` or `projects remove`. Mutations require `--user IDENTITY` for attribution; project tokens can't administer registrations.
108
108
  - **Dispatcher selection.** `AB_DISPATCHER_REPOSITORIES` in the hosted dispatch environment selects projects: unset selects every active registration; an explicit ordered list is intersected with current registrations.
109
109
  - **Dashboard fallback.** With no selection, the dashboard shows the first registered origin.
package/docs/upgrading.md CHANGED
@@ -9,6 +9,11 @@ description: "Update the pinned installation, preserve customization, and resume
9
9
 
10
10
  Autobuild is an exact pinned development dependency. Pin the release you intend and review manifest and lockfile together.
11
11
 
12
+ Build sessions now hydrate inputs under `.ab/<phase>/` (or `.ab/verify-<step>/`
13
+ and `.ab/finalize-<step>/`). Repository-authored skills must replace hardcoded
14
+ hydrated `.ab/<file>` paths with `$AB_CONTEXT_DIR/<file>`. Custom output scratch
15
+ may still live elsewhere under `.ab/`.
16
+
12
17
  ## Update the installation
13
18
 
14
19
  Stop the dispatcher cleanly first and let its sessions drain or suspend. Your operator agent diagnoses the need; you manage the process.
@@ -29,8 +34,8 @@ Check what upgrade committed, then review and commit the version bump.
29
34
 
30
35
  Upgrade keeps your `autobuild.toml`; supported migrations may amend it.
31
36
 
32
- - **Explicit landing policy:** a valid policy stays byte-for-byte unchanged.
33
- - **Absent landing policy:** upgrade reads the target repository's journal. Legacy ON becomes leaf auto; OFF or no fact becomes leaf consent; nodes get consent either way. If the journal is unavailable, restore access or configure policy deliberately, then retry.
37
+ - **Explicit merge policy:** a valid `merge` array stays byte-for-byte unchanged. A deprecated `landing` array is renamed to `merge`, preserving rule values, order and comments without reading the legacy journal. Declaring both keys is an error.
38
+ - **Absent merge policy:** upgrade reads the target repository's journal. Legacy ON becomes leaf auto; OFF or no fact becomes leaf consent; nodes get consent either way. If the journal is unavailable, restore access or configure policy deliberately, then retry.
34
39
 
35
40
  Skills [merge three ways](skills.md#how-upgrades-preserve-customization), with validated agent resolutions for overlapping edits. An unresolved conflict leaves that file untouched while others advance. Read the [upgrade report](skills.md#how-upgrades-preserve-customization) and diff even after exit zero: content conflicts don't fail the command. A conflict-free upgrade makes a narrowly scoped local commit. With `--no-commit`, conflicts or unsafe Git state, edits stay uncommitted with an explanation; resolve the reported files and commit.
36
41
 
@@ -47,4 +52,4 @@ bun ab dispatch
47
52
  - **Old behavior.** Drain old work before switching if it must keep the old execution behavior; no claim-version switch preserves it.
48
53
  - **Hosted services.** Upgrade the hosted service before its connected projects, within its compatibility window.
49
54
 
50
- Read [Infrastructure seams](seams.md) and [Repository configuration](configuration-overview.md) before changing infrastructure or landing policy.
55
+ Read [Infrastructure seams](seams.md) and [Repository configuration](configuration-overview.md) before changing infrastructure or merge policy.
@@ -18,16 +18,49 @@ Every repository needs an **acceptance check**: an agent verify step that runs t
18
18
 
19
19
  ## Steps and outcomes
20
20
 
21
- `[verify].steps` lists ordered `verify:*` steps, each configured in its own table.
21
+ Verification uses ordered stages. A string in `[verify].steps` is a singleton
22
+ stage; a nonempty array groups members that start together. Empty stages and
23
+ repeated names are errors. Plain string lists retain serial event sequences.
24
+ Every member resolves post-reconcile policy, approved selection/`always`, then
25
+ path applicability at stage entry. Only pass or skip satisfies a member. The
26
+ next stage, or finalize after the last, waits for every member to pass or skip.
27
+
28
+ By default a failure lets all siblings finish; the settled stage routes once
29
+ with every failed report, and no later stage runs. `failFast = true` on either
30
+ step kind instead cancels members without outcomes, preserving existing
31
+ outcomes. The kernel records `verify.cancelled {step, attempt, cause: {step}}`.
32
+ Cancellation is neither a pass nor a failure. It ends the entire build execution
33
+ through its existing process-group or environment supervisor; a replacement
34
+ execution resumes before implement can start. This opt-in teardown/relaunch cost
35
+ avoids per-member process groups and ensures cancelled descendants cannot keep
36
+ writing to the shared workspace, including after a crash.
37
+
38
+ An agent escalation holds its own member while siblings continue. The barrier
39
+ waits for the answer and that member's rerun, unless fail-fast cancels it.
40
+ Cancellation supersedes only that exact verifier occurrence's agent escalations,
41
+ including late raises and answers. They stay in history but no longer block,
42
+ route guidance, reset budgets, revise the spec or request abort. Answer commands
43
+ reject a superseded escalation as stale. Unrelated escalations retain authority.
44
+
45
+ All members of a cycle share one monotonic attempt. A failed cycle spends one
46
+ `maxVerifyAttempts` unit regardless of its failure count. Restart preserves
47
+ outcomes and reruns members without outcomes at that same attempt, with
48
+ independent agent contexts under `$AB_CONTEXT_DIR` in the shared workspace.
49
+ Integration nodes use the same barriers with exact head, parent and restack
50
+ identity; their failed-cycle attention is published only after settlement.
51
+
52
+ Each step has its own `[verify.<step>]` table.
53
+
54
+ For example: `steps = ["types", ["unit", "integration"], ["acceptance", "docs"]]`.
22
55
 
23
56
  | Kind | Runs | Outcome |
24
57
  |---|---|---|
25
58
  | `check` | a named `command` from `[commands]`, no agent | exit 0 passes; nonzero fails, keeping the output |
26
59
  | `agent` | the exact `skill` you configure ([repository-local](skills.md#add-a-repository-local-skill), no prefix inferred) | `ab verdict` records pass, fail or skip |
27
60
 
28
- - **Pass** advances to the next step.
29
- - **Fail** sends the report back through implement and code review, then verification, up to `[policy].maxVerifyAttempts`; then the build escalates.
30
- - **Skip** advances without counting as a pass or spending retries. Plan exclusions and path misses skip deterministically. An agent may skip only when the whole step doesn't apply, with a reason; an applicable behavior it can't exercise is a failure.
61
+ - **Pass** satisfies the member; the next stage waits for its siblings.
62
+ - **Fail**, after its stage settles, sends all failed reports back through implement and code review, then verification, up to `[policy].maxVerifyAttempts`; then the build escalates.
63
+ - **Skip** satisfies its member without counting as a pass or spending retries. Plan exclusions and path misses skip deterministically. An agent may skip only when the whole step doesn't apply, with a reason; an applicable behavior it can't exercise is a failure.
31
64
 
32
65
  ## Select what a build needs
33
66
 
@@ -134,13 +167,26 @@ Autobuild's own chain: this repository's choices, not defaults.
134
167
  |---|---|---|---|
135
168
  | 1 | lint | check | formatting and lint; mandatory |
136
169
  | 2 | types | check | TypeScript type checking |
137
- | 3 | unit | check | the test suite |
138
- | 4 | postgres | check | live store, service and migration suites, plus hosted-service packaging; mandatory |
139
- | 5 | dashboard | agent | captures terminal-dashboard frames and judges them |
140
- | 6 | web-dashboard | agent | captures operator web-app frames and judges them against the design |
141
- | 7 | website | agent | captures site and docs frames at desktop and phone widths, compared with approved references |
142
- | 8 | docs | agent | fails when a `docs/` passage no longer matches the build's user-facing changes |
143
-
144
- Steps 5 to 8 are optional and path-scoped, run by repository skills `ab-verify-dashboard`, `verify-web-dashboard`, `verify-website` and `verify-docs`. The docs step applies to product source, skills, templates, `SPEC.md`, `README.md` and `docs/`. The terminal verifier's `ab-` prefix is legacy; local skills get plain names.
145
-
146
- A plan for a docs change like this page selects lint, types, unit, postgres, website and docs; both of the last two pass their path checks because they cover `docs/`. The untouched dashboard steps aren't selected.
170
+ | 3 | unit | check | the test suite, minus database-backed integration tests |
171
+ | 4 | build | check | packs every publishable package and checks its contents, imports and bins; mandatory |
172
+ | 5 | integration | check | database-backed store, service and migration suites, plus a packed hosted-service deploy rehearsal |
173
+ | 6 | ui-tui | agent | captures terminal-dashboard frames and judges them |
174
+ | 7 | ui-app | agent | captures operator web-app frames and judges them against the design |
175
+ | 8 | ui-website | agent | captures site and docs frames at desktop and phone widths, compared with approved references |
176
+ | 9 | docs | agent | fails when a `docs/` passage no longer matches the build's user-facing changes |
177
+
178
+ Steps 5 to 9 are optional and path-scoped. Integration covers core, the Postgres store and the hosted packages; the others run through repository skills `verify-ui-tui`, `verify-ui-app`, `verify-ui-website` and `verify-docs`. The docs step applies to product source, skills, templates, `SPEC.md`, `README.md` and `docs/`.
179
+
180
+ A plan for a docs change like this page selects lint, types, unit, build, ui-website and docs; both of the last two pass their path checks because they cover `docs/`. The untouched ui-tui and ui-app steps aren't selected.
181
+
182
+ Grouped failures retain the legacy `feedback.verify` object for the first report
183
+ in configured order. A decisive `verify.stage-failed` receipt carries the full
184
+ ordered reports and cancelled members; `implement.started.verifyStageFailure`
185
+ references it. `ab context` materializes all reports and lists cancelled members
186
+ as not run, including when guidance is the immediate feedback. Older readers
187
+ defer on the decisive new event rather than misreading the stage's outcome.
188
+
189
+ Implement cancellation feedback is scoped to its referenced failed-stage receipt,
190
+ including guidance rounds. Later implement rounds without that receipt have no
191
+ `cancelledVerify` list. Finalize receives historical reports but omits that list;
192
+ its current verification gates have passed or been skipped.