@defrex/autobuild 1.12.0 → 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 +435 -160
- package/bin/ab-build-runner.ts +8 -0
- package/docs/answering-blocked-builds.md +25 -3
- package/docs/architecture.md +124 -53
- package/docs/cli.md +1 -1
- package/docs/configuration.md +110 -15
- package/docs/dispatcher.md +19 -8
- package/docs/integration-overview.md +1 -1
- package/docs/integration-tree.md +12 -9
- package/docs/merge-policy.md +7 -2
- package/docs/operating.md +5 -3
- package/docs/operator-api.md +46 -23
- package/docs/operator-surfaces.md +7 -6
- package/docs/optimization-nodes.md +7 -6
- 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/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 +14 -8
- package/packages/core/src/cli/dashboard/poll.ts +218 -10
- package/packages/core/src/cli/dashboard/queue.ts +21 -10
- package/packages/core/src/cli/dashboard/row-text.ts +2 -1
- package/packages/core/src/cli/dashboard/vocabulary.ts +5 -1
- package/packages/core/src/cli/dispatch-frontend.ts +2 -1
- package/packages/core/src/cli/dispatch-tickets.ts +33 -12
- package/packages/core/src/cli/dispatch.ts +527 -144
- package/packages/core/src/cli/help.ts +38 -24
- package/packages/core/src/cli/main.ts +7 -5
- 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/repository-status.ts +19 -9
- package/packages/core/src/cli/status.ts +23 -11
- package/packages/core/src/cli/store-opening.ts +12 -0
- 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/events/payloads.ts +74 -14
- package/packages/core/src/events/repository.ts +14 -3
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +27 -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/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/c7c94fbe7f63cf07.json +84 -0
- package/packages/core/src/kernel/clean-restack-policy.ts +40 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +243 -107
- package/packages/core/src/kernel/done-escalations.ts +269 -0
- package/packages/core/src/kernel/engine.ts +28 -9
- 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/open-pr-backpressure.ts +3 -3
- package/packages/core/src/kernel/reducer-registry.ts +3 -0
- package/packages/core/src/kernel/reducer-revisions.ts +15 -0
- package/packages/core/src/kernel/reducer.ts +27 -7
- package/packages/core/src/kernel/repository-attention.ts +14 -5
- package/packages/core/src/kernel/ticket-starts.ts +15 -4
- 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 +1 -1
- package/packages/core/src/operator/protocol.ts +8 -5
- package/packages/core/src/operator/query.ts +33 -19
- package/packages/core/src/operator/registry.ts +17 -13
- 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/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 +544 -212
- 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/reduced-reads.ts +23 -0
- package/packages/core/src/store/reducer-value-shapes.json +6628 -6469
- package/packages/core/src/store/reducer-value-validation.ts +181 -33
- 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 +11 -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 +18 -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/testing/dispatch-read-budget.ts +144 -10
- 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 +381 -18
- package/packages/core/src/testing/released-value-coverage.ts +423 -0
- package/packages/core/src/web/overview-source.ts +19 -6
- package/skills/guide/SKILL.md +138 -67
- package/skills/guide/references/integration-tree.md +12 -9
- package/skills/guide/references/merge-policy.md +7 -2
- package/skills/guide/references/operator-api.md +46 -23
- package/skills/guide/references/optimization-nodes.md +7 -6
- 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 +82 -51
- 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
|
@@ -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.
|
|
@@ -184,7 +184,7 @@ The operation names and `input` values are:
|
|
|
184
184
|
| `list-ready` | `{labels?: string[], state?: string}` | `TicketListing` |
|
|
185
185
|
| `list-targeting` | `{nodeId: string}` | `TicketListing` of every state |
|
|
186
186
|
| `list-page` | `{criteria: {labels?, state?}, page: {limit, offset?, order?}}` | `TicketPageListing` (`{tickets, diagnostics, total}`) |
|
|
187
|
-
| `search` | `{text, state?, labels?, limit, cursor?}` | `{tickets: {id, title, state?, labels, kind, target?}[], cursor?, diagnostics}` |
|
|
187
|
+
| `search` | `{text, state?, labels?, limit, cursor?}` | `{tickets: {id, title, state?, labels, kind, target?, priority?}[], cursor?, diagnostics}` |
|
|
188
188
|
| `get` | `{id}` | `Ticket \| null` |
|
|
189
189
|
| `claim` | `{id}` | `{claimed: boolean}` |
|
|
190
190
|
| `comment` | `{id, body}` | `{ok: true}` |
|
|
@@ -225,11 +225,35 @@ remain unchanged. These rules apply only to hosted tickets, not file or Linear i
|
|
|
225
225
|
## Errors and conformance
|
|
226
226
|
|
|
227
227
|
Errors are JSON `{ "error": string, "kind": "validation" | "not-found" |
|
|
228
|
-
"auth" | "conflict" | "internal" }`. Authentication runs before
|
|
229
|
-
or backend construction. Responses never include exception causes,
|
|
230
|
-
environment values, or credentials. Client 401/403 responses become
|
|
228
|
+
"auth" | "conflict" | "internal" | "unavailable" }`. Authentication runs before
|
|
229
|
+
body parsing or backend construction. Responses never include exception causes,
|
|
230
|
+
stacks, environment values, or credentials. Client 401/403 responses become
|
|
231
231
|
`AuthError`; other backend messages remain actionable.
|
|
232
232
|
|
|
233
|
+
A hosted service answers `503` with kind `unavailable` and a `Retry-After`
|
|
234
|
+
header in seconds when its database is saturated (no free connection slots, or
|
|
235
|
+
a pool acquisition timed out) or when the service is shutting down. The
|
|
236
|
+
response carries no backend detail.
|
|
237
|
+
|
|
238
|
+
The client retries transient failures exactly as the store client does: a
|
|
239
|
+
`429`, `502`, `503`, `504`, a `500` with `kind: "internal"` or no protocol body,
|
|
240
|
+
or a transport failure, at most three attempts within one 10 s bound.
|
|
241
|
+
|
|
242
|
+
- **Retried on any transient failure:** `policy`, `list-ready`,
|
|
243
|
+
`list-targeting`, `list-page`, `search`, `states`, `state-counts`, `get`,
|
|
244
|
+
`dependency-states`, `transition`, `update`, `add-blocker`, `remove-blocker`,
|
|
245
|
+
`mutate-if-revision`, and `create` with an idempotency key. Each is a read or
|
|
246
|
+
a set-or-replace write; a repeated revision check fails as a typed conflict.
|
|
247
|
+
- **Never retried after a response:** `claim`, `comment`, `add-state` and an
|
|
248
|
+
unkeyed `create`. They retry only a `429` or a transport failure that
|
|
249
|
+
preceded delivery.
|
|
250
|
+
- **Exhaustion** surfaces as `RemoteUnavailableError` with the service's
|
|
251
|
+
message; `AuthError` and the typed protocol errors keep precedence.
|
|
252
|
+
|
|
253
|
+
A dispatcher publishes `policy` and settles `list-targeting` at its first tick
|
|
254
|
+
boundary rather than while it starts, so a transient failure there fails only
|
|
255
|
+
that tick.
|
|
256
|
+
|
|
233
257
|
The shared `TicketSource` contract is normative for protocol implementations.
|
|
234
258
|
Project partitions must be isolated. The direct Linear client retains its
|
|
235
259
|
separate opt-in GraphQL contract; this protocol does not proxy Linear.
|
|
@@ -307,7 +331,7 @@ snapshot of fields, blockers and revision.
|
|
|
307
331
|
`POST /tickets/mutate-if-revision` accepts the usual authenticated context and
|
|
308
332
|
`input: { id, expectedRevision, mutation }`. Mutation is one of
|
|
309
333
|
`{ kind: "update", patch: { title?, body?, labels?, kind?, target?,
|
|
310
|
-
priority?: "urgent" | "normal" } }`,
|
|
334
|
+
priority?: "urgent" | "high" | "normal" | "low" } }`,
|
|
311
335
|
`{ kind: "transition", state }`, or
|
|
312
336
|
`{ kind: "blockers", operation: "block" | "unblock", ids: string[] }`.
|
|
313
337
|
Unknown keys and empty patches are refused. Success returns `{ ok: true }`.
|
|
@@ -387,8 +411,12 @@ response without the header, or a `404` or `400` refusal of `list-targeting`
|
|
|
387
411
|
without it, means the service predates the operation. Against such a service
|
|
388
412
|
the client never declares it, and integration observation uses the exhaustive
|
|
389
413
|
listing by that explicit decision. An inconclusive probe (a network failure or
|
|
390
|
-
an unmarked gateway error) fails
|
|
391
|
-
|
|
414
|
+
an unmarked gateway error) fails preparation. An ordinary consumer prepares
|
|
415
|
+
while constructing the source, so construction fails. A dispatcher prepares at
|
|
416
|
+
its first tick boundary: exhausted transient unavailability fails that tick and
|
|
417
|
+
preparation runs again at the next one, while any other failure stops the run.
|
|
418
|
+
A targeted read the service later refuses fails closed, with no fallback within
|
|
419
|
+
the pass.
|
|
392
420
|
|
|
393
421
|
## Issue links
|
|
394
422
|
|
|
@@ -425,40 +453,57 @@ not establish continuity for in-flight builds; see the migration procedure.
|
|
|
425
453
|
|
|
426
454
|
## Priority
|
|
427
455
|
|
|
428
|
-
Hosted tickets store `priority`,
|
|
429
|
-
update and guarded update accept it as an optional field. A create that
|
|
430
|
-
files a normal ticket, and an update that omits it never changes it.
|
|
431
|
-
existed before the field read as normal. A priority change
|
|
432
|
-
revision, and rewriting the same value is a no-op.
|
|
433
|
-
|
|
434
|
-
Ticket responses
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
`
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
`
|
|
449
|
-
|
|
456
|
+
Hosted tickets store `priority`: `"urgent"`, `"high"`, `"normal"` or `"low"`.
|
|
457
|
+
Create, update and guarded update accept it as an optional field. A create that
|
|
458
|
+
omits it files a normal ticket, and an update that omits it never changes it.
|
|
459
|
+
Tickets that existed before the field read as normal. A priority change
|
|
460
|
+
increments the revision, and rewriting the same value is a no-op.
|
|
461
|
+
|
|
462
|
+
Ticket responses project priority by the capability headers the client sends,
|
|
463
|
+
independently of the other capabilities and of the client version:
|
|
464
|
+
|
|
465
|
+
| Client sends | Response `priority` |
|
|
466
|
+
|---|---|
|
|
467
|
+
| `x-autobuild-ticket-priority-levels: 1` | the stored level, on every ticket, `normal` included |
|
|
468
|
+
| only `x-autobuild-ticket-priority: 1` | `urgent` stays `urgent`; `high`, `low` and `normal` read as `normal` |
|
|
469
|
+
| neither | absent, for historical strict decoders, whose writes never name it and so never clear it |
|
|
470
|
+
|
|
471
|
+
Search hits carry an optional `priority`, projected the same way and stripped
|
|
472
|
+
for clients without the levels header. Every `/tickets/*` response, including
|
|
473
|
+
errors, carries both `x-autobuild-ticket-priority: 1` and
|
|
474
|
+
`x-autobuild-ticket-priority-levels: 1`.
|
|
475
|
+
|
|
476
|
+
`list-ready` returns urgent tickets first, then high, then normal, then low,
|
|
477
|
+
each level in filing order, for every client. Ordering happens within the
|
|
478
|
+
existing listing; it adds no per-ticket reads. `list-ready` stays exhaustive;
|
|
479
|
+
paged reads use `list-page`.
|
|
480
|
+
|
|
481
|
+
Refusals, all before anything is written:
|
|
482
|
+
|
|
483
|
+
- A service whose backing source cannot store the level answers
|
|
484
|
+
`409 { "kind": "conflict", "code": "priority-unsupported" }`.
|
|
485
|
+
- A service predating priority refuses the unknown field with a `400`
|
|
486
|
+
validation error and no capability header.
|
|
487
|
+
- A service that stores only `urgent` and `normal` refuses `high` or `low`
|
|
488
|
+
with a `400` validation error and no `x-autobuild-ticket-priority-levels`
|
|
489
|
+
header. The client sends the request; the older service rejects it before
|
|
490
|
+
persisting anything.
|
|
491
|
+
|
|
492
|
+
Clients report each as `TicketPriorityUnsupported` naming the `hosted` source.
|
|
493
|
+
Current clients omit `normal` on create, so a plain create still works against
|
|
494
|
+
an older service.
|
|
450
495
|
|
|
451
496
|
## Paged listing
|
|
452
497
|
|
|
453
498
|
`list-page` answers one window of the tickets matching `criteria`, from the
|
|
454
499
|
backing source's native paging. `limit` and `offset` are nonnegative integers;
|
|
455
|
-
`offset` defaults to 0. `order` is `oldest` (the default), which is
|
|
456
|
-
order: urgent
|
|
457
|
-
first, regardless of
|
|
500
|
+
`offset` defaults to 0. `order` is `oldest` (the default), which is priority
|
|
501
|
+
order: urgent, then high, then normal, then low, each in filing order. `newest`
|
|
502
|
+
is newest filed first, regardless of priority. Offset and limit apply after ordering, so
|
|
458
503
|
consecutive windows traverse the listing with no omissions or duplicates.
|
|
459
504
|
`total` counts every match before slicing, also for a zero limit or an offset
|
|
460
505
|
past the end. The service returns the page in the order the source answered;
|
|
461
|
-
it does not re-sort it
|
|
506
|
+
it does not re-sort it by priority. Cost follows the window, not the project's
|
|
462
507
|
ticket count.
|
|
463
508
|
|
|
464
509
|
A backing source without native paging answers `409` with
|
|
@@ -469,8 +514,9 @@ ticket grants and harvest delegations receive `403`.
|
|
|
469
514
|
Every `/tickets/*` response, including errors, carries
|
|
470
515
|
`x-autobuild-ticket-paging: 1`. A current client declares `listPage` only after
|
|
471
516
|
a response from the service has carried that header. It settles the decision on
|
|
472
|
-
the response that already finishes
|
|
473
|
-
targeted-listing probe), with no extra probe
|
|
517
|
+
the response that already finishes preparation (the policy sync or the
|
|
518
|
+
targeted-listing probe), with no extra probe, whether preparation runs during
|
|
519
|
+
ordinary source construction or at a dispatcher's first tick. An ok response without the header
|
|
474
520
|
means the service predates the operation. Against such a service the client
|
|
475
521
|
never declares `listPage`, and paged operator listings read `list-ready` and
|
|
476
522
|
slice it, as for any source without native paging. A `list-page` request that the
|
|
@@ -498,8 +544,9 @@ for duplicate checks before filing:
|
|
|
498
544
|
stable across pages: the PostgreSQL backend answers newest ticket number
|
|
499
545
|
first. `cursor` is opaque; pass the previous page's `cursor` with the same
|
|
500
546
|
text and filters. It is absent on the last page.
|
|
501
|
-
- **Hits.** `id`, `title`, `state`, `labels`, `kind` and `
|
|
502
|
-
search read itself
|
|
547
|
+
- **Hits.** `id`, `title`, `state`, `labels`, `kind`, `target` and `priority`
|
|
548
|
+
come from the search read itself; `priority` follows the
|
|
549
|
+
[priority projection](#priority). Bodies are never returned, and there is no read per hit.
|
|
503
550
|
- **Refusals.** A backing source without search answers `409` with
|
|
504
551
|
`code: "search-unsupported"`. A malformed or foreign cursor answers `400` with
|
|
505
552
|
`code: "search-cursor-invalid"` and the `cursor`. Clients report them as
|
|
@@ -513,7 +560,7 @@ for duplicate checks before filing:
|
|
|
513
560
|
Every `/tickets/*` response, including errors, carries
|
|
514
561
|
`x-autobuild-ticket-search: 1`. A current client declares `search` only after a
|
|
515
562
|
response from the service has carried that header, settled on the response that
|
|
516
|
-
already finishes
|
|
563
|
+
already finishes preparation, with no extra probe. Against a service
|
|
517
564
|
predating the operation (an ok response without the header) the client never
|
|
518
565
|
declares `search`, so callers refuse with `TicketSearchUnsupported` before any
|
|
519
566
|
request and nothing is listed. A `search` request that the service later refuses
|
package/docs/restacking.md
CHANGED
|
@@ -89,7 +89,9 @@ waiting leaves restack when the target moves. Node-target finalize contributions
|
|
|
89
89
|
are canonicalized before guarded merge even when the target SHA is unchanged.
|
|
90
90
|
Clean replay starts no agent. A clean awaiting-merge leaf rewrite preserves completed
|
|
91
91
|
verification when build-owned config is unchanged, even when replay replaces
|
|
92
|
-
the pin commit's ancestry
|
|
92
|
+
the pin commit's ancestry, unless a
|
|
93
|
+
[clean-restack policy](#clean-restack-re-verification) opts steps in for a
|
|
94
|
+
root-targeting leaf. Reports retain their actual cycle base/head.
|
|
93
95
|
Changed config still starts a fresh verification cycle while waiting. Before
|
|
94
96
|
running further verification steps, cycles also require known pin ancestry;
|
|
95
97
|
a future cycle captures fresh config from its checkout. Configuration
|
|
@@ -195,7 +197,9 @@ displaced heads and the temporary change, best effort, per commit:
|
|
|
195
197
|
before the guarded update landed abandons the reservation, and the next node
|
|
196
198
|
transaction reserves again from the published branches.
|
|
197
199
|
- Workspace preservation is strict: archive ref, else a `history-objects-<sha>`
|
|
198
|
-
store copy over the preservation base, else release is refused.
|
|
200
|
+
store copy over the preservation base, else release is refused. Abort cleanup
|
|
201
|
+
is the one exception: when preservation fails it records
|
|
202
|
+
`workspace.commits-lost` and releases. Store-kept
|
|
199
203
|
heads go on decisive `workspace.commits-retained`, and replacement
|
|
200
204
|
provisioning restores them on any host.
|
|
201
205
|
|
|
@@ -230,6 +234,45 @@ interpretation and supply a promoted contribution base for later replay.
|
|
|
230
234
|
|
|
231
235
|
Replay retention (`replay-objects-<sha>`) and leaf history retention (`history-objects-<sha>`) store thin Git packs in bounded binary chunks, with a fixed-size completion manifest written only after every chunk is acknowledged. Digest-keyed chunks make interrupted writes retryable; incomplete uploads are never restored. Recovery validates all chunk sizes and the pack digest before installation, and requires the base objects (restoring node prefixes in order). Existing single-artifact base64 packs remain readable. Retained replay and history artifacts are read only when the requested commit is missing locally, never by idle polling.
|
|
232
236
|
|
|
237
|
+
## Clean-restack re-verification
|
|
238
|
+
|
|
239
|
+
A cleanly restacked waiting leaf lands without re-running verification by
|
|
240
|
+
default. To catch semantic drift a clean replay cannot see, such as a new lint
|
|
241
|
+
rule, a tightened type or a changed shared export on the target, opt steps in:
|
|
242
|
+
|
|
243
|
+
```toml
|
|
244
|
+
[verify.lint]
|
|
245
|
+
kind = "check"
|
|
246
|
+
command = "lint"
|
|
247
|
+
afterCleanRestack = true
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
| Setting | Default | Effect |
|
|
251
|
+
|---|---|---|
|
|
252
|
+
| `[verify].afterCleanRestack` | `false` (omitted) | Repository default for every step. |
|
|
253
|
+
| `[verify.<step>].afterCleanRestack` | inherited | Overrides the default in either direction. |
|
|
254
|
+
|
|
255
|
+
- **Scope.** Only a root-targeting leaf's clean awaiting-merge restack,
|
|
256
|
+
including a resolved `[[generated]]` regeneration. A leaf targeting an
|
|
257
|
+
integration node relies on the node's own verification before root.
|
|
258
|
+
- **Frozen policy.** When at least one step is enabled, the runner records the
|
|
259
|
+
resolved ordered policy as `cleanRestackPolicy` on
|
|
260
|
+
`restack.publish-intended`, `restack.rewritten` and `restack.completed`.
|
|
261
|
+
Recovery after a crash keeps it, even if configuration changed.
|
|
262
|
+
- **Fresh cycle.** That completion starts a verify cycle at a new attempt on
|
|
263
|
+
the restacked base and head. Opted-in steps run under the usual plan and
|
|
264
|
+
`paths` rules; the others record `skipped` with
|
|
265
|
+
`skipCause = "clean-restack-policy"`. No further restack runs.
|
|
266
|
+
- **Landing.** The leaf does not land until the cycle is satisfied. A failure
|
|
267
|
+
routes to implement, code review and ordinary verification, and counts
|
|
268
|
+
toward `maxVerifyAttempts`. On success, landing consent survives as for any
|
|
269
|
+
clean restack.
|
|
270
|
+
- **Cost.** Every target move under a waiting leaf re-runs the opted-in steps.
|
|
271
|
+
Prefer cheap deterministic checks; an agent step re-runs only when opted in.
|
|
272
|
+
|
|
273
|
+
Omitted or all-false settings record nothing, so existing builds behave
|
|
274
|
+
exactly as before.
|
|
275
|
+
|
|
233
276
|
## Node contributions and recovery
|
|
234
277
|
|
|
235
278
|
Node replay enumerates oldest-first first-parent contributions above the last
|
|
@@ -271,7 +314,9 @@ committed unchanged.
|
|
|
271
314
|
- **Leaf restack.** `restack.regenerated` records the files, the commands and
|
|
272
315
|
the outcome. A `resolved` replay's head is retained before the fact is
|
|
273
316
|
written, and then publishes like a clean restack, so verification follows the
|
|
274
|
-
clean-restack rules
|
|
317
|
+
clean-restack rules, including any
|
|
318
|
+
[clean-restack policy](#clean-restack-re-verification) while waiting to merge;
|
|
319
|
+
the configured verify steps still check the result.
|
|
275
320
|
The regeneration counts as conflict resolution for merge consent: consent
|
|
276
321
|
given under a `paths` or `within` rule is revoked, with
|
|
277
322
|
`landing.consent-revoked`, when the regenerated files match it, even though
|
package/docs/setup.md
CHANGED
|
@@ -504,7 +504,8 @@ Archive refs are a recommendation (WARN or UNKNOWN, never FAIL):
|
|
|
504
504
|
build and proceed.
|
|
505
505
|
- **Workspace preservation** keeps unpublished workspace commits as BuildStore
|
|
506
506
|
copies where refused, and refuses to release the workspace only when the store
|
|
507
|
-
copy fails too.
|
|
507
|
+
copy fails too. Abort cleanup is the exception: it records
|
|
508
|
+
`workspace.commits-lost` and releases.
|
|
508
509
|
|
|
509
510
|
Require **linear history** on protected root and node target branches to prevent
|
|
510
511
|
merge commits from GitHub's update-branch action. On the configured root, enable
|
package/docs/ticket-migration.md
CHANGED
|
@@ -93,7 +93,7 @@ timestamps remain in the export; imported comments use the target's metadata.
|
|
|
93
93
|
|
|
94
94
|
Portable records use TOML frontmatter between `+++` fences and an unchanged
|
|
95
95
|
Markdown body. Alongside `id`, `title`, `labels`, `blockedBy` and `idempotencyKey`,
|
|
96
|
-
optional `issueLinks` contain `issue` and `intent` (`closes` or `refs`), optional `priority` is `"urgent"` (absent means normal), optional `comments` contain `body`, `createdAt` and optional `author`. Optional
|
|
96
|
+
optional `issueLinks` contain `issue` and `intent` (`closes` or `refs`), optional `priority` is `"urgent"`, `"high"` or `"low"` (absent means normal), optional `comments` contain `body`, `createdAt` and optional `author`. Optional
|
|
97
97
|
`attachments` contain `kind`, `name`, `layout` (`file` or `tree`) and `entries`:
|
|
98
98
|
`{ type = "dir", path = "empty" }` or
|
|
99
99
|
`{ type = "file", path = "image.png", base64 = "…" }`. Common asset limits and
|
|
@@ -109,7 +109,7 @@ no continuous sync, assignee migration, state history or build-history migration
|
|
|
109
109
|
|
|
110
110
|
Integration-tree `kind` and `target` are preserved in portable frontmatter.
|
|
111
111
|
Import validates the complete target graph before changing the destination and
|
|
112
|
-
refuses a destination that cannot preserve metadata. Issue links and
|
|
112
|
+
refuses a destination that cannot preserve metadata. Issue links and
|
|
113
113
|
priority are preserved the same way, and a destination that cannot store them is refused before any write. It creates or adopts every
|
|
114
114
|
identity, establishes node kinds, then applies targets using the durable id map,
|
|
115
115
|
just like blockers. Input order does not matter. Resuming also restores edges on
|
package/docs/ticket-sources.md
CHANGED
|
@@ -92,7 +92,7 @@ Replace `ENG` and the case-sensitive workflow names with your team's.
|
|
|
92
92
|
- **Admission.** `teamKey` selects the team; `readyState`, every `readyLabels` entry and optional `readyAssignee` filter it.
|
|
93
93
|
- **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate.
|
|
94
94
|
- **No `project` key.** Scope the queue through team access, states and labels.
|
|
95
|
-
- **Priority.**
|
|
95
|
+
- **Priority.** Urgent, High and Low read as `urgent`, `high` and `low`; Medium and No priority read as `normal`. `--priority urgent|high|low` sets the matching Linear priority. `--priority normal` sets No priority on an Urgent, High or Low issue and leaves Medium untouched. The revision covers priority.
|
|
96
96
|
- **Rate limits** are shared with your other API callers.
|
|
97
97
|
- **Backlog and rejected.** Neither role has a default, and neither may share a state with triage. Here `Backlog` is the triage state, so a deferred-work state needs its own name, such as `backlogState = "Icebox"`. Linear counts `Canceled` as complete; mapped to `rejectedState`, it no longer resolves blockers.
|
|
98
98
|
|
|
@@ -156,6 +156,7 @@ rejectedState = "rejected"
|
|
|
156
156
|
- **Closing reasons.** Closed as completed, or closed before GitHub recorded reasons, is done. Closed as not planned or duplicate is in the `rejectedState` state; without `rejectedState` it reads as a fixed `not-planned` state that is never ready, never resolves a blocker and can't be moved into. Moving to done or rejected closes the issue with that reason (an issue already closed with the other reason is reopened and closed again, because GitHub changes a reason only with the state); moving to any other state opens it with exactly that state's label.
|
|
157
157
|
- **Reopen goes to triage.** If a state label survived the close, the adapter strips that stale label the first time it reads the reopened issue. It tells stale from fresh by the issue's last 100 label and reopen events; an issue whose deciding event is older than that is left out of listings with a diagnostic until its state label is removed and re-added.
|
|
158
158
|
- **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate. Missing labels, [creation labels](#creation-labels) included, are created on demand. State and link labels are never part of a ticket's labels, and a write that names one is refused. The `autobuild:proposal` and `autobuild:aborted` labels that harvest and abort apply are ordinary labels, so `proposal` and `aborted` can't be states.
|
|
159
|
+
- **Priority** is one label: `priority:urgent`, `priority:high` or `priority:low`, none for normal, matched case-insensitively. With several, the highest wins and the next `--priority` write leaves one. Priority labels show as the ticket's `priority`, never in its labels; label writes, filters and `readyLabels`/`createLabels` entries naming one are refused. See Optional priority below.
|
|
159
160
|
- **Assignee.** `readyAssignee = "me"` keeps only issues assigned to the login that owns the GitHub credential; a username, including an Enterprise Managed User login such as `mona_acme`, names a specific user. The ready read itself is narrowed by assignee, an unassigned issue is never ready, and any one of several assignees matches. While `readyAssignee` is set, each scan reports open ready issues that carry every `readyLabels` entry but have no assignee in the ticket diagnostics, which `ab repository status` and the dashboards show, naming the ten lowest-numbered and counting the rest. The report never claims or assigns them; assigning one makes it claimable. `"me"` costs one `GET /user` per dispatcher start, never during a tick, so a reload that enables it needs no restart unless startup couldn't resolve the credential's owner.
|
|
160
161
|
- **Assignees.** Tickets carry the issue's assignees as an `assignees` array of usernames in JSON reads, whether they were set on GitHub or through `ab`, and `ab ticket show` prints them. They aren't part of the ticket's `revision`. `--assignees` on `ab ticket create` and `ab ticket update`, and the `assignees` field of the operator `tickets.create` and `tickets.update` tools, set them: each entry is a username or `me`, at most ten entries counted before duplicates collapse, and an update replaces the whole set. `createAssignee = "me"` (or a username) assigns every ticket Autobuild creates, through `ab ticket create`, operator `tickets.create` and harvest proposals, unless the create names its own assignees; a harvest proposal goes to the owner of the filing dispatcher's credential. That pairs with `readyAssignee = "me"`, so each person's dispatcher picks up the tickets they file. A create or update fails, naming the cause and writing nothing, when `me` has no user behind the credential (a GitHub App installation token has none) or a user can't be assigned issues in the repository. GitHub silently drops assignees a token without push access sets, so a write whose assignees don't come back fails, naming the issue and saying it is unassigned; a retried harvest create adopts that issue, assigns it and adds any requested labels it is missing. A write naming assignees costs one check per user per process, `me` reuses the `readyAssignee` `GET /user`, and reads cost nothing extra.
|
|
161
162
|
- **Blockers** are native issue dependencies ("blocked by"), visible on both issues, including ones added on GitHub. A blocker resolves when its issue is done. One in another repository never resolves and is named in the dependency diagnostics. GitHub's dependency summary lags the edges by seconds, so reads that can lead to a claim (`ab ticket show`, the ready scan, dependency checks) read the dependency list instead; broad listings (`ab ticket list` outside the ready state) and export trust the summary and can miss a blocker recorded seconds earlier. Claim re-reads the dependency list fresh: a ticket whose blocker was added after the scan's dependency check stays ready and counts as dependency-blocked until a later scan. `ab ticket create --blocked-by` into the ready state opens the issue in triage, records every blocker, then moves it to ready; a partial failure says so and leaves it in triage. An issue transferred to another repository is no longer a ticket here: its old number reads as missing, so it is never written and never resolves a blocker.
|
|
@@ -192,7 +193,20 @@ The `file`, `hosted` and `github` sources store [forge issue links](tickets.md#g
|
|
|
192
193
|
|
|
193
194
|
### Optional priority
|
|
194
195
|
|
|
195
|
-
A ticket is `urgent`
|
|
196
|
+
A ticket is `urgent`, `high`, `normal` (the default) or `low`. The dispatcher claims ready work by level, urgent first and low last, each level in the source's order and ahead of lower-level builds waiting for a slot; each build takes its ticket's level.
|
|
197
|
+
|
|
198
|
+
| Source | Storage | Ready order |
|
|
199
|
+
| --- | --- | --- |
|
|
200
|
+
| `file` | `priority = "<level>"` frontmatter; no key for normal | filing order |
|
|
201
|
+
| `hosted` | transactional project data | urgent, high, normal, low, each in filing order |
|
|
202
|
+
| `linear` | native priority, described in its section above | Linear's order |
|
|
203
|
+
| `github`, plugins without `priority` | one `priority:urgent`, `priority:high` or `priority:low` label; none for normal | the source's order |
|
|
204
|
+
|
|
205
|
+
Native sources cover priority in their revisions. On the label fallback, the revision changes with priority because it covers labels, and:
|
|
206
|
+
|
|
207
|
+
- **Reads.** Priority labels match case-insensitively, hand-added ones included; with several, the highest wins. They are reported as the ticket's `priority`, never in its `labels`, and cost no extra request.
|
|
208
|
+
- **Writes.** A priority write leaves exactly one priority label (none for normal) and touches no other label. A labels replacement neither adds nor removes priority labels.
|
|
209
|
+
- **Refusals.** A label write, a listing or search filter, or a `readyLabels` or `createLabels` entry naming a priority label is refused (configuration at startup); set priority with `--priority`. Priority labels therefore never satisfy or block `readyLabels`.
|
|
196
210
|
|
|
197
211
|
### Optional ticket tree
|
|
198
212
|
|
|
@@ -229,6 +243,8 @@ Declare `assignees` only if you store, return and verify ticket assignees; witho
|
|
|
229
243
|
|
|
230
244
|
Labels need no capability: every source stores them. Callers union `[tickets].createLabels` into the draft's `labels` before `create`, so a draft's labels are always exact.
|
|
231
245
|
|
|
246
|
+
Declare `priority` only if you store all four levels natively; without it, Autobuild stores priority as labels for you. See the [optional priority capability](plugin-authoring.md#optional-priority-capability).
|
|
247
|
+
|
|
232
248
|
Declare tree support only if you keep the [optional tree contract](plugin-authoring.md#optional-ticket-tree-capability) on the same port and harness: exhaustive pagination, canonical targets, revision coverage and atomic rejection.
|
|
233
249
|
|
|
234
250
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
@@ -236,18 +252,17 @@ Native paging is an optional API 1.9 ticket-source capability:
|
|
|
236
252
|
The SDK exports these types; the result is `TicketListing & { total: number }`.
|
|
237
253
|
Criteria retain state, labels (AND), and assignee semantics. The page has a
|
|
238
254
|
nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
|
|
239
|
-
and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
reverse of dispatch order. Offset and limit apply after ordering. Total counts all matches, even
|
|
255
|
+
and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is
|
|
256
|
+
priority order: urgent, high, normal, then low tickets, each in listing order.
|
|
257
|
+
Newest is newest filed first: creation time descending, regardless of
|
|
258
|
+
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
|
|
244
259
|
with limit zero or an offset past the end. Records, diagnostics and errors
|
|
245
260
|
match the exhaustive listing. The shared `describeTicketSourceContract` suite
|
|
246
261
|
automatically compares declared native paging with full-read windows.
|
|
247
262
|
|
|
248
263
|
Only paged operator listings select this capability. Sources without it retain
|
|
249
264
|
the full-read fallback, which orders the listing before offset and limit: by
|
|
250
|
-
default a stable
|
|
265
|
+
default a stable priority sort (urgent, high, normal, then low, each in source
|
|
251
266
|
order), or for newest the reversed listing, which is newest filed first for
|
|
252
267
|
sources that list in filing order (file, GitHub, Linear). Native errors
|
|
253
268
|
propagate. Unpaged operator listings, CLI ticket lists and dispatcher ready
|
package/docs/tickets.md
CHANGED
|
@@ -55,7 +55,7 @@ A build freezes the links when it claims the ticket. On GitHub, a leaf build tha
|
|
|
55
55
|
bun ab ticket create "Close stale sandboxes" --body spec.md --issues 824,820:refs
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
When a ticket must go next, such as a fix for a stuck build, mark it urgent instead of moving other tickets out of ready
|
|
58
|
+
A ticket's priority is `urgent`, `high`, `normal` (the default) or `low`; set it with `--priority` on `ab ticket create` or `ab ticket update`. When a ticket must go next, such as a fix for a stuck build, mark it urgent instead of moving other tickets out of ready. An update without `--priority` leaves it alone, and any other value is refused before anything is written. Every source stores priority: `file`, `hosted` and `linear` natively, `github` and plugins without native support as one `priority:<level>` label. See [Ticket sources](ticket-sources.md#shipped-adapters).
|
|
59
59
|
|
|
60
60
|
```sh
|
|
61
61
|
bun ab ticket update AUT-12 --priority urgent
|
|
@@ -90,10 +90,10 @@ Moving a ticket back to triage, backlog or ready restores ordinary behavior. "Bu
|
|
|
90
90
|
Ordinary intake claims only tickets in the ready state with the required labels and any source-specific listing filter, such as a ready assignee. A ticket named by `ab start` (`tickets.start`) must still be in the ready state, but those listing labels and the ready assignee are not applied to it. A ready ticket still waits on:
|
|
91
91
|
|
|
92
92
|
- **Blockers.** Unresolved prerequisite tickets keep it queued; they don't create a blocked build. With nodes, prerequisites with builds must be present at the sampled destination; see [integration and blocker presence](integration-overview.md).
|
|
93
|
-
- **Destination and capacity.** Its target must accept new work, and a capacity slot must be free and not reserved for an integration node awaiting verification, a finished build waiting to re-verify or reconcile, or a build resuming after an answered escalation, a resumed pause or an ended ticket wait; each of those is admitted before
|
|
94
|
-
- **Open-PR backpressure.** When the repository configures `maxOpenPrs` and that many root build PRs are open and unmerged, the dispatcher pauses ordinary ready-queue normal
|
|
93
|
+
- **Destination and capacity.** Its target must accept new work, and a capacity slot must be free and not reserved for an integration node awaiting verification, a finished build waiting to re-verify or reconcile, or a build resuming after an answered escalation, a resumed pause or an ended ticket wait; each of those is admitted before ticket claims at its level (see [slot admission order](dispatcher.md#slot-admission-order)). A pending `ab start` request reserves a slot ahead of the claims and parked work its tier outranks.
|
|
94
|
+
- **Open-PR backpressure.** When the repository configures `maxOpenPrs` and that many root build PRs are open and unmerged, the dispatcher pauses ordinary ready-queue claims of `high`, `normal` and `low` tickets, even with a free slot, until the count drains to `resumeOpenPrs` (below `maxOpenPrs` when the two are equal). Urgent tickets bypass this gate, and so does every `ab start` tier, which still respects capacity and repository pause. See [`[policy]`](configuration.md#policy) for the thresholds.
|
|
95
95
|
|
|
96
|
-
When a slot is free, the dispatcher takes
|
|
96
|
+
When a slot is free, the dispatcher takes ready tickets by level, `urgent`, `high`, `normal`, then `low`, each level in the source's order. A level's tickets go ahead of lower-level builds waiting to re-verify, reconcile or resume, though not ahead of waiting builds at their own level or above. Each build takes its ticket's level. An [optimization node's attempts](optimization-nodes.md#attempts) claim at the node's current level instead: a later `ab priority` on the node affects attempts claimed afterwards, while an already claimed attempt keeps its level. To expedite or defer a build that already exists, run `ab priority <slug> urgent|high|normal|low`. Only urgent tickets bypass open-PR backpressure. A blocked ticket waits like any other while lower-level work proceeds, and no level stops or pauses a running build. The web dashboard's Queue tab lists ready tickets in dispatch order and marks them `URGENT`, `HIGH` or `LOW` (normal is unmarked); the mark shows the level, not that the ticket will dispatch next.
|
|
97
97
|
|
|
98
98
|
Before ready filing, the agent checks `ab repository status --json`. With live
|
|
99
99
|
`operator.registrations`, it records intent, rejected alternatives and out-of-scope
|
package/docs/troubleshooting.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
title: Troubleshooting
|
|
3
3
|
group: reference
|
|
4
4
|
order: 18
|
|
5
|
-
description: "Diagnose configuration, idle dispatch, authentication, stalled builds, and project selection."
|
|
5
|
+
description: "Diagnose configuration, idle dispatch, authentication, stalled builds, sandbox recovery steps, and project selection."
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Troubleshooting
|
|
@@ -58,7 +58,7 @@ bun ab harvest status
|
|
|
58
58
|
- **Blockers and destination:** blockers done, target node open, required changes in the destination. A target node built by another dispatcher's store never opens here; see [several dispatchers](build-store.md#several-dispatchers-on-one-repository). `ab repository status` lists the queue diagnostics.
|
|
59
59
|
- **Claims:** claimed tickets aren't reclaimed.
|
|
60
60
|
- **Forge cooldown:** `forge landing/polling paused until <reset>` means a GitHub rate limit holds forge work until that reset, whether a request was refused or a successful response reported the quota exhausted. `forge rate limit <resource>` lines show the last observed quota and when it was seen.
|
|
61
|
-
- **Capacity:** a build holds a slot while Autobuild owes its next move. Paused builds, builds blocked on a question once nothing is still working on them, builds waiting for a merge decision or on other tickets, and idle collecting nodes hold none. An answered or resumed build, a finished build that must re-verify or reconcile, and a build whose ticket wait ended wait as parked work for a slot ahead of
|
|
61
|
+
- **Capacity:** a build holds a slot while Autobuild owes its next move. Paused builds, builds blocked on a question once nothing is still working on them, builds waiting for a merge decision or on other tickets, and idle collecting nodes hold none. An answered or resumed build, a finished build that must re-verify or reconcile, and a build whose ticket wait ended wait as parked work for a slot ahead of claims at its level; higher-level work, including higher-level ready tickets, goes first, and `ab priority <slug> urgent` expedites a waiting build. Occupancy never exceeds `capacity`.
|
|
62
62
|
- **Harvest:** check the acknowledged harvest gate and unclaimed observations. Harvest triggers at `policy.harvestThreshold` observations, or `policy.harvestMaxDrift` other merged builds since the oldest observation (zero disables drift), and uses no build slot.
|
|
63
63
|
|
|
64
64
|
## Worktree destination not isolated
|
|
@@ -114,6 +114,21 @@ bun ab builds --queued
|
|
|
114
114
|
|
|
115
115
|
See [answering blocked builds](operating.md#answer-and-pause). Preserve event logs; let the kernel manage leases and recovery.
|
|
116
116
|
|
|
117
|
+
## Infrastructure escalation names a recovery step
|
|
118
|
+
|
|
119
|
+
**Symptom.** `infrastructure.failed`, or an escalation reading `maxInfrastructureAttempts (N) exhausted during reconcile at step resume`, on a remote sandbox build.
|
|
120
|
+
|
|
121
|
+
**Cause.** Workspace recovery failed at the named step:
|
|
122
|
+
|
|
123
|
+
| Step | What failed | Action |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `resume` | Cold resume of a stopped sandbox | Usually transient latency. Answer with a retry resolution, or raise `recoveryTimeoutMs` within the hosted invocation budget. |
|
|
126
|
+
| `fence` | Proving the sandbox's execution stopped | Check provider status for the sandbox, then retry. |
|
|
127
|
+
| `preserve` | Inspecting or pushing the sandbox's commits | Check forge credentials and the branch, then retry. |
|
|
128
|
+
| `cleanup` | Stop, snapshot purge or delete | Check the sandbox and its snapshots in the provider, then retry. |
|
|
129
|
+
|
|
130
|
+
A deadline-deferred step records nothing and retries on the next invocation. See [Vercel sandbox recovery](configuration.md#vercel-sandbox).
|
|
131
|
+
|
|
117
132
|
## Remote project access
|
|
118
133
|
|
|
119
134
|
**Symptom.** Remote requests refuse a project despite a configured URL.
|
package/docs/verification.md
CHANGED
|
@@ -21,7 +21,7 @@ Every repository needs an **acceptance check**: an agent verify step that runs t
|
|
|
21
21
|
Verification uses ordered stages. A string in `[verify].steps` is a singleton
|
|
22
22
|
stage; a nonempty array groups members that start together. Empty stages and
|
|
23
23
|
repeated names are errors. Plain string lists retain serial event sequences.
|
|
24
|
-
Every member resolves post-reconcile policy, approved selection/`always`, then
|
|
24
|
+
Every member resolves post-reconcile and clean-restack policy, approved selection/`always`, then
|
|
25
25
|
path applicability at stage entry. Only pass or skip satisfies a member. The
|
|
26
26
|
next stage, or finalize after the last, waits for every member to pass or skip.
|
|
27
27
|
|
|
@@ -115,6 +115,8 @@ Path rules:
|
|
|
115
115
|
|
|
116
116
|
After a reconcile, the `afterReconcile` policy applies before plan and path selection. By default it re-verifies; excluded steps are recorded as policy skips.
|
|
117
117
|
|
|
118
|
+
After a clean restack while a root-targeting leaf waits to land, steps opted in with `afterCleanRestack` re-run on the restacked head before it lands; the rest are recorded as policy skips. It is off by default.
|
|
119
|
+
|
|
118
120
|
## What a check command receives
|
|
119
121
|
|
|
120
122
|
A `check` command runs in the build's workspace with `AB_VERIFY_BASE` set to the commit verification compares against, the same base path applicability diffs from:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defrex/autobuild",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Agent-driven software delivery from groomed ticket to merged PR",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
},
|
|
163
163
|
"devDependencies": {
|
|
164
164
|
"@biomejs/biome": "2.5.5",
|
|
165
|
-
"@defrex/autobuild-postgres-store": "1.
|
|
166
|
-
"@defrex/autobuild-vercel-sandbox": "1.
|
|
165
|
+
"@defrex/autobuild-postgres-store": "1.13.0",
|
|
166
|
+
"@defrex/autobuild-vercel-sandbox": "1.13.0",
|
|
167
167
|
"@resvg/resvg-js": "2.6.2",
|
|
168
168
|
"@types/bun": "^1.3.14",
|
|
169
169
|
"@types/node": "^24.0.0",
|