@defrex/autobuild 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/SPEC.md +432 -92
- package/bin/ab-dispatch-kernel.ts +1 -0
- package/docs/accounts.md +9 -0
- package/docs/agent-runtimes.md +1 -0
- package/docs/answering-blocked-builds.md +2 -1
- package/docs/architecture.md +282 -127
- package/docs/assets/headline-wide.png +0 -0
- package/docs/build-store.md +33 -3
- package/docs/cli.md +2 -1
- package/docs/configuration-overview.md +9 -0
- package/docs/configuration.md +163 -102
- package/docs/dispatcher-hosting.md +19 -3
- package/docs/dispatcher.md +9 -4
- package/docs/integration-overview.md +2 -2
- package/docs/integration-tree.md +91 -28
- package/docs/merge-policy.md +28 -9
- package/docs/operator-api.md +43 -18
- package/docs/operator-surfaces.md +1 -1
- package/docs/plugin-authoring.md +85 -8
- package/docs/remote-store-protocol.md +25 -7
- package/docs/remote-ticket-protocol.md +126 -12
- package/docs/restacking.md +20 -6
- package/docs/seams.md +2 -2
- package/docs/setup.md +19 -13
- package/docs/spec-standard.md +2 -1
- package/docs/ticket-dependencies.md +26 -8
- package/docs/ticket-migration.md +70 -7
- package/docs/ticket-sources.md +82 -5
- package/docs/tickets.md +34 -2
- package/docs/troubleshooting.md +2 -2
- package/docs/verification.md +5 -5
- package/docs/website.md +8 -0
- package/docs/workspaces.md +1 -1
- package/package.json +4 -3
- package/packages/core/src/accounts/hosted-readiness.ts +21 -0
- package/packages/core/src/cli/attention.ts +1 -0
- package/packages/core/src/cli/build-control.ts +36 -12
- package/packages/core/src/cli/connect.ts +9 -18
- package/packages/core/src/cli/context.ts +44 -0
- package/packages/core/src/cli/dashboard/configuration.ts +11 -0
- package/packages/core/src/cli/dashboard/model.ts +40 -10
- package/packages/core/src/cli/dashboard/queue.ts +21 -0
- package/packages/core/src/cli/dashboard/render.ts +40 -22
- package/packages/core/src/cli/dispatch-frontend.ts +63 -30
- package/packages/core/src/cli/dispatch-mode.ts +35 -16
- package/packages/core/src/cli/dispatch-repository-feed.ts +40 -11
- package/packages/core/src/cli/dispatch.ts +154 -47
- package/packages/core/src/cli/help.ts +59 -22
- package/packages/core/src/cli/init-hosted-accounts.ts +54 -0
- package/packages/core/src/cli/init-readiness-remote.ts +16 -3
- package/packages/core/src/cli/init-validation.ts +144 -42
- package/packages/core/src/cli/issue-links.ts +67 -0
- package/packages/core/src/cli/main.ts +32 -15
- package/packages/core/src/cli/pr-summary-publication.ts +38 -7
- package/packages/core/src/cli/publication-settlement.ts +36 -24
- package/packages/core/src/cli/repository-status.ts +201 -49
- package/packages/core/src/cli/status.ts +41 -3
- package/packages/core/src/cli/terminals.ts +37 -2
- package/packages/core/src/cli/ticket-editor.ts +20 -6
- package/packages/core/src/cli/ticket.ts +264 -46
- package/packages/core/src/cli/triage-count-sampler.ts +59 -0
- package/packages/core/src/cli/watch.ts +4 -0
- package/packages/core/src/config/live.ts +45 -4
- package/packages/core/src/config/load.ts +9 -0
- package/packages/core/src/config/pipeline-source.ts +6 -2
- package/packages/core/src/config/ready-assignee.ts +86 -0
- package/packages/core/src/config/schema.ts +164 -36
- package/packages/core/src/distribution-packaging.ts +1 -1
- package/packages/core/src/events/catalog.ts +5 -0
- package/packages/core/src/events/compatibility.ts +2 -1
- package/packages/core/src/events/payloads.ts +70 -0
- package/packages/core/src/events/policy.ts +8 -0
- package/packages/core/src/events/repository.ts +91 -28
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +41 -0
- package/packages/core/src/kernel/build-identity.ts +12 -0
- package/packages/core/src/kernel/change-presence.ts +139 -6
- package/packages/core/src/kernel/dispatch-capacity.ts +80 -14
- package/packages/core/src/kernel/dispatch-status.ts +10 -1
- package/packages/core/src/kernel/dispatch-upgrade.ts +104 -5
- package/packages/core/src/kernel/engine.ts +4 -2
- package/packages/core/src/kernel/finalize-pr-rejection.ts +95 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +15 -1
- package/packages/core/src/kernel/harvest.ts +4 -1
- package/packages/core/src/kernel/integration-completeness.ts +104 -17
- package/packages/core/src/kernel/integration-landing.ts +17 -0
- package/packages/core/src/kernel/integration-state.ts +17 -0
- package/packages/core/src/kernel/issue-keywords.ts +202 -0
- package/packages/core/src/kernel/janitor-failure.ts +11 -0
- package/packages/core/src/kernel/kernel-git.ts +87 -0
- package/packages/core/src/kernel/landing-readiness.ts +25 -17
- package/packages/core/src/kernel/log-index.ts +1 -1
- package/packages/core/src/kernel/node-issue-links.ts +142 -0
- package/packages/core/src/kernel/node-parent.ts +6 -0
- package/packages/core/src/kernel/node-restack-transaction.ts +2 -0
- package/packages/core/src/kernel/pr-summary.ts +24 -0
- package/packages/core/src/kernel/read-deferrals.ts +75 -12
- package/packages/core/src/kernel/read-facts.ts +32 -1
- package/packages/core/src/kernel/reconcile-restack.ts +1 -1
- package/packages/core/src/kernel/reducer-registry.ts +31 -1
- package/packages/core/src/kernel/reducer.ts +90 -2
- package/packages/core/src/kernel/ticket-preparation.ts +12 -0
- package/packages/core/src/kernel/verify-budget.ts +43 -0
- package/packages/core/src/operator/index.ts +3 -1
- package/packages/core/src/operator/presentation.ts +3 -0
- package/packages/core/src/operator/protocol.ts +38 -2
- package/packages/core/src/operator/query.ts +66 -29
- package/packages/core/src/operator/registry.ts +47 -26
- package/packages/core/src/operator/tickets.ts +77 -10
- package/packages/core/src/plugin-sdk/index.ts +13 -0
- package/packages/core/src/plugins/manifest.ts +1 -1
- package/packages/core/src/plugins/registry.ts +1 -0
- package/packages/core/src/ports/forge/contract.ts +69 -0
- package/packages/core/src/ports/forge/create.ts +5 -0
- package/packages/core/src/ports/forge/fake.ts +184 -3
- package/packages/core/src/ports/forge/git-rewrite.ts +4 -2
- package/packages/core/src/ports/forge/github.ts +175 -38
- package/packages/core/src/ports/forge/local-git.ts +14 -0
- package/packages/core/src/ports/forge/readiness.ts +10 -0
- package/packages/core/src/ports/forge-failure.ts +43 -0
- package/packages/core/src/ports/runner/claude.ts +7 -1
- package/packages/core/src/ports/runner/codex.ts +7 -2
- package/packages/core/src/ports/runner/native-cli-fixture.ts +2 -1
- package/packages/core/src/ports/runner/pi.ts +7 -1
- package/packages/core/src/ports/runner/runtime.ts +3 -0
- package/packages/core/src/ports/runner/start-prompt.ts +37 -0
- package/packages/core/src/ports/tickets/contract.ts +320 -7
- package/packages/core/src/ports/tickets/create.ts +72 -17
- package/packages/core/src/ports/tickets/fake.ts +18 -0
- package/packages/core/src/ports/tickets/file-codec.ts +20 -0
- package/packages/core/src/ports/tickets/file.ts +43 -1
- package/packages/core/src/ports/tickets/github-fake.ts +1123 -0
- package/packages/core/src/ports/tickets/github-issues.ts +431 -0
- package/packages/core/src/ports/tickets/github-validators.ts +194 -0
- package/packages/core/src/ports/tickets/github.ts +2029 -0
- package/packages/core/src/ports/tickets/hosted-index.ts +34 -3
- package/packages/core/src/ports/tickets/issue-links.ts +86 -0
- package/packages/core/src/ports/tickets/lifecycle.ts +60 -4
- package/packages/core/src/ports/tickets/linear.ts +66 -6
- package/packages/core/src/ports/tickets/migration.ts +290 -68
- package/packages/core/src/ports/tickets/operations.ts +98 -12
- package/packages/core/src/ports/tickets/priority.ts +55 -0
- package/packages/core/src/ports/tickets/remote-protocol.ts +195 -29
- package/packages/core/src/ports/tickets/remote.ts +188 -13
- package/packages/core/src/ports/tickets/revision.ts +22 -1
- package/packages/core/src/ports/tickets/states.ts +43 -0
- package/packages/core/src/ports/tickets/tree.ts +58 -12
- package/packages/core/src/ports/tickets/update.ts +12 -2
- package/packages/core/src/ports/types.ts +190 -9
- package/packages/core/src/ports/workspace/commit-preservation.ts +135 -13
- package/packages/core/src/ports/workspace/git-worktree.ts +3 -1
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +118 -27
- package/packages/core/src/processes/build-runner.ts +99 -21
- package/packages/core/src/processes/dispatcher.ts +822 -338
- package/packages/core/src/processes/execution-no-progress.ts +5 -0
- package/packages/core/src/processes/harvest-runner.ts +17 -8
- package/packages/core/src/processes/harvest.ts +5 -8
- package/packages/core/src/processes/tick-publication.ts +12 -2
- package/packages/core/src/processes/ticket-scan-schedule.ts +78 -0
- package/packages/core/src/processes/workspace-preservation.ts +36 -1
- package/packages/core/src/runtime-identity.ts +10 -2
- package/packages/core/src/scenarios/harness.ts +4 -0
- package/packages/core/src/store/adapter.ts +7 -1
- package/packages/core/src/store/contract.ts +83 -2
- package/packages/core/src/store/digest.ts +32 -1
- package/packages/core/src/store/reducer-value-shapes.json +4187 -3391
- package/packages/core/src/store/remote/protocol.ts +2 -0
- package/packages/core/src/store/remote/released-clients.json +11 -0
- package/packages/core/src/store/remote/released-reducer-values/1.5.0.json +26924 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +2 -0
- package/packages/core/src/store/repo-state-events.ts +2 -0
- package/packages/core/src/store/types.ts +5 -0
- package/packages/core/src/testing/dispatch-read-budget.ts +729 -123
- package/packages/core/src/testing/index.ts +18 -1
- package/packages/core/src/testing/presence-history.ts +79 -0
- package/packages/core/src/testing/reduced-read-budget.ts +1085 -31
- package/packages/core/src/testing/upgrade-generations.ts +77 -0
- package/skills/code-review/SKILL.md +4 -3
- package/skills/finalize/SKILL.md +18 -2
- package/skills/guide/SKILL.md +374 -136
- package/skills/guide/references/accounts.md +9 -0
- package/skills/guide/references/integration-tree.md +91 -28
- package/skills/guide/references/merge-policy.md +28 -9
- package/skills/guide/references/operator-api.md +43 -18
- package/skills/guide/references/plugin-authoring.md +85 -8
- package/skills/guide/references/remote-store-protocol.md +25 -7
- package/skills/guide/references/remote-ticket-protocol.md +126 -12
- package/skills/guide/references/restacking.md +20 -6
- package/skills/guide/references/setup.md +19 -13
- package/skills/guide/references/spec-standard.md +2 -1
- package/skills/guide/references/ticket-dependencies.md +26 -8
- package/skills/guide/references/ticket-migration.md +70 -7
- package/skills/harvest-review/SKILL.md +4 -3
- package/skills/implement/SKILL.md +20 -1
- package/skills/operate/SKILL.md +103 -28
- package/skills/plan/SKILL.md +1 -1
- package/skills/reconcile/SKILL.md +5 -4
- package/skills/spec/SKILL.md +15 -2
- package/skills/tickets/SKILL.md +114 -37
- package/templates/autobuild.toml +5 -0
- package/templates/hosted-service/package.json +2 -2
|
@@ -96,6 +96,15 @@ and makes one minimal request using each account's actual runtime, including
|
|
|
96
96
|
unused accounts, in the disposable sandbox. Hosted ChatGPT credentials use the
|
|
97
97
|
metadata readiness boundary described below.
|
|
98
98
|
|
|
99
|
+
Hosted Claude and Kimi accounts use the same boundary. When a connected project
|
|
100
|
+
is validated in Vercel Sandbox and the account's variable is absent locally,
|
|
101
|
+
validation reports the project secret set by `bun ab secrets set VARIABLE` from
|
|
102
|
+
its write-only metadata: owner, set time and status. It never downloads, prints
|
|
103
|
+
or forwards the value and makes no model request for that account. **The first
|
|
104
|
+
hosted build is the live check.** A missing or non-ready secret fails before
|
|
105
|
+
the sandbox is created and names both remedies: set the project secret, or
|
|
106
|
+
provide the local variable. A local variable keeps the minimal model request.
|
|
107
|
+
|
|
99
108
|
|
|
100
109
|
## ChatGPT subscriptions
|
|
101
110
|
|
|
@@ -78,6 +78,18 @@ label and parent connections are fully paginated and guarded writes are refused.
|
|
|
78
78
|
Kind and target participate in content revisions; file writes retain their
|
|
79
79
|
best-effort unlocked semantics. `ab ticket edit` displays these fields read-only.
|
|
80
80
|
|
|
81
|
+
GitHub also uses the exact `node` label for kind. A ticket targets a node by
|
|
82
|
+
being a sub-issue of the node's issue, so each node's children show in its
|
|
83
|
+
sub-issue list on GitHub. A parent without the `node` label, or in another
|
|
84
|
+
repository, is grouping: it gives no target, never blocks dispatch, and is left
|
|
85
|
+
untouched. `--target` on a sub-issue of a grouping parent is refused, naming the
|
|
86
|
+
parent, and `--no-target` never removes grouping. Setting a target replaces a
|
|
87
|
+
node parent. Adding or removing a sub-issue or the `node` label in the GitHub
|
|
88
|
+
UI reads back the same as `ab ticket`. Sub-issue lists are fully paginated.
|
|
89
|
+
GitHub caps a node at 100 direct sub-issues and 8 levels of nesting. A
|
|
90
|
+
repository label cased otherwise, such as `Node`, must be renamed to `node`
|
|
91
|
+
before tickets can become nodes. There are no guarded writes.
|
|
92
|
+
|
|
81
93
|
A ready node opens `ab-node/<slug>` at its parent's sampled head. Opening intent
|
|
82
94
|
and acknowledgement are durable. Its branch admits children immediately, with
|
|
83
95
|
no placeholder commit or PR. Idle nodes need no provisioned workspace, runner,
|
|
@@ -86,14 +98,19 @@ has commits its current parent lacks; parent-only advancement remains empty.
|
|
|
86
98
|
|
|
87
99
|
|
|
88
100
|
A node requesting reconcile or verification is admitted before new ticket
|
|
89
|
-
claims.
|
|
101
|
+
claims. The request is durable: a prepared verification cycle or a restack
|
|
102
|
+
conflict, with no runner yet. Until the node holds its slot, intake reserves one
|
|
103
|
+
slot for it, and the dispatcher checks its admission every tick regardless of
|
|
104
|
+
idle node polling, so a slot freed in any tick goes to the node, not to a new
|
|
105
|
+
claim. Its candidate occupancy excludes itself and capacity-bearing blocked or
|
|
90
106
|
paused descendants, following accepted source-qualified build target ancestry.
|
|
91
107
|
Running descendants and unrelated builds still count; ordinary blocked and
|
|
92
108
|
paused work retains its slot for every other admission. Provisioning reserves
|
|
93
109
|
node occupancy before the runner starts. This exception never raises the budget
|
|
94
110
|
for new claims. Status and both dashboards report actual occupancy, configured
|
|
95
111
|
capacity, effective display capacity and the nodes using descendant-held slots.
|
|
96
|
-
|
|
112
|
+
Status, `ab builds` and both dashboards report each node waiting for a slot
|
|
113
|
+
ahead of new ticket claims. Idle collecting nodes remain free.
|
|
97
114
|
|
|
98
115
|
Claims freeze the destination build generation and branch. Missing, unopened,
|
|
99
116
|
merged, closed or aborted targets leave work queued with diagnostics. The newest
|
|
@@ -103,28 +120,8 @@ source targets, while build status shows the effective destination.
|
|
|
103
120
|
|
|
104
121
|
## Collect, verify and merge
|
|
105
122
|
|
|
106
|
-
Node `verify:*`
|
|
107
|
-
|
|
108
|
-
identities, event-authorized spec revisions and spec paths, and their commits.
|
|
109
|
-
The index maps every commit in the range using build identity trailers,
|
|
110
|
-
including earlier-cycle contributions and merge side history. Commits without
|
|
111
|
-
an identity are listed as unattributed (a mechanical classification). The manifest
|
|
112
|
-
and index also expose `handPushedCommits: [{sha, originalSha, message}]` for owned
|
|
113
|
-
hand-pushed commits in the frozen range, preserving original identity across restacks.
|
|
114
|
-
Their full messages express maintainer-authorized intent: judge quality and
|
|
115
|
-
consistency, and never fail them solely for lacking a covering spec. Other node
|
|
116
|
-
changes are authorized when covered by the current event-authorized node spec or the spec
|
|
117
|
-
of the contribution introducing it; use the commit mapping to find that spec.
|
|
118
|
-
The dispatcher collects these inputs with repository authority before launching
|
|
119
|
-
verification and atomically deposits a node-owned `node-verification-context`
|
|
120
|
-
artifact cited by exact revision in `integration.prepared`. Contributor specs
|
|
121
|
-
freeze at preparation; resumed and concurrent verifiers read the same cycle input.
|
|
122
|
-
Hydration reads only that node-owned artifact and grants no general contributor
|
|
123
|
-
read authority. Missing or ambiguous provenance prevents preparation; missing,
|
|
124
|
-
corrupt or mismatched prepared inputs fail hydration. Historical agent cycles
|
|
125
|
-
without a citation require a new integration cycle. Leaf context is unchanged.
|
|
126
|
-
See [iterating inside a node](#iterating-inside-a-node) for authoring and evolving
|
|
127
|
-
these sources of intent.
|
|
123
|
+
Node `verify:*` sessions receive frozen contribution provenance; see
|
|
124
|
+
[node verification context](#node-verification-context).
|
|
128
125
|
|
|
129
126
|
Create a node and direct work into it (replace ids with those returned by your
|
|
130
127
|
source):
|
|
@@ -143,9 +140,11 @@ Each leaf runs the normal spec, plan/review, implement/review, verify and finali
|
|
|
143
140
|
pipeline against its frozen destination.
|
|
144
141
|
|
|
145
142
|
A node collects until every ticket targeting it is natively done or cancelled,
|
|
146
|
-
all frozen child claims have settled,
|
|
147
|
-
Triage, backlog and ready children
|
|
148
|
-
|
|
143
|
+
or sits in the configured rejected state, all frozen child claims have settled,
|
|
144
|
+
and at least one contribution has merged. Triage, backlog and ready children
|
|
145
|
+
keep it incomplete; a rejected child does not. Exhaustive enumeration of the
|
|
146
|
+
tickets targeting it (a source's `listTargeting` when present, as the GitHub
|
|
147
|
+
and hosted sources provide, otherwise `listAll`) fails closed. Completeness is sampled again before verification and
|
|
149
148
|
publication; tracker edits cannot be transactional with a forge write.
|
|
150
149
|
|
|
151
150
|
The kernel runs all configured verify steps with normal path applicability on
|
|
@@ -164,12 +163,76 @@ consent. Automatic authorization still requires every readiness and merge gate.
|
|
|
164
163
|
A merged node completes its ticket and closes admission; it is not a perpetual
|
|
165
164
|
staging branch. Releases remain separate maintainer operations.
|
|
166
165
|
|
|
166
|
+
Issue links close when the node lands. On GitHub, a child's PR into a node
|
|
167
|
+
ends with one `Refs #N` line per linked issue, so each issue shows the PR that
|
|
168
|
+
did the work, but it never closes anything, and its landed commit carries no
|
|
169
|
+
lines. As each child lands, its links, downgrades included, are recorded on the
|
|
170
|
+
node, and a nested node passes its own links and its set up to its parent. On a
|
|
171
|
+
forge that closes issues and can update PR bodies (GitHub), the root node's PR
|
|
172
|
+
into the default branch carries one line per issue for the node's own links and
|
|
173
|
+
every contribution, kept current as children land and refreshed before the
|
|
174
|
+
kernel lands it. A downgrade by any child makes the issue `Refs`. Merging the
|
|
175
|
+
root node PR, by the kernel or a human, closes the rest, including the node's
|
|
176
|
+
own issue; landed child commits keep their own messages.
|
|
177
|
+
|
|
167
178
|
Human forge merges are an explicit escape hatch, including while incomplete,
|
|
168
179
|
paused or unverified. The janitor records human provenance and whether the actual
|
|
169
180
|
merged head was verified, then completes the ticket. Closing without merge or
|
|
170
181
|
aborting closes admission and returns the ticket to triage; already claimed
|
|
171
182
|
children retain their frozen destination.
|
|
172
183
|
|
|
184
|
+
### Node verification context
|
|
185
|
+
|
|
186
|
+
In node `verify:*` context, `nodeVerification` in the manifest identifies the
|
|
187
|
+
frozen `range`, `indexPath`, `contributions`, `handPushedCommits` and
|
|
188
|
+
`unattributedCommits`. Each contribution has `build`, its preparation-time
|
|
189
|
+
stored `ticket` identity, `spec: {kind: 'spec', rev}` (the event-authorized
|
|
190
|
+
revision), `specPath` and `commits`. The JSON index repeats this metadata and
|
|
191
|
+
adds the exhaustive ordered `commits: [{sha, build?}]` mapping. Paths are
|
|
192
|
+
workspace-relative and reflect scratch allocation, including legacy
|
|
193
|
+
tracked-file collisions. Contribution specs normally live at
|
|
194
|
+
`$AB_CONTEXT_DIR/contributions/<build>/spec.md` and the index at
|
|
195
|
+
`$AB_CONTEXT_DIR/node-verification.json`; both are marked `derived` in
|
|
196
|
+
`materialized`, with their source build and revision recorded in the metadata.
|
|
197
|
+
Read them through the manifest's allocated paths.
|
|
198
|
+
|
|
199
|
+
Membership comes from build identity trailers on every commit reachable in the
|
|
200
|
+
frozen parent-to-head range, including earlier-cycle contributions and merge
|
|
201
|
+
side history. Commits without an identity are listed as unattributed, a
|
|
202
|
+
mechanical absence of a trailer rather than an authorization verdict.
|
|
203
|
+
`handPushedCommits: [{sha, originalSha, message}]`, in the manifest and the
|
|
204
|
+
index, identifies node-owned hand-pushed commits in the frozen range. Ownership
|
|
205
|
+
uses the durable first-parent contribution boundary; inherited and merge-side
|
|
206
|
+
history are not automatically owned. Confirmed rewrite aliases preserve
|
|
207
|
+
original identity across restacks, and `message` is the full commit message.
|
|
208
|
+
|
|
209
|
+
Hand-pushed messages express maintainer-authorized intent: judge quality and
|
|
210
|
+
consistency, and never fail these commits solely for lacking a covering spec.
|
|
211
|
+
Other node changes are authorized when covered by the current event-authorized
|
|
212
|
+
node spec or the spec of the contribution introducing it; use the commit
|
|
213
|
+
mapping to find that spec.
|
|
214
|
+
|
|
215
|
+
The dispatcher collects these inputs with repository authority while preparing
|
|
216
|
+
the exact cycle head, before launching verification, and atomically deposits a
|
|
217
|
+
versioned node-owned `node-verification-context` artifact cited by exact
|
|
218
|
+
revision in `integration.prepared`. Specs use the event-authorized revision at
|
|
219
|
+
preparation, never an unsanctioned latest deposit or mutable ticket body.
|
|
220
|
+
Contributor specs freeze at preparation; resumed and concurrent verifiers read
|
|
221
|
+
the same cycle input, and a new cycle collects fresh contributor identities and
|
|
222
|
+
specs.
|
|
223
|
+
|
|
224
|
+
Hydration reads only that cited artifact, validates its cycle and range, and
|
|
225
|
+
allocates the public paths. It grants no general contributor read authority and
|
|
226
|
+
performs no Git provenance discovery; session and build scope permissions are
|
|
227
|
+
unchanged. Unknown identities, ambiguous or invalid trailers, and missing
|
|
228
|
+
source data prevent preparation; missing, corrupt or mismatched prepared inputs
|
|
229
|
+
fail hydration without publishing a manifest. Historical agent cycles without a
|
|
230
|
+
citation require a new prepared cycle; check-only cycles need no contributor
|
|
231
|
+
inputs. Leaf verification omits node provenance; leaf context is unchanged.
|
|
232
|
+
|
|
233
|
+
See [iterating inside a node](#iterating-inside-a-node) for authoring and
|
|
234
|
+
evolving these sources of intent.
|
|
235
|
+
|
|
173
236
|
## Iterating inside a node
|
|
174
237
|
|
|
175
238
|
Write the node spec as a finite integration charter: its goal, observable
|
|
@@ -198,7 +261,7 @@ An open node supports three ways to iterate:
|
|
|
198
261
|
restrictions.
|
|
199
262
|
|
|
200
263
|
Open children keep the node incomplete, including triage, backlog and ready
|
|
201
|
-
children. Completion remains finite: merged or otherwise ended nodes close
|
|
264
|
+
children. A child in the configured rejected state is not open. Completion remains finite: merged or otherwise ended nodes close
|
|
202
265
|
admission. Iteration does not relax verification of the exact head and parent,
|
|
203
266
|
or the configured readiness, consent and merge gates described above.
|
|
204
267
|
|
|
@@ -115,13 +115,19 @@ authoritatively ungated root permits an inspected-head guarded direct squash;
|
|
|
115
115
|
unknown gate state defers. Node targets instead require authoritative proof of
|
|
116
116
|
an ungated destination, cancel native auto-merge and serialize the guarded push.
|
|
117
117
|
Gated or unproven node destinations stay open with actionable diagnostics.
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
A push alone is not evidence of merge: a node-target merge is recorded only
|
|
119
|
+
under the publication readback rule in Forge requirements. Forge
|
|
120
|
+
acknowledgement, a merged-SHA comment and closing an unacknowledged open
|
|
121
|
+
review, is best-effort after the merge is recorded and never decides, retries
|
|
122
|
+
or fails the merge.
|
|
120
123
|
|
|
121
124
|
Native application receipts bind to exact candidates; consent does not. Every
|
|
122
125
|
replacement confirms cancellation first; the next poll reconciles native state
|
|
123
|
-
before other actions. Stale enables are repaired by polling.
|
|
124
|
-
|
|
126
|
+
before other actions. Stale enables are repaired by polling. An
|
|
127
|
+
already-enabled native request counts as applied only after the forge confirms
|
|
128
|
+
its squash method and identity message. Each eligible poll re-reads an armed
|
|
129
|
+
request and repairs it when PR edits or a human arm left it stale. This bounded
|
|
130
|
+
model requires replacement-head checks to take far longer than a poll interval. It
|
|
125
131
|
has no durable native-effect reservation. Human forge merges record whether a
|
|
126
132
|
hold was overridden; possible stale-enable merges raise operator attention.
|
|
127
133
|
No result is undone by rewriting the target.
|
|
@@ -149,10 +155,16 @@ admitting nodes or requesting unsupported retargeting or merge operations.
|
|
|
149
155
|
For the lifecycle see [integration trees](integration-tree.md); for old controls
|
|
150
156
|
and upgrade conversion see [migration](migration-1.0.md).
|
|
151
157
|
|
|
152
|
-
Publication
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
Publication, including a node-target merge, is acknowledged only by exact
|
|
159
|
+
authoritative head readback of the destination: `ls-remote` on an origin
|
|
160
|
+
forge, the shared database for local-git. A node merge is recorded when that
|
|
161
|
+
readback shows exactly the candidate head, or from the durable receipt of an
|
|
162
|
+
accepted guarded write overtaken before readback. A different observed head is
|
|
163
|
+
contention and records no merge; a failed readback records nothing and is
|
|
164
|
+
retried. Interrupted publication recovers by the same exact readback; an
|
|
165
|
+
unconfirmed candidate's descendants do not prove success. Durable confirmed
|
|
166
|
+
receipts preserve historical writes. Local refs cache confirmed heads; remote
|
|
167
|
+
expected-head leases and durable writer reservations still guard writes.
|
|
156
168
|
Local-git's shared database retains authoritative CAS.
|
|
157
169
|
|
|
158
170
|
Native cancellation receipts are candidate- and operation-specific. Publication
|
|
@@ -167,7 +179,14 @@ with one deprecation notice on stderr. `node-landed` remains an alias for the
|
|
|
167
179
|
`ab wait --for node-merged` condition. Ordinary help lists only the current names.
|
|
168
180
|
|
|
169
181
|
The deprecated `[[landing]]` config array has the same semantics as `[[merge]]`
|
|
170
|
-
and warns after validation.
|
|
182
|
+
and warns after validation. Commands that read the file warn each time they run.
|
|
183
|
+
`ab dispatch` reports it once at startup with its other configuration notices
|
|
184
|
+
(stderr, or the dashboard's warning region), and once more for each changed
|
|
185
|
+
`autobuild.toml` it evaluates — including a change it rejects or has not yet
|
|
186
|
+
applied, which is labelled as pending. Repeated evaluation and phase launches
|
|
187
|
+
stay quiet, and a build branch's own `landing` key is not reported because merge
|
|
188
|
+
policy comes from the dispatcher's configuration. Declare only one spelling,
|
|
189
|
+
including empty arrays.
|
|
171
190
|
`ab upgrade` renames the old root key and table headers while preserving policy;
|
|
172
191
|
unsupported spellings require the reported manual edit before retrying.
|
|
173
192
|
|
|
@@ -84,11 +84,11 @@ raw session-event append. External operator harnesses own agent execution.
|
|
|
84
84
|
|---|---|
|
|
85
85
|
| `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. |
|
|
86
86
|
| `GET …/builds/{slug}` | `{detail, dashboardRow}`; `detail.runnerAttaches` records chronological attach boundaries and their runtime identity (version, commit, source kind/location), with null runtime for unrecorded historical attaches; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it (after cleanup's `build.completed`). |
|
|
87
|
-
| `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, queue/capacity and settings projection. Optional `rollback` contains `correlation`, `lineage`, full `failed` and `restored` runtime identities and rollback event `ts` for the authoritative dispatcher lineage’s unresolved hold. Both dashboards name failed, restored and held runtime plus timestamp. Matching durable different-target hold clearance removes it; a fresh operator lineage hides it only after a committed operational tick or accepted takeover. Run-started and yielded ticks alone cannot replace authority; same-lineage generations retain the notice. Historical rollback records are not fallback notices. Optional `handoffs` lists all accepted unfinished handoffs with predecessor `run`, optional `successor`, `correlation`, full `from`/`to` runtimes, `mode` and optional `deadline`. Outstanding drain-mode builds carry `draining: true`, also on build-detail `dashboardRow`; matching settlement removes it. Accepted completion removes the handoff; neither takeover nor the clock does. Missing historical mode means cutover and missing deadline displays unknown. |
|
|
88
|
-
| `GET …/status` | Repository intake, pause, and default-auto-merge projection. |
|
|
87
|
+
| `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, triage (when the dispatcher published one)/queue/capacity and settings projection. `model.configuration` is `"no-dispatcher-run"` when the repository records no dispatcher run, and absent otherwise. Optional `rollback` contains `correlation`, `lineage`, full `failed` and `restored` runtime identities and rollback event `ts` for the authoritative dispatcher lineage’s unresolved hold. Both dashboards name failed, restored and held runtime plus timestamp. Matching durable different-target hold clearance removes it; a fresh operator lineage hides it only after a committed operational tick or accepted takeover. Run-started and yielded ticks alone cannot replace authority; same-lineage generations retain the notice. Historical rollback records are not fallback notices. Optional `handoffs` lists all accepted unfinished handoffs with predecessor `run`, optional `successor`, `correlation`, full `from`/`to` runtimes, `mode` and optional `deadline`. Outstanding drain-mode builds carry `draining: true`, also on build-detail `dashboardRow`; matching settlement removes it. Accepted completion removes the handoff; neither takeover nor the clock does. Missing historical mode means cutover and missing deadline displays unknown. |
|
|
88
|
+
| `GET …/status` | Repository intake, pause, and default-auto-merge projection. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
|
|
89
89
|
| `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
|
|
90
90
|
| `GET …/builds/{slug}/artifacts/{kind}?rev=N` | Raw bytes (`application/octet-stream`) plus content-disposition and `X-Autobuild-Artifact-*` metadata headers. Omit `rev` for latest. |
|
|
91
|
-
| `GET …/tickets?state=S&label=L&limit=N&offset=K&order=O` | `{states,tickets,diagnostics,criteria,triageState,readyState,doneState,total}`. The three lifecycle names come from effective repository configuration (including provider fallback). With no `state`, `criteria.state` is `triageState`; repeated `label` parameters narrow that state with AND filters. An explicit `state` selects that exact backend workflow state. `limit` (0–200) returns one page, after skipping `offset`, in `order` `oldest` (the
|
|
91
|
+
| `GET …/tickets?state=S&label=L&limit=N&offset=K&order=O` | `{states,tickets,diagnostics,criteria,triageState,readyState,doneState,total}`. The three lifecycle names come from effective repository configuration (including provider fallback). With no `state`, `criteria.state` is `triageState`; repeated `label` parameters narrow that state with AND filters. An explicit `state` selects that exact backend workflow state. `limit` (0–200) returns one page, after skipping `offset`, in `order` `oldest` (the default: dispatch order, urgent tickets first, then the source order) or `newest` (newest filed first); `total` counts every match before paging. |
|
|
92
92
|
| `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
|
|
93
93
|
| `GET …/tickets/{id}` | `{ticket,blockers,build}`. Blockers include native `exists`/`resolved` status; `build` prefers an active matching repository build, otherwise the most recently updated one. |
|
|
94
94
|
|
|
@@ -98,17 +98,25 @@ from `0` through `Number.MAX_SAFE_INTEGER` (`9007199254740991`). All other
|
|
|
98
98
|
supplied forms return `400 validation`.
|
|
99
99
|
|
|
100
100
|
Dashboard reads use the latest durable, run-correlated `effectiveConfig`
|
|
101
|
-
repository artifact.
|
|
101
|
+
repository artifact. A repository with no recorded dispatcher run answers the
|
|
102
|
+
dashboard with `200` and `model.configuration: "no-dispatcher-run"`: no rows,
|
|
103
|
+
repository controls from the journal, and an Active counter that is not
|
|
104
|
+
meaningful. Reads that need configuration (build detail, ticket context without
|
|
105
|
+
a published ticket policy) return a typed `409 no-dispatcher-run` there. When a
|
|
106
|
+
run is recorded, missing, corrupt, or invalid configuration returns a typed
|
|
102
107
|
`409 effective-config-unavailable`; the service never guesses from a checkout.
|
|
103
108
|
Clients poll these reads — the operator HTTP API exposes no push or long-poll
|
|
104
109
|
event transport. Streaming is provided by `ab watch`; unflagged watches are read-only.
|
|
105
110
|
Only CLI `--operator` watches write advisory liveness, never events or authority;
|
|
106
|
-
MCP presence registration is deferred.
|
|
111
|
+
MCP presence registration is deferred. Repository status over this API and MCP
|
|
112
|
+
marks operator presence `unavailable` rather than reporting an empty registration
|
|
113
|
+
list; use `ab repository status --json` for presence. `ab watch`
|
|
107
114
|
streams build and repository events by polling the same event logs client-side
|
|
108
115
|
(the store protocol's `GET /builds/{slug}/events` and `GET /repos/{repo}/events`
|
|
109
116
|
reads), not as a transport on this API. `triageState`, `readyState`,
|
|
110
117
|
`doneState`, and every entry in `states` are backend state names and must be sent back verbatim
|
|
111
|
-
when used
|
|
118
|
+
when used as the move control's `state`. A move may instead name a lifecycle `role`,
|
|
119
|
+
which the service resolves through the repository's `[tickets]` configuration.
|
|
112
120
|
|
|
113
121
|
## Controls
|
|
114
122
|
|
|
@@ -124,9 +132,9 @@ JSON bodies are strict: unknown fields are rejected.
|
|
|
124
132
|
| `POST …/bulk-control` | `{"action":"pause"\|"resume"}`. The hold fact, intake fact, then eligible build events are written in that order. |
|
|
125
133
|
| `POST …/harvest/control` | `{"action":"toggle-gate"}` or `{"action":"run","run":"…"}`. A run action is bound to that concrete projected run. |
|
|
126
134
|
| `POST …/tickets/states` | `{name,about?}` → `{state,created}`; requires attributed operator identity (`tickets.state.create` in MCP). Hosted duplicate names are refused case-insensitively. |
|
|
127
|
-
| `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default. |
|
|
128
|
-
| `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. |
|
|
129
|
-
| `POST …/tickets/{id}/move` | `{"state":"backend state name"}`. |
|
|
135
|
+
| `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"normal","kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, and omitted priority is normal. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`; one that cannot store priority refuses `urgent` with `code: "priority-unsupported"` and accepts `normal` as a no-op. |
|
|
136
|
+
| `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent` or `normal`; refusals as for create), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
|
|
137
|
+
| `POST …/tickets/{id}/move` | Exactly one of `{"state":"backend state name"}` or `{"role":"triage"\|"ready"\|"backlog"\|"rejected"}`; both or neither is `400 validation` (`tickets.move` in MCP takes the same target). A role resolves to the configured `triageState`, `readyState`, `backlogState`, or `rejectedState`. An unset `backlogState` or `rejectedState` refuses with a message naming the key to set, and never guesses a native state. A source that can create states creates a missing role state before moving. |
|
|
130
138
|
| `POST …/tickets/{id}/block` | `{"blockerIds":["…"]}`. |
|
|
131
139
|
| `POST …/tickets/{id}/unblock` | `{"blockerIds":["…"]}`. |
|
|
132
140
|
|
|
@@ -214,6 +222,11 @@ skew and unavailable projections are `409 conflict`. A build outside the URL's
|
|
|
214
222
|
repository is deliberately hidden as `404 not-found` with `unknown build`,
|
|
215
223
|
consistently for detail, control, answer, and artifact routes. Control refusals are `409
|
|
216
224
|
refusal` and preserve the shared `BuildControlError` code and exact reason text.
|
|
225
|
+
A `land` control whose merge candidate is not ready is refused with code
|
|
226
|
+
`merge-not-ready`, and its reason names the unmet condition; a node that fails
|
|
227
|
+
the live completeness check is refused with code `node-incomplete`, naming any
|
|
228
|
+
open children. Neither records consent or starts a merge, so refresh the
|
|
229
|
+
build's status and retry once the reason is resolved.
|
|
217
230
|
A partial bulk failure uses code `bulk-partial` and includes the durable write
|
|
218
231
|
progress and unattempted builds. Unexpected failures are `500 internal`.
|
|
219
232
|
|
|
@@ -280,7 +293,8 @@ The default watch reports actionable conditions only:
|
|
|
280
293
|
build/PR; it does not duplicate consent or hold attention.
|
|
281
294
|
- Repository `harvest.escalated`, `harvest.recovery-exhausted`,
|
|
282
295
|
`dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
|
|
283
|
-
`restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
|
|
296
|
+
`restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
|
|
297
|
+
`dispatcher.kernel-git-unavailable`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
|
|
284
298
|
- `dispatcher.ticket-source-persistent`: degradation past its advertised
|
|
285
299
|
reset time, once a tick started at or after reset has completed or failed
|
|
286
300
|
with the episode still open; crossing reset alone is silent. Without a reset,
|
|
@@ -343,8 +357,8 @@ when no events are available. Repository event reads have a 1,000-position
|
|
|
343
357
|
window; build history itself remains available through explicit pages.
|
|
344
358
|
|
|
345
359
|
|
|
346
|
-
Hosted ticket tools resolve independent project ticket policy
|
|
347
|
-
configuration. Queue, detail, state discovery and mutations work before any build
|
|
360
|
+
Hosted ticket tools resolve independent project ticket policy, including its
|
|
361
|
+
backlog and rejected roles for role moves, before legacy uploaded configuration. Queue, detail, state discovery and mutations work before any build
|
|
348
362
|
or dispatcher run; detail reports a null matching build. Ticket policy publication
|
|
349
363
|
never creates synthetic build or repository history.
|
|
350
364
|
|
|
@@ -379,13 +393,22 @@ non-node, unopened and terminal builds and enforces repository ownership.
|
|
|
379
393
|
|
|
380
394
|
Repository status includes `upgrades.runs`, keyed by originating dispatcher run,
|
|
381
395
|
with latest successful `resolved` target, detected target, failure, handoff and
|
|
382
|
-
completion evidence.
|
|
396
|
+
completion evidence. It retains at most 16 runs: the authoritative run, the run
|
|
397
|
+
holding the newest accepted handoff, the newest settled outcomes, then the most
|
|
398
|
+
recently active, keeping incomplete handoffs longest. Full upgrade history stays
|
|
399
|
+
in the repository journal for explicit history reads. `dispatcher.upgrade-target-resolved` carries strict
|
|
383
400
|
`{run, lineage, target}` data; the target has mode (`pinned`, `installed`, or
|
|
384
401
|
`source`), content key, source provenance and optional version/base/SHA. Source
|
|
385
402
|
mode names the authoritative base commit, which can advance without changing
|
|
386
403
|
packaged inputs or the running runtime. Status text renders the resolved mode,
|
|
387
404
|
base and SHA separately, so an older handoff cannot hide a newer target. Identical
|
|
388
|
-
observations append nothing
|
|
405
|
+
observations append nothing. A failure fact stays on its run until a later
|
|
406
|
+
successful preparation or handoff clears it; status marks it superseded once a
|
|
407
|
+
later resolved target with a different key, or a later generation, exists.
|
|
408
|
+
Human status shows at most the live handoff, the current generation's resolved
|
|
409
|
+
target and latest outcome, and the latest settled outcome from an earlier
|
|
410
|
+
generation; JSON `upgradeStatus` (`handoff`, `current`, `previous`, with
|
|
411
|
+
`superseded` on a replaced failure) carries the same projection. Facts carry launcher
|
|
389
412
|
lineage, from/to runtimes, resolution mode and authoritative base SHA/ref or original
|
|
390
413
|
installation provenance, plus prepared cache identity. Completion names the successor
|
|
391
414
|
and records completed retirement separately from takeover. During a handoff the
|
|
@@ -397,9 +420,11 @@ relaunch; their separate handoff capture never holds retirement open. `dispatche
|
|
|
397
420
|
attention; the current generation remains active and identical failed inputs are
|
|
398
421
|
suppressed across native handoff until target or selected-store compatibility evidence changes or a fresh operator launch.
|
|
399
422
|
|
|
400
|
-
Repository status additionally exposes `upgrades.lastRollback` (
|
|
401
|
-
when cleared), `upgrades.holds` keyed by launcher lineage
|
|
402
|
-
|
|
423
|
+
Repository status additionally exposes `upgrades.lastRollback` (the single latest
|
|
424
|
+
rollback, retained when cleared), `upgrades.holds` keyed by launcher lineage (up to
|
|
425
|
+
16 lineages, always including the authoritative lineage's hold), `upgrades.lineages`
|
|
426
|
+
keyed by generation run (the 16 most recent generation starts, always including the
|
|
427
|
+
authoritative run), optional `upgrades.authoritativeRun` from rollback, accepted takeover or committed operational tick (never startup/yield alone), `upgrades.rollbackIds` for idempotent rollback correlations (the 16 most recent), and `rollbackHold` for the effective dispatcher lineage.
|
|
403
428
|
`dispatcher.runtime-rolled-back` names failed/restored runtime identities and cache
|
|
404
429
|
roots, target, original handoff/takeover, three failed exits and reason. It is default
|
|
405
430
|
repository attention. `dispatcher.rollback-hold-cleared` records a different
|
|
@@ -543,7 +568,7 @@ permission or retention failures leave deletion pending. Vercel Blob cleanup use
|
|
|
543
568
|
the same store identity, token and prefixed pathname as uploads. Missing objects
|
|
544
569
|
are successful cleanup; provider errors never count as completed deletion.
|
|
545
570
|
|
|
546
|
-
Paged ticket listings use the source's optional native `listPage(criteria, page)` capability when present, otherwise read the full listing and
|
|
571
|
+
Paged ticket listings use the source's optional native `listPage(criteria, page)` capability when present, otherwise read the full listing, order it, and slice it: by default urgent tickets first, then normal ones, each in source order; for `newest`, the reversed source order. Native errors propagate. PostgreSQL counts matches without bodies and reads only the requested window. Zero limits and offsets past the end still report the full matching total. Unpaged listings remain exhaustive; the wire payload is the same for both paths.
|
|
547
572
|
|
|
548
573
|
|
|
549
574
|
### Forge cooldown admission and explicit recovery
|
|
@@ -42,7 +42,7 @@ Wrap an `AgentRunner` that supports:
|
|
|
42
42
|
- typed failures: verbatim message, retry-compatible `permanent` bit, optional `cause: availability | exhaustion | credentials | configuration` routing evidence
|
|
43
43
|
- the distribution-managed `ab` launcher
|
|
44
44
|
|
|
45
|
-
Declare served model prefixes and a default. Optional tool-free `oneShot` sits beside the runner interface.
|
|
45
|
+
Declare served model prefixes and a default. Optional tool-free `oneShot` sits beside the runner interface. An optional `startPrompt(opts)` returns the exact first message `start` sends, which the kernel records on `session.started`.
|
|
46
46
|
|
|
47
47
|
### `workspace-provider`
|
|
48
48
|
|
|
@@ -55,6 +55,7 @@ Declare served model prefixes and a default. Optional tool-free `oneShot` sits b
|
|
|
55
55
|
- Kernel-owned regular pushes, idempotent PR opening, PR-state projection, gated and ungated auto-merge, head-guarded squash merge, and comments. Agents never receive forge credentials or push.
|
|
56
56
|
- API 1.2: optional idempotent `closePr` and `deleteBranch` for abort cleanup. `closePr` must preserve a racing merge. Without them, cleanup stays visibly pending.
|
|
57
57
|
- Optional `prAttachments` hosts images; the text-only path must work without it.
|
|
58
|
+
- Optional `closesIssues: true` declares that closing keywords reaching the default branch close issues. Only then does the kernel pass `issueLinks` (`{ issue, intent }[]`). For a leaf aimed at the default branch it passes the build's sealed links to `openPr` and in `BuildLandingOptions` to `setAutoMerge` and `squashMerge`. Compose them with the SDK helpers: `neutralizeClosingReferences(title, links, { repository })` for the PR title and squash headline, `withIssueKeywords(body, links, { repository, trailers: false })` for the PR body so it ends with the `Closes #N` / `Refs #N` lines, and `landingMessage(message, buildSlug, links, { repository })` for the landed message, which puts the keyword paragraph before the trailer block. `repository` is `owner/name`, so qualified references to other repositories are left alone. Compare an already-applied landing request against the same composition, or auto-merge churns. The kernel calls `setAutoMerge(…, true, options)` on every eligible poll while a request is armed: return `applied` without mutating when the armed method and message match, and call `options.canApply()` before any mutation that repairs them. Without the flag no links are passed and none are written. A leaf aimed at a node passes its links to `openPr` with every intent `refs` (and none to the landing calls), a root node's PR receives the node's own links merged with its landed children's union, and a nested node's PR receives that set with every intent `refs`. When `openPr` adopts an existing open PR for the head and links are present, converge it: neutralize the existing title, recompose the existing body with `withIssueKeywords`, write only the fields that changed, and confirm by readback, without replacing the title, prose or merge message. To keep a node's PR current, implement the optional `updatePrIssueLinks(workspacePath, number, issueLinks)`: read the PR, neutralize its title and compose its body with `withIssueKeywords(body, links, { repository, trailers: false })`, write only when either changed, re-read and throw when the readback disagrees or the PR is not open. Without the method a node's set is recorded but never written.
|
|
58
59
|
|
|
59
60
|
### Reconcile rewrites
|
|
60
61
|
|
|
@@ -65,8 +66,10 @@ Reconcile requires the optional grouped `Forge.rewrite` capability:
|
|
|
65
66
|
archives also publish commits present only on the remote: GitHub uses create-only
|
|
66
67
|
Git-reference REST creation when the workspace lacks the commit, retaining guarded
|
|
67
68
|
Git pushes for local objects. Exact remote readback confirms publication, then a
|
|
68
|
-
|
|
69
|
-
restores missing commits and
|
|
69
|
+
non-shallow fetch of only that exact archive ref (without tags, configured refmap
|
|
70
|
+
expansion or a depth limit) restores missing commits and their missing ancestry,
|
|
71
|
+
writes no shallow boundary, leaves an already-shallow repository's existing
|
|
72
|
+
boundaries unchanged, and verifies the commits locally before returning.
|
|
70
73
|
3. Replace the explicit branch, leased on an explicit expected remote head.
|
|
71
74
|
|
|
72
75
|
- Return `lease-mismatch` separately from transport, auth and policy failures.
|
|
@@ -86,6 +89,15 @@ authentication, malformed responses or rate limits. Missing capability withholds
|
|
|
86
89
|
new replay requiring proof. GitHub uses exact-SHA comparison; local-git requires
|
|
87
90
|
an explicit served `repoRoot`. Unknown ancestry never authorizes replay.
|
|
88
91
|
|
|
92
|
+
The optional `remoteBranchExists(branch)` returns false only for proven absence
|
|
93
|
+
and throws on failure. Dispatch uses it at claim time to skip slugs whose build
|
|
94
|
+
branch another store already published, and to recognize a target node branch
|
|
95
|
+
another store opened. A throw during slug selection fails that claim: no build
|
|
96
|
+
is created and the ticket is handed back to retry on a later tick, never named
|
|
97
|
+
without the check. A throw while diagnosing a target node leaves the plain
|
|
98
|
+
pending diagnostic. Without the capability, slugs are deduplicated against the
|
|
99
|
+
local store only and the dispatcher records a startup warning.
|
|
100
|
+
|
|
89
101
|
Stores may expose `getNodeRewrite(node, previousHead, beforePrevious)` as a bounded point
|
|
90
102
|
lookup of a durable `node.rewritten` receipt. Built-in adapters index these
|
|
91
103
|
validated publication facts atomically with append, including transactional
|
|
@@ -108,6 +120,16 @@ confirmed, absent, or unknown without deleting an environment or its snapshots.
|
|
|
108
120
|
Only dispatcher-authorized reap follows the durable fence and preservation/loss
|
|
109
121
|
receipt. `provision` accepts exact `restoration` heads; branch ancestry must be
|
|
110
122
|
verified, and detached producer objects must never overwrite the named branch.
|
|
123
|
+
`preserve` receives `replaced`, and `provision` receives `restorationReplaced`:
|
|
124
|
+
the build's bounded record of the latest 64 shas recorded rewrites replaced.
|
|
125
|
+
A branch head equal to or contained in one of them is superseded. Preserve
|
|
126
|
+
archives it only as a producer; provision skips it before any branch mutation
|
|
127
|
+
and reports each skipped head, as `contained` or `superseded`, in the result's
|
|
128
|
+
`restorationSkipped`. The dispatcher demotes exact matches itself, so a
|
|
129
|
+
provider that ignores these fields stays safe. `preserve` also receives
|
|
130
|
+
`neverExecuted` when no execution ever started in the environment: a missing
|
|
131
|
+
base, `HEAD`, branch, or candidate object then means nothing to preserve rather
|
|
132
|
+
than an error. A provider that ignores it stays strict, and cleanup fails safely.
|
|
111
133
|
Provision/start failures signal `WorkspaceCleanupRequired` rather than deleting
|
|
112
134
|
or implicitly recreating an existing checkout. A confirmed `snapshot_not_found`
|
|
113
135
|
lookup establishes filesystem absence, while retaining the stale name for
|
|
@@ -184,6 +206,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
|
|
|
184
206
|
- **1.7** Workspace factory seams.
|
|
185
207
|
- **1.8** Forge failure classification and request observers.
|
|
186
208
|
- **1.9** Optional native ticket-source paging (`listPage`); older sources retain operator slicing.
|
|
209
|
+
- **1.10** Optional ticket-source ready-assignee capability (`readyAssignee`, with `prepareReadyAssignee`, `readyAssigneeRefusal` and `describeReadyAssignee`); sources without it refuse `[tickets].readyAssignee`. Also optional targeted ticket listing (`listTargeting`); older tree sources are observed through `listAll`.
|
|
187
210
|
|
|
188
211
|
## 2. Create a repository-local module
|
|
189
212
|
|
|
@@ -412,8 +435,9 @@ acme-autobuild-plugin/
|
|
|
412
435
|
└── bun.lock
|
|
413
436
|
```
|
|
414
437
|
|
|
415
|
-
|
|
438
|
+
Replace `<tested-version>` with the exact Autobuild release your contracts passed against: the version `bun add -d --exact @defrex/autobuild` recorded, also the first line of `ab --version`. That output's plugin API line is the version your `apiVersion` range must contain. Keep the peer at that tested release; widen it to a range only after the unchanged contracts pass on each added host.
|
|
416
439
|
|
|
440
|
+
<!-- plugin-authoring-package-manifest:start -->
|
|
417
441
|
```json
|
|
418
442
|
{
|
|
419
443
|
"name": "@acme/autobuild-plugin",
|
|
@@ -426,11 +450,12 @@ This manifest declares only the tested host release (`1.0.0-beta.2`); widen it o
|
|
|
426
450
|
"test": "bun test",
|
|
427
451
|
"prepublishOnly": "bun run typecheck && bun test"
|
|
428
452
|
},
|
|
429
|
-
"devDependencies": { "@defrex/autobuild": "
|
|
430
|
-
"peerDependencies": { "@defrex/autobuild": "
|
|
453
|
+
"devDependencies": { "@defrex/autobuild": "<tested-version>", "typescript": "5.9.3" },
|
|
454
|
+
"peerDependencies": { "@defrex/autobuild": "<tested-version>" },
|
|
431
455
|
"peerDependenciesMeta": { "@defrex/autobuild": { "optional": true } }
|
|
432
456
|
}
|
|
433
457
|
```
|
|
458
|
+
<!-- plugin-authoring-package-manifest:end -->
|
|
434
459
|
|
|
435
460
|
- **Dependencies.** Type-only SDK imports erase, so Autobuild is a dev dependency, not a runtime `dependencies` entry. The optional peer names the tested host without loading a second Autobuild copy. Runtime imports, such as the reference fake, need a runtime dependency; never ship the fake as a production adapter.
|
|
436
461
|
- **Versions.** Package semver is independent of the host range and `apiVersion`. On an incompatible host plugin API, update adapter and contracts, change the range once they pass, and version the package by the user-visible compatibility change.
|
|
@@ -468,8 +493,58 @@ An adapter opts in with `integrationTree: true` and must:
|
|
|
468
493
|
- before writing any mixed patch, including revision-checked writes, validate same-source existence, node kind, self and ancestor cycles, corrupt chains, and demotion of a node with children
|
|
469
494
|
- expose kind and target in revisions
|
|
470
495
|
|
|
496
|
+
Optionally (API 1.10), implement `listTargeting(nodeId: string): Promise<TicketListing>`: every ticket in every state whose target is `nodeId`, exhausting pagination and propagating infrastructure failures. It must equal `listAll()` filtered by `target === nodeId`, with diagnostics only for excluded records it read. Integration observation prefers it, so a node's completeness read can cost what its children cost instead of a full scan; a failure never falls back to `listAll`. The shared `describeTicketSourceContract` suite checks the equality for any source that declares it.
|
|
497
|
+
|
|
471
498
|
Don't opt in unless the source preserves these semantics. Legacy sources get ordinary CRUD; the compatibility facade refuses metadata writes before legacy methods run, and unsupported sources should also refuse metadata at their own write boundary.
|
|
472
499
|
|
|
500
|
+
## Optional issue links capability
|
|
501
|
+
|
|
502
|
+
An adapter opts in with `issueLinks: true` and must persist
|
|
503
|
+
`issueLinks?: IssueLink[]` (`{ issue: number, intent: 'closes' | 'refs' }`) on
|
|
504
|
+
create, update and revision-checked update, return them on every read sorted by
|
|
505
|
+
issue number (absent means none), treat an update's set as a complete replacement
|
|
506
|
+
where `[]` clears, and include nonempty links in revisions. `normalizeIssueLinks`
|
|
507
|
+
validates, defaults intent to `closes` and sorts. Without the flag, the
|
|
508
|
+
compatibility facade refuses any write naming links with
|
|
509
|
+
`TicketIssueLinksUnsupported` before your methods run, and strips links from reads.
|
|
510
|
+
|
|
511
|
+
## Optional priority capability
|
|
512
|
+
|
|
513
|
+
An adapter opts in with `priority: true` and must persist
|
|
514
|
+
`priority?: 'urgent' | 'normal'` on create, update and revision-checked update,
|
|
515
|
+
return `priority: 'urgent'` on every read of an urgent ticket and omit the field
|
|
516
|
+
otherwise, treat `normal` as clearing urgency, and include urgent priority in
|
|
517
|
+
revisions. The dispatcher claims urgent ready tickets before normal ones, each in
|
|
518
|
+
your listing order. Without the flag, every ticket reads as normal: the
|
|
519
|
+
compatibility facade refuses a write naming `urgent` with
|
|
520
|
+
`TicketPriorityUnsupported` before your methods run, drops a `normal` no-op
|
|
521
|
+
(skipping the call when nothing else remains), and strips priority from reads.
|
|
522
|
+
|
|
523
|
+
## Optional ready assignee capability
|
|
524
|
+
|
|
525
|
+
An adapter opts in to `[tickets].readyAssignee` with `readyAssignee: true` and
|
|
526
|
+
must then honour `criteria.assignee` in `listReady` (and `listPage`, if
|
|
527
|
+
implemented): only tickets assigned to that user are ready, and an unassigned
|
|
528
|
+
ticket is never ready while it is set. `"me"` means the owner of the source's
|
|
529
|
+
credential; any other value's forms are the source's to define and enforce.
|
|
530
|
+
Without the flag, dispatcher startup, `ab init --validate` and live reloads
|
|
531
|
+
refuse a configured `readyAssignee` with an error naming the source and plugin.
|
|
532
|
+
|
|
533
|
+
Three optional methods support it:
|
|
534
|
+
|
|
535
|
+
- `prepareReadyAssignee(): Promise<void>` is called once at dispatcher startup,
|
|
536
|
+
before the loop and never in a tick, whether or not `readyAssignee` is set.
|
|
537
|
+
Resolve whatever `"me"` needs and memoize it. A credential with no user is a
|
|
538
|
+
recorded result, not a throw; throw only for infrastructure failures, which
|
|
539
|
+
fail startup when `readyAssignee` is set and are otherwise a warning.
|
|
540
|
+
- `readyAssigneeRefusal(value): string | undefined` is synchronous and makes no
|
|
541
|
+
request. Return why the value can't be honoured from what was prepared, or
|
|
542
|
+
`undefined`. Startup and every reload call it, so a refused reload keeps the
|
|
543
|
+
previous configuration.
|
|
544
|
+
- `describeReadyAssignee(value): Promise<string>` serves `ab init --validate`:
|
|
545
|
+
return a one-line summary of who the value names, such as `me → @octocat`,
|
|
546
|
+
or throw an error that says how to fix a value that names nobody.
|
|
547
|
+
|
|
473
548
|
## Optional ticket paging capability
|
|
474
549
|
|
|
475
550
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
@@ -484,10 +559,12 @@ match the exhaustive listing. The shared `describeTicketSourceContract` suite
|
|
|
484
559
|
automatically compares declared native paging with full-read windows.
|
|
485
560
|
|
|
486
561
|
Only paged operator listings select this capability. Sources without it retain
|
|
487
|
-
the full-read
|
|
562
|
+
the full-read fallback, which orders the listing before offset and limit: by
|
|
563
|
+
default a stable urgent-first partition (urgent, then normal, each in source
|
|
564
|
+
order), or for newest the reversed source order. Native errors propagate. Unpaged operator
|
|
488
565
|
listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
|
|
489
566
|
`listReady`/`listAll`. The hosted PostgreSQL source counts matches without
|
|
490
|
-
bodies and reads only the SQL-bounded window. File, Linear and the remote
|
|
567
|
+
bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
|
|
491
568
|
`HostedTicketSource` retain fallback; the POST list-ready protocol stays exhaustive.
|
|
492
569
|
|
|
493
570
|
Hosted cooldown recording rejects observed reset deadlines beyond the 24-hour
|