@defrex/autobuild 1.11.1 → 1.13.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 +601 -203
- package/bin/ab-build-runner.ts +8 -0
- package/docs/answering-blocked-builds.md +32 -2
- package/docs/architecture.md +188 -57
- package/docs/assets/headline-wide.png +0 -0
- package/docs/cli.md +1 -1
- package/docs/configuration.md +120 -23
- package/docs/dispatcher.md +19 -8
- package/docs/integration-overview.md +1 -1
- package/docs/integration-tree.md +33 -18
- package/docs/merge-policy.md +7 -2
- package/docs/operating.md +5 -3
- package/docs/operator-api.md +48 -25
- package/docs/operator-surfaces.md +39 -3
- package/docs/optimization-nodes.md +10 -8
- package/docs/plugin-authoring.md +46 -18
- package/docs/remote-store-protocol.md +51 -12
- package/docs/remote-ticket-protocol.md +85 -38
- package/docs/restacking.md +48 -3
- package/docs/setup.md +2 -1
- package/docs/ticket-migration.md +2 -2
- package/docs/ticket-sources.md +23 -8
- package/docs/tickets.md +4 -4
- package/docs/troubleshooting.md +17 -2
- package/docs/verification.md +3 -1
- package/package.json +3 -3
- package/packages/core/src/cli/ambient-errors.ts +17 -0
- package/packages/core/src/cli/bounded-io.ts +174 -0
- package/packages/core/src/cli/build-control.ts +72 -6
- package/packages/core/src/cli/dashboard/actions.ts +4 -0
- package/packages/core/src/cli/dashboard/integration-row.ts +43 -19
- package/packages/core/src/cli/dashboard/model.ts +93 -29
- package/packages/core/src/cli/dashboard/poll.ts +231 -34
- package/packages/core/src/cli/dashboard/queue.ts +21 -10
- package/packages/core/src/cli/dashboard/render.ts +14 -37
- package/packages/core/src/cli/dashboard/row-text.ts +26 -8
- package/packages/core/src/cli/dashboard/tone-ansi.ts +39 -0
- package/packages/core/src/cli/dashboard/vocabulary.ts +165 -20
- package/packages/core/src/cli/dispatch-frontend.ts +2 -1
- package/packages/core/src/cli/dispatch-handoff.ts +41 -10
- package/packages/core/src/cli/dispatch-launch-contract.ts +5 -0
- package/packages/core/src/cli/dispatch-launcher-cadence.ts +80 -0
- package/packages/core/src/cli/dispatch-launcher.ts +9 -10
- package/packages/core/src/cli/dispatch-preflight.ts +12 -3
- package/packages/core/src/cli/dispatch-release-observer.ts +53 -0
- package/packages/core/src/cli/dispatch-runtime-cache.ts +204 -82
- package/packages/core/src/cli/dispatch-runtime-dependencies.ts +250 -43
- package/packages/core/src/cli/dispatch-tickets.ts +33 -12
- package/packages/core/src/cli/dispatch-upgrade-install.ts +36 -16
- package/packages/core/src/cli/dispatch-upgrade-source.ts +8 -2
- package/packages/core/src/cli/dispatch-yield-observer.ts +82 -0
- package/packages/core/src/cli/dispatch.ts +595 -149
- package/packages/core/src/cli/env.ts +2 -15
- package/packages/core/src/cli/help.ts +43 -28
- package/packages/core/src/cli/main.ts +11 -7
- package/packages/core/src/cli/production-store.ts +102 -0
- package/packages/core/src/cli/publication-settlement.ts +4 -0
- package/packages/core/src/cli/remote-poll.ts +22 -5
- package/packages/core/src/cli/repo-state.ts +2 -3
- package/packages/core/src/cli/repository-status.ts +44 -28
- package/packages/core/src/cli/sessionless-store.ts +26 -0
- package/packages/core/src/cli/status.ts +188 -47
- package/packages/core/src/cli/store-opening.ts +26 -57
- package/packages/core/src/cli/store-ref.ts +6 -1
- package/packages/core/src/cli/ticket-start.ts +3 -3
- package/packages/core/src/cli/ticket.ts +12 -11
- package/packages/core/src/cli/wait.ts +8 -28
- package/packages/core/src/cli/watch.ts +113 -50
- package/packages/core/src/config/reference-metadata.ts +7 -1
- package/packages/core/src/config/reference.ts +5 -2
- package/packages/core/src/config/schema.ts +51 -16
- package/packages/core/src/distribution-packaging.ts +156 -18
- package/packages/core/src/events/catalog-identity.ts +28 -0
- package/packages/core/src/events/catalog.ts +3 -9
- package/packages/core/src/events/compatibility.ts +2 -30
- package/packages/core/src/events/payloads.ts +85 -14
- package/packages/core/src/events/policy.ts +3 -0
- package/packages/core/src/events/repository.ts +15 -4
- package/packages/core/src/events/sessions.ts +1 -1
- package/packages/core/src/events/validation-error.ts +12 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +36 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/0a10010ee5cf2e47.json +577 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/227701361be6d1e0.json +490 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/3064e337cc75f8d6.json +310 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/76e5043bae7a80ab.json +86 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/87a917802870bbed.json +87 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9d85616e5b9e24c1.json +500 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a1e90a969d32a367.json +307 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c7c94fbe7f63cf07.json +84 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/da3bc91c49211eab.json +310 -0
- package/packages/core/src/kernel/auto-merge-default.ts +2 -1
- package/packages/core/src/kernel/capacity-build.ts +21 -0
- package/packages/core/src/kernel/clean-restack-policy.ts +40 -0
- package/packages/core/src/kernel/discard-in-flight.ts +13 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +578 -235
- package/packages/core/src/kernel/done-escalations.ts +269 -0
- package/packages/core/src/kernel/engine.ts +30 -17
- package/packages/core/src/kernel/integration-landing.ts +24 -4
- package/packages/core/src/kernel/integration-stack.ts +39 -0
- package/packages/core/src/kernel/janitor-failure.ts +20 -1
- package/packages/core/src/kernel/log-index-value.ts +3 -0
- package/packages/core/src/kernel/log-index.ts +41 -2
- package/packages/core/src/kernel/measurement.ts +24 -0
- package/packages/core/src/kernel/open-pr-backpressure.ts +3 -3
- package/packages/core/src/kernel/read-facts.ts +8 -370
- package/packages/core/src/kernel/reducer-registry.ts +43 -125
- package/packages/core/src/kernel/reducer-revisions.ts +18 -0
- package/packages/core/src/kernel/reducer-value-entry.ts +98 -0
- package/packages/core/src/kernel/reducer-value-index.ts +75 -0
- package/packages/core/src/kernel/reducer.ts +84 -16
- package/packages/core/src/kernel/reopen-state.ts +10 -0
- package/packages/core/src/kernel/repository-attention.ts +14 -5
- package/packages/core/src/kernel/repository-read-facts.ts +375 -0
- package/packages/core/src/kernel/ticket-starts.ts +15 -4
- package/packages/core/src/kernel/verify-stage-state.ts +145 -3
- package/packages/core/src/kernel/verify-stages.ts +46 -7
- package/packages/core/src/operator/attention.ts +28 -3
- package/packages/core/src/operator/done-escalations.ts +38 -0
- package/packages/core/src/operator/presentation.ts +14 -1
- package/packages/core/src/operator/protocol.ts +8 -5
- package/packages/core/src/operator/query.ts +72 -57
- package/packages/core/src/operator/registry.ts +19 -15
- package/packages/core/src/operator/ticket-start.ts +8 -7
- package/packages/core/src/operator/tickets.ts +28 -9
- package/packages/core/src/plugin-sdk/index.ts +10 -0
- package/packages/core/src/plugins/manifest.ts +14 -1
- package/packages/core/src/ports/forge/create.ts +8 -0
- package/packages/core/src/ports/forge/github-transport.ts +5 -1
- package/packages/core/src/ports/forge/github.ts +3 -0
- package/packages/core/src/ports/tickets/contract.ts +147 -76
- package/packages/core/src/ports/tickets/create.ts +47 -7
- package/packages/core/src/ports/tickets/fake.ts +8 -4
- package/packages/core/src/ports/tickets/file-codec.ts +4 -3
- package/packages/core/src/ports/tickets/file.ts +7 -3
- package/packages/core/src/ports/tickets/github.ts +1 -0
- package/packages/core/src/ports/tickets/grants.ts +11 -3
- package/packages/core/src/ports/tickets/hosted-index.ts +5 -0
- package/packages/core/src/ports/tickets/linear.ts +28 -9
- package/packages/core/src/ports/tickets/migration.ts +4 -4
- package/packages/core/src/ports/tickets/operations.ts +4 -2
- package/packages/core/src/ports/tickets/priority-labels.ts +213 -0
- package/packages/core/src/ports/tickets/priority.ts +127 -21
- package/packages/core/src/ports/tickets/remote-protocol.ts +10 -0
- package/packages/core/src/ports/tickets/remote.ts +104 -11
- package/packages/core/src/ports/tickets/revision.ts +5 -3
- package/packages/core/src/ports/tickets/search.ts +9 -0
- package/packages/core/src/ports/tickets/tree.ts +8 -6
- package/packages/core/src/ports/types.ts +30 -15
- package/packages/core/src/ports/workspace/build-execution.ts +4 -0
- package/packages/core/src/ports/workspace/builtin-capabilities.ts +4 -0
- package/packages/core/src/ports/workspace/create.ts +16 -3
- package/packages/core/src/ports/workspace/execution-exit-marker.ts +41 -0
- package/packages/core/src/ports/workspace/fake.ts +15 -3
- package/packages/core/src/ports/workspace/recovery-step.ts +101 -0
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +510 -145
- package/packages/core/src/processes/build-execution-state.ts +4 -0
- package/packages/core/src/processes/build-runner.ts +14 -1
- package/packages/core/src/processes/dispatcher.ts +777 -288
- package/packages/core/src/processes/execution-no-progress.ts +1 -0
- package/packages/core/src/processes/execution-settlement.ts +1 -0
- package/packages/core/src/processes/harvest-runner.ts +12 -7
- package/packages/core/src/processes/infrastructure-failure-budget.ts +7 -2
- package/packages/core/src/processes/invocation-budget.ts +176 -0
- package/packages/core/src/processes/publication-loss.ts +38 -3
- package/packages/core/src/processes/workspace-preservation.ts +86 -15
- package/packages/core/src/store/contract.ts +81 -3
- package/packages/core/src/store/event-reads.ts +30 -1
- package/packages/core/src/store/local/capabilities.ts +115 -0
- package/packages/core/src/store/local/store.ts +86 -56
- package/packages/core/src/store/reduced-reads.ts +32 -1
- package/packages/core/src/store/reducer-value-read.ts +235 -0
- package/packages/core/src/store/reducer-value-shapes.json +6722 -6475
- package/packages/core/src/store/reducer-value-validation.ts +181 -33
- package/packages/core/src/store/reducer-values.ts +36 -204
- package/packages/core/src/store/remote/client.ts +169 -29
- package/packages/core/src/store/remote/compatibility.ts +113 -56
- package/packages/core/src/store/remote/credentials.ts +4 -1
- package/packages/core/src/store/remote/protocol.ts +3 -0
- package/packages/core/src/store/remote/released-clients.json +22 -0
- package/packages/core/src/store/remote/released-reducer-values/1.12.0.json +35806 -0
- package/packages/core/src/store/remote/released-reducer-values/1.13.0.json +35966 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +20 -16
- package/packages/core/src/store/remote/released-value-policy.ts +144 -0
- package/packages/core/src/store/remote/retry.ts +406 -0
- package/packages/core/src/store/rollup-lease.ts +41 -0
- package/packages/core/src/store/rollups.ts +7 -38
- package/packages/core/src/store/snapshots.ts +1 -1
- package/packages/core/src/testing/dispatch-read-budget.ts +409 -14
- package/packages/core/src/testing/import-graph.ts +78 -0
- package/packages/core/src/testing/index.ts +2 -0
- package/packages/core/src/testing/invocation-budget.ts +42 -0
- package/packages/core/src/testing/reduced-read-budget.ts +602 -40
- package/packages/core/src/testing/released-value-coverage.ts +423 -0
- package/packages/core/src/testing/slot-agreement.ts +52 -0
- package/packages/core/src/web/assets/app.js +5 -5
- package/packages/core/src/web/overview-source.ts +19 -6
- package/skills/guide/SKILL.md +245 -103
- package/skills/guide/references/integration-tree.md +33 -18
- package/skills/guide/references/merge-policy.md +7 -2
- package/skills/guide/references/operator-api.md +48 -25
- package/skills/guide/references/optimization-nodes.md +10 -8
- package/skills/guide/references/plugin-authoring.md +46 -18
- package/skills/guide/references/remote-store-protocol.md +51 -12
- package/skills/guide/references/remote-ticket-protocol.md +85 -38
- package/skills/guide/references/restacking.md +48 -3
- package/skills/guide/references/setup.md +2 -1
- package/skills/guide/references/ticket-migration.md +2 -2
- package/skills/operate/SKILL.md +114 -65
- package/skills/plan/SKILL.md +4 -3
- package/skills/spec/SKILL.md +9 -5
- package/skills/tickets/SKILL.md +25 -17
- package/templates/hosted-service/package.json +2 -2
|
@@ -13,7 +13,9 @@ See [restacking](restacking.md) for change identity and replay.
|
|
|
13
13
|
Presence is checked only at claim, never to interrupt existing work. The newest
|
|
14
14
|
build generation supplies evidence; ambiguous or unavailable evidence leaves the
|
|
15
15
|
dependent queued. Confirmed merge SHA reachability can prove presence without
|
|
16
|
-
a trailer, and a merged node transports its whole owned contribution.
|
|
16
|
+
a trailer, and a merged node transports its whole owned contribution. A child
|
|
17
|
+
whose commit became empty and was dropped by a forge rebase merge still counts as
|
|
18
|
+
landed through that contribution. Empty
|
|
17
19
|
completed nodes contribute nothing. Sibling work waits for merge into the common
|
|
18
20
|
ancestor and demand the minimal restack path; same-node merges satisfy presence directly.
|
|
19
21
|
|
|
@@ -98,22 +100,35 @@ execution lease or dispatch capacity. A PR opens or is adopted when the node
|
|
|
98
100
|
has commits its current parent lacks; parent-only advancement remains empty.
|
|
99
101
|
|
|
100
102
|
|
|
101
|
-
A node
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
103
|
+
A node takes a slot only by admission for runner work: `reconcile` for a
|
|
104
|
+
restack conflict, `verification` for an integration cycle or a measurement, and
|
|
105
|
+
`propose` for an optimization node's open proposal request. The request is
|
|
106
|
+
durable and is admitted before ticket claims at its level, higher levels first. Until
|
|
107
|
+
the node holds its slot, intake reserves one slot for it ahead of claims at its
|
|
108
|
+
own level and below, and the dispatcher checks its admission every tick
|
|
109
|
+
regardless of idle node polling. A slot freed in any tick goes to the node, not
|
|
110
|
+
to a new claim at its level or below; higher-level demand can take it first.
|
|
111
|
+
Admission counts every build that holds a slot, as every admission does.
|
|
112
|
+
|
|
113
|
+
- **Recorded before provisioning.** Admission is a durable `slot.admitted`
|
|
114
|
+
fact naming the work it admitted.
|
|
115
|
+
- **Held through the work.** The node keeps the slot through provisioning,
|
|
116
|
+
launch and relaunch after a crashed runner or expired lease, and across a
|
|
117
|
+
dispatcher restart, until that work is done: the cycle verified or failed,
|
|
118
|
+
the measurement recorded, the proposal deposited or the restack settled.
|
|
119
|
+
- **Released on an outside wait.** A paused node, or one blocked on a question
|
|
120
|
+
(a restack conflict's escalation included), holds none. Once answered or
|
|
121
|
+
resumed, it requests its slot again.
|
|
122
|
+
- **Never held by idling.** An idle collecting node, a node waiting for a
|
|
123
|
+
repair child and a node's retained workspace hold none. Paused descendants,
|
|
124
|
+
and blocked ones with nothing still working on them, hold none either, so they never stand between a node and the
|
|
125
|
+
slot it needs to unblock them.
|
|
126
|
+
|
|
127
|
+
Status and both dashboards report occupancy against configured capacity, and
|
|
128
|
+
each node waiting for a slot ahead of ticket claims at its level, marking
|
|
129
|
+
urgent, high and low ones.
|
|
130
|
+
Status also reports every build's slot state (`slot`, `capacity.slots`):
|
|
131
|
+
an admitted node reports `held`; a node awaiting admission reports its request.
|
|
117
132
|
|
|
118
133
|
Claims freeze the destination build generation and branch. Missing, unopened,
|
|
119
134
|
merged, closed or aborted targets leave work queued with diagnostics. The newest
|
|
@@ -251,7 +266,7 @@ An optimization node follows `branch opening → starting measurement →
|
|
|
251
266
|
(propose → collecting)*`, then completes, verifies and merges like any node.
|
|
252
267
|
Once the starting value is measured, the dispatcher requests a `propose`
|
|
253
268
|
session whenever the node has room within its concurrency and attempts budget.
|
|
254
|
-
The request takes a slot ahead of
|
|
269
|
+
The request takes a slot ahead of ticket claims at the node's level, like node reconcile and
|
|
255
270
|
verification. The session runs the `ab-propose` skill on the node head, reads
|
|
256
271
|
the attempt ledger and deposits proposals with `ab propose`; it never creates
|
|
257
272
|
tickets. The dispatcher files each proposal as a work ticket targeting the
|
|
@@ -188,7 +188,10 @@ Node-to-GitHub-root merge uses PR rebase merge guarded on verified head after
|
|
|
188
188
|
a final parent freshness read. Enforced up-to-date protection provides a fenced
|
|
189
189
|
merge; uncertainty is recorded as unfenced and requires immutable merged-tree
|
|
190
190
|
audit. A mismatch raises operator attention without rewriting the shared parent.
|
|
191
|
-
|
|
191
|
+
A verified empty child commit that the rebase merge dropped is accounted for when
|
|
192
|
+
the merged tree matches; a missing non-empty commit or a duplicate identity still
|
|
193
|
+
raises attention. Answer it with `ab answer`, which acknowledges it without
|
|
194
|
+
reopening the build. Pending audits survive completion and retry until settled.
|
|
192
195
|
|
|
193
196
|
Root leaves land by one of three routes. Behind a real merge-blocking gate,
|
|
194
197
|
Autobuild arms GitHub-native auto-merge. An authoritatively ungated root
|
|
@@ -259,7 +262,9 @@ displaced history under immutable exact archive refs
|
|
|
259
262
|
them. Where it refuses, they keep a BuildStore copy (`history-objects-<sha>`),
|
|
260
263
|
or record one `history-unretained` warning and proceed.
|
|
261
264
|
- **Workspace preservation** keeps unpublished workspace commits under archive
|
|
262
|
-
refs, else as BuildStore copies. When neither holds them, release is refused
|
|
265
|
+
refs, else as BuildStore copies. When neither holds them, release is refused,
|
|
266
|
+
except under abort cleanup, which records `workspace.commits-lost` and
|
|
267
|
+
releases.
|
|
263
268
|
- There is never a branch or tag fallback. When an environment refuses non-branch
|
|
264
269
|
Git pushes, as Claude Code on the web's GitHub proxy does, the GitHub adapter
|
|
265
270
|
creates the same archive ref through REST ref creation and confirms it by exact
|
|
@@ -16,8 +16,10 @@ other credentials. Unknown, expired or revoked credentials receive `401 auth`;
|
|
|
16
16
|
removed projects receive `403 auth` with `project not registered`.
|
|
17
17
|
|
|
18
18
|
The hosted cron dispatcher issues a dispatcher-purpose credential per repository
|
|
19
|
-
tick, then
|
|
20
|
-
|
|
19
|
+
tick, then attempts to delete that exact row on completion or failure, within a
|
|
20
|
+
bounded cleanup window of at least 5 seconds. Issuance or deletion that does not
|
|
21
|
+
settle in that window is reported as a tick failure, and the row relies on its
|
|
22
|
+
expiry, capped at the invocation deadline plus 60 seconds and the configured
|
|
21
23
|
`AB_DISPATCHER_TOKEN_TTL_SECONDS` upper bound. Each served tick removes at most
|
|
22
24
|
100 expired or revoked dispatcher rows through indexed probes. Legacy unexpired
|
|
23
25
|
rows keep their recorded expiry and are pruned afterward. Owner lifetimes are
|
|
@@ -82,13 +84,13 @@ raw session-event append. External operator harnesses own agent execution.
|
|
|
82
84
|
|
|
83
85
|
| Method and path | Result |
|
|
84
86
|
|---|---|
|
|
85
|
-
| `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. |
|
|
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
|
|
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, plus `ticketStarts` (`{pending, recent}`, each entry with its `priority`) when single-ticket start requests are pending or recently settled. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
|
|
87
|
+
| `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. Each nonterminal summary's `slot` is `{state: "held"}`, `{state: "requested", request, priority?: "urgent" \| "high" \| "low"}` or `{state: "none"}`; absent means unknown (an older server), never `none`. Its `statusWord` is `{word, tone, note?}`, the status word every surface shows; `status` stays the reducer's lifecycle status. |
|
|
88
|
+
| `GET …/builds/{slug}` | `{detail, dashboardRow}`; `detail.slot` and `dashboardRow.slot` carry the build's slot state, shaped as in `GET …/builds`; `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: at `build.completed` when no escalation is open. A completed build with an open escalation keeps, or regains, a `BLOCKED` row (note `done`), including after abort cleanup, and the row becomes `null` once the escalation is acknowledged; neither step reopens its lifecycle state. |
|
|
89
|
+
| `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.capacity.slots` maps each build to its slot state, and each `model.builds[].slot` repeats it; absent means unknown. `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. |
|
|
90
|
+
| `GET …/status` | Repository intake, pause, and default-auto-merge projection, plus `ticketStarts` (`{pending, recent}`, each entry with its `priority`) when single-ticket start requests are pending or recently settled. `capacity.slots`, when the held configuration is readable, maps each nonterminal build to its slot state; `capacity.occupied` counts its `held` entries. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
|
|
89
91
|
| `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
|
|
90
92
|
| `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 default:
|
|
93
|
+
| `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: priority order, urgent, high, normal, then low tickets, each in the source order) or `newest` (newest filed first, regardless of priority; see paging below); `total` counts every match before paging. |
|
|
92
94
|
| `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
|
|
93
95
|
| `GET …/tickets/{id}` | `{ticket,blockers,build,assets}`. Blockers include native `exists`/`resolved` status; `build` prefers an active matching repository build, otherwise the most recently updated one. `assets` lists the current ticket assets as `{kind,name,revision,size,layout,fileCount}`, as `ab ticket show --json` does. |
|
|
94
96
|
|
|
@@ -124,7 +126,7 @@ JSON bodies are strict: unknown fields are rejected.
|
|
|
124
126
|
|
|
125
127
|
| Method and path | Body |
|
|
126
128
|
|---|---|
|
|
127
|
-
| `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"\|"priority"}`; `priority` requires `"priority":"urgent"\|"normal"` and records `build.priority-set`, the build's slot-admission
|
|
129
|
+
| `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"\|"priority"}`; `priority` requires `"priority":"urgent"\|"high"\|"normal"\|"low"` and records `build.priority-set`, the build's slot-admission level, as `ab priority` does. Free slots go to `manual` start requests, then, for each level from urgent to low, that level's waiting work, then its start requests and ordinary claims. `land` alone accepts an optional `"head":"<sha>"` (full or at least seven characters) that binds consent to that candidate head. Abort alone also accepts `"to":"triage"\|"ready"` (default triage) and a `"reason"` of 1–2000 characters after trimming, as `ab abort --to/--reason` does. `hold` also accepts an optional `"reason"` of 1–2000 characters after trimming, as `ab hold --reason` does; a blank reason is refused with `invalid-argument` and nothing is recorded. `"reason"` with any other action is a validation error. Ready requires the current ticket to meet the spec standard; otherwise cleanup returns it to triage and the hand-back comment and `ticket.handed-back` event carry the `requested` role and `missing` parts. Repeating an identical pending abort is idempotent; a repeat with a different destination or reason is refused. Aborting an [optimization attempt](optimization-nodes.md#landing-and-settlement) ignores `to`: it settles `aborted`, the node moves the ticket to rejected, and no hand-back is reported. |
|
|
128
130
|
| `POST …/builds/{slug}/restack` | Empty body; durable node restack demand. |
|
|
129
131
|
| `POST …/builds/{slug}/answer` | One answer variant described below. |
|
|
130
132
|
| `PUT …/settings/intake` | `{"enabled":boolean}` |
|
|
@@ -132,10 +134,10 @@ JSON bodies are strict: unknown fields are rejected.
|
|
|
132
134
|
| `POST …/bulk-control` | `{"action":"pause"\|"resume"}`. The hold fact, intake fact, then eligible build events are written in that order. |
|
|
133
135
|
| `POST …/harvest/control` | `{"action":"toggle-gate"}` or `{"action":"run","run":"…"}`. A run action is bound to that concrete projected run. |
|
|
134
136
|
| `POST …/tickets/states` | `{name,about?}` → `{state,created}`; requires attributed operator identity (`tickets.state.create` in MCP). Hosted duplicate names are refused case-insensitively. |
|
|
135
|
-
| `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"normal","assignees"?:["login"|"me"],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, omitted priority is normal, and omitted assignees apply `[tickets].createAssignee` (`[]` creates an unassigned ticket), and `labels` are unioned with `[tickets].createLabels`. `assignees` takes at most ten entries, counted before duplicates collapse, and more is a validation error. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`;
|
|
136
|
-
| `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent` or `
|
|
137
|
+
| `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"high"|"normal"|"low","assignees"?:["login"|"me"],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, omitted priority is normal, and omitted assignees apply `[tickets].createAssignee` (`[]` creates an unassigned ticket), and `labels` are unioned with `[tickets].createLabels`. `assignees` takes at most ten entries, counted before duplicates collapse, and more is a validation error. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`; any other `priority` value is a validation error naming the four levels; a hosted service that cannot store the level refuses it with `code: "priority-unsupported"` (sources without native priority store it as a `priority:<level>` label instead); one that cannot store assignees refuses any `assignees` with `code: "assignees-unsupported"`. |
|
|
138
|
+
| `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent`, `high`, `normal` or `low`; omitted never changes it; refusals as for create), complete-replacement `assignees` (`[]` clears; refusals as for create), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
|
|
137
139
|
| `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. |
|
|
138
|
-
| `POST …/tickets/{id}/start` | Empty body, or `{"priority":"manual"\|"urgent"\|"normal"}` (default `manual`; anything else is `400 validation`). Records a durable request that the running dispatcher start this ticket on its next tick with a free slot in the priority's admission tier, even while intake is off (`tickets.start` in MCP). The id resolves through the configured source; an unknown ticket is `404 not-found`. Returns `{status:"pending",existing,updated,request,priority,requestedAt,ticket}`; `existing` is true when a request for the ticket was already pending, and `updated` is true when that request's priority was changed to this one. Nothing is written when `updated` is false for an existing request. The outcome arrives later as `ticket.start-settled`. |
|
|
140
|
+
| `POST …/tickets/{id}/start` | Empty body, or `{"priority":"manual"\|"urgent"\|"high"\|"normal"\|"low"}` (default `manual`; anything else is `400 validation`). Records a durable request that the running dispatcher start this ticket on its next tick with a free slot in the priority's admission tier, even while intake is off (`tickets.start` in MCP). The id resolves through the configured source; an unknown ticket is `404 not-found`. Returns `{status:"pending",existing,updated,request,priority,requestedAt,ticket}`; `existing` is true when a request for the ticket was already pending, and `updated` is true when that request's priority was changed to this one. Nothing is written when `updated` is false for an existing request. The outcome arrives later as `ticket.start-settled`. |
|
|
139
141
|
| `POST …/tickets/{id}/start/cancel` | Empty body. Cancels the pending start request: `{cancelled:true,request,ticket}`, or `{cancelled:false,id}` when none is pending (`tickets.start` with `cancel: true` in MCP). |
|
|
140
142
|
| `POST …/tickets/{id}/block` | `{"blockerIds":["…"]}`. |
|
|
141
143
|
| `POST …/tickets/{id}/unblock` | `{"blockerIds":["…"]}`. |
|
|
@@ -156,6 +158,10 @@ The retry object is deliberately bare: adding `text` is a `400 validation`
|
|
|
156
158
|
rather than silently changing the resolution to guidance. A revision object may
|
|
157
159
|
also carry `ceiling` only to receive the shared `incompatible-answer-options`
|
|
158
160
|
refusal; a ceiling and spec revision cannot be performed together.
|
|
161
|
+
On a `done` build only `guidance` and `retry` are accepted: they acknowledge its
|
|
162
|
+
open escalations, such as a post-landing integration audit, and return
|
|
163
|
+
`acknowledged: true` while the build stays done. Other variants get
|
|
164
|
+
`409 refusal` with code `inactive`, as does a done build with nothing open.
|
|
159
165
|
The protocol does not supply ticket-provider credentials. For ticket-origin
|
|
160
166
|
revision, a trusted caller fetches the current ticket body and supplies it; the
|
|
161
167
|
build must still have a recorded ticket. Revision conformance, lazy retry,
|
|
@@ -368,7 +374,7 @@ The default watch reports actionable conditions only:
|
|
|
368
374
|
- `dispatcher.forge-degraded`: the dispatcher's own rate-limit cooldown opened, with its reset; once per episode. Extensions marked `continued` are silent.
|
|
369
375
|
- `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
|
|
370
376
|
|
|
371
|
-
- Build `escalation.raised`, `integration.landed`,
|
|
377
|
+
- Build `escalation.raised`, `integration.landed`,
|
|
372
378
|
`target.rewritten` (a node's, once per rejected base; a leaf recovers or escalates),
|
|
373
379
|
`landing.consent-revoked` (protected merge consent revoked by a reconcile's
|
|
374
380
|
edits, naming the matched files and both heads),
|
|
@@ -376,20 +382,27 @@ The default watch reports actionable conditions only:
|
|
|
376
382
|
per head and failing set; build summaries, details and merge-queue entries
|
|
377
383
|
carry it as `ciFailure` until a CI read finds no failing checks on that
|
|
378
384
|
head, pending ones included, or the PR moves to another head),
|
|
379
|
-
`optimization.noise-exceeded` (an optimization node's ε is below its
|
|
380
|
-
measured noise, naming both)
|
|
381
|
-
`restack.replayed` events. `build.consent-ready` is the single
|
|
385
|
+
or `optimization.noise-exceeded` (an optimization node's ε is below its
|
|
386
|
+
measured noise, naming both). `build.consent-ready` is the single
|
|
382
387
|
signal for a ready consent or held merge, including first repository-wide
|
|
383
388
|
discovery. Its target has the queue entry shape `{kind, branch, ticket?, build?}`.
|
|
384
389
|
Unready and stale candidates stay silent. `build.merge-decision` remains for
|
|
385
390
|
current actionable merge-gate deferrals, landings awaiting a human merge, and
|
|
386
391
|
unsafe forge outcomes, once per build/PR; it does not duplicate consent or
|
|
387
392
|
hold attention.
|
|
393
|
+
- Conflicted `restack.replayed` and `node.item-conflicted` are routine
|
|
394
|
+
(reconcile or generated-file regeneration resolves them). They stay out of
|
|
395
|
+
the default, matching `repository.attention`. Follow them with `--event`.
|
|
396
|
+
An unresolvable conflict arrives as `escalation.raised` (reconcile
|
|
397
|
+
escalation, exhausted `maxReconcileAttempts`, no progress) or
|
|
398
|
+
`landing.consent-revoked`.
|
|
388
399
|
- Repository `harvest.escalated`, `harvest.recovery-exhausted`,
|
|
389
400
|
`dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
|
|
390
401
|
`restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
|
|
391
402
|
`dispatcher.kernel-git-unavailable`, `forge.credential-limited`, abnormal
|
|
392
|
-
`dispatcher.run-stopped`, and `dispatcher.lost`. A
|
|
403
|
+
`dispatcher.run-stopped`, and `dispatcher.lost`. A one-tick run whose tick
|
|
404
|
+
failed and was reported stops normally, with exit code 1 and the error, so a
|
|
405
|
+
single blip is not attention. A `forge.credential-limited`
|
|
393
406
|
line names the process whose GitHub request was rate-limited outside the
|
|
394
407
|
dispatcher's credential (unauthenticated, with why, or on that process's own
|
|
395
408
|
credential) and its reset; dispatcher forge work continues.
|
|
@@ -427,9 +440,12 @@ The default watch reports actionable conditions only:
|
|
|
427
440
|
with the episode still open; crossing reset alone is silent. Without a reset,
|
|
428
441
|
the deadline is 15 minutes after onset. Repeated evidence never postpones
|
|
429
442
|
the deadline; recovery ends the episode.
|
|
430
|
-
- `dispatcher.tick-failure-persistent`: continuously failing
|
|
431
|
-
|
|
432
|
-
ends the episode
|
|
443
|
+
- `dispatcher.tick-failure-persistent`: continuously failing ticks for five
|
|
444
|
+
minutes, across consecutive runs, including one-tick hosted runs. Any
|
|
445
|
+
completed tick ends the episode, as does a clean, abnormal or forced stop of
|
|
446
|
+
the run that last failed. A new run does not, nor does a one-tick run's normal
|
|
447
|
+
stop after its failed tick. The observation keeps the first failure's time and
|
|
448
|
+
names the latest failing run and error. Source grace and cooldown-driven failures do not start
|
|
433
449
|
this clock; after grace, the first qualifying failure starts a new five-minute
|
|
434
450
|
interval. Each persistence episode is reported once. Unavailable failure writes delay durable visibility:
|
|
435
451
|
watch keeps running, warns locally and reports one bounded unreported window
|
|
@@ -461,14 +477,19 @@ silently baselines historical direct events and merge decisions, but retains
|
|
|
461
477
|
active repository timers. A no-slug watch follows each build announced in the
|
|
462
478
|
journal after its position from the build's first event; cursors carry
|
|
463
479
|
creations still in preparation, and a cursor from an earlier release, which
|
|
464
|
-
carries none, baselines a build whose creation was selected before it.
|
|
480
|
+
carries none, baselines a build whose creation was selected before it. A watch retires a terminal, settled build (no pending cleanup, reclaim, open
|
|
481
|
+
execution or integration audit) once its events through settlement are
|
|
482
|
+
delivered: it leaves tracking and every later cursor, so a re-armed cursor
|
|
483
|
+
stays proportional to active builds. Named builds are never retired. Following
|
|
484
|
+
a build reads only events after its position, with no per-poll reduced read. Reconcile existing conditions through status after
|
|
465
485
|
arming the watch. Named watches still end when every named build is terminal;
|
|
466
486
|
learn their outcomes from status reconciliation at exit.
|
|
467
487
|
|
|
468
488
|
`ab wait --for attention` is build-only and uses the same build conditions:
|
|
469
489
|
current failed node verification, an open escalation other than a ticket wait's
|
|
470
490
|
own, janitor failure attention, a current forge CI failure,
|
|
471
|
-
consent readiness, merge
|
|
491
|
+
consent readiness, merge attention or a merge decision; `--for
|
|
492
|
+
restack-conflicted` opts into restack conflicts. Current failed
|
|
472
493
|
verification satisfies attention even before its notification is written. Existing conditions return immediately,
|
|
473
494
|
even with `--since`; live and backlog matches ignore routine outcomes and
|
|
474
495
|
self-healing failures. A merge match uses the watch observation with
|
|
@@ -504,7 +525,7 @@ waiting on the operator:
|
|
|
504
525
|
|
|
505
526
|
| Section | Contents |
|
|
506
527
|
|---|---|
|
|
507
|
-
| `escalations` | Open builds with open escalations, as `builds.get` reports them; wait-only builds are excluded |
|
|
528
|
+
| `escalations` | Open builds with open escalations, as `builds.get` reports them; wait-only builds are excluded. Also each `done` build with an open escalation (status `done`), which `builds.answer` acknowledges while the build stays done |
|
|
508
529
|
| `merges` | The `merges.list` entries, each with its build's PR |
|
|
509
530
|
| `events` | The `repository.events` attention page after `cursor`: `{items, cursor, hasMore}` |
|
|
510
531
|
| `waiting` | Builds `paused`, `stalled`, failing node verification (`verification-failed`) or failing forge CI (`ci-failing`), each with a `detail` |
|
|
@@ -516,8 +537,10 @@ fixes; the named tool reads the evidence to report. Cursor rules match
|
|
|
516
537
|
`repository.events`: an omitted cursor returns no events and a baseline cursor
|
|
517
538
|
beside every current-state section, and an expired cursor fails with
|
|
518
539
|
`code: "cursor-too-old"`. The call never waits. Its cost is bounded: one open-build
|
|
519
|
-
listing pass, the `repository.status` reads
|
|
520
|
-
|
|
540
|
+
listing pass, the `repository.status` reads, one `doneEscalations` rollup read
|
|
541
|
+
plus a record and saved-facts read per done build with an open escalation, and
|
|
542
|
+
at most 256 journal positions. It grows with open escalations, never with
|
|
543
|
+
history, and reads zero event rows when nothing changed.
|
|
521
544
|
|
|
522
545
|
|
|
523
546
|
Hosted ticket tools resolve independent project ticket policy, including its
|
|
@@ -839,7 +862,7 @@ permission or retention failures leave deletion pending. Vercel Blob cleanup use
|
|
|
839
862
|
the same store identity, token and prefixed pathname as uploads. Missing objects
|
|
840
863
|
are successful cleanup; provider errors never count as completed deletion.
|
|
841
864
|
|
|
842
|
-
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
|
|
865
|
+
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 priority order (urgent, high, normal, then low tickets, each in source order); for `newest`, the reversed listing. `newest` means newest filed first, regardless of priority, with a stable tie-break; it is not the reverse of priority order. A source that lists in filing order (file, GitHub, Linear) gets exactly that from the reversed listing. The remote `HostedTicketSource` pages natively through the service's `list-page` operation, and uses the fallback only against a service predating it. 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.
|
|
843
866
|
|
|
844
867
|
|
|
845
868
|
### Forge cooldown admission and explicit recovery
|
|
@@ -295,8 +295,9 @@ spread. A command node uses the objective's pairing and sample count (see
|
|
|
295
295
|
[judge panel](#judge-panels) of its harness pin against itself: its starting
|
|
296
296
|
value is 0.5, and its spread is the distance of that self-comparison win rate
|
|
297
297
|
from 0.5. The dispatcher admits that run as it admits a node verification: the
|
|
298
|
-
node
|
|
299
|
-
the
|
|
298
|
+
node holds a runner slot from admission until the starting value is recorded,
|
|
299
|
+
through any relaunch of its runner. The workspace for the run is provisioned
|
|
300
|
+
after admission and released separately; it never holds the slot.
|
|
300
301
|
|
|
301
302
|
**Noise check.** When ε, in metric units, is smaller than the measured spread,
|
|
302
303
|
the gate would accept noise. A panel's ε is a win-rate margin, compared with
|
|
@@ -741,7 +742,7 @@ because a request is open. A node that is paused, blocked, has a pending command
|
|
|
741
742
|
conflicted node restack, a landing intent or a merged or closed PR, or is
|
|
742
743
|
deferred for runtime compatibility gets `optimization.proposal-deferred` with
|
|
743
744
|
that reason instead, and is reconsidered once a fact that can clear it lands.
|
|
744
|
-
The request takes a slot ahead of
|
|
745
|
+
The request takes a slot ahead of ticket claims at the node's level, like node reconcile and
|
|
745
746
|
verification. Before the session starts, the dispatcher re-checks the request:
|
|
746
747
|
when the node stopped, the active-hours budget is spent, or room fell below the
|
|
747
748
|
recorded room, it records `optimization.proposal-withdrawn`, which clears the
|
|
@@ -831,11 +832,12 @@ build as an ordinary child.
|
|
|
831
832
|
An attempt keeps the ordinary work grammar: plan, plan review, implement, code
|
|
832
833
|
review, verify and finalize.
|
|
833
834
|
|
|
834
|
-
An attempt claims at its node's
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
835
|
+
An attempt claims at its node's level, any of `urgent`, `high`, `normal` or
|
|
836
|
+
`low`, whether or not the ticket source stores priority. `ab priority <node>
|
|
837
|
+
high` puts the node's attempts claimed afterwards in the high tier; an attempt
|
|
838
|
+
already claimed keeps its build's level. Nothing is reserved: an attempt waits
|
|
839
|
+
for a free slot like any ready ticket, preempts nothing, and follows the
|
|
840
|
+
source's order within its tier.
|
|
839
841
|
|
|
840
842
|
### Attempt context
|
|
841
843
|
|
|
@@ -157,7 +157,9 @@ archive transport refuses a head's archive ref, call it with your trusted Git
|
|
|
157
157
|
transport. It keeps the head as a BuildStore copy and resolves to the copy's
|
|
158
158
|
exclusion base; record the head with that `storeBase` in place of `remoteRef`.
|
|
159
159
|
It throws when the head cannot be kept; rethrow so release is refused. A
|
|
160
|
-
provider that ignores it preserves strictly.
|
|
160
|
+
provider that ignores it preserves strictly. Abort cleanup is the exception:
|
|
161
|
+
when preservation fails, the dispatcher records the commits as lost
|
|
162
|
+
(`workspace.commits-lost`) and releases anyway. A `restoration` head may name
|
|
161
163
|
`storeBase` instead of `remoteRef`. Then `provision` receives
|
|
162
164
|
`restoreStored({ exec, workspacePath, sha })`: when the commit is absent, call
|
|
163
165
|
it with your trusted transport, and fail provisioning when it resolves false.
|
|
@@ -248,6 +250,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
|
|
|
248
250
|
- **1.9** Optional native ticket-source paging (`listPage`); older sources retain operator slicing.
|
|
249
251
|
- **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`.
|
|
250
252
|
- **1.11** Optional ticket-source search (`search`); callers refuse sources without it and never fall back to a listing.
|
|
253
|
+
- **1.12** Host-provided factory-context `fetch` and `invocationSignal` for bounded-invocation cancellation.
|
|
251
254
|
|
|
252
255
|
## 2. Create a repository-local module
|
|
253
256
|
|
|
@@ -293,6 +296,12 @@ Every module default-exports one strict `AutobuildPluginManifest`:
|
|
|
293
296
|
|
|
294
297
|
Every adapter and contract factory receives `{ config, env, repoRoot }`: read-only `config`, the process `env`, and `repoRoot`, the absolute consuming-repository root.
|
|
295
298
|
|
|
299
|
+
Ticket-source, forge and workspace-provider factories also receive `fetch` and `invocationSignal` from a host that provides API 1.12. A bounded dispatcher invocation (the hosted cron) cancels requests at its deadline through them:
|
|
300
|
+
|
|
301
|
+
- **`fetch`** Use it for provider HTTP. Every request is cancelled at the current invocation phase's deadline, together with any `init.signal` you pass; outside a bounded invocation it is plain `fetch`.
|
|
302
|
+
- **`invocationSignal()`** Call it at request time, not at construction, for other transports (SQL clients, subprocesses, SDKs with their own HTTP). It returns `undefined` outside a bounded invocation.
|
|
303
|
+
- An adapter that ignores both still works, but at the deadline its requests are abandoned rather than cancelled.
|
|
304
|
+
|
|
296
305
|
| Port | `config` |
|
|
297
306
|
|---|---|
|
|
298
307
|
| ticket-source | the existing strict `[tickets]` fields; no untyped plugin-options table |
|
|
@@ -301,7 +310,7 @@ Every adapter and contract factory receives `{ config, env, repoRoot }`: read-on
|
|
|
301
310
|
|
|
302
311
|
Workspace-provider factories also receive optional host-derived seams (API 1.7), absent when the call site has none; ignoring them changes nothing.
|
|
303
312
|
|
|
304
|
-
- **`storeRef`, `delegateCredential`** Store URL and credential-exchange callback; guaranteed when the registration declares `capabilities.storeRequirements`.
|
|
313
|
+
- **`storeRef`, `delegateCredential`** Store URL and credential-exchange callback; guaranteed when the registration declares `capabilities.storeRequirements`. In a bounded invocation the exchange goes through the host `fetch`, so it is cancelled at the deadline too.
|
|
305
314
|
- **`runtimeReferences`** The host's effective runtime routes.
|
|
306
315
|
- **`origin`, `remoteBranchHead`** Checkout-less readers; when absent, fall back to host `git` from `repoRoot`.
|
|
307
316
|
|
|
@@ -551,15 +560,33 @@ compatibility facade refuses any write naming links with
|
|
|
551
560
|
|
|
552
561
|
## Optional priority capability
|
|
553
562
|
|
|
554
|
-
|
|
555
|
-
`
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
+
Ticket priority has four levels, highest first: `urgent`, `high`, `normal`
|
|
564
|
+
(the default) and `low`. Declare `priority: true` only if you store all four
|
|
565
|
+
natively. Then you must:
|
|
566
|
+
|
|
567
|
+
- persist `priority?: TicketPriority` on create, update and revision-checked
|
|
568
|
+
update; an update that omits it never changes it
|
|
569
|
+
- return the level on every read, omitting the field for normal
|
|
570
|
+
- include any level other than normal in revisions
|
|
571
|
+
|
|
572
|
+
Without the flag, the compatibility facade stores priority as labels for you:
|
|
573
|
+
`priority:urgent`, `priority:high` or `priority:low`, none for normal. It reads
|
|
574
|
+
them case-insensitively (the highest wins when several are present), reports
|
|
575
|
+
them as `priority` and never in `labels`, keeps them across labels
|
|
576
|
+
replacements, never touches any other label, and refuses label writes,
|
|
577
|
+
criteria and `readyLabels` or `createLabels` entries that name one. If your
|
|
578
|
+
source records the `node` kind as a label rather than natively, declare
|
|
579
|
+
`kindLabel` with that label's name: a kind change written beside a priority
|
|
580
|
+
then adds or removes it. A raw source used outside the facade
|
|
581
|
+
without the flag refuses any level but `normal` with
|
|
582
|
+
`TicketPriorityUnsupported`.
|
|
583
|
+
|
|
584
|
+
The dispatcher claims ready tickets by level, urgent first and low last, each
|
|
585
|
+
level in your listing order and ahead of lower-level builds waiting for a
|
|
586
|
+
slot. The SDK exports `TICKET_PRIORITIES`, `ticketPriority` (absent reads as
|
|
587
|
+
normal), `dispatchPriority` (the level a ticket is claimed at), `byPriority`
|
|
588
|
+
(a stable four-level sort), and, for the label fallback, `priorityLabelSource`,
|
|
589
|
+
`PRIORITY_LABEL_PREFIX` and `priorityLabel`.
|
|
563
590
|
|
|
564
591
|
## Optional ready assignee capability
|
|
565
592
|
|
|
@@ -627,18 +654,17 @@ Native paging is an optional API 1.9 ticket-source capability:
|
|
|
627
654
|
The SDK exports these types; the result is `TicketListing & { total: number }`.
|
|
628
655
|
Criteria retain state, labels (AND), and assignee semantics. The page has a
|
|
629
656
|
nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
|
|
630
|
-
and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
reverse of dispatch order. Offset and limit apply after ordering. Total counts all matches, even
|
|
657
|
+
and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is
|
|
658
|
+
priority order: urgent, high, normal, then low tickets, each in listing order.
|
|
659
|
+
Newest is newest filed first: creation time descending, regardless of
|
|
660
|
+
priority, with a stable tie-break. It is not the reverse of priority order. Offset and limit apply after ordering. Total counts all matches, even
|
|
635
661
|
with limit zero or an offset past the end. Records, diagnostics and errors
|
|
636
662
|
match the exhaustive listing. The shared `describeTicketSourceContract` suite
|
|
637
663
|
automatically compares declared native paging with full-read windows.
|
|
638
664
|
|
|
639
665
|
Only paged operator listings select this capability. Sources without it retain
|
|
640
666
|
the full-read fallback, which orders the listing before offset and limit: by
|
|
641
|
-
default a stable
|
|
667
|
+
default a stable priority sort (urgent, high, normal, then low, each in source
|
|
642
668
|
order), or for newest the reversed listing, which is newest filed first for
|
|
643
669
|
sources that list in filing order (file, GitHub, Linear). Native errors
|
|
644
670
|
propagate. Unpaged operator listings, CLI ticket lists and dispatcher ready
|
|
@@ -658,7 +684,7 @@ errors.
|
|
|
658
684
|
| Type | Fields |
|
|
659
685
|
| --- | --- |
|
|
660
686
|
| `TicketSearchQuery` | `text`, optional `state`, optional `labels`, `limit`, optional `cursor` |
|
|
661
|
-
| `TicketSearchHit` | `id`, `title`, optional `state`, `labels`, `kind`, optional `target` |
|
|
687
|
+
| `TicketSearchHit` | `id`, `title`, optional `state`, `labels`, `kind`, optional `target`, optional `priority` (`TicketPriority`) |
|
|
662
688
|
| `TicketSearchPage` | `tickets: TicketSearchHit[]`, optional `cursor`, `diagnostics` |
|
|
663
689
|
|
|
664
690
|
- **Matching.** A ticket matches when every whitespace-separated term of
|
|
@@ -672,6 +698,8 @@ errors.
|
|
|
672
698
|
is source-defined and stable across pages. Reject a malformed or foreign
|
|
673
699
|
cursor with the SDK's `TicketSearchCursorInvalid(sourceName, cursor)`;
|
|
674
700
|
callers map it to the `search-cursor-invalid` refusal.
|
|
701
|
+
- **Priority.** Set `priority` on a hit whose ticket is `urgent`, `high` or
|
|
702
|
+
`low`, taken from the search read itself; `normal` may be omitted.
|
|
675
703
|
- **Cost.** Build each hit from the search read itself, never from a follow-up
|
|
676
704
|
read per result. A failure rejects; it never falls back to `listAll`.
|
|
677
705
|
|
|
@@ -362,7 +362,7 @@ Section 7 defines the placeholder and transaction semantics.
|
|
|
362
362
|
// every non-success response
|
|
363
363
|
{
|
|
364
364
|
"error": "human-readable message",
|
|
365
|
-
"kind": "validation" // validation | not-found | auth | conflict | internal
|
|
365
|
+
"kind": "validation" // validation | not-found | auth | conflict | internal | unavailable
|
|
366
366
|
}
|
|
367
367
|
```
|
|
368
368
|
|
|
@@ -504,14 +504,24 @@ a compatibility gate. A client accepts any value its own finished shape can
|
|
|
504
504
|
represent and drops object properties that shape does not know. An invalid envelope
|
|
505
505
|
or a value the client cannot represent, such as a missing field or an unknown
|
|
506
506
|
variant, raises `ReducerValueIncompatibilityError`, naming the reducer,
|
|
507
|
-
client/server versions and
|
|
507
|
+
client/server versions, validation detail and upgrade advice. The error is terminal:
|
|
508
|
+
`ab watch` and `ab wait` exit instead of retrying it. Clients send
|
|
508
509
|
`x-autobuild-reducer-value-projection: 1`. The service retains frozen finished-value
|
|
509
510
|
contracts for every supported published client, including projection-capable clients.
|
|
510
511
|
It projects answers onto those contracts and stamps the released reducer version.
|
|
511
|
-
An
|
|
512
|
-
state
|
|
513
|
-
|
|
514
|
-
|
|
512
|
+
An optional `lastEvent` the release cannot represent is omitted, including in nested
|
|
513
|
+
build state, when its type is unknown to the release or when it is a well-formed event
|
|
514
|
+
whose payload carries values the release predates; a malformed display event leaves
|
|
515
|
+
the answer unchanged. Cursor, progress, and compatibility facts remain canonical. The
|
|
516
|
+
required `seenTypes` set retains the event types known to that released reader.
|
|
517
|
+
Widened literals are rewritten to a declared older equivalent (a `provisioning` or
|
|
518
|
+
`failed` sandbox reaches older readers as `stopped`), or omitted when optional, per the
|
|
519
|
+
service's released-value policy, only where released readers then behave the same.
|
|
520
|
+
A value that drives released decisions, such as an escalation's policy cause, is not
|
|
521
|
+
rewritten or omitted: like other unrepresentable required values, it retains typed
|
|
522
|
+
incompatibility behavior. Every divergence from a
|
|
523
|
+
supported contract must be declared there, and populated values covering every
|
|
524
|
+
variant are tested against every supported contract. The request’s
|
|
515
525
|
`x-autobuild-catalog-identity` may identify the generated finished-value catalog.
|
|
516
526
|
A recorded published catalog identity selects its frozen contract, even when the
|
|
517
527
|
client advertises projection. An unrecognized catalog identity plus projection
|
|
@@ -534,7 +544,7 @@ client version window are unchanged.
|
|
|
534
544
|
|
|
535
545
|
| Scope | Reducers with no arguments |
|
|
536
546
|
| --- | --- |
|
|
537
|
-
| Build | `executionNoProgress`, `summaryRequests`, `build`, `buildDigest`, `currentPrAttachments`, `pendingPrAttachmentReclaims`, `openExecution`, `lastExecutionOutcome`, `infrastructureFailureReset`, `openWorkspace`, `setupStreak`, `openBuildWorkspace`, `currentDeferralObservation`, `dashboardFacts`, `buildTimeline`, `buildRosterEntry`, `pinnedAssets`, `buildDelegation` |
|
|
547
|
+
| Build | `executionNoProgress`, `summaryRequests`, `build`, `buildDigest`, `currentPrAttachments`, `pendingPrAttachmentReclaims`, `openExecution`, `lastExecutionOutcome`, `infrastructureFailureReset`, `openWorkspace`, `setupStreak`, `openBuildWorkspace`, `currentDeferralObservation`, `dashboardFacts`, `buildTimeline`, `buildRosterEntry`, `doneEscalationEntry`, `pinnedAssets`, `buildDelegation` |
|
|
538
548
|
| Repository | `dispatchPlacement`, `ticketPreparation`, `harvest`, `dispatchSettings`, `sandboxStates`, `openHarvestExecutions`, `hostedHarvestAuthority`, `autoMergeDefault`, `effectiveConfig`, `harvestDelegation` |
|
|
539
549
|
|
|
540
550
|
| Reducer | Scope | Required arguments |
|
|
@@ -612,6 +622,7 @@ repository's builds. The body is a named-value request of at most
|
|
|
612
622
|
| --- | --- | --- | --- |
|
|
613
623
|
| `stepDurations` | `outcome`: `merged` (default) or `all`; `kind`: `leaf` (default), `node` or `all` | `window`: `24h`, `7d` (default), `30d` or `all` | `{"position": string, "window": string, "steps": [{"step", "count", "meanMs", "p50Ms", "p90Ms", "p99Ms", "totalMs"}]}`, steps in pipeline order with waits last |
|
|
614
624
|
| `buildRoster` | none | none | `{"position": string, "live": [{"slug", "kind", "createdAt"?}], "finished": [{"slug", "kind", "outcome", "completedAt"}]}`: every live build, oldest first; up to 10 of the newest finished builds, newest first, with `outcome` `merged`, `closed` or `aborted` |
|
|
625
|
+
| `doneEscalations` | none | none | `{"position": string, "builds": [{"slug", "kind"}]}`: every `done` build with an open escalation, by slug |
|
|
615
626
|
|
|
616
627
|
### Reducer snapshots
|
|
617
628
|
|
|
@@ -1328,10 +1339,12 @@ project; phase CLI scoped handles still constrain build and session access.
|
|
|
1328
1339
|
Authenticated raw writes cannot claim a delegated `via`. Owner-project
|
|
1329
1340
|
credentials also use their recorded creator for operator writes. Dispatcher
|
|
1330
1341
|
credentials have an immutable server-side purpose: raw store and tickets only,
|
|
1331
|
-
never operator controls. Each hosted cron repository tick
|
|
1332
|
-
dispatcher-purpose credential row on success or failure
|
|
1333
|
-
|
|
1334
|
-
|
|
1342
|
+
never operator controls. Each hosted cron repository tick attempts to delete its
|
|
1343
|
+
exact issued dispatcher-purpose credential row on success or failure, within a
|
|
1344
|
+
bounded cleanup window of at least 5 seconds. Issuance or deletion that does not
|
|
1345
|
+
settle in that window is reported as a tick failure and left to expiry. That
|
|
1346
|
+
expiry is the earlier of the configured token TTL and the invocation deadline
|
|
1347
|
+
plus 60 seconds. Spawned builds receive independent delegated grants whose authority
|
|
1335
1348
|
continues according to their durable lifecycle after the parent row is deleted
|
|
1336
1349
|
or expires. Shared content-addressed blobs remain deduplicated; this is resource
|
|
1337
1350
|
authorization, not blob partitioning.
|
|
@@ -1507,6 +1520,7 @@ Conforming servers map failures as follows:
|
|
|
1507
1520
|
| `422` | `validation` | `EventValidationError` from build, repository, or session catalog validation, or a ticket-asset validation failure (including the 25 MiB limit); its message is preserved verbatim |
|
|
1508
1521
|
| `501` | `unsupported-operation` | Optional latest artifact metadata capability is unavailable on the backing adapter |
|
|
1509
1522
|
| `500` | `internal` | Any other unexpected backing or server failure; the thrown error message is returned |
|
|
1523
|
+
| `503` | `unavailable` | The backing database is saturated (connection slots or pool acquisition) or the service is shutting down; retry after `Retry-After` seconds |
|
|
1510
1524
|
|
|
1511
1525
|
Clients classify a write response with HTTP 413 as `StoreWriteTooLargeError`,
|
|
1512
1526
|
including platform responses with no valid protocol JSON body. Diagnostics
|
|
@@ -1517,6 +1531,10 @@ ceiling. Ticket-asset validation and stream-batch ceiling errors retain their
|
|
|
1517
1531
|
specialized types and messages. Reads and other statuses keep their existing
|
|
1518
1532
|
error handling. Kernel phase operations treat the general error as permanent.
|
|
1519
1533
|
|
|
1534
|
+
Clients treat `429`, `502`, `503`, `504` and a `500` with `kind: "internal"` (or
|
|
1535
|
+
no protocol body) as transient, and `checkpoint-integrity` as permanent; see
|
|
1536
|
+
section 11 for which requests they retry.
|
|
1537
|
+
|
|
1520
1538
|
Authentication runs before resource lookup, and session authorization runs
|
|
1521
1539
|
before event catalog validation. A request may therefore receive `401` or
|
|
1522
1540
|
`403` even if its resource or event body is also invalid.
|
|
@@ -1602,7 +1620,28 @@ For streams, the backing store must additionally maintain:
|
|
|
1602
1620
|
|
|
1603
1621
|
## 11. Client-only behavior and health
|
|
1604
1622
|
|
|
1605
|
-
|
|
1623
|
+
Five shipped behaviors do not add `BuildStore` routes:
|
|
1624
|
+
|
|
1625
|
+
- **Transient retries.** The client retries a request that failed transiently
|
|
1626
|
+
(section 9) or at the transport, at most three attempts with jittered backoff
|
|
1627
|
+
of 250–500 ms then 500–1000 ms, honoring a `Retry-After` of up to 5 s.
|
|
1628
|
+
- **Idempotent requests retry any transient failure:** every `GET`, `PUT` and
|
|
1629
|
+
`DELETE`; `POST …/reducer-values` and `…/rollup-values`; the `conditional`
|
|
1630
|
+
appends; lease and node-writer claim, heartbeat and release; `POST /repos`,
|
|
1631
|
+
scan cadence and operator presence; and `POST /builds` with a creation key
|
|
1632
|
+
when `/health` advertises `build-creation-key-v1`. A retried keyed create
|
|
1633
|
+
answered `409 conflict` means an earlier attempt landed and lost its
|
|
1634
|
+
response, so the client returns the build at the key's derived slug,
|
|
1635
|
+
read within the same retry bound.
|
|
1636
|
+
- **Every other `POST`** retries only a `429` or a transport failure that
|
|
1637
|
+
preceded delivery (connection refused, unresolvable host, connect timeout).
|
|
1638
|
+
- **One bound.** The first retryable failure fixes a bound of 10 s, or the
|
|
1639
|
+
invocation deadline when sooner. Retry sleeps, retry requests and reading
|
|
1640
|
+
any response body after that failure end at the bound. First attempts are
|
|
1641
|
+
unbounded; a successful first request is exactly one request.
|
|
1642
|
+
- **Exhaustion** surfaces as `RemoteUnavailableError` with the server's
|
|
1643
|
+
message. A caller's abort, authentication and reducer incompatibility are
|
|
1644
|
+
never retried.
|
|
1606
1645
|
|
|
1607
1646
|
- `RemoteBuildStore.scopeBuild(slug)` and `RemoteBuildStore.scopeSession(id)`
|
|
1608
1647
|
return interface-enforced client handles for exactly that build or session.
|