@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.
Files changed (168) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +362 -56
  3. package/bin/ab-dispatch-generation.ts +93 -0
  4. package/docs/agent-runtimes.md +157 -0
  5. package/docs/answering-blocked-builds.md +21 -3
  6. package/docs/architecture.md +166 -7
  7. package/docs/build-store.md +123 -0
  8. package/docs/builds.md +82 -0
  9. package/docs/cli.md +48 -0
  10. package/docs/configuration-overview.md +93 -0
  11. package/docs/configuration.md +1778 -188
  12. package/docs/dispatcher-hosting.md +115 -0
  13. package/docs/dispatcher.md +59 -0
  14. package/docs/forges.md +121 -0
  15. package/docs/getting-started.md +60 -0
  16. package/docs/glossary.md +60 -0
  17. package/docs/hosted-service.md +2 -2
  18. package/docs/intake.md +48 -0
  19. package/docs/integration-overview.md +81 -0
  20. package/docs/integration-tree.md +87 -2
  21. package/docs/integration.md +54 -0
  22. package/docs/operating.md +114 -0
  23. package/docs/operator-api.md +64 -11
  24. package/docs/operator-surfaces.md +90 -0
  25. package/docs/overview.md +49 -0
  26. package/docs/plugin-authoring.md +426 -0
  27. package/docs/remote-store-protocol.md +12 -9
  28. package/docs/restacking.md +4 -1
  29. package/docs/seams.md +66 -0
  30. package/docs/setup.md +28 -6
  31. package/docs/skills.md +119 -0
  32. package/docs/spec-standard.md +23 -5
  33. package/docs/ticket-sources.md +132 -0
  34. package/docs/tickets.md +69 -0
  35. package/docs/troubleshooting.md +111 -0
  36. package/docs/upgrading.md +50 -0
  37. package/docs/verification.md +146 -0
  38. package/docs/website.md +47 -5
  39. package/docs/workspaces.md +152 -0
  40. package/package.json +5 -4
  41. package/packages/core/src/cli/artifact.ts +5 -4
  42. package/packages/core/src/cli/attention.ts +2 -0
  43. package/packages/core/src/cli/binary-direct.ts +190 -0
  44. package/packages/core/src/cli/binary-lifecycle.ts +46 -0
  45. package/packages/core/src/cli/binary.ts +24 -210
  46. package/packages/core/src/cli/build-control.ts +105 -2
  47. package/packages/core/src/cli/context.ts +41 -1
  48. package/packages/core/src/cli/dashboard/hand-pushed.ts +24 -0
  49. package/packages/core/src/cli/dashboard/handoff.ts +64 -0
  50. package/packages/core/src/cli/dashboard/integration-detail.ts +3 -0
  51. package/packages/core/src/cli/dashboard/model.ts +34 -10
  52. package/packages/core/src/cli/dashboard/render.ts +24 -2
  53. package/packages/core/src/cli/dashboard/rollback.ts +30 -0
  54. package/packages/core/src/cli/dispatch-args.ts +53 -0
  55. package/packages/core/src/cli/dispatch-crash-budget.ts +15 -0
  56. package/packages/core/src/cli/dispatch-frontend.ts +52 -5
  57. package/packages/core/src/cli/dispatch-handoff.ts +276 -0
  58. package/packages/core/src/cli/dispatch-launch-contract.ts +170 -0
  59. package/packages/core/src/cli/dispatch-launcher.ts +580 -0
  60. package/packages/core/src/cli/dispatch-parent-watch.ts +44 -0
  61. package/packages/core/src/cli/dispatch-preflight.ts +272 -0
  62. package/packages/core/src/cli/dispatch-presentation-job.ts +46 -0
  63. package/packages/core/src/cli/dispatch-presentation-ownership.ts +9 -0
  64. package/packages/core/src/cli/dispatch-process.ts +22 -90
  65. package/packages/core/src/cli/dispatch-readiness.ts +47 -0
  66. package/packages/core/src/cli/dispatch-repository-feed.ts +5 -1
  67. package/packages/core/src/cli/dispatch-runtime-cache.ts +522 -0
  68. package/packages/core/src/cli/dispatch-runtime-dependencies.ts +291 -0
  69. package/packages/core/src/cli/dispatch-runtime-use.ts +336 -0
  70. package/packages/core/src/cli/dispatch-upgrade-controller.ts +221 -0
  71. package/packages/core/src/cli/dispatch-upgrade-install.ts +258 -0
  72. package/packages/core/src/cli/dispatch-upgrade-source.ts +309 -0
  73. package/packages/core/src/cli/dispatch-upgrade-target.ts +190 -0
  74. package/packages/core/src/cli/dispatch.ts +604 -60
  75. package/packages/core/src/cli/dispatcher-liveness.ts +1 -1
  76. package/packages/core/src/cli/env.ts +1 -1
  77. package/packages/core/src/cli/harvest.ts +28 -11
  78. package/packages/core/src/cli/help.ts +10 -5
  79. package/packages/core/src/cli/installation.ts +5 -3
  80. package/packages/core/src/cli/main-checkout.ts +59 -0
  81. package/packages/core/src/cli/main.ts +15 -45
  82. package/packages/core/src/cli/node-verification-provenance.ts +97 -0
  83. package/packages/core/src/cli/repo-state.ts +3 -58
  84. package/packages/core/src/cli/repository-status.ts +67 -3
  85. package/packages/core/src/cli/runtime-spawn.ts +16 -0
  86. package/packages/core/src/cli/status.ts +57 -3
  87. package/packages/core/src/cli/upgrade-followup.ts +25 -0
  88. package/packages/core/src/cli/wait.ts +3 -0
  89. package/packages/core/src/cli/watch.ts +7 -0
  90. package/packages/core/src/config/landing.ts +8 -0
  91. package/packages/core/src/config/live.ts +1 -0
  92. package/packages/core/src/config/reference-metadata.ts +31 -0
  93. package/packages/core/src/config/reference.ts +342 -0
  94. package/packages/core/src/config/roles.ts +1 -1
  95. package/packages/core/src/config/schema.ts +352 -10
  96. package/packages/core/src/distribution-packaging.ts +116 -0
  97. package/packages/core/src/events/catalog.ts +6 -0
  98. package/packages/core/src/events/payloads.ts +53 -9
  99. package/packages/core/src/events/policy.ts +25 -0
  100. package/packages/core/src/events/repository.ts +184 -4
  101. package/packages/core/src/events/runtime.ts +16 -0
  102. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +2515 -78
  103. package/packages/core/src/kernel/dispatch-drain-recovery.ts +121 -0
  104. package/packages/core/src/kernel/dispatch-status.ts +4 -2
  105. package/packages/core/src/kernel/dispatch-upgrade.ts +171 -0
  106. package/packages/core/src/kernel/dispatcher-liveness.ts +7 -0
  107. package/packages/core/src/kernel/generators/repository-journals.ts +82 -0
  108. package/packages/core/src/kernel/guarded-forge.ts +1 -1
  109. package/packages/core/src/kernel/harvest.ts +98 -4
  110. package/packages/core/src/kernel/integration-attention.ts +20 -0
  111. package/packages/core/src/kernel/integration-state.ts +80 -11
  112. package/packages/core/src/kernel/landing-readiness.ts +6 -1
  113. package/packages/core/src/kernel/mixed-version.ts +34 -0
  114. package/packages/core/src/kernel/node-polling.ts +160 -0
  115. package/packages/core/src/kernel/read-facts.ts +40 -5
  116. package/packages/core/src/kernel/reducer-registry.ts +3 -0
  117. package/packages/core/src/kernel/reducer.ts +75 -14
  118. package/packages/core/src/kernel/service-facts.ts +11 -4
  119. package/packages/core/src/ontology.ts +2 -2
  120. package/packages/core/src/open-map.ts +3 -1
  121. package/packages/core/src/operator/presentation.ts +7 -0
  122. package/packages/core/src/operator/query.ts +6 -2
  123. package/packages/core/src/operator/registry.ts +1 -1
  124. package/packages/core/src/plugins/load.ts +4 -1
  125. package/packages/core/src/plugins/runtime-snapshot.ts +128 -0
  126. package/packages/core/src/ports/forge/contract.ts +29 -0
  127. package/packages/core/src/ports/forge/github.ts +189 -61
  128. package/packages/core/src/ports/forge-failure.ts +1 -0
  129. package/packages/core/src/ports/forge-telemetry.ts +3 -0
  130. package/packages/core/src/ports/runner/session-env.ts +1 -0
  131. package/packages/core/src/ports/types.ts +10 -0
  132. package/packages/core/src/ports/workspace/distribution-archive.ts +22 -149
  133. package/packages/core/src/ports/workspace/distribution-release.ts +56 -0
  134. package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
  135. package/packages/core/src/ports/workspace/local-build-execution.ts +37 -17
  136. package/packages/core/src/processes/build-child-exit.ts +5 -26
  137. package/packages/core/src/processes/build-runner.ts +81 -11
  138. package/packages/core/src/processes/dispatcher.ts +254 -23
  139. package/packages/core/src/processes/execution-no-progress.ts +6 -0
  140. package/packages/core/src/processes/execution-relaunch.ts +30 -0
  141. package/packages/core/src/processes/execution-settlement.ts +16 -7
  142. package/packages/core/src/processes/harvest-runner.ts +328 -292
  143. package/packages/core/src/processes/process-group-reaper.ts +17 -10
  144. package/packages/core/src/runtime-identity.ts +22 -3
  145. package/packages/core/src/store/contract.ts +153 -0
  146. package/packages/core/src/store/local/store.ts +197 -72
  147. package/packages/core/src/store/reduced-reads.ts +8 -0
  148. package/packages/core/src/store/reducer-value-shapes.json +5783 -3305
  149. package/packages/core/src/store/remote/client.ts +43 -0
  150. package/packages/core/src/store/repo-state-events.ts +20 -3
  151. package/packages/core/src/store/types.ts +7 -0
  152. package/skills/finalize/SKILL.md +3 -1
  153. package/skills/guide/SKILL.md +273 -48
  154. package/skills/guide/references/integration-tree.md +87 -2
  155. package/skills/guide/references/operator-api.md +71 -14
  156. package/skills/guide/references/plugin-authoring.md +231 -266
  157. package/skills/guide/references/remote-store-protocol.md +12 -9
  158. package/skills/guide/references/restacking.md +4 -1
  159. package/skills/guide/references/setup.md +28 -6
  160. package/skills/guide/references/spec-standard.md +23 -5
  161. package/skills/harvest/SKILL.md +4 -0
  162. package/skills/harvest-review/SKILL.md +4 -0
  163. package/skills/implement/SKILL.md +4 -2
  164. package/skills/operate/SKILL.md +104 -35
  165. package/skills/plan/SKILL.md +12 -4
  166. package/skills/spec/SKILL.md +20 -2
  167. package/skills/tickets/SKILL.md +20 -1
  168. 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).
@@ -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.
@@ -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.14.0",
21
- "@defrex/autobuild": "0.14.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.
@@ -103,6 +103,22 @@ source targets, while build status shows the effective destination.
103
103
 
104
104
  ## Collect, verify and land
105
105
 
106
+ Node `verify:*` context additionally exposes `nodeVerification`: the frozen
107
+ range, a JSON index path, contribution build slugs, current stored ticket
108
+ identities, event-authorized spec revisions and spec paths, and their commits.
109
+ The index maps every commit in the range using build identity trailers,
110
+ including earlier-cycle contributions and merge side history. Commits without
111
+ an identity are listed as unattributed (a mechanical classification). The manifest
112
+ and index also expose `handPushedCommits: [{sha, originalSha, message}]` for owned
113
+ hand-pushed commits in the frozen range, preserving original identity across restacks.
114
+ Their full messages express maintainer-authorized intent: judge quality and
115
+ consistency, and never fail them solely for lacking a covering spec. Other node
116
+ changes are authorized when covered by the current event-authorized node spec or the spec
117
+ of the contribution introducing it; use the commit mapping to find that spec.
118
+ Missing or ambiguous provenance fails hydration. Leaf context is unchanged.
119
+ See [iterating inside a node](#iterating-inside-a-node) for authoring and evolving
120
+ these sources of intent.
121
+
106
122
  Create a node and direct work into it (replace ids with those returned by your
107
123
  source):
108
124
 
@@ -127,8 +143,10 @@ publication; tracker edits cannot be transactional with a forge write.
127
143
 
128
144
  The kernel runs all configured verify steps with normal path applicability on
129
145
  the exact node head and parent. Either moving invalidates eligibility, even a
130
- clean restack. Failed verification blocks the node: file a repair child targeting
131
- it; the repaired landed head permits a new cycle. Historical reports keep their
146
+ clean restack. Failed verification blocks the node and emits `integration.verification-failed` once per prepared cycle. Default watch and new hosted wake settings include it; `ab wait --for attention` also detects the current failure before notification. The fact names failed steps, head, parent and repair guidance. Watch baselines prior failures; reconcile status after arming. A new cycle can notify again, while historical facts do not keep a repaired node blocked. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled. Recheck current status before filing a repair, since the node may have advanced after notification. To recover, file a repair child targeting
147
+ it; the repaired landed head permits a new cycle. If the contract changed, an
148
+ operator can explicitly revise the spec instead and verify again on the same head
149
+ (see operator node spec revisions below). Historical reports keep their
132
150
  actual head/base citations. Integration grammar is collect → verify → land →
133
151
  close, with restacking and repair cycles along the way.
134
152
 
@@ -145,6 +163,38 @@ merged head was verified, then completes the ticket. Closing without merge or
145
163
  aborting closes admission and returns the ticket to triage; already claimed
146
164
  children retain their frozen destination.
147
165
 
166
+ ## Iterating inside a node
167
+
168
+ Write the node spec as a finite integration charter: its goal, observable
169
+ completion conditions for the whole, and destination and landing expectations
170
+ under the effective policy. Put feature specifics in spec-standard children.
171
+ An open node supports three ways to iterate:
172
+
173
+ - **Add children.** Create spec-standard tickets targeting the node's ticket id,
174
+ for example `ab ticket create "Account settings" --body settings.md --target <node-id>`.
175
+ Ordinary children run their normal pipeline. Verification uses the provenance
176
+ mapping to judge changes against the introducing child's spec or the current
177
+ event-authorized node charter; a child contribution need not also be promised
178
+ independently by the charter.
179
+ - **Push small maintainer-authorized tweaks.** Push to the node's recorded branch
180
+ with meaningful commit messages describing intent. Verification reads the frozen
181
+ range's owned `handPushedCommits` messages, judges quality and consistency, and
182
+ cannot fail a tweak solely because it lacks a covering spec. This is maintainer
183
+ iteration, not permission for phase agents to bypass their publication boundary.
184
+ - **Revise the charter when the charter itself changes.** Use
185
+ `ab answer <node> --revise-spec replacement.md`, or update the ticket and import
186
+ it with `ab answer <node> --revise-spec-from-ticket`. A ticket edit alone does
187
+ not revise an active build. Children retain their specs, claims and targets;
188
+ the node recollects and verifies the replacement revision, including on the
189
+ same head and parent after failed verification. See
190
+ [operator node spec revisions](#operator-node-spec-revisions) for admission
191
+ restrictions.
192
+
193
+ Open children keep the node incomplete, including triage, backlog and ready
194
+ children. Completion remains finite: landed or otherwise ended nodes close
195
+ admission. Iteration does not relax verification of the exact head and parent,
196
+ or the configured readiness, consent and landing gates described above.
197
+
148
198
  ## Changing a parent
149
199
 
150
200
  `ab ticket update NODE-1 --target NODE-2` reparents an open node;
@@ -194,3 +244,38 @@ verification and landing, for queued dependency presence, on operator request,
194
244
  and after accepted re-parenting. Descendants need independent demand; presence
195
245
  requests follow only the minimal proven ancestor path. See
196
246
  [restacking](restacking.md#timing-and-evidence) for timing, requests and distance.
247
+
248
+ ## Polling and status
249
+
250
+ Opened integration nodes poll every tick until their durable activity has been
251
+ quiet for `policy.nodeIdleAfterSeconds` (default 600 seconds), then poll every
252
+ `policy.nodeIdlePollSeconds` (default 120 seconds). Holds and waiting for consent
253
+ qualify normally. Child claims, PR and landing activity, operator commands
254
+ (including repeated holds), restack requests and answers wake the next tick.
255
+ GitHub-only changes are discovered on the next due check, within the idle
256
+ interval plus normal tick scheduling while the dispatcher is running; failure,
257
+ cooldown and transport-budget gates still apply. Pending operations retain
258
+ active polling and action-time readiness checks remain fresh. Successful
259
+ `node.poll-checked` facts preserve quiet history across restarts; missing facts
260
+ force a fresh check. `ab build status` reports active or idle cadence and the
261
+ last successful check (or unrecorded evidence).
262
+
263
+ ## Operator node spec revisions
264
+
265
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
266
+ integration verification without an escalation. Use
267
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
268
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
269
+ the build. Both forms enforce the same spec standard as leaf revisions.
270
+ Each kernel `spec.revised` records the exact artifact and operator identity
271
+ (with optional transport provenance); earlier revisions remain readable.
272
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
273
+ The node recollects and verifies the new revision, including on the same head
274
+ and parent after a failed cycle. Earlier cycles remain historical evidence
275
+ and cannot block or authorize landing under the replacement. Children keep
276
+ their specs, claims and targets; contributions are not restarted.
277
+ Active verification/reconcile or writer work, restack/reparent work, pause,
278
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
279
+ A concurrent state change refuses publication with a retry explanation;
280
+ uncited artifacts are inert. Leaves still require an open escalation and
281
+ restart from `plan`.