@defrex/autobuild 1.0.0 → 1.1.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 (186) hide show
  1. package/README.md +6 -6
  2. package/SPEC.md +360 -229
  3. package/docs/answering-blocked-builds.md +2 -2
  4. package/docs/architecture.md +155 -45
  5. package/docs/assets/headline-wide.png +0 -0
  6. package/docs/builds.md +4 -4
  7. package/docs/cli.md +4 -4
  8. package/docs/configuration-overview.md +4 -4
  9. package/docs/configuration.md +245 -210
  10. package/docs/dispatcher-hosting.md +2 -2
  11. package/docs/dispatcher.md +1 -1
  12. package/docs/forges.md +5 -5
  13. package/docs/getting-started.md +2 -2
  14. package/docs/glossary.md +6 -6
  15. package/docs/hosted-dispatcher.md +6 -3
  16. package/docs/hosted-service.md +16 -5
  17. package/docs/integration-overview.md +15 -15
  18. package/docs/integration-tree.md +45 -38
  19. package/docs/integration.md +6 -6
  20. package/docs/mcp.md +16 -15
  21. package/docs/{landing-policy.md → merge-policy.md} +42 -24
  22. package/docs/migration-1.0.md +17 -13
  23. package/docs/operating.md +41 -18
  24. package/docs/operator-api.md +91 -15
  25. package/docs/operator-surfaces.md +8 -4
  26. package/docs/overview.md +3 -3
  27. package/docs/remote-store-protocol.md +76 -11
  28. package/docs/remote-ticket-protocol.md +1 -1
  29. package/docs/restacking.md +54 -15
  30. package/docs/setup.md +41 -6
  31. package/docs/skills.md +1 -1
  32. package/docs/spec-standard.md +6 -6
  33. package/docs/ticket-dependencies.md +7 -7
  34. package/docs/tickets.md +8 -2
  35. package/docs/troubleshooting.md +2 -2
  36. package/docs/upgrading.md +8 -3
  37. package/docs/verification.md +60 -14
  38. package/package.json +7 -5
  39. package/packages/core/src/cli/binary-direct.ts +13 -1
  40. package/packages/core/src/cli/binary-lifecycle.ts +65 -2
  41. package/packages/core/src/cli/build-control.ts +83 -28
  42. package/packages/core/src/cli/context.ts +81 -38
  43. package/packages/core/src/cli/dashboard/facts.ts +2 -1
  44. package/packages/core/src/cli/dashboard/integration-detail.ts +8 -8
  45. package/packages/core/src/cli/dashboard/integration-row.ts +40 -13
  46. package/packages/core/src/cli/dashboard/landing-display.ts +25 -0
  47. package/packages/core/src/cli/dashboard/model.ts +56 -33
  48. package/packages/core/src/cli/dashboard/poll.ts +9 -3
  49. package/packages/core/src/cli/dashboard/render.ts +59 -37
  50. package/packages/core/src/cli/dashboard/target-distance.ts +14 -0
  51. package/packages/core/src/cli/dashboard/tree.ts +3 -2
  52. package/packages/core/src/cli/dispatch-args.ts +1 -1
  53. package/packages/core/src/cli/dispatch-frontend.ts +6 -3
  54. package/packages/core/src/cli/dispatch.ts +35 -9
  55. package/packages/core/src/cli/env.ts +4 -0
  56. package/packages/core/src/cli/help.ts +30 -23
  57. package/packages/core/src/cli/main.ts +24 -8
  58. package/packages/core/src/cli/node-verification-provenance.ts +1 -97
  59. package/packages/core/src/cli/publication-settlement.ts +43 -20
  60. package/packages/core/src/cli/repository-status.ts +20 -9
  61. package/packages/core/src/cli/status.ts +42 -5
  62. package/packages/core/src/cli/store-opening.ts +6 -1
  63. package/packages/core/src/cli/terminal.ts +22 -1
  64. package/packages/core/src/cli/terminals.ts +14 -10
  65. package/packages/core/src/cli/upgrade-landing.ts +70 -30
  66. package/packages/core/src/cli/upgrade.ts +3 -1
  67. package/packages/core/src/cli/wait.ts +15 -7
  68. package/packages/core/src/cli/watch-lifetime.ts +111 -0
  69. package/packages/core/src/cli/watch.ts +634 -511
  70. package/packages/core/src/config/effective-artifact.fixture.ts +27 -0
  71. package/packages/core/src/config/effective-artifact.ts +13 -0
  72. package/packages/core/src/config/landing.ts +1 -1
  73. package/packages/core/src/config/load.ts +21 -1
  74. package/packages/core/src/config/pipeline-source.ts +28 -0
  75. package/packages/core/src/config/reference-metadata.ts +2 -0
  76. package/packages/core/src/config/reference.ts +22 -7
  77. package/packages/core/src/config/schema.ts +86 -162
  78. package/packages/core/src/context-directory.ts +26 -0
  79. package/packages/core/src/distribution-packaging.ts +26 -5
  80. package/packages/core/src/events/catalog.ts +10 -2
  81. package/packages/core/src/events/globs.ts +1 -1
  82. package/packages/core/src/events/payloads.ts +70 -1
  83. package/packages/core/src/events/policy.ts +7 -0
  84. package/packages/core/src/events/repository.ts +2 -4
  85. package/packages/core/src/events/sessions.ts +6 -6
  86. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +571 -0
  87. package/packages/core/src/kernel/auto-merge.ts +2 -2
  88. package/packages/core/src/kernel/engine.ts +255 -26
  89. package/packages/core/src/kernel/generators/leaf-restack-log.ts +10 -0
  90. package/packages/core/src/kernel/integration-landing.ts +3 -3
  91. package/packages/core/src/kernel/integration-state.ts +27 -4
  92. package/packages/core/src/kernel/leaf-restack-state.ts +28 -3
  93. package/packages/core/src/kernel/log-index.ts +13 -1
  94. package/packages/core/src/kernel/node-landing.ts +8 -8
  95. package/packages/core/src/kernel/node-parent.ts +2 -2
  96. package/packages/core/src/kernel/node-restack-transaction.ts +1 -1
  97. package/packages/core/src/kernel/node-verification-context.ts +216 -0
  98. package/packages/core/src/kernel/phases.ts +1 -1
  99. package/packages/core/src/kernel/plan-verify-selection.ts +16 -0
  100. package/packages/core/src/kernel/publication-retry.ts +168 -0
  101. package/packages/core/src/kernel/reconcile-restack.ts +29 -1
  102. package/packages/core/src/kernel/reducer.ts +82 -5
  103. package/packages/core/src/kernel/target-distance.ts +45 -0
  104. package/packages/core/src/kernel/terminal-guard.ts +10 -1
  105. package/packages/core/src/kernel/verify-stage-state.ts +123 -0
  106. package/packages/core/src/kernel/verify-stages.ts +39 -0
  107. package/packages/core/src/ontology.ts +1 -0
  108. package/packages/core/src/operator/annotations.ts +6 -0
  109. package/packages/core/src/operator/control.ts +1 -1
  110. package/packages/core/src/operator/index.ts +1 -7
  111. package/packages/core/src/operator/landings.ts +5 -1
  112. package/packages/core/src/operator/presentation.ts +6 -1
  113. package/packages/core/src/operator/query.ts +14 -18
  114. package/packages/core/src/operator/registry.ts +17 -6
  115. package/packages/core/src/operator/sandbox-host.ts +64 -40
  116. package/packages/core/src/operator/sandbox.ts +3 -0
  117. package/packages/core/src/operator/ticket-source-backend.ts +3 -12
  118. package/packages/core/src/ports/forge/contract.ts +2 -2
  119. package/packages/core/src/ports/forge/git-rewrite.ts +25 -2
  120. package/packages/core/src/ports/forge/github-readiness.ts +2 -2
  121. package/packages/core/src/ports/forge/github.ts +26 -7
  122. package/packages/core/src/ports/forge/local-git.ts +4 -4
  123. package/packages/core/src/ports/forge/readiness.ts +1 -1
  124. package/packages/core/src/ports/forge-failure.ts +24 -0
  125. package/packages/core/src/ports/workspace/build-execution.ts +3 -1
  126. package/packages/core/src/ports/workspace/phase-scratch.ts +4 -3
  127. package/packages/core/src/ports/workspace/vercel-sandbox.ts +59 -39
  128. package/packages/core/src/processes/build-child.ts +6 -8
  129. package/packages/core/src/processes/build-execution-state.ts +8 -5
  130. package/packages/core/src/processes/build-runner.ts +522 -98
  131. package/packages/core/src/processes/dispatcher.ts +186 -101
  132. package/packages/core/src/processes/execution-no-progress.ts +8 -1
  133. package/packages/core/src/processes/phase-failure-budget.ts +1 -0
  134. package/packages/core/src/processes/publication-loss.ts +8 -2
  135. package/packages/core/src/processes/publication-state.ts +42 -4
  136. package/packages/core/src/processes/repo-view.ts +14 -0
  137. package/packages/core/src/processes/verify-cycle-config.ts +96 -0
  138. package/packages/core/src/{integration → scenarios}/harness.ts +330 -317
  139. package/packages/core/src/store/adapter.ts +1 -0
  140. package/packages/core/src/store/build-scope.ts +9 -0
  141. package/packages/core/src/store/contract.ts +113 -1
  142. package/packages/core/src/store/local/schema.ts +13 -0
  143. package/packages/core/src/store/local/store.ts +42 -0
  144. package/packages/core/src/store/memory.ts +47 -0
  145. package/packages/core/src/store/operator-presence.ts +21 -0
  146. package/packages/core/src/store/phase-session.ts +10 -0
  147. package/packages/core/src/store/reducer-value-shapes.json +5081 -4160
  148. package/packages/core/src/store/remote/client.ts +47 -1
  149. package/packages/core/src/store/remote/compatibility.ts +2 -0
  150. package/packages/core/src/store/remote/protocol.ts +4 -0
  151. package/packages/core/src/store/remote/version.ts +3 -1
  152. package/packages/core/src/store/retention.ts +2 -3
  153. package/packages/core/src/store/session-handle.ts +9 -0
  154. package/packages/core/src/store/streams/session-writer.ts +1 -1
  155. package/packages/core/src/store/types.ts +12 -2
  156. package/packages/core/src/testing/index.ts +11 -1
  157. package/packages/core/src/testing/temp-directories.ts +58 -0
  158. package/skills/code-review/SKILL.md +23 -9
  159. package/skills/finalize/SKILL.md +15 -7
  160. package/skills/guide/SKILL.md +253 -118
  161. package/skills/guide/references/integration-tree.md +45 -38
  162. package/skills/guide/references/{landing-policy.md → merge-policy.md} +42 -24
  163. package/skills/guide/references/migration-1.0.md +17 -13
  164. package/skills/guide/references/operator-api.md +91 -15
  165. package/skills/guide/references/remote-store-protocol.md +76 -11
  166. package/skills/guide/references/remote-ticket-protocol.md +1 -1
  167. package/skills/guide/references/restacking.md +54 -15
  168. package/skills/guide/references/setup.md +41 -6
  169. package/skills/guide/references/spec-standard.md +6 -6
  170. package/skills/guide/references/ticket-dependencies.md +7 -7
  171. package/skills/implement/SKILL.md +43 -17
  172. package/skills/operate/SKILL.md +117 -116
  173. package/skills/plan/SKILL.md +39 -13
  174. package/skills/plan-review/SKILL.md +15 -10
  175. package/skills/reconcile/SKILL.md +22 -3
  176. package/skills/spec/SKILL.md +19 -19
  177. package/skills/tickets/SKILL.md +9 -7
  178. package/templates/autobuild.toml +1 -1
  179. package/templates/hosted-service/package.json +2 -2
  180. package/packages/core/src/orchestrator/approvals.ts +0 -115
  181. package/packages/core/src/orchestrator/conversation.ts +0 -167
  182. package/packages/core/src/orchestrator/model.ts +0 -86
  183. package/packages/core/src/orchestrator/prompt.ts +0 -63
  184. package/packages/core/src/orchestrator/tools.ts +0 -117
  185. package/packages/core/src/orchestrator/turn-runner.ts +0 -457
  186. package/packages/core/src/processes/orchestrator-tick.ts +0 -360
@@ -1,25 +1,24 @@
1
1
  ---
2
2
  name: operate
3
- description: Orchestrate a repository's builds - file and groom tickets, watch builds, answer escalations, pause, resume, or abort builds, control landing consent, and drive work to merge. Use when asked to watch, shepherd, or orchestrate builds, whether from a coding-agent session at the repository root using the ab CLI or inside the hosted service with the operator tool registry.
3
+ description: Orchestrate a repository's builds - file and groom tickets, watch builds, answer escalations, pause, resume, or abort builds, control merge consent, and drive work to merge. Use when asked to watch, shepherd, or orchestrate builds, whether from a coding-agent session at the repository root using the ab CLI or from an external connected agent using the operator tool registry.
4
4
  ---
5
5
 
6
6
  # Operating the repository
7
7
 
8
- The operator agent is whichever agent is pointed at a repository to file tickets, watch builds, unblock them, answer
9
- human questions, and drive work to merge. Any agent can take it on: a
10
- coding-agent session at the repository root using the `ab` CLI (or `ab mcp`),
11
- or the hosted service's embedded turn runner. There is no initialization
12
- step — deciding to orchestrate is enough. By default, the agent that
13
- specified and queued work (the `ab-spec` and `ab-tickets` skills) takes the
14
- role for that work as soon as it is ready, unless the human opts out.
8
+ The operator agent operates the builds the repository's dispatcher dispatches:
9
+ files and grooms tickets, watches builds, answers escalations and drives authorized
10
+ work to merge. Any external agent can take the role through the CLI or MCP.
11
+ Filing sessions check presence before taking the role; with a live operator,
12
+ they leave operating context in the ticket and stop. Explicit human instructions
13
+ always override that default. Presence is advisory, permits concurrent operators,
14
+ and grants no exclusive authority. MCP presence registration is deferred.
15
15
 
16
16
  The operator agent is not a build phase: it never runs pipeline steps, never
17
17
  edits the repository, and never touches a build's checkout. Its reach is the
18
- operator surface — the `ab` CLI, or the operator tool registry bound into a
19
- hosted turn.
18
+ operator surface — the `ab` CLI, or the operator tool registry exposed through MCP.
20
19
 
21
20
  Find your setting and read that section: **Running locally with the `ab`
22
- CLI** if you are a session with a shell, **Running in the hosted service** if
21
+ CLI** if you are a session with a shell, **Running as an external connected agent** if
23
22
  your tools are the registry's `builds.*` / `tickets.*` family. The sections
24
23
  after them apply to both.
25
24
 
@@ -80,9 +79,16 @@ working directory, and actual version when you start orchestrating.
80
79
  Every `ab …` example in this skill means this resolved invocation, run from
81
80
  the same resolved working directory.
82
81
 
82
+ ### Check presence before registering
83
+
84
+ Run `ab repository status --json` and inspect `operator.registrations`. If another
85
+ live operator is present, tell the human and do not become a second operator
86
+ unless directed. Otherwise arm a repository-wide `ab watch --operator --json`.
87
+ A flagged watch writes only mutable liveness, never events or a lease.
88
+
83
89
  ### Watch for attention events
84
90
 
85
- `ab watch --json` is the standing monitor. Keep its default filter: every
91
+ `ab watch --operator --json` is the standing monitor. Keep its default filter: every
86
92
  record calls for action. It reports failed node verification, build escalations, persistent janitor failures and merge decisions,
87
93
  harvest escalations/recovery exhaustion, automatic upgrade failures and runtime rollbacks, rejected configuration, reloads needing
88
94
  restart, abnormal dispatcher stops/loss, ticket-source and forge degradation past reset (15 minutes
@@ -92,7 +98,16 @@ on that retry stays silent. Source grace and cooldown-driven failures do not
92
98
  start the tick-failure clock. Routine outcomes and self-healing failures stay silent.
93
99
 
94
100
  Every record carries a cursor; bounded watches end with a bare `{"cursor": …}`
95
- line. Resume with `--since <cursor>`. Named watches end when all named builds
101
+ line. Re-arm only with `ab watch --operator --json --since <watch-cursor>`,
102
+ using this standing watch's own cursor. Presence survives a re-arm gap of up to
103
+ five minutes after its last heartbeat on routine timeout/count completion.
104
+ Termination (SIGINT, SIGTERM, SIGHUP or stdout EPIPE) attempts withdrawal within
105
+ about two seconds; re-arming with the cursor re-registers the same ID/start.
106
+ Failed or unsupported withdrawal and SIGKILL fall back to TTL expiry.
107
+ `ab wait` neither heartbeats nor carries
108
+ registration identity. A separate unflagged diagnostic watch or wait must never
109
+ replace the standing monitor or supply its resume cursor.
110
+ Named diagnostic watches end when all named builds
96
111
  are terminal; add `--repository` for repository attention. With no slugs all
97
112
  active builds and repository attention are included. Reconcile status after
98
113
  arming because historical build attention is silently baselined.
@@ -151,49 +166,36 @@ establish loss: a healthy lease can accompany a slow tick.
151
166
  An unscoped watch, or a named watch with `--repository`, reports loss as a
152
167
  read-only observation: `{repo, build:null, state:null, observation:{type:
153
168
  "dispatcher.lost", run, observedAt, leaseExpiresAt, ...identity}, cursor}`.
169
+ A validated successor takeover suppresses predecessor loss even while its sessions
170
+ drain. An unfinished handoff without takeover still reports loss on lease expiry;
171
+ successor loss and upgrade-failure/rollback attention remain independent.
154
172
  It has no durable event envelope. Keep its cursor just as for event records;
155
173
  resuming it suppresses repeated loss reports for that run. Inspect repository
156
174
  status to diagnose the condition and report dispatcher trouble to the human.
157
175
  Neither a loss observation nor a later retry authorizes dispatcher intervention.
158
176
 
159
- ### Keep watching until the work is done
160
-
161
- Checking once is not shepherding. When you take responsibility for builds:
162
-
163
- 1. Record the set you are shepherding (`ab builds --all --json`, or the slugs
164
- you were given).
165
- 2. Arm the default standing watch and keep its cursor:
166
- `ab watch --json --since <cursor>` (or named slugs with `--repository`) (omit `--since` the first
167
- time). Events are delivered exactly once, so a build that already finished
168
- is never replayed. Do not loop on `ab wait --for terminal|attention|…`:
169
- state conditions are satisfied at once by any build already in that state,
170
- even with `--since`, so a finished build would be returned again and the
171
- loop would spin on it. If you use `ab wait`, use only `--event <glob>`
172
- conditions (satisfied by new events only), never `--for`.
173
- 3. Reconcile current state right after the first watch is armed, and again
174
- whenever a watch ends without records: a watch baselines each build at its
175
- current position and does not emit what already happened, so a build that
176
- merged, or an escalation already open, before registration would otherwise
177
- never reach you. Run `ab build status <slug> --json` for every slug in the
178
- set, and `ab repository status --json` for source health, initially and after
179
- every timeout or legacy-cursor attachment. Reading status after arming leaves no gap — anything earlier shows in
180
- the status, anything later arrives as an event. Treat a terminal status
181
- (merged, closed, aborted) as that build's outcome, and an open escalation
182
- or merge decision as attention to handle now.
183
- 4. When a watch returns records, react: read the record, inspect the build,
184
- resolve attention using the shared rules; for a repository record inspect repository status and act
185
- on its condition without assuming a build slug. Then re-arm from the last cursor. Keep your own
186
- outcome table from status reconciliation after named-watch exit and bounded
187
- watch timeouts. Default watches do not emit routine merge/completion records. A timeout (exit 3, or a watch
188
- that ends with only a `{"cursor": …}` line) is not completion — reconcile
189
- as in step 3, then re-arm from that cursor.
190
- 5. Stop only when every build in the set has an outcome in your table.
191
- `pr.conflicted` is not terminal — reconcile follows. An open escalation
192
- (`blocked`) needs a response, not patience. A watch that exits because
193
- every named build is terminal still needs the step 3 status read to learn
194
- how each ended.
195
- 6. Report each outcome to the human, and file or move tickets when the
196
- outcome makes that obviously right.
177
+ ### Keep going and adopt newly dispatched builds
178
+
179
+ Operate the builds the repository's dispatcher dispatches, including new builds
180
+ that appear after you arm. Finishing the initially queued set is no reason to stop.
181
+
182
+ 1. Check presence as above, then arm `ab watch --operator --json` with no slugs.
183
+ Retain its own cursor and re-arm with
184
+ `ab watch --operator --json --since <watch-cursor>`.
185
+ 2. Right after arming and after each timeout, run `ab builds --all --json`, adopt
186
+ newly dispatched builds, inspect active builds with `ab build status <slug> --json`,
187
+ and reconcile `ab repository status --json`. Historical attention is baselined
188
+ by a fresh watch, so status reconciliation closes the attachment gap.
189
+ 3. Handle each attention record using the shared rules. Repository records have
190
+ no build slug: inspect repository status. Re-arm from the standing watch's
191
+ latest cursor, including its trailing cursor after a timeout or count exit.
192
+ 4. Report each merged, closed or aborted outcome and file or move tickets when
193
+ warranted. A conflict or escalation requires action. Keep the standing watch
194
+ alive and keep discovering work until the human ends or hands off the role.
195
+
196
+ Use `ab wait` and named unflagged watches only as separate diagnostics. They
197
+ cannot replace the registered monitor or its cursor. In MCP, use the existing
198
+ registry monitoring tools; operator presence is not exposed there.
197
199
 
198
200
  ### Inspect
199
201
 
@@ -216,7 +218,7 @@ Read events with a cursor or a small `--events` count; logs are long.
216
218
  resolves with a revised spec; `--revise-spec-from-ticket` imports an amended ticket.
217
219
  Idle collecting or verification-failed nodes need no escalation and recollect
218
220
  for verification on the same head; children and contributions remain intact.
219
- Active work, pause, pending controls and landing intent refuse revision. Leaves
221
+ Active work, pause, pending controls and merge intent refuse revision. Leaves
220
222
  require an escalation and restart from plan. Run `ab help answer` for the full menu.
221
223
  - `ab pause <slug>` / `ab resume <slug>`; `ab pause --all` / `ab resume --all`
222
224
  hold and release the whole repository. Pause immediately interrupts live agent
@@ -226,22 +228,22 @@ Read events with a cursor or a small `--events` count; logs are long.
226
228
  check-only verify), pause still takes effect at the next boundary.
227
229
  - `ab abort <slug>` — destructive: closes the PR, removes branches, and
228
230
  returns the ticket to triage.
229
- - `ab hold <slug>` — persistently hold a landing and revoke earlier consent.
230
- - `ab land <slug>` — consent to a ready landing and clear its hold. Consent
231
+ - `ab hold <slug>` — persistently hold a merge and revoke earlier consent.
232
+ - `ab merge <slug>` — consent to a ready merge and clear its hold. Consent
231
233
  survives restacks and verification; use hold to withdraw it when work changes.
232
234
  Read the matched policy, readiness, acknowledged command and gate deferral in
233
235
  build status before acting. Work the consent queue by checking completeness
234
- and current verification, then issuing land for the chosen landing. A land
236
+ and current verification, then issuing merge for the chosen merge. A merge
235
237
  acknowledgement accepts consent; it never promises that gates passed.
236
- - Configure ordered `[[landing]]` rules for project policy through ab-guide.
238
+ - Configure ordered `[[merge]]` rules for project policy through ab-guide.
237
239
  Repository auto-merge defaults and per-build auto-merge toggles are retired.
238
240
 
239
241
  ### Tickets
240
242
 
241
243
  For feature sets you file yourself, consult the shared
242
244
  [destination choice guidance](../ab-guide/references/integration-tree.md#choosing-a-destination):
243
- explicitly choose root or a node, evaluate the repository's effective landing
244
- policy, and explain the landing flow to the human. Ask when intent is unclear.
245
+ explicitly choose root or a node, evaluate the repository's effective merge
246
+ policy, and explain the merge flow to the human. Ask when intent is unclear.
245
247
 
246
248
  `ab ticket create|update|block|unblock|list|show|move|states` file, edit, and
247
249
  move tickets; the `ab-tickets` skill covers the tracker's details. Moving a
@@ -254,47 +256,32 @@ The registry has operator notes, harvest control, and `discard`, which have no
254
256
  CLI equivalent, and no bulk control beyond `pause --all` / `resume --all`. Say
255
257
  so rather than improvising; tell the human, or record it with `ab observe`
256
258
  when you are inside a build. `ab mcp` mounts the same registry over MCP for
257
- harnesses that support it — if you have those tools, the hosted section's tool
259
+ harnesses that support it — if you have those tools, the connected-agent section's tool
258
260
  descriptions apply.
259
261
 
260
- ## Running in the hosted service
262
+ ## Running as an external connected agent
261
263
 
262
- This section applies when your tools are the operator registry bound into
263
- your turn. If you are a session with a shell and the `ab` CLI, use the
264
- section above and ignore this one. In the hosted service you never supply a
265
- repository argument; it is bound for you.
264
+ This section applies when an external agent harness connects to the operator
265
+ registry through MCP. With a shell and the `ab` CLI, use the section above.
266
+ Follow each advertised tool schema, including its repository arguments; do not
267
+ assume repository identity is injected into calls.
266
268
 
267
269
  ### How you run
268
270
 
269
- Each of your turns is one durable agent loop:
270
-
271
- - The conversation is reconstructed from durable state on every invocation.
272
- Nothing is held in memory between invocations; if your turn suspends and
273
- resumes in a fresh invocation, the model input is identical.
274
- - Your output streams as protocol parts onto the turn's stream. The human
275
- sees it live in the session.
276
- - Every tool call is attributed to the session owner — the human account
277
- named on every write is that owner, with your session as the delegate.
278
- Act accordingly: you are spending their authority.
279
- - Your tools target exactly one repository, the session's own. You never
280
- supply a repository argument; it is bound for you.
271
+ Your external harness owns the conversation, scheduling, output, checkpoints
272
+ and concurrency. The service does not load your prompt or operator notes, run
273
+ a durable agent loop, deliver wake messages, or resume you on a timer.
274
+ Read notes and current repository facts explicitly before acting. Tool writes
275
+ use the authenticated binding's operator identity: local MCP uses the local
276
+ operator identity, and hosted MCP uses the authenticated user's authority.
277
+ Do not assume session-owner delegation or a runner-provided repository scope.
281
278
 
282
- ### Suspension
279
+ ### Human approvals
283
280
 
284
- Your turn can stop in two ways, and both are normal:
285
-
286
- - **Budget.** Each invocation has a wall-clock budget. When it runs out, the
287
- turn suspends (`cause: budget`) and resumes in a fresh invocation — a new
288
- provider call — with the identical conversation. Never assume a turn
289
- died; never repeat work a checkpoint already covers.
290
- - **Approval.** Some tools are on the repository's approval list. Calling
291
- one suspends your turn (`cause: approval`) until the human answers.
292
- An `approve` answer executes the call; a `deny` answer hands you a denied
293
- tool output — treat it as a firm no, say so briefly, and move on. Tools
294
- not on the list run without pause.
295
-
296
- When suspended, just stop cleanly. Anything important you want to say should
297
- already be in your streamed output before the suspension point.
281
+ Respect a human denial as a firm no. Any approval or suspension flow in your
282
+ external harness belongs to that harness. Hosted session approval answers are
283
+ durable records only; the service does not execute approved calls or resume
284
+ agents. Do not repeat completed work when your harness resumes.
298
285
 
299
286
  ### The tool surface
300
287
 
@@ -327,7 +314,7 @@ that does the job, and say what you are doing before you do it:
327
314
  genuinely conforms and the human's intent is clear.
328
315
  - `notes.read`, `notes.write` — the operator-notes artifact: durable,
329
316
  human-readable notes about this repository's operation. Write what the
330
- next turn (or the next human) will need; read it before acting on
317
+ next operator or human will need; explicitly read it before acting on
331
318
  anything you'd otherwise guess.
332
319
  - `repository.settings` and `repository.bulk_control` — repository-wide
333
320
  switches; use sparingly and only on clear instruction.
@@ -339,17 +326,17 @@ report it, adapt, and carry on.
339
326
 
340
327
  ### The attention set
341
328
 
342
- A wake turn's first message carries the configured event record and the
343
- build's reduced state as JSON. Existing hosted wake settings are independent
344
- of CLI watch defaults; reconcile current state before acting on their routine
345
- outcomes or self-healing failures.
329
+ Obtain current facts through supported status, event and monitoring reads.
330
+ Notifications may be stale; reconcile current state before acting on routine
331
+ outcomes or self-healing failures. The service does not automatically deliver
332
+ wake payloads to your external harness.
346
333
 
347
334
  Treat every default-watch record as a call to act:
348
335
 
349
336
  - `integration.verification-failed`: inspect the failed steps, verified head and parent, then recheck current status. If the node still needs that repair, file a repair child targeting it. Each current failed cycle reports once; recovery does not backfill superseded failures. The node may have advanced after notification.
350
337
  - `escalation.raised`: inspect the question and evidence, then resolve it using
351
338
  the shared rules.
352
- - `build.consent-ready`: inspect the one consent queue, then land or hold the
339
+ - `build.consent-ready`: inspect the one consent queue, then merge or hold the
353
340
  selected candidate under the human's policy. Unready or stale candidates
354
341
  do not produce this observation.
355
342
  - `build.merge-decision`: diagnose the current merge-gate deferral or unsafe
@@ -444,8 +431,8 @@ for the exceptions above.
444
431
  observe it with a tool, say you cannot observe it.
445
432
  - You never invent repository identity, ticket ids, or build slugs; every
446
433
  id you act on came from a tool result or the conversation.
447
- - In the hosted service you do not run concurrent work: one turn at a time,
448
- and a message that arrives mid-turn is answered after the current turn ends.
434
+ - External harnesses own concurrency and incoming-message handling; the
435
+ service provides no one-turn-at-a-time or queued-message execution guarantee.
449
436
  - Where operator notes exist (hosted), they are shared ground truth; keep
450
437
  them current when you learn something durable.
451
438
 
@@ -456,33 +443,33 @@ its integration build collects child contributions on its recorded branch.
456
443
  A target is the destination of a contribution. `ab ticket tree --json` (MCP
457
444
  `tickets.tree`) shows exhaustive source metadata, including completed tickets
458
445
  and empty nodes. A claimed build freezes its effective target; use build status
459
- or queue entries for landing ancestry after a source ticket changes.
446
+ or queue entries for merge ancestry after a source ticket changes.
460
447
 
461
- Start with `ab landings --json` (MCP `landings.list`). This is the one queue of
462
- ready landings needing a decision: consent-policy candidates and held ready
448
+ Start with `ab merges --json` (MCP `merges.list`). This is the one queue of
449
+ ready merges needing a decision: consent-policy candidates and held ready
463
450
  candidates. Entries include the target, branch preview, candidate head/parent,
464
451
  verification receipts and node children/completeness. Unknown completeness is
465
452
  not zero children. A changed head or parent must regain current verification;
466
453
  unfinished or automatically authorized candidates do not ask for attention.
467
454
 
468
- Select a queue build in the terminal and use `l land` or `o hold`, or run
469
- `ab land <slug>` / `ab hold <slug>`. MCP uses `builds.control` with action `land`
470
- or `hold`. Hold is available before readiness and suppresses automatic landing.
471
- Land rechecks readiness and live node completeness, so act on failures by
455
+ Select a queue build in the terminal and use `l merge` or `o hold`, or run
456
+ `ab merge <slug>` / `ab hold <slug>`. MCP uses `builds.control` with action `merge`
457
+ or `hold`. Hold is available before readiness and suppresses automatic merge.
458
+ Merge rechecks readiness and live node completeness, so act on failures by
472
459
  refreshing the facts. Open children keep a node collecting. When integration
473
- verification fails, file a repair child targeting that node and let it land
460
+ verification fails, file a repair child targeting that node and let it merge
474
461
  before retrying the node cycle.
475
462
 
476
- Watch for decisions and conflicts with `ab watch --json`; save its opaque cursor
477
- and resume with `ab watch --since <cursor> --json`. Default attention includes
478
- failed node verification (`integration.verification-failed`), node landings, node item conflicts, conflicted leaf replays and derived
479
- `build.consent-ready` observations, including already-ready landings on first
463
+ Watch for decisions and conflicts with `ab watch --operator --json`; save its opaque cursor
464
+ and resume with `ab watch --operator --since <watch-cursor> --json`. Default attention includes
465
+ failed node verification (`integration.verification-failed`), node merges, node item conflicts, conflicted leaf replays and derived
466
+ `build.consent-ready` observations, including already-ready merges on first
480
467
  repository-wide discovery. Readiness is identified by its durable
481
468
  entry position: resuming suppresses the same episode, while a new candidate or
482
469
  exit/re-entry can notify again. Explicit `--event` globs remain event-only.
483
- Use `ab wait --for consent --for node-landed --for restack-conflicted --json`
470
+ Use `ab wait --for consent --for node-merged --for restack-conflicted --json`
484
471
  for one wake; state waits return immediately when already satisfied. `--for
485
- attention` also includes current failed node verification, consent readiness, janitor failure attention and landing/conflict attention.
472
+ attention` also includes current failed node verification, consent readiness, janitor failure attention and merge/conflict attention.
486
473
  Resume event backlogs with `--since <cursor>`; keep handling emitted records
487
474
  before interpreting terminal completion.
488
475
 
@@ -497,6 +484,20 @@ raise with its own event type.
497
484
 
498
485
  ## Forge failure recovery
499
486
 
487
+ Leaf restack and reconcile publication retry classified transient forge or transport
488
+ failures six times after the initial attempt, waiting 30, 60, 120, 240, 300 and
489
+ 300 seconds. `publication.retry-scheduled` records the operation, frozen rewrite
490
+ identity, episode anchor, failure ordinal, last error and absolute retry time;
491
+ restart resumes that schedule without rerunning the resolver. These retries do
492
+ not consume `maxPhaseAttempts`. A seventh transient failure records
493
+ `publication.retry-exhausted` and raises `publication-retry-limit`, naming the last
494
+ error and six retries. Answering that escalation opens a fresh publication episode
495
+ for the same retained intent without resetting agent phase failures. Pending
496
+ publication keeps its workspace through backoff and unresolved exhaustion.
497
+ Classified rate limits retain repository cooldown and consume no publication
498
+ retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
499
+ errors retain their existing behavior.
500
+
500
501
  Janitor failures are durable per-build episodes. Eligible failures retry after
501
502
  30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
502
503
  Skipped polls preserve the episode across restart. After
@@ -507,7 +508,7 @@ clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
507
508
  A classified forge rate limit records repository degradation with `resetAt`.
508
509
  Forge work waits during cooldown; passing the deadline permits a recovery
509
510
  request, and only success clears degradation. A further limit extends cooldown.
510
- Native landing application failures keep candidate-specific retry eligibility,
511
+ Native merge application failures keep candidate-specific retry eligibility,
511
512
  including automatic decisions without a human command. Retries recheck consent,
512
513
  holds, verification and the exact candidate. Uncertain enables remain pending
513
514
  until cancellation can be confirmed after cooldown. Publication retries reuse
@@ -531,7 +532,7 @@ using exact-resource ETags; authenticated 304s spare the REST primary quota.
531
532
  Adapter caches are bounded and restart/eviction falls back to fresh reads.
532
533
  Writes, including Git publication and rewrites, invalidate observations before
533
534
  attempting the mutation so acknowledgement reads remain fresh. Leaf PR polling
534
- keeps its existing cadence. Readiness and landing inspections remain fresh.
535
+ keeps its existing cadence. Readiness and merge inspections remain fresh.
535
536
 
536
537
  For node cadence, durable wakes, restart behavior and CLI evidence, see
537
538
  [node polling and status](../ab-guide/references/integration-tree.md#polling-and-status).
@@ -547,7 +548,7 @@ Shared requests are attributed to their first requester; cache hits count zero.
547
548
  An open collecting node may intentionally trail its parent. Parent movement is
548
549
  observed without starting replay. Use `ab restack <node>` (or `builds.restack`
549
550
  with `{repo, slug}`) to request freshness; paused or blocked nodes retain the
550
- request until their ordinary safety gates permit it. Completeness, landing,
551
+ request until their ordinary safety gates permit it. Completeness, merge,
551
552
  queued dependency presence and accepted re-parenting supply automatic demand.
552
553
  Nested nodes need independent demand. Inspect the shared parent commit distance
553
554
  readout; unknown is unavailable evidence, not zero. Existing transactions finish
@@ -11,18 +11,32 @@ write product code in this phase.
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
- 1. Run `ab context` first. It hydrates `.ab/` with everything you may see:
17
- `.ab/context.json` (the manifest — your required deposits, allowed terminal
18
- commands, and this round's `feedback` when the round has any), `.ab/spec.md`
19
- (the contract you plan against), `.ab/ticket.md`, your prior plan revision
20
- once you have one, and this round's feedback: `.ab/findings.json` (the
21
- reviewer's findings) or `.ab/guidance.json` (an operator's answer to
30
+ 1. Run `ab context` first. It hydrates `$AB_CONTEXT_DIR/` with everything you may see:
31
+ `$AB_CONTEXT_DIR/context.json` (the manifest — your required deposits, allowed terminal
32
+ commands, and this round's `feedback` when the round has any), `$AB_CONTEXT_DIR/spec.md`
33
+ (the contract you plan against), `$AB_CONTEXT_DIR/ticket.md`, your prior plan revision
34
+ once you have one, and this round's feedback: `$AB_CONTEXT_DIR/findings.json` (the
35
+ reviewer's findings) or `$AB_CONTEXT_DIR/guidance.json` (an operator's answer to
22
36
  the escalation that blocked this build). A round never carries both, and a
23
37
  round may carry neither.
24
38
  When the manifest lists `assets`, they are the build's pinned ticket assets
25
- under `.ab/assets/<kind>/<name>/`; read them with the spec. A `design` asset
39
+ under `$AB_CONTEXT_DIR/assets/<kind>/<name>/`; read them with the spec. A `design` asset
26
40
  is a contract on observable visual and reference outcomes, not on implementation — the plan must satisfy it, while how stays yours. The spec cites
27
41
  assets by kind and name.
28
42
  2. Read the spec, then the codebase. The spec says what and why; you decide
@@ -33,10 +47,10 @@ Guidance is an external operator answer, from the operator agent or a human.
33
47
  identifier constraints; memory, nearby adapter code, and passing tests over
34
48
  a fake or mock are not evidence of the real contract because they can
35
49
  repeat the author's assumption.
36
- 3. Write the plan to `.ab/plan.md`, deposit it, and finish:
50
+ 3. Write the plan to `$AB_CONTEXT_DIR/plan.md`, deposit it, and finish:
37
51
 
38
52
  ```
39
- ab artifact put plan .ab/plan.md
53
+ ab artifact put plan "$AB_CONTEXT_DIR/plan.md"
40
54
  ab done
41
55
  ```
42
56
 
@@ -57,7 +71,7 @@ Read `autobuild.toml` before writing the plan:
57
71
  path-glob calculation.
58
72
 
59
73
  Put the selection in an opening TOML front-matter block in the same
60
- `.ab/plan.md` artifact:
74
+ `$AB_CONTEXT_DIR/plan.md` artifact:
61
75
 
62
76
  ```toml
63
77
  +++
@@ -79,6 +93,13 @@ deposit a fresh corrected plan revision and retry. `plan-review` sees and
79
93
  reviews this block as part of the plan—there is no separate artifact or
80
94
  verdict.
81
95
 
96
+ If the approved selection later names any step absent from the cycle's pinned
97
+ configured universe, the entire selection falls back to all configured optional
98
+ steps. The kernel records one observation per cycle and plan revision naming
99
+ the unknown steps. Mandatory steps, path applicability and post-reconcile policy
100
+ still apply. A valid selection continues to skip genuinely omitted optional
101
+ steps. Strict validation when depositing a new plan is unchanged.
102
+
82
103
  ## What a plan contains
83
104
 
84
105
  - **Approach** — the shape of the change and why this shape, in a few
@@ -102,10 +123,10 @@ ab observe --kind followup "…"
102
123
  ## Feedback rounds
103
124
 
104
125
  A round that carries feedback carries exactly one kind, and only that file
105
- exists. `.ab/findings.json` is the reviewer's findings against your previous
126
+ exists. `$AB_CONTEXT_DIR/findings.json` is the reviewer's findings against your previous
106
127
  revision: address every one — change the plan, or state in the plan why the
107
128
  finding is wrong (the reviewer sees your revision next round).
108
- `.ab/guidance.json` is an operator's answer to the escalation that blocked
129
+ `$AB_CONTEXT_DIR/guidance.json` is an operator's answer to the escalation that blocked
109
130
  this build. It may have been raised by you or the reviewer, or by the kernel's
110
131
  plan-loop stall or policy guards. The file carries the escalation id and the
111
132
  answer text.
@@ -128,8 +149,13 @@ If the spec is contradictory, unbuildable, or wrong — do not plan around it.
128
149
  Park the build for a human:
129
150
 
130
151
  ```
131
- ab escalate "…the question, concretely…" --refs .ab/spec.md
152
+ ab escalate "…the question, concretely…" --refs "$AB_CONTEXT_DIR/spec.md"
132
153
  ```
133
154
 
134
155
  This is also a terminal command; use exactly one of `ab done` or
135
156
  `ab escalate` per session.
157
+
158
+ Read the manifest path printed by `ab context`. Its `materialized` keys are
159
+ relative to `contextDir`: join them to locate collision-adjusted inputs.
160
+ Manifest path fields are workspace-relative; use `notesPath` for producer notes.
161
+ Run commands from the workspace root.
@@ -11,15 +11,15 @@ verdict travels the typed channel; nothing you print matters to the pipeline.
11
11
 
12
12
  ## Session shape
13
13
 
14
- 1. Run `ab context`. You get `.ab/spec.md`, `.ab/plan.md` (latest revision),
15
- and `.ab/history/` with every prior round's findings — for persistence
16
- marking, not for deference. When present, `.ab/dismissed-findings.json`
14
+ 1. Run `ab context`. You get `$AB_CONTEXT_DIR/spec.md`, `$AB_CONTEXT_DIR/plan.md` (latest revision),
15
+ and `$AB_CONTEXT_DIR/history/` with every prior round's findings — for persistence
16
+ marking, not for deference. When present, `$AB_CONTEXT_DIR/dismissed-findings.json`
17
17
  lists finding ids a human explicitly dismissed.
18
18
  2. Judge the plan on exactly these axes:
19
19
  - **Spec conformance** — does executing this plan satisfy every
20
20
  acceptance criterion? Does anything in it exceed the spec's scope? A
21
- pinned `design` asset (listed under `assets` in `.ab/context.json`, files
22
- under `.ab/assets/<kind>/<name>/`) is a contract on observable visual and reference outcomes, not on implementation: open it and flag a plan that
21
+ pinned `design` asset (listed under `assets` in `$AB_CONTEXT_DIR/context.json`, files
22
+ under `$AB_CONTEXT_DIR/assets/<kind>/<name>/`) is a contract on observable visual and reference outcomes, not on implementation: open it and flag a plan that
23
23
  contradicts or ignores it, as you would an unmet criterion. A gap in the
24
24
  asset is not a reason to invent requirements.
25
25
  - **Groundedness** — do the files and seams it names actually exist and
@@ -42,13 +42,13 @@ verdict travels the typed channel; nothing you print matters to the pipeline.
42
42
  unjustified omission or addition like any other plan defect. Mandatory
43
43
  `always = true` steps must be present; no front matter means the safe
44
44
  default of all configured steps.
45
- 3. Write your review notes to `.ab/plan-review.md`, then deliver exactly one
45
+ 3. Write your review notes to `$AB_CONTEXT_DIR/plan-review.md`, then deliver exactly one
46
46
  verdict:
47
47
 
48
48
  ```
49
- ab verdict approve --notes .ab/plan-review.md
50
- ab verdict revise --findings .ab/findings.json --notes .ab/plan-review.md
51
- ab verdict escalate --reason "…" --notes .ab/plan-review.md
49
+ ab verdict approve --notes "$AB_CONTEXT_DIR/plan-review.md"
50
+ ab verdict revise --findings "$AB_CONTEXT_DIR/findings.json" --notes "$AB_CONTEXT_DIR/plan-review.md"
51
+ ab verdict escalate --reason "…" --notes "$AB_CONTEXT_DIR/plan-review.md"
52
52
  ```
53
53
 
54
54
  ## Writing findings
@@ -68,7 +68,7 @@ Findings are structured JSON (the CLI validates and stamps ids):
68
68
  ```
69
69
 
70
70
  - `severity`: `blocking` | `important` | `minor`, calibrated below.
71
- - `persists`: if a prior round's finding (see `.ab/history/`) is still
71
+ - `persists`: if a prior round's finding (see `$AB_CONTEXT_DIR/history/`) is still
72
72
  unresolved — the same disagreement, even if reworded — list its id here.
73
73
  This is judgment only you can apply.
74
74
 
@@ -123,3 +123,8 @@ would have written it. Known immaterial defects are not a reason to withhold
123
123
  approval — record them with `ab observe` and approve. Escalate when the
124
124
  *spec* is the problem (contradictory or unbuildable); revise when the plan
125
125
  is.
126
+
127
+ Read the manifest path printed by `ab context`. Its `materialized` keys are
128
+ relative to `contextDir`: join them to locate collision-adjusted inputs.
129
+ Manifest path fields are workspace-relative; use `notesPath` for producer notes.
130
+ Run commands from the workspace root.
@@ -7,7 +7,7 @@ description: Resolve the kernel-prepared replay of a build's single change onto
7
7
 
8
8
  The kernel has collapsed this build's contribution into one change and replayed
9
9
  it onto a frozen refreshed base. Your job is to preserve both the build's intent
10
- and the behavior already landed upstream. Work on the prepared detached HEAD;
10
+ and the behavior already merged upstream. Work on the prepared detached HEAD;
11
11
  the kernel retains the published branch until guarded publication succeeds.
12
12
 
13
13
  For a node conflict, `nodeChange` names the integration owner, transaction,
@@ -21,10 +21,24 @@ integration owner's. `ab done` retains the item and records its receipt; trusted
21
21
  kernel plumbing advances the remaining stack after the session ends. Do not
22
22
  publish, collapse the node, choose another item, or rewrite the public branch.
23
23
 
24
+ Scratch output, downloaded references, probes, and temporary scripts belong under `.ab/`
25
+ (prefer the current `$AB_CONTEXT_DIR` when appropriate), never at the worktree
26
+ root, and must not be committed. Manifest-directed artifact paths remain authoritative.
27
+
28
+ Large scratch belongs under the session's `.ab/` directory (prefer `$AB_CONTEXT_DIR`),
29
+ not `/tmp`: this includes ad-hoc PostgreSQL data/cluster directories, Cargo target
30
+ directories, browser profiles, and database copies. Configure `PGDATA`,
31
+ `CARGO_TARGET_DIR`, and explicit browser profile paths for those resources.
32
+ Keep `TMPDIR` outside the worktree for test suites and commands that discover
33
+ repositories or configuration through parent directories, including focused tests
34
+ and Git probes. Do not relocate required installed tooling or retained evidence;
35
+ manifest-directed artifact paths remain authoritative. Never commit scratch.
36
+
37
+
24
38
  ## Session shape
25
39
 
26
40
  1. Run `ab context`. Read the printed manifest and its `materialized` paths for
27
- the spec, approved plan, implement-notes, and any `.ab/guidance.json` guidance. `replay` names the
41
+ the spec, approved plan, implement-notes, and any `$AB_CONTEXT_DIR/guidance.json` guidance. `replay` names the
28
42
  original head, old contribution base, single change, frozen target base and
29
43
  whether replay conflicted. A replay may originate at verify entry before any
30
44
  PR exists; `restackId` identifies an adopted automatic transaction. Never fetch, merge, rebase, select another base,
@@ -32,7 +46,7 @@ publish, collapse the node, choose another item, or rewrite the public branch.
32
46
  2. Inspect `git status` and the prepared replay. If conflicts remain, resolve
33
47
  them with the explicit charge to regress against neither side:
34
48
  - Preserve the behavior the spec and approved plan require.
35
- - Preserve the behavior already landed on the target base.
49
+ - Preserve the behavior already merged on the target base.
36
50
  Stage only the resolved files and run `git cherry-pick --continue`. If the
37
51
  change is now redundant, preserve an empty commit with `git commit
38
52
  --allow-empty --no-edit`; never skip away the build's identity. A clean
@@ -72,3 +86,8 @@ A human answer in guidance is authoritative while the spec remains the contract.
72
86
  If they cannot both be satisfied, escalate the contradiction. Reconcile has no
73
87
  code-review round; risky resolutions need human judgment. The only successful
74
88
  terminal commands are `ab done` and `ab escalate`.
89
+
90
+ Read the manifest path printed by `ab context`. Its `materialized` keys are
91
+ relative to `contextDir`: join them to locate collision-adjusted inputs.
92
+ Manifest path fields are workspace-relative; use `notesPath` for producer notes.
93
+ Run commands from the workspace root.