@defrex/autobuild 0.11.0 → 0.12.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 +3 -1
- package/SPEC.md +222 -22
- package/docs/architecture.md +66 -4
- package/docs/configuration.md +105 -16
- package/docs/hosted-dispatcher.md +17 -2
- package/docs/hosted-service.md +214 -0
- package/docs/mcp.md +8 -2
- package/docs/operator-api.md +90 -7
- package/docs/remote-store-protocol.md +189 -144
- package/docs/remote-ticket-protocol.md +107 -19
- package/docs/setup.md +173 -16
- package/docs/ticket-dependencies.md +1 -1
- package/package.json +7 -6
- package/packages/core/src/cli/attention.ts +209 -0
- package/packages/core/src/cli/configured-store.ts +17 -0
- package/packages/core/src/cli/connect.ts +261 -0
- package/packages/core/src/cli/dashboard/model.ts +4 -5
- package/packages/core/src/cli/dispatch.ts +183 -41
- package/packages/core/src/cli/help.ts +39 -10
- package/packages/core/src/cli/init-validation.ts +27 -2
- package/packages/core/src/cli/main.ts +41 -15
- package/packages/core/src/cli/mcp.ts +7 -1
- package/packages/core/src/cli/pr-summary-publication.ts +220 -0
- package/packages/core/src/cli/pr-summary.ts +2 -0
- package/packages/core/src/cli/project-credentials.ts +132 -0
- package/packages/core/src/cli/repo-state.ts +15 -2
- package/packages/core/src/cli/self-update.ts +10 -0
- package/packages/core/src/cli/store-opening.ts +22 -14
- package/packages/core/src/cli/terminals.ts +0 -10
- package/packages/core/src/cli/ticket.ts +8 -1
- package/packages/core/src/cli/upgrade-compatibility.ts +80 -0
- package/packages/core/src/cli/wait.ts +84 -17
- package/packages/core/src/cli/watch.ts +197 -60
- package/packages/core/src/config/live.ts +3 -0
- package/packages/core/src/config/schema.ts +56 -9
- package/packages/core/src/connection.ts +86 -0
- package/packages/core/src/events/catalog.ts +10 -2
- package/packages/core/src/events/payloads.ts +44 -0
- package/packages/core/src/events/repository.ts +13 -0
- package/packages/core/src/kernel/__snapshots__/reducer-registry.test.ts.snap +130 -83
- package/packages/core/src/kernel/engine.ts +24 -0
- package/packages/core/src/kernel/generators/build-log.ts +10 -0
- package/packages/core/src/kernel/log-index.ts +17 -0
- package/packages/core/src/kernel/pr-summary.ts +89 -0
- package/packages/core/src/kernel/reducer-registry.ts +8 -0
- package/packages/core/src/kernel/reducer.ts +8 -0
- package/packages/core/src/ontology.ts +1 -0
- package/packages/core/src/operator/index.ts +7 -0
- package/packages/core/src/operator/query.ts +38 -16
- package/packages/core/src/operator/ticket-source-backend.ts +1 -0
- package/packages/core/src/operator/tickets.ts +6 -8
- package/packages/core/src/plugin-sdk/index.ts +1 -0
- package/packages/core/src/plugins/manifest.ts +5 -3
- package/packages/core/src/plugins/runtimes.ts +3 -1
- package/packages/core/src/ports/forge/fake.ts +13 -1
- package/packages/core/src/ports/forge/github-transport.ts +36 -1
- package/packages/core/src/ports/forge/github.ts +29 -5
- package/packages/core/src/ports/forge/local-git.ts +12 -4
- package/packages/core/src/ports/forge/summary-marker.ts +8 -0
- package/packages/core/src/ports/runner/session-env.ts +1 -0
- package/packages/core/src/ports/tickets/create.ts +11 -3
- package/packages/core/src/ports/tickets/hosted-index.ts +0 -3
- package/packages/core/src/ports/tickets/remote-protocol.ts +1 -0
- package/packages/core/src/ports/tickets/remote.ts +1 -0
- package/packages/core/src/ports/workspace/build-execution.ts +5 -1
- package/packages/core/src/ports/workspace/create.ts +11 -2
- package/packages/core/src/ports/workspace/distribution-archive.ts +3 -5
- package/packages/core/src/ports/workspace/harvest-execution.ts +3 -1
- package/packages/core/src/ports/workspace/local-build-execution.ts +8 -1
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +47 -19
- package/packages/core/src/processes/build-execution-state.ts +1 -1
- package/packages/core/src/processes/build-runner.ts +87 -26
- package/packages/core/src/processes/dispatch-failure-budget.ts +83 -0
- package/packages/core/src/processes/dispatcher.ts +59 -10
- package/packages/core/src/processes/harvest-child.ts +1 -0
- package/packages/core/src/processes/harvest-execution-state.ts +19 -2
- package/packages/core/src/processes/harvest-runner.ts +142 -100
- package/packages/core/src/processes/phase-failure-budget.ts +1 -0
- package/packages/core/src/processes/publication-loss.ts +18 -1
- package/packages/core/src/store/remote/client.ts +1 -1
- package/packages/core/src/store/remote/compatibility.ts +90 -0
- package/packages/core/src/store/remote/credentials.ts +28 -0
- package/packages/core/src/store/remote/index.ts +14 -1
- package/packages/core/src/store/remote/protocol.ts +25 -0
- package/packages/core/src/store/remote/token.ts +74 -13
- package/packages/core/src/testing/index.ts +7 -0
- package/skills/guide/SKILL.md +144 -26
- package/skills/guide/references/operator-api.md +135 -13
- package/skills/guide/references/plugin-authoring.md +10 -2
- package/skills/guide/references/remote-store-protocol.md +189 -144
- package/skills/guide/references/remote-ticket-protocol.md +111 -18
- package/skills/guide/references/setup.md +173 -16
- package/skills/guide/references/ticket-dependencies.md +1 -1
- package/skills/operate/SKILL.md +126 -36
- package/templates/hosted-service/package.json +13 -0
- package/templates/hosted-service/vercel.json +7 -0
|
@@ -28,7 +28,7 @@ maintainer before selecting it:
|
|
|
28
28
|
- a dispatcher-side push-capable `GITHUB_TOKEN` or `GH_TOKEN`;
|
|
29
29
|
- for a private repository, a separate read-only clone identity named by
|
|
30
30
|
`gitUsernameEnv` and `gitPasswordEnv`;
|
|
31
|
-
- an HTTPS hosted
|
|
31
|
+
- an HTTPS hosted service reachable from Vercel, configured through `ab connect <url>`;
|
|
32
32
|
- each selected role and alternate's runtime/model, its pinned
|
|
33
33
|
`[workspace.config.runtimeProvisioning.<runtime>]` commands, and the API
|
|
34
34
|
credential names it needs in `[workspace.config].environmentVariables`.
|
|
@@ -177,7 +177,7 @@ ab dispatch --repository https://github.com/owner/repository \\
|
|
|
177
177
|
```
|
|
178
178
|
|
|
179
179
|
`--repository` (or `AB_REPOSITORY`) is the normalized origin. Origin mode
|
|
180
|
-
requires an HTTPS `
|
|
180
|
+
requires an HTTPS service selected through `[store] url` or `AB_STORE`, a saved project credential or `AB_TOKEN`, an exported `GITHUB_TOKEN` or
|
|
181
181
|
`GH_TOKEN`, and `forge = "github"`; the interactive dashboard is unavailable
|
|
182
182
|
(`--plain` or no TTY). Origin mode never consults the gh CLI: a checkout-less
|
|
183
183
|
host has no gh and no keyring, and the only workspace provider it can run,
|
|
@@ -208,17 +208,34 @@ sources agree with the running system by construction:
|
|
|
208
208
|
**running dispatcher's version** (read from the deployed distribution's
|
|
209
209
|
`package.json`), so the guest runs the dispatcher's own release.
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
A service accepts stable clients from its own `major.minor` release line and
|
|
212
|
+
the two preceding minor lines in the same major. A major starts a new family:
|
|
213
|
+
X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
|
|
214
|
+
Patch versions are interchangeable in both directions and must never change
|
|
215
|
+
the protocol. Upgrade the service first, then projects independently within
|
|
216
|
+
its window. Supported release lines retain their wire handlers and known
|
|
217
|
+
protocol identities; an unknown protocol is refused independently of version.
|
|
218
|
+
Malformed, missing, and prerelease identities are refused with HTTP 409.
|
|
219
|
+
A newer client is told to upgrade the service; a client below the window is
|
|
220
|
+
told to upgrade the project's Autobuild. Diagnostics name the service version
|
|
221
|
+
and supported range.
|
|
222
|
+
|
|
223
|
+
Unauthenticated `GET /health` publishes `ok`, `autobuildVersion`,
|
|
224
|
+
`protocolVersion`, and `supportedClientRange: { minVersion, maxVersionExclusive }`.
|
|
225
|
+
The range is inclusive at the minimum and exclusive at the maximum; a 0.11.x
|
|
226
|
+
service publishes `>=0.9.0 <0.12.0`. Health needs no credentials, version
|
|
227
|
+
headers, or available backend.
|
|
228
|
+
|
|
229
|
+
`ab upgrade` probes this public range before installation or project changes.
|
|
230
|
+
It warns and continues when the target is outside the range, naming the
|
|
231
|
+
required service upgrade for a newer target or a compatible project range for
|
|
232
|
+
an older one. An unavailable or malformed probe warns that connectivity may
|
|
233
|
+
fail after upgrade. Legacy health without a range means exact-version matching;
|
|
234
|
+
upgrade that service to the compatibility-window release first.
|
|
235
|
+
|
|
236
|
+
A distribution fix reaches origin-mode guests after a release is cut and the
|
|
237
|
+
dispatcher is upgraded. Guests continue to run the dispatcher's own version;
|
|
238
|
+
the hosted service must support that release line.
|
|
222
239
|
|
|
223
240
|
Provisioning records the installed distribution's identity — package version
|
|
224
241
|
and remote-store protocol version — in the guest's
|
|
@@ -229,10 +246,10 @@ against the identity the current system would deliver and, when they disagree
|
|
|
229
246
|
(which includes every guest provisioned before the marker existed), refreshes
|
|
230
247
|
it in place (archive re-fetched, extracted, and production-installed) first,
|
|
231
248
|
so an upgraded dispatcher retrofits its existing guests instead of resuming a
|
|
232
|
-
stale distribution
|
|
249
|
+
stale distribution. A refresh failure deletes
|
|
233
250
|
the sandbox so the next provisioning pass rematerializes it from scratch.
|
|
234
251
|
|
|
235
|
-
After a
|
|
252
|
+
After a dispatcher upgrade, confirm a fix-bearing guest from the guest
|
|
236
253
|
perspective:
|
|
237
254
|
|
|
238
255
|
1. `ab build status <slug> --json` with the ambient build identity for a
|
|
@@ -250,7 +267,7 @@ apart from the identity change, `ab dispatch` behaves as it did.
|
|
|
250
267
|
A hosted-store deployment configures its web/auth variables once — see the
|
|
251
268
|
hosted service README and the complete environment reference in the pinned
|
|
252
269
|
distribution checkout: `BETTER_AUTH_URL`, `AB_WEB_ALLOWED_EMAILS`,
|
|
253
|
-
|
|
270
|
+
and the optional `AB_WEB_MCP_RESOURCE` — the protected
|
|
254
271
|
resource the hosted MCP server (docs/mcp.md) binds its OAuth tokens to,
|
|
255
272
|
defaulting to `<BETTER_AUTH_URL>/mcp`. Set it only when a proxy or custom
|
|
256
273
|
domain fronts the deployment under a different public URL than
|
|
@@ -258,6 +275,93 @@ domain fronts the deployment under a different public URL than
|
|
|
258
275
|
production) or every MCP client's discovery binds tokens to the wrong
|
|
259
276
|
resource.
|
|
260
277
|
|
|
278
|
+
|
|
279
|
+
## Connect a project
|
|
280
|
+
|
|
281
|
+
From a checkout with an origin remote, run `ab connect https://YOUR_ORIGIN`.
|
|
282
|
+
The CLI prints a verification URL and short code and attempts to open a browser.
|
|
283
|
+
Sign in as an allowed owner, check the full repository identity and code, and
|
|
284
|
+
approve or deny. Another device can open the printed URL, or visit `/connect`
|
|
285
|
+
and enter the code. Approval requires the web-enabled service origin; a
|
|
286
|
+
standalone machine-only listener cannot present browser consent. Requests
|
|
287
|
+
expire after ten minutes. Denial and timeout leave local configuration unchanged.
|
|
288
|
+
|
|
289
|
+
On approval the service registers the project and issues a project credential.
|
|
290
|
+
The CLI keeps it in `$XDG_CONFIG_HOME/autobuild/credentials` (or
|
|
291
|
+
`~/.config/autobuild/credentials`), keyed by normalized service and origin,
|
|
292
|
+
with directory mode 0700 and file mode 0600. Credentials never belong in the
|
|
293
|
+
repository. It adds the non-secret `[store] url` to `autobuild.toml` when
|
|
294
|
+
absent; review and commit that change yourself. An existing different URL
|
|
295
|
+
must be changed explicitly before connecting. Reconnecting replaces the saved
|
|
296
|
+
credential only after approval and revokes the previous credential.
|
|
297
|
+
|
|
298
|
+
All worktrees share the main checkout's configuration and the user's saved
|
|
299
|
+
credential. A service manager running as that user uses the same HOME and
|
|
300
|
+
XDG_CONFIG_HOME, with no AB_STORE or AB_TOKEN exports. A fresh clone with
|
|
301
|
+
committed store configuration but no saved credential fails with `ab connect`
|
|
302
|
+
guidance; it never silently creates local state. Run connect on each host/user.
|
|
303
|
+
|
|
304
|
+
`ab connect` without a URL reports service, project, and credential status:
|
|
305
|
+
accepted, rejected, missing, or unreachable. `ab disconnect` revokes the saved
|
|
306
|
+
credential remotely before removing it locally, keeping the project registered,
|
|
307
|
+
its data, and store configuration. A network/server failure retains the local
|
|
308
|
+
entry for retry; an already revoked credential can be removed. If saving a new
|
|
309
|
+
connection fails, the CLI cancels/revokes it and retains the previous entry.
|
|
310
|
+
If remote cleanup cannot be confirmed, check the printed credential id with
|
|
311
|
+
the owner's administrative tools before retrying.
|
|
312
|
+
|
|
313
|
+
Store selection is `--store` > nonblank `AB_STORE` > `[store] url` > the
|
|
314
|
+
main checkout's `.autobuild/`. `AB_TOKEN` overrides the exact service/project's
|
|
315
|
+
saved credential for CI and other non-interactive hosts. A service override
|
|
316
|
+
never borrows another service's credential. Build and harvest sessions keep
|
|
317
|
+
their explicit scoped authority.
|
|
318
|
+
|
|
319
|
+
## Connected projects
|
|
320
|
+
|
|
321
|
+
Migrate PostgreSQL from the pinned release before deploying (`bun run
|
|
322
|
+
postgres:migrate`). The service keeps an independent, durable project registry;
|
|
323
|
+
existing build or ticket data does not register a project. An administrator
|
|
324
|
+
with deployment database credentials manages it without redeploying:
|
|
325
|
+
|
|
326
|
+
```sh
|
|
327
|
+
ab-hosted-store projects list
|
|
328
|
+
ab-hosted-store projects add https://github.com/owner/project --user owner@example.com
|
|
329
|
+
ab-hosted-store projects remove https://github.com/owner/project --user owner@example.com
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
From a source checkout, substitute `bun packages/hosted-store-service/src/bin.ts`
|
|
333
|
+
for `ab-hosted-store`. Configure `AB_POSTGRES_URL` or `DATABASE_URL` in that
|
|
334
|
+
process. Database possession grants administration; `--user` is declared audit
|
|
335
|
+
attribution, not a verified login. Ordinary project/store tokens cannot manage
|
|
336
|
+
registrations. Each entry records the normalized origin URL, addition time,
|
|
337
|
+
and adding identity. SSH git spellings normalize to HTTPS; local paths and
|
|
338
|
+
credential-bearing HTTPS URLs are rejected. Duplicate adds preserve metadata;
|
|
339
|
+
remove is idempotent, and re-adding records a fresh addition.
|
|
340
|
+
|
|
341
|
+
Every allowlisted signed-in user owns every registered project. The dashboard,
|
|
342
|
+
MCP discovery and calls, and every operator API route consult current
|
|
343
|
+
registration. Removal hides a project from all these surfaces and subsequent
|
|
344
|
+
hosted dispatcher invocations; builds, events, artifacts and tickets remain,
|
|
345
|
+
and re-registration restores access. Already-started work is not cancelled.
|
|
346
|
+
Project credentials issued by connect authorize only their registered project. Administrative credential issuance remains available for non-interactive hosts.
|
|
347
|
+
|
|
348
|
+
Link directly to `/?repo=<URL-encoded normalized origin>`. The page selects the
|
|
349
|
+
first registered origin when the requested one is missing or removed, and an
|
|
350
|
+
empty registry shows no project data or controls. Registry errors fail closed;
|
|
351
|
+
there is no environment fallback on database failure.
|
|
352
|
+
|
|
353
|
+
`AB_WEB_REPOSITORIES` is deprecated. A nonempty CSV is imported exactly once per
|
|
354
|
+
database, on the first registry initialization with that variable configured,
|
|
355
|
+
with actor `system:AB_WEB_REPOSITORIES`. The import and durable marker commit
|
|
356
|
+
atomically across concurrent starts. An absent variable does not consume the
|
|
357
|
+
marker. Later restarts or edits to the variable never re-add removed projects;
|
|
358
|
+
use the owner commands for subsequent administration.
|
|
359
|
+
|
|
360
|
+
The hosted dispatcher queries current registrations on every authorized
|
|
361
|
+
invocation. With `AB_DISPATCHER_REPOSITORIES` unset, it serves all registered
|
|
362
|
+
projects; an explicit list preserves its order and is intersected with current
|
|
363
|
+
registration. An empty registry is a successful zero-project invocation.
|
|
364
|
+
|
|
261
365
|
## Authoring an agent verifier
|
|
262
366
|
|
|
263
367
|
A repository-owned agent-verify skill is a verifier, not a reviewer: it drives
|
|
@@ -290,3 +394,56 @@ explanation, never a skip or silent pass. Use `skip` only when the complete step
|
|
|
290
394
|
does not apply. If guidance still cannot make a verdict possible, escalate and
|
|
291
395
|
explain what remains unresolved. Record out-of-scope work with `ab observe`;
|
|
292
396
|
the verifier does not fix it.
|
|
397
|
+
|
|
398
|
+
### Project-scoped hosted tickets
|
|
399
|
+
|
|
400
|
+
Hosted ticket queues belong to the credential's registered repository, even
|
|
401
|
+
when projects share a team key. The latest uploaded effective `[tickets]`
|
|
402
|
+
configuration owns lifecycle: hosted defaults are Backlog / Doing / Done,
|
|
403
|
+
`readyState` is required, `doneState` customizes completion, and create/proposal
|
|
404
|
+
default to triage. The union of configured roles is allowed; roles may overlap.
|
|
405
|
+
Owner admin requests require an explicit registered `context.repo`; project
|
|
406
|
+
credentials cannot select another project. Missing effective configuration is
|
|
407
|
+
an actionable refusal: run the project's dispatcher to publish it.
|
|
408
|
+
|
|
409
|
+
The service never contacts Linear. Projects with external sources (including
|
|
410
|
+
file and Linear) keep using those sources directly through their dispatcher;
|
|
411
|
+
service ticket HTTP, operator and MCP surfaces refuse with project/source
|
|
412
|
+
feedback rather than returning an empty queue. Removed `AB_TICKET_BACKEND` and
|
|
413
|
+
`LINEAR_API_KEY` values are ignored with one startup removal message, including
|
|
414
|
+
blank/unknown values. Removed `AB_TICKET_TRIAGE_STATE`, `AB_TICKET_READY_STATE`,
|
|
415
|
+
`AB_TICKET_DOING_STATE` and `AB_TICKET_DONE_STATE` values are ignored even when
|
|
416
|
+
malformed. None of these retired settings prevents startup.
|
|
417
|
+
|
|
418
|
+
The environment-aware migration imports `AB_WEB_REPOSITORIES` once before
|
|
419
|
+
ownership preflight, including released main-v9 deployments without registry
|
|
420
|
+
tables. A failed migration rolls back the import, main-schema promotion and
|
|
421
|
+
ticket changes together. Owner `projects add` and `tickets assign-team` commands
|
|
422
|
+
bootstrap only the registry/recovery journals and work while the main marker
|
|
423
|
+
is still v9. Without the retired environment, first register the intended
|
|
424
|
+
project with `ab-hosted-store projects add REPOSITORY --user IDENTITY`, then
|
|
425
|
+
assign the team and rerun migration. A successful one-time import is never
|
|
426
|
+
reapplied from later environment edits.
|
|
427
|
+
|
|
428
|
+
Ticket schema v1 migration assigns each whole legacy team to its sole claimant
|
|
429
|
+
among registered projects' latest effective configs, reading their actual blob
|
|
430
|
+
bytes. Projects with no dispatcher run or no effective-config reference make
|
|
431
|
+
no team claim and do not block other projects. Unclaimed teams still fail closed.
|
|
432
|
+
When inferring ownership, a selected configuration whose revision/blob is missing,
|
|
433
|
+
unreadable or invalid stops unchanged with recovery guidance. Restore the selected
|
|
434
|
+
configuration or assign every remaining legacy team explicitly; complete owner
|
|
435
|
+
assignments to registered projects bypass unrelated configuration reads. Conflicts
|
|
436
|
+
and asset ownership mismatches also stop unchanged. Resolve ownership, then rerun:
|
|
437
|
+
|
|
438
|
+
```sh
|
|
439
|
+
ab-hosted-store tickets assign-team TEAM https://github.com/acme/app --user owner@example.com
|
|
440
|
+
ab-postgres-store migrate
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
The assignment journal works before v2 assertion, retains the actor, and grants
|
|
444
|
+
no future cross-project access. Migration preserves ids, states, comments,
|
|
445
|
+
blockers, timestamps and assets. Populated-v1 migration and deployment builds
|
|
446
|
+
require the running service's blob backend, access mode, credentials and prefix
|
|
447
|
+
(`AB_BLOB_PREFIX`), not just PostgreSQL access. `deploy:build` inherits this
|
|
448
|
+
environment and migration failure stops Next build. Fresh databases, empty v1
|
|
449
|
+
queues and v2 reruns stay SQL-only and do not initialize blob storage.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`ab ticket create --blocked-by` validates prerequisite ids and records blocking
|
|
4
4
|
relationships, but a single CLI command is **not an atomic publication guarantee**.
|
|
5
|
-
In particular, direct Linear
|
|
5
|
+
In particular, direct Linear creates the issue first and adds
|
|
6
6
|
its blocker relationships in separate requests. If the issue is already in the
|
|
7
7
|
ready state, a dispatcher can see it before those relationships exist. A
|
|
8
8
|
successful create response containing every blocker does not prove that no build
|
package/skills/operate/SKILL.md
CHANGED
|
@@ -24,20 +24,83 @@ after them apply to both.
|
|
|
24
24
|
|
|
25
25
|
## Running locally with the `ab` CLI
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
Each command acts with the operator's authority, so say what you are doing
|
|
28
|
+
before you do anything destructive.
|
|
29
|
+
|
|
30
|
+
### Resolve the local invocation first
|
|
31
|
+
|
|
32
|
+
Before your first Autobuild command, read the repository's package manifests
|
|
33
|
+
and package-manager evidence. A direct `@defrex/autobuild` declaration in
|
|
34
|
+
`dependencies` or `devDependencies` requires the repository's installed
|
|
35
|
+
version. The manifest's own `name` and a transitive dependency are not declarations.
|
|
36
|
+
|
|
37
|
+
Determine the package manager from `packageManager` and the lockfile:
|
|
38
|
+
`bun.lock` / `bun.lockb`, `package-lock.json` / `npm-shrinkwrap.json`,
|
|
39
|
+
`pnpm-lock.yaml`, or `yarn.lock`. Resolve workspace context from the manifest
|
|
40
|
+
declaring the dependency and the repository's package-manager configuration.
|
|
41
|
+
If evidence conflicts or cannot establish the manager, diagnose and tell the
|
|
42
|
+
operator instead of guessing.
|
|
43
|
+
|
|
44
|
+
Verify that the dependency is already installed and that its installed package
|
|
45
|
+
exposes the `ab` binary you will execute. For node_modules installs, verify
|
|
46
|
+
that `./node_modules/.bin/ab` resolves to that installed
|
|
47
|
+
`@defrex/autobuild` package, not another package or a global binary. For Yarn
|
|
48
|
+
PnP, use Yarn's installed dependency and binary evidence to establish ownership.
|
|
49
|
+
Run from the resolved repository/workspace directory:
|
|
50
|
+
|
|
51
|
+
| Package manager | Local-only invocation |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| Bun | `bun run ./node_modules/.bin/ab …` |
|
|
54
|
+
| npm | `npm exec --offline --no --call './node_modules/.bin/ab …'` |
|
|
55
|
+
| pnpm | `pnpm exec ./node_modules/.bin/ab …` |
|
|
56
|
+
| Modern Yarn | `yarn run --binaries-only ab …` |
|
|
57
|
+
| Yarn Classic | `yarn run ab …` |
|
|
58
|
+
|
|
59
|
+
Replace the ellipsis with CLI arguments; for npm they go inside the quoted
|
|
60
|
+
call, with appropriate shell quoting. Do not add `--package` or an inferred
|
|
61
|
+
package name. The explicit path prevents global PATH fallback, and npm's
|
|
62
|
+
offline/no flags prevent registry installation. Modern Yarn's binary-only
|
|
63
|
+
selection supports installed PnP dependencies without assuming node_modules.
|
|
64
|
+
Before using Yarn Classic, verify its installed local binary and check that
|
|
65
|
+
`scripts.ab`, `scripts.preab`, and `scripts.postab` cannot intercept the
|
|
66
|
+
command. Report a script conflict instead of executing it.
|
|
67
|
+
|
|
68
|
+
These forms execute an already-installed dependency. A missing dependency,
|
|
69
|
+
unavailable binary, or failed local execution must be reported to the operator;
|
|
70
|
+
never hide it with global fallback or install dependencies automatically.
|
|
71
|
+
Never use bare `bunx ab`, `npx ab`, `dlx`, or other registry-fetching
|
|
72
|
+
variants: the registry package named `ab` is not Autobuild. Offline cache
|
|
73
|
+
availability alone does not prove a local installation.
|
|
74
|
+
|
|
75
|
+
Only when no local declaration exists may you use global `ab`. In either
|
|
76
|
+
case run the resolved invocation with `--version` and report the invocation,
|
|
77
|
+
working directory, and actual version when you start orchestrating.
|
|
78
|
+
|
|
79
|
+
Every `ab …` example in this skill means this resolved invocation, run from
|
|
80
|
+
the same resolved working directory.
|
|
29
81
|
|
|
30
82
|
### Watch for attention events
|
|
31
83
|
|
|
32
|
-
`ab watch --json`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
84
|
+
`ab watch --json` is the standing monitor. Keep its default filter: every
|
|
85
|
+
record calls for action. It reports build escalations and merge decisions,
|
|
86
|
+
harvest escalations/recovery exhaustion, rejected configuration, reloads needing
|
|
87
|
+
restart, abnormal dispatcher stops/loss, degradation past reset (15 minutes
|
|
88
|
+
without reset), and five minutes of continuous tick failures. Advertised resets
|
|
89
|
+
wait for a post-reset tick to finish before requiring action; ordinary recovery
|
|
90
|
+
on that retry stays silent. Source grace and cooldown-driven failures do not
|
|
91
|
+
start the tick-failure clock. Routine outcomes and self-healing failures stay silent.
|
|
92
|
+
|
|
93
|
+
Every record carries a cursor; bounded watches end with a bare `{"cursor": …}`
|
|
94
|
+
line. Resume with `--since <cursor>`. Named watches end when all named builds
|
|
95
|
+
are terminal; add `--repository` for repository attention. With no slugs all
|
|
96
|
+
active builds and repository attention are included. Reconcile status after
|
|
97
|
+
arming because historical build attention is silently baselined.
|
|
98
|
+
|
|
99
|
+
Add an extra monitor only for an identified need, such as an operator asking
|
|
100
|
+
to hear when a particular build merges or an outcome triggering follow-up work.
|
|
101
|
+
Scope it to named slugs and explicit `--event` globs (for example,
|
|
102
|
+
`ab watch my-build --event pr.merged --json`), and retire it when that need ends.
|
|
103
|
+
An extra monitor supplements the default standing watch.
|
|
41
104
|
|
|
42
105
|
`ab wait [<slug>...] (--for <condition> | --event <glob>) [--since <cursor>] [--json]`
|
|
43
106
|
blocks until a condition holds and prints one record. `--for` state conditions
|
|
@@ -51,7 +114,10 @@ bare `{"cursor": …}` to resume from.
|
|
|
51
114
|
|
|
52
115
|
Run long watches and waits in whatever background or monitor facility your
|
|
53
116
|
harness provides, so the session stays responsive and you are woken when they
|
|
54
|
-
emit.
|
|
117
|
+
emit. Use precisely the same resolved invocation and working directory as
|
|
118
|
+
foreground commands, including inside background shells and harness monitors.
|
|
119
|
+
Do not rely on a shell alias or function that those facilities may lose.
|
|
120
|
+
Never block a foreground command for their whole duration.
|
|
55
121
|
|
|
56
122
|
Ticket-source degradation records mean dispatch intake cannot evaluate the source;
|
|
57
123
|
existing builds may still advance. Inspect `ab repository status --json` for the
|
|
@@ -59,7 +125,7 @@ active cause, operation, message, and expected reset. Reset times are advisory;
|
|
|
59
125
|
recovery means reads actually succeeded. Allow the existing cooldown and retry
|
|
60
126
|
behavior, investigate persistent ready-scan failures or a condition still active
|
|
61
127
|
after its reset estimate, and keep watching through recovery. Empty builds do
|
|
62
|
-
not establish idle intake;
|
|
128
|
+
not establish idle intake; diagnose persistent trouble and report it to the operator.
|
|
63
129
|
|
|
64
130
|
Repository records have null build and state. Handle them with repository
|
|
65
131
|
status rather than build commands, keep their cursor, and re-arm. A legacy
|
|
@@ -69,8 +135,8 @@ cannot recover its earlier interval: reconcile current repository status.
|
|
|
69
135
|
attention watch.
|
|
70
136
|
|
|
71
137
|
|
|
72
|
-
Check dispatcher liveness with `ab repository status --json`
|
|
73
|
-
|
|
138
|
+
Check dispatcher liveness with `ab repository status --json` after a watch
|
|
139
|
+
timeout or `dispatcher.lost` observation, or when dispatch appears unhealthy. Do not
|
|
74
140
|
use process lists to decide whether a dispatcher owns this repository. The
|
|
75
141
|
`dispatcher` projection distinguishes `held` (an unexpired lease), `lost`
|
|
76
142
|
(expired ownership without a recorded stop), `stopped`, and `absent`. Its holder
|
|
@@ -84,7 +150,8 @@ read-only observation: `{repo, build:null, state:null, observation:{type:
|
|
|
84
150
|
"dispatcher.lost", run, observedAt, leaseExpiresAt, ...identity}, cursor}`.
|
|
85
151
|
It has no durable event envelope. Keep its cursor just as for event records;
|
|
86
152
|
resuming it suppresses repeated loss reports for that run. Inspect repository
|
|
87
|
-
status
|
|
153
|
+
status to diagnose the condition and report dispatcher trouble to the operator.
|
|
154
|
+
Neither a loss observation nor a later retry authorizes dispatcher intervention.
|
|
88
155
|
|
|
89
156
|
### Keep watching until the work is done
|
|
90
157
|
|
|
@@ -92,7 +159,7 @@ Checking once is not shepherding. When you take responsibility for builds:
|
|
|
92
159
|
|
|
93
160
|
1. Record the set you are shepherding (`ab builds --all --json`, or the slugs
|
|
94
161
|
you were given).
|
|
95
|
-
2. Arm
|
|
162
|
+
2. Arm the default standing watch and keep its cursor:
|
|
96
163
|
`ab watch --json --since <cursor>` (or named slugs with `--repository`) (omit `--since` the first
|
|
97
164
|
time). Events are delivered exactly once, so a build that already finished
|
|
98
165
|
is never replayed. Do not loop on `ab wait --for terminal|attention|…`:
|
|
@@ -109,12 +176,12 @@ Checking once is not shepherding. When you take responsibility for builds:
|
|
|
109
176
|
every timeout or legacy-cursor attachment. Reading status after arming leaves no gap — anything earlier shows in
|
|
110
177
|
the status, anything later arrives as an event. Treat a terminal status
|
|
111
178
|
(merged, closed, aborted) as that build's outcome, and an open escalation
|
|
112
|
-
or
|
|
179
|
+
or merge decision as attention to handle now.
|
|
113
180
|
4. When a watch returns records, react: read the record, inspect the build,
|
|
114
|
-
|
|
181
|
+
resolve attention using the shared rules; for a repository record inspect repository status and act
|
|
115
182
|
on its condition without assuming a build slug. Then re-arm from the last cursor. Keep your own
|
|
116
|
-
outcome table
|
|
117
|
-
|
|
183
|
+
outcome table from status reconciliation after named-watch exit and bounded
|
|
184
|
+
watch timeouts. Default watches do not emit routine merge/completion records. A timeout (exit 3, or a watch
|
|
118
185
|
that ends with only a `{"cursor": …}` line) is not completion — reconcile
|
|
119
186
|
as in step 3, then re-arm from that cursor.
|
|
120
187
|
5. Stop only when every build in the set has an outcome in your table.
|
|
@@ -241,19 +308,24 @@ report it, adapt, and carry on.
|
|
|
241
308
|
|
|
242
309
|
### The attention set
|
|
243
310
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
operator
|
|
255
|
-
|
|
256
|
-
|
|
311
|
+
A wake turn's first message carries the configured event record and the
|
|
312
|
+
build's reduced state as JSON. Existing hosted wake settings are independent
|
|
313
|
+
of CLI watch defaults; reconcile current state before acting on their routine
|
|
314
|
+
outcomes or self-healing failures.
|
|
315
|
+
|
|
316
|
+
Treat every default-watch record as a call to act:
|
|
317
|
+
|
|
318
|
+
- `escalation.raised`: inspect the question and evidence, then resolve it using
|
|
319
|
+
the shared rules.
|
|
320
|
+
- `build.merge-decision`: inspect the PR and current merge gate, then apply
|
|
321
|
+
the operator's merge policy or request the decision that is missing.
|
|
322
|
+
- Harvest escalation or recovery exhaustion: inspect harvest status and resolve
|
|
323
|
+
the reported blocker.
|
|
324
|
+
- Dispatcher loss, abnormal stop, restart-required reload, rejected config, or
|
|
325
|
+
persistent tick failure: diagnose through repository status and report the
|
|
326
|
+
condition to the operator. Never start or run a dispatcher.
|
|
327
|
+
- Persistent source degradation: inspect the source cause and reset evidence,
|
|
328
|
+
diagnose and report the continuing intake problem.
|
|
257
329
|
|
|
258
330
|
Do not re-derive history the build's events already tell you; read events
|
|
259
331
|
with a cursor and keep it short.
|
|
@@ -262,6 +334,16 @@ with a cursor and keep it short.
|
|
|
262
334
|
|
|
263
335
|
These apply in both settings. Where the text below says "plain streamed text", a local session means plain text to the human in the session.
|
|
264
336
|
|
|
337
|
+
### Resolve attention by default
|
|
338
|
+
|
|
339
|
+
Make a best effort to resolve attention without operator input. Inspect the
|
|
340
|
+
escalation, spec, code, build artifacts/events, and applicable operator notes.
|
|
341
|
+
Answer questions supported by that evidence, retry when the evidence warrants
|
|
342
|
+
it, and file or move tickets where that is clearly right, within the existing
|
|
343
|
+
ready-state authorization boundary. Investigate before asking; the exceptions
|
|
344
|
+
below govern when the evidence or available tools cannot resolve the issue,
|
|
345
|
+
or a human decision is required.
|
|
346
|
+
|
|
265
347
|
### When to escalate instead of act
|
|
266
348
|
|
|
267
349
|
Stop and ask the operator — in plain streamed text — whenever:
|
|
@@ -273,11 +355,19 @@ Stop and ask the operator — in plain streamed text — whenever:
|
|
|
273
355
|
- A tool refusal repeats and you cannot resolve it with the tools you have.
|
|
274
356
|
- The attention event is one you cannot act on with the tools you have at all.
|
|
275
357
|
|
|
276
|
-
Filing a ticket
|
|
277
|
-
|
|
358
|
+
Filing a ticket is acting — do it when the request is concrete. Default to
|
|
359
|
+
resolving attention yourself within these boundaries; ask the operator only
|
|
360
|
+
for the exceptions above.
|
|
278
361
|
|
|
279
362
|
### Boundaries
|
|
280
363
|
|
|
364
|
+
- Never start, restart, or stop a dispatcher: no `ab dispatch` in any mode,
|
|
365
|
+
and no dispatcher process-management commands. This applies when the
|
|
366
|
+
dispatcher is lost, stopped, absent, or failing repeatedly. Its lease,
|
|
367
|
+
process, and configuration management belong to the operator. Diagnose
|
|
368
|
+
through repository status and report trouble to the operator; reporting
|
|
369
|
+
does not authorize process intervention, including on a later retry.
|
|
370
|
+
|
|
281
371
|
- You never claim to have done anything outside the tools you have. If you cannot
|
|
282
372
|
observe it with a tool, say you cannot observe it.
|
|
283
373
|
- You never invent repository identity, ticket ids, or build slugs; every
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"scripts": {
|
|
4
|
+
"build": "ab-hosted-service-build"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@defrex/autobuild-hosted-store-service": "0.12.0",
|
|
8
|
+
"@defrex/autobuild": "0.12.0",
|
|
9
|
+
"next": "16.1.6",
|
|
10
|
+
"react": "19.2.4",
|
|
11
|
+
"react-dom": "19.2.4"
|
|
12
|
+
}
|
|
13
|
+
}
|