@defrex/autobuild 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +41 -2
  3. package/docs/architecture.md +27 -2
  4. package/docs/configuration.md +11 -3
  5. package/docs/dispatcher-hosting.md +5 -3
  6. package/docs/operator-api.md +14 -1
  7. package/docs/plugin-authoring.md +29 -1
  8. package/docs/remote-ticket-protocol.md +34 -1
  9. package/docs/restacking.md +5 -0
  10. package/docs/setup.md +9 -3
  11. package/docs/ticket-sources.md +28 -1
  12. package/docs/troubleshooting.md +15 -0
  13. package/docs/workspaces.md +1 -1
  14. package/package.json +4 -4
  15. package/packages/core/src/cli/dashboard/refresh.ts +8 -0
  16. package/packages/core/src/config/schema.ts +2 -1
  17. package/packages/core/src/events/repository.ts +37 -1
  18. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/d41044cb2e54809c.json +194 -0
  19. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e0f89f52e48cbf62.json +197 -0
  20. package/packages/core/src/kernel/reducer-revisions.ts +5 -0
  21. package/packages/core/src/kernel/repository-read-facts.ts +9 -2
  22. package/packages/core/src/kernel/ticket-preparation.ts +10 -0
  23. package/packages/core/src/operator/registry.ts +64 -9
  24. package/packages/core/src/operator/tickets.ts +139 -25
  25. package/packages/core/src/plugin-sdk/index.ts +4 -0
  26. package/packages/core/src/plugins/manifest.ts +1 -1
  27. package/packages/core/src/ports/tickets/completion.ts +71 -0
  28. package/packages/core/src/ports/tickets/contract.ts +73 -0
  29. package/packages/core/src/ports/tickets/github-fake.ts +8 -0
  30. package/packages/core/src/ports/tickets/github-issues.ts +1 -0
  31. package/packages/core/src/ports/tickets/github.ts +18 -6
  32. package/packages/core/src/ports/tickets/hosted-index.ts +8 -0
  33. package/packages/core/src/ports/tickets/linear.ts +18 -2
  34. package/packages/core/src/ports/tickets/remote-protocol.ts +37 -8
  35. package/packages/core/src/ports/tickets/remote.ts +41 -3
  36. package/packages/core/src/ports/tickets/tree.ts +11 -1
  37. package/packages/core/src/ports/types.ts +32 -4
  38. package/packages/core/src/ports/workspace/vercel-sandbox.ts +78 -25
  39. package/packages/core/src/processes/dispatcher.ts +852 -276
  40. package/packages/core/src/processes/pass-stages.ts +32 -6
  41. package/packages/core/src/store/reducer-value-shapes.json +8309 -8240
  42. package/packages/core/src/store/remote/released-clients.json +11 -0
  43. package/packages/core/src/store/remote/released-reducer-values/1.18.0.json +36436 -0
  44. package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -16
  45. package/packages/core/src/testing/dispatch-read-budget.ts +143 -16
  46. package/packages/core/src/testing/index.ts +2 -0
  47. package/packages/core/src/testing/reduced-read-budget.ts +198 -2
  48. package/skills/guide/SKILL.md +21 -5
  49. package/skills/guide/references/operator-api.md +14 -1
  50. package/skills/guide/references/plugin-authoring.md +29 -1
  51. package/skills/guide/references/remote-ticket-protocol.md +34 -1
  52. package/skills/guide/references/restacking.md +5 -0
  53. package/skills/guide/references/setup.md +9 -3
  54. package/skills/operate/SKILL.md +18 -1
  55. package/templates/hosted-service/package.json +2 -2
@@ -185,7 +185,7 @@ The operation names and `input` values are:
185
185
  | `state-counts` | `{names: string[]}` (1–16) | `{name, tickets}[]` for the names that resolve |
186
186
  | `list-ready` | `{labels?: string[], state?: string}` | `TicketListing` |
187
187
  | `list-targeting` | `{nodeId: string}` | `TicketListing` of every state |
188
- | `list-page` | `{criteria: {labels?, state?}, page: {limit, offset?, order?}}` | `TicketPageListing` (`{tickets, diagnostics, total}`) |
188
+ | `list-page` | `{criteria: {labels?, state?, excludeLabels?, since?, until?}, page: {limit, offset?, order?}}` | `TicketPageListing` (`{tickets, diagnostics, total}`) |
189
189
  | `search` | `{text, state?, labels?, limit, cursor?}` | `{tickets: {id, title, state?, labels, kind, target?, priority?}[], cursor?, diagnostics}` |
190
190
  | `get` | `{id}` | `Ticket \| null` |
191
191
  | `claim` | `{id}` | `{claimed: boolean}` |
@@ -532,6 +532,39 @@ listing takes the `list-ready` path by that explicit decision.
532
532
  The capability is additive. It does not change the remote BuildStore protocol
533
533
  version, and released clients, which never send `list-page`, are unaffected.
534
534
 
535
+ ## Completion listing
536
+
537
+ Recently completed work is listed through `list-page` with completion criteria,
538
+ negotiated by `x-autobuild-ticket-completion: 1`:
539
+
540
+ - **Ticket fields.** `resolvedAt` (ISO-8601, when the ticket entered its done
541
+ state) and `targetTitle` (the target node's title, beside `target`) appear on
542
+ tickets in every operation's answer, only for clients that send the header.
543
+ Released strict decoders never see them. PostgreSQL stamps the completion time
544
+ on entering the done state and clears it on leaving; a done ticket written
545
+ before that completes at its last update.
546
+ - **Criteria.** `excludeLabels` drops any ticket carrying any named label.
547
+ `since` (inclusive) and `until` (exclusive) bound `resolvedAt`, ISO-8601 with
548
+ an offset; tickets without a completion time never match. `order: "completed"`
549
+ is most recently completed first, ties newest filed first, then tickets
550
+ without a completion time, newest filed first. Any of them requires
551
+ `criteria.state`, or the request is a `400` validation error.
552
+ - **Cap.** The PostgreSQL backend accepts a state and range holding at most
553
+ 5,000 tickets. It answers with up to two index range scans, each stopping at
554
+ 5,001 rows: one counts the matches, the second reads the requested window. A
555
+ zero `limit` or a refusal stops after the first. When the count scan reaches
556
+ the 5,001st row, the request answers
557
+ `409 {kind: "conflict", code: "completion-range-too-broad", error, limit}`;
558
+ the client reports `TicketCompletionRangeTooBroad` with the `limit`. Narrow
559
+ `since`/`until`. Within the cap, `total` is exact.
560
+ - **Refusal.** A backing source that cannot honour completion criteria answers
561
+ `409` with `code: "paging-unsupported"`.
562
+ - **Negotiation.** Every `/tickets/*` response, including errors, carries the
563
+ header. A client sends completion criteria only after a response carried it
564
+ and `list-page` is declared; otherwise it fails with `HostedTicketPagingError`
565
+ (`service-predates`) before any request, and operator listings filter
566
+ `list-ready` instead.
567
+
535
568
  ## Search
536
569
 
537
570
  `search` answers one page of compact hits from the backing source's own search,
@@ -457,6 +457,11 @@ point-reads the selected slug and, for a keyed attempt, the canonical slug deriv
457
457
  from the repository, selected slug and key: one matching record and atomic
458
458
  `build.created` retain ownership even if creation threw after committing or its
459
459
  response was lost.
460
+ A bounded hosted invocation may journal an admission without a claim, when the
461
+ preparation would not fit before its work deadline, and stamps every intent with
462
+ that deadline. An attempt the deadline interrupted, with no failure or bounce
463
+ recorded, is carried: the next invocation resumes it first from its durable
464
+ boundaries, and it is never returned to Ready.
460
465
  Unavailable or conflicting readback never authorizes release or a replacement
461
466
  build. Pending attempts retain the original failure, latest recovery error and
462
467
  retry deadline in the canonical repository reduced value; resolved attempts
@@ -113,9 +113,15 @@ already has required system tooling.
113
113
  Put each selected runtime's immutable install and executable/version check in
114
114
  its `runtimeProvisioning` entry. Autobuild runs install then preflight after
115
115
  checkout dependencies in every fresh/replacement sandbox and before the
116
- readiness probe, writes the marker only after success, and reruns every
117
- preflight before each build runner. A failure names the runtime, selecting
118
- role/alternate, and field and starts no agent. Runtime provisioning receives
116
+ readiness probe, and writes the marker only after success. Every build-runner
117
+ launch and harvest relaunch reruns each selected runtime's preflight. A
118
+ preflight that fails in an existing sandbox runs that runtime's install and
119
+ then its preflight again; only a failure after that install fails the launch.
120
+ A failure names the runtime, selecting role/alternate, and the failed field
121
+ (`install` or `preflight`) with the command output, and starts no agent. A
122
+ `[roles]` change that selects a new runtime, or a changed pin, takes effect in
123
+ existing workspaces at their next launch; no abort is needed, so keep each
124
+ install safe to run over an older install. Runtime provisioning receives
119
125
  allowlisted legacy API credentials named by
120
126
  `[workspace.config].environmentVariables` and automatically supplied placeholders
121
127
  for every declared account credential variable. Account variables need no
@@ -640,6 +640,11 @@ that does the job, and say what you are doing before you do it:
640
640
  - `tickets.list`, `tickets.get` — read the ticket queue and one ticket, with
641
641
  its current assets. A long
642
642
  queue pages with `limit`, `offset` and `order`; `total` counts every match.
643
+ For a "what shipped" digest, pass `since`/`until` (the state defaults to
644
+ done), `order: "completed"`, `excludeLabels` for repository-defined
645
+ categories, and `summary: true` to drop bodies; tickets carry `resolvedAt`,
646
+ and children carry `targetTitle`. On a hosted source, a range over 5,000
647
+ tickets refuses with `code: "completion-range-too-broad"`, so narrow it.
643
648
  - `tickets.search` — search ticket titles and bodies across every state, with
644
649
  optional `state`, `labels`, `limit` and `cursor`. Use it to check for
645
650
  duplicates before `tickets.create`. A source without search refuses with
@@ -784,7 +789,8 @@ Treat every default-watch record as a call to act:
784
789
  - Ticket hand-back (`ticket.handed-back`): the dispatcher returned a claimed or
785
790
  ready ticket other than as completion, and the move is already committed.
786
791
  `cause` is `abort`, `spec-bounce`, `preparation-failed`, `pr-closed` or
787
- `discard`; `state` and `role` say where it went, `requested` the role an abort
792
+ `discard`. A preparation the work deadline cut or deferred is carried, never
793
+ handed back as `preparation-failed`. `state` and `role` say where it went, `requested` the role an abort
788
794
  asked for when it fell back, `missing` the spec-standard parts, and `reason`
789
795
  the operator's text. An abort to ready needs nothing more. For triage, groom
790
796
  the ticket and move it on when intended; for a spec bounce, fix the missing
@@ -1146,6 +1152,11 @@ slow cold resume of a stopped sandbox: retry, or suggest raising
1146
1152
  `recoveryTimeoutMs` within the hosted invocation budget. `at step fence` or
1147
1153
  `at step cleanup` points at sandbox or provider state worth checking before a
1148
1154
  retry; `at step preserve` at the checkout, forge credentials or branch.
1155
+ `during start` with `runtime "X" install failed after its preflight failed` or
1156
+ `runtime "X" preflight failed after install` means the configured
1157
+ `runtimeProvisioning.X` install or preflight is broken, or its pin is wrong:
1158
+ fix the config, then retry. A role change by itself never needs an abort; the
1159
+ next launch installs the newly selected runtime.
1149
1160
  A dispatch log line `build X: resume deferred by the invocation budget` (or
1150
1161
  `provision deferred`, or `launch deferred` for a launch the work deadline cut),
1151
1162
  counted as `recoveryDeferred` or `provisioningDeferred`, is normal: nothing is
@@ -1154,6 +1165,12 @@ first. The same build deferring across several invocations means the hosted
1154
1165
  budget cannot fit that work: report it, and do not retry it. A `fence` line that
1155
1166
  repeats with an infrastructure failure at step `fence` means the provider
1156
1167
  cannot confirm the sandbox stopped: check the sandbox.
1168
+ A line `ticket X: preparation carried by the invocation budget`, counted as
1169
+ `preparationsCarried`, is normal too: the hosted invocation had no time to
1170
+ finish preparing that ticket, so it holds the ticket and the next invocation
1171
+ prepares it first. Do not retry, move or re-file the ticket. The same ticket
1172
+ carried across several invocations means its preparation outlasts the hosted
1173
+ budget: report it with the stage the line names.
1157
1174
  Each hosted invocation logs `stages:` with time and items per stage, and `ab
1158
1175
  repository status` shows the latest as `last pass stages:`. `(share)` on a
1159
1176
  stage is normal under load. Settlement, janitor, hand-back, recovery, resume
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.17.0",
8
- "@defrex/autobuild": "1.17.0",
7
+ "@defrex/autobuild-hosted-store-service": "1.18.0",
8
+ "@defrex/autobuild": "1.18.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"