@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
@@ -16,8 +16,10 @@ other credentials. Unknown, expired or revoked credentials receive `401 auth`;
16
16
  removed projects receive `403 auth` with `project not registered`.
17
17
 
18
18
  The hosted cron dispatcher issues a dispatcher-purpose credential per repository
19
- tick, then deletes that exact row on completion or failure. Its crash-safety
20
- expiry is capped at the invocation deadline plus 60 seconds and the configured
19
+ tick, then attempts to delete that exact row on completion or failure, within a
20
+ bounded cleanup window of at least 5 seconds. Issuance or deletion that does not
21
+ settle in that window is reported as a tick failure, and the row relies on its
22
+ expiry, capped at the invocation deadline plus 60 seconds and the configured
21
23
  `AB_DISPATCHER_TOKEN_TTL_SECONDS` upper bound. Each served tick removes at most
22
24
  100 expired or revoked dispatcher rows through indexed probes. Legacy unexpired
23
25
  rows keep their recorded expiry and are pruned afterward. Owner lifetimes are
@@ -82,13 +84,13 @@ raw session-event append. External operator harnesses own agent execution.
82
84
 
83
85
  | Method and path | Result |
84
86
  |---|---|
85
- | `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. Each nonterminal summary's `slot` is `{state: "held"}`, `{state: "requested", request, priority?: "urgent"}` or `{state: "none"}`; absent means unknown (an older server), never `none`. Its `statusWord` is `{word, tone, note?}`, the status word every surface shows; `status` stays the reducer's lifecycle status. |
86
- | `GET …/builds/{slug}` | `{detail, dashboardRow}`; `detail.slot` and `dashboardRow.slot` carry the build's slot state, shaped as in `GET …/builds`; `detail.runnerAttaches` records chronological attach boundaries and their runtime identity (version, commit, source kind/location), with null runtime for unrecorded historical attaches; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it (after cleanup's `build.completed`). |
87
+ | `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. Each nonterminal summary's `slot` is `{state: "held"}`, `{state: "requested", request, priority?: "urgent" \| "high" \| "low"}` or `{state: "none"}`; absent means unknown (an older server), never `none`. Its `statusWord` is `{word, tone, note?}`, the status word every surface shows; `status` stays the reducer's lifecycle status. |
88
+ | `GET …/builds/{slug}` | `{detail, dashboardRow}`; `detail.slot` and `dashboardRow.slot` carry the build's slot state, shaped as in `GET …/builds`; `detail.runnerAttaches` records chronological attach boundaries and their runtime identity (version, commit, source kind/location), with null runtime for unrecorded historical attaches; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it: at `build.completed` when no escalation is open. A completed build with an open escalation keeps, or regains, a `BLOCKED` row (note `done`), including after abort cleanup, and the row becomes `null` once the escalation is acknowledged; neither step reopens its lifecycle state. |
87
89
  | `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, triage (when the dispatcher published one)/queue/capacity and settings projection. `model.capacity.slots` maps each build to its slot state, and each `model.builds[].slot` repeats it; absent means unknown. `model.configuration` is `"no-dispatcher-run"` when the repository records no dispatcher run, and absent otherwise. Optional `rollback` contains `correlation`, `lineage`, full `failed` and `restored` runtime identities and rollback event `ts` for the authoritative dispatcher lineage’s unresolved hold. Both dashboards name failed, restored and held runtime plus timestamp. Matching durable different-target hold clearance removes it; a fresh operator lineage hides it only after a committed operational tick or accepted takeover. Run-started and yielded ticks alone cannot replace authority; same-lineage generations retain the notice. Historical rollback records are not fallback notices. Optional `handoffs` lists all accepted unfinished handoffs with predecessor `run`, optional `successor`, `correlation`, full `from`/`to` runtimes, `mode` and optional `deadline`. Outstanding drain-mode builds carry `draining: true`, also on build-detail `dashboardRow`; matching settlement removes it. Accepted completion removes the handoff; neither takeover nor the clock does. Missing historical mode means cutover and missing deadline displays unknown. |
88
90
  | `GET …/status` | Repository intake, pause, and default-auto-merge projection, plus `ticketStarts` (`{pending, recent}`, each entry with its `priority`) when single-ticket start requests are pending or recently settled. `capacity.slots`, when the held configuration is readable, maps each nonterminal build to its slot state; `capacity.occupied` counts its `held` entries. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
89
91
  | `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
90
92
  | `GET …/builds/{slug}/artifacts/{kind}?rev=N` | Raw bytes (`application/octet-stream`) plus content-disposition and `X-Autobuild-Artifact-*` metadata headers. Omit `rev` for latest. |
91
- | `GET …/tickets?state=S&label=L&limit=N&offset=K&order=O` | `{states,tickets,diagnostics,criteria,triageState,readyState,doneState,total}`. The three lifecycle names come from effective repository configuration (including provider fallback). With no `state`, `criteria.state` is `triageState`; repeated `label` parameters narrow that state with AND filters. An explicit `state` selects that exact backend workflow state. `limit` (0–200) returns one page, after skipping `offset`, in `order` `oldest` (the default: dispatch order, urgent tickets first, then the source order) or `newest` (newest filed first, regardless of urgency; see paging below); `total` counts every match before paging. |
93
+ | `GET …/tickets?state=S&label=L&limit=N&offset=K&order=O` | `{states,tickets,diagnostics,criteria,triageState,readyState,doneState,total}`. The three lifecycle names come from effective repository configuration (including provider fallback). With no `state`, `criteria.state` is `triageState`; repeated `label` parameters narrow that state with AND filters. An explicit `state` selects that exact backend workflow state. `limit` (0–200) returns one page, after skipping `offset`, in `order` `oldest` (the default: priority order, urgent, high, normal, then low tickets, each in the source order) or `newest` (newest filed first, regardless of priority; see paging below); `total` counts every match before paging. |
92
94
  | `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
93
95
  | `GET …/tickets/{id}` | `{ticket,blockers,build,assets}`. Blockers include native `exists`/`resolved` status; `build` prefers an active matching repository build, otherwise the most recently updated one. `assets` lists the current ticket assets as `{kind,name,revision,size,layout,fileCount}`, as `ab ticket show --json` does. |
94
96
 
@@ -124,7 +126,7 @@ JSON bodies are strict: unknown fields are rejected.
124
126
 
125
127
  | Method and path | Body |
126
128
  |---|---|
127
- | `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"\|"priority"}`; `priority` requires `"priority":"urgent"\|"normal"` and records `build.priority-set`, the build's slot-admission priority, as `ab priority` does. Build priority stays `urgent` or `normal`; free slots go to `manual` start requests, then urgent waiting work, then urgent start requests and ordinary urgent claims, then normal waiting work, then normal start requests and ordinary normal claims. `land` alone accepts an optional `"head":"<sha>"` (full or at least seven characters) that binds consent to that candidate head. Abort alone also accepts `"to":"triage"\|"ready"` (default triage) and a `"reason"` of 1–2000 characters after trimming, as `ab abort --to/--reason` does. `hold` also accepts an optional `"reason"` of 1–2000 characters after trimming, as `ab hold --reason` does; a blank reason is refused with `invalid-argument` and nothing is recorded. `"reason"` with any other action is a validation error. Ready requires the current ticket to meet the spec standard; otherwise cleanup returns it to triage and the hand-back comment and `ticket.handed-back` event carry the `requested` role and `missing` parts. Repeating an identical pending abort is idempotent; a repeat with a different destination or reason is refused. Aborting an [optimization attempt](optimization-nodes.md#landing-and-settlement) ignores `to`: it settles `aborted`, the node moves the ticket to rejected, and no hand-back is reported. |
129
+ | `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"\|"priority"}`; `priority` requires `"priority":"urgent"\|"high"\|"normal"\|"low"` and records `build.priority-set`, the build's slot-admission level, as `ab priority` does. Free slots go to `manual` start requests, then, for each level from urgent to low, that level's waiting work, then its start requests and ordinary claims. `land` alone accepts an optional `"head":"<sha>"` (full or at least seven characters) that binds consent to that candidate head. Abort alone also accepts `"to":"triage"\|"ready"` (default triage) and a `"reason"` of 1–2000 characters after trimming, as `ab abort --to/--reason` does. `hold` also accepts an optional `"reason"` of 1–2000 characters after trimming, as `ab hold --reason` does; a blank reason is refused with `invalid-argument` and nothing is recorded. `"reason"` with any other action is a validation error. Ready requires the current ticket to meet the spec standard; otherwise cleanup returns it to triage and the hand-back comment and `ticket.handed-back` event carry the `requested` role and `missing` parts. Repeating an identical pending abort is idempotent; a repeat with a different destination or reason is refused. Aborting an [optimization attempt](optimization-nodes.md#landing-and-settlement) ignores `to`: it settles `aborted`, the node moves the ticket to rejected, and no hand-back is reported. |
128
130
  | `POST …/builds/{slug}/restack` | Empty body; durable node restack demand. |
129
131
  | `POST …/builds/{slug}/answer` | One answer variant described below. |
130
132
  | `PUT …/settings/intake` | `{"enabled":boolean}` |
@@ -132,10 +134,10 @@ JSON bodies are strict: unknown fields are rejected.
132
134
  | `POST …/bulk-control` | `{"action":"pause"\|"resume"}`. The hold fact, intake fact, then eligible build events are written in that order. |
133
135
  | `POST …/harvest/control` | `{"action":"toggle-gate"}` or `{"action":"run","run":"…"}`. A run action is bound to that concrete projected run. |
134
136
  | `POST …/tickets/states` | `{name,about?}` → `{state,created}`; requires attributed operator identity (`tickets.state.create` in MCP). Hosted duplicate names are refused case-insensitively. |
135
- | `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"normal","assignees"?:["login"|"me"],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, omitted priority is normal, and omitted assignees apply `[tickets].createAssignee` (`[]` creates an unassigned ticket), and `labels` are unioned with `[tickets].createLabels`. `assignees` takes at most ten entries, counted before duplicates collapse, and more is a validation error. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`; one that cannot store priority refuses `urgent` with `code: "priority-unsupported"` and accepts `normal` as a no-op; one that cannot store assignees refuses any `assignees` with `code: "assignees-unsupported"`. |
136
- | `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent` or `normal`; refusals as for create), complete-replacement `assignees` (`[]` clears; refusals as for create), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
137
+ | `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"high"|"normal"|"low","assignees"?:["login"|"me"],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, omitted priority is normal, and omitted assignees apply `[tickets].createAssignee` (`[]` creates an unassigned ticket), and `labels` are unioned with `[tickets].createLabels`. `assignees` takes at most ten entries, counted before duplicates collapse, and more is a validation error. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`; any other `priority` value is a validation error naming the four levels; a hosted service that cannot store the level refuses it with `code: "priority-unsupported"` (sources without native priority store it as a `priority:<level>` label instead); one that cannot store assignees refuses any `assignees` with `code: "assignees-unsupported"`. |
138
+ | `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent`, `high`, `normal` or `low`; omitted never changes it; refusals as for create), complete-replacement `assignees` (`[]` clears; refusals as for create), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
137
139
  | `POST …/tickets/{id}/move` | Exactly one of `{"state":"backend state name"}` or `{"role":"triage"\|"ready"\|"backlog"\|"rejected"}`; both or neither is `400 validation` (`tickets.move` in MCP takes the same target). A role resolves to the configured `triageState`, `readyState`, `backlogState`, or `rejectedState`. An unset `backlogState` or `rejectedState` refuses with a message naming the key to set, and never guesses a native state. A source that can create states creates a missing role state before moving. |
138
- | `POST …/tickets/{id}/start` | Empty body, or `{"priority":"manual"\|"urgent"\|"normal"}` (default `manual`; anything else is `400 validation`). Records a durable request that the running dispatcher start this ticket on its next tick with a free slot in the priority's admission tier, even while intake is off (`tickets.start` in MCP). The id resolves through the configured source; an unknown ticket is `404 not-found`. Returns `{status:"pending",existing,updated,request,priority,requestedAt,ticket}`; `existing` is true when a request for the ticket was already pending, and `updated` is true when that request's priority was changed to this one. Nothing is written when `updated` is false for an existing request. The outcome arrives later as `ticket.start-settled`. |
140
+ | `POST …/tickets/{id}/start` | Empty body, or `{"priority":"manual"\|"urgent"\|"high"\|"normal"\|"low"}` (default `manual`; anything else is `400 validation`). Records a durable request that the running dispatcher start this ticket on its next tick with a free slot in the priority's admission tier, even while intake is off (`tickets.start` in MCP). The id resolves through the configured source; an unknown ticket is `404 not-found`. Returns `{status:"pending",existing,updated,request,priority,requestedAt,ticket}`; `existing` is true when a request for the ticket was already pending, and `updated` is true when that request's priority was changed to this one. Nothing is written when `updated` is false for an existing request. The outcome arrives later as `ticket.start-settled`. |
139
141
  | `POST …/tickets/{id}/start/cancel` | Empty body. Cancels the pending start request: `{cancelled:true,request,ticket}`, or `{cancelled:false,id}` when none is pending (`tickets.start` with `cancel: true` in MCP). |
140
142
  | `POST …/tickets/{id}/block` | `{"blockerIds":["…"]}`. |
141
143
  | `POST …/tickets/{id}/unblock` | `{"blockerIds":["…"]}`. |
@@ -156,6 +158,10 @@ The retry object is deliberately bare: adding `text` is a `400 validation`
156
158
  rather than silently changing the resolution to guidance. A revision object may
157
159
  also carry `ceiling` only to receive the shared `incompatible-answer-options`
158
160
  refusal; a ceiling and spec revision cannot be performed together.
161
+ On a `done` build only `guidance` and `retry` are accepted: they acknowledge its
162
+ open escalations, such as a post-landing integration audit, and return
163
+ `acknowledged: true` while the build stays done. Other variants get
164
+ `409 refusal` with code `inactive`, as does a done build with nothing open.
159
165
  The protocol does not supply ticket-provider credentials. For ticket-origin
160
166
  revision, a trusted caller fetches the current ticket body and supplies it; the
161
167
  build must still have a recorded ticket. Revision conformance, lazy retry,
@@ -368,7 +374,7 @@ The default watch reports actionable conditions only:
368
374
  - `dispatcher.forge-degraded`: the dispatcher's own rate-limit cooldown opened, with its reset; once per episode. Extensions marked `continued` are silent.
369
375
  - `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
370
376
 
371
- - Build `escalation.raised`, `integration.landed`, `node.item-conflicted`,
377
+ - Build `escalation.raised`, `integration.landed`,
372
378
  `target.rewritten` (a node's, once per rejected base; a leaf recovers or escalates),
373
379
  `landing.consent-revoked` (protected merge consent revoked by a reconcile's
374
380
  edits, naming the matched files and both heads),
@@ -376,20 +382,27 @@ The default watch reports actionable conditions only:
376
382
  per head and failing set; build summaries, details and merge-queue entries
377
383
  carry it as `ciFailure` until a CI read finds no failing checks on that
378
384
  head, pending ones included, or the PR moves to another head),
379
- `optimization.noise-exceeded` (an optimization node's ε is below its
380
- measured noise, naming both), or conflicted
381
- `restack.replayed` events. `build.consent-ready` is the single
385
+ or `optimization.noise-exceeded` (an optimization node's ε is below its
386
+ measured noise, naming both). `build.consent-ready` is the single
382
387
  signal for a ready consent or held merge, including first repository-wide
383
388
  discovery. Its target has the queue entry shape `{kind, branch, ticket?, build?}`.
384
389
  Unready and stale candidates stay silent. `build.merge-decision` remains for
385
390
  current actionable merge-gate deferrals, landings awaiting a human merge, and
386
391
  unsafe forge outcomes, once per build/PR; it does not duplicate consent or
387
392
  hold attention.
393
+ - Conflicted `restack.replayed` and `node.item-conflicted` are routine
394
+ (reconcile or generated-file regeneration resolves them). They stay out of
395
+ the default, matching `repository.attention`. Follow them with `--event`.
396
+ An unresolvable conflict arrives as `escalation.raised` (reconcile
397
+ escalation, exhausted `maxReconcileAttempts`, no progress) or
398
+ `landing.consent-revoked`.
388
399
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
389
400
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
390
401
  `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
391
402
  `dispatcher.kernel-git-unavailable`, `forge.credential-limited`, abnormal
392
- `dispatcher.run-stopped`, and `dispatcher.lost`. A `forge.credential-limited`
403
+ `dispatcher.run-stopped`, and `dispatcher.lost`. A one-tick run whose tick
404
+ failed and was reported stops normally, with exit code 1 and the error, so a
405
+ single blip is not attention. A `forge.credential-limited`
393
406
  line names the process whose GitHub request was rate-limited outside the
394
407
  dispatcher's credential (unauthenticated, with why, or on that process's own
395
408
  credential) and its reset; dispatcher forge work continues.
@@ -427,9 +440,12 @@ The default watch reports actionable conditions only:
427
440
  with the episode still open; crossing reset alone is silent. Without a reset,
428
441
  the deadline is 15 minutes after onset. Repeated evidence never postpones
429
442
  the deadline; recovery ends the episode.
430
- - `dispatcher.tick-failure-persistent`: continuously failing completed ticks
431
- for five minutes in one run. A successful tick, new run, or matching stop
432
- ends the episode. Source grace and cooldown-driven failures do not start
443
+ - `dispatcher.tick-failure-persistent`: continuously failing ticks for five
444
+ minutes, across consecutive runs, including one-tick hosted runs. Any
445
+ completed tick ends the episode, as does a clean, abnormal or forced stop of
446
+ the run that last failed. A new run does not, nor does a one-tick run's normal
447
+ stop after its failed tick. The observation keeps the first failure's time and
448
+ names the latest failing run and error. Source grace and cooldown-driven failures do not start
433
449
  this clock; after grace, the first qualifying failure starts a new five-minute
434
450
  interval. Each persistence episode is reported once. Unavailable failure writes delay durable visibility:
435
451
  watch keeps running, warns locally and reports one bounded unreported window
@@ -461,14 +477,19 @@ silently baselines historical direct events and merge decisions, but retains
461
477
  active repository timers. A no-slug watch follows each build announced in the
462
478
  journal after its position from the build's first event; cursors carry
463
479
  creations still in preparation, and a cursor from an earlier release, which
464
- carries none, baselines a build whose creation was selected before it. Reconcile existing conditions through status after
480
+ carries none, baselines a build whose creation was selected before it. A watch retires a terminal, settled build (no pending cleanup, reclaim, open
481
+ execution or integration audit) once its events through settlement are
482
+ delivered: it leaves tracking and every later cursor, so a re-armed cursor
483
+ stays proportional to active builds. Named builds are never retired. Following
484
+ a build reads only events after its position, with no per-poll reduced read. Reconcile existing conditions through status after
465
485
  arming the watch. Named watches still end when every named build is terminal;
466
486
  learn their outcomes from status reconciliation at exit.
467
487
 
468
488
  `ab wait --for attention` is build-only and uses the same build conditions:
469
489
  current failed node verification, an open escalation other than a ticket wait's
470
490
  own, janitor failure attention, a current forge CI failure,
471
- consent readiness, merge/conflict attention or a merge decision. Current failed
491
+ consent readiness, merge attention or a merge decision; `--for
492
+ restack-conflicted` opts into restack conflicts. Current failed
472
493
  verification satisfies attention even before its notification is written. Existing conditions return immediately,
473
494
  even with `--since`; live and backlog matches ignore routine outcomes and
474
495
  self-healing failures. A merge match uses the watch observation with
@@ -504,7 +525,7 @@ waiting on the operator:
504
525
 
505
526
  | Section | Contents |
506
527
  |---|---|
507
- | `escalations` | Open builds with open escalations, as `builds.get` reports them; wait-only builds are excluded |
528
+ | `escalations` | Open builds with open escalations, as `builds.get` reports them; wait-only builds are excluded. Also each `done` build with an open escalation (status `done`), which `builds.answer` acknowledges while the build stays done |
508
529
  | `merges` | The `merges.list` entries, each with its build's PR |
509
530
  | `events` | The `repository.events` attention page after `cursor`: `{items, cursor, hasMore}` |
510
531
  | `waiting` | Builds `paused`, `stalled`, failing node verification (`verification-failed`) or failing forge CI (`ci-failing`), each with a `detail` |
@@ -516,8 +537,10 @@ fixes; the named tool reads the evidence to report. Cursor rules match
516
537
  `repository.events`: an omitted cursor returns no events and a baseline cursor
517
538
  beside every current-state section, and an expired cursor fails with
518
539
  `code: "cursor-too-old"`. The call never waits. Its cost is bounded: one open-build
519
- listing pass, the `repository.status` reads and at most 256 journal positions,
520
- with zero event rows when nothing changed.
540
+ listing pass, the `repository.status` reads, one `doneEscalations` rollup read
541
+ plus a record and saved-facts read per done build with an open escalation, and
542
+ at most 256 journal positions. It grows with open escalations, never with
543
+ history, and reads zero event rows when nothing changed.
521
544
 
522
545
 
523
546
  Hosted ticket tools resolve independent project ticket policy, including its
@@ -839,7 +862,7 @@ permission or retention failures leave deletion pending. Vercel Blob cleanup use
839
862
  the same store identity, token and prefixed pathname as uploads. Missing objects
840
863
  are successful cleanup; provider errors never count as completed deletion.
841
864
 
842
- Paged ticket listings use the source's optional native `listPage(criteria, page)` capability when present, otherwise read the full listing, order it, and slice it: by default urgent tickets first, then normal ones, each in source order; for `newest`, the reversed listing. `newest` means newest filed first, regardless of urgency, with a stable tie-break; it is not the reverse of dispatch order. A source that lists in filing order (file, GitHub, Linear) gets exactly that from the reversed listing. The remote `HostedTicketSource` pages natively through the service's `list-page` operation, and uses the fallback only against a service predating it. Native errors propagate. PostgreSQL counts matches without bodies and reads only the requested window. Zero limits and offsets past the end still report the full matching total. Unpaged listings remain exhaustive; the wire payload is the same for both paths.
865
+ Paged ticket listings use the source's optional native `listPage(criteria, page)` capability when present, otherwise read the full listing, order it, and slice it: by default priority order (urgent, high, normal, then low tickets, each in source order); for `newest`, the reversed listing. `newest` means newest filed first, regardless of priority, with a stable tie-break; it is not the reverse of priority order. A source that lists in filing order (file, GitHub, Linear) gets exactly that from the reversed listing. The remote `HostedTicketSource` pages natively through the service's `list-page` operation, and uses the fallback only against a service predating it. Native errors propagate. PostgreSQL counts matches without bodies and reads only the requested window. Zero limits and offsets past the end still report the full matching total. Unpaged listings remain exhaustive; the wire payload is the same for both paths.
843
866
 
844
867
 
845
868
  ### Forge cooldown admission and explicit recovery
@@ -742,7 +742,7 @@ because a request is open. A node that is paused, blocked, has a pending command
742
742
  conflicted node restack, a landing intent or a merged or closed PR, or is
743
743
  deferred for runtime compatibility gets `optimization.proposal-deferred` with
744
744
  that reason instead, and is reconsidered once a fact that can clear it lands.
745
- The request takes a slot ahead of normal ticket claims, like node reconcile and
745
+ The request takes a slot ahead of ticket claims at the node's level, like node reconcile and
746
746
  verification. Before the session starts, the dispatcher re-checks the request:
747
747
  when the node stopped, the active-hours budget is spent, or room fell below the
748
748
  recorded room, it records `optimization.proposal-withdrawn`, which clears the
@@ -832,11 +832,12 @@ build as an ordinary child.
832
832
  An attempt keeps the ordinary work grammar: plan, plan review, implement, code
833
833
  review, verify and finalize.
834
834
 
835
- An attempt claims at its node's priority. `ab priority <node> urgent` puts
836
- the node's attempts claimed afterwards in the urgent tier; an attempt already
837
- claimed keeps its build's priority. Nothing is reserved: an attempt waits for
838
- a free slot like any ready ticket, preempts nothing, and follows the source's
839
- order within its tier.
835
+ An attempt claims at its node's level, any of `urgent`, `high`, `normal` or
836
+ `low`, whether or not the ticket source stores priority. `ab priority <node>
837
+ high` puts the node's attempts claimed afterwards in the high tier; an attempt
838
+ already claimed keeps its build's level. Nothing is reserved: an attempt waits
839
+ for a free slot like any ready ticket, preempts nothing, and follows the
840
+ source's order within its tier.
840
841
 
841
842
  ### Attempt context
842
843
 
@@ -157,7 +157,9 @@ archive transport refuses a head's archive ref, call it with your trusted Git
157
157
  transport. It keeps the head as a BuildStore copy and resolves to the copy's
158
158
  exclusion base; record the head with that `storeBase` in place of `remoteRef`.
159
159
  It throws when the head cannot be kept; rethrow so release is refused. A
160
- provider that ignores it preserves strictly. A `restoration` head may name
160
+ provider that ignores it preserves strictly. Abort cleanup is the exception:
161
+ when preservation fails, the dispatcher records the commits as lost
162
+ (`workspace.commits-lost`) and releases anyway. A `restoration` head may name
161
163
  `storeBase` instead of `remoteRef`. Then `provision` receives
162
164
  `restoreStored({ exec, workspacePath, sha })`: when the commit is absent, call
163
165
  it with your trusted transport, and fail provisioning when it resolves false.
@@ -248,6 +250,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
248
250
  - **1.9** Optional native ticket-source paging (`listPage`); older sources retain operator slicing.
249
251
  - **1.10** Optional ticket-source ready-assignee capability (`readyAssignee`, with `prepareReadyAssignee`, `readyAssigneeRefusal` and `describeReadyAssignee`); sources without it refuse `[tickets].readyAssignee`. Also optional targeted ticket listing (`listTargeting`); older tree sources are observed through `listAll`.
250
252
  - **1.11** Optional ticket-source search (`search`); callers refuse sources without it and never fall back to a listing.
253
+ - **1.12** Host-provided factory-context `fetch` and `invocationSignal` for bounded-invocation cancellation.
251
254
 
252
255
  ## 2. Create a repository-local module
253
256
 
@@ -293,6 +296,12 @@ Every module default-exports one strict `AutobuildPluginManifest`:
293
296
 
294
297
  Every adapter and contract factory receives `{ config, env, repoRoot }`: read-only `config`, the process `env`, and `repoRoot`, the absolute consuming-repository root.
295
298
 
299
+ Ticket-source, forge and workspace-provider factories also receive `fetch` and `invocationSignal` from a host that provides API 1.12. A bounded dispatcher invocation (the hosted cron) cancels requests at its deadline through them:
300
+
301
+ - **`fetch`** Use it for provider HTTP. Every request is cancelled at the current invocation phase's deadline, together with any `init.signal` you pass; outside a bounded invocation it is plain `fetch`.
302
+ - **`invocationSignal()`** Call it at request time, not at construction, for other transports (SQL clients, subprocesses, SDKs with their own HTTP). It returns `undefined` outside a bounded invocation.
303
+ - An adapter that ignores both still works, but at the deadline its requests are abandoned rather than cancelled.
304
+
296
305
  | Port | `config` |
297
306
  |---|---|
298
307
  | ticket-source | the existing strict `[tickets]` fields; no untyped plugin-options table |
@@ -301,7 +310,7 @@ Every adapter and contract factory receives `{ config, env, repoRoot }`: read-on
301
310
 
302
311
  Workspace-provider factories also receive optional host-derived seams (API 1.7), absent when the call site has none; ignoring them changes nothing.
303
312
 
304
- - **`storeRef`, `delegateCredential`** Store URL and credential-exchange callback; guaranteed when the registration declares `capabilities.storeRequirements`.
313
+ - **`storeRef`, `delegateCredential`** Store URL and credential-exchange callback; guaranteed when the registration declares `capabilities.storeRequirements`. In a bounded invocation the exchange goes through the host `fetch`, so it is cancelled at the deadline too.
305
314
  - **`runtimeReferences`** The host's effective runtime routes.
306
315
  - **`origin`, `remoteBranchHead`** Checkout-less readers; when absent, fall back to host `git` from `repoRoot`.
307
316
 
@@ -551,15 +560,33 @@ compatibility facade refuses any write naming links with
551
560
 
552
561
  ## Optional priority capability
553
562
 
554
- An adapter opts in with `priority: true` and must persist
555
- `priority?: 'urgent' | 'normal'` on create, update and revision-checked update,
556
- return `priority: 'urgent'` on every read of an urgent ticket and omit the field
557
- otherwise, treat `normal` as clearing urgency, and include urgent priority in
558
- revisions. The dispatcher claims urgent ready tickets before normal ones, each in
559
- your listing order, and ahead of normal builds waiting for a slot. Without the
560
- flag, every ticket reads as normal: the compatibility facade refuses a write naming `urgent` with
561
- `TicketPriorityUnsupported` before your methods run, drops a `normal` no-op
562
- (skipping the call when nothing else remains), and strips priority from reads.
563
+ Ticket priority has four levels, highest first: `urgent`, `high`, `normal`
564
+ (the default) and `low`. Declare `priority: true` only if you store all four
565
+ natively. Then you must:
566
+
567
+ - persist `priority?: TicketPriority` on create, update and revision-checked
568
+ update; an update that omits it never changes it
569
+ - return the level on every read, omitting the field for normal
570
+ - include any level other than normal in revisions
571
+
572
+ Without the flag, the compatibility facade stores priority as labels for you:
573
+ `priority:urgent`, `priority:high` or `priority:low`, none for normal. It reads
574
+ them case-insensitively (the highest wins when several are present), reports
575
+ them as `priority` and never in `labels`, keeps them across labels
576
+ replacements, never touches any other label, and refuses label writes,
577
+ criteria and `readyLabels` or `createLabels` entries that name one. If your
578
+ source records the `node` kind as a label rather than natively, declare
579
+ `kindLabel` with that label's name: a kind change written beside a priority
580
+ then adds or removes it. A raw source used outside the facade
581
+ without the flag refuses any level but `normal` with
582
+ `TicketPriorityUnsupported`.
583
+
584
+ The dispatcher claims ready tickets by level, urgent first and low last, each
585
+ level in your listing order and ahead of lower-level builds waiting for a
586
+ slot. The SDK exports `TICKET_PRIORITIES`, `ticketPriority` (absent reads as
587
+ normal), `dispatchPriority` (the level a ticket is claimed at), `byPriority`
588
+ (a stable four-level sort), and, for the label fallback, `priorityLabelSource`,
589
+ `PRIORITY_LABEL_PREFIX` and `priorityLabel`.
563
590
 
564
591
  ## Optional ready assignee capability
565
592
 
@@ -627,18 +654,17 @@ Native paging is an optional API 1.9 ticket-source capability:
627
654
  The SDK exports these types; the result is `TicketListing & { total: number }`.
628
655
  Criteria retain state, labels (AND), and assignee semantics. The page has a
629
656
  nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
630
- and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is the
631
- source's dispatch order: with `priority`, urgent tickets first, then normal
632
- ones, each in listing order. Newest is newest filed first: creation time
633
- descending, regardless of urgency, with a stable tie-break. It is not the
634
- reverse of dispatch order. Offset and limit apply after ordering. Total counts all matches, even
657
+ and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is
658
+ priority order: urgent, high, normal, then low tickets, each in listing order.
659
+ Newest is newest filed first: creation time descending, regardless of
660
+ priority, with a stable tie-break. It is not the reverse of priority order. Offset and limit apply after ordering. Total counts all matches, even
635
661
  with limit zero or an offset past the end. Records, diagnostics and errors
636
662
  match the exhaustive listing. The shared `describeTicketSourceContract` suite
637
663
  automatically compares declared native paging with full-read windows.
638
664
 
639
665
  Only paged operator listings select this capability. Sources without it retain
640
666
  the full-read fallback, which orders the listing before offset and limit: by
641
- default a stable urgent-first partition (urgent, then normal, each in source
667
+ default a stable priority sort (urgent, high, normal, then low, each in source
642
668
  order), or for newest the reversed listing, which is newest filed first for
643
669
  sources that list in filing order (file, GitHub, Linear). Native errors
644
670
  propagate. Unpaged operator listings, CLI ticket lists and dispatcher ready
@@ -658,7 +684,7 @@ errors.
658
684
  | Type | Fields |
659
685
  | --- | --- |
660
686
  | `TicketSearchQuery` | `text`, optional `state`, optional `labels`, `limit`, optional `cursor` |
661
- | `TicketSearchHit` | `id`, `title`, optional `state`, `labels`, `kind`, optional `target` |
687
+ | `TicketSearchHit` | `id`, `title`, optional `state`, `labels`, `kind`, optional `target`, optional `priority` (`TicketPriority`) |
662
688
  | `TicketSearchPage` | `tickets: TicketSearchHit[]`, optional `cursor`, `diagnostics` |
663
689
 
664
690
  - **Matching.** A ticket matches when every whitespace-separated term of
@@ -672,6 +698,8 @@ errors.
672
698
  is source-defined and stable across pages. Reject a malformed or foreign
673
699
  cursor with the SDK's `TicketSearchCursorInvalid(sourceName, cursor)`;
674
700
  callers map it to the `search-cursor-invalid` refusal.
701
+ - **Priority.** Set `priority` on a hit whose ticket is `urgent`, `high` or
702
+ `low`, taken from the search read itself; `normal` may be omitted.
675
703
  - **Cost.** Build each hit from the search read itself, never from a follow-up
676
704
  read per result. A failure rejects; it never falls back to `listAll`.
677
705
 
@@ -362,7 +362,7 @@ Section 7 defines the placeholder and transaction semantics.
362
362
  // every non-success response
363
363
  {
364
364
  "error": "human-readable message",
365
- "kind": "validation" // validation | not-found | auth | conflict | internal
365
+ "kind": "validation" // validation | not-found | auth | conflict | internal | unavailable
366
366
  }
367
367
  ```
368
368
 
@@ -504,14 +504,24 @@ a compatibility gate. A client accepts any value its own finished shape can
504
504
  represent and drops object properties that shape does not know. An invalid envelope
505
505
  or a value the client cannot represent, such as a missing field or an unknown
506
506
  variant, raises `ReducerValueIncompatibilityError`, naming the reducer,
507
- client/server versions and validation detail. Clients send
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 unknown event variant in optional `lastEvent` is omitted, including nested build
512
- state; cursor, progress, and compatibility facts remain canonical. The required
513
- `seenTypes` set retains the event types known to that released reader. Required values
514
- that cannot be represented retain typed incompatibility behavior. The request’s
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 deletes its exact issued
1332
- dispatcher-purpose credential row on success or failure. Its crash-safety expiry
1333
- is the earlier of the configured token TTL and the invocation deadline plus
1334
- 60 seconds. Spawned builds receive independent delegated grants whose authority
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
- Four shipped behaviors do not add `BuildStore` routes:
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.