@defrex/autobuild 1.0.0-beta.3 → 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 +362 -56
- package/bin/ab-dispatch-generation.ts +93 -0
- package/docs/agent-runtimes.md +157 -0
- package/docs/answering-blocked-builds.md +21 -3
- package/docs/architecture.md +166 -7
- 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 +1778 -188
- 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/integration-tree.md +87 -2
- package/docs/integration.md +54 -0
- package/docs/operating.md +114 -0
- package/docs/operator-api.md +64 -11
- 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 +12 -9
- package/docs/restacking.md +4 -1
- package/docs/seams.md +66 -0
- package/docs/setup.md +28 -6
- package/docs/skills.md +119 -0
- package/docs/spec-standard.md +23 -5
- 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/artifact.ts +5 -4
- package/packages/core/src/cli/attention.ts +2 -0
- package/packages/core/src/cli/binary-direct.ts +190 -0
- package/packages/core/src/cli/binary-lifecycle.ts +46 -0
- package/packages/core/src/cli/binary.ts +24 -210
- package/packages/core/src/cli/build-control.ts +105 -2
- package/packages/core/src/cli/context.ts +41 -1
- package/packages/core/src/cli/dashboard/hand-pushed.ts +24 -0
- package/packages/core/src/cli/dashboard/handoff.ts +64 -0
- package/packages/core/src/cli/dashboard/integration-detail.ts +3 -0
- package/packages/core/src/cli/dashboard/model.ts +34 -10
- package/packages/core/src/cli/dashboard/render.ts +24 -2
- package/packages/core/src/cli/dashboard/rollback.ts +30 -0
- package/packages/core/src/cli/dispatch-args.ts +53 -0
- package/packages/core/src/cli/dispatch-crash-budget.ts +15 -0
- package/packages/core/src/cli/dispatch-frontend.ts +52 -5
- package/packages/core/src/cli/dispatch-handoff.ts +276 -0
- package/packages/core/src/cli/dispatch-launch-contract.ts +170 -0
- package/packages/core/src/cli/dispatch-launcher.ts +580 -0
- package/packages/core/src/cli/dispatch-parent-watch.ts +44 -0
- package/packages/core/src/cli/dispatch-preflight.ts +272 -0
- package/packages/core/src/cli/dispatch-presentation-job.ts +46 -0
- package/packages/core/src/cli/dispatch-presentation-ownership.ts +9 -0
- package/packages/core/src/cli/dispatch-process.ts +22 -90
- package/packages/core/src/cli/dispatch-readiness.ts +47 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +5 -1
- package/packages/core/src/cli/dispatch-runtime-cache.ts +522 -0
- package/packages/core/src/cli/dispatch-runtime-dependencies.ts +291 -0
- package/packages/core/src/cli/dispatch-runtime-use.ts +336 -0
- package/packages/core/src/cli/dispatch-upgrade-controller.ts +221 -0
- package/packages/core/src/cli/dispatch-upgrade-install.ts +258 -0
- package/packages/core/src/cli/dispatch-upgrade-source.ts +309 -0
- package/packages/core/src/cli/dispatch-upgrade-target.ts +190 -0
- package/packages/core/src/cli/dispatch.ts +604 -60
- package/packages/core/src/cli/dispatcher-liveness.ts +1 -1
- package/packages/core/src/cli/env.ts +1 -1
- package/packages/core/src/cli/harvest.ts +28 -11
- package/packages/core/src/cli/help.ts +10 -5
- package/packages/core/src/cli/installation.ts +5 -3
- package/packages/core/src/cli/main-checkout.ts +59 -0
- package/packages/core/src/cli/main.ts +15 -45
- package/packages/core/src/cli/node-verification-provenance.ts +97 -0
- package/packages/core/src/cli/repo-state.ts +3 -58
- package/packages/core/src/cli/repository-status.ts +67 -3
- package/packages/core/src/cli/runtime-spawn.ts +16 -0
- package/packages/core/src/cli/status.ts +57 -3
- package/packages/core/src/cli/upgrade-followup.ts +25 -0
- package/packages/core/src/cli/wait.ts +3 -0
- package/packages/core/src/cli/watch.ts +7 -0
- package/packages/core/src/config/landing.ts +8 -0
- package/packages/core/src/config/live.ts +1 -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 +352 -10
- package/packages/core/src/distribution-packaging.ts +116 -0
- package/packages/core/src/events/catalog.ts +6 -0
- package/packages/core/src/events/payloads.ts +53 -9
- package/packages/core/src/events/policy.ts +25 -0
- package/packages/core/src/events/repository.ts +184 -4
- package/packages/core/src/events/runtime.ts +16 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +2515 -78
- package/packages/core/src/kernel/dispatch-drain-recovery.ts +121 -0
- package/packages/core/src/kernel/dispatch-status.ts +4 -2
- package/packages/core/src/kernel/dispatch-upgrade.ts +171 -0
- package/packages/core/src/kernel/dispatcher-liveness.ts +7 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +82 -0
- package/packages/core/src/kernel/guarded-forge.ts +1 -1
- package/packages/core/src/kernel/harvest.ts +98 -4
- package/packages/core/src/kernel/integration-attention.ts +20 -0
- package/packages/core/src/kernel/integration-state.ts +80 -11
- package/packages/core/src/kernel/landing-readiness.ts +6 -1
- package/packages/core/src/kernel/mixed-version.ts +34 -0
- package/packages/core/src/kernel/node-polling.ts +160 -0
- package/packages/core/src/kernel/read-facts.ts +40 -5
- package/packages/core/src/kernel/reducer-registry.ts +3 -0
- package/packages/core/src/kernel/reducer.ts +75 -14
- package/packages/core/src/kernel/service-facts.ts +11 -4
- package/packages/core/src/ontology.ts +2 -2
- package/packages/core/src/open-map.ts +3 -1
- package/packages/core/src/operator/presentation.ts +7 -0
- package/packages/core/src/operator/query.ts +6 -2
- package/packages/core/src/operator/registry.ts +1 -1
- package/packages/core/src/plugins/load.ts +4 -1
- package/packages/core/src/plugins/runtime-snapshot.ts +128 -0
- package/packages/core/src/ports/forge/contract.ts +29 -0
- package/packages/core/src/ports/forge/github.ts +189 -61
- package/packages/core/src/ports/forge-failure.ts +1 -0
- package/packages/core/src/ports/forge-telemetry.ts +3 -0
- package/packages/core/src/ports/runner/session-env.ts +1 -0
- package/packages/core/src/ports/types.ts +10 -0
- package/packages/core/src/ports/workspace/distribution-archive.ts +22 -149
- package/packages/core/src/ports/workspace/distribution-release.ts +56 -0
- package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
- package/packages/core/src/ports/workspace/local-build-execution.ts +37 -17
- package/packages/core/src/processes/build-child-exit.ts +5 -26
- package/packages/core/src/processes/build-runner.ts +81 -11
- package/packages/core/src/processes/dispatcher.ts +254 -23
- package/packages/core/src/processes/execution-no-progress.ts +6 -0
- package/packages/core/src/processes/execution-relaunch.ts +30 -0
- package/packages/core/src/processes/execution-settlement.ts +16 -7
- package/packages/core/src/processes/harvest-runner.ts +328 -292
- package/packages/core/src/processes/process-group-reaper.ts +17 -10
- package/packages/core/src/runtime-identity.ts +22 -3
- package/packages/core/src/store/contract.ts +153 -0
- package/packages/core/src/store/local/store.ts +197 -72
- package/packages/core/src/store/reduced-reads.ts +8 -0
- package/packages/core/src/store/reducer-value-shapes.json +5783 -3305
- package/packages/core/src/store/remote/client.ts +43 -0
- package/packages/core/src/store/repo-state-events.ts +20 -3
- package/packages/core/src/store/types.ts +7 -0
- package/skills/finalize/SKILL.md +3 -1
- package/skills/guide/SKILL.md +273 -48
- package/skills/guide/references/integration-tree.md +87 -2
- package/skills/guide/references/operator-api.md +71 -14
- package/skills/guide/references/plugin-authoring.md +231 -266
- package/skills/guide/references/remote-store-protocol.md +12 -9
- package/skills/guide/references/restacking.md +4 -1
- package/skills/guide/references/setup.md +28 -6
- package/skills/guide/references/spec-standard.md +23 -5
- package/skills/harvest/SKILL.md +4 -0
- package/skills/harvest-review/SKILL.md +4 -0
- package/skills/implement/SKILL.md +4 -2
- package/skills/operate/SKILL.md +104 -35
- package/skills/plan/SKILL.md +12 -4
- package/skills/spec/SKILL.md +20 -2
- package/skills/tickets/SKILL.md +20 -1
- package/templates/hosted-service/package.json +2 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Iterating inside an integration node
|
|
2
|
+
|
|
3
|
+
A node collects related work into one finite delivery to its parent. Write its
|
|
4
|
+
ticket as a charter: why the integration matters, what observable conditions
|
|
5
|
+
make the whole done, and where and how it lands under the repository's effective
|
|
6
|
+
landing policy. Keep the usual spec sections: what and why, checkable acceptance
|
|
7
|
+
criteria, out of scope, and evidence. Put evolving feature specifics in children.
|
|
8
|
+
|
|
9
|
+
For example, a charter can aim for a coherent account-management flow, complete
|
|
10
|
+
when account settings and closure work together and pass integration verification.
|
|
11
|
+
Child tickets define the detailed behavior of those flows.
|
|
12
|
+
|
|
13
|
+
Create the node and children with ids returned by your ticket source:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
ab ticket create "Account management" --body charter.md --kind node
|
|
17
|
+
ab ticket create "Account settings" --body settings.md --target <node-id>
|
|
18
|
+
ab ticket tree
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
While the node is open, add more spec-standard children as needed. Each ordinary
|
|
22
|
+
child runs its normal pipeline. Node verification uses contribution provenance
|
|
23
|
+
to judge ordinary changes against either the current event-authorized node
|
|
24
|
+
charter or the introducing child's spec. Each child need not be independently
|
|
25
|
+
promised by the charter.
|
|
26
|
+
|
|
27
|
+
For small maintainer-authorized tweaks, push to the node's recorded branch with
|
|
28
|
+
meaningful commit messages explaining intent. Verification reads the owned
|
|
29
|
+
hand-pushed commit messages in the frozen range and judges quality and
|
|
30
|
+
consistency; it cannot fail a tweak solely for lacking a covering spec.
|
|
31
|
+
Phase agents still follow their own publication boundaries.
|
|
32
|
+
|
|
33
|
+
When the charter itself changes, explicitly revise the active build:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
ab answer <node> --revise-spec replacement.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Alternatively, amend the ticket, then run
|
|
40
|
+
`ab answer <node> --revise-spec-from-ticket`. Editing the ticket alone does not
|
|
41
|
+
revise the build. Eligible idle collecting or verification-failed nodes recollect
|
|
42
|
+
and verify the replacement revision, even on the same head and parent after a
|
|
43
|
+
failed cycle. Children retain their specs, claims and targets.
|
|
44
|
+
|
|
45
|
+
Open children, including triage, backlog and ready tickets, keep the node
|
|
46
|
+
incomplete. Once complete, the node must pass verification on its exact head and
|
|
47
|
+
parent and satisfy its configured landing gates. Landing completes the node and
|
|
48
|
+
closes admission; use a new node for a later delivery. Consent requirements depend
|
|
49
|
+
on the effective policy.
|
|
50
|
+
|
|
51
|
+
See [integration trees](integration-tree.md#collect-verify-and-land) for provenance
|
|
52
|
+
and completion details, [revision restrictions](integration-tree.md#operator-node-spec-revisions)
|
|
53
|
+
for when a replacement is accepted, and [landing policy](landing-policy.md) for
|
|
54
|
+
landing and consent rules.
|
|
@@ -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.
|
package/docs/operator-api.md
CHANGED
|
@@ -51,9 +51,9 @@ commands; see [owner workflow](setup.md#connected-projects).
|
|
|
51
51
|
|
|
52
52
|
## Operator sessions
|
|
53
53
|
|
|
54
|
-
Operator sessions are the signed-in
|
|
54
|
+
Operator sessions are the signed-in user's durable orchestrator
|
|
55
55
|
conversations: a hosted-only third store resource. A session
|
|
56
|
-
belongs to the
|
|
56
|
+
belongs to the user who created it; other members of the same repository
|
|
57
57
|
can read it and cannot write to it (`403 auth` on non-owner writes). Every
|
|
58
58
|
write is attributed to the token's signed user — never a client-supplied
|
|
59
59
|
identity — and carries no `via` marker: session events are the delegate's own
|
|
@@ -62,14 +62,14 @@ archived status is terminal.
|
|
|
62
62
|
|
|
63
63
|
| Method and path | Result |
|
|
64
64
|
|---|---|
|
|
65
|
-
| `GET …/sessions` | The repository's session records, newest update first. Readable by any
|
|
66
|
-
| `POST …/sessions` | `{"title"?:"…"}` → `201` + the created `SessionRecord`; the signed-in
|
|
67
|
-
| `GET …/sessions/{sid}` | `{session, state, turns}` where `state` is the reducer's derived state (`status`, `openTurn`, `pendingApproval`, `wakeGlobs`, `wakeCursors`, `turns`) and `turns` the ordered turn list. Readable by any
|
|
65
|
+
| `GET …/sessions` | The repository's session records, newest update first. Readable by any member of the repository. |
|
|
66
|
+
| `POST …/sessions` | `{"title"?:"…"}` → `201` + the created `SessionRecord`; the signed-in user owns it. |
|
|
67
|
+
| `GET …/sessions/{sid}` | `{session, state, turns}` where `state` is the reducer's derived state (`status`, `openTurn`, `pendingApproval`, `wakeGlobs`, `wakeCursors`, `turns`) and `turns` the ordered turn list. Readable by any member of the repository. |
|
|
68
68
|
| `POST …/sessions/{sid}/messages` | `{"text":"…"}` → appends `message.posted`. Owner only. |
|
|
69
69
|
| `PUT …/sessions/{sid}/wake` | `{"globs":["…"]}` (possibly empty) → appends `session.wake-set`. Owner only. |
|
|
70
70
|
| `POST …/sessions/{sid}/approvals` | `{"turn":"…","toolCallId":"…","decision":"approve"\|"deny"}` → `approval.answered`. Owner only; `409 refusal` when the reduced state has no matching pending approval. |
|
|
71
71
|
| `POST …/sessions/{sid}/archive` | Empty body → `session.archived`. Owner only; `409 refusal` when already archived. |
|
|
72
|
-
| `GET …/sessions/{sid}/turns/{turn}/stream?since=N&wait=N` | The turn's stream read: `{chunks,status,outcome?,artifact?}` with `since` strictly greater-than and the same bounded-wait semantics as the stream protocol (whole seconds, clamped at 30). Unknown turn is `404 not-found`. Readable by any
|
|
72
|
+
| `GET …/sessions/{sid}/turns/{turn}/stream?since=N&wait=N` | The turn's stream read: `{chunks,status,outcome?,artifact?}` with `since` strictly greater-than and the same bounded-wait semantics as the stream protocol (whole seconds, clamped at 30). Unknown turn is `404 not-found`. Readable by any member of the repository. |
|
|
73
73
|
|
|
74
74
|
Session state is a reduction of the session's event log, never a stored
|
|
75
75
|
column; a `GET …/sessions/{sid}` response therefore always reflects the
|
|
@@ -81,8 +81,8 @@ turn runner (a later ticket) is the only producer of turn facts.
|
|
|
81
81
|
| Method and path | Result |
|
|
82
82
|
|---|---|
|
|
83
83
|
| `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. |
|
|
84
|
-
| `GET …/builds/{slug}` | `{detail, dashboardRow}`; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it (after cleanup's `build.completed`). |
|
|
85
|
-
| `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, queue/capacity and settings projection. |
|
|
84
|
+
| `GET …/builds/{slug}` | `{detail, dashboardRow}`; `detail.runnerAttaches` records chronological attach boundaries and their runtime identity (version, commit, source kind/location), with null runtime for unrecorded historical attaches; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it (after cleanup's `build.completed`). |
|
|
85
|
+
| `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, queue/capacity and settings projection. Optional `rollback` contains `correlation`, `lineage`, full `failed` and `restored` runtime identities and rollback event `ts` for the authoritative dispatcher lineage’s unresolved hold. Both dashboards name failed, restored and held runtime plus timestamp. Matching durable different-target hold clearance removes it; a fresh operator lineage hides it only after a committed operational tick or accepted takeover. Run-started and yielded ticks alone cannot replace authority; same-lineage generations retain the notice. Historical rollback records are not fallback notices. Optional `handoffs` lists all accepted unfinished handoffs with predecessor `run`, optional `successor`, `correlation`, full `from`/`to` runtimes, `mode` and optional `deadline`. Outstanding drain-mode builds carry `draining: true`, also on build-detail `dashboardRow`; matching settlement removes it. Accepted completion removes the handoff; neither takeover nor the clock does. Missing historical mode means cutover and missing deadline displays unknown. |
|
|
86
86
|
| `GET …/status` | Repository intake, pause, and default-auto-merge projection. |
|
|
87
87
|
| `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
|
|
88
88
|
| `GET …/builds/{slug}/artifacts/{kind}?rev=N` | Raw bytes (`application/octet-stream`) plus content-disposition and `X-Autobuild-Artifact-*` metadata headers. Omit `rev` for latest. |
|
|
@@ -146,6 +146,24 @@ revision, a trusted caller fetches the current ticket body and supplies it; the
|
|
|
146
146
|
build must still have a recorded ticket. Revision conformance, lazy retry,
|
|
147
147
|
artifact metadata, event ordering, and refusal rules are the same as the CLI.
|
|
148
148
|
|
|
149
|
+
Operators may explicitly revise an opened idle collecting node or a node blocked on failed
|
|
150
|
+
integration verification without an escalation. Use
|
|
151
|
+
`ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
|
|
152
|
+
`ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
|
|
153
|
+
the build. Both forms enforce the same spec standard as leaf revisions.
|
|
154
|
+
Each kernel `spec.revised` records the exact artifact and operator identity
|
|
155
|
+
(with optional transport provenance); earlier revisions remain readable.
|
|
156
|
+
Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
|
|
157
|
+
The node recollects and verifies the new revision, including on the same head
|
|
158
|
+
and parent after a failed cycle. Earlier cycles remain historical evidence
|
|
159
|
+
and cannot block or authorize landing under the replacement. Children keep
|
|
160
|
+
their specs, claims and targets; contributions are not restarted.
|
|
161
|
+
Active verification/reconcile or writer work, restack/reparent work, pause,
|
|
162
|
+
pending controls, landing intent and ended PRs refuse the no-escalation path.
|
|
163
|
+
A concurrent state change refuses publication with a retry explanation;
|
|
164
|
+
uncited artifacts are inert. Leaves still require an open escalation and
|
|
165
|
+
restart from `plan`.
|
|
166
|
+
|
|
149
167
|
## The registry's protocol face: `POST …/tools/{tool}`
|
|
150
168
|
|
|
151
169
|
One generic route executes any entry of the agent tool registry (the same
|
|
@@ -220,7 +238,8 @@ event reads.
|
|
|
220
238
|
|
|
221
239
|
Dispatcher liveness is also visible through `ab repository status --json`:
|
|
222
240
|
`dispatcher.holder` identifies the unexpired repository lease owner, independently
|
|
223
|
-
of `latestRun`.
|
|
241
|
+
of `latestRun`. Each run includes its recorded `runtime` (version, commit, and
|
|
242
|
+
source kind/location), or null for unrecorded historical starts. Heartbeat age measures attributable renewals; tick age measures
|
|
224
243
|
durable progress. Missing historical evidence is null. The liveness query uses
|
|
225
244
|
bounded repository facts first, with a full-history fallback when a later
|
|
226
245
|
invocation hides the holder start or the latest stop. Other state reads retain
|
|
@@ -238,6 +257,8 @@ record the first signal in the stop fact, and release its lease before exit.
|
|
|
238
257
|
|
|
239
258
|
The default watch reports actionable conditions only:
|
|
240
259
|
|
|
260
|
+
- `integration.verification-failed`: failed node verification, once per prepared cycle, with failed steps, verified head and parent, and guidance to file a repair child targeting the node. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled.
|
|
261
|
+
|
|
241
262
|
- `build.janitor-failing`: a build has reached the configured consecutive-failure threshold; a successful janitor attempt clears it.
|
|
242
263
|
- `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
|
|
243
264
|
|
|
@@ -250,7 +271,7 @@ The default watch reports actionable conditions only:
|
|
|
250
271
|
build/PR; it does not duplicate consent or hold attention.
|
|
251
272
|
- Repository `harvest.escalated`, `harvest.recovery-exhausted`,
|
|
252
273
|
`dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
|
|
253
|
-
`restartRequired`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
|
|
274
|
+
`restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
|
|
254
275
|
- `dispatcher.ticket-source-persistent`: degradation past its advertised
|
|
255
276
|
reset time, once a tick started at or after reset has completed or failed
|
|
256
277
|
with the episode still open; crossing reset alone is silent. Without a reset,
|
|
@@ -287,7 +308,9 @@ arming the watch. Named watches still end when every named build is terminal;
|
|
|
287
308
|
learn their outcomes from status reconciliation at exit.
|
|
288
309
|
|
|
289
310
|
`ab wait --for attention` is build-only and uses the same build conditions:
|
|
290
|
-
|
|
311
|
+
current failed node verification, an open escalation, janitor failure attention,
|
|
312
|
+
consent readiness, landing/conflict attention or a merge decision. Current failed
|
|
313
|
+
verification satisfies attention even before its notification is written. Existing conditions return immediately,
|
|
291
314
|
even with `--since`; live and backlog matches ignore routine outcomes and
|
|
292
315
|
self-healing failures. A merge match uses the watch observation with
|
|
293
316
|
`condition: "attention"`. Explicit `--event` globs remain event-only.
|
|
@@ -320,3 +343,33 @@ the original reset, which later rate limits cannot postpone indefinitely.
|
|
|
320
343
|
uses the same service as `ab restack <node>`. The receipt contains `slug`,
|
|
321
344
|
`request`, `coalesced` and `waiting`; execution is asynchronous. It refuses
|
|
322
345
|
non-node, unopened and terminal builds and enforces repository ownership.
|
|
346
|
+
|
|
347
|
+
Repository status includes `upgrades.runs`, keyed by originating dispatcher run,
|
|
348
|
+
with latest successful `resolved` target, detected target, failure, handoff and
|
|
349
|
+
completion evidence. `dispatcher.upgrade-target-resolved` carries strict
|
|
350
|
+
`{run, lineage, target}` data; the target has mode (`pinned`, `installed`, or
|
|
351
|
+
`source`), content key, source provenance and optional version/base/SHA. Source
|
|
352
|
+
mode names the authoritative base commit, which can advance without changing
|
|
353
|
+
packaged inputs or the running runtime. Status text renders the resolved mode,
|
|
354
|
+
base and SHA separately, so an older handoff cannot hide a newer target. Identical
|
|
355
|
+
observations append nothing; a successful resolution does not clear failures. Facts carry launcher
|
|
356
|
+
lineage, from/to runtimes, resolution mode and authoritative base SHA/ref or original
|
|
357
|
+
installation provenance, plus prepared cache identity. Completion names the successor
|
|
358
|
+
and records completed retirement separately from takeover. During a handoff the
|
|
359
|
+
projection includes both generations, chosen mode, outstanding draining builds
|
|
360
|
+
and deadline. The successor owns repository work after terminal release and lease
|
|
361
|
+
claim, while old local runners retain execution leases until settlement or deadline.
|
|
362
|
+
Remote guests retain independent leases, finish their phase and request neutral
|
|
363
|
+
relaunch; their separate handoff capture never holds retirement open. `dispatcher.upgrade-failed` is immediate repository
|
|
364
|
+
attention; the current generation remains active and identical failed inputs are
|
|
365
|
+
suppressed across native handoff until target or selected-store compatibility evidence changes or a fresh operator launch.
|
|
366
|
+
|
|
367
|
+
Repository status additionally exposes `upgrades.lastRollback` (historical, retained
|
|
368
|
+
when cleared), `upgrades.holds` keyed by launcher lineage, `upgrades.lineages` keyed
|
|
369
|
+
by generation run, optional `upgrades.authoritativeRun` from rollback, accepted takeover or committed operational tick (never startup/yield alone), `upgrades.rollbackIds` for idempotent rollback correlations, and `rollbackHold` for the effective dispatcher lineage.
|
|
370
|
+
`dispatcher.runtime-rolled-back` names failed/restored runtime identities and cache
|
|
371
|
+
roots, target, original handoff/takeover, three failed exits and reason. It is default
|
|
372
|
+
repository attention. `dispatcher.rollback-hold-cleared` records a different
|
|
373
|
+
successfully resolved target. The rollback hold survives store compatibility
|
|
374
|
+
changes, resolution errors and upgrade opt-out; a new operator-launch lineage
|
|
375
|
+
ignores old holds. Preflight failure suppression above remains separate.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Operator surfaces"
|
|
3
|
+
group: "reference"
|
|
4
|
+
description: "Watch and act through the terminal, web app, CLI, or MCP with your operator agent."
|
|
5
|
+
label: "Operator surfaces"
|
|
6
|
+
order: 12
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Operator surfaces
|
|
10
|
+
|
|
11
|
+
## Responsibility
|
|
12
|
+
|
|
13
|
+
Operator surfaces are where you and your operator agent inspect tickets and builds, answer escalations, pause work and authorize landing. Autobuild never hosts or starts your agent; it runs anywhere.
|
|
14
|
+
|
|
15
|
+
## Shipped arrangements
|
|
16
|
+
|
|
17
|
+
### Terminal dashboard and local CLI
|
|
18
|
+
|
|
19
|
+
A local Store needs no dashboard credential:
|
|
20
|
+
|
|
21
|
+
<!-- seam-config:start -->
|
|
22
|
+
```toml
|
|
23
|
+
[tickets]
|
|
24
|
+
source = "file"
|
|
25
|
+
readyState = "ready"
|
|
26
|
+
```
|
|
27
|
+
<!-- seam-config:end -->
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
bun ab dispatch
|
|
31
|
+
bun ab builds
|
|
32
|
+
bun ab build status example-build --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- Interactive `dispatch` shows the terminal dashboard.
|
|
36
|
+
- A shell-capable agent follows progress and acts through the CLI, including `bun ab watch` and `bun ab wait`.
|
|
37
|
+
- Dashboard and API share one lifecycle vocabulary.
|
|
38
|
+
|
|
39
|
+
A local CLI can use a remote Store:
|
|
40
|
+
|
|
41
|
+
<!-- seam-config:start -->
|
|
42
|
+
```toml
|
|
43
|
+
[store]
|
|
44
|
+
url = "https://builds.example.com"
|
|
45
|
+
|
|
46
|
+
[tickets]
|
|
47
|
+
source = "file"
|
|
48
|
+
readyState = "ready"
|
|
49
|
+
```
|
|
50
|
+
<!-- seam-config:end -->
|
|
51
|
+
|
|
52
|
+
`bun ab connect https://builds.example.com` approves the registered project and saves its credential outside the checkout; CI sets `AB_TOKEN` instead. It authorizes the project only, not forge or runtime access. See [Build store](build-store.md).
|
|
53
|
+
|
|
54
|
+
### Web app
|
|
55
|
+
|
|
56
|
+
The hosted web app shows registered repositories and their builds.
|
|
57
|
+
|
|
58
|
+
- **Sign-in** uses the deployment's GitHub authentication and email allowlist, independent of CLI credentials.
|
|
59
|
+
- **Secrets** (database, blob, signing, OAuth, allowlist) stay on the service, never in TOML or browser bundles.
|
|
60
|
+
|
|
61
|
+
### Local stdio MCP
|
|
62
|
+
|
|
63
|
+
For an agent with an MCP client but no convenient shell, configure the client to launch:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
bun ab mcp
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- **Scope.** Run from the connected project, or pass `--store` and `--repo` to constrain authority.
|
|
70
|
+
- **Lifetime.** Serves the operator tool registry over stdio; exits on client EOF. No daemon.
|
|
71
|
+
- **Phase refusal.** Refuses phase-session `AB_*` authority, including malformed tuples: repository-wide tools can't be narrowed to one phase.
|
|
72
|
+
- **Attribution.** Sessionless writes use the local user identity, like the CLI.
|
|
73
|
+
|
|
74
|
+
### Hosted HTTP MCP
|
|
75
|
+
|
|
76
|
+
A remote agent connects its MCP client to `https://builds.example.com/mcp` over Streamable HTTP.
|
|
77
|
+
|
|
78
|
+
- **Authentication:** OAuth with discovery, dynamic registration, PKCE and rotating refresh tokens, authorized through the deployment's sign-in and allowlist. `AB_TOKEN` doesn't substitute.
|
|
79
|
+
- **Every call** rechecks access and repository scope.
|
|
80
|
+
- **Writes** record the authorizing identity and MCP client.
|
|
81
|
+
|
|
82
|
+
## Writing your own
|
|
83
|
+
|
|
84
|
+
There's no operator-surface plugin map. Build a client of the versioned, authenticated Operator API, or connect through MCP.
|
|
85
|
+
|
|
86
|
+
- One registry defines tools, schemas, annotations and execution, keeping CLI, API and MCP at parity.
|
|
87
|
+
- Follow the API's request, version and authentication requirements; don't scrape dashboard markup.
|
|
88
|
+
- A new surface adds no pipeline phase and no embedded operator agent.
|
|
89
|
+
|
|
90
|
+
[Writing a plugin](plugin-authoring.md) covers infrastructure adapters.
|
package/docs/overview.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "How Autobuild works"
|
|
3
|
+
group: "start"
|
|
4
|
+
description: "The ticket-driven development lifecycle, its review and verification gates, and the repositories it fits."
|
|
5
|
+
label: "Overview"
|
|
6
|
+
order: 0
|
|
7
|
+
slug: ""
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# How Autobuild works
|
|
11
|
+
|
|
12
|
+
Autobuild runs coding agents through a fixed pipeline that takes a groomed ticket to a verified pull request, with a separate workspace for each build. Three actors keep that work moving:
|
|
13
|
+
|
|
14
|
+
- **You** decide goals, scope, tradeoffs, and how much authority to delegate.
|
|
15
|
+
- **Your operator agent** is an external agent that writes specs, files and grooms tickets, watches builds, and answers questions within your instructions. The `ab` CLI is primarily its interface; remote agents use MCP.
|
|
16
|
+
- **The dispatcher** claims ready work and runs the durable pipeline, including isolated agent sessions, checks, and publication.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## From a ticket to a change
|
|
20
|
+
|
|
21
|
+
A ticket states the observable change, why it matters, acceptance criteria, explicit limits, and evidence. Grooming turns it into a buildable spec and moves it to the tracker's ready state; filing alone doesn't make it ready.
|
|
22
|
+
|
|
23
|
+
The dispatcher claims ready tickets up to your configured capacity and runs each through the same pipeline:
|
|
24
|
+
|
|
25
|
+
1. **Spec.** The ticket's spec becomes the build's contract.
|
|
26
|
+
2. **Plan and plan review.** An agent proposes a plan; an independent reviewer checks it against the spec and can request revisions.
|
|
27
|
+
3. **Implement and code review.** An agent commits the change; a fresh reviewer's findings send it back for another round.
|
|
28
|
+
4. **Verify.** Your configured checks, commands or agent verifiers, run in order; a failure returns the build to implementation. This effectively replaces CI.
|
|
29
|
+
5. **Finalize.** An agent writes the pull request description and Autobuild opens the PR.
|
|
30
|
+
|
|
31
|
+
Landing depends on the configured policy and merge gates. Conflicts are reconciled, then verified again. Related work can be collected into an integration tree before landing.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Where it fits
|
|
35
|
+
|
|
36
|
+
Autobuild fits repositories whose work can be stated as clear tickets and checked automatically.
|
|
37
|
+
|
|
38
|
+
- **Requirements.** Bun, git, and your agent runtime (Claude Code, Codex CLI, or Pi) with its access and credentials.
|
|
39
|
+
- **Throughput over latency.** Independent builds run side by side, but each one pays for planning, review, and verification. A small edit you need now is better done directly in your coding agent.
|
|
40
|
+
- **Not a product owner.** It doesn't make product decisions or make vague tickets precise without your input; builds stop for answers, and your agent brings unresolved decisions back to you. If you can't state what done means, or your checks can't detect a broken change, fix grooming and verification first.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Using these docs
|
|
44
|
+
|
|
45
|
+
Start with [Getting started](getting-started.md), then:
|
|
46
|
+
|
|
47
|
+
- **Concepts:** [builds](builds.md), the [dispatcher](dispatcher.md), [integration](integration-overview.md), [tickets](tickets.md) with the [spec standard](tickets.md#groom-a-buildable-spec), and [Skills](skills.md) for editable agent defaults.
|
|
48
|
+
- **Operating and configuring:** [Working with your operator agent](operating.md), [Seams](seams.md), and the [configuration reference](configuration-overview.md).
|
|
49
|
+
- **Reference:** [CLI](cli.md), [Upgrading](upgrading.md), [Troubleshooting](troubleshooting.md), and the [Glossary](glossary.md).
|