@defrex/autobuild 1.8.1 → 1.9.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 +92 -11
- package/docs/architecture.md +38 -14
- package/docs/configuration.md +247 -4
- package/docs/dispatcher-hosting.md +4 -0
- package/docs/merge-policy.md +45 -5
- package/docs/operating.md +21 -0
- package/docs/operator-api.md +11 -2
- package/docs/plugin-authoring.md +4 -1
- package/docs/restacking.md +4 -0
- package/docs/setup.md +3 -1
- package/docs/verification.md +7 -6
- package/package.json +4 -3
- package/packages/core/src/cli/attention.ts +3 -0
- package/packages/core/src/cli/dashboard/landing-display.ts +9 -1
- package/packages/core/src/cli/dashboard/model.ts +25 -6
- package/packages/core/src/cli/dashboard/render.ts +2 -2
- package/packages/core/src/cli/dispatch.ts +120 -1
- package/packages/core/src/cli/help.ts +6 -2
- package/packages/core/src/cli/repository-status.ts +66 -1
- package/packages/core/src/cli/status.ts +2 -2
- package/packages/core/src/cli/watch.ts +1074 -627
- package/packages/core/src/config/live.ts +1 -0
- package/packages/core/src/config/load.ts +19 -0
- package/packages/core/src/config/schema.ts +114 -0
- package/packages/core/src/events/catalog.ts +2 -0
- package/packages/core/src/events/payloads.ts +22 -0
- package/packages/core/src/events/policy.ts +9 -0
- package/packages/core/src/events/repository.ts +43 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +31 -0
- package/packages/core/src/kernel/auto-merge.ts +33 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +18 -0
- package/packages/core/src/kernel/landing-state.ts +56 -0
- package/packages/core/src/kernel/reducer.ts +1 -1
- package/packages/core/src/plugin-sdk/index.ts +7 -1
- package/packages/core/src/ports/forge/fake.ts +128 -8
- package/packages/core/src/ports/forge/git-rewrite.ts +34 -3
- package/packages/core/src/ports/forge/github-squash-message.ts +89 -0
- package/packages/core/src/ports/forge/github-transport.ts +30 -0
- package/packages/core/src/ports/forge/github.ts +565 -164
- package/packages/core/src/ports/types.ts +47 -3
- package/packages/core/src/processes/build-execution-state.ts +4 -3
- package/packages/core/src/processes/dispatcher.ts +73 -4
- package/packages/core/src/processes/execution-no-progress.ts +2 -0
- package/packages/core/src/processes/hook-command.ts +125 -0
- package/packages/core/src/processes/hook-webhook.ts +144 -0
- package/packages/core/src/processes/hooks.ts +740 -0
- package/packages/core/src/store/contract.ts +28 -0
- package/packages/core/src/store/reducer-value-shapes.json +3729 -3297
- package/packages/core/src/store/remote/released-clients.json +11 -0
- package/packages/core/src/store/remote/released-reducer-values/1.9.0.json +29475 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +2 -0
- package/packages/core/src/store/repo-state-events.ts +3 -0
- package/packages/core/src/store/retention.ts +16 -2
- package/packages/core/src/testing/index.ts +1 -0
- package/packages/core/src/testing/reduced-read-budget.ts +476 -1
- package/skills/guide/SKILL.md +81 -6
- package/skills/guide/references/merge-policy.md +45 -5
- package/skills/guide/references/operator-api.md +11 -2
- package/skills/guide/references/plugin-authoring.md +4 -1
- package/skills/guide/references/restacking.md +4 -0
- package/skills/guide/references/setup.md +3 -1
- package/skills/operate/SKILL.md +24 -4
- package/templates/hosted-service/package.json +2 -2
package/skills/guide/SKILL.md
CHANGED
|
@@ -473,7 +473,7 @@ evaluated as config logic.
|
|
|
473
473
|
|
|
474
474
|
**Strictness:** unknown top-level keys/tables and unknown keys inside known
|
|
475
475
|
tables are **errors**, not warnings — a typo must not silently disable a
|
|
476
|
-
verifier. The open maps are `[accounts]`, `[commands]`, `[roles]`, `[profiles]`,
|
|
476
|
+
verifier. The open maps are `[accounts]`, `[commands]`, `[hooks]`, `[roles]`, `[profiles]`,
|
|
477
477
|
`[profiles.<name>.roles]`, `[workspace.config]`,
|
|
478
478
|
`[workspace.config.runtimeProvisioning]`, `[verify.<step>]`, and
|
|
479
479
|
`[finalize.<step>]`. Autobuild strictly validates the
|
|
@@ -1616,6 +1616,62 @@ stays in the repository journal;
|
|
|
1616
1616
|
`dispatcher.upgrade-failed` and `dispatcher.runtime-rolled-back` are actionable attention. Status also exposes the last rollback and current-lineage hold. Unrelated base commits do not
|
|
1617
1617
|
retry an unchanged failed target. No registry credentials belong in these facts.
|
|
1618
1618
|
|
|
1619
|
+
### `[hooks]`
|
|
1620
|
+
|
|
1621
|
+
An open map of hook name → observe-only hook. The lease-holding dispatcher
|
|
1622
|
+
delivers each record that matches the hook's filter to its command or URL, so
|
|
1623
|
+
tooling reacts to attention without keeping its own `ab watch` alive.
|
|
1624
|
+
|
|
1625
|
+
| Field | Default | Meaning |
|
|
1626
|
+
| --- | --- | --- |
|
|
1627
|
+
| `command` | one of `command`/`url` | Shell command run with `sh -c` from the checkout, once per record. |
|
|
1628
|
+
| `url` | one of `command`/`url` | Endpoint that receives one signed JSON `POST` per record: `https`, or `http` only to loopback (`localhost`, `127.0.0.0/8`, `[::1]`); no credentials or fragment. |
|
|
1629
|
+
| `secretEnv` | required with `url` | Name of the dispatcher environment variable holding the signing secret; rejected on a command hook. |
|
|
1630
|
+
| `events` | absent | `ab watch --event` globs, catalog-validated; absent means the default watch attention set. |
|
|
1631
|
+
| `timeoutSeconds` | `30` | Per-delivery limit; a timeout is a failure and kills a command's process group or abandons a request. |
|
|
1632
|
+
|
|
1633
|
+
- **Validation.** Names use ASCII letters, digits, `.`, `_` and `-`; a duplicate
|
|
1634
|
+
table, no target or both `command` and `url`, a bad `url`, a `url` without
|
|
1635
|
+
`secretEnv`, an empty `events` list, or a glob matching no build or repository
|
|
1636
|
+
event type (or `dispatcher.lost`) is rejected naming the hook, at startup and
|
|
1637
|
+
on reload. The dispatcher also rejects a `secretEnv` variable that is unset or
|
|
1638
|
+
blank in its own environment, naming the hook and the variable but never a
|
|
1639
|
+
value. `hooks` hot-reloads. The **hosted dispatcher rejects command hooks** as
|
|
1640
|
+
a config error, never silently ignored, and **delivers url hooks**.
|
|
1641
|
+
- **Record.** stdin carries exactly one record per invocation: the line `ab watch
|
|
1642
|
+
--json` prints for the same event under the same filter, including derived
|
|
1643
|
+
observations such as `build.consent-ready`. The record's `id` is stable across
|
|
1644
|
+
redelivery; its `cursor` is the hook's position after it. The environment drops
|
|
1645
|
+
build and session identity and adds `AB_HOOK=<name>`.
|
|
1646
|
+
- **Webhook.** A url hook gets one `POST` per record. The body is the record
|
|
1647
|
+
line without its newline (`Content-Type: application/json`), with headers
|
|
1648
|
+
`Autobuild-Hook` (hook name), `Autobuild-Delivery` (the record `id`, stable
|
|
1649
|
+
across redelivery), `Autobuild-Timestamp` (Unix seconds, per attempt) and
|
|
1650
|
+
`Autobuild-Signature: v1=<lowercase hex HMAC-SHA256 of "<timestamp>.<body>">`
|
|
1651
|
+
keyed by the secret. A 2xx response within the timeout is success; any other
|
|
1652
|
+
status, a redirect (never followed), a timeout or a connection error is a
|
|
1653
|
+
failure. Receivers recompute the signature over the raw body, compare in
|
|
1654
|
+
constant time, reject stale timestamps (five minutes is reasonable) and
|
|
1655
|
+
deduplicate on `Autobuild-Delivery`. The secret never appears in events,
|
|
1656
|
+
status, logs or errors.
|
|
1657
|
+
- **Guarantee.** For a command, exit 0 within the timeout is success. Records arrive in order,
|
|
1658
|
+
one invocation at a time; delivery is at least once, so consumers deduplicate
|
|
1659
|
+
by `id`. Hooks run outside the dispatch tick and nothing reads their outcome:
|
|
1660
|
+
a hook never delays or changes a build, a tick or another hook.
|
|
1661
|
+
- **Progress.** Durable per hook name (the latest `hook-progress.<name>`
|
|
1662
|
+
repository artifact) across restarts, hot upgrades and reloads. A new name
|
|
1663
|
+
starts when first loaded, without history; a renamed hook starts fresh; a
|
|
1664
|
+
changed command or filter resumes from saved progress. History too old to read
|
|
1665
|
+
resumes from the current position and records `hook.skipped`. `ab dispatch
|
|
1666
|
+
--once` makes one delivery pass per hook and stops at the first failure; a
|
|
1667
|
+
delivery in flight at a hosted invocation's deadline is stopped and
|
|
1668
|
+
redelivered next pass.
|
|
1669
|
+
- **Failure.** Retries back off to one minute between attempts. Five minutes of
|
|
1670
|
+
continuous failure records `hook.failing` once per episode; the next success
|
|
1671
|
+
records `hook.recovered`. All three `hook.*` events are default watch
|
|
1672
|
+
attention. `ab repository status` lists each hook's last delivery, backlog or
|
|
1673
|
+
"caught up", and current failure.
|
|
1674
|
+
|
|
1619
1675
|
## Setup and upgrades
|
|
1620
1676
|
|
|
1621
1677
|
For 0.x upgrades, first read the [migration reference](references/migration-1.0.md):
|
|
@@ -2418,7 +2474,12 @@ followed by its later kernel acknowledgement, never by the request alone.
|
|
|
2418
2474
|
Every build row renders a `merge <state>` token. Cyan requested means
|
|
2419
2475
|
authorized but not yet applied natively; green enabled means the native request
|
|
2420
2476
|
is armed; yellow cancelling means cancellation is in flight; dim off means no
|
|
2421
|
-
authorization.
|
|
2477
|
+
authorization. Cyan `merge polling` means GitHub GraphQL is unavailable to the
|
|
2478
|
+
dispatcher, so Autobuild lands the gated PR itself when GitHub reports it clear
|
|
2479
|
+
to merge, which needs a running dispatcher. Yellow `merge awaits a human merge`
|
|
2480
|
+
means the landing settled and makes no further attempts: the base requires a
|
|
2481
|
+
merge queue, or GitHub refused the guarded merge (its message is shown), and a
|
|
2482
|
+
person merges the PR on GitHub. A recorded consent decision waiting for an operator reads
|
|
2422
2483
|
`merge awaiting consent`; an explicit hold reads `merge held`.
|
|
2423
2484
|
There is no red comparison with a repository default. Row and detail merge
|
|
2424
2485
|
explanations distinguish a pending policy decision, consent, and hold, and name
|
|
@@ -2683,7 +2744,10 @@ It also lists the latest ticket scan's ticket and dependency diagnostics
|
|
|
2683
2744
|
including ready tickets whose labels select more than one role profile and
|
|
2684
2745
|
tickets held because their target
|
|
2685
2746
|
node is being built by another store, and dispatcher startup warnings
|
|
2686
|
-
(`warningLines`).
|
|
2747
|
+
(`warningLines`). Each hook configured by the latest dispatcher run is listed
|
|
2748
|
+
with its last successful delivery, pending backlog or "caught up", and current
|
|
2749
|
+
failure (`hook <name> — …` lines; `hooks` in JSON, empty when none, each with its
|
|
2750
|
+
`command` or `url`).
|
|
2687
2751
|
|
|
2688
2752
|
**`ab builds`** summarizes this repository's builds, one row each. It reports
|
|
2689
2753
|
**active** builds by default — `running`, `paused`, `blocked` — because those
|
|
@@ -2823,8 +2887,8 @@ The default watch reports actionable conditions only:
|
|
|
2823
2887
|
It names the matched files and the previous and new heads; the build returns
|
|
2824
2888
|
to the consent queue and needs fresh consent for its new head.
|
|
2825
2889
|
- Build `build.merge-decision`: a finalized open PR
|
|
2826
|
-
with a recorded consent decision awaiting consent, an explicit hold,
|
|
2827
|
-
current actionable merge-gate deferral. Policy decisions not yet recorded and
|
|
2890
|
+
with a recorded consent decision awaiting consent, an explicit hold, a
|
|
2891
|
+
current actionable merge-gate deferral, or a landing awaiting a human merge. Policy decisions not yet recorded and
|
|
2828
2892
|
authorized merges awaiting application are silent. One merge decision is reported per build/PR.
|
|
2829
2893
|
- Repository `harvest.escalated`, `harvest.recovery-exhausted`,
|
|
2830
2894
|
`dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
|
|
@@ -2834,6 +2898,14 @@ The default watch reports actionable conditions only:
|
|
|
2834
2898
|
line names the process whose GitHub request was rate-limited outside the
|
|
2835
2899
|
dispatcher's credential (unauthenticated, with why, or on that process's own
|
|
2836
2900
|
credential) and its reset; dispatcher forge work continues.
|
|
2901
|
+
- Repository `hook.failing`, `hook.recovered` and `hook.skipped`: a configured
|
|
2902
|
+
hook (`[hooks]`) has failed continuously for five minutes (once per episode,
|
|
2903
|
+
naming the latest error and the record `id` it is stuck on), has delivered
|
|
2904
|
+
again after a reported episode, or resumed past history it could no longer
|
|
2905
|
+
read (with the skipped stream ranges) or a build announcement it could not
|
|
2906
|
+
resolve. Inspect `ab repository status`, fix the hook's command, endpoint or
|
|
2907
|
+
configuration, and treat a skipped range as records the hook's consumer never
|
|
2908
|
+
received.
|
|
2837
2909
|
- Repository `ticket-preparation.resolved` with outcome `abandoned`: automatic
|
|
2838
2910
|
preparation recovery stopped and left the ticket unchanged. The line names the
|
|
2839
2911
|
ticket, attempt and recorded reason; the payload's `claimed` says whether the
|
|
@@ -2892,7 +2964,10 @@ arming the watch. Named watches still end when every named build is terminal;
|
|
|
2892
2964
|
learn their outcomes from status reconciliation at exit.
|
|
2893
2965
|
|
|
2894
2966
|
With `--json`, stdout is newline-delimited JSON — exactly one object per
|
|
2895
|
-
matching event, flushed as soon as it is written — with fields `
|
|
2967
|
+
matching event, flushed as soon as it is written — with fields `id` (the
|
|
2968
|
+
record's stable identity, the same on redelivery and resume:
|
|
2969
|
+
`build:<slug>:<seq>`, `repo:<seq>`, `<observation type>:<dedupe identity>`, or
|
|
2970
|
+
`dispatcher.lost:<run>`), `build` (slug,
|
|
2896
2971
|
or null for a repository event), `repo` (present only for repository events),
|
|
2897
2972
|
`event` (the complete durable envelope: build, seq, ts, actor, type, payload),
|
|
2898
2973
|
`state` (for build events, the reduction after that event: `status`, `phase`,
|
|
@@ -182,9 +182,36 @@ merge; uncertainty is recorded as unfenced and requires immutable merged-tree
|
|
|
182
182
|
audit. A mismatch raises operator attention without rewriting the shared parent.
|
|
183
183
|
Pending audits survive completion and retry until settled.
|
|
184
184
|
|
|
185
|
-
Root
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
Root leaves land by one of three routes. Behind a real merge-blocking gate,
|
|
186
|
+
Autobuild arms GitHub-native auto-merge. An authoritatively ungated root
|
|
187
|
+
permits an inspected-head guarded direct squash; unknown gate state defers.
|
|
188
|
+
When GitHub GraphQL is unavailable to the dispatcher, as from Claude Code on
|
|
189
|
+
the web, whose GitHub proxy refuses GraphQL, native auto-merge cannot be
|
|
190
|
+
armed, so a gated root leaf lands by polling. On each dispatcher tick
|
|
191
|
+
Autobuild checks whether GitHub reports the PR clear to merge (`clean`,
|
|
192
|
+
`unstable` or `has_hooks`, and mergeable) at the verified head. It then reads
|
|
193
|
+
that state again, rechecks consent, and squashes guarded on that head. It
|
|
194
|
+
never relies on GitHub refusing a premature merge, so a credential that could
|
|
195
|
+
bypass branch protection never merges a blocked PR. Rows show
|
|
196
|
+
`merge polling`. Polling lands only while a dispatcher runs, so native
|
|
197
|
+
auto-merge stays the route wherever GraphQL works: it lands even after the
|
|
198
|
+
dispatcher stops.
|
|
199
|
+
|
|
200
|
+
A polling landing settles once into awaiting a human merge, shown as
|
|
201
|
+
`merge awaits a human merge`, and Autobuild makes no further landing attempt
|
|
202
|
+
for that candidate when either holds: GitHub exposes a merge queue for the
|
|
203
|
+
base over REST (a ruleset merge-queue rule, or merge-queue merges GitHub
|
|
204
|
+
reports for the base branch), or GitHub refuses the guarded squash of a PR it
|
|
205
|
+
had just reported clear, in which case its refusal message is shown. A squash
|
|
206
|
+
request cannot enter a merge queue. A human merges the PR on GitHub, and
|
|
207
|
+
Autobuild records that like any human forge merge. A classic
|
|
208
|
+
branch-protection merge queue that GitHub does not expose over REST and has
|
|
209
|
+
never recorded a merge-queue merge cannot be detected. A PR GitHub keeps
|
|
210
|
+
reporting blocked there stays `merge polling` and never merges. In
|
|
211
|
+
GraphQL-blocked environments, use a ruleset merge queue or merge such PRs by
|
|
212
|
+
hand.
|
|
213
|
+
|
|
214
|
+
Node targets instead require authoritative proof of
|
|
188
215
|
an ungated destination, cancel native auto-merge and serialize the guarded push.
|
|
189
216
|
Gated or unproven node destinations stay open with actionable diagnostics.
|
|
190
217
|
A push alone is not evidence of merge: a node-target merge is recorded only
|
|
@@ -198,7 +225,16 @@ replacement confirms cancellation first; the next poll reconciles native state
|
|
|
198
225
|
before other actions. Stale enables are repaired by polling. An
|
|
199
226
|
already-enabled native request counts as applied only after the forge confirms
|
|
200
227
|
its squash method and identity message. Each eligible poll re-reads an armed
|
|
201
|
-
request and repairs it when PR edits or a human arm left it stale.
|
|
228
|
+
request and repairs it when PR edits or a human arm left it stale. On GitHub
|
|
229
|
+
the expected headline and body come from the PR and the repository's squash
|
|
230
|
+
title and message settings, with the build trailer and issue-link handling on
|
|
231
|
+
top. Landing reads use REST; GraphQL only arms or disarms native auto-merge,
|
|
232
|
+
after one read-only availability probe per dispatcher process. A GraphQL
|
|
233
|
+
refusal is remembered for 30 minutes, so a blocked environment sends at most
|
|
234
|
+
one GraphQL request per process in that window, and none on a quiet polling
|
|
235
|
+
tick. Quiet polls do not re-check merge queues; native enable, repair and
|
|
236
|
+
direct merge do, and the polling route checks merge-queue activity when it
|
|
237
|
+
first selects polling and again whenever GitHub reports the PR clear. This bounded
|
|
202
238
|
model requires replacement-head checks to take far longer than a poll interval. It
|
|
203
239
|
has no durable native-effect reservation. Human forge merges record whether a
|
|
204
240
|
hold was overridden; possible stale-enable merges raise operator attention.
|
|
@@ -209,7 +245,11 @@ No result is undone by rewriting the target.
|
|
|
209
245
|
The kernel must publish and fetch immutable exact archive refs under
|
|
210
246
|
`refs/autobuild/archive/<slug>/<sha>` and replace branches with an exact
|
|
211
247
|
expected-old-head guard. Namespace or permission failures stop publication;
|
|
212
|
-
there is no branch/tag fallback.
|
|
248
|
+
there is no branch/tag fallback. When an environment refuses non-branch Git pushes,
|
|
249
|
+
as Claude Code on the web's GitHub proxy does, the GitHub adapter creates the same
|
|
250
|
+
archive ref through REST ref creation and confirms it by exact readback. Commits that
|
|
251
|
+
exist only in the local workspace cannot use this fallback and fail with an actionable
|
|
252
|
+
error. Archive retention remains indefinite pending a
|
|
213
253
|
retention policy. See [restacking](restacking.md).
|
|
214
254
|
|
|
215
255
|
Tree admission requires node branch creation, authoritative branch-head reads
|
|
@@ -297,8 +297,9 @@ The default watch reports actionable conditions only:
|
|
|
297
297
|
signal for a ready consent or held merge, including first repository-wide
|
|
298
298
|
discovery. Its target has the queue entry shape `{kind, branch, ticket?, build?}`.
|
|
299
299
|
Unready and stale candidates stay silent. `build.merge-decision` remains for
|
|
300
|
-
current actionable merge-gate deferrals
|
|
301
|
-
build/PR; it does not duplicate consent or
|
|
300
|
+
current actionable merge-gate deferrals, landings awaiting a human merge, and
|
|
301
|
+
unsafe forge outcomes, once per build/PR; it does not duplicate consent or
|
|
302
|
+
hold attention.
|
|
302
303
|
- Repository `harvest.escalated`, `harvest.recovery-exhausted`,
|
|
303
304
|
`dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
|
|
304
305
|
`restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
|
|
@@ -307,6 +308,14 @@ The default watch reports actionable conditions only:
|
|
|
307
308
|
line names the process whose GitHub request was rate-limited outside the
|
|
308
309
|
dispatcher's credential (unauthenticated, with why, or on that process's own
|
|
309
310
|
credential) and its reset; dispatcher forge work continues.
|
|
311
|
+
- Repository `hook.failing`, `hook.recovered` and `hook.skipped`: a configured
|
|
312
|
+
hook (`[hooks]`) has failed continuously for five minutes (once per episode,
|
|
313
|
+
naming the latest error and the record `id` it is stuck on), has delivered
|
|
314
|
+
again after a reported episode, or resumed past history it could no longer
|
|
315
|
+
read (with the skipped stream ranges) or a build announcement it could not
|
|
316
|
+
resolve. Inspect `ab repository status`, fix the hook's command, endpoint or
|
|
317
|
+
configuration, and treat a skipped range as records the hook's consumer never
|
|
318
|
+
received.
|
|
310
319
|
- Repository `ticket-preparation.resolved` with outcome `abandoned`: automatic
|
|
311
320
|
preparation recovery stopped and left the ticket unchanged. The line names the
|
|
312
321
|
ticket, attempt and recorded reason; the payload's `claimed` says whether the
|
|
@@ -56,6 +56,7 @@ Declare served model prefixes and a default. Optional tool-free `oneShot` sits b
|
|
|
56
56
|
- API 1.2: optional idempotent `closePr` and `deleteBranch` for abort cleanup. `closePr` must preserve a racing merge. Without them, cleanup stays visibly pending.
|
|
57
57
|
- Optional `prAttachments` hosts images; the text-only path must work without it.
|
|
58
58
|
- Optional `closesIssues: true` declares that closing keywords reaching the default branch close issues. Only then does the kernel pass `issueLinks` (`{ issue, intent }[]`). For a leaf aimed at the default branch it passes the build's sealed links to `openPr` and in `BuildLandingOptions` to `setAutoMerge` and `squashMerge`. Compose them with the SDK helpers: `neutralizeClosingReferences(title, links, { repository })` for the PR title and squash headline, `withIssueKeywords(body, links, { repository, trailers: false })` for the PR body so it ends with the `Closes #N` / `Refs #N` lines, and `landingMessage(message, buildSlug, links, { repository })` for the landed message, which puts the keyword paragraph before the trailer block. `repository` is `owner/name`, so qualified references to other repositories are left alone. Compare an already-applied landing request against the same composition, or auto-merge churns. The kernel calls `setAutoMerge(…, true, options)` on every eligible poll while a request is armed: return `applied` without mutating when the armed method and message match, and call `options.canApply()` before any mutation that repairs them. Without the flag no links are passed and none are written. A leaf aimed at a node passes its links to `openPr` with every intent `refs` (and none to the landing calls), a root node's PR receives the node's own links merged with its landed children's union, and a nested node's PR receives that set with every intent `refs`. When `openPr` adopts an existing open PR for the head and links are present, converge it: neutralize the existing title, recompose the existing body with `withIssueKeywords`, write only the fields that changed, and confirm by readback, without replacing the title, prose or merge message. To keep a node's PR current, implement the optional `updatePrIssueLinks(workspacePath, number, issueLinks)`: read the PR, neutralize its title and compose its body with `withIssueKeywords(body, links, { repository, trailers: false })`, write only when either changed, re-read and throw when the readback disagrees or the PR is not open. Without the method a node's set is recorded but never written.
|
|
59
|
+
- A forge that cannot arm a gated root landing natively may return `polling` from `setAutoMerge(…, true, options)`, with `headSha` and `clear` true only when the forge reports the PR clear to merge at that head, or `human-merge` when the base requires a merge queue. The kernel then squashes a clear PR with `options.requireClearState`. Honour it: re-read the PR, refuse with an ordinary error unless it is still clear at the expected head, call `options.canApply()` immediately before the merge request, and raise the forge's refusal of that request as the SDK's `ForgeRejection`, which settles the landing as awaiting a human merge. Never rely on the forge refusing a premature merge.
|
|
59
60
|
|
|
60
61
|
### Reconcile rewrites
|
|
61
62
|
|
|
@@ -65,7 +66,9 @@ Reconcile requires the optional grouped `Forge.rewrite` capability:
|
|
|
65
66
|
2. Publish immutable exact-SHA refs under `refs/autobuild/archive/<slug>/<sha>`. Remote
|
|
66
67
|
archives also publish commits present only on the remote: GitHub uses create-only
|
|
67
68
|
Git-reference REST creation when the workspace lacks the commit, retaining guarded
|
|
68
|
-
Git pushes for local objects.
|
|
69
|
+
Git pushes for local objects. When a non-branch Git push of the archive ref is
|
|
70
|
+
refused (not a transient failure), GitHub creates the identical ref through the same
|
|
71
|
+
REST call; the readback still decides. Exact remote readback confirms publication, then a
|
|
69
72
|
non-shallow fetch of only that exact archive ref (without tags, configured refmap
|
|
70
73
|
expansion or a depth limit) restores missing commits and their missing ancestry,
|
|
71
74
|
writes no shallow boundary, leaves an already-shallow repository's existing
|
|
@@ -145,6 +145,10 @@ Before replacement the kernel publishes retained tips, displaced heads and the
|
|
|
145
145
|
temporary change under immutable exact archive refs. Remote archives also publish
|
|
146
146
|
commits present only on the remote: GitHub uses create-only Git-reference REST creation
|
|
147
147
|
when the workspace lacks the commit, retaining guarded Git pushes for local objects.
|
|
148
|
+
When the environment refuses a non-branch Git push of an archive ref, as Claude Code on
|
|
149
|
+
the web's GitHub proxy does, GitHub creates the identical archive ref through the same
|
|
150
|
+
REST call; a commit that exists only in the local workspace cannot use this fallback and
|
|
151
|
+
fails with an error naming both refusals.
|
|
148
152
|
Exact remote readback confirms publication, then a non-shallow fetch of only that exact
|
|
149
153
|
archive ref (without tags, configured refmap expansion or a depth limit) restores
|
|
150
154
|
missing commits and their missing ancestry, writes no shallow boundary, leaves an
|
|
@@ -475,7 +475,9 @@ For GitHub, enable **Allow squash merging** and **Allow rebase merging** in
|
|
|
475
475
|
Settings → General. The kernel needs direct publication and force-push permission
|
|
476
476
|
throughout `refs/heads/ab/` and `refs/heads/ab-node/`, including future branch
|
|
477
477
|
names. It also publishes immutable `refs/autobuild/archive/` refs, a non-head
|
|
478
|
-
namespace.
|
|
478
|
+
namespace. If the environment's Git transport refuses non-branch pushes, the GitHub
|
|
479
|
+
adapter falls back to creating the archive ref through the REST API (Contents: write),
|
|
480
|
+
so that path needs REST access to the archive namespace. Review protection rules, inherited organization rulesets, push rules,
|
|
479
481
|
and actor restrictions for all three namespaces. GitHub's branch APIs cannot
|
|
480
482
|
prove archive-domain access: manually verify it with your administrator without
|
|
481
483
|
creating probe refs or overwriting archives. Autobuild never changes settings or
|
package/skills/operate/SKILL.md
CHANGED
|
@@ -120,7 +120,7 @@ record calls for action. It reports failed node verification, build escalations,
|
|
|
120
120
|
harvest escalations/recovery exhaustion, automatic upgrade failures and runtime rollbacks, rejected configuration, reloads needing
|
|
121
121
|
restart, abnormal dispatcher stops/loss, abandoned ticket preparations, ticket hand-backs (`ticket.handed-back`), ticket-source and forge degradation past reset (15 minutes
|
|
122
122
|
for ticket sources without reset), forge rate limits outside the dispatcher's credential
|
|
123
|
-
(`forge.credential-limited`), and five minutes of continuous tick failures. Advertised resets
|
|
123
|
+
(`forge.credential-limited`), configured hook failures and skips (`hook.*`), and five minutes of continuous tick failures. Advertised resets
|
|
124
124
|
wait for a post-reset tick to finish before requiring action; ordinary recovery
|
|
125
125
|
on that retry stays silent. Source grace and cooldown-driven failures do not
|
|
126
126
|
start the tick-failure clock. When failure writes are unavailable, dispatch watch
|
|
@@ -129,8 +129,10 @@ configured interval, if longer). Recovery records the bounded unreported window;
|
|
|
129
129
|
local warnings do not start durable attention retroactively. Explicit shutdown
|
|
130
130
|
still stops dispatch without waiting for reporting recovery. Routine outcomes and self-healing failures stay silent.
|
|
131
131
|
|
|
132
|
-
Every record carries a cursor
|
|
133
|
-
line.
|
|
132
|
+
Every record carries a cursor and a stable `id`; bounded watches end with a bare `{"cursor": …}`
|
|
133
|
+
line. A repository's configured hooks (`[hooks]`) can replace a separately
|
|
134
|
+
supervised `ab watch` integration for tooling such as notifiers, but they never
|
|
135
|
+
replace this standing monitor. Normally re-arm with `ab watch --operator --json --since <watch-cursor>`,
|
|
134
136
|
using this standing watch's own cursor. Hosted resume covers the most recent
|
|
135
137
|
1,000 sequence positions (inclusive at head minus 1,000). On typed
|
|
136
138
|
`cursor-too-old`, re-arm without `--since` and reconcile repository/build status;
|
|
@@ -284,7 +286,8 @@ operator presence is not exposed there, and its
|
|
|
284
286
|
in JSON and unrecorded in human output.
|
|
285
287
|
- `ab repository status` — the repository's derived status, including the lease
|
|
286
288
|
holder’s recorded runtime version, commit, and source kind/location, and the
|
|
287
|
-
latest scan's queue diagnostics and startup warnings
|
|
289
|
+
latest scan's queue diagnostics and startup warnings, and each configured
|
|
290
|
+
hook's last delivery, backlog and failure. Historical runtime is
|
|
288
291
|
null in JSON and unrecorded in human output.
|
|
289
292
|
- `ab artifact` — fetch one artifact's bytes.
|
|
290
293
|
|
|
@@ -333,6 +336,11 @@ Read events with a cursor or a small `--events` count; logs are long.
|
|
|
333
336
|
landing, though a node's completeness check may save an
|
|
334
337
|
`integration.observed` diagnostic; re-read status and act on the stated
|
|
335
338
|
reason.
|
|
339
|
+
- `merge polling` on a build means GitHub GraphQL is unavailable to the
|
|
340
|
+
dispatcher, so Autobuild merges the PR itself once GitHub reports it clear to
|
|
341
|
+
merge. It lands only while a dispatcher runs and needs no action. A PR that
|
|
342
|
+
stays `merge polling` while GitHub reports it blocked on a base with a
|
|
343
|
+
classic-protection merge queue never lands by itself: ask a human to merge it.
|
|
336
344
|
- `ab merge <slug> --head <sha>` — bind consent to the head you reviewed. It
|
|
337
345
|
records consent only when `<sha>` (full or at least seven characters) is the
|
|
338
346
|
build's current candidate head; otherwise it refuses with code
|
|
@@ -496,6 +504,12 @@ Treat every default-watch record as a call to act:
|
|
|
496
504
|
or hold it. The build is back in the consent queue until you do.
|
|
497
505
|
- `build.merge-decision`: diagnose the current merge-gate deferral or unsafe
|
|
498
506
|
forge outcome. Consent and hold decisions use only `build.consent-ready`.
|
|
507
|
+
When the reason begins `Awaiting a human merge`, Autobuild cannot land the PR
|
|
508
|
+
itself: GitHub GraphQL is unavailable and the base requires a merge queue, or
|
|
509
|
+
GitHub refused the guarded merge. Tell a human to merge the PR on GitHub,
|
|
510
|
+
through its merge queue when it has one, and relay GitHub's refusal message
|
|
511
|
+
from the reason. Autobuild makes no further attempts and records the merge
|
|
512
|
+
when it happens.
|
|
499
513
|
- Harvest escalation or recovery exhaustion: inspect harvest status and resolve
|
|
500
514
|
the reported blocker.
|
|
501
515
|
- Automatic upgrade failure: inspect repository status for the target, provenance
|
|
@@ -531,6 +545,12 @@ Treat every default-watch record as a call to act:
|
|
|
531
545
|
assuming it sits in Doing. Decide whether to leave it finished or cancelled,
|
|
532
546
|
or return it to Ready for another attempt. Each abandonment reports once;
|
|
533
547
|
history does not replay.
|
|
548
|
+
- Configured hook health (`hook.failing`, `hook.recovered`, `hook.skipped`): a
|
|
549
|
+
hook's command or endpoint has failed for five minutes, recovered, or resumed
|
|
550
|
+
past history or a build announcement it could not read. Inspect `ab repository
|
|
551
|
+
status` for the hook's latest error and backlog and report the broken command,
|
|
552
|
+
endpoint or configuration to the human. A skipped range means the hook's
|
|
553
|
+
consumer missed those records; reconcile what it needed through status.
|
|
534
554
|
- Ticket hand-back (`ticket.handed-back`): the dispatcher returned a claimed or
|
|
535
555
|
ready ticket other than as completion, and the move is already committed.
|
|
536
556
|
`cause` is `abort`, `spec-bounce`, `preparation-failed`, `pr-closed` or
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"build": "ab-hosted-service-build"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@defrex/autobuild-hosted-store-service": "1.
|
|
8
|
-
"@defrex/autobuild": "1.
|
|
7
|
+
"@defrex/autobuild-hosted-store-service": "1.9.0",
|
|
8
|
+
"@defrex/autobuild": "1.9.0",
|
|
9
9
|
"next": "16.1.6",
|
|
10
10
|
"react": "19.2.4",
|
|
11
11
|
"react-dom": "19.2.4"
|