@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.
Files changed (159) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +435 -160
  3. package/bin/ab-build-runner.ts +8 -0
  4. package/docs/answering-blocked-builds.md +25 -3
  5. package/docs/architecture.md +124 -53
  6. package/docs/cli.md +1 -1
  7. package/docs/configuration.md +110 -15
  8. package/docs/dispatcher.md +19 -8
  9. package/docs/integration-overview.md +1 -1
  10. package/docs/integration-tree.md +12 -9
  11. package/docs/merge-policy.md +7 -2
  12. package/docs/operating.md +5 -3
  13. package/docs/operator-api.md +46 -23
  14. package/docs/operator-surfaces.md +7 -6
  15. package/docs/optimization-nodes.md +7 -6
  16. package/docs/plugin-authoring.md +46 -18
  17. package/docs/remote-store-protocol.md +51 -12
  18. package/docs/remote-ticket-protocol.md +85 -38
  19. package/docs/restacking.md +48 -3
  20. package/docs/setup.md +2 -1
  21. package/docs/ticket-migration.md +2 -2
  22. package/docs/ticket-sources.md +23 -8
  23. package/docs/tickets.md +4 -4
  24. package/docs/troubleshooting.md +17 -2
  25. package/docs/verification.md +3 -1
  26. package/package.json +3 -3
  27. package/packages/core/src/cli/build-control.ts +72 -6
  28. package/packages/core/src/cli/dashboard/actions.ts +4 -0
  29. package/packages/core/src/cli/dashboard/integration-row.ts +43 -19
  30. package/packages/core/src/cli/dashboard/model.ts +14 -8
  31. package/packages/core/src/cli/dashboard/poll.ts +218 -10
  32. package/packages/core/src/cli/dashboard/queue.ts +21 -10
  33. package/packages/core/src/cli/dashboard/row-text.ts +2 -1
  34. package/packages/core/src/cli/dashboard/vocabulary.ts +5 -1
  35. package/packages/core/src/cli/dispatch-frontend.ts +2 -1
  36. package/packages/core/src/cli/dispatch-tickets.ts +33 -12
  37. package/packages/core/src/cli/dispatch.ts +527 -144
  38. package/packages/core/src/cli/help.ts +38 -24
  39. package/packages/core/src/cli/main.ts +7 -5
  40. package/packages/core/src/cli/publication-settlement.ts +4 -0
  41. package/packages/core/src/cli/remote-poll.ts +22 -5
  42. package/packages/core/src/cli/repository-status.ts +19 -9
  43. package/packages/core/src/cli/status.ts +23 -11
  44. package/packages/core/src/cli/store-opening.ts +12 -0
  45. package/packages/core/src/cli/ticket-start.ts +3 -3
  46. package/packages/core/src/cli/ticket.ts +12 -11
  47. package/packages/core/src/cli/wait.ts +8 -28
  48. package/packages/core/src/cli/watch.ts +113 -50
  49. package/packages/core/src/config/reference-metadata.ts +7 -1
  50. package/packages/core/src/config/reference.ts +5 -2
  51. package/packages/core/src/config/schema.ts +51 -16
  52. package/packages/core/src/events/payloads.ts +74 -14
  53. package/packages/core/src/events/repository.ts +14 -3
  54. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +27 -0
  55. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/0a10010ee5cf2e47.json +577 -0
  56. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/227701361be6d1e0.json +490 -0
  57. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/76e5043bae7a80ab.json +86 -0
  58. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/87a917802870bbed.json +87 -0
  59. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9d85616e5b9e24c1.json +500 -0
  60. package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c7c94fbe7f63cf07.json +84 -0
  61. package/packages/core/src/kernel/clean-restack-policy.ts +40 -0
  62. package/packages/core/src/kernel/dispatch-capacity.ts +243 -107
  63. package/packages/core/src/kernel/done-escalations.ts +269 -0
  64. package/packages/core/src/kernel/engine.ts +28 -9
  65. package/packages/core/src/kernel/integration-landing.ts +24 -4
  66. package/packages/core/src/kernel/integration-stack.ts +39 -0
  67. package/packages/core/src/kernel/janitor-failure.ts +20 -1
  68. package/packages/core/src/kernel/log-index-value.ts +3 -0
  69. package/packages/core/src/kernel/log-index.ts +41 -2
  70. package/packages/core/src/kernel/open-pr-backpressure.ts +3 -3
  71. package/packages/core/src/kernel/reducer-registry.ts +3 -0
  72. package/packages/core/src/kernel/reducer-revisions.ts +15 -0
  73. package/packages/core/src/kernel/reducer.ts +27 -7
  74. package/packages/core/src/kernel/repository-attention.ts +14 -5
  75. package/packages/core/src/kernel/ticket-starts.ts +15 -4
  76. package/packages/core/src/kernel/verify-stages.ts +46 -7
  77. package/packages/core/src/operator/attention.ts +28 -3
  78. package/packages/core/src/operator/done-escalations.ts +38 -0
  79. package/packages/core/src/operator/presentation.ts +1 -1
  80. package/packages/core/src/operator/protocol.ts +8 -5
  81. package/packages/core/src/operator/query.ts +33 -19
  82. package/packages/core/src/operator/registry.ts +17 -13
  83. package/packages/core/src/operator/ticket-start.ts +8 -7
  84. package/packages/core/src/operator/tickets.ts +28 -9
  85. package/packages/core/src/plugin-sdk/index.ts +10 -0
  86. package/packages/core/src/plugins/manifest.ts +14 -1
  87. package/packages/core/src/ports/forge/create.ts +8 -0
  88. package/packages/core/src/ports/forge/github-transport.ts +5 -1
  89. package/packages/core/src/ports/forge/github.ts +3 -0
  90. package/packages/core/src/ports/tickets/contract.ts +147 -76
  91. package/packages/core/src/ports/tickets/create.ts +47 -7
  92. package/packages/core/src/ports/tickets/fake.ts +8 -4
  93. package/packages/core/src/ports/tickets/file-codec.ts +4 -3
  94. package/packages/core/src/ports/tickets/file.ts +7 -3
  95. package/packages/core/src/ports/tickets/github.ts +1 -0
  96. package/packages/core/src/ports/tickets/grants.ts +11 -3
  97. package/packages/core/src/ports/tickets/hosted-index.ts +5 -0
  98. package/packages/core/src/ports/tickets/linear.ts +28 -9
  99. package/packages/core/src/ports/tickets/migration.ts +4 -4
  100. package/packages/core/src/ports/tickets/operations.ts +4 -2
  101. package/packages/core/src/ports/tickets/priority-labels.ts +213 -0
  102. package/packages/core/src/ports/tickets/priority.ts +127 -21
  103. package/packages/core/src/ports/tickets/remote-protocol.ts +10 -0
  104. package/packages/core/src/ports/tickets/remote.ts +104 -11
  105. package/packages/core/src/ports/tickets/revision.ts +5 -3
  106. package/packages/core/src/ports/tickets/search.ts +9 -0
  107. package/packages/core/src/ports/tickets/tree.ts +8 -6
  108. package/packages/core/src/ports/types.ts +30 -15
  109. package/packages/core/src/ports/workspace/build-execution.ts +4 -0
  110. package/packages/core/src/ports/workspace/builtin-capabilities.ts +4 -0
  111. package/packages/core/src/ports/workspace/create.ts +16 -3
  112. package/packages/core/src/ports/workspace/execution-exit-marker.ts +41 -0
  113. package/packages/core/src/ports/workspace/recovery-step.ts +101 -0
  114. package/packages/core/src/ports/workspace/vercel-sandbox.ts +510 -145
  115. package/packages/core/src/processes/build-execution-state.ts +4 -0
  116. package/packages/core/src/processes/build-runner.ts +14 -1
  117. package/packages/core/src/processes/dispatcher.ts +544 -212
  118. package/packages/core/src/processes/execution-settlement.ts +1 -0
  119. package/packages/core/src/processes/harvest-runner.ts +12 -7
  120. package/packages/core/src/processes/infrastructure-failure-budget.ts +7 -2
  121. package/packages/core/src/processes/invocation-budget.ts +176 -0
  122. package/packages/core/src/processes/publication-loss.ts +38 -3
  123. package/packages/core/src/processes/workspace-preservation.ts +86 -15
  124. package/packages/core/src/store/contract.ts +81 -3
  125. package/packages/core/src/store/event-reads.ts +30 -1
  126. package/packages/core/src/store/reduced-reads.ts +23 -0
  127. package/packages/core/src/store/reducer-value-shapes.json +6628 -6469
  128. package/packages/core/src/store/reducer-value-validation.ts +181 -33
  129. package/packages/core/src/store/remote/client.ts +169 -29
  130. package/packages/core/src/store/remote/compatibility.ts +113 -56
  131. package/packages/core/src/store/remote/credentials.ts +4 -1
  132. package/packages/core/src/store/remote/protocol.ts +3 -0
  133. package/packages/core/src/store/remote/released-clients.json +11 -0
  134. package/packages/core/src/store/remote/released-reducer-values/1.13.0.json +35966 -0
  135. package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -16
  136. package/packages/core/src/store/remote/released-value-policy.ts +144 -0
  137. package/packages/core/src/store/remote/retry.ts +406 -0
  138. package/packages/core/src/testing/dispatch-read-budget.ts +144 -10
  139. package/packages/core/src/testing/index.ts +2 -0
  140. package/packages/core/src/testing/invocation-budget.ts +42 -0
  141. package/packages/core/src/testing/reduced-read-budget.ts +381 -18
  142. package/packages/core/src/testing/released-value-coverage.ts +423 -0
  143. package/packages/core/src/web/overview-source.ts +19 -6
  144. package/skills/guide/SKILL.md +138 -67
  145. package/skills/guide/references/integration-tree.md +12 -9
  146. package/skills/guide/references/merge-policy.md +7 -2
  147. package/skills/guide/references/operator-api.md +46 -23
  148. package/skills/guide/references/optimization-nodes.md +7 -6
  149. package/skills/guide/references/plugin-authoring.md +46 -18
  150. package/skills/guide/references/remote-store-protocol.md +51 -12
  151. package/skills/guide/references/remote-ticket-protocol.md +85 -38
  152. package/skills/guide/references/restacking.md +48 -3
  153. package/skills/guide/references/setup.md +2 -1
  154. package/skills/guide/references/ticket-migration.md +2 -2
  155. package/skills/operate/SKILL.md +82 -51
  156. package/skills/plan/SKILL.md +4 -3
  157. package/skills/spec/SKILL.md +9 -5
  158. package/skills/tickets/SKILL.md +25 -17
  159. package/templates/hosted-service/package.json +2 -2
@@ -164,15 +164,19 @@ keep the Evidence citation.
164
164
 
165
165
  When grooming established that the ticket must go next — for example a fix
166
166
  that unblocks a stuck build — create it with `--priority urgent` so the
167
- dispatcher claims it before normal ready work and normal waiting builds, and
168
- claims it even while open-PR backpressure pauses normal intake. Otherwise omit
169
- the flag; normal is the default. A source that cannot store priority refuses
170
- the create and names itself; file it normal and tell the human so the operator can expedite it.
167
+ dispatcher claims it before all other ready work and lower-level waiting
168
+ builds, and claims it even while open-PR backpressure pauses other intake.
169
+ When grooming ranked it more or less important than routine work, use
170
+ `--priority high` (claimed ahead of routine work, without urgent's
171
+ backpressure bypass) or `--priority low` (claimed only when no higher-level
172
+ work wants the slot). Otherwise omit the flag; normal is the default. If the
173
+ create is refused with a priority error (a hosted service too old to store the
174
+ level), file it normal and tell the human so the operator can expedite it.
171
175
 
172
176
  When the explicitly named destination equals `[tickets].readyState`, tell the
173
177
  human in the completion response that the ticket may be claimed by the next
174
178
  dispatch once the repository's label, dependency, intake, capacity, and other
175
- readiness gates are satisfied, after any urgent ready tickets. Before ready filing, follow
179
+ readiness gates are satisfied, after any higher-level ready tickets. Before ready filing, follow
176
180
  [After filing: check operator presence](#after-filing-check-operator-presence):
177
181
  with a live operator, say the existing operator will pick it up; without one,
178
182
  say you will operate it. The human's explicit instructions override either default.
@@ -139,7 +139,7 @@ states the work could be in with `ab ticket list --state <state>` before
139
139
  filing.
140
140
 
141
141
  ```
142
- ab ticket create "Rate-limit auth endpoints" --body spec.md [--labels bug,api] [--blocked-by file-1,file-2] [--issues 824,820:refs] [--priority urgent] [--assignees alice,me]
142
+ ab ticket create "Rate-limit auth endpoints" --body spec.md [--labels bug,api] [--blocked-by file-1,file-2] [--issues 824,820:refs] [--priority urgent|high|normal|low] [--assignees alice,me]
143
143
  ```
144
144
 
145
145
  It lands in `triage/` and prints the new id. `--body` is a file, and its
@@ -150,8 +150,10 @@ spec gets bounced back to `triage/` by the dispatcher rather than built.
150
150
  Blocker ids are source-local; every blocker must exist before creation
151
151
  succeeds. When the ticket originates from a forge issue, attach it with
152
152
  `--issues`: `N` (intent `closes`, the default) when the ticket fully resolves
153
- the issue, `N:refs` when it only partly addresses it. `--priority urgent` makes
154
- the dispatcher claim it before normal ready work; omit it for normal.
153
+ the issue, `N:refs` when it only partly addresses it. `--priority` takes
154
+ `urgent`, `high`, `normal` (the default) or `low`; the dispatcher claims
155
+ ready work by level, so `urgent` goes before all other ready work and `low`
156
+ after it.
155
157
  `--assignees` assigns the ticket on a source that stores assignees (GitHub):
156
158
  usernames, or `me` for the owner of the GitHub credential. Without it, a
157
159
  configured `[tickets].createAssignee` assigns the ticket, and `--assignees ''`
@@ -207,10 +209,13 @@ ab ticket unblock file-3 file-1
207
209
 
208
210
  Update is partial: omitted fields stay untouched, while an explicitly empty
209
211
  `--labels` clears labels. `--issues` replaces the whole set of issue links and
210
- `--issues ''` clears it. `--priority urgent|normal` sets the dispatch class;
211
- the file tracker writes `priority = "urgent"` and removes the key for normal. A
212
- source that cannot store priority refuses `urgent`, names itself, and writes
213
- nothing; `normal` succeeds there. `--assignees` replaces the whole set of
212
+ `--issues ''` clears it. `--priority urgent|high|normal|low` sets the level and
213
+ omitting it leaves the level alone; any other value is refused before anything
214
+ is written. The file tracker writes `priority = "<level>"` and removes the key
215
+ for normal. GitHub and plugin sources without native priority store it as one
216
+ `priority:urgent`, `priority:high` or `priority:low` label, shown as the
217
+ ticket's priority, not among its labels; set it with `--priority`, never
218
+ `--labels`, which refuses priority labels. `--assignees` replaces the whole set of
214
219
  assignees, `--assignees ''` clears it, and omitting it leaves them alone;
215
220
  `ab ticket show` prints them and JSON reads carry an `assignees` array. Hand a
216
221
  GitHub ticket to someone else this way. A source that cannot store assignees
@@ -267,15 +272,18 @@ another move to `ready/`, subject to the remaining dispatch gates and available
267
272
  capacity. Blocker edits must use the source-agnostic `ab ticket block` and
268
273
  `ab ticket unblock` commands shown above.
269
274
 
270
- With a free slot the dispatcher claims eligible urgent tickets first, then
271
- normal ones, each in source order; urgent tickets also go ahead of normal
272
- builds waiting to re-verify, reconcile or resume. A blocked urgent ticket waits
273
- while normal work proceeds, and urgency never stops a running build. To
274
- expedite a ticket, mark it urgent rather than moving other tickets out of
275
- `ready/`. Editing a ticket's priority after it is claimed does not change its
276
- build; the operator runs `ab priority <slug> urgent` for that.
275
+ With a free slot the dispatcher claims eligible tickets by level, `urgent`,
276
+ `high`, `normal`, then `low`, each level in source order; each level also
277
+ goes ahead of lower-level builds waiting to re-verify, reconcile or resume.
278
+ Each build takes its ticket's level. A blocked ticket waits while
279
+ lower-level work proceeds, and priority never stops a running build. To
280
+ expedite a ticket, mark it `urgent` or `high` rather than moving other
281
+ tickets out of `ready/`. Editing a ticket's priority after it is claimed does
282
+ not change its build; the operator runs `ab priority <slug> <level>` for
283
+ that.
277
284
  When `[policy].maxOpenPrs` is set and that many root PRs are open and unmerged,
278
- open-PR backpressure pauses normal claims while urgent ones are still claimed.
285
+ open-PR backpressure pauses `high`, `normal` and `low` claims while urgent
286
+ ones are still claimed.
279
287
 
280
288
  When the dispatcher claims an eligible file ticket, it moves it to `doing/`,
281
289
  then to `done/` on merge or back to `triage/` if the build aborts (`ready/`
@@ -471,8 +479,8 @@ absolute file path containing the edited text. Read the current ticket and
471
479
  reapply the intended changes before retrying; conflicts are never merged.
472
480
 
473
481
  File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets,
474
- state and urgent priority; file revisions also cover nonempty issue links. GitHub revisions
475
- fingerprint kind, target, title, body, canonical label/blocker sets, state and issue links,
482
+ state and any priority other than normal; file revisions also cover nonempty issue links. GitHub revisions
483
+ fingerprint kind, target, title, body, canonical label/blocker sets (priority labels included), state and issue links,
476
484
  including the ticket's own issue; GitHub tickets carry no comments. Reverting
477
485
  identical content restores its fingerprint. File checks
478
486
  re-read immediately before writing, with the existing no-lock race window.
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.12.0",
8
- "@defrex/autobuild": "1.12.0",
7
+ "@defrex/autobuild-hosted-store-service": "1.13.0",
8
+ "@defrex/autobuild": "1.13.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"