@defrex/autobuild 1.0.1 → 1.2.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 (247) hide show
  1. package/README.md +10 -18
  2. package/SPEC.md +499 -238
  3. package/bin/ab-dispatch-generation.ts +11 -2
  4. package/docs/accounts.md +119 -0
  5. package/docs/agent-runtimes.md +4 -4
  6. package/docs/answering-blocked-builds.md +2 -2
  7. package/docs/architecture.md +262 -53
  8. package/docs/assets/headline-wide.png +0 -0
  9. package/docs/build-store.md +3 -41
  10. package/docs/builds.md +4 -4
  11. package/docs/cli.md +18 -4
  12. package/docs/configuration-overview.md +115 -4
  13. package/docs/configuration.md +488 -334
  14. package/docs/dispatcher-hosting.md +19 -34
  15. package/docs/dispatcher.md +1 -1
  16. package/docs/forges.md +5 -5
  17. package/docs/getting-started.md +2 -2
  18. package/docs/glossary.md +6 -6
  19. package/docs/intake.md +2 -0
  20. package/docs/integration-overview.md +15 -15
  21. package/docs/integration-tree.md +45 -38
  22. package/docs/integration.md +6 -6
  23. package/{skills/guide/references/landing-policy.md → docs/merge-policy.md} +40 -24
  24. package/docs/migration-1.0.md +17 -13
  25. package/docs/operating.md +41 -19
  26. package/docs/operator-api.md +180 -51
  27. package/docs/operator-surfaces.md +5 -18
  28. package/docs/overview.md +3 -3
  29. package/docs/plugin-authoring.md +21 -0
  30. package/docs/remote-store-protocol.md +242 -68
  31. package/docs/remote-ticket-protocol.md +30 -50
  32. package/docs/restacking.md +54 -15
  33. package/docs/seams.md +8 -8
  34. package/docs/setup.md +59 -119
  35. package/docs/skills.md +1 -1
  36. package/docs/spec-standard.md +6 -6
  37. package/docs/ticket-dependencies.md +7 -7
  38. package/docs/ticket-sources.md +18 -0
  39. package/docs/tickets.md +8 -2
  40. package/docs/troubleshooting.md +8 -12
  41. package/docs/upgrading.md +9 -4
  42. package/docs/verification.md +60 -14
  43. package/docs/workspaces.md +4 -4
  44. package/package.json +17 -6
  45. package/packages/core/src/accounts/chatgpt-oauth.ts +216 -0
  46. package/packages/core/src/accounts/chatgpt-state.ts +41 -0
  47. package/packages/core/src/accounts/local-credentials.ts +194 -0
  48. package/packages/core/src/accounts/local-inference.ts +106 -0
  49. package/packages/core/src/accounts/local-owner.ts +123 -0
  50. package/packages/core/src/accounts/sensitive.ts +2 -0
  51. package/packages/core/src/cli/accounts.ts +147 -0
  52. package/packages/core/src/cli/binary-direct.ts +13 -1
  53. package/packages/core/src/cli/binary-lifecycle.ts +65 -2
  54. package/packages/core/src/cli/binary.ts +3 -1
  55. package/packages/core/src/cli/build-control.ts +83 -28
  56. package/packages/core/src/cli/connect.ts +3 -3
  57. package/packages/core/src/cli/context.ts +81 -38
  58. package/packages/core/src/cli/dashboard/facts.ts +2 -1
  59. package/packages/core/src/cli/dashboard/integration-detail.ts +8 -8
  60. package/packages/core/src/cli/dashboard/integration-row.ts +40 -13
  61. package/packages/core/src/cli/dashboard/landing-display.ts +25 -0
  62. package/packages/core/src/cli/dashboard/model.ts +56 -33
  63. package/packages/core/src/cli/dashboard/poll.ts +9 -3
  64. package/packages/core/src/cli/dashboard/render.ts +59 -37
  65. package/packages/core/src/cli/dashboard/target-distance.ts +14 -0
  66. package/packages/core/src/cli/dashboard/tree.ts +3 -2
  67. package/packages/core/src/cli/dispatch-args.ts +1 -1
  68. package/packages/core/src/cli/dispatch-frontend.ts +6 -3
  69. package/packages/core/src/cli/dispatch-handoff.ts +125 -44
  70. package/packages/core/src/cli/dispatch-launch-contract.ts +187 -0
  71. package/packages/core/src/cli/dispatch-launcher.ts +54 -21
  72. package/packages/core/src/cli/dispatch-preflight.ts +6 -1
  73. package/packages/core/src/cli/dispatch.ts +106 -11
  74. package/packages/core/src/cli/env.ts +4 -0
  75. package/packages/core/src/cli/help.ts +46 -23
  76. package/packages/core/src/cli/init-readiness-remote.ts +22 -1
  77. package/packages/core/src/cli/init-readiness-shared.ts +5 -1
  78. package/packages/core/src/cli/init-validation.ts +160 -18
  79. package/packages/core/src/cli/main.ts +68 -8
  80. package/packages/core/src/cli/node-verification-provenance.ts +1 -97
  81. package/packages/core/src/cli/publication-settlement.ts +47 -21
  82. package/packages/core/src/cli/repository-status.ts +20 -9
  83. package/packages/core/src/cli/secrets.ts +173 -0
  84. package/packages/core/src/cli/status.ts +42 -5
  85. package/packages/core/src/cli/store-opening.ts +17 -2
  86. package/packages/core/src/cli/terminal.ts +22 -1
  87. package/packages/core/src/cli/terminals.ts +14 -10
  88. package/packages/core/src/cli/upgrade-agent.ts +9 -1
  89. package/packages/core/src/cli/upgrade-landing.ts +70 -30
  90. package/packages/core/src/cli/upgrade.ts +3 -1
  91. package/packages/core/src/cli/wait.ts +15 -7
  92. package/packages/core/src/cli/watch-lifetime.ts +111 -0
  93. package/packages/core/src/cli/watch.ts +635 -510
  94. package/packages/core/src/config/accounts.ts +101 -0
  95. package/packages/core/src/config/effective-artifact.fixture.ts +27 -0
  96. package/packages/core/src/config/effective-artifact.ts +13 -0
  97. package/packages/core/src/config/landing.ts +1 -1
  98. package/packages/core/src/config/live.ts +14 -1
  99. package/packages/core/src/config/load.ts +21 -1
  100. package/packages/core/src/config/pipeline-source.ts +28 -0
  101. package/packages/core/src/config/reference-metadata.ts +2 -0
  102. package/packages/core/src/config/reference.ts +22 -7
  103. package/packages/core/src/config/roles.ts +54 -3
  104. package/packages/core/src/config/schema.ts +146 -162
  105. package/packages/core/src/context-directory.ts +26 -0
  106. package/packages/core/src/distribution-packaging.ts +26 -5
  107. package/packages/core/src/events/catalog.ts +10 -2
  108. package/packages/core/src/events/compatibility.ts +2 -1
  109. package/packages/core/src/events/globs.ts +1 -1
  110. package/packages/core/src/events/payloads.ts +73 -1
  111. package/packages/core/src/events/policy.ts +7 -0
  112. package/packages/core/src/events/repository.ts +4 -4
  113. package/packages/core/src/events/sessions.ts +6 -6
  114. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +574 -0
  115. package/packages/core/src/kernel/auto-merge.ts +2 -2
  116. package/packages/core/src/kernel/engine.ts +255 -26
  117. package/packages/core/src/kernel/generators/leaf-restack-log.ts +10 -0
  118. package/packages/core/src/kernel/integration-landing.ts +3 -3
  119. package/packages/core/src/kernel/integration-state.ts +27 -4
  120. package/packages/core/src/kernel/leaf-restack-state.ts +28 -3
  121. package/packages/core/src/kernel/log-index.ts +13 -1
  122. package/packages/core/src/kernel/node-landing.ts +8 -8
  123. package/packages/core/src/kernel/node-parent.ts +2 -2
  124. package/packages/core/src/kernel/node-restack-transaction.ts +1 -1
  125. package/packages/core/src/kernel/node-verification-context.ts +216 -0
  126. package/packages/core/src/kernel/phases.ts +1 -1
  127. package/packages/core/src/kernel/plan-verify-selection.ts +16 -0
  128. package/packages/core/src/kernel/publication-retry.ts +168 -0
  129. package/packages/core/src/kernel/reconcile-restack.ts +29 -1
  130. package/packages/core/src/kernel/reducer.ts +85 -5
  131. package/packages/core/src/kernel/target-distance.ts +45 -0
  132. package/packages/core/src/kernel/terminal-guard.ts +10 -1
  133. package/packages/core/src/kernel/verify-stage-state.ts +123 -0
  134. package/packages/core/src/kernel/verify-stages.ts +39 -0
  135. package/packages/core/src/ontology.ts +1 -0
  136. package/packages/core/src/operator/annotations.ts +6 -0
  137. package/packages/core/src/operator/control.ts +1 -1
  138. package/packages/core/src/operator/index.ts +3 -7
  139. package/packages/core/src/operator/landings.ts +5 -1
  140. package/packages/core/src/operator/presentation.ts +6 -1
  141. package/packages/core/src/operator/protocol.ts +6 -0
  142. package/packages/core/src/operator/query.ts +14 -18
  143. package/packages/core/src/operator/registry.ts +39 -7
  144. package/packages/core/src/operator/sandbox-host.ts +64 -40
  145. package/packages/core/src/operator/sandbox.ts +3 -0
  146. package/packages/core/src/operator/ticket-source-backend.ts +3 -12
  147. package/packages/core/src/operator/tickets.ts +25 -4
  148. package/packages/core/src/plugins/manifest.ts +2 -1
  149. package/packages/core/src/ports/forge/contract.ts +2 -2
  150. package/packages/core/src/ports/forge/git-rewrite.ts +25 -2
  151. package/packages/core/src/ports/forge/github-readiness.ts +2 -2
  152. package/packages/core/src/ports/forge/github.ts +26 -7
  153. package/packages/core/src/ports/forge/local-git.ts +4 -4
  154. package/packages/core/src/ports/forge/readiness.ts +1 -1
  155. package/packages/core/src/ports/forge-failure.ts +24 -0
  156. package/packages/core/src/ports/runner/account-env.ts +88 -0
  157. package/packages/core/src/ports/runner/chatgpt-provider.ts +85 -0
  158. package/packages/core/src/ports/runner/claude.ts +26 -2
  159. package/packages/core/src/ports/runner/codex.ts +63 -31
  160. package/packages/core/src/ports/runner/one-shot.ts +2 -0
  161. package/packages/core/src/ports/runner/provider-error.ts +5 -0
  162. package/packages/core/src/ports/runner/routing.ts +35 -4
  163. package/packages/core/src/ports/tickets/contract.ts +58 -0
  164. package/packages/core/src/ports/tickets/tree.ts +1 -1
  165. package/packages/core/src/ports/types.ts +28 -7
  166. package/packages/core/src/ports/workspace/account-policy.ts +72 -0
  167. package/packages/core/src/ports/workspace/build-execution.ts +9 -2
  168. package/packages/core/src/ports/workspace/builtin-capabilities.ts +1 -0
  169. package/packages/core/src/ports/workspace/create.ts +2 -0
  170. package/packages/core/src/ports/workspace/git-worktree.ts +6 -1
  171. package/packages/core/src/ports/workspace/phase-scratch.ts +4 -3
  172. package/packages/core/src/ports/workspace/provider-capabilities.ts +1 -0
  173. package/packages/core/src/ports/workspace/vercel-sandbox.ts +182 -72
  174. package/packages/core/src/processes/build-child.ts +6 -8
  175. package/packages/core/src/processes/build-execution-state.ts +8 -5
  176. package/packages/core/src/processes/build-runner.ts +554 -99
  177. package/packages/core/src/processes/dispatcher.ts +209 -101
  178. package/packages/core/src/processes/execution-no-progress.ts +8 -1
  179. package/packages/core/src/processes/execution-settlement.ts +21 -3
  180. package/packages/core/src/processes/harvest-runner.ts +68 -8
  181. package/packages/core/src/processes/phase-failure-budget.ts +1 -0
  182. package/packages/core/src/processes/publication-loss.ts +8 -2
  183. package/packages/core/src/processes/publication-state.ts +42 -4
  184. package/packages/core/src/processes/repo-view.ts +14 -0
  185. package/packages/core/src/processes/verify-cycle-config.ts +96 -0
  186. package/packages/core/src/project-secrets.ts +105 -0
  187. package/packages/core/src/{integration → scenarios}/harness.ts +330 -317
  188. package/packages/core/src/secret-name.ts +41 -0
  189. package/packages/core/src/store/account-redaction.ts +156 -0
  190. package/packages/core/src/store/adapter.ts +1 -0
  191. package/packages/core/src/store/build-scope.ts +9 -0
  192. package/packages/core/src/store/contract.ts +116 -2
  193. package/packages/core/src/store/local/schema.ts +13 -0
  194. package/packages/core/src/store/local/store.ts +42 -0
  195. package/packages/core/src/store/memory.ts +47 -0
  196. package/packages/core/src/store/operator-presence.ts +21 -0
  197. package/packages/core/src/store/phase-session.ts +10 -0
  198. package/packages/core/src/store/reducer-value-shapes.json +5185 -4156
  199. package/packages/core/src/store/remote/client.ts +89 -48
  200. package/packages/core/src/store/remote/compatibility.ts +20 -0
  201. package/packages/core/src/store/remote/protocol.ts +4 -0
  202. package/packages/core/src/store/remote/version.ts +3 -1
  203. package/packages/core/src/store/retention.ts +2 -3
  204. package/packages/core/src/store/session-handle.ts +9 -0
  205. package/packages/core/src/store/streams/session-writer.ts +1 -1
  206. package/packages/core/src/store/types.ts +12 -2
  207. package/packages/core/src/testing/dispatch-read-budget.ts +122 -0
  208. package/packages/core/src/testing/index.ts +12 -1
  209. package/packages/core/src/testing/reduced-read-budget.ts +47 -0
  210. package/packages/core/src/testing/temp-directories.ts +58 -0
  211. package/skills/code-review/SKILL.md +23 -9
  212. package/skills/finalize/SKILL.md +15 -7
  213. package/skills/guide/SKILL.md +373 -148
  214. package/skills/guide/references/accounts.md +119 -0
  215. package/skills/guide/references/integration-tree.md +45 -38
  216. package/{docs/landing-policy.md → skills/guide/references/merge-policy.md} +40 -24
  217. package/skills/guide/references/migration-1.0.md +17 -13
  218. package/skills/guide/references/operator-api.md +180 -51
  219. package/skills/guide/references/plugin-authoring.md +21 -0
  220. package/skills/guide/references/remote-store-protocol.md +242 -68
  221. package/skills/guide/references/remote-ticket-protocol.md +30 -50
  222. package/skills/guide/references/restacking.md +54 -15
  223. package/skills/guide/references/setup.md +59 -119
  224. package/skills/guide/references/spec-standard.md +6 -6
  225. package/skills/guide/references/ticket-dependencies.md +7 -7
  226. package/skills/harvest/SKILL.md +3 -1
  227. package/skills/harvest-review/SKILL.md +3 -1
  228. package/skills/implement/SKILL.md +43 -17
  229. package/skills/operate/SKILL.md +118 -118
  230. package/skills/plan/SKILL.md +39 -13
  231. package/skills/plan-review/SKILL.md +15 -10
  232. package/skills/reconcile/SKILL.md +22 -3
  233. package/skills/spec/SKILL.md +20 -20
  234. package/skills/tickets/SKILL.md +12 -9
  235. package/templates/autobuild.toml +1 -1
  236. package/templates/hosted-service/package.json +2 -2
  237. package/docs/hosted-dispatcher-cutover-validation.md +0 -178
  238. package/docs/hosted-dispatcher.md +0 -275
  239. package/docs/hosted-service.md +0 -293
  240. package/docs/mcp.md +0 -149
  241. package/packages/core/src/orchestrator/approvals.ts +0 -115
  242. package/packages/core/src/orchestrator/conversation.ts +0 -167
  243. package/packages/core/src/orchestrator/model.ts +0 -86
  244. package/packages/core/src/orchestrator/prompt.ts +0 -63
  245. package/packages/core/src/orchestrator/tools.ts +0 -117
  246. package/packages/core/src/orchestrator/turn-runner.ts +0 -457
  247. package/packages/core/src/processes/orchestrator-tick.ts +0 -360
@@ -19,19 +19,24 @@ Destination observations are durable `target.moved` facts, including while an
19
19
  agent runs. Verify-entry restack freezes a current base before verification;
20
20
  path selection excludes upstream-only paths. After finalize and post-steps,
21
21
  waiting leaves restack when the target moves. Node-target finalize contributions
22
- are canonicalized before guarded landing even when the target SHA is unchanged.
23
- Clean replay starts no agent. A clean waiting leaf rewrite preserves prior
24
- verification; reports retain their actual cycle base/head. Conflicted replay
25
- runs reconcile and verification, and initial verification cannot be skipped
26
- through post-reconcile policy.
22
+ are canonicalized before guarded merge even when the target SHA is unchanged.
23
+ Clean replay starts no agent. A clean waiting leaf rewrite preserves completed
24
+ verification when build-owned config is unchanged, even when replay replaces
25
+ the pin commit's ancestry. Reports retain their actual cycle base/head.
26
+ Changed config still starts a fresh verification cycle while waiting. Before
27
+ running further verification steps, cycles also require known pin ancestry;
28
+ a future cycle captures fresh config from its checkout. Configuration
29
+ supersession is separate from replay and reconcile. Conflicted replay runs
30
+ reconcile and verification, and initial verification cannot be skipped through
31
+ post-reconcile policy.
27
32
 
28
33
  Nodes observe parent movement durably but restack only on demand: before a
29
- complete nonempty node verifies; before landing if its parent moved; when queued
34
+ complete nonempty node verifies; before merge if its parent moved; when queued
30
35
  dependency presence requires an ancestor change; on `ab restack <node>`; or on
31
36
  accepted re-parenting. There is no eager mode or cadence option. Nested nodes
32
37
  need their own demand. Existing frozen transactions, including ones reserved
33
38
  before upgrade, finish first; later demand coalesces onto the latest parent.
34
- Leaves keep verify-entry and awaiting-landing restacks for every target.
39
+ Leaves keep verify-entry and awaiting-merge restacks for every target.
35
40
 
36
41
  For observation cadence, durable wakes and last-check evidence, see
37
42
  [node polling and status](integration-tree.md#polling-and-status).
@@ -48,11 +53,29 @@ and unopened nodes. Paused or blocked nodes wait for their normal safety gates.
48
53
  A request arriving during replay survives until its parent and required identities
49
54
  are covered. Re-parenting invalidates requests for the old destination.
50
55
 
51
- Both dashboards show `parent N commits ahead`, `parent current`, or
52
- `parent distance unknown`. Distance counts commits reachable from the observed
53
- parent but not the last confirmed contribution base; it is not elapsed time or
54
- poll count. Samples are invalidated by replay or re-parenting. A stale node
55
- cannot verify or land; inventory and child landings continue while it collects.
56
+ Both dashboards use `+N` beside the destination for commits it has that the
57
+ build lacks, no suffix when current, and `+?` when unknown. Merged and closed
58
+ builds omit the suffix. Terminal list rows put `→ destination +N` on the slug
59
+ line; work steps follow immediately and integration progress keeps only the
60
+ bar and child counts. Detail target/Parent fields use the same suffix.
61
+
62
+ Work distance counts destination commits absent from the sampled current build
63
+ head (`BUILD..TARGET`). It is advisory durable telemetry refreshed during normal
64
+ target polls, including when the build head changes. Unavailable or stale samples
65
+ are unknown; this observation does not change merge or restack decisions.
66
+
67
+ Integration parent distance counts commits reachable from the observed parent
68
+ but not the last confirmed contribution base; it is not elapsed time or poll
69
+ count. Samples are invalidated by replay or re-parenting. This freshness gate
70
+ applies to nodes: a stale node cannot verify or merge; inventory and child merges
71
+ continue while it collects.
72
+
73
+ Restack and reconcile publication reject tracked modifications with the existing
74
+ clean-worktree error. Nonignored untracked files do not block publication and
75
+ remain unpublished and untouched; each publication that encounters them records
76
+ a path-bearing `observation.recorded` followup, deduplicated by operation,
77
+ transaction, candidate SHA and exact path list on recovery. The phase-terminal
78
+ D5 clean-worktree rule for `ab done` remains unchanged.
56
79
 
57
80
  Before replacement the kernel publishes retained tips, displaced heads and the
58
81
  temporary change under immutable exact archive refs. `restack.*` facts record
@@ -80,7 +103,7 @@ Ordered source identities survive, and identities already reachable upstream
80
103
  are dropped. Untagged commits, including empty ones, are foreign.
81
104
 
82
105
  A separate node writer lease and durable reservation serialize restacks and
83
- child landings. Reservations freeze expected head, parent, contribution boundary,
106
+ child merges. Reservations freeze expected head, parent, contribution boundary,
84
107
  archives, changes and merge proofs. Lease expiry recovers the same operation,
85
108
  not a competing one. Prepared/conflicted/replayed item receipts, publication
86
109
  intent, proven replacement and settlement distinguish each recovery boundary.
@@ -108,10 +131,26 @@ identity refuses the whole restack. The branch and contribution boundary remain
108
131
  untouched and the integration build escalates with offending evidence. The kernel
109
132
  never preserves merge topology or decomposes an unsafe merge automatically.
110
133
 
111
- See [integration trees](integration-tree.md), [landing](landing-policy.md), and
134
+ See [integration trees](integration-tree.md), [merge](merge-policy.md), and
112
135
  [migration](migration-1.0.md).
113
136
 
114
137
  Native cancellation receipts are candidate- and operation-specific. Publication
115
138
  retries confirm forge state before reusing a receipt; external re-enables require
116
- another confirmed cancellation. Classified transient landing failures retain
139
+ another confirmed cancellation. Classified transient merge failures retain
117
140
  retry eligibility and recheck authorization after repository forge cooldown.
141
+
142
+ ## Leaf publication retry recovery
143
+
144
+ Leaf restack and reconcile publication retry classified transient forge or transport
145
+ failures six times after the initial attempt, waiting 30, 60, 120, 240, 300 and
146
+ 300 seconds. `publication.retry-scheduled` records the operation, frozen rewrite
147
+ identity, episode anchor, failure ordinal, last error and absolute retry time;
148
+ restart resumes that schedule without rerunning the resolver. These retries do
149
+ not consume `maxPhaseAttempts`. A seventh transient failure records
150
+ `publication.retry-exhausted` and raises `publication-retry-limit`, naming the last
151
+ error and six retries. Answering that escalation opens a fresh publication episode
152
+ for the same retained intent without resetting agent phase failures. Pending
153
+ publication keeps its workspace through backoff and unresolved exhaustion.
154
+ Classified rate limits retain repository cooldown and consume no publication
155
+ retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
156
+ errors retain their existing behavior.
@@ -32,7 +32,7 @@ maintainer before selecting it:
32
32
  - a dispatcher-side push-capable `GITHUB_TOKEN` or `GH_TOKEN`;
33
33
  - for a private repository, a separate read-only clone identity named by
34
34
  `gitUsernameEnv` and `gitPasswordEnv`;
35
- - an HTTPS hosted service reachable from Vercel, configured through `ab connect <url>`;
35
+ - a remote store that speaks the remote BuildStore protocol and is reachable from Vercel, configured through `ab connect <url>`;
36
36
  - each selected role and alternate's runtime/model, its pinned
37
37
  `[workspace.config.runtimeProvisioning.<runtime>]` commands, and the API
38
38
  credential names it needs in `[workspace.config].environmentVariables`.
@@ -67,8 +67,7 @@ preflight = "test \"$(pi --version)\" = \"0.84.4\" && pi update --models"
67
67
  ```
68
68
 
69
69
  Use a `vercel-ai-gateway/...` Pi model with `AI_GATEWAY_API_KEY` in the
70
- dispatcher environment. Do not copy `~/.pi`, OAuth refresh tokens, or any local
71
- runtime auth state, and do not attempt interactive login in a sandbox. Runtime
70
+ dispatcher environment. For Claude Code, configure [accounts](accounts.md) with a manually provisioned `claude setup-token` credential or a Kimi Code membership key; use the unmodified runtime, your own subscription, and ordinary individual usage. ChatGPT subscription accounts use `bun ab accounts login NAME` on your machine with one dispatcher or hosted refresh owner. Pi and ambient Codex login state are not copied, and interactive sandbox login is unsupported. Runtime
72
71
  names are open: a plugin runtime uses the same strict map, for example
73
72
  `[workspace.config.runtimeProvisioning.opencode]`, with its own immutable
74
73
  install and exact-version preflight commands.
@@ -96,7 +95,10 @@ checkout dependencies in every fresh/replacement sandbox and before the
96
95
  readiness probe, writes the marker only after success, and reruns every
97
96
  preflight before each build runner. A failure names the runtime, selecting
98
97
  role/alternate, and field and starts no agent. Runtime provisioning receives
99
- only the API credentials named by `[workspace.config].environmentVariables`.
98
+ allowlisted legacy API credentials named by
99
+ `[workspace.config].environmentVariables` and automatically supplied placeholders
100
+ for every declared account credential variable. Account variables need no
101
+ allowlist entry; their real credentials remain on the dispatcher host.
100
102
 
101
103
  Keep package-level and checkout-level bootstrap in an idempotent
102
104
  `[commands].setup`. It runs after system provisioning and must remain safe to
@@ -126,7 +128,8 @@ exits nonzero on failure. Then:
126
128
  6. Run `ab init --validate`. Fix every named failure, review warnings and unknowns, and rerun
127
129
  validation. Setup ends at successful validation. Ask the human to start
128
130
  `bun ab dispatch`, then open their coding agent at the repository root with
129
- `ab-operate` loaded to specify, create, groom, and shepherd the first ticket.
131
+ `ab-operate` loaded to specify, create and groom the first ticket. Check operator
132
+ presence before taking the role; an existing operator picks up ready work.
130
133
  The setup agent must not start dispatch itself.
131
134
 
132
135
  Validation is explicit and noninteractive. It does not dispatch, claim a
@@ -155,7 +158,7 @@ to `workspace.config.provisioning` (or a package dependency to setup) while
155
158
  retaining the universal image; add a runtime credential name to
156
159
  `environmentVariables` and its value to the dispatcher environment; correct the
157
160
  Vercel team/project credential set; provide separate private-clone credentials;
158
- use an HTTPS GitHub origin and hosted Store; authorize the Store token; or commit
161
+ use an HTTPS GitHub origin and remote Store; authorize the Store token; or commit
159
162
  and push the selected base branch.
160
163
 
161
164
  ## Keep per-build records in separate fragments
@@ -182,7 +185,7 @@ shared edit surface; the repository owns the release-time assembly tooling.
182
185
  ## Repository identity is the origin, not a checkout path
183
186
 
184
187
  Repository identity in the Store, dispatcher, `ab builds`, `ab build status`,
185
- `ab repository status`, and the web app is the repository's **normalized origin
188
+ `ab repository status` is the repository's **normalized origin
186
189
  URL** (`https://github.com/owner/repository`), not a checkout's absolute path.
187
190
  Two checkouts of the same repository — on different hosts, or a dispatcher and
188
191
  its sandboxes — agree on one identity.
@@ -244,15 +247,14 @@ sources agree with the running system by construction:
244
247
  runs the dispatcher's own code.
245
248
  - **Origin mode** (checkout-less dispatcher): the guest archive is the release
246
249
  asset `autobuild-<version>.tgz` fetched from the canonical repository at the
247
- **running dispatcher's version** (read from the deployed distribution's
250
+ **running dispatcher's version** (read from the installed distribution's
248
251
  `package.json`), so the guest runs the dispatcher's own release.
249
252
 
250
253
  A service accepts stable and prerelease clients from its own `major.minor`
251
254
  release line and the two preceding minor lines in the same major. A major starts a new family:
252
255
  X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
253
256
  Patch versions are interchangeable in both directions and must never change
254
- the protocol. Upgrade the service first, then projects independently within
255
- its window. Supported release lines retain their wire handlers and known
257
+ the protocol. Keep project clients within the instance’s published window. Supported release lines retain their wire handlers and known
256
258
  protocol identities; an unknown protocol is refused independently of version.
257
259
  Stable and prerelease service and client identities share their numeric major/minor
258
260
  line. Malformed or missing identities, build metadata (`+…`), prefixes and
@@ -273,11 +275,12 @@ It warns and continues when the target is outside the range, naming the
273
275
  required service upgrade for a newer target or a compatible project range for
274
276
  an older one. An unavailable or malformed probe warns that connectivity may
275
277
  fail after upgrade. Legacy health without a range means exact-version matching;
276
- upgrade that service to the compatibility-window release first.
278
+ the hosted instance must publish a compatibility window before clients can
279
+ use release-line compatibility.
277
280
 
278
281
  A distribution fix reaches origin-mode guests after a release is cut and the
279
282
  dispatcher is upgraded. Guests continue to run the dispatcher's own version;
280
- the hosted service must support that release line.
283
+ the instance must support that release line.
281
284
 
282
285
  Provisioning records the installed distribution's identity — package version
283
286
  and remote-store protocol version — in the guest's
@@ -304,29 +307,20 @@ perspective:
304
307
  Local `git-worktree` dispatch keeps working from a checkout exactly as before;
305
308
  apart from the identity change, `ab dispatch` behaves as it did.
306
309
 
307
- ## Hosted deployment variables
308
-
309
- A hosted-store deployment configures its web/auth variables once — see the
310
- hosted service README and the complete environment reference in the pinned
311
- distribution checkout: `BETTER_AUTH_URL`, `AB_WEB_ALLOWED_EMAILS`,
312
- and the optional `AB_WEB_MCP_RESOURCE` — the protected
313
- resource the hosted MCP server (docs/mcp.md) binds its OAuth tokens to,
314
- defaulting to `<BETTER_AUTH_URL>/mcp`. Set it only when a proxy or custom
315
- domain fronts the deployment under a different public URL than
316
- `BETTER_AUTH_URL`; the value must be an absolute http(s) URL (https in
317
- production) or every MCP client's discovery binds tokens to the wrong
318
- resource.
319
-
320
-
321
310
  ## Connect a project
322
311
 
323
312
  From a checkout with an origin remote, run `ab connect https://YOUR_ORIGIN`.
324
313
  The CLI prints a verification URL and short code and attempts to open a browser.
325
- Sign in as an allowed owner, check the full repository identity and code, and
326
- approve or deny. Another device can open the printed URL, or visit `/connect`
327
- and enter the code. Approval requires the web-enabled service origin; a
328
- standalone machine-only listener cannot present browser consent. Requests
329
- expire after ten minutes. Denial and timeout leave local configuration unchanged.
314
+ The code link opens approval directly; if sign-in is needed, it returns there.
315
+ Check the full repository identity and code, and approve or deny. For an
316
+ unassigned project, choose an eligible organization; a sole option is visibly
317
+ selected. Approval requires that destination even for previously registered
318
+ unassigned projects. Assigned projects show their organization as read-only;
319
+ moving them uses project management. With no eligible organization, approval is
320
+ unavailable until a super user creates one. Another device can open the printed
321
+ URL, or visit `/connect` and enter the code. Approval uses the instance’s browser
322
+ consent endpoint. Requests expire after ten minutes. Denial requires no
323
+ organization choice; denial and timeout leave local configuration unchanged.
330
324
 
331
325
  On approval the service registers the project and issues a project credential.
332
326
  The CLI keeps it in `$XDG_CONFIG_HOME/autobuild/credentials` (or
@@ -358,62 +352,34 @@ saved credential for CI and other non-interactive hosts. A service override
358
352
  never borrows another service's credential. Build and harvest sessions keep
359
353
  their explicit scoped authority.
360
354
 
361
- ## Connected projects
362
-
363
- Migrate PostgreSQL from the pinned release before deploying (`bun run
364
- postgres:migrate`). The service keeps an independent, durable project registry;
365
- existing build or ticket data does not register a project. An administrator
366
- with deployment database credentials manages it without redeploying:
367
-
368
- ```sh
369
- ab-hosted-store projects list
370
- ab-hosted-store projects add https://github.com/owner/project --user owner@example.com
371
- ab-hosted-store projects remove https://github.com/owner/project --user owner@example.com
372
- ```
373
-
374
- From a source checkout, substitute `bun packages/hosted-store-service/src/bin.ts`
375
- for `ab-hosted-store`. Configure `AB_POSTGRES_URL` or `DATABASE_URL` in that
376
- process. Database possession grants administration; `--user` is declared audit
377
- attribution, not a verified login. Ordinary project/store tokens cannot manage
378
- registrations. Each entry records the normalized origin URL, addition time,
379
- and adding identity. SSH git spellings normalize to HTTPS; local paths and
380
- credential-bearing HTTPS URLs are rejected. Duplicate adds preserve metadata;
381
- remove is idempotent, and re-adding records a fresh addition.
382
-
383
- Every allowlisted signed-in user owns every registered project. The dashboard,
384
- MCP discovery and calls, and every operator API route consult current
385
- registration. Removal hides a project from all these surfaces and subsequent
386
- hosted dispatcher invocations; builds, events, artifacts and tickets remain,
387
- and re-registration restores access. Already-started work is not cancelled.
388
- Project credentials issued by connect authorize only their registered project. Administrative credential issuance remains available for non-interactive hosts.
389
-
390
- Link directly to `/?repo=<URL-encoded normalized origin>`. The page selects the
391
- first registered origin when the requested one is missing or removed, and an
392
- empty registry shows no project data or controls. Registry errors fail closed;
393
- there is no environment fallback on database failure.
394
-
395
- `AB_WEB_REPOSITORIES` is deprecated. A nonempty CSV is imported exactly once per
396
- database, on the first registry initialization with that variable configured,
397
- with actor `system:AB_WEB_REPOSITORIES`. The import and durable marker commit
398
- atomically across concurrent starts. An absent variable does not consume the
399
- marker. Later restarts or edits to the variable never re-add removed projects;
400
- use the owner commands for subsequent administration.
401
-
402
- The hosted dispatcher queries current registrations on every authorized
403
- invocation. With `AB_DISPATCHER_REPOSITORIES` unset, it serves all registered
404
- projects; an explicit list preserves its order and is intersected with current
405
- registration. An empty registry is a successful zero-project invocation.
406
-
407
355
  ## Authoring an agent verifier
408
356
 
409
357
  A repository-owned agent-verify skill is a verifier, not a reviewer: it drives
410
358
  the running application and observes whether the spec's acceptance criteria
411
359
  hold. It does not inspect the diff for style or edit product code.
412
360
 
361
+ Repository-authored finalize skills also run `ab context` and read hydrated inputs
362
+ from `$AB_CONTEXT_DIR`, using the manifest for collision-adjusted paths.
363
+
413
364
  Its session instructions must preserve this contract:
414
365
 
415
- 1. Run `ab context`. The verifier receives `.ab/spec.md`, the configured step,
416
- the commit range, and, after escalation is answered, `.ab/guidance.json`.
366
+ Scratch output, downloaded references, probes, and temporary scripts belong under `.ab/`
367
+ (prefer the current `$AB_CONTEXT_DIR` when appropriate), never at the worktree
368
+ root, and must not be committed. Manifest-directed artifact paths remain authoritative.
369
+
370
+ Large scratch belongs under the session's `.ab/` directory (prefer `$AB_CONTEXT_DIR`),
371
+ not `/tmp`: this includes ad-hoc PostgreSQL data/cluster directories, Cargo target
372
+ directories, browser profiles, and database copies. Configure `PGDATA`,
373
+ `CARGO_TARGET_DIR`, and explicit browser profile paths for those resources.
374
+ Keep `TMPDIR` outside the worktree for test suites and commands that discover
375
+ repositories or configuration through parent directories, including focused tests
376
+ and Git probes. Do not relocate required installed tooling or retained evidence;
377
+ manifest-directed artifact paths remain authoritative. Never commit scratch.
378
+
379
+
380
+ 1. Run `ab context` and read `"$AB_CONTEXT_DIR/context.json"`. The verifier receives
381
+ `$AB_CONTEXT_DIR/spec.md`, the configured step,
382
+ the commit range, and, after escalation is answered, `$AB_CONTEXT_DIR/guidance.json`.
417
383
  Node verify sessions also receive `nodeVerification` in the context manifest:
418
384
  contribution specs and a provenance index mapping commits to the builds that
419
385
  introduced them. Read those specs through the manifest's allocated paths.
@@ -458,45 +424,8 @@ cannot select another project. See [local builds with hosted tickets](#local-bui
458
424
 
459
425
  The service never contacts Linear. Projects with external sources (including
460
426
  file and Linear) keep using those sources directly through their dispatcher;
461
- service ticket HTTP, operator and MCP surfaces refuse with project/source
462
- feedback rather than returning an empty queue. Removed `AB_TICKET_BACKEND` and
463
- `LINEAR_API_KEY` values are ignored with one startup removal message, including
464
- blank/unknown values. Removed `AB_TICKET_TRIAGE_STATE`, `AB_TICKET_READY_STATE`,
465
- `AB_TICKET_DOING_STATE` and `AB_TICKET_DONE_STATE` values are ignored even when
466
- malformed. None of these retired settings prevents startup.
467
-
468
- The environment-aware migration imports `AB_WEB_REPOSITORIES` once before
469
- ownership preflight, including released main-v9 deployments without registry
470
- tables. A failed migration rolls back the import, main-schema promotion and
471
- ticket changes together. Owner `projects add` and `tickets assign-team` commands
472
- bootstrap only the registry/recovery journals and work while the main marker
473
- is still v9. Without the retired environment, first register the intended
474
- project with `ab-hosted-store projects add REPOSITORY --user IDENTITY`, then
475
- assign the team and rerun migration. A successful one-time import is never
476
- reapplied from later environment edits.
477
-
478
- Ticket schema v1 migration assigns each whole legacy team to its sole claimant
479
- among registered projects' latest effective configs, reading their actual blob
480
- bytes. Projects with no dispatcher run or no effective-config reference make
481
- no team claim and do not block other projects. Unclaimed teams still fail closed.
482
- When inferring ownership, a selected configuration whose revision/blob is missing,
483
- unreadable or invalid stops unchanged with recovery guidance. Restore the selected
484
- configuration or assign every remaining legacy team explicitly; complete owner
485
- assignments to registered projects bypass unrelated configuration reads. Conflicts
486
- and asset ownership mismatches also stop unchanged. Resolve ownership, then rerun:
487
-
488
- ```sh
489
- ab-hosted-store tickets assign-team TEAM https://github.com/acme/app --user owner@example.com
490
- ab-postgres-store migrate
491
- ```
492
-
493
- The assignment journal works before v2 assertion, retains the actor, and grants
494
- no future cross-project access. Migration preserves ids, states, comments,
495
- blockers, timestamps and assets. Populated-v1 migration and deployment builds
496
- require the running service's blob backend, access mode, credentials and prefix
497
- (`AB_BLOB_PREFIX`), not just PostgreSQL access. `deploy:build` inherits this
498
- environment and migration failure stops Next build. Fresh databases, empty v1
499
- queues and v2 reruns stay SQL-only and do not initialize blob storage.
427
+ service ticket HTTP and operator surfaces refuse with project/source
428
+ feedback rather than returning an empty queue.
500
429
 
501
430
  ## Local builds with hosted tickets
502
431
 
@@ -543,7 +472,7 @@ performs test pushes.
543
472
  Require **linear history** on protected root and node target branches to prevent
544
473
  merge commits from GitHub's update-branch action. On the configured root, enable
545
474
  **Require branches to be up to date before merging**, with nonempty required
546
- checks enforced for all merge actors. This makes root node landings fenced;
475
+ checks enforced for all merge actors. This makes root node merges fenced;
547
476
  without it they are best-effort. Both are recommendations, so missing settings
548
477
  produce warnings rather than hard failures.
549
478
 
@@ -567,3 +496,14 @@ access, revalidate and restart dispatch to refresh its startup diagnostics.
567
496
  Changing the connected ticket source does not itself migrate in-flight builds.
568
497
  Follow [ticket migration](ticket-migration.md), keeping the existing BuildStore
569
498
  and recording continuity before resuming build-related ticket writes.
499
+
500
+
501
+ Permanent hosted data removal is available on the web app's Projects page to
502
+ super users and owners of the project's organization. `ab disconnect` only
503
+ revokes a credential; admin `projects remove` only unregisters access and retains
504
+ data. Project deletion removes hosted builds, tickets, blobs, secrets and accounts,
505
+ revokes every credential and retains only a minimal deletion audit. It does not
506
+ change local files or configuration. Failed cleanup is retryable with access
507
+ already refused. Reconnecting requires fresh browser approval and starts empty,
508
+ with hosted ticket numbering reset to 1. See
509
+ [permanent project deletion](operator-api.md#permanent-project-deletion).
@@ -58,7 +58,7 @@ evidence is not.
58
58
 
59
59
  Every build pays a fixed cost no matter how small its diff: spec, plan and
60
60
  plan review, code review, the repository's full verify suite, finalize,
61
- landing, and a restack for everything queued behind it. Ten small tickets pay
61
+ merge, and a restack for everything queued behind it. Ten small tickets pay
62
62
  that cost ten times, and a blocker chain pays it in series. Prefer fewer,
63
63
  larger tickets: one ticket per coherent change, as large as one plan and one
64
64
  review pass can hold without the quality bar slipping.
@@ -68,7 +68,7 @@ or fix a reviewer can judge in a single pass, one plan can cover it without
68
68
  deferring a design decision to a later build, and its out-of-scope list is
69
69
  short and obvious. It is too big when its criteria fall into groups that share
70
70
  no behavior, when part of it waits on a decision nobody has made, or when its
71
- parts need different landing — one can ship now while another needs consent
71
+ parts need different merge — one can ship now while another needs consent
72
72
  or must wait.
73
73
 
74
74
  Do not split:
@@ -103,7 +103,7 @@ A cut at a seam pays twice:
103
103
 
104
104
  If no seam exists where the work divides, keep it as one ticket, or make the
105
105
  first ticket establish the contract with tests at the boundary and block the
106
- tickets on either side of it until it lands. After that, they can build
106
+ tickets on either side of it until it merges. After that, they can build
107
107
  concurrently.
108
108
 
109
109
  State the seam in each ticket as behavior, not structure: what the contract
@@ -117,7 +117,7 @@ a planner reading one ticket knows what its siblings own.
117
117
  A split feature takes as long as its longest blocker chain, not as long as
118
118
  its ticket count. A wave of independent tickets finishes in about one build's
119
119
  time; the same tickets in a chain take one build per link. Prefer cuts that
120
- let tickets start together. When one ticket must land first — usually the one
120
+ let tickets start together. When one ticket must merge first — usually the one
121
121
  that establishes a shared contract — keep it to that contract and its tests,
122
122
  so the wave behind it starts sooner, and fold nothing unrelated into it.
123
123
  Add a blocker only for a real prerequisite, never to express a preferred
@@ -143,10 +143,10 @@ Each kernel `spec.revised` records the exact artifact and operator identity
143
143
  Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
144
144
  The node recollects and verifies the new revision, including on the same head
145
145
  and parent after a failed cycle. Earlier cycles remain historical evidence
146
- and cannot block or authorize landing under the replacement. Children keep
146
+ and cannot block or authorize merge under the replacement. Children keep
147
147
  their specs, claims and targets; contributions are not restarted.
148
148
  Active verification/reconcile or writer work, restack/reparent work, pause,
149
- pending controls, landing intent and ended PRs refuse the no-escalation path.
149
+ pending controls, merge intent and ended PRs refuse the no-escalation path.
150
150
  A concurrent state change refuses publication with a retry explanation;
151
151
  uncited artifacts are inert. Leaves still require an open escalation and
152
152
  restart from `plan`.
@@ -62,25 +62,25 @@ and claims the ticket only after they resolve and other readiness gates pass.
62
62
 
63
63
  Read [nodes and targets](integration-tree.md) for lifecycle, validation and
64
64
  source storage, and [choosing a destination](integration-tree.md#choosing-a-destination)
65
- when filing a feature set. Blockers order work independently of landing targets;
66
- landing authorization follows the repository's matched policy.
65
+ when filing a feature set. Blockers order work independently of merge targets;
66
+ merge authorization follows the repository's matched policy.
67
67
 
68
68
  ## When a blocker resolves
69
69
 
70
70
  In a repository with nodes, a blocker that has a build resolves when its change
71
71
  is present in the dependent's target head (or the configured root branch).
72
72
  Source done state and aggregate blocker flags do not bypass this gate. A
73
- confirmed landing SHA reachable from the sampled target proves presence even
73
+ confirmed merge SHA reachable from the sampled target proves presence even
74
74
  without a build trailer. A node blocker requires its entire completed owned
75
75
  contribution, including nested changes and foreign commits, excluding inherited
76
76
  parent history. An empty completed contribution is satisfied; missing evidence,
77
77
  an open or aborted node, or ambiguous newest build generations remain queued.
78
78
  Older successful generations are never substituted for the newest build.
79
79
 
80
- - Same node: the blocking change lands directly into the target.
81
- - Ancestor: the change lands into an ancestor, then presence demand restacks only the required path to the target.
82
- - Sibling: the blocking node lands into their common ancestor, then presence demand reaches the target through the minimal ancestor path.
83
- - Descendant: the blocking node lands into the dependent's target ancestor.
80
+ - Same node: the blocking change merges directly into the target.
81
+ - Ancestor: the change merges into an ancestor, then presence demand restacks only the required path to the target.
82
+ - Sibling: the blocking node merges into their common ancestor, then presence demand reaches the target through the minimal ancestor path.
83
+ - Descendant: the blocking node merges into the dependent's target ancestor.
84
84
 
85
85
  Blockers that never had a build, and repositories without nodes, retain the
86
86
  source's done-state rule. Waiting tickets stay source work; diagnostics identify
@@ -52,7 +52,9 @@ cluster and author; you never create or move tickets.
52
52
  {"action":"suppress","reason":"...","observations":[...]}
53
53
  ```
54
54
 
55
- Join only an existing unresolved ticket supplied by the ledger. Suppress a
55
+ Ledger lifecycle is scan-time context; filing checks existence and resolution
56
+ again before allowing a join, sharing that fresh lookup with hosted alias
57
+ resolution. Join only an existing unresolved ticket supplied by the ledger. Suppress a
56
58
  duplicate whose ledger ticket is resolved/missing, or a record that cannot
57
59
  support actionable work. Never invent a ticket reference.
58
60
  3. Finish exactly once:
@@ -29,7 +29,9 @@ not author proposals or touch tickets.
29
29
  - every `blockedBy` id is justified by evidence as a hard start gate;
30
30
  contextual citations, related work, and nonbinding preferences such as
31
31
  “do this later” must not become blockers, and ticket ids are never invented;
32
- - joins name only an unresolved ledger proposal and resolved/missing ledger
32
+ - ledger lifecycle is scan-time context; filing refreshes existence and
33
+ resolution before allowing joins and shares that lookup with hosted alias
34
+ resolution. Joins name only an unresolved ledger proposal and resolved/missing ledger
33
35
  tickets are tombstones, not recreated work;
34
36
  - suppression has a concrete evidence-backed reason;
35
37
  - no proposal asks harvest to groom, ready, claim, or dispatch anything.
@@ -11,27 +11,44 @@ You never push — the push is plumbing that happens when you finish.
11
11
 
12
12
  Guidance is an external operator answer, from the operator agent or a human.
13
13
 
14
+ Scratch output, downloaded references, probes, and temporary scripts belong under `.ab/`
15
+ (prefer the current `$AB_CONTEXT_DIR` when appropriate), never at the worktree
16
+ root, and must not be committed. Manifest-directed artifact paths remain authoritative.
17
+
18
+ Large scratch belongs under the session's `.ab/` directory (prefer `$AB_CONTEXT_DIR`),
19
+ not `/tmp`: this includes ad-hoc PostgreSQL data/cluster directories, Cargo target
20
+ directories, browser profiles, and database copies. Configure `PGDATA`,
21
+ `CARGO_TARGET_DIR`, and explicit browser profile paths for those resources.
22
+ Keep `TMPDIR` outside the worktree for test suites and commands that discover
23
+ repositories or configuration through parent directories, including focused tests
24
+ and Git probes. Do not relocate required installed tooling or retained evidence;
25
+ manifest-directed artifact paths remain authoritative. Never commit scratch.
26
+
27
+
14
28
  ## Session shape
15
29
 
16
30
  1. Run `ab context`. Read the manifest path printed by the command (normally
17
- `.ab/context.json`); its `materialized` entries are the actual input paths
31
+ `$AB_CONTEXT_DIR/context.json`); its `materialized` entries are the actual directory-relative input paths
18
32
  and may be relocated when a legacy repository tracks a conventional path.
19
- You get the approved spec and plan, your own prior-round notes, every verify report
20
- deposited so far under `.ab/verify/`, and this round's feedback when the
21
- round has any — at most one of `.ab/findings.json` (code-review findings), a
22
- failed verify step's report in `.ab/verify/`, or `.ab/guidance.json` (an
23
- operator's answer to the escalation that blocked this build). The manifest's
24
- `feedback` field names which one this round is, and is absent when the round
25
- carries none.
33
+ You get the approved spec and plan, your own prior-round notes, and every
34
+ deposited verify report under `$AB_CONTEXT_DIR/verify/`. The manifest's
35
+ `feedback` field names this round's immediate feedback: `findings` resolves
36
+ `$AB_CONTEXT_DIR/findings.json`, `verify` names the first failed report, and
37
+ `guidance` resolves `$AB_CONTEXT_DIR/guidance.json`. It is absent when there
38
+ is no immediate feedback. A `verifyStageFailure` receipt additionally lists
39
+ every failed report and cancelled/not-run member; it remains available on
40
+ guidance rounds. Read its `verifyReports` paths and `cancelledVerify` entries.
41
+ Cancellation feedback belongs only to that receipt; a later round without a
42
+ receipt carries no cancellation list.
26
43
  When the manifest lists `assets`, they are the build's pinned ticket assets
27
- under `.ab/assets/<kind>/<name>/`; read them with the spec. A `design` asset
44
+ under `$AB_CONTEXT_DIR/assets/<kind>/<name>/`; read them with the spec. A `design` asset
28
45
  is a contract on observable visual and reference outcomes, not on implementation — what you build must satisfy it, while how stays yours.
29
46
  2. Execute the plan. Commit in coherent increments with real messages —
30
47
  the commit history is part of the paper trail.
31
48
  3. Run the repo's checks yourself before finishing (the config's typecheck /
32
49
  lint / test commands). A verify failure that a local run would have caught
33
50
  is a wasted round trip.
34
- 4. Write the manifest's `notesPath` (normally `.ab/implement-notes.md`) — what
51
+ 4. Write the manifest's `notesPath` (normally `$AB_CONTEXT_DIR/implement-notes.md`) — what
35
52
  you did, where you deviated from the plan and why, what the reviewer should
36
53
  look at hardest — then run `ab done --notes <notesPath>`. The notes bytes
37
54
  reach the store only through this flag; the file is never committed.
@@ -59,11 +76,14 @@ Guidance is an external operator answer, from the operator agent or a human.
59
76
  ```
60
77
 
61
78
  - **Handle feedback before anything else.** A round with feedback carries
62
- exactly one kind, named by `.ab/context.json`'s `feedback` field:
63
- `findings` → resolve every finding in `.ab/findings.json`; findings you
79
+ exactly one kind, named by `$AB_CONTEXT_DIR/context.json`'s `feedback` field:
80
+ `findings` → resolve every finding in `$AB_CONTEXT_DIR/findings.json`; findings you
64
81
  dodge come back marked as persisting, and a chain that stays persistent
65
- goes to a human. `verify` → get the named step's report in `.ab/verify/`
66
- to pass. `guidance` → `.ab/guidance.json` carries an operator's reply
82
+ goes to a human. `verify` → address every failed report listed in the manifest's
83
+ `verifyReports` (or the historical single report) under `$AB_CONTEXT_DIR/verify/`.
84
+ `cancelledVerify` lists unfinished steps as not run with their fail-fast cause;
85
+ cancellation is never a pass. A stage receipt can remain available alongside
86
+ guidance, which retains immediate feedback precedence. `guidance` → `$AB_CONTEXT_DIR/guidance.json` carries an operator's reply
67
87
  to the escalation that blocked this build. The escalation may have come
68
88
  from you, from the reviewer, from the kernel's code-loop stall or policy
69
89
  guards, or from the verify-attempt policy guard after a failed report.
@@ -71,9 +91,10 @@ Guidance is an external operator answer, from the operator agent or a human.
71
91
  authoritative for the round and act on it in the code. The spec remains
72
92
  the contract this phase is measured against — if honoring the answer means
73
93
  breaking the spec, escalate rather than quietly picking one. A guidance
74
- round comes with no `.ab/findings.json` and no routed verify step; the
75
- answer is the entirety of your feedback. If `feedback` is absent
76
- entirely, the round has none: build the plan.
94
+ round carries no `$AB_CONTEXT_DIR/findings.json`; its immediate feedback is
95
+ the answer. A referenced failed-stage receipt still provides reports and
96
+ cancelled/not-run members alongside that guidance. If `feedback` is absent,
97
+ build the plan and read any receipt listed by the manifest.
77
98
  - **Keep `.ab/` out of every commit.** Never stage or commit it, even with
78
99
  `git add -f`. It is disposable phase scratch, not part of the build
79
100
  deliverable.
@@ -87,3 +108,8 @@ Guidance is an external operator answer, from the operator agent or a human.
87
108
  ```
88
109
  ab escalate "…the question…" --refs src/whatever.ts
89
110
  ```
111
+
112
+ Read the manifest path printed by `ab context`. Its `materialized` keys are
113
+ relative to `contextDir`: join them to locate collision-adjusted inputs.
114
+ Manifest path fields are workspace-relative; use `notesPath` for producer notes.
115
+ Run commands from the workspace root.