@defrex/autobuild 1.0.0-beta.4 → 1.0.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 +45 -36
- package/docs/agent-runtimes.md +157 -0
- package/docs/build-store.md +123 -0
- package/docs/builds.md +82 -0
- package/docs/cli.md +48 -0
- package/docs/configuration-overview.md +93 -0
- package/docs/configuration.md +1626 -204
- package/docs/dispatcher-hosting.md +115 -0
- package/docs/dispatcher.md +59 -0
- package/docs/forges.md +121 -0
- package/docs/getting-started.md +60 -0
- package/docs/glossary.md +60 -0
- package/docs/hosted-service.md +2 -2
- package/docs/intake.md +48 -0
- package/docs/integration-overview.md +81 -0
- package/docs/operating.md +114 -0
- package/docs/operator-api.md +6 -6
- package/docs/operator-surfaces.md +90 -0
- package/docs/overview.md +49 -0
- package/docs/plugin-authoring.md +426 -0
- package/docs/remote-store-protocol.md +8 -8
- package/docs/seams.md +66 -0
- package/docs/setup.md +8 -6
- package/docs/skills.md +119 -0
- package/docs/ticket-sources.md +132 -0
- package/docs/tickets.md +69 -0
- package/docs/troubleshooting.md +111 -0
- package/docs/upgrading.md +50 -0
- package/docs/verification.md +146 -0
- package/docs/website.md +47 -5
- package/docs/workspaces.md +152 -0
- package/package.json +5 -4
- package/packages/core/src/cli/env.ts +1 -1
- package/packages/core/src/cli/help.ts +4 -2
- package/packages/core/src/config/landing.ts +8 -0
- package/packages/core/src/config/reference-metadata.ts +31 -0
- package/packages/core/src/config/reference.ts +342 -0
- package/packages/core/src/config/roles.ts +1 -1
- package/packages/core/src/config/schema.ts +344 -6
- package/packages/core/src/ontology.ts +2 -2
- package/packages/core/src/open-map.ts +3 -1
- package/skills/finalize/SKILL.md +3 -1
- package/skills/guide/SKILL.md +42 -25
- package/skills/guide/references/operator-api.md +18 -10
- package/skills/guide/references/plugin-authoring.md +227 -303
- package/skills/guide/references/remote-store-protocol.md +8 -8
- package/skills/guide/references/setup.md +8 -6
- package/skills/implement/SKILL.md +4 -2
- package/skills/operate/SKILL.md +26 -27
- package/skills/plan/SKILL.md +12 -4
- package/skills/spec/SKILL.md +1 -1
- package/skills/tickets/SKILL.md +1 -1
- package/templates/hosted-service/package.json +2 -2
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Dispatcher hosting"
|
|
3
|
+
group: "reference"
|
|
4
|
+
description: "Run the dispatcher locally or through bounded hosted invocations over durable state."
|
|
5
|
+
label: "Dispatcher hosting"
|
|
6
|
+
order: 11
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Dispatcher hosting
|
|
10
|
+
|
|
11
|
+
## Responsibility
|
|
12
|
+
|
|
13
|
+
The dispatcher claims eligible tickets, starts and observes build runners, settles publication and landing, and recovers durable work. Local and hosted arrangements run the same kernel. Your operator agent acts through the CLI or MCP; Autobuild never starts it.
|
|
14
|
+
|
|
15
|
+
## Shipped arrangements
|
|
16
|
+
|
|
17
|
+
### Local process
|
|
18
|
+
|
|
19
|
+
<!-- seam-config:start -->
|
|
20
|
+
```toml
|
|
21
|
+
forge = "github"
|
|
22
|
+
|
|
23
|
+
[tickets]
|
|
24
|
+
source = "file"
|
|
25
|
+
readyState = "ready"
|
|
26
|
+
```
|
|
27
|
+
<!-- seam-config:end -->
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
bun ab dispatch
|
|
31
|
+
# Or perform one bounded pass:
|
|
32
|
+
bun ab dispatch --once
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The host needs:
|
|
36
|
+
|
|
37
|
+
- the runtime CLI, dependencies, Git and check tools ([Workspaces](workspaces.md))
|
|
38
|
+
- runtime authentication and forge credentials ([Forges](forges.md) covers precedence)
|
|
39
|
+
- credentials for a remote Store or workspace provisioning, if used
|
|
40
|
+
|
|
41
|
+
A service manager may own the process under an identity with the same configuration and credentials. To restart, stop gracefully and let drain and suspension finish; work resumes from durable state. A restart never answers escalations or grants landing consent. See [the dispatcher lifecycle](dispatcher.md).
|
|
42
|
+
|
|
43
|
+
### Hosted scheduled dispatcher
|
|
44
|
+
|
|
45
|
+
Commit a remote-compatible configuration to the base branch:
|
|
46
|
+
|
|
47
|
+
<!-- seam-config:start -->
|
|
48
|
+
```toml
|
|
49
|
+
forge = "github"
|
|
50
|
+
plugins = ["@defrex/autobuild-vercel-sandbox"]
|
|
51
|
+
|
|
52
|
+
[store]
|
|
53
|
+
url = "https://builds.example.com"
|
|
54
|
+
|
|
55
|
+
[tickets]
|
|
56
|
+
source = "hosted"
|
|
57
|
+
teamKey = "ENG"
|
|
58
|
+
|
|
59
|
+
[workspace]
|
|
60
|
+
provider = "vercel-sandbox"
|
|
61
|
+
|
|
62
|
+
[workspace.config]
|
|
63
|
+
timeoutSeconds = 2700
|
|
64
|
+
environmentVariables = ["AI_GATEWAY_API_KEY"]
|
|
65
|
+
|
|
66
|
+
[workspace.config.runtimeProvisioning.pi]
|
|
67
|
+
install = "npm install --global --ignore-scripts @earendil-works/pi-coding-agent@0.84.4"
|
|
68
|
+
preflight = "test \"$(pi --version)\" = \"0.84.4\" && pi update --models"
|
|
69
|
+
|
|
70
|
+
[roles.default]
|
|
71
|
+
runtime = "pi"
|
|
72
|
+
model = "vercel-ai-gateway/anthropic/claude-sonnet-4.6"
|
|
73
|
+
```
|
|
74
|
+
<!-- seam-config:end -->
|
|
75
|
+
|
|
76
|
+
- **Required:** hosted HTTP Store, GitHub forge, remote ticket source, remote workspace. Hosted tickets need the registered project's team key.
|
|
77
|
+
- **Install the Sandbox plugin** in the project and make it available to the dispatcher deployment.
|
|
78
|
+
- **Replace the example** runtime, model and provisioning commands with values for your account.
|
|
79
|
+
|
|
80
|
+
Deploy `@defrex/autobuild-hosted-dispatcher` and mount its `dispatcherEndpoint()` at `/api/dispatch`; a store-only deployment never dispatches. Server-only environment includes:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
export AB_DISPATCHER_ORIGIN='https://builds.example.com'
|
|
84
|
+
export CRON_SECRET='<schedule secret>'
|
|
85
|
+
export GITHUB_TOKEN='<repository publication token>'
|
|
86
|
+
export DATABASE_URL='<postgres connection URL>'
|
|
87
|
+
export AI_GATEWAY_API_KEY='<runtime API credential>'
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Plus the Store's signing, blob and auth secrets, and registered projects.
|
|
91
|
+
|
|
92
|
+
- **Authority.** A hosted invocation mints project-scoped authority; a separately launched origin-mode CLI uses its saved project credential or `AB_TOKEN`.
|
|
93
|
+
- **Origin dispatch** reads configuration from the forge, needs exported forge credentials, and can't load checkout-relative plugins.
|
|
94
|
+
- **Sandbox provisioning.** On Vercel, the invocation's OIDC identity authenticates; don't add `VERCEL_TOKEN`. Elsewhere, it needs a durable token, team and project, or short-lived OIDC credentials ([Workspaces](workspaces.md)).
|
|
95
|
+
- **Guests** get only the declared runtime API credentials, never Store or forge secrets.
|
|
96
|
+
|
|
97
|
+
Schedule authenticated invocations:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"crons": [{ "path": "/api/dispatch", "schedule": "* * * * *" }]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Build the distribution's guest archive into the function bundle before deploying; the function can't pack it at runtime.
|
|
106
|
+
|
|
107
|
+
- **Bounded ticks:** a 240-second default work budget inside a 300-second route. Unfinished work resumes on later ticks; guests run independently.
|
|
108
|
+
- **Overlap:** the repository supervisor lease makes overlapping invocations yield.
|
|
109
|
+
- Selecting Postgres alone never moves dispatch here.
|
|
110
|
+
|
|
111
|
+
## Writing your own
|
|
112
|
+
|
|
113
|
+
There's no hosting plugin port. Invoke the local or origin dispatcher entrypoints with supported Store, workspace and forge adapters, and keep coordination in durable state, never private channels between processes.
|
|
114
|
+
|
|
115
|
+
See [Writing a plugin](plugin-authoring.md) for adapters and [Build store](build-store.md#writing-your-own) for custom storage.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "The dispatcher and durable state"
|
|
3
|
+
group: "concepts"
|
|
4
|
+
description: "How Autobuild claims ready tickets, runs isolated builds within capacity, and resumes from its event log."
|
|
5
|
+
label: "Dispatcher"
|
|
6
|
+
order: 3
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# The dispatcher and durable state
|
|
10
|
+
|
|
11
|
+
The dispatcher is the long-running process that turns ready tickets into builds. Agents supply judgment inside the pipeline; deterministic code decides what runs next.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
bun ab dispatch
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
It watches your ticket source, claims eligible tickets, pins their specs, and starts isolated build-runners up to capacity.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Ready work becomes a build
|
|
21
|
+
|
|
22
|
+
A ticket is claimed when it passes every gate:
|
|
23
|
+
|
|
24
|
+
- **Ready state.** The configured workflow state, required labels and source filters.
|
|
25
|
+
- **Blockers.** Every dependency is done.
|
|
26
|
+
- **Destination.** Its target (`main` or an integration node) accepts new work.
|
|
27
|
+
|
|
28
|
+
Others stay queued. See [Tickets and specs](tickets.md) for grooming and [Intake and harvest](intake.md) for proposed work.
|
|
29
|
+
|
|
30
|
+
Each build gets its own workspace (local git worktree or remote sandbox) and a build-runner that owns its pipeline. Capacity caps concurrency: a work build holds a slot while it runs; an integration node holds one only while it verifies, not while collecting children. See [the integration tree](integration-overview.md).
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## The log is the source of truth
|
|
34
|
+
|
|
35
|
+
The BuildStore holds typed, append-only event logs and artifacts:
|
|
36
|
+
|
|
37
|
+
- **Per-build log.** Phase transitions, verdicts, escalations and answers.
|
|
38
|
+
- **Repository journal.** Dispatcher runs, harvest and operator settings.
|
|
39
|
+
- **Artifacts.** Specs, plans, reports and evidence.
|
|
40
|
+
|
|
41
|
+
State is reduced from those events; a snapshot is only a cache.
|
|
42
|
+
|
|
43
|
+
Agents report through the typed `ab` CLI (`ab done`, `ab verdict`), not their output; code validates the deposit, applies the gates and records the transition.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Resume the work, not the chat
|
|
47
|
+
|
|
48
|
+
A restart loses nothing. The dispatcher continues each build from its recorded phase, completed boundaries, artifacts and feedback, even in a replacement sandbox. Authority boundaries hold:
|
|
49
|
+
|
|
50
|
+
- Unanswered escalations stay parked until your operator agent answers.
|
|
51
|
+
- Pending operator commands and actionable work proceed.
|
|
52
|
+
- A restart never grants permission or resets an exhausted retry budget.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## The operator agent stays outside
|
|
56
|
+
|
|
57
|
+
Your operator agent is an external coding agent you direct, like Claude Code or Codex. It files and grooms tickets with you, watches builds, answers bounded escalations and manages landing consent, using the `ab` CLI locally or the same tools over MCP. You make the product calls. Autobuild never hosts or starts it, and its chat isn't part of the build's paper trail.
|
|
58
|
+
|
|
59
|
+
Next: [operator surfaces](operator-surfaces.md) for the controls, [one build end to end](builds.md) for the phases.
|
package/docs/forges.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Forges"
|
|
3
|
+
group: "reference"
|
|
4
|
+
description: "Choose GitHub or local git and implement safe code publication and landing."
|
|
5
|
+
label: "Forges"
|
|
6
|
+
order: 9
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Forges
|
|
10
|
+
|
|
11
|
+
## Responsibility
|
|
12
|
+
|
|
13
|
+
The forge publishes code and represents pull requests.
|
|
14
|
+
|
|
15
|
+
- **The kernel owns the forge.** Pushes, PRs, comments, landing and merge happen in deterministic code.
|
|
16
|
+
- **Agents only commit locally.** They never push or see forge credentials.
|
|
17
|
+
- **Publication is exact.** The branch head read back from the forge must equal the intended SHA.
|
|
18
|
+
|
|
19
|
+
## Shipped adapters
|
|
20
|
+
|
|
21
|
+
### GitHub
|
|
22
|
+
|
|
23
|
+
The default, selected explicitly in this complete configuration:
|
|
24
|
+
|
|
25
|
+
<!-- seam-config:start -->
|
|
26
|
+
```toml
|
|
27
|
+
forge = "github"
|
|
28
|
+
|
|
29
|
+
[tickets]
|
|
30
|
+
source = "file"
|
|
31
|
+
readyState = "ready"
|
|
32
|
+
```
|
|
33
|
+
<!-- seam-config:end -->
|
|
34
|
+
|
|
35
|
+
Export a token for the dispatcher:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
export GITHUB_TOKEN='<push-capable repository token>'
|
|
39
|
+
bun ab init --validate
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Credential precedence:
|
|
43
|
+
|
|
44
|
+
1. `GITHUB_TOKEN`, if nonblank
|
|
45
|
+
2. `GH_TOKEN`, if nonblank
|
|
46
|
+
3. local `gh auth token` login, checkout-mode local workspaces only
|
|
47
|
+
|
|
48
|
+
Origin mode and Vercel Sandbox need an exported token. Never forward kernel credentials to guests; private cloning uses a separate read-only identity.
|
|
49
|
+
|
|
50
|
+
| Permission | Used for |
|
|
51
|
+
|---|---|
|
|
52
|
+
| Contents: write | publishing branches |
|
|
53
|
+
| Pull requests: write | opening and updating PRs |
|
|
54
|
+
| Metadata, Administration: read | readiness checks |
|
|
55
|
+
|
|
56
|
+
A classic token on a private repository needs the `repo` scope instead. Validation doesn't guarantee a merge: branch protection, required checks, merge settings and permissions can still defer landing.
|
|
57
|
+
|
|
58
|
+
### Local git
|
|
59
|
+
|
|
60
|
+
<!-- seam-config:start -->
|
|
61
|
+
```toml
|
|
62
|
+
forge = "local-git"
|
|
63
|
+
|
|
64
|
+
[tickets]
|
|
65
|
+
source = "file"
|
|
66
|
+
readyState = "ready"
|
|
67
|
+
```
|
|
68
|
+
<!-- seam-config:end -->
|
|
69
|
+
|
|
70
|
+
Needs only Git and a writable repository.
|
|
71
|
+
|
|
72
|
+
- **Pull requests** are JSON records under private `refs/autobuild/` refs, linking to local branch refs.
|
|
73
|
+
- **Publication** confirms the local branch; nothing is uploaded.
|
|
74
|
+
- **Landing** makes a head-guarded squash commit with compare-and-swap ref updates, waiting while the checked-out destination has unsafe local changes.
|
|
75
|
+
|
|
76
|
+
It can't serve remote sandboxes; use GitHub there.
|
|
77
|
+
|
|
78
|
+
## Writing your own
|
|
79
|
+
|
|
80
|
+
[Writing a plugin](plugin-authoring.md) covers the module, packaging and capability contract. For a forge:
|
|
81
|
+
|
|
82
|
+
1. Register a `ForgePluginFactory` in `forges`.
|
|
83
|
+
2. Expose a `ForgeContractFactory`.
|
|
84
|
+
3. Run the shared harness unchanged before dispatching:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
bun ab plugin test forge acme
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then select it:
|
|
91
|
+
|
|
92
|
+
<!-- seam-config:start -->
|
|
93
|
+
```toml
|
|
94
|
+
plugins = ["./autobuild-plugin.ts"]
|
|
95
|
+
forge = "acme"
|
|
96
|
+
|
|
97
|
+
[tickets]
|
|
98
|
+
source = "file"
|
|
99
|
+
readyState = "ready"
|
|
100
|
+
```
|
|
101
|
+
<!-- seam-config:end -->
|
|
102
|
+
|
|
103
|
+
An adapter must provide:
|
|
104
|
+
|
|
105
|
+
- idempotent PR creation
|
|
106
|
+
- exact-SHA publication confirmation, never inferred from ancestry or a push response
|
|
107
|
+
- guarded landing and comments
|
|
108
|
+
- every capability it advertises
|
|
109
|
+
|
|
110
|
+
Reconciliation needs the optional `Forge.rewrite` group: immutable exact-SHA archives, branch snapshots and head-guarded replacement. Report lease mismatches separately and preserve unknown work. Without it, reconciliation fails with an actionable refusal, never an ordinary push.
|
|
111
|
+
|
|
112
|
+
Classify failures with `ForgeFailure` (API 1.8):
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
{ kind: 'rate-limited', resetAt } // resetAt: a valid ISO timestamp
|
|
116
|
+
{ kind: 'transient', retry: 'retryable' } // retryable transport failures
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Ordinary policy or permission refusals stay deferrals.
|
|
120
|
+
|
|
121
|
+
Optional `observeRequests` observers count every wire request, including failures and pagination, attributed to a build when known, excluding skipped calls and credential discovery; no observer means "unknown", not zero. Keep tokens out of failures and telemetry.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Getting started"
|
|
3
|
+
group: "start"
|
|
4
|
+
description: "Install Autobuild in your repository, configure it with ab init, validate setup, start the dispatcher, and ask your operator agent for the first change."
|
|
5
|
+
label: "Getting started"
|
|
6
|
+
order: 1
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Getting started
|
|
10
|
+
|
|
11
|
+
Start in the repository you want Autobuild to build. You need:
|
|
12
|
+
|
|
13
|
+
- [Bun](https://bun.sh) and git
|
|
14
|
+
- your agent runtime's local prerequisites: Claude Code, Codex CLI, or Pi
|
|
15
|
+
- for the GitHub forge, an authenticated [gh CLI](https://cli.github.com) or an exported `GITHUB_TOKEN` or `GH_TOKEN`; the local-git forge needs no account or remote
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1. Install in the repository
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
bun add -D @defrex/autobuild
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Run the CLI as `bun ab`. If installation creates `package.json` and `bun.lock`, commit them and ignore `node_modules/`.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 2. Initialize and configure
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
bun ab init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Initialization vendors the editable `ab-*` skills, writes a stack-neutral `autobuild.toml`, and hands repository-aware setup to a coding agent. Follow that handoff to choose a runtime and model, ticket tracker, forge, workspace, and meaningful verification commands for your stack.
|
|
34
|
+
|
|
35
|
+
An **acceptance check** is a repository-owned agent verify step that runs the built software, exercises each acceptance criterion in the spec, attaches evidence, and returns a typed verdict. See the [verification guide](verification.md).
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 3. Start dispatch
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
bun ab dispatch
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Run this yourself and leave it running. The dispatcher shows a live dashboard and claims tickets as they enter the tracker's configured ready state; a draft or triage ticket isn't ready.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## 4. Ask your operator agent for the first change
|
|
48
|
+
|
|
49
|
+
Open your coding agent at the repository root, then ask in plain language:
|
|
50
|
+
|
|
51
|
+
> Help me specify a small retry-budget change. Ask me about the behavior and limits, file and groom the ticket when we agree, and watch it through landing. Ask me before granting landing consent.
|
|
52
|
+
|
|
53
|
+
The agent works out acceptance criteria, scope, and evidence with you.
|
|
54
|
+
|
|
55
|
+
- Keep the first change small, with checks that demonstrate success. The [spec standard](tickets.md#groom-a-buildable-spec) defines a buildable ticket.
|
|
56
|
+
- With dispatch running, a ticket moved to ready is eligible for claim immediately.
|
|
57
|
+
- Your agent watches progress and answers build questions within your instructions, bringing unresolved decisions back to you.
|
|
58
|
+
- Landing follows the configured policy and gates; a green build doesn't guarantee immediate merge.
|
|
59
|
+
|
|
60
|
+
Continue with [Working with your operator agent](operating.md) and the [configuration reference](configuration-overview.md).
|
package/docs/glossary.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Glossary
|
|
3
|
+
group: reference
|
|
4
|
+
order: 19
|
|
5
|
+
description: "Definitions for tickets, integration, execution boundaries, and agent roles."
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Glossary
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
One execution of a claimed ticket: an immutable slug and a durable event stream. Work builds run the [fixed pipeline](builds.md); node builds collect, verify and land contributions.
|
|
13
|
+
|
|
14
|
+
## Ticket
|
|
15
|
+
|
|
16
|
+
A tracked unit of proposed work or a finite integration point, dispatchable once it passes readiness and dependency gates. See [Tickets](tickets.md).
|
|
17
|
+
|
|
18
|
+
## Spec
|
|
19
|
+
|
|
20
|
+
The build's contract: intent, rationale, acceptance criteria, scope limits and evidence, set by grooming under the [spec standard](tickets.md#groom-a-buildable-spec).
|
|
21
|
+
|
|
22
|
+
## Node
|
|
23
|
+
|
|
24
|
+
A finite integration build that collects child contributions, verifies its exact head against its parent and lands into it. Nodes nest and close when complete. See [integration trees](integration-overview.md).
|
|
25
|
+
|
|
26
|
+
## Target
|
|
27
|
+
|
|
28
|
+
Where a ticket's work lands: a node ticket, or the configured root when omitted. Blockers, not targets, decide when work starts.
|
|
29
|
+
|
|
30
|
+
## Seam
|
|
31
|
+
|
|
32
|
+
A narrow interface between the kernel and infrastructure: ticket sources, stores, runtimes. See [Seams](seams.md).
|
|
33
|
+
|
|
34
|
+
## Adapter
|
|
35
|
+
|
|
36
|
+
A seam implementation for one provider or environment. The kernel keeps lifecycle decisions.
|
|
37
|
+
|
|
38
|
+
## Verifier
|
|
39
|
+
|
|
40
|
+
A deterministic check or evidence-judging agent that tests a build against its contract and reports a typed outcome. Code decides what happens next.
|
|
41
|
+
|
|
42
|
+
## Escalation
|
|
43
|
+
|
|
44
|
+
A durable question or failure that parks work until answered with guidance or a retry through the [answer interface](operating.md#answer-and-pause).
|
|
45
|
+
|
|
46
|
+
## Landing
|
|
47
|
+
|
|
48
|
+
Guarded integration of a ready contribution into its destination, authorized by [landing policy](integration-overview.md#policy-authorizes-landing) and still subject to verification and forge gates.
|
|
49
|
+
|
|
50
|
+
## Restack
|
|
51
|
+
|
|
52
|
+
Kernel-owned replay of a leaf's net change, or a node's ordered contributions, onto a refreshed destination. A clean replay needs no agent. See [restacking](integration-overview.md#one-identity-per-leaf-change).
|
|
53
|
+
|
|
54
|
+
## Reconcile
|
|
55
|
+
|
|
56
|
+
The agent phase that resolves conflicts in a kernel-prepared replay against a frozen, refreshed base. The kernel then publishes and re-verifies.
|
|
57
|
+
|
|
58
|
+
## Operator agent
|
|
59
|
+
|
|
60
|
+
Your external agent, working outside the pipeline through the CLI or connected tools. It writes specs, files and grooms tickets, watches the dispatcher, answers escalations and manages authorized landing; you supply intent and authority.
|
package/docs/hosted-service.md
CHANGED
|
@@ -17,8 +17,8 @@ package's `deployment/` directory and in `templates/hosted-service/`).
|
|
|
17
17
|
"build": "ab-hosted-service-build"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@defrex/autobuild-hosted-store-service": "0.
|
|
21
|
-
"@defrex/autobuild": "0.
|
|
20
|
+
"@defrex/autobuild-hosted-store-service": "1.0.0",
|
|
21
|
+
"@defrex/autobuild": "1.0.0",
|
|
22
22
|
"next": "16.1.6",
|
|
23
23
|
"react": "19.2.4",
|
|
24
24
|
"react-dom": "19.2.4"
|
package/docs/intake.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Intake and harvest"
|
|
3
|
+
group: "concepts"
|
|
4
|
+
description: "Turn outside signals and agent observations into reviewed proposals for your operator agent to triage and groom."
|
|
5
|
+
label: "Intake and harvest"
|
|
6
|
+
order: 5.5
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Intake and harvest
|
|
10
|
+
|
|
11
|
+
Outside signals and agent observations propose work. Your operator agent triages proposals, consults you on product choices, and grooms selected work to the [spec standard](tickets.md#groom-a-buildable-spec) before dispatch.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Sources carry proposals
|
|
15
|
+
|
|
16
|
+
Anything that can write a ticket can propose work. Every source, including plugins, shares the same content, workflow states, labels, and blockers; see [Tickets and specs](tickets.md).
|
|
17
|
+
|
|
18
|
+
- Scheduled ingesters for signals such as telemetry are proposed extensions, not shipped integrations.
|
|
19
|
+
- A signal is evidence for a proposal, not permission to dispatch work.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Observations become reviewed tickets
|
|
23
|
+
|
|
24
|
+
Agents record discoveries as observations while staying within their current spec:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
ab observe --kind followup --files src/retry.ts "Retry budget ignores jitter"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Observation harvest, a shipped repository workflow rather than a build phase, collects observations, synthesizes and reviews proposals, and files approved tickets.
|
|
31
|
+
|
|
32
|
+
A run starts after `[policy].harvestThreshold` new unclaimed observations (default 5), or once `[policy].harvestMaxDrift` other builds (default 3) have merged since the oldest one (`0` disables drift).
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## Triage is the default gate
|
|
36
|
+
|
|
37
|
+
Proposals land in the configured Triage state for grooming. A repository waives that gate by setting `[tickets].proposalState` to its ready state:
|
|
38
|
+
|
|
39
|
+
```toml
|
|
40
|
+
[tickets]
|
|
41
|
+
source = "file"
|
|
42
|
+
readyState = "ready"
|
|
43
|
+
proposalState = "ready"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The waiver doesn't skip blocker eligibility or the dispatch spec gate.
|
|
47
|
+
|
|
48
|
+
The [dispatcher guide](dispatcher.md) covers readiness and claim; [Tickets and specs](tickets.md) covers pinned specs and revisions.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Integrating related work"
|
|
3
|
+
group: "concepts"
|
|
4
|
+
description: "Collect work in an integration tree, preserve change identity through restacks, and land under explicit policy."
|
|
5
|
+
slug: "integration"
|
|
6
|
+
label: "Integration"
|
|
7
|
+
order: 4
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Integrating related work
|
|
11
|
+
|
|
12
|
+
Break a big feature into tickets, collect their changes on one branch, and land the verified feature on main once. Work forms a tree rooted at `baseBranch`:
|
|
13
|
+
|
|
14
|
+
- **Work tickets** are leaves.
|
|
15
|
+
- **Node tickets** are finite integration points that collect children, then land into their parent.
|
|
16
|
+
- Repositories without nodes send every work ticket to the root.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Targets form the tree
|
|
20
|
+
|
|
21
|
+
A node opens an `ab-node/<slug>` branch at its parent's sampled head; nodes can nest. A work ticket targets a node by ticket id, or the root by default:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
bun ab ticket create "Checkout redesign" --body checkout.md --kind node
|
|
25
|
+
bun ab ticket create "Cart summary" --body cart.md --target <node-id>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Claim freezes the destination build generation and branch; editing a claimed ticket can't redirect its change.
|
|
29
|
+
|
|
30
|
+
Leaves run the [normal build pipeline](builds.md). A node collects, verifies, lands, and closes. It finishes collecting when its targeting tickets are done or cancelled, frozen child claims have settled, and at least one contribution has landed.
|
|
31
|
+
|
|
32
|
+
- **Idle** nodes need no runner; empty nodes have no PR.
|
|
33
|
+
- **Repair** a failed node check with a child ticket targeting the node.
|
|
34
|
+
- **Landing** closes admission; a node isn't a perpetual staging branch.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## One identity per leaf change
|
|
38
|
+
|
|
39
|
+
A leaf contributes one canonical net change, however many commits it took.
|
|
40
|
+
|
|
41
|
+
- **Identity.** The `Autobuild-Build: <slug>` trailer carries it across SHA rewrites. Root squash landings keep it; node integration keeps each contributing identity, in order, rather than one node commit.
|
|
42
|
+
- **Restacks.** When a destination moves, Autobuild restacks onto it and cascades through descendants. Clean replay is automatic; a conflict attaches a reconcile runner with the source change's context, then verification as required.
|
|
43
|
+
- **Reverification.** Node verification covers the exact node head and parent; a change to either voids landing eligibility until reverified, even after a clean restack. A cleanly restacked waiting leaf can keep its prior verification; reports cite their actual head and base.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Blockers are a separate graph
|
|
47
|
+
|
|
48
|
+
A target says where work integrates; a blocker says what must be available before dependent work starts.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
bun ab ticket block <id> <blocker-id>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- **With nodes**, a blocker that has a build resolves when its change is present in the dependent's sampled destination. Sibling work may need to land into a common ancestor and cascade first.
|
|
55
|
+
- **Presence** is checked at claim, without interrupting existing builds; missing or ambiguous evidence keeps the dependent queued.
|
|
56
|
+
- **Without nodes**, and for blockers without builds, the source ticket's done state resolves it.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Policy authorizes landing
|
|
60
|
+
|
|
61
|
+
Ordered `[[landing]]` rules in `autobuild.toml` select `auto` or `consent`; the first match wins. Rules match source kind (`from`), destination (`into`), and ticket `label`. Without a match, leaves default to `auto` and nodes to `consent`.
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
# Leaves land on the root automatically; everything else needs consent.
|
|
65
|
+
[[landing]]
|
|
66
|
+
from = "leaf"
|
|
67
|
+
into = "root"
|
|
68
|
+
mode = "auto"
|
|
69
|
+
|
|
70
|
+
[[landing]]
|
|
71
|
+
mode = "consent"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Your operator agent manages consent:
|
|
75
|
+
|
|
76
|
+
- `ab land <slug>` records consent to a ready landing and clears a hold.
|
|
77
|
+
- `ab hold <slug>` suppresses landing, even before readiness, and withdraws consent.
|
|
78
|
+
|
|
79
|
+
Neither control, nor automatic authorization, bypasses readiness, verification, forge checks, protection, or merge gates.
|
|
80
|
+
|
|
81
|
+
[Tickets and specs](tickets.md) covers the input side of the tree.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Working with your operator agent"
|
|
3
|
+
group: "guides"
|
|
4
|
+
description: "Delegate specs, tickets, monitoring, and landing to your agent while keeping product decisions and authority with you."
|
|
5
|
+
label: "Working with your operator agent"
|
|
6
|
+
order: 6
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Working with your operator agent
|
|
10
|
+
|
|
11
|
+
Your operator agent keeps work moving through `ab` or MCP. Under your instructions it writes specs, files and grooms tickets, watches builds, answers bounded escalations, pauses or aborts work, and authorizes landing.
|
|
12
|
+
|
|
13
|
+
- **You own** goals, scope, tradeoffs and authority, and you run the dispatcher and upgrades.
|
|
14
|
+
- **The agent never** starts, stops or restarts dispatch; it reports dispatcher trouble to you.
|
|
15
|
+
- **Autobuild doesn't** host or start the agent. There's no orchestrator setup step.
|
|
16
|
+
|
|
17
|
+
## Choose a harness
|
|
18
|
+
|
|
19
|
+
- **A local coding agent** at the repository root with the installed `ab-operate` skill, using the CLI or `bun ab mcp` (operator tools over stdio).
|
|
20
|
+
- **A remote agent** with no checkout, on the authenticated hosted `/mcp` endpoint. See [Operator surfaces](operator-surfaces.md).
|
|
21
|
+
|
|
22
|
+
We recommend the same model as your reviewer roles, since the agent interprets findings and escalation answers.
|
|
23
|
+
|
|
24
|
+
## Give the agent memory
|
|
25
|
+
|
|
26
|
+
Autobuild ships no agent memory. Keep goals, decisions, constraints and monitor cursors in your harness's memory or an agreed notes file: load it at session start, record decisions as they're made, and on resume reconcile it against recorded state. Notes hold your intent; build events and artifacts hold what happened.
|
|
27
|
+
|
|
28
|
+
## Give steering that sticks
|
|
29
|
+
|
|
30
|
+
Give the agent your scope, priorities, acceptance boundaries, escalation thresholds and landing authority. For example:
|
|
31
|
+
|
|
32
|
+
> Keep this change API-compatible. Prioritize the retry budget over diagnostics. You may answer questions already settled by this spec, but ask me about scope changes and before granting landing consent.
|
|
33
|
+
|
|
34
|
+
Agree on boundaries before the agent acts: moving a ticket to ready can start a build immediately, and granting consent can let it land once gates pass.
|
|
35
|
+
|
|
36
|
+
The agent answers questions your instructions settle and escalates ambiguous goals, scope or compatibility tradeoffs, consequential or destructive choices, missing authority or access, and dispatcher trouble.
|
|
37
|
+
|
|
38
|
+
## Watch for attention
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
bun ab watch --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`watch` monitors active builds, new builds and the repository journal.
|
|
45
|
+
|
|
46
|
+
- **Default filter:** actionable attention only, such as escalations and ready landings awaiting consent. Add `--event` globs for routine lifecycle events.
|
|
47
|
+
- **Starts now:** a fresh watch ignores history, so check current status too.
|
|
48
|
+
- **Resumable:** pass the opaque cursor from the JSON output back with `--since` to receive events recorded while away. The final JSON line always carries one.
|
|
49
|
+
- **Duration:** 30 minutes by default; `--timeout 0` keeps it open.
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
bun ab wait my-build --for attention --json --timeout 5m
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`wait` blocks once until a build condition holds:
|
|
56
|
+
|
|
57
|
+
| Exit | Meaning |
|
|
58
|
+
|---|---|
|
|
59
|
+
| 0 | A condition matched |
|
|
60
|
+
| 2 | Every named build ended without matching |
|
|
61
|
+
| 3 | Timed out |
|
|
62
|
+
|
|
63
|
+
Existing attention returns immediately, even with a cursor, so looping `wait` doesn't consume events. Use `watch --since` for that.
|
|
64
|
+
|
|
65
|
+
## Answer and pause
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
bun ab answer my-build "Keep the public API compatible"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
An escalation parks work until answered; guidance feeds the next round. `answer` also accepts a bare retry and spec-revision resolutions for when the contract must change; see `bun ab help answer`.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
bun ab pause my-build
|
|
75
|
+
bun ab resume my-build
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- **`pause`** stops a build at its supported boundary.
|
|
79
|
+
- **`resume`** releases a cleanly paused build. It doesn't answer an escalation.
|
|
80
|
+
- **`pause --all`** holds queued work, turns intake off and requests pauses on running builds.
|
|
81
|
+
- **`resume --all`** releases the hold, turns intake on and resumes cleanly paused builds.
|
|
82
|
+
|
|
83
|
+
Intake off only stops new ticket claims; a repository pause also holds queued builds. Neither withdraws landing consent; use `hold`.
|
|
84
|
+
|
|
85
|
+
## Authorize landing
|
|
86
|
+
|
|
87
|
+
Ordered landing rules choose automatic authorization or explicit consent. With no matching rule, leaves default to auto and integration nodes to consent. Verification, checks, protection and merge gates still apply.
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
bun ab land my-build
|
|
91
|
+
bun ab hold my-build
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- **`land`** requires a ready build, clears its hold and grants consent to land into its destination.
|
|
95
|
+
- **`hold`** suppresses landing and revokes consent, even before the build is ready.
|
|
96
|
+
- **Persistence:** consent survives head changes, restacks, verification and re-finalization until a hold or completion. Accepted node reparenting revokes it.
|
|
97
|
+
|
|
98
|
+
## Choose an operator surface
|
|
99
|
+
|
|
100
|
+
Every surface reads the same durable state; [Operator surfaces](operator-surfaces.md) covers remote access.
|
|
101
|
+
|
|
102
|
+
| Surface | Progress, escalations, pause/resume | Landing consent and hold |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| Terminal dashboard (`bun ab dispatch`) | Yes | Keys `l` (land) and `o` (hold) |
|
|
105
|
+
| Hosted web app | Yes, plus sessions and transcripts | No |
|
|
106
|
+
| CLI and MCP operator tools | Yes | Yes |
|
|
107
|
+
|
|
108
|
+
## An example session
|
|
109
|
+
|
|
110
|
+
1. You start `bun ab dispatch` and open your agent with `ab-operate` loaded.
|
|
111
|
+
2. You ask: “Add a small retry budget; keep the API compatible and ask before granting consent.” The agent asks whether exhausted retries should keep the existing error; you say yes, and it records that.
|
|
112
|
+
3. The agent specifies, files and grooms the ticket, then watches. When the build asks about the error shape, the agent answers from your instruction.
|
|
113
|
+
4. An escalation proposes expanding the API. The agent asks you; you keep it out of scope.
|
|
114
|
+
5. When the build is ready, the agent asks for consent, grants it once you authorize, and reports whether the change merged, stayed gated or closed. Green verification isn't a merge.
|