@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,93 @@
1
+ #!/usr/bin/env bun
2
+ import { ownsDispatchPresentation } from '../packages/core/src/cli/dispatch-presentation-ownership'
3
+ import { cachedRuntime } from '../packages/core/src/cli/dispatch-runtime-cache'
4
+ import { distributionRoot } from '../packages/core/src/distribution'
5
+ import {
6
+ consumeGenerationMarker,
7
+ GENERATION_EXITS,
8
+ DISPATCH_LAUNCH_CONTEXT_ENV,
9
+ } from '../packages/core/src/cli/dispatch-launch-contract'
10
+ import { watchDispatchParent } from '../packages/core/src/cli/dispatch-parent-watch'
11
+ let code: number = GENERATION_EXITS.failed
12
+ let presentationOwner = process.argv[2] !== '--preflight'
13
+ try {
14
+ const launch = consumeGenerationMarker(process.env, distributionRoot())
15
+ if (!(await cachedRuntime(launch.runtimeRoot)))
16
+ throw new Error('dispatcher generation requires a completed cached runtime')
17
+ const { loadDotEnv } = await import('../packages/core/src/cli/dotenv')
18
+ const { join } = await import('node:path')
19
+ loadDotEnv(join(launch.checkout, '.env'), process.env)
20
+ const { readHandoff } = await import('../packages/core/src/cli/dispatch-handoff')
21
+ if (process.argv[2] === '--read-journal') {
22
+ const { readGenerationJournal } = await import('../packages/core/src/cli/dispatch-handoff')
23
+ console.log(
24
+ JSON.stringify(await readGenerationJournal(launch, process.argv.slice(3), process.env)),
25
+ )
26
+ process.exit(0)
27
+ }
28
+ if (process.argv[2] === '--recover-terminal-release') {
29
+ const { recoverTerminalRelease } = await import('../packages/core/src/cli/dispatch-handoff')
30
+ await recoverTerminalRelease(launch, process.argv.slice(3), process.env)
31
+ process.exit(0)
32
+ }
33
+ if (process.argv[2] === '--read-upgrade') {
34
+ const { readUpgradeProjection } = await import('../packages/core/src/cli/dispatch-handoff')
35
+ console.log(
36
+ JSON.stringify(await readUpgradeProjection(launch, process.argv.slice(3), process.env)),
37
+ )
38
+ process.exit(0)
39
+ }
40
+ if (process.argv[2] === '--record-preflight-failure') {
41
+ const { recordPreflightFailure } = await import('../packages/core/src/cli/dispatch-handoff')
42
+ await recordPreflightFailure(
43
+ launch,
44
+ process.argv.slice(5),
45
+ process.env,
46
+ process.argv[3]!,
47
+ process.argv[4]!,
48
+ )
49
+ process.exit(0)
50
+ }
51
+ if (process.argv[2] === '--read-handoff') {
52
+ const handoff = await readHandoff(launch, process.argv.slice(3), process.env)
53
+ console.log(JSON.stringify({ version: 1, handoff: handoff ?? null }))
54
+ process.exit(0)
55
+ }
56
+ if (process.argv[2] === '--preflight') {
57
+ if (launch.overlapVersion !== 1) throw new Error('launcher has no overlap capability')
58
+ const { preflightGeneration } = await import('../packages/core/src/cli/dispatch-preflight')
59
+ const abort = new AbortController()
60
+ const stop = () => abort.abort()
61
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT'] as const)
62
+ process.on(signal, stop)
63
+ try {
64
+ if (!(await preflightGeneration(launch, process.argv.slice(3), process.env, abort.signal)))
65
+ process.exit(GENERATION_EXITS.failed)
66
+ presentationOwner = true
67
+ process.argv.splice(2, 1)
68
+ } finally {
69
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT'] as const)
70
+ process.removeListener(signal, stop)
71
+ }
72
+ }
73
+ process.env[DISPATCH_LAUNCH_CONTEXT_ENV] = JSON.stringify(launch)
74
+ const watch = watchDispatchParent(launch.launcherPid ?? process.ppid, () =>
75
+ process.kill(process.pid, 'SIGINT'),
76
+ )
77
+ try {
78
+ const { runDirectBinary } = await import('../packages/core/src/cli/binary-direct')
79
+ const result = await runDirectBinary(process.argv.slice(2))
80
+ code =
81
+ result === 0
82
+ ? (await readHandoff(launch, process.argv.slice(2), process.env))
83
+ ? GENERATION_EXITS.handoff
84
+ : GENERATION_EXITS.stopped
85
+ : result
86
+ } finally {
87
+ watch.close()
88
+ }
89
+ } catch (error) {
90
+ if (presentationOwner && ownsDispatchPresentation())
91
+ console.error(error instanceof Error ? error.message : String(error))
92
+ }
93
+ process.exit(code)
@@ -0,0 +1,157 @@
1
+ ---
2
+ title: "Agent runtimes"
3
+ group: "reference"
4
+ description: "Choose Claude Code, Codex, or Pi, route producer and reviewer models, and implement a runtime adapter."
5
+ label: "Agent runtimes"
6
+ order: 14
7
+ ---
8
+
9
+ # Agent runtimes
10
+
11
+ ## Responsibility
12
+
13
+ A runtime transports agent turns: it starts, continues, cancels and ends sessions, captures transcripts and usage, and classifies failures. Roles choose the runtime and model; the workspace provider decides where they execute. Neither starts your operator agent, which works externally through the CLI or MCP.
14
+
15
+ ## Shipped adapters
16
+
17
+ Install with `bun add -d --exact @defrex/autobuild`. Examples are complete minimal configs for local execution: install and authenticate the CLI on the dispatcher host, then run `bun ab init --validate`.
18
+
19
+ A subscription login is host state and doesn't reach a remote sandbox. Remotely, provision every selected runtime and alternate and forward only API credentials; see [Workspaces](workspaces.md).
20
+
21
+ | Runtime | Models | Model ids | Default model |
22
+ |---|---|---|---|
23
+ | `claude` | Anthropic, via Claude Code | `claude-` family | the CLI's default |
24
+ | `codex` | OpenAI, via the Codex CLI | `gpt-` family | the CLI's default |
25
+ | `pi` | many providers | `provider/model` | `kimi-coding/k3` |
26
+
27
+ Set the model with the role's `model` field, not in `args`; the adapter owns model and output-protocol flags.
28
+
29
+ ### Claude Code (`claude`)
30
+
31
+ Install `claude` ([setup](https://code.claude.com/docs/en/setup)) and log in. API-backed environments need a provider credential such as `ANTHROPIC_API_KEY`, not copied login state; see [Claude authentication](https://code.claude.com/docs/en/authentication).
32
+
33
+ <!-- seam-config:start -->
34
+ ```toml
35
+ [tickets]
36
+ source = "file"
37
+ readyState = "ready"
38
+
39
+ [roles.default]
40
+ runtime = "claude"
41
+ ```
42
+ <!-- seam-config:end -->
43
+
44
+ ### Codex (`codex`)
45
+
46
+ Install `codex` ([CLI instructions](https://developers.openai.com/codex/cli)) and run `codex login`. API use needs its own credential, commonly `OPENAI_API_KEY`, with billing authority; see [Codex authentication](https://developers.openai.com/codex/auth).
47
+
48
+ <!-- seam-config:start -->
49
+ ```toml
50
+ [tickets]
51
+ source = "file"
52
+ readyState = "ready"
53
+
54
+ [roles.default]
55
+ runtime = "codex"
56
+ ```
57
+ <!-- seam-config:end -->
58
+
59
+ ### Pi (`pi`)
60
+
61
+ Install `pi` ([setup guide](https://github.com/earendil-works/pi/tree/main/packages/coding-agent)), then `/login` with a supported subscription or supply the provider's API credentials (a Vercel AI Gateway route needs `AI_GATEWAY_API_KEY`). Pi's provider configuration decides which account serves the model.
62
+
63
+ <!-- seam-config:start -->
64
+ ```toml
65
+ [tickets]
66
+ source = "file"
67
+ readyState = "ready"
68
+
69
+ [roles.default]
70
+ runtime = "pi"
71
+ model = "vercel-ai-gateway/anthropic/claude-sonnet-4.6"
72
+ ```
73
+ <!-- seam-config:end -->
74
+
75
+ Set an explicit route for any provider other than the `kimi-coding/k3` default. Example ids show syntax, not availability.
76
+
77
+ ## Choosing models
78
+
79
+ - **Producers** (plan, implement): one strong general coding model.
80
+ - **Reviewers** (plan review, code review, agent verification): a different strong model, preferably from another provider, to expose different assumptions. If your operator agent critiques specs well, its model is a good candidate.
81
+ - **Measure** quality, cost, latency and account limits on your repository.
82
+
83
+ This repository's example, recorded **2026-10-21**, uses `gpt-6.1-sol` (Codex) for producers and `claude-opus-5-5` (Claude) for reviewers, with reciprocal alternates. These are dated ids, not defaults; check `bun ab models` before adopting them.
84
+
85
+ <!-- seam-config:start -->
86
+ ```toml
87
+ [tickets]
88
+ source = "file"
89
+ readyState = "ready"
90
+
91
+ [verify]
92
+ steps = ["acceptance"]
93
+
94
+ [verify.acceptance]
95
+ kind = "agent"
96
+ skill = "verify-acceptance"
97
+
98
+ [roles.default]
99
+ runtime = "codex"
100
+ model = "gpt-6.1-sol"
101
+ alternates = [{ runtime = "claude", model = "claude-opus-5-5" }]
102
+
103
+ [roles.plan]
104
+ runtime = "codex"
105
+ model = "gpt-6.1-sol"
106
+ alternates = [{ runtime = "claude", model = "claude-opus-5-5" }]
107
+
108
+ [roles.implement]
109
+ runtime = "codex"
110
+ model = "gpt-6.1-sol"
111
+ alternates = [{ runtime = "claude", model = "claude-opus-5-5" }]
112
+
113
+ [roles.plan-review]
114
+ runtime = "claude"
115
+ model = "claude-opus-5-5"
116
+ alternates = [{ runtime = "codex", model = "gpt-6.1-sol" }]
117
+
118
+ [roles.code-review]
119
+ runtime = "claude"
120
+ model = "claude-opus-5-5"
121
+ alternates = [{ runtime = "codex", model = "gpt-6.1-sol" }]
122
+
123
+ [roles.acceptance]
124
+ runtime = "claude"
125
+ model = "claude-opus-5-5"
126
+ alternates = [{ runtime = "codex", model = "gpt-6.1-sol" }]
127
+ ```
128
+ <!-- seam-config:end -->
129
+
130
+ - **Verifier roles** use the step name (`roles.acceptance`), not the skill name; author the `verify-acceptance` skill first. Check steps run commands and need no model.
131
+ - **Inheritance.** Each role inherits omitted fields from `roles.default` field by field; an explicit `args` list replaces the inherited one.
132
+ - **Alternates** are ordered availability routes, not extra reviewers. Availability or exhaustion failures, or a missing executable, select the next route; credential and configuration failures need repair. A fallback may cost provider independence, so check which runtime ran.
133
+
134
+ ## Writing your own
135
+
136
+ Implement `AgentRunner`, return it in a `RuntimeRegistration`, and register the factory in `agentRuntimes`. Import from `@defrex/autobuild/plugin-sdk`; [Writing a plugin](plugin-authoring.md) covers the manifest.
137
+
138
+ A runtime must:
139
+
140
+ - preserve start/continue/end session identity, complete transcripts and usage, and refresh the environment each turn
141
+ - use the session's supplied `ab` launcher, never a CLI from the build branch
142
+ - keep an endable handle after cancellation so the runner can deposit the partial transcript
143
+ - report failures with verbatim diagnostics, the `permanent` bit and, when classifiable, `cause: availability | exhaustion | credentials | configuration`; never classify authentication as capacity loss
144
+ - declare `servesModels` prefixes and an optional matching `defaultModel` for routing validation
145
+
146
+ Optional capabilities:
147
+
148
+ - **`oneShot`**, tool-free and separate from phase sessions.
149
+ - **Native resume.** Declaring it means running `describeNativeResumeContract` with a `NativeResumeContractFixture` and preserving fresh-process identity and continuation semantics.
150
+
151
+ Test with an `AgentRunnerContractFactory` whose `AgentRunnerContractHarness` fixtures cover successful turns, typed failures, cancellation, turn-environment observations and cleanup. Run `describeAgentRunnerContract` unchanged, or expose its fixture through the plugin descriptor and run:
152
+
153
+ ```sh
154
+ bun ab plugin test agent-runtime acme
155
+ ```
156
+
157
+ Exercise declared streaming and one-shot capabilities through their harness fixtures too.
@@ -11,7 +11,7 @@ Every action below is sessionless, records a human-authored fact, and accepts
11
11
  | Try again without guidance | `ab answer <slug>` | Records a bare `retry`; no prose is delivered to an agent. |
12
12
  | Widen an exhausted review loop | `ab answer <slug> [<text>] --review-round-ceiling <n>` | Answers the open `review-round-limit` escalation and replaces the configured cap with absolute ceiling `n` for that loop and spec revision only. |
13
13
  | Retire a review disagreement | `ab answer <slug> --dismiss` | Records `dismiss-finding` for each escalation that cites a real finding id. The next reviewer is told not to re-raise that chain. |
14
- | Replace the build contract from a file | `ab answer <slug> --revise-spec <file>` | Records the replacement as the next spec revision and restarts at `plan`. |
14
+ | Replace the build contract from a file | `ab answer <slug> --revise-spec <file>` | Records the replacement as the next spec revision and restarts leaves at `plan`; nodes recollect and verify. |
15
15
  | Re-import an amended ticket | `ab answer <slug> --revise-spec-from-ticket` | Reads the build's recorded ticket and performs the same revision. |
16
16
  | Abandon the build | `ab abort <slug>` | Irrevocably requests abort; cleanup returns the ticket to Triage. |
17
17
 
@@ -66,14 +66,14 @@ problem in the same file under a new finding id.
66
66
 
67
67
  ## Revising the spec
68
68
 
69
- Revision requires an open escalation because the spec is the contract against
69
+ Leaf revision requires an open escalation because the spec is the contract against
70
70
  which every downstream approval is measured. The replacement must satisfy the
71
71
  same spec-standard quality gate used at dispatch; a non-conforming body is
72
72
  rejected before an artifact or event is recorded, leaving the build blocked on
73
73
  its current revision.
74
74
 
75
75
  A successful answer records a human `escalation.answered` fact naming the exact
76
- replacement artifact, followed by kernel `spec.revised`. The build re-plans and
76
+ replacement artifact, followed by kernel `spec.revised`. The leaf re-plans and
77
77
  pre-revision reviews, verification, and finalize completion do not satisfy the
78
78
  new run. Historical phase runs remain pinned to the revision they saw. An
79
79
  already-open pull request is retained and updated rather than duplicated.
@@ -87,3 +87,21 @@ A build that has already become terminal cannot restart. This includes the
87
87
  short windows where its PR has merged or closed and completion is underway, or
88
88
  where an abort request is pending. Abort is irrevocable; after cleanup, dispatch
89
89
  the returned ticket as a fresh build if work should continue.
90
+
91
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
92
+ integration verification without an escalation. Use
93
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
94
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
95
+ the build. Both forms enforce the same spec standard as leaf revisions.
96
+ Each kernel `spec.revised` records the exact artifact and operator identity
97
+ (with optional transport provenance); earlier revisions remain readable.
98
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
99
+ The node recollects and verifies the new revision, including on the same head
100
+ and parent after a failed cycle. Earlier cycles remain historical evidence
101
+ and cannot block or authorize landing under the replacement. Children keep
102
+ their specs, claims and targets; contributions are not restarted.
103
+ Active verification/reconcile or writer work, restack/reparent work, pause,
104
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
105
+ A concurrent state change refuses publication with a retry explanation;
106
+ uncited artifacts are inert. Leaves still require an open escalation and
107
+ restart from `plan`.
@@ -89,7 +89,7 @@ remote-store protocol requires matching client and server versions.
89
89
  | `packages/core/src/plugins/` | Strict versioned plugin manifests, dual-root repository/package Bun loading, owner-aware adapter registration, contract/credential metadata, and runtime-factory materialization | §3.2.1, §9 |
90
90
  | `packages/core/src/plugin-sdk/` | The sole supported `@defrex/autobuild/plugin-sdk` barrel: port/manifest types, contract suites, and reference fakes | §3.2.1 |
91
91
  | `packages/core/src/processes/` | build-runner and standalone child composition, durable execution config/diagnostics, dispatcher (+ janitor duty, harvest trigger, and the last-step orchestrator resume/reap/wake pass, origin-mode-gated), orchestrator tick step, harvest deterministic core + runner | §3.3, §7.1.2, §12, §15.7 |
92
- | `packages/core/src/cli/` and `bin/` | The `ab` CLI — the only agent↔store channel — plus the shared presentation-only durable-progress projection, init/upgrade, the Store-only dispatch frontend, its private supervised kernel entry, and `bin/ab-build-runner.ts` (one child per build) | §8, §14, §16.3 |
92
+ | `packages/core/src/cli/` and `bin/` | The `ab` CLI — the only agent↔store channel — plus the shared presentation-only durable-progress projection, init/upgrade, the filesystem-only dispatch launcher and immutable generation cache, the Store-only dispatch frontend, its private supervised kernel entry, and `bin/ab-build-runner.ts` (one child per build) | §8, §14, §16.3 |
93
93
  | `packages/core/src/cli/dashboard/` | `ab dispatch`'s fixed live frame: pure projection, renderer, poll cache, and deterministic image renderer | §14 |
94
94
  | `bin/agent/ab` | Private launcher placed first on agent-session `PATH`; delegates to the canonical `bin/ab.ts` | §8.1 |
95
95
  | `packages/core/src/config/` | `autobuild.toml` parsing and strict validation, plus the pure role-key consumability diagnostics `ab dispatch` reports at startup (`roles.ts`); user reference in `docs/configuration.md` | §9, §16.1 |
@@ -423,7 +423,83 @@ reaps the complete inherited process group, escalating group-wide from SIGTERM
423
423
  through the existing bounded delay to SIGKILL; only then is it a liveness signal
424
424
  and only then does the kernel release the exact lease. Interactive `ab dispatch` runs the kernel owner in the
425
425
  private `bin/ab-dispatch-kernel.ts` child;
426
- `dispatch-frontend.ts` owns only terminal/Store adapters and
426
+ `dispatch-launcher.ts` freezes the invoking distribution and installed production
427
+ dependencies offline under `.autobuild/runtime/`, then starts
428
+ `bin/ab-dispatch-generation.ts` using the pinned v1 process contract. It loads
429
+ only filesystem/process helpers and never opens a Store. The generation's
430
+ frontend, kernel, local runners and agent CLI use one completed immutable root;
431
+ `dispatch-runtime-use.ts` protects current/previous/held/live entries during
432
+ spawn and pruning. Source guest archives are captured at installation. Source generations deliver
433
+ the exact packed source archive; registry generations keep a separate,
434
+ digest-validated GitHub release asset matching the cached manifest version,
435
+ resolved and atomically cached at first guest use. Local launch remains offline.
436
+ Installation provenance uses Bun store/lock evidence across isolated and hoisted
437
+ layouts, preserving source/forge markers before staging.
438
+ The normalized host archive retains its independent compiler boundary. Guest
439
+ archive delivery uses the authenticated provider transport after launcher startup,
440
+ keeping HTTP code outside the resident launcher’s eager filesystem/process graph.
441
+ `--once`, origin/hosted paths and injected hot dashboard rendering remain direct.
442
+ `dispatch-upgrade-target.ts` reads manifest and lock blobs from one authoritative
443
+ base snapshot, or rereads the original install pathname when unpinned. Frozen
444
+ launcher eligibility selects source mode for a source root sharing the dispatched
445
+ repository's Git common directory. `dispatch-upgrade-source.ts` exports exact
446
+ commits into private cache staging and fingerprints actual packed contents and
447
+ the production-reachable Bun lock closure. Source preparation installs with the
448
+ frozen lock and scripts disabled, then publishes through the existing immutable
449
+ runtime cache. Neither resolution nor installation changes an operator/build
450
+ worktree. Excluded-file commits change observed provenance without adoption.
451
+ `dispatch-upgrade-install.ts` stages and validates exact targets;
452
+ `dispatch-upgrade-controller.ts` checks immediately and every 60 seconds, suppresses
453
+ failed target inputs and publishes durable prepared targets. `dispatch-preflight.ts`
454
+ checks target configuration, provider compatibility and actual protocol-write
455
+ admission before requesting yield. `kernel/dispatch-upgrade.ts` folds correlated
456
+ acceptance, terminal release, takeover, per-execution retirement and completion.
457
+ The runtime-owned `dispatch-handoff.ts` reader lets the filesystem-only launcher
458
+ supervise overlapping generations without owning Store or config decisions.
459
+ A runtime-owned repository-record projection binds the journal transport before
460
+ initial spawn and across handoffs, including when later config edits are invalid.
461
+ `dispatch-frontend.ts` acknowledges terminal release only after joining input
462
+ and rendering. The old kernel releases repository authority but retains local
463
+ execution supervision until completion or the hot policy deadline. Build-log
464
+ execution authorization permits expected mixed-version deferral without restart
465
+ attention. Accepted authorization also carries the target runtime.
466
+ `processes/execution-relaunch.ts` compares immutable identities from existing
467
+ boundary facts; local and remote runners finish the phase, record an instance-correlated
468
+ relaunch request and clean up. Confirmed teardown records a neutral relaunch
469
+ outcome. The current owner's ordinary lease sweep resumes durable work promptly,
470
+ including after an ownership gap. Remote captures authorize exact guest runtimes
471
+ independently of local retirement, including late attachment after completion.
472
+ The existing repository execution digests bound recovery and handoff capture reads
473
+ to open executions; multiple historical captures share one read per live build.
474
+ Guests detach without losing leases; re-attachment refreshes their archive before
475
+ the next phase. Deadline suspension applies only to local runners. `kernel/dispatch-drain-recovery.ts` reconstructs unfinished retirement
476
+ after a predecessor dies. Cutover suspends immediately when provider evidence
477
+ cannot establish safe overlap. Automatic upgrades can be disabled; targets
478
+ without preflight capability require manual restart.
479
+
480
+ **Automatic runtime rollback.** The filesystem/process-only launcher in
481
+ `cli/dispatch-launcher.ts` owns the crash budget, anchored to durable takeover.
482
+ `cli/dispatch-crash-budget.ts` counts three failed exits within ten minutes;
483
+ `cli/dispatch-launch-contract.ts` negotiates a separate rollback capability while
484
+ preserving v1 launch/overlap compatibility. Generation-owned readers expose takeover
485
+ and capability evidence. `cli/dispatch-handoff.ts` validates recovery against that
486
+ evidence and deposits the idempotent rollback fact after lease acquisition.
487
+ `kernel/dispatch-upgrade.ts` reduces lineage holds and historical rollback;
488
+ `cli/dispatch-upgrade-controller.ts` clears a hold only after resolving a different
489
+ target. `cli/dispatch-runtime-use.ts` transfers reservations to generation-owned
490
+ hold retention under the pruning lock. Existing runner leases and decisive-read
491
+ deferrals remain the boundary recovery authority.
492
+
493
+ Local harvest suspends durably before repository lease release on handoff or
494
+ clean stop. The next generation resumes eligible native sessions with fresh
495
+ logical credentials, or records a reasoned `harvest.session.resume-fallback`
496
+ and starts fresh. Orderly suspension spends no recovery attempt; real crashes
497
+ retain recovery accounting.
498
+
499
+ The advisory
500
+ `dispatcher.upgrade-target-resolved` fact independently retains each run's latest
501
+ successful mode/base/SHA observation without clearing failure evidence; repeated
502
+ identical observations append nothing. `dispatch-frontend.ts` owns only terminal/Store adapters and
427
503
  `dispatch-process.ts` owns child supervision. SIGINT, SIGHUP, SIGQUIT, and
428
504
  SIGTERM restore terminal modes immediately and begin one supervised drain;
429
505
  persistent frontend and child handlers keep repeated signals graceful until the
@@ -459,7 +535,7 @@ appends transcriptless reclaimed `session.ended` facts for unrelated open
459
535
  sessions before `runner.attached` cites that same boundary. Partial closure is
460
536
  retry-safe; historical orphan-only logs keep their
461
537
  old projection until an actual takeover records those facts. The supervisor
462
- rechecks kernel-child liveness at the force boundary
538
+ waits for graceful kernel-child teardown without a force-kill deadline
463
539
  and projects the same normal, forced, or abnormal result (with available
464
540
  process/error detail) that the repository run-stopped evidence records. Ordinary
465
541
  kernel teardown stops and reaps all build groups. Every build-child terminal
@@ -902,7 +978,10 @@ alternate targets, and independently inherited build-session budget.
902
978
  `build-runner.ts` and `harvest-runner.ts` own the deterministic
903
979
  primary-first attempt loop: each substitution opens a new session bracket,
904
980
  records provenance on its start, and only complete-chain exhaustion consumes an
905
- existing phase/session attempt. This keeps runtime availability routing out of
981
+ existing phase/session attempt. A suspended harvest turn first tries its recorded
982
+ route, then the remaining targets in configured order; provider evidence retains
983
+ configured indexes, and only the primary stays live for producer revisions.
984
+ This keeps runtime availability routing out of
906
985
  agent judgment while preserving transcript and artifact actor attribution.
907
986
 
908
987
  A normal `bun test` runs the memory/fake/local registrations, including a fake
@@ -923,12 +1002,39 @@ A claim freezes the ticket's current assets into the build (SPEC §6.3):
923
1002
  `spec.revised.assets`) record the pinned revisions, `state.pinnedAssets` in the
924
1003
  reducer projects them, `getPinnedTicketAsset` reads them back by pinned revision,
925
1004
  and `ab context` writes them under `.ab/assets/`.
1005
+
926
1006
  For hosted tickets, `store/ticket-asset-snapshots.ts` copies exact revisions
927
1007
  into chunked immutable repository artifacts in the build store before pinning.
928
1008
  Reads use explicit manifest/chunk revisions without a ticket connection. Old
929
1009
  pins retain ticket-row reads; existing service attachments need no migration,
930
1010
  and attachments in old local stores are not moved.
931
1011
 
1012
+ In node `verify:*` context, `nodeVerification` in the manifest identifies the frozen
1013
+ `range`, `indexPath`, `contributions`, `handPushedCommits` and `unattributedCommits`. Each contribution
1014
+ has `build`, its current stored `ticket` identity, `spec: {kind: 'spec', rev}`,
1015
+ `specPath` and `commits`. The JSON index repeats this metadata and adds the
1016
+ exhaustive ordered `commits: [{sha, build?}]` mapping. Paths are workspace-relative
1017
+ and reflect scratch allocation, including legacy tracked-file collisions.
1018
+ Contribution specs normally live at `.ab/contributions/<build>/spec.md`; the index
1019
+ normally lives at `.ab/node-verification.json`. These files are marked `derived`
1020
+ in `materialized`, with their source build and revision recorded in the metadata.
1021
+
1022
+ Membership comes from build identity trailers on every commit reachable in the
1023
+ frozen parent-to-head range, including earlier cycles and merge side history.
1024
+ Specs use the current event-authorized revision, never an unsanctioned latest
1025
+ deposit or mutable ticket body. Unknown identities, ambiguous or invalid trailers,
1026
+ and missing source data fail hydration. Commits without a build trailer are
1027
+ listed as unattributed, a mechanical absence of a trailer rather than an authorization verdict.
1028
+ `handPushedCommits: [{sha, originalSha, message}]` identifies node-owned hand-pushed
1029
+ commits in the frozen range. Ownership uses the durable first-parent contribution
1030
+ boundary; inherited and merge-side history are not automatically owned. Confirmed
1031
+ rewrite aliases preserve original identity, and `message` is the full commit message.
1032
+ These messages express maintainer-authorized intent: judge quality and consistency;
1033
+ never fail these commits solely for lacking a covering spec.
1034
+ Other node changes are authorized when the node spec or the spec of the contribution
1035
+ that introduced it covers it; use the commit mapping to find that spec.
1036
+ Leaf verification context is unchanged.
1037
+
932
1038
  Both `ab dispatch` and sessionless `ab ticket` load the repository's plugins
933
1039
  before selecting their TicketSource; dispatch passes that one adapter instance
934
1040
  through readiness, dependency, harvest, and completion paths. The Linear,
@@ -1263,7 +1369,8 @@ columns. Reservations live in the event stream and survive lease expiry.
1263
1369
  The contribution boundary advances only on completed restacks. Reachable build
1264
1370
  identities include inherited parent changes; foreign counts include only the
1265
1371
  node's own contribution, preventing a parent rewrite from inflating descendants'
1266
- foreign inventory. Status text and JSON expose both inventory and active items.
1372
+ hand-pushed inventory (node-owned foreign commits). Status text and JSON expose
1373
+ both inventory and active items, retaining original identities after rewrites.
1267
1374
 
1268
1375
 
1269
1376
  Integration completion is sampled by `kernel/integration-completeness.ts` from
@@ -1315,8 +1422,10 @@ SIGINT/SIGTERM. A conditional artifact deposit records `session.suspended`
1315
1422
  with cause `shutdown`, the native handle, active milliseconds, partial transcript
1316
1423
  and any known incremental usage. A terminal fact that lands first prevents
1317
1424
  suspension; suspension fences the old session's terminal credentials permanently.
1318
- The process supervisor retains its existing bounded force-stop path if provider
1319
- cleanup or persistence cannot complete.
1425
+ Graceful shutdown waits for provider cleanup and durable suspension without a
1426
+ wall-clock force-exit deadline. Only after the runner leader exits does bounded
1427
+ process-group cleanup reap remaining descendants. Abnormal parent loss retains
1428
+ the detached reaper recovery path.
1320
1429
 
1321
1430
  On attachment the runner retains an eligible current phase/round session and
1322
1431
  records takeover. Matching host, workspace and runtime permit native resume;
@@ -1396,6 +1505,56 @@ ordered by descending count then build name; repository requests are unattribute
1396
1505
  Repository status names a hotspot only when one build makes at least two requests
1397
1506
  and more than half of attributed requests. Telemetry never controls workflow.
1398
1507
 
1508
+ GitHub shares in-flight and completed PR, branch/ref and comparison observations
1509
+ across builds within one dispatcher tick. Opened nodes prime their tips and
1510
+ commit distance with at most two reads: PR plus comparison, or parent branch
1511
+ plus reversed comparison without a PR. Priming is best-effort: failures add a
1512
+ diagnostic and ordinary parent/target observations continue, so a deleted parent
1513
+ can still be replaced. Forge cooldowns and rate limits retain their gates.
1514
+ Each admitted poll revalidates mutable resources
1515
+ using exact-resource ETags; authenticated 304s spare the REST primary quota.
1516
+ Adapter caches are bounded and restart/eviction falls back to fresh reads.
1517
+ Writes, including Git publication and rewrites, invalidate observations before
1518
+ attempting the mutation so acknowledgement reads remain fresh. Leaf PR polling
1519
+ keeps its existing cadence. Readiness and landing inspections remain fresh.
1520
+
1521
+ For node cadence, durable wakes, restart behavior and CLI evidence, see
1522
+ [node polling and status](integration-tree.md#polling-and-status).
1523
+
1524
+ The total includes all attempted requests. Optional `restPrimary`,
1525
+ `restNotModified` and `graphql` counts distinguish REST responses charged to the
1526
+ primary quota, REST 304s and GraphQL calls. Transport failures and historical or
1527
+ legacy observations can remain unclassified; absent fields never imply zero.
1528
+ Shared requests are attributed to their first requester; cache hits count zero.
1529
+
1399
1530
  Ticket-source continuity is reduced by `kernel/ticket-migrations.ts` from durable
1400
1531
  repository `tickets.migration-recorded` facts. Import publishes only complete
1401
1532
  mappings; current-operation resolvers leave build records and old events intact.
1533
+
1534
+ ## Integration verification reporting
1535
+
1536
+ A failed node verification cycle records `integration.verification-failed` with its prepared cycle id, failed steps, exact head and parent, and guidance to file a repair child targeting the node. The kernel reports durable failed receipts; dispatcher housekeeping recovers missing reports for the current cycle using a per-cycle CAS guard. Superseded cycles are never backfilled with repair instructions: recovery requires the latest prepared cycle to match the node’s observed head and parent. This fact is decisive evidence and bookkeeping, and does not change verification or leaf routing.
1537
+
1538
+ Default watch and new hosted wake settings include this event. Watch cursors deliver each failed cycle once and baseline failures when first armed; reconcile build status after arming. `ab wait --for attention` also detects a current failed node cycle before the report is written. Historical facts remain queryable after repair without retaining current attention. Explicit event globs and existing stored wake choices are preserved.
1539
+
1540
+ `packages/core/src/kernel/integration-state.ts` retains reported cycle identities and selects missing failures from exact receipts. `kernel/integration-attention.ts` owns their CAS append; `processes/build-runner.ts` reports after verification and `processes/dispatcher.ts` recovers missing facts before per-build janitor gates. The shared `cli/dashboard/model.ts` projects current failure as blocked attention for both frontends.
1541
+
1542
+ ## Operator node spec revisions
1543
+
1544
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
1545
+ integration verification without an escalation. Use
1546
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
1547
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
1548
+ the build. Both forms enforce the same spec standard as leaf revisions.
1549
+ Each kernel `spec.revised` records the exact artifact and operator identity
1550
+ (with optional transport provenance); earlier revisions remain readable.
1551
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
1552
+ The node recollects and verifies the new revision, including on the same head
1553
+ and parent after a failed cycle. Earlier cycles remain historical evidence
1554
+ and cannot block or authorize landing under the replacement. Children keep
1555
+ their specs, claims and targets; contributions are not restarted.
1556
+ Active verification/reconcile or writer work, restack/reparent work, pause,
1557
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
1558
+ A concurrent state change refuses publication with a retry explanation;
1559
+ uncited artifacts are inert. Leaves still require an open escalation and
1560
+ restart from `plan`.
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: "Build store"
3
+ group: "reference"
4
+ description: "Select local SQLite or an HTTP service and understand the storage extension contract."
5
+ label: "Build store"
6
+ order: 10
7
+ ---
8
+
9
+ # Build store
10
+
11
+ ## Responsibility
12
+
13
+ The BuildStore persists typed append-only events and repository journals, artifacts, blobs, session streams and leases.
14
+
15
+ - State is reduced from events; snapshots are disposable caches.
16
+ - Atomic sequence checks and transactions guard concurrent writes.
17
+ - A replacement runner resumes from durable records, without its predecessor's process or chat.
18
+ - Chosen independently of tickets and dispatcher placement.
19
+
20
+ ## Shipped adapters
21
+
22
+ ### SQLite and filesystem blobs
23
+
24
+ The default; needs no service credential:
25
+
26
+ <!-- seam-config:start -->
27
+ ```toml
28
+ [tickets]
29
+ source = "file"
30
+ readyState = "ready"
31
+ ```
32
+ <!-- seam-config:end -->
33
+
34
+ History lives in `.autobuild/`. To move it, pass a filesystem path or set a nonblank `AB_STORE`:
35
+
36
+ ```sh
37
+ bun ab builds --store /srv/autobuild/project-store
38
+ ```
39
+
40
+ Keep the database and blob directory together, durable and writable by the dispatcher identity.
41
+
42
+ ### Postgres with object storage
43
+
44
+ The server-side `@defrex/autobuild-postgres-store` package persists to PostgreSQL plus S3-compatible storage or Vercel Blob. The CLI never connects to PostgreSQL directly (no `[store] provider`); a repository selects the HTTP service:
45
+
46
+ <!-- seam-config:start -->
47
+ ```toml
48
+ [store]
49
+ url = "https://builds.example.com"
50
+
51
+ [tickets]
52
+ source = "file"
53
+ readyState = "ready"
54
+ ```
55
+ <!-- seam-config:end -->
56
+
57
+ In the service project:
58
+
59
+ ```sh
60
+ bun add @defrex/autobuild-postgres-store
61
+ export DATABASE_URL='<postgres connection URL>'
62
+ # AB_POSTGRES_URL overrides DATABASE_URL when nonblank.
63
+ ```
64
+
65
+ ```ts
66
+ import { openPostgresBuildStoreFromEnv } from '@defrex/autobuild-postgres-store'
67
+
68
+ const store = await openPostgresBuildStoreFromEnv(process.env)
69
+ ```
70
+
71
+ - **Migrate first** with the matching release's idempotent migration. Migration needs schema-creation permission; runtime needs access to the resulting tables.
72
+ - **One blob backend.** S3 needs a bucket, prefix and GetObject/PutObject credentials; Vercel Blob needs a read-write token, or an OIDC identity plus store ID.
73
+ - **Database and blob secrets** never leave the service.
74
+
75
+ ```sh
76
+ # S3-compatible storage
77
+ export AB_BLOB_BACKEND='s3'
78
+ export AB_S3_BUCKET='autobuild-artifacts'
79
+ export AB_S3_REGION='us-east-1'
80
+ export AB_S3_ACCESS_KEY_ID='<object-store identity>'
81
+ export AB_S3_SECRET_ACCESS_KEY='<object-store secret>'
82
+ # Optional: AB_S3_ENDPOINT, AB_S3_FORCE_PATH_STYLE, AB_S3_SESSION_TOKEN, AB_BLOB_PREFIX
83
+ ```
84
+
85
+ ```sh
86
+ # Alternatively, Vercel Blob
87
+ export AB_BLOB_BACKEND='vercel'
88
+ export AB_VERCEL_BLOB_ACCESS='private'
89
+ export BLOB_READ_WRITE_TOKEN='<blob read-write token>'
90
+ # Or supply VERCEL_OIDC_TOKEN and BLOB_STORE_ID together instead of the token.
91
+ ```
92
+
93
+
94
+ ### Remote HTTP client and service
95
+
96
+ `[store] url` selects the shipped HTTP client. Connect once per host and user, from a checkout with the intended origin:
97
+
98
+ ```sh
99
+ bun ab connect https://builds.example.com
100
+ bun ab builds
101
+ ```
102
+
103
+ Browser approval registers the project and saves its credential outside the repository. A URL alone grants no authority; in CI, set `AB_TOKEN` for the registered project.
104
+
105
+ Store selection precedence:
106
+
107
+ 1. `--store`
108
+ 2. nonblank `AB_STORE`
109
+ 3. committed `[store] url`
110
+ 4. the local default
111
+
112
+ A remote Store with missing credentials fails with connection guidance; it never falls back to local state.
113
+
114
+ ## Writing your own
115
+
116
+ A BuildStore isn't a plugin registration (no `buildStores` map; see [Writing a plugin](plugin-authoring.md)).
117
+
118
+ To add a backend:
119
+
120
+ 1. Implement `BuildStore` and `BlobStore` with the storage types from `@defrex/autobuild/store-adapter`.
121
+ 2. Pass the unchanged `describeBuildStoreContract` and `describeBlobStoreContract` suites from `@defrex/autobuild/testing`, on isolated fixtures with real persistence.
122
+
123
+ To serve it to the shipped CLI, implement the normative remote store protocol, not a new route catalog. Meet its conformance section and test the real remote client against your server.