@defrex/autobuild 0.13.0 → 1.0.0-beta.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 (210) hide show
  1. package/README.md +5 -3
  2. package/SPEC.md +673 -99
  3. package/bin/ab-dispatch-kernel.ts +4 -6
  4. package/docs/architecture.md +322 -75
  5. package/docs/assets/headline-wide.png +0 -0
  6. package/docs/configuration.md +112 -12
  7. package/docs/hosted-service.md +20 -2
  8. package/docs/integration-tree.md +117 -0
  9. package/docs/landing-policy.md +150 -0
  10. package/docs/mcp.md +24 -0
  11. package/docs/migration-1.0.md +68 -0
  12. package/docs/operator-api.md +20 -9
  13. package/docs/remote-store-protocol.md +114 -9
  14. package/docs/remote-ticket-protocol.md +26 -5
  15. package/docs/restacking.md +79 -0
  16. package/docs/setup.md +49 -6
  17. package/docs/ticket-dependencies.md +69 -0
  18. package/docs/ticket-migration.md +8 -0
  19. package/package.json +4 -3
  20. package/packages/core/src/cli/attention.ts +40 -163
  21. package/packages/core/src/cli/build-control.ts +75 -55
  22. package/packages/core/src/cli/bulk-control.ts +3 -2
  23. package/packages/core/src/cli/context.ts +68 -78
  24. package/packages/core/src/cli/dashboard/actions.ts +6 -3
  25. package/packages/core/src/cli/dashboard/landing-display.ts +6 -0
  26. package/packages/core/src/cli/dashboard/live.ts +5 -0
  27. package/packages/core/src/cli/dashboard/model.ts +178 -40
  28. package/packages/core/src/cli/dashboard/poll.ts +15 -9
  29. package/packages/core/src/cli/dashboard/refresh.ts +176 -0
  30. package/packages/core/src/cli/dashboard/render.ts +78 -28
  31. package/packages/core/src/cli/dashboard/repository-poll.ts +57 -0
  32. package/packages/core/src/cli/dashboard/selection.ts +7 -1
  33. package/packages/core/src/cli/dashboard/tree.ts +107 -0
  34. package/packages/core/src/cli/dispatch-frontend.ts +173 -169
  35. package/packages/core/src/cli/dispatch-process.ts +14 -7
  36. package/packages/core/src/cli/dispatch-repository-feed.ts +196 -0
  37. package/packages/core/src/cli/dispatch.ts +397 -214
  38. package/packages/core/src/cli/dispatcher-liveness.ts +41 -21
  39. package/packages/core/src/cli/harvest.ts +71 -39
  40. package/packages/core/src/cli/help.ts +49 -32
  41. package/packages/core/src/cli/historical-build-state.ts +27 -0
  42. package/packages/core/src/cli/init-validation.ts +43 -2
  43. package/packages/core/src/cli/keyboard.ts +6 -0
  44. package/packages/core/src/cli/landings.ts +18 -0
  45. package/packages/core/src/cli/main.ts +52 -18
  46. package/packages/core/src/cli/mcp.ts +9 -0
  47. package/packages/core/src/cli/pr-attachments.ts +10 -13
  48. package/packages/core/src/cli/pr-summary-publication.ts +27 -60
  49. package/packages/core/src/cli/pr-summary.ts +43 -13
  50. package/packages/core/src/cli/publication-settlement.ts +177 -21
  51. package/packages/core/src/cli/repository-status.ts +49 -2
  52. package/packages/core/src/cli/status.ts +133 -36
  53. package/packages/core/src/cli/terminal-restore.ts +54 -0
  54. package/packages/core/src/cli/terminal.ts +16 -2
  55. package/packages/core/src/cli/terminals.ts +121 -219
  56. package/packages/core/src/cli/ticket-editor.ts +10 -3
  57. package/packages/core/src/cli/ticket.ts +115 -20
  58. package/packages/core/src/cli/upgrade-commit.ts +4 -0
  59. package/packages/core/src/cli/upgrade-compatibility.ts +2 -2
  60. package/packages/core/src/cli/upgrade-landing.ts +69 -0
  61. package/packages/core/src/cli/upgrade.ts +16 -0
  62. package/packages/core/src/cli/wait.ts +194 -91
  63. package/packages/core/src/cli/watch.ts +111 -109
  64. package/packages/core/src/config/landing.ts +22 -0
  65. package/packages/core/src/config/live.ts +1 -0
  66. package/packages/core/src/config/pipeline-source.ts +4 -3
  67. package/packages/core/src/config/schema.ts +3 -0
  68. package/packages/core/src/events/catalog.ts +48 -3
  69. package/packages/core/src/events/payloads.ts +295 -6
  70. package/packages/core/src/events/repository.ts +38 -3
  71. package/packages/core/src/integration/harness.ts +11 -2
  72. package/packages/core/src/kernel/__snapshots__/reducer-registry.test.ts.snap +3330 -119
  73. package/packages/core/src/kernel/auto-merge-default.ts +1 -0
  74. package/packages/core/src/kernel/auto-merge.ts +29 -4
  75. package/packages/core/src/kernel/build-identity.ts +94 -0
  76. package/packages/core/src/kernel/change-presence.ts +179 -0
  77. package/packages/core/src/kernel/dispatch-status.ts +17 -1
  78. package/packages/core/src/kernel/dispatcher-liveness.ts +10 -4
  79. package/packages/core/src/kernel/engine.ts +89 -2
  80. package/packages/core/src/kernel/generators/build-log.ts +23 -0
  81. package/packages/core/src/kernel/generators/leaf-restack-log.ts +110 -0
  82. package/packages/core/src/kernel/generators/node-restack-log.ts +94 -0
  83. package/packages/core/src/kernel/generators/repository-journals.ts +25 -3
  84. package/packages/core/src/kernel/harvest.ts +25 -23
  85. package/packages/core/src/kernel/integration-completeness.ts +81 -0
  86. package/packages/core/src/kernel/integration-landing.ts +263 -0
  87. package/packages/core/src/kernel/integration-stack.ts +36 -0
  88. package/packages/core/src/kernel/integration-state.ts +135 -0
  89. package/packages/core/src/kernel/landing-policy.ts +47 -0
  90. package/packages/core/src/kernel/landing-publication.ts +41 -0
  91. package/packages/core/src/kernel/landing-readiness.ts +67 -0
  92. package/packages/core/src/kernel/landing-state.ts +96 -0
  93. package/packages/core/src/kernel/leaf-restack-completion.ts +24 -0
  94. package/packages/core/src/kernel/leaf-restack-state.ts +73 -0
  95. package/packages/core/src/kernel/log-index-value.ts +38 -0
  96. package/packages/core/src/kernel/log-index.ts +35 -5
  97. package/packages/core/src/kernel/node-landing.ts +439 -0
  98. package/packages/core/src/kernel/node-parent.ts +184 -0
  99. package/packages/core/src/kernel/node-restack-state.ts +191 -0
  100. package/packages/core/src/kernel/node-restack-transaction.ts +210 -0
  101. package/packages/core/src/kernel/node-restack.ts +274 -0
  102. package/packages/core/src/kernel/read-facts.ts +704 -0
  103. package/packages/core/src/kernel/reconcile-head.ts +51 -0
  104. package/packages/core/src/kernel/reconcile-restack.ts +560 -0
  105. package/packages/core/src/kernel/reducer-registry.ts +153 -3
  106. package/packages/core/src/kernel/reducer.ts +121 -6
  107. package/packages/core/src/kernel/repository-attention.ts +179 -0
  108. package/packages/core/src/kernel/service-facts.ts +135 -0
  109. package/packages/core/src/kernel/snapshot-parent.ts +33 -0
  110. package/packages/core/src/kernel/terminal-guard.ts +133 -0
  111. package/packages/core/src/ontology.ts +9 -1
  112. package/packages/core/src/operator/annotations.ts +12 -0
  113. package/packages/core/src/operator/control.ts +11 -6
  114. package/packages/core/src/operator/index.ts +6 -0
  115. package/packages/core/src/operator/landings.ts +35 -0
  116. package/packages/core/src/operator/presentation.ts +1 -0
  117. package/packages/core/src/operator/protocol.ts +12 -3
  118. package/packages/core/src/operator/query.ts +40 -21
  119. package/packages/core/src/operator/read-view.ts +4 -13
  120. package/packages/core/src/operator/registry.ts +48 -19
  121. package/packages/core/src/operator/requests.ts +3 -22
  122. package/packages/core/src/operator/sandbox.ts +10 -9
  123. package/packages/core/src/operator/tickets.ts +57 -11
  124. package/packages/core/src/plugin-sdk/index.ts +13 -0
  125. package/packages/core/src/ports/forge/contract.ts +91 -3
  126. package/packages/core/src/ports/forge/fake.ts +142 -4
  127. package/packages/core/src/ports/forge/git-rewrite.ts +232 -0
  128. package/packages/core/src/ports/forge/github-readiness.ts +421 -0
  129. package/packages/core/src/ports/forge/github.ts +631 -35
  130. package/packages/core/src/ports/forge/local-git.ts +119 -5
  131. package/packages/core/src/ports/forge/readiness.ts +99 -0
  132. package/packages/core/src/ports/tickets/contract.ts +41 -0
  133. package/packages/core/src/ports/tickets/create.ts +8 -1
  134. package/packages/core/src/ports/tickets/fake.ts +32 -1
  135. package/packages/core/src/ports/tickets/file-codec.ts +7 -0
  136. package/packages/core/src/ports/tickets/file.ts +18 -1
  137. package/packages/core/src/ports/tickets/hosted-index.ts +2 -0
  138. package/packages/core/src/ports/tickets/linear.ts +124 -4
  139. package/packages/core/src/ports/tickets/migration.ts +25 -1
  140. package/packages/core/src/ports/tickets/operations.ts +7 -2
  141. package/packages/core/src/ports/tickets/remote-protocol.ts +19 -0
  142. package/packages/core/src/ports/tickets/remote.ts +10 -1
  143. package/packages/core/src/ports/tickets/revision.ts +3 -1
  144. package/packages/core/src/ports/tickets/tree.ts +148 -0
  145. package/packages/core/src/ports/tickets/update.ts +15 -2
  146. package/packages/core/src/ports/types.ts +135 -5
  147. package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
  148. package/packages/core/src/ports/workspace/provider-capabilities.ts +1 -1
  149. package/packages/core/src/ports/workspace/vercel-sandbox.ts +60 -3
  150. package/packages/core/src/processes/build-child.ts +6 -6
  151. package/packages/core/src/processes/build-runner.ts +586 -87
  152. package/packages/core/src/processes/dispatch-failure-budget.ts +5 -4
  153. package/packages/core/src/processes/dispatcher-selectors.ts +15 -9
  154. package/packages/core/src/processes/dispatcher.ts +2239 -357
  155. package/packages/core/src/processes/execution-no-progress.ts +46 -1
  156. package/packages/core/src/processes/harvest-execution-state.ts +15 -9
  157. package/packages/core/src/processes/harvest-runner.ts +34 -70
  158. package/packages/core/src/processes/harvest.ts +38 -15
  159. package/packages/core/src/processes/infrastructure-failure-budget.ts +13 -15
  160. package/packages/core/src/processes/orchestrator-tick.ts +2 -2
  161. package/packages/core/src/processes/publication-loss.ts +35 -21
  162. package/packages/core/src/processes/publication-state.ts +30 -5
  163. package/packages/core/src/processes/repo-view.ts +244 -1130
  164. package/packages/core/src/processes/tick-publication.ts +110 -0
  165. package/packages/core/src/store/adapter.ts +23 -0
  166. package/packages/core/src/store/build-scope.ts +35 -0
  167. package/packages/core/src/store/contract.ts +909 -0
  168. package/packages/core/src/store/digest.ts +52 -4
  169. package/packages/core/src/store/local/schema.ts +26 -13
  170. package/packages/core/src/store/local/store.ts +296 -55
  171. package/packages/core/src/store/memory.ts +181 -30
  172. package/packages/core/src/store/phase-session.ts +34 -0
  173. package/packages/core/src/store/reduced-reads.ts +240 -0
  174. package/packages/core/src/store/reducer-value-shapes.json +18323 -0
  175. package/packages/core/src/store/reducer-value-validation.ts +96 -0
  176. package/packages/core/src/store/reducer-values.ts +145 -0
  177. package/packages/core/src/store/remote/client.ts +85 -0
  178. package/packages/core/src/store/remote/compatibility.ts +21 -9
  179. package/packages/core/src/store/remote/index.ts +19 -0
  180. package/packages/core/src/store/remote/protocol.ts +27 -0
  181. package/packages/core/src/store/remote/version.ts +3 -1
  182. package/packages/core/src/store/repo-state-events.ts +3 -1
  183. package/packages/core/src/store/repo-tick.ts +72 -0
  184. package/packages/core/src/store/session-handle.ts +34 -0
  185. package/packages/core/src/store/snapshots.ts +10 -0
  186. package/packages/core/src/store/subscribe.ts +1 -1
  187. package/packages/core/src/store/ticket-assets.ts +4 -4
  188. package/packages/core/src/store/types.ts +71 -6
  189. package/packages/core/src/testing/dispatch-read-budget.ts +215 -0
  190. package/packages/core/src/testing/index.ts +10 -0
  191. package/packages/core/src/testing/reduced-read-budget.ts +502 -0
  192. package/packages/core/src/testing/refresh-scheduler.ts +32 -0
  193. package/skills/guide/SKILL.md +116 -62
  194. package/skills/guide/references/integration-tree.md +117 -0
  195. package/skills/guide/references/landing-policy.md +150 -0
  196. package/skills/guide/references/migration-1.0.md +68 -0
  197. package/skills/guide/references/operator-api.md +13 -6
  198. package/skills/guide/references/plugin-authoring.md +34 -0
  199. package/skills/guide/references/remote-store-protocol.md +114 -9
  200. package/skills/guide/references/remote-ticket-protocol.md +26 -5
  201. package/skills/guide/references/restacking.md +79 -0
  202. package/skills/guide/references/setup.md +49 -6
  203. package/skills/guide/references/ticket-dependencies.md +69 -0
  204. package/skills/guide/references/ticket-migration.md +8 -0
  205. package/skills/operate/SKILL.md +55 -5
  206. package/skills/reconcile/SKILL.md +55 -48
  207. package/skills/spec/SKILL.md +67 -1
  208. package/skills/tickets/SKILL.md +55 -2
  209. package/templates/autobuild.toml +3 -0
  210. package/templates/hosted-service/package.json +2 -2
@@ -0,0 +1,68 @@
1
+ # Migrating from 0.x to 1.0
2
+
3
+ The integration tree changes replay and landing authorization. It does not cut a
4
+ release or rename `baseBranch`: that setting now names the tree root. Existing
5
+ tickets default to work with no target and continue targeting the root. Adopt
6
+ nodes only when useful; see [integration trees](integration-tree.md).
7
+
8
+ ## Configuration and installed skills
9
+
10
+ Run `ab upgrade` against the intended repository. It updates the recognized
11
+ installation and three-way merges vendored skills with their pristine defaults;
12
+ review local conflicts. `--no-self-update` skips installation update while still
13
+ performing repository migration and skill merging. Preserve local customizations
14
+ and use the installed [setup reference](setup.md) to review verification and roles.
15
+
16
+ When `landing` is absent, upgrade reads the target repository's configured
17
+ BuildStore journal, ignoring ambient `AB_STORE` for that choice, and appends:
18
+
19
+ | Legacy repository default | Leaf rule | Node rule |
20
+ |---|---|---|
21
+ | ON | auto | consent |
22
+ | OFF or no fact | consent | consent |
23
+
24
+ A genuinely absent local journal counts as no fact. An unreadable or unavailable
25
+ journal fails migration with guidance: restore store access and retry, or write
26
+ explicit rules after deciding the desired policy. Existing valid landing arrays
27
+ are preserved byte-for-byte, including root-level `landing = []`, which selects
28
+ the new leaf-auto/node-consent defaults. Fresh init uses those new defaults.
29
+ See [landing policy](landing-policy.md) for complete worked configurations.
30
+
31
+ The repository auto-merge default, its fan-out and old CLI/default controls are
32
+ retired. Use `ab land` and `ab hold`, not an old repository switch. Historical
33
+ explicit per-build `build.auto-merge-requested`/`cancelled` facts map to land/hold
34
+ until a new landing command supersedes them; historical default-seeded requests
35
+ confer no consent. New claims do not materialize old defaults.
36
+
37
+ ## Builds already in flight
38
+
39
+ Historical events and merge reconciliations keep their replay/display meaning;
40
+ old merge commits remain valid history. Later replay uses the promoted historical
41
+ contribution base. The current engine can restack resumed builds at newly reached
42
+ verification or waiting-for-landing boundaries, and current landing rules govern
43
+ new readiness decisions. There is no claim-version switch promising every old
44
+ build finishes with the old merge standard. Drain old work before switching
45
+ versions if retaining old execution behavior is required. Simultaneous old and
46
+ new writers are not a supported migration strategy.
47
+
48
+ Execution pipeline configuration stays pinned to the build; live dispatcher
49
+ landing policy is separate. A recorded readiness decision retains its rule
50
+ snapshot despite configuration edits; a new candidate receives a new decision.
51
+ Explicit consent persists through replay and re-verification until hold or
52
+ completion, except accepted node reparenting revokes it.
53
+
54
+ ## The reversed rebase ban
55
+
56
+ The old ban protected event-recorded SHAs and avoided resolving the same conflict
57
+ for every WIP commit. The new standard replays one net leaf change or ordered
58
+ node contributions, retains displaced history through immutable archive refs and
59
+ durable rewrite facts, and resolves each conflicted item once. Ordinary agent
60
+ rebase of WIP history is still inappropriate. Agents resolve kernel-prepared
61
+ replay; the kernel owns branch replacement with expected-head guards.
62
+
63
+ Root leaves squash; node destinations and local-git root nodes fast-forward;
64
+ GitHub root nodes use guarded rebase merge with recorded fencing/audit limits.
65
+ Check [forge requirements](landing-policy.md#forge-requirements) and
66
+ [restacking](restacking.md) before enabling nodes on a plugin forge. Ensure
67
+ archive publication/read permissions, tree capabilities and required merge
68
+ methods are available; legacy read compatibility is insufficient.
@@ -1,7 +1,7 @@
1
1
  # Operator API v1
2
2
 
3
3
  The hosted service exposes the polling-oriented operator surface at
4
- `/operator/v1/repos/{repo}`. It is versioned with remote store protocol **3**.
4
+ `/operator/v1/repos/{repo}`. It is versioned with remote store protocol **4**.
5
5
  Every request must send `X-Autobuild-Version`,
6
6
  `X-Autobuild-Protocol-Version: 3`, and `Authorization: Bearer …`. Identity is
7
7
  checked before authentication or resource lookup.
@@ -112,17 +112,15 @@ JSON bodies are strict: unknown fields are rejected.
112
112
 
113
113
  | Method and path | Body |
114
114
  |---|---|
115
- | `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"auto-merge-on"\|"auto-merge-off"}` |
115
+ | `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"}` |
116
116
  | `POST …/builds/{slug}/answer` | One answer variant described below. |
117
117
  | `PUT …/settings/intake` | `{"enabled":boolean}` |
118
118
  | `POST …/settings/intake/toggle` | Empty body. |
119
- | `PUT …/settings/auto-merge-default` | `{"enabled":boolean}` |
120
- | `POST …/settings/auto-merge-default/toggle` | Empty body. |
121
119
  | `POST …/bulk-control` | `{"action":"pause"\|"resume"}`. The hold fact, intake fact, then eligible build events are written in that order. |
122
120
  | `POST …/harvest/control` | `{"action":"toggle-gate"}` or `{"action":"run","run":"…"}`. A run action is bound to that concrete projected run. |
123
121
  | `POST …/tickets/states` | `{name,about?}` → `{state,created}`; requires attributed operator identity (`tickets.state.create` in MCP). Hosted duplicate names are refused case-insensitively. |
124
- | `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[]}`; omitted state preserves the backend default. |
125
- | `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, and complete-replacement `labels`. Body bytes are not normalized. |
122
+ | `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default. |
123
+ | `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
126
124
  | `POST …/tickets/{id}/move` | `{"state":"backend state name"}`. |
127
125
  | `POST …/tickets/{id}/block` | `{"blockerIds":["…"]}`. |
128
126
  | `POST …/tickets/{id}/unblock` | `{"blockerIds":["…"]}`. |
@@ -291,3 +289,12 @@ Hosted ticket tools resolve independent project ticket policy before legacy uplo
291
289
  configuration. Queue, detail, state discovery and mutations work before any build
292
290
  or dispatcher run; detail reports a null matching build. Ticket policy publication
293
291
  never creates synthetic build or repository history.
292
+
293
+ Ticket results include kind (default work) and optional same-source node target.
294
+ Metadata-only patches are accepted. Target validation and demotion guards apply
295
+ to CLI, HTTP and MCP alike; unsupported sources refuse even explicit defaults
296
+ or clears before changing other fields. Dispatch routing is unchanged.
297
+
298
+ Landing controls use `land` and `hold` with acknowledged durable state. Land
299
+ requires readiness and survives restacks; hold persists until land. Repository
300
+ auto-merge settings are retired; configure ordered `[[landing]]` rules.
@@ -18,6 +18,23 @@ paths are not API.
18
18
  | `workspace-provider` | `workspaceProviders` | `WorkspaceProvider` | Provision an absolute, writable working copy for the requested branch, return durable base evidence, resume an intact branch non-destructively, rematerialize a lost copy, and make release idempotent. Never silently re-cut resumed work from a newer base. |
19
19
  | `forge` | `forges` | `Forge` | Implement kernel-owned regular pushes, idempotent PR opening, PR-state projection, gated/ungated auto-merge behavior, head-guarded squash merge, and comments. API 1.2 adds optional idempotent `closePr` and `deleteBranch` abort-cleanup capabilities; `closePr` must preserve a racing merge. Without them abort cleanup remains visibly pending. Agents never receive forge credentials or push. `prAttachments` is an optional image-hosting capability; absence must preserve the supported text-only path. |
20
20
 
21
+ Reconcile requires the optional grouped `Forge.rewrite` capability: snapshot the
22
+ actual build branch into a build-private ref, publish immutable exact-SHA refs
23
+ under `refs/autobuild/archive/<slug>/<sha>`, and replace the explicit branch with
24
+ an explicit expected remote head. Return `lease-mismatch` separately from
25
+ transport, auth and policy failures. If the CAS succeeds but another writer
26
+ advances it before readback, return `lease-mismatch` with `rewritten: true` and the
27
+ observed `actual` head. The kernel records that write and retries the observed
28
+ history without claiming completion. After an acknowledged replacement, reattach
29
+ the matching detached workspace HEAD to the build branch so later implementation
30
+ publication remains usable. Never overwrite unknown work or silently
31
+ fall back to merging, ordinary pushes, archive branches or tags. Older forge
32
+ plugins remain loadable and receive an actionable refusal at reconcile time.
33
+ Remote workspace providers additionally need trusted `WorkspacePublication.rewrite`
34
+ after guest execution teardown; ordinary `publish` cannot publish a restack.
35
+ A local-ref acknowledgement has its own `localExpected` guard, separate from
36
+ the authoritative remote lease when another writer advanced the remote branch.
37
+
21
38
  Plugin API 1.3 adds the optional AgentRunner failure `cause` and the
22
39
  `exhaustion-failure` shared-contract scenario. Legacy failures without `cause`
23
40
  remain supported: `permanent: false` is eligible for a configured alternate,
@@ -377,3 +394,20 @@ and is never supplied; factory environments also exclude `AB_TOKEN`. Launch
377
394
  credentials travel through the separate transient execution-auth argument, never
378
395
  through serialized execution identity. Existing plugins that forwarded
379
396
  `storeToken` must migrate to this callback and fail closed if it is unavailable.
397
+
398
+ ## Optional ticket tree capability
399
+
400
+ Existing ticket-source factories remain compatible without new methods or fields.
401
+ Raw `Ticket.kind` is optional for source compatibility; public projections normalize
402
+ it to `work`. An adapter opts in with `integrationTree: true` and implements
403
+ `listAll(): Promise<TicketListing>` over every state, independently of ready filters.
404
+ It must persist `kind?: 'work' | 'node'` and `target?: string | null` on drafts
405
+ and updates: omitted preserves/defaults, explicit work resets kind, null clears
406
+ target. Read targets are source-local canonical ticket ids. Validate same-source
407
+ existence, node kind, self/ancestor cycles, corrupt chains and demotion with any
408
+ children before writing any mixed patch, including revision-checked writes.
409
+ Expose kind/target in revisions. Exhaust provider pagination and propagate
410
+ infrastructure failures. Do not opt in if the source cannot preserve these semantics.
411
+ Legacy sources receive ordinary CRUD unchanged; metadata writes are refused by
412
+ the compatibility facade before legacy methods run. Unsupported sources should
413
+ also refuse metadata explicitly at their own direct write boundary.
@@ -12,21 +12,24 @@ persistence requirements, and conformance bar for the protocol shipped in this
12
12
  distribution are all defined here. Protocol implementations must retain contracts for every supported client line;
13
13
  protocol changes update this document and executable contracts together.
14
14
 
15
- A service accepts stable clients from its own `major.minor` release line and
16
- the two preceding minor lines in the same major. A major starts a new family:
15
+ A service accepts stable and prerelease clients from its own `major.minor`
16
+ release line and the two preceding minor lines in the same major. A major starts a new family:
17
17
  X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
18
18
  Patch versions are interchangeable in both directions and must never change
19
19
  the protocol. Upgrade the service first, then projects independently within
20
20
  its window. Supported release lines retain their wire handlers and known
21
21
  protocol identities; an unknown protocol is refused independently of version.
22
- Malformed, missing, and prerelease identities are refused with HTTP 409.
22
+ Stable and prerelease service and client identities share their numeric major/minor
23
+ line. Malformed or missing identities, build metadata (`+…`), prefixes and
24
+ whitespace are refused with HTTP 409.
23
25
  A newer client is told to upgrade the service; a client below the window is
24
26
  told to upgrade the project's Autobuild. Diagnostics name the service version
25
27
  and supported range.
26
28
 
27
29
  Unauthenticated `GET /health` publishes `ok`, `autobuildVersion`,
28
30
  `protocolVersion`, and `supportedClientRange: { minVersion, maxVersionExclusive }`.
29
- The range is inclusive at the minimum and exclusive at the maximum; a 0.11.x
31
+ Range endpoints remain stable versions. The range is inclusive at the minimum
32
+ and exclusive at the maximum; a 0.11.x
30
33
  service publishes `>=0.9.0 <0.12.0`. Health needs no credentials, version
31
34
  headers, or available backend.
32
35
 
@@ -37,7 +40,7 @@ headers, or available backend.
37
40
  `[store] url` (in that precedence order, before the local default); the shipped client appends the routes below.
38
41
  - Every `/builds`, `/repos`, and `/sessions` request sends
39
42
  `X-Autobuild-Version` with the exact client package version and
40
- `X-Autobuild-Protocol-Version` with the remote protocol version (`3` in this
43
+ `X-Autobuild-Protocol-Version` with the remote protocol version (`4` in this
41
44
  distribution). Before authentication,
42
45
  body parsing, or resource lookup, the server validates the release-line window and known protocol identity.
43
46
  Unsupported or missing values receive `409 {"kind":"conflict","error":"…"}`;
@@ -355,6 +358,74 @@ part of this protocol. Retention is enforced server-side inside the store at
355
358
  deposit time (bounded pruning of dispatcher run/config artifact revisions),
356
359
  not through any endpoint.
357
360
 
361
+ ### Named reducer values
362
+
363
+ `POST /builds/{slug}/reducer-values` and
364
+ `POST /repos/{repo}/reducer-values` accept at most 4 KiB of JSON:
365
+
366
+ ```json
367
+ {"reducer":"dispatchStatus","args":{"run":"run-a"}}
368
+ ```
369
+
370
+ The response is `200 {"version":2,"cursor":123,"value":{...}}`. Only the
371
+ finished JSON answer is returned, with no accumulator or raw-log bundle. `cursor`
372
+ is the authoritative prefix included in the answer, not a guarantee to include
373
+ appends concurrent with the request. Every call checks durable progress and
374
+ persisted state; parallel instances may safely advance the same checkpoint.
375
+ Snapshots are disposable caches: deletion, corruption, wrong versions and
376
+ unreadable cache storage cause replay. Log read failures remain errors.
377
+
378
+ The executable catalog is `kernel/reducer-registry.ts`. All requests reject
379
+ unknown names, excluded reducers, wrong scopes and invalid/extra arguments with
380
+ `400 validation`. A missing resource is `404`, project and delegated authority
381
+ checks are the same as other reads, and unsupported methods remain unavailable.
382
+ The operation is read-only authority even though its HTTP verb is POST and its
383
+ internal cache may advance. It does not accept caller-supplied state. This is an
384
+ additive protocol route: historical snapshot and event handlers and the supported
385
+ client version window are unchanged.
386
+
387
+ | Scope | Reducers with no arguments |
388
+ | --- | --- |
389
+ | Build | `executionNoProgress`, `summaryRequests`, `build`, `buildDigest`, `currentPrAttachments`, `pendingPrAttachmentReclaims`, `openExecution`, `lastExecutionOutcome`, `infrastructureFailureReset`, `openWorkspace`, `setupStreak`, `openBuildWorkspace`, `currentDeferralObservation`, `dashboardFacts`, `pinnedAssets`, `buildDelegation` |
390
+ | Repository | `harvest`, `dispatchSettings`, `sandboxStates`, `openHarvestExecutions`, `autoMergeDefault`, `effectiveConfig`, `harvestDelegation` |
391
+
392
+ | Reducer | Scope | Required arguments |
393
+ | --- | --- | --- |
394
+ | `dispatchStatus`, `openTick` | Repository | `run`: nonempty string |
395
+ | `dispatchFailureBudget` | Build | `infrastructureOwnsWorkspace`: boolean |
396
+ | `phaseFailures` | Build | `phase`: valid phase name; `round`: nonnegative integer |
397
+
398
+ Arguments are canonicalized into the cache identity; variants never reuse one
399
+ another's accumulator. `effectiveConfig` returns an object with optional `run`
400
+ and `reference: {kind, rev}`. Absence is distinct from an unreadable referenced
401
+ artifact. Delegation values contain semantic lifecycle facts indexed by prefixed
402
+ identifiers, not authorization decisions; request time and grace expiry are
403
+ always evaluated against those facts on the service.
404
+
405
+ Each remaining registered reducer is explicitly excluded:
406
+
407
+ | Reducers | Reason |
408
+ | --- | --- |
409
+ | `journalView`, `repositoryStateEvents`, `dispatchFrontend` | Raw repository event lists |
410
+ | `session` | Operator-session log scope |
411
+ | `publicationState` | Selector functions in finished value |
412
+ | `logIndex` | Maps and Sets in finished value |
413
+ | `hostedPrAttachments` | Map as finished value |
414
+ | `summaryBoundary`, `ticketSourceHealth`, `frozenPrImageHost`, `publishedBranchHead`, `verifyDiffBase`, `recordedBaseSha`, `baseBranch`, `provisionMarker`, `recoveryCheckpoint` | Existing finished contract can return top-level `undefined`, which is not JSON |
415
+
416
+ `GET /repos/{repo}/state-events` is **deprecated**. Its response remains unchanged
417
+ for supported clients, including the current dispatcher run's event tail. It is
418
+ the compatibility exception to flat event-row reads; new callers should request
419
+ named values. The current product no longer loads or writes raw-tail snapshots.
420
+
421
+ The `value.*` snapshot namespace is reserved for the adapter's private value
422
+ checkpoint hooks. Public snapshot GET and PUT requests for this prefix return
423
+ `400 validation`, including requests made with delegated or administrator
424
+ credentials. Adapter snapshot APIs reject the same names. Ordinary snapshot
425
+ names retain their existing behavior. The value cache key format is versioned;
426
+ checkpoints from the former publicly writable format are ignored and rebuilt
427
+ from the log after upgrading.
428
+
358
429
  ### Reducer snapshots
359
430
 
360
431
  A reducer snapshot is one registered reducer's serialized state as of a log
@@ -442,22 +513,37 @@ creation operation and must not reset timestamps, events, artifacts, or lease
442
513
  state when the repository already exists. Event sequence numbering starts at 1
443
514
  for each repository independently of every build and other repository.
444
515
 
445
- A `BuildDigest` is the projection of one build's log onto its terminal fact
446
- and its `observation.recorded` occurrences:
516
+ A `BuildDigest` projects terminal, observation, and compact landing evidence
517
+ from one build's log:
447
518
 
448
519
  ```jsonc
449
520
  // BuildDigest
450
521
  {
522
+ "integrationAuditPending": true, // optional: kernel landing audit requested, not yet settled
451
523
  "slug": "ab-fix-login-3",
452
524
  "terminal": "done", // optional: "done" | "aborted", omitted while the log has neither
453
525
  "observations": [ // ascending-seq pairs for the log's observation.recorded events
454
526
  { "seq": 1, "ts": "2026-07-15T12:00:01.000Z" },
455
527
  { "seq": 4, "ts": "2026-07-15T12:00:04.000Z" }
456
528
  ],
457
- "merged": "2026-07-15T12:00:06.000Z" // optional: ts of the log's latest pr.merged, omitted when none
529
+ "merged": "2026-07-15T12:00:06.000Z", // optional: ts of the log's latest pr.merged, omitted when none
530
+ "mergedSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", // optional: that merge's actual landing SHA
531
+ "nodeContribution": { // optional: latest node.contribution-recorded payload
532
+ "landing": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
533
+ "head": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
534
+ "base": "cccccccccccccccccccccccccccccccccccccccc",
535
+ "identities": ["build:child"]
536
+ }
458
537
  }
459
538
  ```
460
539
 
540
+ The optional `mergedSha` and `nodeContribution` fields let admission index
541
+ confirmed landing evidence without fetching every historical build's full facts.
542
+ A node contribution is usable only when its `landing` matches `mergedSha`;
543
+ recording or recovering a contribution advances `readinessChangeSeq`. These
544
+ members are additive: older peers can omit them, leaving presence unproven rather
545
+ than substituting source completion. They do not change the protocol version.
546
+
461
547
  The digest is derived from the event log on every call — the server persists
462
548
  nothing and there is no refresh step. Protocol version `3` reshaped the
463
549
  digest's `observations` from bare sequence numbers to `{seq, ts}` pairs and
@@ -1136,7 +1222,7 @@ Four shipped behaviors do not add `BuildStore` routes:
1136
1222
  store lifecycle; there is no close endpoint.
1137
1223
  - `GET /health` is outside the `BuildStore` interface. It is always open and
1138
1224
  returns exactly `200 {"ok":true,"autobuildVersion":"<package>",
1139
- "protocolVersion":"3", "supportedClientRange":{"minVersion":"0.9.0",
1225
+ "protocolVersion":"4", "supportedClientRange":{"minVersion":"0.9.0",
1140
1226
  "maxVersionExclusive":"0.12.0"}}`. It reports HTTP-process availability and identity,
1141
1227
  not a deeper backing-store transaction or migration check.
1142
1228
 
@@ -1213,3 +1299,22 @@ require a project credential and operate only on its own identity; admin and
1213
1299
  internal operator credentials cannot impersonate self-service. All protocol
1214
1300
  responses are no-store/no-referrer. Connection commands are unavailable in
1215
1301
  build/harvest sessions.
1302
+
1303
+ ### Repository tick telemetry (protocol 4)
1304
+
1305
+ `POST /repos/:repo/tick/begin` accepts `{holder}` and returns the actual start
1306
+ timestamp, or null when the unexpired repository lease does not match.
1307
+ `POST /repos/:repo/tick/finish` accepts `{holder, completion, events}`. Completion
1308
+ is `{outcome:"completed", counters}` or `{outcome:"failed", error}`; events is
1309
+ empty for a quiet success or a matching dispatcher start/terminal pair for that
1310
+ holder. The validated batch and finished telemetry commit atomically. The reply
1311
+ is `{observation, events}` with assigned envelopes, or null on fencing failure.
1312
+ These operations never renew the lease. Repository records optionally expose
1313
+ `tick: {run, open?: {startedAt}, finished?: {run, startedAt, completedAt, ...completion}}`.
1314
+ They retain the previous completion while a new tick is open and after lease
1315
+ release. Build and session credentials cannot mutate repository ticks.
1316
+
1317
+ The optional `integrationAuditPending` digest fact is introduced on the 0.14
1318
+ release line without changing protocol identity 4. It survives build completion
1319
+ and is cleared by audit settlement. Services omit it for historical 0.12/0.13
1320
+ clients, retaining their decoders and the supported three-line window.
@@ -6,21 +6,24 @@ version headers with the remote BuildStore. The version must be in the
6
6
  published service window and the protocol must
7
7
  match its known release-line identity (`3` for 0.9, 0.10, and 0.11).
8
8
 
9
- A service accepts stable clients from its own `major.minor` release line and
10
- the two preceding minor lines in the same major. A major starts a new family:
9
+ A service accepts stable and prerelease clients from its own `major.minor`
10
+ release line and the two preceding minor lines in the same major. A major starts a new family:
11
11
  X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
12
12
  Patch versions are interchangeable in both directions and must never change
13
13
  the protocol. Upgrade the service first, then projects independently within
14
14
  its window. Supported release lines retain their wire handlers and known
15
15
  protocol identities; an unknown protocol is refused independently of version.
16
- Malformed, missing, and prerelease identities are refused with HTTP 409.
16
+ Stable and prerelease service and client identities share their numeric major/minor
17
+ line. Malformed or missing identities, build metadata (`+…`), prefixes and
18
+ whitespace are refused with HTTP 409.
17
19
  A newer client is told to upgrade the service; a client below the window is
18
20
  told to upgrade the project's Autobuild. Diagnostics name the service version
19
21
  and supported range.
20
22
 
21
23
  Unauthenticated `GET /health` publishes `ok`, `autobuildVersion`,
22
24
  `protocolVersion`, and `supportedClientRange: { minVersion, maxVersionExclusive }`.
23
- The range is inclusive at the minimum and exclusive at the maximum; a 0.11.x
25
+ Range endpoints remain stable versions. The range is inclusive at the minimum
26
+ and exclusive at the maximum; a 0.11.x
24
27
  service publishes `>=0.9.0 <0.12.0`. Health needs no credentials, version
25
28
  headers, or available backend.
26
29
 
@@ -273,7 +276,7 @@ snapshot of fields, blockers and revision.
273
276
 
274
277
  `POST /tickets/mutate-if-revision` accepts the usual authenticated context and
275
278
  `input: { id, expectedRevision, mutation }`. Mutation is one of
276
- `{ kind: "update", patch: { title?, body?, labels? } }`,
279
+ `{ kind: "update", patch: { title?, body?, labels?, kind?, target? } }`,
277
280
  `{ kind: "transition", state }`, or
278
281
  `{ kind: "blockers", operation: "block" | "unblock", ids: string[] }`.
279
282
  Unknown keys and empty patches are refused. Success returns `{ ok: true }`.
@@ -312,3 +315,21 @@ before source construction. Their ordinary create grants remain unchanged.
312
315
 
313
316
  See the [migration procedure](ticket-migration.md) for preflight, state mapping,
314
317
  resumption and portable file records.
318
+
319
+ ## Integration tree metadata
320
+
321
+ Hosted tickets store `kind` (`work` or `node`, default `work`) and optional
322
+ `target`, the canonical readable id of a node in the same project. Create accepts
323
+ both fields; update and guarded update preserve omitted fields and accept
324
+ `target: null` to clear an edge. Targets must exist and be nodes. Self-targets,
325
+ ancestor cycles, and demoting a node with targeting tickets (including completed
326
+ work) are rejected before any part of a mixed patch is written. Graph mutations
327
+ serialize per project in the same transaction as validation and revision checks.
328
+ Effective metadata changes increment the revision; equivalent aliases are no-ops.
329
+
330
+ Ticket responses include these fields only with `x-autobuild-ticket-tree: 1`.
331
+ This capability is independent of revision and comment capabilities and of the
332
+ client version. Without it, both fields are projected away, preserving historical
333
+ strict decoders. Current hosted clients send all three capability headers and
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.
@@ -0,0 +1,79 @@
1
+ # Restacking and change identity
2
+
3
+ A leaf contributes one net change, independent of its WIP commit count. Before
4
+ verification the kernel collapses its contribution relative to the effective
5
+ diff base and replays it onto the sampled destination. Implementation and review
6
+ do not rewrite history. Verification failures return to implementation; later
7
+ commits append until the next approved cycle. Later reviews use the effective
8
+ base from the preceding successful restack; the original cut remains provenance.
9
+
10
+ The terminal `Autobuild-Build: <slug>` trailer identifies a change across SHA
11
+ rewrites. Reachable identities determine presence, including blockers; old SHAs
12
+ alone do not. Each canonical leaf replay has one parent and one identity,
13
+ including an empty resolved change. Root leaf squash retains that identity;
14
+ node fast-forwards preserve ordered contributing identities.
15
+
16
+ ## Timing and evidence
17
+
18
+ Destination observations are durable `target.moved` facts, including while an
19
+ agent runs. Verify-entry restack freezes a current base before verification;
20
+ path selection excludes upstream-only paths. After finalize and post-steps,
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.
27
+
28
+ Every open node observes its parent and cascades movement to descendants,
29
+ including empty nodes without PRs. Movement coalesces onto the newest sample
30
+ after an active frozen transaction finishes; no separate throttle is configured.
31
+ Unlike clean waiting leaves, nodes must reverify any changed head or parent.
32
+
33
+ Before replacement the kernel publishes retained tips, displaced heads and the
34
+ temporary change under immutable exact archive refs. `restack.*` facts record
35
+ preparation, replay, intent, archived replacement, contention and completion.
36
+ Unpublished request/loss records alone cannot preserve objects from a released
37
+ sandbox. Publication uses exact expected-head CAS; contention retains evidence
38
+ and retries without overwriting another writer. Remote guests park for trusted
39
+ publication after teardown. Historical merge reconciliations keep their original
40
+ interpretation and supply a promoted contribution base for later replay.
41
+
42
+ ## Node contributions and recovery
43
+
44
+ Node replay enumerates oldest-first first-parent contributions above the last
45
+ completed boundary (initially the opening SHA). Inherited foreign history is
46
+ excluded from node ownership; the boundary advances only on confirmed completion.
47
+ Ordered source identities survive, and identities already reachable upstream
48
+ are dropped. Untagged commits, including empty ones, are foreign.
49
+
50
+ A separate node writer lease and durable reservation serialize restacks and
51
+ child landings. Reservations freeze expected head, parent, contribution boundary,
52
+ archives, changes and merge proofs. Lease expiry recovers the same operation,
53
+ not a competing one. Prepared/conflicted/replayed item receipts, publication
54
+ intent, proven replacement and settlement distinguish each recovery boundary.
55
+ Inventory exposes source identities, node-owned foreign commits, active operation,
56
+ conflict item and unsafe merge evidence.
57
+
58
+ Only a conflicted item attaches a reconcile runner. It receives the original
59
+ source build's pinned spec, approved plan and implement-notes, with the integration
60
+ owner identified separately. Missing artifacts or invalid identity escalate.
61
+ Foreign conflicts receive commit metadata and a diff; unclear intent escalates.
62
+ Completion validates exactly one commit on the item's replay base, preserving
63
+ identity or foreign status. The agent never publishes the stack; dispatcher
64
+ publication waits for session and execution settlement.
65
+
66
+ ## Foreign merges
67
+
68
+ Before any replay or publication, inspect every merge's non-first-parent history,
69
+ including nested side history, against identities reachable in the frozen parent.
70
+ Flattening is safe only when the merge has no own identity and every side-history
71
+ identity is already present upstream. It becomes one foreign first-parent delta,
72
+ including resolution content or an empty result; side identities stay inherited.
73
+ An identity-bearing merge, absent upstream side identity, malformed or ambiguous
74
+ identity refuses the whole restack. The branch and contribution boundary remain
75
+ untouched and the integration build escalates with offending evidence. The kernel
76
+ never preserves merge topology or decomposes an unsafe merge automatically.
77
+
78
+ See [integration trees](integration-tree.md), [landing](landing-policy.md), and
79
+ [migration](migration-1.0.md).
@@ -119,8 +119,8 @@ exits nonzero on failure. Then:
119
119
  5. Commit the config, setup files, lockfiles, and installed reference changes,
120
120
  then push them to `baseBranch`. A remote sandbox clones the authoritative
121
121
  GitHub revision; it cannot acquire local-only edits.
122
- 6. Run `ab init --validate`. Fix every named failure and rerun until every check
123
- passes. Only then use the installed grooming/ticket skills to create the
122
+ 6. Run `ab init --validate`. Fix every named failure, review warnings and unknowns, and rerun
123
+ validation. Only then use the installed grooming/ticket skills to create the
124
124
  first groomed Ready ticket and start `ab dispatch`.
125
125
 
126
126
  Validation is explicit and noninteractive. It does not dispatch, claim a
@@ -208,21 +208,24 @@ sources agree with the running system by construction:
208
208
  **running dispatcher's version** (read from the deployed distribution's
209
209
  `package.json`), so the guest runs the dispatcher's own release.
210
210
 
211
- A service accepts stable clients from its own `major.minor` release line and
212
- the two preceding minor lines in the same major. A major starts a new family:
211
+ A service accepts stable and prerelease clients from its own `major.minor`
212
+ release line and the two preceding minor lines in the same major. A major starts a new family:
213
213
  X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
214
214
  Patch versions are interchangeable in both directions and must never change
215
215
  the protocol. Upgrade the service first, then projects independently within
216
216
  its window. Supported release lines retain their wire handlers and known
217
217
  protocol identities; an unknown protocol is refused independently of version.
218
- Malformed, missing, and prerelease identities are refused with HTTP 409.
218
+ Stable and prerelease service and client identities share their numeric major/minor
219
+ line. Malformed or missing identities, build metadata (`+…`), prefixes and
220
+ whitespace are refused with HTTP 409.
219
221
  A newer client is told to upgrade the service; a client below the window is
220
222
  told to upgrade the project's Autobuild. Diagnostics name the service version
221
223
  and supported range.
222
224
 
223
225
  Unauthenticated `GET /health` publishes `ok`, `autobuildVersion`,
224
226
  `protocolVersion`, and `supportedClientRange: { minVersion, maxVersionExclusive }`.
225
- The range is inclusive at the minimum and exclusive at the maximum; a 0.11.x
227
+ Range endpoints remain stable versions. The range is inclusive at the minimum
228
+ and exclusive at the maximum; a 0.11.x
226
229
  service publishes `>=0.9.0 <0.12.0`. Health needs no credentials, version
227
230
  headers, or available backend.
228
231
 
@@ -473,3 +476,43 @@ To retain earlier names configure `triageState = "Backlog"`,
473
476
  `claimedState = "Doing"`, `doneState = "Done"`, and the desired `readyState`.
474
477
  Existing ticket rows are never renamed. Older combined-service clients continue
475
478
  using the uploaded dispatcher configuration until independent policy is published.
479
+
480
+ ## Forge readiness
481
+
482
+ Validation inspects the configured forge once on the host, including when builds
483
+ run in Vercel Sandbox. Forge credentials never enter the guest. Each setting is
484
+ PASS, FAIL, WARN, or UNKNOWN; unknown never means permission was proved.
485
+
486
+ For GitHub, enable **Allow squash merging** and **Allow rebase merging** in
487
+ Settings → General. The kernel needs direct publication and force-push permission
488
+ throughout `refs/heads/ab/` and `refs/heads/ab-node/`, including future branch
489
+ names. It also publishes immutable `refs/autobuild/archive/` refs, a non-head
490
+ namespace. Review protection rules, inherited organization rulesets, push rules,
491
+ and actor restrictions for all three namespaces. GitHub's branch APIs cannot
492
+ prove archive-domain access: manually verify it with your administrator without
493
+ creating probe refs or overwriting archives. Autobuild never changes settings or
494
+ performs test pushes.
495
+
496
+ Require **linear history** on protected root and node target branches to prevent
497
+ merge commits from GitHub's update-branch action. On the configured root, enable
498
+ **Require branches to be up to date before merging**, with nonempty required
499
+ checks enforced for all merge actors. This makes root node landings fenced;
500
+ without it they are best-effort. Both are recommendations, so missing settings
501
+ produce warnings rather than hard failures.
502
+
503
+ Inspection needs **Metadata:read** for rulesets and **Administration:read** for
504
+ classic protection; classic private-repository tokens need `repo` access.
505
+ Publication separately needs **Contents:write**. Read access never proves write
506
+ access. Insufficient scope, incomplete inventories, ambiguous patterns, or
507
+ unproven actor bypass produce UNKNOWN with access/remediation guidance. Plugins
508
+ without the optional readiness capability report UNKNOWN and need an adapter
509
+ upgrade; local Git passes these hosted-policy checks trivially.
510
+
511
+ Known hard failures make `ab init --validate` exit unsuccessfully. Warnings and
512
+ unknowns preserve the workspace validation result and require operator review.
513
+ Dispatch reports known hard failures once per invocation as durable
514
+ `dispatcher.forge-readiness-failed` repository notices without adding an admission
515
+ gate. External orchestrators follow these through `ab watch` with no slugs or an
516
+ explicit repository watch; `ab wait` remains build-only. The dashboard and operator
517
+ repository query retain all failures for that run. After correcting settings or
518
+ access, revalidate and restart dispatch to refresh its startup diagnostics.
@@ -57,3 +57,72 @@ or repair the blocker set, and only then move the ticket back to ready. Moving
57
57
  the ticket before cleanup finishes can be overwritten by cleanup. Ready with
58
58
  unresolved blockers is the normal waiting state: dispatch rechecks dependencies
59
59
  and claims the ticket only after they resolve and other readiness gates pass.
60
+
61
+ ## Node tickets and targets
62
+
63
+ Tickets have `kind = "work"` by default, or `kind = "node"` for a named
64
+ integration point. The optional `target` is a node ticket id in the same source;
65
+ omission means the configured `baseBranch` root. Nodes may target other nodes.
66
+ A ready node opens an integration branch; a targeting build freezes that node
67
+ as its base and landing destination. The existing cascade restacks descendants
68
+ when a parent moves. Blockers remain a separate graph.
69
+
70
+ Use `ab ticket create "Integration" --body spec.md --kind node`, then
71
+ `ab ticket update <id> --target <node-id>`. Clear a target with `--no-target`;
72
+ reset kind with `--kind work`. Omitted fields preserve existing values.
73
+ `ab ticket show <id> [--json]` exposes both fields; `ab ticket tree [--json]`
74
+ shows the configured root and every ticket, including completed work and empty
75
+ nodes, nested by target with state. Siblings are sorted by id. Invalid external
76
+ graphs and listing diagnostics are reported explicitly.
77
+
78
+ Targets must exist and be nodes in the configured source. Self-targeting,
79
+ ancestor cycles and demoting a node with targeting tickets are refused before
80
+ any part of the requested update is written, regardless of ticket state.
81
+ Clear or reparent its children before demotion. File frontmatter persists the
82
+ fields; `ab ticket edit` displays them read-only. Change them through update.
83
+ Kind and target participate in content revisions and revision-checked writes.
84
+ File writes retain their existing best-effort, unlocked concurrency semantics.
85
+
86
+ Linear uses the exact `node` issue label for kind and the parent relation for
87
+ target, only when the parent carries that label. Ordinary grouping parents do
88
+ not impose targets and survive unrelated updates. Explicit target clear clears
89
+ the parent relation. Label replacements can demote nodes and receive the same
90
+ guards; explicit kind and label instructions must agree about `node`. Label
91
+ and parent connections are fully paginated. Linear still refuses guarded writes.
92
+
93
+ Hosted sources support kind and target with project-scoped transactional validation.
94
+ Existing tickets default to work with no target. Metadata changes increment the
95
+ revision once; equivalent aliases and unchanged values do not. Node demotion
96
+ checks all targeting tickets, including completed work. Legacy plugins without
97
+ integrationTree support read as work with no target and refuse metadata writes.
98
+
99
+
100
+ A node remains incomplete while any ticket targeting it is unresolved, including
101
+ triage and backlog tickets. Done and cancelled tickets are terminal. A complete
102
+ node with landed contributions verifies its exact head before explicit per-build
103
+ landing consent can publish it. If node verification fails, file a repair child
104
+ with that node as its target; landing the repair triggers a fresh cycle. Human
105
+ forge merges are recorded escape hatches from these gates.
106
+
107
+ ## When a blocker resolves
108
+
109
+ In a repository with nodes, a blocker that has a build resolves when its change
110
+ is present in the dependent's target head (or the configured root branch).
111
+ Source done state and aggregate blocker flags do not bypass this gate. A
112
+ confirmed landing SHA reachable from the sampled target proves presence even
113
+ without a build trailer. A node blocker requires its entire completed owned
114
+ contribution, including nested changes and foreign commits, excluding inherited
115
+ parent history. An empty completed contribution is satisfied; missing evidence,
116
+ an open or aborted node, or ambiguous newest build generations remain queued.
117
+ Older successful generations are never substituted for the newest build.
118
+
119
+ - Same node: the blocking change lands directly into the target.
120
+ - Ancestor: the change lands into an ancestor, then the cascade restacks the target.
121
+ - Sibling: the blocking node lands into their common ancestor, then the cascade reaches the target.
122
+ - Descendant: the blocking node lands into the dependent's target ancestor.
123
+
124
+ Blockers that never had a build, and repositories without nodes, retain the
125
+ source's done-state rule. Waiting tickets stay source work; diagnostics identify
126
+ the missing blocker and destination. Presence is checked only when claiming,
127
+ against an exact sampled head revalidated before claim. Changing presence later
128
+ never stops an existing build.