@defrex/autobuild 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/SPEC.md +423 -57
- package/docs/agent-runtimes.md +1 -1
- package/docs/answering-blocked-builds.md +44 -3
- package/docs/architecture.md +124 -29
- package/docs/cli.md +1 -0
- package/docs/configuration-overview.md +11 -1
- package/docs/configuration.md +334 -14
- package/docs/dispatcher.md +1 -1
- package/docs/forges.md +1 -0
- package/docs/integration-overview.md +2 -2
- package/docs/integration-tree.md +7 -4
- package/docs/merge-policy.md +78 -6
- package/docs/migration-1.0.md +4 -2
- package/docs/operating.md +3 -2
- package/docs/operator-api.md +45 -13
- package/docs/operator-surfaces.md +16 -3
- package/docs/plugin-authoring.md +45 -7
- package/docs/remote-store-protocol.md +28 -7
- package/docs/restacking.md +35 -11
- package/docs/ticket-dependencies.md +9 -4
- package/docs/ticket-sources.md +34 -6
- package/docs/tickets.md +7 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/workspaces.md +1 -1
- package/package.json +3 -3
- package/packages/core/src/cli/attention.ts +2 -0
- package/packages/core/src/cli/binary-direct.ts +1 -0
- package/packages/core/src/cli/build-control.ts +65 -7
- package/packages/core/src/cli/context.ts +55 -14
- package/packages/core/src/cli/dashboard/actions.ts +13 -4
- package/packages/core/src/cli/dashboard/landing-display.ts +32 -8
- package/packages/core/src/cli/dashboard/model.ts +61 -8
- package/packages/core/src/cli/dashboard/render.ts +28 -3
- package/packages/core/src/cli/dashboard/tree.ts +9 -1
- package/packages/core/src/cli/dispatch-frontend.ts +10 -14
- package/packages/core/src/cli/dispatch-preflight.ts +1 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +145 -109
- package/packages/core/src/cli/dispatch.ts +9 -3
- package/packages/core/src/cli/help.ts +80 -11
- package/packages/core/src/cli/init-validation.ts +14 -1
- package/packages/core/src/cli/landings.ts +1 -1
- package/packages/core/src/cli/main.ts +60 -9
- package/packages/core/src/cli/publication-settlement.ts +10 -0
- package/packages/core/src/cli/repository-status.ts +37 -2
- package/packages/core/src/cli/status.ts +186 -12
- package/packages/core/src/cli/terminals.ts +197 -4
- package/packages/core/src/cli/ticket.ts +22 -4
- package/packages/core/src/cli/wait.ts +1 -0
- package/packages/core/src/cli/watch.ts +73 -0
- package/packages/core/src/config/landing.ts +12 -0
- package/packages/core/src/config/live.ts +4 -0
- package/packages/core/src/config/path-selectors.ts +68 -0
- package/packages/core/src/config/profiles.ts +96 -0
- package/packages/core/src/config/ready-assignee.ts +43 -11
- package/packages/core/src/config/roles.ts +33 -10
- package/packages/core/src/config/schema.ts +205 -81
- package/packages/core/src/events/catalog.ts +17 -3
- package/packages/core/src/events/compatibility.ts +4 -1
- package/packages/core/src/events/forge-degradation-policy.ts +16 -2
- package/packages/core/src/events/head-paths-limits.ts +25 -0
- package/packages/core/src/events/payloads.ts +323 -20
- package/packages/core/src/events/policy.ts +22 -0
- package/packages/core/src/events/repository.ts +47 -1
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +320 -130
- package/packages/core/src/kernel/build-creation.ts +29 -0
- package/packages/core/src/kernel/consent-revocation.ts +72 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +19 -8
- package/packages/core/src/kernel/engine.ts +48 -8
- package/packages/core/src/kernel/forge-health.ts +47 -0
- package/packages/core/src/kernel/guarded-forge.ts +76 -18
- package/packages/core/src/kernel/head-paths-state.ts +63 -0
- package/packages/core/src/kernel/head-paths.ts +401 -0
- package/packages/core/src/kernel/landing-policy-identity.ts +20 -0
- package/packages/core/src/kernel/landing-policy.ts +55 -2
- package/packages/core/src/kernel/landing-readiness.ts +104 -9
- package/packages/core/src/kernel/landing-state.ts +44 -4
- package/packages/core/src/kernel/leaf-restack-state.ts +50 -2
- package/packages/core/src/kernel/log-index.ts +27 -1
- package/packages/core/src/kernel/node-parent.ts +2 -0
- package/packages/core/src/kernel/node-polling.ts +13 -3
- package/packages/core/src/kernel/node-restack-state.ts +8 -1
- package/packages/core/src/kernel/node-restack-transaction.ts +45 -0
- package/packages/core/src/kernel/read-deferrals.ts +3 -1
- package/packages/core/src/kernel/read-facts.ts +37 -2
- package/packages/core/src/kernel/reducer-registry.ts +22 -1
- package/packages/core/src/kernel/reducer.ts +332 -16
- package/packages/core/src/kernel/target-observation.ts +2 -5
- package/packages/core/src/kernel/terminal-guard.ts +52 -3
- package/packages/core/src/kernel/ticket-handbacks.ts +40 -0
- package/packages/core/src/kernel/ticket-preparation.ts +15 -1
- package/packages/core/src/kernel/ticket-wait.ts +345 -0
- package/packages/core/src/kernel/verify-applicability.ts +9 -19
- package/packages/core/src/ontology.ts +1 -0
- package/packages/core/src/operator/annotations.ts +6 -0
- package/packages/core/src/operator/index.ts +3 -0
- package/packages/core/src/operator/protocol.ts +25 -2
- package/packages/core/src/operator/query.ts +1 -1
- package/packages/core/src/operator/registry.ts +122 -10
- package/packages/core/src/operator/repository-events.ts +67 -0
- package/packages/core/src/operator/sandbox-host.ts +3 -0
- package/packages/core/src/operator/tickets.ts +15 -3
- package/packages/core/src/plugin-sdk/index.ts +4 -0
- package/packages/core/src/ports/forge/create.ts +6 -0
- package/packages/core/src/ports/forge/github-transport.ts +40 -3
- package/packages/core/src/ports/forge/github.ts +12 -1
- package/packages/core/src/ports/forge/workspace-ancestry.ts +60 -0
- package/packages/core/src/ports/forge-failure.ts +31 -2
- package/packages/core/src/ports/runner/routing.ts +66 -5
- package/packages/core/src/ports/tickets/assignees.ts +54 -0
- package/packages/core/src/ports/tickets/contract.ts +164 -4
- package/packages/core/src/ports/tickets/create.ts +17 -3
- package/packages/core/src/ports/tickets/fake.ts +5 -0
- package/packages/core/src/ports/tickets/github-fake.ts +18 -2
- package/packages/core/src/ports/tickets/github.ts +247 -29
- package/packages/core/src/ports/tickets/hosted-index.ts +1 -0
- package/packages/core/src/ports/tickets/operations.ts +6 -1
- package/packages/core/src/ports/tickets/tree.ts +12 -2
- package/packages/core/src/ports/tickets/update.ts +6 -2
- package/packages/core/src/ports/types.ts +36 -5
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +9 -0
- package/packages/core/src/processes/build-child.ts +28 -7
- package/packages/core/src/processes/build-execution-state.ts +34 -2
- package/packages/core/src/processes/build-runner.ts +165 -19
- package/packages/core/src/processes/dispatcher.ts +837 -115
- package/packages/core/src/processes/execution-no-progress.ts +22 -2
- package/packages/core/src/processes/harvest-child.ts +4 -0
- package/packages/core/src/processes/harvest-runner.ts +5 -0
- package/packages/core/src/processes/phase-failure-budget.ts +1 -0
- package/packages/core/src/processes/publication-state.ts +6 -1
- package/packages/core/src/processes/repo-view.ts +2 -0
- package/packages/core/src/scenarios/harness.ts +15 -1
- package/packages/core/src/store/digest.ts +41 -2
- package/packages/core/src/store/reduced-reads.ts +4 -1
- package/packages/core/src/store/reducer-value-shapes.json +10310 -8441
- package/packages/core/src/store/remote/client.ts +49 -10
- package/packages/core/src/store/remote/index.ts +4 -0
- package/packages/core/src/store/remote/protocol.ts +18 -1
- package/packages/core/src/store/remote/released-clients.json +22 -0
- package/packages/core/src/store/remote/released-reducer-values/1.7.0.json +27366 -0
- package/packages/core/src/store/remote/released-reducer-values/1.8.0.json +29043 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +4 -0
- package/packages/core/src/store/repo-state-events.ts +3 -0
- package/packages/core/src/store/types.ts +27 -0
- package/packages/core/src/testing/dispatch-read-budget.ts +84 -58
- package/packages/core/src/testing/index.ts +2 -0
- package/packages/core/src/testing/reduced-read-budget.ts +419 -9
- package/skills/code-review/SKILL.md +8 -0
- package/skills/finalize/SKILL.md +4 -0
- package/skills/guide/SKILL.md +241 -47
- package/skills/guide/references/integration-tree.md +7 -4
- package/skills/guide/references/merge-policy.md +78 -6
- package/skills/guide/references/migration-1.0.md +4 -2
- package/skills/guide/references/operator-api.md +45 -13
- package/skills/guide/references/plugin-authoring.md +45 -7
- package/skills/guide/references/remote-store-protocol.md +28 -7
- package/skills/guide/references/restacking.md +35 -11
- package/skills/guide/references/ticket-dependencies.md +9 -4
- package/skills/implement/SKILL.md +15 -1
- package/skills/operate/SKILL.md +133 -16
- package/skills/plan/SKILL.md +17 -2
- package/skills/plan-review/SKILL.md +8 -0
- package/skills/reconcile/SKILL.md +21 -5
- package/skills/tickets/SKILL.md +23 -6
- package/templates/hosted-service/package.json +2 -2
|
@@ -9,24 +9,64 @@ predicates are ANDed, omissions are wildcards, and the first match wins.
|
|
|
9
9
|
| `from` | `leaf` or `node` |
|
|
10
10
|
| `into` | `root`, any `node`, or an exact destination node ticket id |
|
|
11
11
|
| `label` | An exact, case-sensitive source ticket label |
|
|
12
|
+
| `paths` | At least one changed path matches a selector |
|
|
13
|
+
| `within` | Every changed path matches a selector, and at least one path changed |
|
|
12
14
|
|
|
13
15
|
Blank destinations and labels are invalid. With no match, leaves use auto and
|
|
14
16
|
nodes consent. Destination means the frozen effective destination, not mutable
|
|
15
17
|
source metadata. Successful source reads supply labels at readiness; unavailable
|
|
16
18
|
data defers the decision rather than pretending labels are empty.
|
|
17
19
|
|
|
20
|
+
### Changed paths
|
|
21
|
+
|
|
22
|
+
`paths` and `within` take the same selectors as `[verify.<step>].paths`:
|
|
23
|
+
positive, repository-relative, case-sensitive globs with `*`, `?` and
|
|
24
|
+
whole-segment `**`. An invalid selector is rejected when the configuration
|
|
25
|
+
loads, naming its rule, such as `merge[1].paths[0]`. The changed paths are the
|
|
26
|
+
ones the candidate head changes against its merge base with the destination,
|
|
27
|
+
as the build recorded when it produced that head. A rename counts both paths
|
|
28
|
+
and a deletion counts its path. Each candidate head is decided on its own
|
|
29
|
+
paths, and `landing.decided` records the paths the matched rule's selectors
|
|
30
|
+
matched: the first 20, sorted, with a total.
|
|
31
|
+
|
|
32
|
+
Evaluation never guesses a change. When it reaches a rule with a path
|
|
33
|
+
predicate and the candidate head's paths are not recorded, the decision is
|
|
34
|
+
deferred, recorded once and shown in `ab build status`; it is never evaluated
|
|
35
|
+
as an empty change. Only heads a build publishes are recorded, so a head
|
|
36
|
+
pushed to the branch outside a build stays deferred until the build publishes
|
|
37
|
+
a recorded head. A recorded empty change matches neither predicate. Rules
|
|
38
|
+
without path predicates decide without the fact.
|
|
39
|
+
|
|
40
|
+
First match still wins, so **protective rules belong first**: put a `paths`
|
|
41
|
+
rule that holds sensitive files ahead of any `within` rule that releases the
|
|
42
|
+
rest. See [Protected paths](#protected-paths).
|
|
43
|
+
|
|
18
44
|
A leaf is ready after verification and finalize on a current base; a node must
|
|
19
45
|
be complete and verified at its exact head and parent. `landing.decided` retains
|
|
20
46
|
that candidate, labels, mode and the full matched rule/index or explicit default.
|
|
21
47
|
Editing configuration does not revise that decision. A replacement candidate
|
|
22
|
-
gets a fresh decision
|
|
23
|
-
|
|
48
|
+
gets a fresh decision, evaluated on its own changed paths, and that decision
|
|
49
|
+
governs. A reconcile or restack head can therefore match a different rule: a
|
|
50
|
+
documentation change that merged automatically waits for consent once its new
|
|
51
|
+
head touches a protected file. Native auto-merge armed under the old decision
|
|
52
|
+
is cancelled before the new head is published. Policy is live dispatcher
|
|
53
|
+
configuration, separate from the pinned execution pipeline.
|
|
24
54
|
|
|
25
55
|
`ab hold <slug>` suppresses merge and revokes consent, even before readiness.
|
|
26
56
|
`ab merge <slug>` requires readiness, clears hold and consents to this merge
|
|
27
|
-
into its destination. Consent survives head replacement, restacking,
|
|
28
|
-
and re-finalization until hold or completion; it approves the merge
|
|
29
|
-
an immutable diff.
|
|
57
|
+
into its destination. Consent survives head replacement, clean restacking,
|
|
58
|
+
verification and re-finalization until hold or completion; it approves the merge
|
|
59
|
+
rather than an immutable diff. Consent given under a rule with `paths` or
|
|
60
|
+
`within` predicates is revoked when a reconcile's own edits (its recorded
|
|
61
|
+
resolution) touch a file those predicates match: `landing.consent-revoked`
|
|
62
|
+
raises default attention naming the files and both heads, and the build returns
|
|
63
|
+
to the consent queue for its new head. Accepted node reparenting also revokes
|
|
64
|
+
consent.
|
|
65
|
+
`ab merge <slug> --head <sha>` binds consent to the head the reviewer saw: it
|
|
66
|
+
refuses with `head-mismatch`, recording nothing, unless `<sha>` (full or at
|
|
67
|
+
least seven characters) is the current candidate head. Build status and the
|
|
68
|
+
consent queue show the current candidate head beside the head consent was
|
|
69
|
+
given at; `--head` does not change survival. Commands and receipts
|
|
30
70
|
are sequence-correlated: hold acknowledgement confirms native cancellation;
|
|
31
71
|
merge acknowledgement does not claim gates passed. MCP/operator tools offer the
|
|
32
72
|
same actions; the terminal uses `l`/`o`. These controls record durable actions; merge consent does not mean the merge gates have passed.
|
|
@@ -99,6 +139,38 @@ other leaves match rule 3. `Review` does not match `review`. Moving the catch-al
|
|
|
99
139
|
to the front would shadow both safeguards and automatically authorize nodes too.
|
|
100
140
|
Authorization never bypasses verification, checks, protection or merge gates.
|
|
101
141
|
|
|
142
|
+
### Protected paths
|
|
143
|
+
|
|
144
|
+
```toml
|
|
145
|
+
baseBranch = "main"
|
|
146
|
+
|
|
147
|
+
[[merge]]
|
|
148
|
+
paths = ["autobuild.toml", ".agents/**", "SPEC.md", "docs/policy/**"]
|
|
149
|
+
mode = "consent"
|
|
150
|
+
|
|
151
|
+
[[merge]]
|
|
152
|
+
within = ["docs/**", "README.md"]
|
|
153
|
+
mode = "auto"
|
|
154
|
+
|
|
155
|
+
[[merge]]
|
|
156
|
+
mode = "consent"
|
|
157
|
+
|
|
158
|
+
[tickets]
|
|
159
|
+
source = "file"
|
|
160
|
+
readyState = "ready"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Rule 1 holds any change that touches a protected file, whatever else it
|
|
164
|
+
changes. Rule 2 merges changes confined to documentation automatically. Every
|
|
165
|
+
other change matches rule 3 and waits for consent. Protective rules belong
|
|
166
|
+
first: placed after rule 2, a documentation change under `docs/policy/**` would
|
|
167
|
+
match rule 2 and merge automatically.
|
|
168
|
+
|
|
169
|
+
Consent given under rule 1 lasts only while the reviewed protected change does.
|
|
170
|
+
A clean restack keeps it, and so does a reconcile that resolves conflicts
|
|
171
|
+
without editing a protected file. A reconcile whose resolution edits a protected
|
|
172
|
+
file revokes it, and the new head needs fresh consent.
|
|
173
|
+
|
|
102
174
|
## Merge methods
|
|
103
175
|
|
|
104
176
|
Root-target leaves squash into one identity-bearing commit per build.
|
|
@@ -192,5 +264,5 @@ unsupported spellings require the reported manual edit before retrying.
|
|
|
192
264
|
|
|
193
265
|
MCP discovery offers `merges.list` and its deprecated alias `landings.list`.
|
|
194
266
|
`builds.control` accepts canonical `merge` and deprecated `land` actions through
|
|
195
|
-
both MCP bindings
|
|
267
|
+
both MCP bindings, with an optional `head` that binds consent like `--head`. HTTP control bodies and durable event fields retain their
|
|
196
268
|
existing wire names, including `land`, `landing.decided`, and `integration.landed`.
|
|
@@ -52,8 +52,10 @@ Execution pipeline configuration stays owned by the build and is re-pinned
|
|
|
52
52
|
from its checkout at each verify cycle; live dispatcher
|
|
53
53
|
merge policy is separate. A recorded readiness decision retains its rule
|
|
54
54
|
snapshot despite configuration edits; a new candidate receives a new decision.
|
|
55
|
-
Explicit consent persists through replay and re-verification until hold
|
|
56
|
-
completion, except accepted node reparenting revokes it
|
|
55
|
+
Explicit consent persists through clean replay and re-verification until hold
|
|
56
|
+
or completion, except accepted node reparenting revokes it, and a reconcile
|
|
57
|
+
whose own edits touch files protected by the consent rule's `paths` or `within`
|
|
58
|
+
predicates revokes it.
|
|
57
59
|
|
|
58
60
|
## The reversed rebase ban
|
|
59
61
|
|
|
@@ -88,7 +88,7 @@ raw session-event append. External operator harnesses own agent execution.
|
|
|
88
88
|
| `GET …/status` | Repository intake, pause, and default-auto-merge projection. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
|
|
89
89
|
| `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
|
|
90
90
|
| `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); `total` counts every match before paging. |
|
|
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. |
|
|
92
92
|
| `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
|
|
93
93
|
| `GET …/tickets/{id}` | `{ticket,blockers,build}`. Blockers include native `exists`/`resolved` status; `build` prefers an active matching repository build, otherwise the most recently updated one. |
|
|
94
94
|
|
|
@@ -124,7 +124,7 @@ JSON bodies are strict: unknown fields are rejected.
|
|
|
124
124
|
|
|
125
125
|
| Method and path | Body |
|
|
126
126
|
|---|---|
|
|
127
|
-
| `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"}` |
|
|
127
|
+
| `POST …/builds/{slug}/control` | `{"action":"pause"\|"cancel-pause"\|"resume"\|"abort"\|"discard"\|"land"\|"hold"}`; `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. 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. |
|
|
128
128
|
| `POST …/builds/{slug}/restack` | Empty body; durable node restack demand. |
|
|
129
129
|
| `POST …/builds/{slug}/answer` | One answer variant described below. |
|
|
130
130
|
| `PUT …/settings/intake` | `{"enabled":boolean}` |
|
|
@@ -132,8 +132,8 @@ JSON bodies are strict: unknown fields are rejected.
|
|
|
132
132
|
| `POST …/bulk-control` | `{"action":"pause"\|"resume"}`. The hold fact, intake fact, then eligible build events are written in that order. |
|
|
133
133
|
| `POST …/harvest/control` | `{"action":"toggle-gate"}` or `{"action":"run","run":"…"}`. A run action is bound to that concrete projected run. |
|
|
134
134
|
| `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","kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`,
|
|
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), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
|
|
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). `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
137
|
| `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
138
|
| `POST …/tickets/{id}/block` | `{"blockerIds":["…"]}`. |
|
|
139
139
|
| `POST …/tickets/{id}/unblock` | `{"blockerIds":["…"]}`. |
|
|
@@ -225,7 +225,9 @@ refusal` and preserve the shared `BuildControlError` code and exact reason text.
|
|
|
225
225
|
A `land` control whose merge candidate is not ready is refused with code
|
|
226
226
|
`merge-not-ready`, and its reason names the unmet condition; a node that fails
|
|
227
227
|
the live completeness check is refused with code `node-incomplete`, naming any
|
|
228
|
-
open children.
|
|
228
|
+
open children. A `land` whose `head` is not the current candidate head is
|
|
229
|
+
refused with code `head-mismatch`, and its reason names the current head.
|
|
230
|
+
None of these records consent or starts a merge, so refresh the
|
|
229
231
|
build's status and retry once the reason is resolved.
|
|
230
232
|
A partial bulk failure uses code `bulk-partial` and includes the durable write
|
|
231
233
|
progress and unattempted builds. Unexpected failures are `500 internal`.
|
|
@@ -288,8 +290,10 @@ The default watch reports actionable conditions only:
|
|
|
288
290
|
- `build.janitor-escalated`: a build's janitor failure episode outlasted `policy.janitorFailureEscalationSeconds` and raised one escalation naming the operation, last error, attempt count and episode start. The janitor keeps retrying; a successful attempt closes the escalation, and a bare retry answer attempts on the next tick.
|
|
289
291
|
- `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
|
|
290
292
|
|
|
291
|
-
- Build `escalation.raised`, `integration.landed`, `node.item-conflicted`, `target.rewritten`,
|
|
292
|
-
|
|
293
|
+
- Build `escalation.raised`, `integration.landed`, `node.item-conflicted`, `target.rewritten`,
|
|
294
|
+
`landing.consent-revoked` (protected merge consent revoked by a reconcile's
|
|
295
|
+
edits, naming the matched files and both heads), or conflicted
|
|
296
|
+
`restack.replayed` events. `build.consent-ready` is the single
|
|
293
297
|
signal for a ready consent or held merge, including first repository-wide
|
|
294
298
|
discovery. Its target has the queue entry shape `{kind, branch, ticket?, build?}`.
|
|
295
299
|
Unready and stale candidates stay silent. `build.merge-decision` remains for
|
|
@@ -298,7 +302,11 @@ The default watch reports actionable conditions only:
|
|
|
298
302
|
- Repository `harvest.escalated`, `harvest.recovery-exhausted`,
|
|
299
303
|
`dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
|
|
300
304
|
`restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
|
|
301
|
-
`dispatcher.kernel-git-unavailable`,
|
|
305
|
+
`dispatcher.kernel-git-unavailable`, `forge.credential-limited`, abnormal
|
|
306
|
+
`dispatcher.run-stopped`, and `dispatcher.lost`. A `forge.credential-limited`
|
|
307
|
+
line names the process whose GitHub request was rate-limited outside the
|
|
308
|
+
dispatcher's credential (unauthenticated, with why, or on that process's own
|
|
309
|
+
credential) and its reset; dispatcher forge work continues.
|
|
302
310
|
- Repository `ticket-preparation.resolved` with outcome `abandoned`: automatic
|
|
303
311
|
preparation recovery stopped and left the ticket unchanged. The line names the
|
|
304
312
|
ticket, attempt and recorded reason; the payload's `claimed` says whether the
|
|
@@ -306,6 +314,12 @@ The default watch reports actionable conditions only:
|
|
|
306
314
|
events written before `claimed` existed report the certainty as not recorded.
|
|
307
315
|
Each abandonment reports once as it lands; a fresh watch does not replay
|
|
308
316
|
historical ones, and nothing clears or acknowledges it.
|
|
317
|
+
- Repository `ticket.handed-back`: a claimed or ready ticket was returned other
|
|
318
|
+
than as completion (`cause` `abort`, `spec-bounce`, `preparation-failed`,
|
|
319
|
+
`pr-closed` or `discard`), with its destination `state` and `role`, the build
|
|
320
|
+
or preparation attempt, and any `requested` role, `missing` spec parts and
|
|
321
|
+
`reason`. It is appended once, only after the move is committed, so moving
|
|
322
|
+
the ticket on receipt is never overridden.
|
|
309
323
|
- `dispatcher.ticket-source-persistent`: degradation past its advertised
|
|
310
324
|
reset time, once a tick started at or after reset has completed or failed
|
|
311
325
|
with the episode still open; crossing reset alone is silent. Without a reset,
|
|
@@ -367,6 +381,15 @@ complete history without omission. Waiting remains bounded and applies only
|
|
|
367
381
|
when no events are available. Repository event reads have a 1,000-position
|
|
368
382
|
window; build history itself remains available through explicit pages.
|
|
369
383
|
|
|
384
|
+
The MCP `repository.events` tool delivers the same repository attention to a
|
|
385
|
+
connected agent. It takes `{repo, cursor?, waitSeconds?, filter?}` and returns
|
|
386
|
+
`{events, cursor, hasMore}`: one bounded read of at most 256 journal positions
|
|
387
|
+
after `cursor`, filtered by default (`filter: "attention"`) to exactly the
|
|
388
|
+
repository records the CLI default watch reports, or every event with
|
|
389
|
+
`filter: "all"`. The returned cursor is the last scanned position, so it
|
|
390
|
+
advances past filtered events. Omitting `cursor` returns no events and a
|
|
391
|
+
baseline cursor; an expired cursor fails with `code: "cursor-too-old"`.
|
|
392
|
+
|
|
370
393
|
|
|
371
394
|
Hosted ticket tools resolve independent project ticket policy, including its
|
|
372
395
|
backlog and rejected roles for role moves, before legacy uploaded configuration. Queue, detail, state discovery and mutations work before any build
|
|
@@ -385,7 +408,9 @@ to CLI, HTTP and MCP alike; unsupported sources refuse even explicit defaults
|
|
|
385
408
|
or clears before changing other fields. Dispatch routing is unchanged.
|
|
386
409
|
|
|
387
410
|
HTTP merge controls retain the wire actions `land` and `hold` with acknowledged durable state. Merge
|
|
388
|
-
requires readiness and survives restacks
|
|
411
|
+
requires readiness and survives clean restacks, except that a reconcile editing
|
|
412
|
+
files protected by the consent rule's `paths` or `within` predicates revokes it;
|
|
413
|
+
hold persists until merge. Repository
|
|
389
414
|
auto-merge settings are retired; configure ordered `[[merge]]` rules.
|
|
390
415
|
|
|
391
416
|
Default attention includes `build.janitor-failing`, `build.janitor-escalated` and
|
|
@@ -395,6 +420,10 @@ Active janitor attention and an open janitor escalation clear on a successful
|
|
|
395
420
|
attempt. Repository status
|
|
396
421
|
includes forge degradation/reset and available request counts; `dispatcher.forge-persistent` requires a completed retry opportunity past
|
|
397
422
|
the original reset, which later rate limits cannot postpone indefinitely.
|
|
423
|
+
Only the dispatcher's own classified limits record that degradation. Status
|
|
424
|
+
also lists active `forgeCredentialLimits`: limits on unauthenticated requests or
|
|
425
|
+
seen by build runners and phase sessions, each naming the process, which never
|
|
426
|
+
pause repository forge work.
|
|
398
427
|
|
|
399
428
|
### Node restack request
|
|
400
429
|
|
|
@@ -580,20 +609,23 @@ permission or retention failures leave deletion pending. Vercel Blob cleanup use
|
|
|
580
609
|
the same store identity, token and prefixed pathname as uploads. Missing objects
|
|
581
610
|
are successful cleanup; provider errors never count as completed deletion.
|
|
582
611
|
|
|
583
|
-
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 source order. 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.
|
|
612
|
+
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` is the exception: the hosted list-ready protocol returns urgent tickets first and carries no filing time, so its fallback `newest` pages are reversed dispatch order whenever urgent tickets exist. 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.
|
|
584
613
|
|
|
585
614
|
|
|
586
615
|
### Forge cooldown admission and explicit recovery
|
|
587
616
|
|
|
588
617
|
Hosted repository event appends and atomic artifact deposits validate
|
|
589
|
-
`dispatcher.forge-degraded` before any durable
|
|
590
|
-
its event schema, with a finite ISO `resetAt` at most 24 hours after server time
|
|
618
|
+
`dispatcher.forge-degraded` and `forge.credential-limited` before any durable
|
|
619
|
+
mutation. The payload must match its event schema, with a finite ISO `resetAt` at most 24 hours after server time
|
|
591
620
|
(inclusive). Already-expired deadlines are accepted. Invalid or out-of-horizon
|
|
592
621
|
writes return `400 validation` (the remote adapter exposes `EventValidationError`);
|
|
593
622
|
the server never clamps or invents a provider reset. Historical decoding has no clock-relative restriction.
|
|
594
623
|
|
|
595
624
|
Build-runner and build-phase grants may POST only the kernel-authored
|
|
596
|
-
`dispatcher.forge-degraded` repository
|
|
625
|
+
`forge.credential-limited` and `dispatcher.forge-degraded` repository facts
|
|
626
|
+
through the events route. Current runners and phase sessions record only
|
|
627
|
+
`forge.credential-limited` attention; the `dispatcher.forge-degraded` exception
|
|
628
|
+
remains for runners pinned to older releases. The
|
|
597
629
|
preceding `requireProject` check binds this exception to the exact repository
|
|
598
630
|
in the delegated claim. A hosted project identifies one repository. Delegates
|
|
599
631
|
cannot write recovery, deposits or other repository facts, regardless of the
|
|
@@ -31,7 +31,7 @@ All four manifest maps have production selectors. Omitted forge and workspace se
|
|
|
31
31
|
|
|
32
32
|
### `ticket-source`
|
|
33
33
|
|
|
34
|
-
Lists, gets and claims tickets to start builds; receives comments, transitions, creates and updates. Owns lifecycle names, dependency completion, idempotent creation with a stable external creation-key projection, and partial-list diagnostics.
|
|
34
|
+
Lists, gets and claims tickets to start builds; receives comments, transitions, creates and updates. Owns lifecycle names, dependency completion, idempotent creation with a stable external creation-key projection, and partial-list diagnostics. A build never consults it mid-build. The dispatcher reads tickets and adds blockers to validate a declared ticket wait, and while any ticket wait is open it makes one batched `dependencyStates` read per tick to release waits whose tickets completed and escalate waits on rejected or deleted tickets. Not artifact storage.
|
|
35
35
|
|
|
36
36
|
### `agent-runtime`
|
|
37
37
|
|
|
@@ -158,6 +158,9 @@ API 1.8 adds optional forge failure classification. Import `ForgeFailure` and `i
|
|
|
158
158
|
```ts
|
|
159
159
|
// Rate limit, with a valid ISO reset timestamp:
|
|
160
160
|
throw new ForgeFailure(message, { kind: 'rate-limited', resetAt })
|
|
161
|
+
// The limited request carried no credential: say why, so the limit stays local
|
|
162
|
+
// to the caller instead of pausing the repository:
|
|
163
|
+
throw new ForgeFailure(message, { kind: 'rate-limited', resetAt, unauthenticated: reason })
|
|
161
164
|
// Retryable transport error:
|
|
162
165
|
throw new ForgeFailure(message, { kind: 'transient', retry: 'retryable' })
|
|
163
166
|
```
|
|
@@ -537,10 +540,12 @@ refuse a configured `readyAssignee` with an error naming the source and plugin.
|
|
|
537
540
|
Three optional methods support it:
|
|
538
541
|
|
|
539
542
|
- `prepareReadyAssignee(): Promise<void>` is called once at dispatcher startup,
|
|
540
|
-
before the loop and never in a tick, whether or not `readyAssignee`
|
|
543
|
+
before the loop and never in a tick, whether or not `readyAssignee` or
|
|
544
|
+
`createAssignee` is set.
|
|
541
545
|
Resolve whatever `"me"` needs and memoize it. A credential with no user is a
|
|
542
546
|
recorded result, not a throw; throw only for infrastructure failures, which
|
|
543
|
-
fail startup when `readyAssignee` is set and are
|
|
547
|
+
fail startup when `readyAssignee` or `createAssignee` is set and are
|
|
548
|
+
otherwise a warning.
|
|
544
549
|
- `readyAssigneeRefusal(value): string | undefined` is synchronous and makes no
|
|
545
550
|
request. Return why the value can't be honoured from what was prepared, or
|
|
546
551
|
`undefined`. Startup and every reload call it, so a refused reload keeps the
|
|
@@ -549,6 +554,29 @@ Three optional methods support it:
|
|
|
549
554
|
return a one-line summary of who the value names, such as `me → @octocat`,
|
|
550
555
|
or throw an error that says how to fix a value that names nobody.
|
|
551
556
|
|
|
557
|
+
## Optional assignees capability
|
|
558
|
+
|
|
559
|
+
An adapter opts in with `assignees: true` and must then accept
|
|
560
|
+
`assignees?: string[]` on create, update and revision-checked update, where
|
|
561
|
+
each entry is a username or `me` (the owner of the source's credential) and an
|
|
562
|
+
update replaces the whole set, `[]` clearing it. Return `assignees` on every
|
|
563
|
+
read, `[]` when unassigned, and leave it out of revisions. Check each user
|
|
564
|
+
before any write and refuse, writing nothing, when one can't be assigned. A
|
|
565
|
+
write the provider accepts without the requested assignees must fail rather
|
|
566
|
+
than report success, and a retried keyed create that adopts an existing ticket
|
|
567
|
+
must leave it with the requested assignees. Without the flag, the
|
|
568
|
+
compatibility facade refuses any write naming assignees, including `[]`, with
|
|
569
|
+
`TicketAssigneesUnsupported` before your methods run, strips them from reads,
|
|
570
|
+
and dispatcher startup, `ab init --validate` and live reloads refuse a
|
|
571
|
+
configured `[tickets].createAssignee`, naming the source and plugin.
|
|
572
|
+
|
|
573
|
+
Callers apply `createAssignee` themselves, so a draft's assignees are always
|
|
574
|
+
exact. To support it, implement `createAssigneeRefusal(value)`, synchronous
|
|
575
|
+
and request-free like `readyAssigneeRefusal`, and
|
|
576
|
+
`describeCreateAssignee(value)` for `ab init --validate`. `"me"` should reuse
|
|
577
|
+
what `prepareReadyAssignee` resolved, so a dispatcher never resolves it in a
|
|
578
|
+
tick.
|
|
579
|
+
|
|
552
580
|
## Optional ticket paging capability
|
|
553
581
|
|
|
554
582
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
@@ -556,8 +584,11 @@ Native paging is an optional API 1.9 ticket-source capability:
|
|
|
556
584
|
The SDK exports these types; the result is `TicketListing & { total: number }`.
|
|
557
585
|
Criteria retain state, labels (AND), and assignee semantics. The page has a
|
|
558
586
|
nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
|
|
559
|
-
and optional `order: 'oldest' | 'newest'` (default oldest).
|
|
560
|
-
|
|
587
|
+
and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is the
|
|
588
|
+
source's dispatch order: with `priority`, urgent tickets first, then normal
|
|
589
|
+
ones, each in listing order. Newest is newest filed first: creation time
|
|
590
|
+
descending, regardless of urgency, with a stable tie-break. It is not the
|
|
591
|
+
reverse of dispatch order. Offset and limit apply after ordering. Total counts all matches, even
|
|
561
592
|
with limit zero or an offset past the end. Records, diagnostics and errors
|
|
562
593
|
match the exhaustive listing. The shared `describeTicketSourceContract` suite
|
|
563
594
|
automatically compares declared native paging with full-read windows.
|
|
@@ -565,7 +596,12 @@ automatically compares declared native paging with full-read windows.
|
|
|
565
596
|
Only paged operator listings select this capability. Sources without it retain
|
|
566
597
|
the full-read fallback, which orders the listing before offset and limit: by
|
|
567
598
|
default a stable urgent-first partition (urgent, then normal, each in source
|
|
568
|
-
order), or for newest the reversed
|
|
599
|
+
order), or for newest the reversed listing, which is newest filed first for
|
|
600
|
+
sources that list in filing order (file, GitHub, Linear). The remote
|
|
601
|
+
`HostedTicketSource` is the exception: the hosted list-ready protocol returns
|
|
602
|
+
urgent tickets first and carries no filing time, so the client cannot see
|
|
603
|
+
filing order, and its newest pages are reversed dispatch order whenever urgent
|
|
604
|
+
tickets exist. Native errors propagate. Unpaged operator
|
|
569
605
|
listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
|
|
570
606
|
`listReady`/`listAll`. The hosted PostgreSQL source counts matches without
|
|
571
607
|
bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
|
|
@@ -574,4 +610,6 @@ bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remot
|
|
|
574
610
|
Hosted cooldown recording rejects observed reset deadlines beyond the 24-hour
|
|
575
611
|
admission horizon explicitly; adapters must not shorten or invent a provider
|
|
576
612
|
reset to evade this validation. Operator forge-clear is an audited override,
|
|
577
|
-
not a successful provider observation.
|
|
613
|
+
not a successful provider observation. Only limits the dispatcher's own forge
|
|
614
|
+
classifies, without `unauthenticated`, record repository cooldown; others are
|
|
615
|
+
local to the process and reported as `forge.credential-limited` attention.
|
|
@@ -35,6 +35,12 @@ service publishes `>=1.2.0 <1.4.0` until later publication facts permit retireme
|
|
|
35
35
|
The service reads the clock for each decision, so retirement needs no redeploy. Health needs no credentials, version
|
|
36
36
|
headers, or available backend. On the service’s own line, both its runtime protocol and its published ledger protocol are admitted. Health advertises a fully validated same-line request’s admitted protocol. Otherwise it advertises the service line’s published protocol, or its runtime protocol when that line is unpublished. Thus default 1.3 health advertises 6 anonymously and to published clients, and 7 to admitted source clients; explicit 1.4/7 services default to 7. The package version and support range remain truthful. Health performs no store reads.
|
|
37
37
|
|
|
38
|
+
Every current service advertises `build-creation-key-v1` in health `capabilities`:
|
|
39
|
+
keyed project creation lands at the derived slug described under `POST /builds`.
|
|
40
|
+
Clients send a creation key only after seeing it. A client treats a service without
|
|
41
|
+
it as allocating, so an unkeyed creation whose response was lost there is reported
|
|
42
|
+
as an unknown outcome rather than as absence.
|
|
43
|
+
|
|
38
44
|
|
|
39
45
|
## Hosted dispatch placement
|
|
40
46
|
|
|
@@ -372,7 +378,7 @@ it to exist. An unknown build returns `404 not-found`.
|
|
|
372
378
|
|
|
373
379
|
| BuildStore operation | HTTP route | Request | Success |
|
|
374
380
|
|---|---|---|---|
|
|
375
|
-
| `createBuild` | `POST /builds` | `{slug: string, repo: string, repoOrigin?: string, ticket?: TicketRef, branch?: string, created?: event write}`; `slug`, `repo`, and a supplied `branch` are nonempty
|
|
381
|
+
| `createBuild` | `POST /builds` | `{slug: string, repo: string, repoOrigin?: string, ticket?: TicketRef, branch?: string, created?: event write, creationKey?: string}`; `slug`, `repo`, and a supplied `branch` are nonempty; a supplied `creationKey` matches `^[A-Za-z0-9_-]{1,128}$`. `created`, when present, must be a valid `build.created` write; the server appends it as seq 1 atomically with the record (both exist or neither), and an invalid one is `422` with nothing created | `201` + authoritative `BuildRecord`; project credentials receive a fresh random-suffixed slug, or with `creationKey` the slug that key derives (a repeated key is `409 conflict`), and a branch in the build kind's namespace (`ab/<slug>`, or `ab-node/<slug>` for a node); a supplied `branch` must be `ab/<requested slug>` or `ab-node/<requested slug>` agreeing with the `build.created` kind, otherwise `400 validation`. Owner admin/open mode keeps exact-slug semantics with `409 conflict` for duplicates |
|
|
376
382
|
| `listBuilds` | `GET /builds` | none | `200` + `BuildRecord[]`, filtered by the server to the credential project; owner admin may list all projects. List order is unspecified |
|
|
377
383
|
| `getBuild` | `GET /builds/{slug}` | none | `200` + `BuildRecord`; absent is `404` (the shipped client maps this to `null`) |
|
|
378
384
|
| `append` | `POST /builds/{slug}/events` | event write | `201` + build event envelope |
|
|
@@ -715,7 +721,7 @@ without a journal record, or a repository without builds.
|
|
|
715
721
|
| `ensureRepo` | `POST /repos` | `{"repo": string}` with a nonempty id | `200` + `RepositoryRecord`; idempotently returns the existing record |
|
|
716
722
|
| `getRepo` | `GET /repos/{repo}` | none | `200` + `RepositoryRecord`; absent is `404` (the shipped client maps this to `null`) |
|
|
717
723
|
| `appendRepo` | `POST /repos/{repo}/events` | event write | `201` + repository event envelope |
|
|
718
|
-
| `getRepoEvents` | `GET /repos/{repo}/events?since={n}&wait={s}` | optional `since` query value, parsed as in section 3; absence defaults to `0`. Optional `wait` in whole seconds, per the event-wait rules of section 3 | `200` + envelopes with `seq > since`, up to the frozen head; `409 cursor-too-old` below `max(0, head - 1000)` |
|
|
724
|
+
| `getRepoEvents` / `getRepositoryTail` | `GET /repos/{repo}/events?since={n}&through={n}&wait={s}` | optional `since` query value, parsed as in section 3; absence defaults to `0`. Optional `wait` in whole seconds, per the event-wait rules of section 3 | `200` + envelopes with `seq > since`, up to the frozen head; optional `through` caps the response at `seq <= through`; `409 cursor-too-old` below `max(0, head - 1000)` |
|
|
719
725
|
| `getRepoStateEvents` | `GET /repos/{repo}/state-events` | none | `200` + the bounded repository-journal subset (AUT-489): every durable event type (`ticket-preparation.*`, `harvest.*`, `orchestrator.sandbox.*`, the three dispatcher setting types, and cross-generation handoff correlation facts: target-prepared, yield-requested, upgrade-failed, handoff-started, terminal-released, takeover, drain-deadline, drain-settled and handoff-completed) plus the latest-only `dispatcher.ticket-scan-completed` and `dispatcher.placement-set` facts and, when the journal has one, the tail from the latest `dispatcher.run-started`, in increasing sequence order; served inside the repository-existence gate like `GET events`, so an unknown repository is `404` |
|
|
720
726
|
| `getReducerSnapshot` (repo scope) | `GET /repos/{repo}/snapshots/{reducer}?version={n}` | required `version` query value, a positive integer; `reducer` is a registry name (`^[A-Za-z][A-Za-z0-9._-]{0,63}$`) | `200` + `{"version", "cursor", "state"}` or `200 null` when absent, written by another reducer version, ahead of the journal's tail, or the repository has no journal record; an unknown repository is `404`, which the shipped client also maps to `null` |
|
|
721
727
|
| `putReducerSnapshot` (repo scope) | `PUT /repos/{repo}/snapshots/{reducer}` | `{"version": int >= 1, "cursor": int >= 0, "state": JSON}`, at most 16 MiB (`413` above) | `200 {"written": boolean}`; the stored cursor never decreases, so a write at an equal or lower cursor (or an equal cursor at an equal or lower version) and one past the journal's tail answer `written: false` |
|
|
@@ -775,6 +781,14 @@ protocol version: older clients ignore it. A client that needs it and gets an
|
|
|
775
781
|
answer without it, from an older service, fails with a typed error instead of
|
|
776
782
|
reading each build's facts.
|
|
777
783
|
|
|
784
|
+
`waitPending` (`true` while a declared ticket wait awaits the dispatcher's
|
|
785
|
+
check) and `ticketWait` (`{id, escalation, tickets}` while an entered ticket
|
|
786
|
+
wait is open) let a hosted dispatcher service ticket waits from digests alone.
|
|
787
|
+
Both are additive and keep the protocol version; older clients ignore them. An
|
|
788
|
+
older service that omits `ticketWait` yields no automatic release: open waits
|
|
789
|
+
then end only when an operator answers them, and the client never rebuilds the
|
|
790
|
+
field from events.
|
|
791
|
+
|
|
778
792
|
The digest is derived from the event log on every call — the server persists
|
|
779
793
|
nothing and there is no refresh step. Protocol version `3` reshaped the
|
|
780
794
|
digest's `observations` from bare sequence numbers to `{seq, ts}` pairs and
|
|
@@ -1190,8 +1204,12 @@ Remote clients continue mapping addressed GET 404 responses to null. Nested
|
|
|
1190
1204
|
streams must also belong to the addressed parent.
|
|
1191
1205
|
|
|
1192
1206
|
`GET /builds` is filtered by the server to the credential's project. Project
|
|
1193
|
-
`POST /builds`
|
|
1194
|
-
base, even when the base is unused
|
|
1207
|
+
`POST /builds` without `creationKey` allocates a fresh random-suffixed slug from
|
|
1208
|
+
the requested base, even when the base is unused. With `creationKey` it creates at
|
|
1209
|
+
most once at `<base>-<first 24 hex of sha256("autobuild-build-creation\0" + repo +
|
|
1210
|
+
"\0" + requested slug + "\0" + creationKey)>` and answers a repeated key with
|
|
1211
|
+
`409 conflict`, never a second identity; `creationBuildSlug` in the client package
|
|
1212
|
+
computes it. Either way it creates a matching branch in the build kind's
|
|
1195
1213
|
namespace: `ab-node/<slug>` when the `build.created` payload has `kind: "node"`,
|
|
1196
1214
|
otherwise `ab/<slug>`. Without `created`, a supplied `branch` prefix decides the
|
|
1197
1215
|
kind. A supplied `branch` must be exactly `ab/<requested slug>` or
|
|
@@ -1776,14 +1794,17 @@ The commands use the saved owner credential, even if an ambient build token exis
|
|
|
1776
1794
|
### Forge cooldown admission and explicit recovery
|
|
1777
1795
|
|
|
1778
1796
|
Hosted repository event appends and atomic artifact deposits validate
|
|
1779
|
-
`dispatcher.forge-degraded` before any durable
|
|
1780
|
-
its event schema, with a finite ISO `resetAt` at most 24 hours after server time
|
|
1797
|
+
`dispatcher.forge-degraded` and `forge.credential-limited` before any durable
|
|
1798
|
+
mutation. The payload must match its event schema, with a finite ISO `resetAt` at most 24 hours after server time
|
|
1781
1799
|
(inclusive). Already-expired deadlines are accepted. Invalid or out-of-horizon
|
|
1782
1800
|
writes return `400 validation` (the remote adapter exposes `EventValidationError`);
|
|
1783
1801
|
the server never clamps or invents a provider reset. Historical decoding has no clock-relative restriction.
|
|
1784
1802
|
|
|
1785
1803
|
Build-runner and build-phase grants may POST only the kernel-authored
|
|
1786
|
-
`dispatcher.forge-degraded` repository
|
|
1804
|
+
`forge.credential-limited` and `dispatcher.forge-degraded` repository facts
|
|
1805
|
+
through the events route. Current runners and phase sessions record only
|
|
1806
|
+
`forge.credential-limited` attention; the `dispatcher.forge-degraded` exception
|
|
1807
|
+
remains for runners pinned to older releases. The
|
|
1787
1808
|
preceding `requireProject` check binds this exception to the exact repository
|
|
1788
1809
|
in the delegated claim. A hosted project identifies one repository. Delegates
|
|
1789
1810
|
cannot write recovery, deposits or other repository facts, regardless of the
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
A leaf contributes one net change, independent of its WIP commit count. Before
|
|
4
4
|
verification the kernel collapses its contribution relative to the effective
|
|
5
5
|
diff base and replays it onto the sampled destination. Implementation and review
|
|
6
|
-
do not rewrite history
|
|
6
|
+
do not rewrite history; the one exception is a build resuming from a ticket
|
|
7
|
+
wait, which the kernel restacks between phases so the resumed phase sees the
|
|
8
|
+
merged blockers. A build with nothing published fast-forwards to the
|
|
9
|
+
destination only when its local branch has no commits the destination lacks and
|
|
10
|
+
its workspace has no uncommitted tracked changes; otherwise the restack fails
|
|
11
|
+
and that local work is never discarded. Verification failures return to implementation; later
|
|
7
12
|
commits append until the next approved cycle. Later reviews use the effective
|
|
8
13
|
base from the preceding successful restack; the original cut remains provenance.
|
|
9
14
|
|
|
@@ -17,7 +22,7 @@ node fast-forwards preserve ordered contributing identities.
|
|
|
17
22
|
|
|
18
23
|
Destination heads come only from the authoritative forge branch; dispatcher-host
|
|
19
24
|
refs are never a fallback. Failed remote reads retain the accepted observation;
|
|
20
|
-
classified rate limits use repository forge degradation and cooldown. Changed
|
|
25
|
+
dispatcher-classified rate limits use repository forge degradation and cooldown. Changed
|
|
21
26
|
heads require immutable commit ancestry proof against the accepted target and
|
|
22
27
|
the destination base already used by replay. Missing capability or failed proof
|
|
23
28
|
defers new replay. A non-descendant without kernel lineage records
|
|
@@ -49,7 +54,18 @@ polls read no receipts or event rows.
|
|
|
49
54
|
|
|
50
55
|
Accepted destination observations are durable `target.moved` facts, including while an
|
|
51
56
|
agent runs. Verify-entry restack freezes a current base before verification;
|
|
52
|
-
path selection excludes upstream-only paths.
|
|
57
|
+
path selection excludes upstream-only paths. A build leaving a ticket wait
|
|
58
|
+
restacks with trigger `wait-resume` before its declaring phase resumes, when the
|
|
59
|
+
target moved from the base its work sits on; an unchanged target resumes
|
|
60
|
+
without a restack. Published work replays through the guarded restack, and a
|
|
61
|
+
conflict runs reconcile before the declaring phase resumes. With nothing
|
|
62
|
+
published, the local branch fast-forwards to the target (`restack.advanced`)
|
|
63
|
+
only when it has no commits the target lacks and the workspace has no
|
|
64
|
+
uncommitted tracked changes; unpublished local commits or uncommitted tracked
|
|
65
|
+
changes prevent the advance and are never discarded. A wait declared by a
|
|
66
|
+
reconcile session whose replay recorded no publish intent supersedes that
|
|
67
|
+
replay when the target moved, discarding its undeposited resolution, and
|
|
68
|
+
replays the published head onto the current target instead. After finalize and post-steps,
|
|
53
69
|
waiting leaves restack when the target moves. Node-target finalize contributions
|
|
54
70
|
are canonicalized before guarded merge even when the target SHA is unchanged.
|
|
55
71
|
Clean replay starts no agent. A clean waiting leaf rewrite preserves completed
|
|
@@ -68,7 +84,7 @@ dependency presence requires an ancestor change; on `ab restack <node>`; or on
|
|
|
68
84
|
accepted re-parenting. There is no eager mode or cadence option. Nested nodes
|
|
69
85
|
need their own demand. Existing frozen transactions, including ones reserved
|
|
70
86
|
before upgrade, finish first; later demand coalesces onto the latest parent.
|
|
71
|
-
Leaves keep verify-entry and awaiting-merge restacks for every target.
|
|
87
|
+
Leaves keep verify-entry, wait-resume and awaiting-merge restacks for every target.
|
|
72
88
|
|
|
73
89
|
For observation cadence, durable wakes and last-check evidence, see
|
|
74
90
|
[node polling and status](integration-tree.md#polling-and-status).
|
|
@@ -221,7 +237,7 @@ not consume `maxPhaseAttempts`. A seventh transient failure records
|
|
|
221
237
|
error and six retries. Answering that escalation opens a fresh publication episode
|
|
222
238
|
for the same retained intent without resetting agent phase failures. Pending
|
|
223
239
|
publication keeps its workspace through backoff and unresolved exhaustion.
|
|
224
|
-
|
|
240
|
+
Dispatcher-classified rate limits retain repository cooldown and consume no publication
|
|
225
241
|
retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
|
|
226
242
|
errors retain their existing behavior.
|
|
227
243
|
|
|
@@ -237,11 +253,17 @@ sessions do not inherit obsolete reconstruction instructions.
|
|
|
237
253
|
## Ticket preparation before build creation
|
|
238
254
|
|
|
239
255
|
Before claiming, the dispatcher journals a repository-scoped preparation intent;
|
|
240
|
-
a won claim
|
|
256
|
+
a won claim, the selected creation slug and, when the build store attests keyed
|
|
257
|
+
creation, the attempt's creation key are durable boundaries. Caught
|
|
241
258
|
asset-copy, spec-authoring, naming, and build-creation failures return the ticket
|
|
242
|
-
to configured Ready; a nonconforming spec goes to configured Triage.
|
|
243
|
-
|
|
244
|
-
`
|
|
259
|
+
to configured Ready; a nonconforming spec goes to configured Triage. Once a
|
|
260
|
+
confirmed claim's ticket is back, one repository `ticket.handed-back` reports it
|
|
261
|
+
(cause `preparation-failed` or `spec-bounce`, with the missing spec parts) before
|
|
262
|
+
the attempt resolves; an attempt reports at most once. Recovery
|
|
263
|
+
point-reads the selected slug and, for a keyed attempt, the canonical slug derived
|
|
264
|
+
from the repository, selected slug and key: one matching record and atomic
|
|
265
|
+
`build.created` retain ownership even if creation threw after committing or its
|
|
266
|
+
response was lost.
|
|
245
267
|
Unavailable or conflicting readback never authorizes release or a replacement
|
|
246
268
|
build. Pending attempts retain the original failure, latest recovery error and
|
|
247
269
|
retry deadline in the canonical repository reduced value; resolved attempts
|
|
@@ -249,8 +271,10 @@ leave that value. Under repository ownership, each tick admits at most eight
|
|
|
249
271
|
due recovery attempts, before intake and independently of capacity or intake
|
|
250
272
|
settings, with a 30-second durable retry delay after recovery failure. Unresolved
|
|
251
273
|
ticket identities remain withheld. An uncertain claim outcome or unrelated
|
|
252
|
-
external ticket state, missing ticket/state,
|
|
253
|
-
|
|
274
|
+
external ticket state, missing ticket/state, conflicting slug ownership, builds at
|
|
275
|
+
both identities, or an unknown creation outcome (an unkeyed attempt on a store
|
|
276
|
+
that allocates slugs, where absence is not evidence) terminates automatic
|
|
277
|
+
recovery with an `abandoned` resolution and diagnostic reason. The
|
|
254
278
|
ticket is left unchanged; an operator can leave it finished or cancelled, or
|
|
255
279
|
inspect ownership and explicitly return it to Ready for another attempt. These
|
|
256
280
|
cases stop provider polling and further durable diagnostic appends. The tick
|
|
@@ -58,10 +58,15 @@ the ticket ready.
|
|
|
58
58
|
## Already-claimed work
|
|
59
59
|
|
|
60
60
|
Adding blockers does not stop a build already claimed from an earlier listing.
|
|
61
|
-
When the human authorizes restarting premature work
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
the ticket
|
|
61
|
+
When the human authorizes restarting premature work and the blocker set is
|
|
62
|
+
already right, request `ab abort <slug> --to ready`: cleanup moves the ticket
|
|
63
|
+
straight back to ready with its blockers kept, so no second move is needed.
|
|
64
|
+
If the ticket no longer meets the spec standard, cleanup returns it to triage
|
|
65
|
+
instead and the hand-back names the missing parts; groom it before moving it
|
|
66
|
+
to ready.
|
|
67
|
+
If the blockers need changing first, verify or repair them once the
|
|
68
|
+
`ticket.handed-back` repository event for that build arrives; the dispatcher
|
|
69
|
+
writes nothing to the ticket for that hand-back afterwards. Ready with
|
|
65
70
|
unresolved blockers is the normal waiting state: dispatch rechecks dependencies
|
|
66
71
|
and claims the ticket only after they resolve and other readiness gates pass.
|
|
67
72
|
|
|
@@ -69,7 +69,7 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
|
69
69
|
request; fix the failure and retry in the same session. In a remote workspace it records one publication
|
|
70
70
|
request and parks while the dispatcher publishes and records completion;
|
|
71
71
|
**do not run `ab done` again** after that success message. It is your only
|
|
72
|
-
terminal command besides `ab escalate`. If it reports a validation error,
|
|
72
|
+
terminal command besides `ab escalate` and `ab wait-on`. If it reports a validation error,
|
|
73
73
|
fix what it names and run it again.
|
|
74
74
|
|
|
75
75
|
An empty contribution is refused: when HEAD has no commits over the
|
|
@@ -137,6 +137,20 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
|
137
137
|
ab escalate "…the question…" --refs src/whatever.ts
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
- **Wait for another ticket instead of escalating.** If the build cannot
|
|
141
|
+
proceed until another ticket merges — the plan needs code that ticket owns
|
|
142
|
+
and it has not landed — commit your work first (the worktree must be clean;
|
|
143
|
+
the command publishes your commits), then end the session with:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
ab wait-on <ticket-id>... --reason "…what this change needs from them…"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The build parks without holding a slot. When every named ticket completes,
|
|
150
|
+
the dispatcher ends the wait and implement resumes at the same round, on the
|
|
151
|
+
target's current head, with a `wait` block in `$AB_CONTEXT_DIR/guidance.json`.
|
|
152
|
+
Escalate as before for anything else.
|
|
153
|
+
|
|
140
154
|
Read the manifest path printed by `ab context`. Its `materialized` keys are
|
|
141
155
|
relative to `contextDir`: join them to locate collision-adjusted inputs.
|
|
142
156
|
Manifest path fields are workspace-relative; use `notesPath` for producer notes.
|