@defrex/autobuild 1.0.0-beta.2 → 1.0.0-beta.4

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 (145) hide show
  1. package/SPEC.md +342 -23
  2. package/bin/ab-dispatch-generation.ts +93 -0
  3. package/docs/answering-blocked-builds.md +21 -3
  4. package/docs/architecture.md +170 -7
  5. package/docs/configuration.md +173 -5
  6. package/docs/integration-tree.md +91 -4
  7. package/docs/integration.md +54 -0
  8. package/docs/operator-api.md +58 -5
  9. package/docs/remote-store-protocol.md +9 -1
  10. package/docs/remote-ticket-protocol.md +5 -0
  11. package/docs/restacking.md +4 -1
  12. package/docs/setup.md +24 -0
  13. package/docs/spec-standard.md +94 -5
  14. package/docs/ticket-migration.md +50 -4
  15. package/package.json +3 -3
  16. package/packages/core/src/cli/artifact.ts +5 -4
  17. package/packages/core/src/cli/attention.ts +2 -0
  18. package/packages/core/src/cli/binary-direct.ts +190 -0
  19. package/packages/core/src/cli/binary-lifecycle.ts +46 -0
  20. package/packages/core/src/cli/binary.ts +24 -210
  21. package/packages/core/src/cli/build-control.ts +108 -5
  22. package/packages/core/src/cli/context.ts +41 -1
  23. package/packages/core/src/cli/dashboard/hand-pushed.ts +24 -0
  24. package/packages/core/src/cli/dashboard/handoff.ts +64 -0
  25. package/packages/core/src/cli/dashboard/integration-detail.ts +11 -6
  26. package/packages/core/src/cli/dashboard/integration-row.ts +15 -8
  27. package/packages/core/src/cli/dashboard/model.ts +41 -10
  28. package/packages/core/src/cli/dashboard/render.ts +24 -2
  29. package/packages/core/src/cli/dashboard/rollback.ts +30 -0
  30. package/packages/core/src/cli/dispatch-args.ts +53 -0
  31. package/packages/core/src/cli/dispatch-crash-budget.ts +15 -0
  32. package/packages/core/src/cli/dispatch-frontend.ts +57 -5
  33. package/packages/core/src/cli/dispatch-handoff.ts +276 -0
  34. package/packages/core/src/cli/dispatch-launch-contract.ts +170 -0
  35. package/packages/core/src/cli/dispatch-launcher.ts +580 -0
  36. package/packages/core/src/cli/dispatch-parent-watch.ts +44 -0
  37. package/packages/core/src/cli/dispatch-preflight.ts +272 -0
  38. package/packages/core/src/cli/dispatch-presentation-job.ts +46 -0
  39. package/packages/core/src/cli/dispatch-presentation-ownership.ts +9 -0
  40. package/packages/core/src/cli/dispatch-process.ts +22 -90
  41. package/packages/core/src/cli/dispatch-readiness.ts +47 -0
  42. package/packages/core/src/cli/dispatch-repository-feed.ts +6 -1
  43. package/packages/core/src/cli/dispatch-runtime-cache.ts +522 -0
  44. package/packages/core/src/cli/dispatch-runtime-dependencies.ts +291 -0
  45. package/packages/core/src/cli/dispatch-runtime-use.ts +336 -0
  46. package/packages/core/src/cli/dispatch-upgrade-controller.ts +221 -0
  47. package/packages/core/src/cli/dispatch-upgrade-install.ts +258 -0
  48. package/packages/core/src/cli/dispatch-upgrade-source.ts +309 -0
  49. package/packages/core/src/cli/dispatch-upgrade-target.ts +190 -0
  50. package/packages/core/src/cli/dispatch.ts +609 -60
  51. package/packages/core/src/cli/dispatcher-liveness.ts +1 -1
  52. package/packages/core/src/cli/harvest.ts +28 -11
  53. package/packages/core/src/cli/help.ts +7 -3
  54. package/packages/core/src/cli/installation.ts +5 -3
  55. package/packages/core/src/cli/main-checkout.ts +59 -0
  56. package/packages/core/src/cli/main.ts +26 -53
  57. package/packages/core/src/cli/node-verification-provenance.ts +97 -0
  58. package/packages/core/src/cli/repo-state.ts +3 -58
  59. package/packages/core/src/cli/repository-status.ts +74 -4
  60. package/packages/core/src/cli/runtime-spawn.ts +16 -0
  61. package/packages/core/src/cli/status.ts +57 -3
  62. package/packages/core/src/cli/ticket.ts +35 -11
  63. package/packages/core/src/cli/upgrade-followup.ts +25 -0
  64. package/packages/core/src/cli/wait.ts +3 -0
  65. package/packages/core/src/cli/watch.ts +7 -0
  66. package/packages/core/src/config/live.ts +1 -0
  67. package/packages/core/src/config/schema.ts +8 -4
  68. package/packages/core/src/distribution-packaging.ts +116 -0
  69. package/packages/core/src/events/catalog.ts +6 -0
  70. package/packages/core/src/events/payloads.ts +55 -9
  71. package/packages/core/src/events/policy.ts +26 -0
  72. package/packages/core/src/events/repository.ts +205 -4
  73. package/packages/core/src/events/runtime.ts +16 -0
  74. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +6537 -4053
  75. package/packages/core/src/kernel/change-presence.ts +7 -1
  76. package/packages/core/src/kernel/dispatch-capacity.ts +12 -4
  77. package/packages/core/src/kernel/dispatch-drain-recovery.ts +121 -0
  78. package/packages/core/src/kernel/dispatch-status.ts +4 -2
  79. package/packages/core/src/kernel/dispatch-upgrade.ts +171 -0
  80. package/packages/core/src/kernel/dispatcher-liveness.ts +7 -0
  81. package/packages/core/src/kernel/generators/repository-journals.ts +82 -0
  82. package/packages/core/src/kernel/guarded-forge.ts +1 -1
  83. package/packages/core/src/kernel/harvest.ts +98 -4
  84. package/packages/core/src/kernel/integration-attention.ts +20 -0
  85. package/packages/core/src/kernel/integration-completeness.ts +54 -16
  86. package/packages/core/src/kernel/integration-state.ts +80 -11
  87. package/packages/core/src/kernel/landing-readiness.ts +6 -1
  88. package/packages/core/src/kernel/mixed-version.ts +34 -0
  89. package/packages/core/src/kernel/node-parent.ts +35 -10
  90. package/packages/core/src/kernel/node-polling.ts +160 -0
  91. package/packages/core/src/kernel/read-facts.ts +47 -5
  92. package/packages/core/src/kernel/reducer-registry.ts +6 -0
  93. package/packages/core/src/kernel/reducer.ts +75 -14
  94. package/packages/core/src/kernel/service-facts.ts +11 -4
  95. package/packages/core/src/kernel/ticket-migrations.ts +139 -0
  96. package/packages/core/src/operator/presentation.ts +7 -0
  97. package/packages/core/src/operator/query.ts +13 -3
  98. package/packages/core/src/operator/registry.ts +1 -1
  99. package/packages/core/src/operator/tickets.ts +30 -26
  100. package/packages/core/src/plugins/load.ts +4 -1
  101. package/packages/core/src/plugins/runtime-snapshot.ts +128 -0
  102. package/packages/core/src/ports/forge/contract.ts +29 -0
  103. package/packages/core/src/ports/forge/github.ts +189 -61
  104. package/packages/core/src/ports/forge-failure.ts +1 -0
  105. package/packages/core/src/ports/forge-telemetry.ts +3 -0
  106. package/packages/core/src/ports/runner/session-env.ts +1 -0
  107. package/packages/core/src/ports/tickets/linear.ts +180 -12
  108. package/packages/core/src/ports/tickets/migration.ts +92 -9
  109. package/packages/core/src/ports/types.ts +17 -0
  110. package/packages/core/src/ports/workspace/distribution-archive.ts +22 -149
  111. package/packages/core/src/ports/workspace/distribution-release.ts +56 -0
  112. package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
  113. package/packages/core/src/ports/workspace/local-build-execution.ts +37 -17
  114. package/packages/core/src/processes/build-child-exit.ts +5 -26
  115. package/packages/core/src/processes/build-runner.ts +81 -11
  116. package/packages/core/src/processes/dispatcher.ts +418 -59
  117. package/packages/core/src/processes/execution-no-progress.ts +6 -0
  118. package/packages/core/src/processes/execution-relaunch.ts +30 -0
  119. package/packages/core/src/processes/execution-settlement.ts +16 -7
  120. package/packages/core/src/processes/harvest-runner.ts +328 -292
  121. package/packages/core/src/processes/process-group-reaper.ts +17 -10
  122. package/packages/core/src/runtime-identity.ts +22 -3
  123. package/packages/core/src/store/contract.ts +183 -0
  124. package/packages/core/src/store/local/store.ts +197 -72
  125. package/packages/core/src/store/reduced-reads.ts +8 -0
  126. package/packages/core/src/store/reducer-value-shapes.json +8915 -6344
  127. package/packages/core/src/store/remote/client.ts +43 -0
  128. package/packages/core/src/store/repo-state-events.ts +21 -3
  129. package/packages/core/src/store/types.ts +7 -0
  130. package/packages/core/src/testing/dispatch-read-budget.ts +3 -2
  131. package/skills/guide/SKILL.md +234 -24
  132. package/skills/guide/references/integration-tree.md +91 -4
  133. package/skills/guide/references/operator-api.md +53 -4
  134. package/skills/guide/references/plugin-authoring.md +45 -4
  135. package/skills/guide/references/remote-store-protocol.md +9 -1
  136. package/skills/guide/references/remote-ticket-protocol.md +5 -0
  137. package/skills/guide/references/restacking.md +4 -1
  138. package/skills/guide/references/setup.md +24 -0
  139. package/skills/guide/references/spec-standard.md +94 -5
  140. package/skills/guide/references/ticket-migration.md +50 -4
  141. package/skills/harvest/SKILL.md +4 -0
  142. package/skills/harvest-review/SKILL.md +4 -0
  143. package/skills/operate/SKILL.md +78 -8
  144. package/skills/spec/SKILL.md +35 -5
  145. package/skills/tickets/SKILL.md +19 -0
@@ -19,8 +19,10 @@ ancestor and demand the minimal restack path; same-node landings satisfy presenc
19
19
 
20
20
  ## Choosing a destination
21
21
 
22
- Whenever grooming produces more than one ticket for a feature, explicitly choose
23
- root or a node before filing. Use a node when the set should reach the base branch
22
+ First decide whether the feature should be more than one ticket at all; the
23
+ [spec standard](spec-standard.md#sizing-and-splitting) prefers fewer, larger
24
+ tickets cut at seams. Whenever grooming produces more than one ticket for a
25
+ feature, explicitly choose root or a node before filing. Use a node when the set should reach the base branch
24
26
  as one integrated change, or intermediate states should not ship independently.
25
27
  Use root when every ticket is independently valuable and safe to land alone.
26
28
  Nested nodes can collect a subfeature before contributing it to a larger feature.
@@ -101,6 +103,22 @@ source targets, while build status shows the effective destination.
101
103
 
102
104
  ## Collect, verify and land
103
105
 
106
+ Node `verify:*` context additionally exposes `nodeVerification`: the frozen
107
+ range, a JSON index path, contribution build slugs, current stored ticket
108
+ identities, event-authorized spec revisions and spec paths, and their commits.
109
+ The index maps every commit in the range using build identity trailers,
110
+ including earlier-cycle contributions and merge side history. Commits without
111
+ an identity are listed as unattributed (a mechanical classification). The manifest
112
+ and index also expose `handPushedCommits: [{sha, originalSha, message}]` for owned
113
+ hand-pushed commits in the frozen range, preserving original identity across restacks.
114
+ Their full messages express maintainer-authorized intent: judge quality and
115
+ consistency, and never fail them solely for lacking a covering spec. Other node
116
+ changes are authorized when covered by the current event-authorized node spec or the spec
117
+ of the contribution introducing it; use the commit mapping to find that spec.
118
+ Missing or ambiguous provenance fails hydration. Leaf context is unchanged.
119
+ See [iterating inside a node](#iterating-inside-a-node) for authoring and evolving
120
+ these sources of intent.
121
+
104
122
  Create a node and direct work into it (replace ids with those returned by your
105
123
  source):
106
124
 
@@ -125,8 +143,10 @@ publication; tracker edits cannot be transactional with a forge write.
125
143
 
126
144
  The kernel runs all configured verify steps with normal path applicability on
127
145
  the exact node head and parent. Either moving invalidates eligibility, even a
128
- clean restack. Failed verification blocks the node: file a repair child targeting
129
- it; the repaired landed head permits a new cycle. Historical reports keep their
146
+ clean restack. Failed verification blocks the node and emits `integration.verification-failed` once per prepared cycle. Default watch and new hosted wake settings include it; `ab wait --for attention` also detects the current failure before notification. The fact names failed steps, head, parent and repair guidance. Watch baselines prior failures; reconcile status after arming. A new cycle can notify again, while historical facts do not keep a repaired node blocked. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled. Recheck current status before filing a repair, since the node may have advanced after notification. To recover, file a repair child targeting
147
+ it; the repaired landed head permits a new cycle. If the contract changed, an
148
+ operator can explicitly revise the spec instead and verify again on the same head
149
+ (see operator node spec revisions below). Historical reports keep their
130
150
  actual head/base citations. Integration grammar is collect → verify → land →
131
151
  close, with restacking and repair cycles along the way.
132
152
 
@@ -143,6 +163,38 @@ merged head was verified, then completes the ticket. Closing without merge or
143
163
  aborting closes admission and returns the ticket to triage; already claimed
144
164
  children retain their frozen destination.
145
165
 
166
+ ## Iterating inside a node
167
+
168
+ Write the node spec as a finite integration charter: its goal, observable
169
+ completion conditions for the whole, and destination and landing expectations
170
+ under the effective policy. Put feature specifics in spec-standard children.
171
+ An open node supports three ways to iterate:
172
+
173
+ - **Add children.** Create spec-standard tickets targeting the node's ticket id,
174
+ for example `ab ticket create "Account settings" --body settings.md --target <node-id>`.
175
+ Ordinary children run their normal pipeline. Verification uses the provenance
176
+ mapping to judge changes against the introducing child's spec or the current
177
+ event-authorized node charter; a child contribution need not also be promised
178
+ independently by the charter.
179
+ - **Push small maintainer-authorized tweaks.** Push to the node's recorded branch
180
+ with meaningful commit messages describing intent. Verification reads the frozen
181
+ range's owned `handPushedCommits` messages, judges quality and consistency, and
182
+ cannot fail a tweak solely because it lacks a covering spec. This is maintainer
183
+ iteration, not permission for phase agents to bypass their publication boundary.
184
+ - **Revise the charter when the charter itself changes.** Use
185
+ `ab answer <node> --revise-spec replacement.md`, or update the ticket and import
186
+ it with `ab answer <node> --revise-spec-from-ticket`. A ticket edit alone does
187
+ not revise an active build. Children retain their specs, claims and targets;
188
+ the node recollects and verifies the replacement revision, including on the
189
+ same head and parent after failed verification. See
190
+ [operator node spec revisions](#operator-node-spec-revisions) for admission
191
+ restrictions.
192
+
193
+ Open children keep the node incomplete, including triage, backlog and ready
194
+ children. Completion remains finite: landed or otherwise ended nodes close
195
+ admission. Iteration does not relax verification of the exact head and parent,
196
+ or the configured readiness, consent and landing gates described above.
197
+
146
198
  ## Changing a parent
147
199
 
148
200
  `ab ticket update NODE-1 --target NODE-2` reparents an open node;
@@ -192,3 +244,38 @@ verification and landing, for queued dependency presence, on operator request,
192
244
  and after accepted re-parenting. Descendants need independent demand; presence
193
245
  requests follow only the minimal proven ancestor path. See
194
246
  [restacking](restacking.md#timing-and-evidence) for timing, requests and distance.
247
+
248
+ ## Polling and status
249
+
250
+ Opened integration nodes poll every tick until their durable activity has been
251
+ quiet for `policy.nodeIdleAfterSeconds` (default 600 seconds), then poll every
252
+ `policy.nodeIdlePollSeconds` (default 120 seconds). Holds and waiting for consent
253
+ qualify normally. Child claims, PR and landing activity, operator commands
254
+ (including repeated holds), restack requests and answers wake the next tick.
255
+ GitHub-only changes are discovered on the next due check, within the idle
256
+ interval plus normal tick scheduling while the dispatcher is running; failure,
257
+ cooldown and transport-budget gates still apply. Pending operations retain
258
+ active polling and action-time readiness checks remain fresh. Successful
259
+ `node.poll-checked` facts preserve quiet history across restarts; missing facts
260
+ force a fresh check. `ab build status` reports active or idle cadence and the
261
+ last successful check (or unrecorded evidence).
262
+
263
+ ## Operator node spec revisions
264
+
265
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
266
+ integration verification without an escalation. Use
267
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
268
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
269
+ the build. Both forms enforce the same spec standard as leaf revisions.
270
+ Each kernel `spec.revised` records the exact artifact and operator identity
271
+ (with optional transport provenance); earlier revisions remain readable.
272
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
273
+ The node recollects and verifies the new revision, including on the same head
274
+ and parent after a failed cycle. Earlier cycles remain historical evidence
275
+ and cannot block or authorize landing under the replacement. Children keep
276
+ their specs, claims and targets; contributions are not restarted.
277
+ Active verification/reconcile or writer work, restack/reparent work, pause,
278
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
279
+ A concurrent state change refuses publication with a retry explanation;
280
+ uncited artifacts are inert. Leaves still require an open escalation and
281
+ restart from `plan`.
@@ -0,0 +1,54 @@
1
+ # Iterating inside an integration node
2
+
3
+ A node collects related work into one finite delivery to its parent. Write its
4
+ ticket as a charter: why the integration matters, what observable conditions
5
+ make the whole done, and where and how it lands under the repository's effective
6
+ landing policy. Keep the usual spec sections: what and why, checkable acceptance
7
+ criteria, out of scope, and evidence. Put evolving feature specifics in children.
8
+
9
+ For example, a charter can aim for a coherent account-management flow, complete
10
+ when account settings and closure work together and pass integration verification.
11
+ Child tickets define the detailed behavior of those flows.
12
+
13
+ Create the node and children with ids returned by your ticket source:
14
+
15
+ ```sh
16
+ ab ticket create "Account management" --body charter.md --kind node
17
+ ab ticket create "Account settings" --body settings.md --target <node-id>
18
+ ab ticket tree
19
+ ```
20
+
21
+ While the node is open, add more spec-standard children as needed. Each ordinary
22
+ child runs its normal pipeline. Node verification uses contribution provenance
23
+ to judge ordinary changes against either the current event-authorized node
24
+ charter or the introducing child's spec. Each child need not be independently
25
+ promised by the charter.
26
+
27
+ For small maintainer-authorized tweaks, push to the node's recorded branch with
28
+ meaningful commit messages explaining intent. Verification reads the owned
29
+ hand-pushed commit messages in the frozen range and judges quality and
30
+ consistency; it cannot fail a tweak solely for lacking a covering spec.
31
+ Phase agents still follow their own publication boundaries.
32
+
33
+ When the charter itself changes, explicitly revise the active build:
34
+
35
+ ```sh
36
+ ab answer <node> --revise-spec replacement.md
37
+ ```
38
+
39
+ Alternatively, amend the ticket, then run
40
+ `ab answer <node> --revise-spec-from-ticket`. Editing the ticket alone does not
41
+ revise the build. Eligible idle collecting or verification-failed nodes recollect
42
+ and verify the replacement revision, even on the same head and parent after a
43
+ failed cycle. Children retain their specs, claims and targets.
44
+
45
+ Open children, including triage, backlog and ready tickets, keep the node
46
+ incomplete. Once complete, the node must pass verification on its exact head and
47
+ parent and satisfy its configured landing gates. Landing completes the node and
48
+ closes admission; use a new node for a later delivery. Consent requirements depend
49
+ on the effective policy.
50
+
51
+ See [integration trees](integration-tree.md#collect-verify-and-land) for provenance
52
+ and completion details, [revision restrictions](integration-tree.md#operator-node-spec-revisions)
53
+ for when a replacement is accepted, and [landing policy](landing-policy.md) for
54
+ landing and consent rules.
@@ -81,8 +81,8 @@ turn runner (a later ticket) is the only producer of turn facts.
81
81
  | Method and path | Result |
82
82
  |---|---|
83
83
  | `GET …/builds?scope=active\|queued\|all` | Build summaries, newest update first. `queued` means active plus queued, matching `ab builds --queued`. |
84
- | `GET …/builds/{slug}` | `{detail, dashboardRow}`; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it (after cleanup's `build.completed`). |
85
- | `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, queue/capacity and settings projection. |
84
+ | `GET …/builds/{slug}` | `{detail, dashboardRow}`; `detail.runnerAttaches` records chronological attach boundaries and their runtime identity (version, commit, source kind/location), with null runtime for unrecorded historical attaches; `dashboardRow` remains a `CLEANING` row after `build.aborted` and becomes `null` only when the dashboard stops listing it (after cleanup's `build.completed`). |
85
+ | `GET …/dashboard` | `{generatedAt, model, settingsHeader}`. `model` is the dashboard's rows, steps, elapsed timing inputs, harvest row, queue/capacity and settings projection. Optional `rollback` contains `correlation`, `lineage`, full `failed` and `restored` runtime identities and rollback event `ts` for the authoritative dispatcher lineage’s unresolved hold. Both dashboards name failed, restored and held runtime plus timestamp. Matching durable different-target hold clearance removes it; a fresh operator lineage hides it only after a committed operational tick or accepted takeover. Run-started and yielded ticks alone cannot replace authority; same-lineage generations retain the notice. Historical rollback records are not fallback notices. Optional `handoffs` lists all accepted unfinished handoffs with predecessor `run`, optional `successor`, `correlation`, full `from`/`to` runtimes, `mode` and optional `deadline`. Outstanding drain-mode builds carry `draining: true`, also on build-detail `dashboardRow`; matching settlement removes it. Accepted completion removes the handoff; neither takeover nor the clock does. Missing historical mode means cutover and missing deadline displays unknown. |
86
86
  | `GET …/status` | Repository intake, pause, and default-auto-merge projection. |
87
87
  | `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
88
88
  | `GET …/builds/{slug}/artifacts/{kind}?rev=N` | Raw bytes (`application/octet-stream`) plus content-disposition and `X-Autobuild-Artifact-*` metadata headers. Omit `rev` for latest. |
@@ -146,6 +146,24 @@ revision, a trusted caller fetches the current ticket body and supplies it; the
146
146
  build must still have a recorded ticket. Revision conformance, lazy retry,
147
147
  artifact metadata, event ordering, and refusal rules are the same as the CLI.
148
148
 
149
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
150
+ integration verification without an escalation. Use
151
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
152
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
153
+ the build. Both forms enforce the same spec standard as leaf revisions.
154
+ Each kernel `spec.revised` records the exact artifact and operator identity
155
+ (with optional transport provenance); earlier revisions remain readable.
156
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
157
+ The node recollects and verifies the new revision, including on the same head
158
+ and parent after a failed cycle. Earlier cycles remain historical evidence
159
+ and cannot block or authorize landing under the replacement. Children keep
160
+ their specs, claims and targets; contributions are not restarted.
161
+ Active verification/reconcile or writer work, restack/reparent work, pause,
162
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
163
+ A concurrent state change refuses publication with a retry explanation;
164
+ uncited artifacts are inert. Leaves still require an open escalation and
165
+ restart from `plan`.
166
+
149
167
  ## The registry's protocol face: `POST …/tools/{tool}`
150
168
 
151
169
  One generic route executes any entry of the agent tool registry (the same
@@ -220,7 +238,8 @@ event reads.
220
238
 
221
239
  Dispatcher liveness is also visible through `ab repository status --json`:
222
240
  `dispatcher.holder` identifies the unexpired repository lease owner, independently
223
- of `latestRun`. Heartbeat age measures attributable renewals; tick age measures
241
+ of `latestRun`. Each run includes its recorded `runtime` (version, commit, and
242
+ source kind/location), or null for unrecorded historical starts. Heartbeat age measures attributable renewals; tick age measures
224
243
  durable progress. Missing historical evidence is null. The liveness query uses
225
244
  bounded repository facts first, with a full-history fallback when a later
226
245
  invocation hides the holder start or the latest stop. Other state reads retain
@@ -238,6 +257,8 @@ record the first signal in the stop fact, and release its lease before exit.
238
257
 
239
258
  The default watch reports actionable conditions only:
240
259
 
260
+ - `integration.verification-failed`: failed node verification, once per prepared cycle, with failed steps, verified head and parent, and guidance to file a repair child targeting the node. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled.
261
+
241
262
  - `build.janitor-failing`: a build has reached the configured consecutive-failure threshold; a successful janitor attempt clears it.
242
263
  - `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
243
264
 
@@ -250,7 +271,7 @@ The default watch reports actionable conditions only:
250
271
  build/PR; it does not duplicate consent or hold attention.
251
272
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
252
273
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
253
- `restartRequired`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
274
+ `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
254
275
  - `dispatcher.ticket-source-persistent`: degradation past its advertised
255
276
  reset time, once a tick started at or after reset has completed or failed
256
277
  with the episode still open; crossing reset alone is silent. Without a reset,
@@ -287,7 +308,9 @@ arming the watch. Named watches still end when every named build is terminal;
287
308
  learn their outcomes from status reconciliation at exit.
288
309
 
289
310
  `ab wait --for attention` is build-only and uses the same build conditions:
290
- an open escalation or a merge decision. Existing conditions return immediately,
311
+ current failed node verification, an open escalation, janitor failure attention,
312
+ consent readiness, landing/conflict attention or a merge decision. Current failed
313
+ verification satisfies attention even before its notification is written. Existing conditions return immediately,
291
314
  even with `--since`; live and backlog matches ignore routine outcomes and
292
315
  self-healing failures. A merge match uses the watch observation with
293
316
  `condition: "attention"`. Explicit `--event` globs remain event-only.
@@ -320,3 +343,33 @@ the original reset, which later rate limits cannot postpone indefinitely.
320
343
  uses the same service as `ab restack <node>`. The receipt contains `slug`,
321
344
  `request`, `coalesced` and `waiting`; execution is asynchronous. It refuses
322
345
  non-node, unopened and terminal builds and enforces repository ownership.
346
+
347
+ Repository status includes `upgrades.runs`, keyed by originating dispatcher run,
348
+ with latest successful `resolved` target, detected target, failure, handoff and
349
+ completion evidence. `dispatcher.upgrade-target-resolved` carries strict
350
+ `{run, lineage, target}` data; the target has mode (`pinned`, `installed`, or
351
+ `source`), content key, source provenance and optional version/base/SHA. Source
352
+ mode names the authoritative base commit, which can advance without changing
353
+ packaged inputs or the running runtime. Status text renders the resolved mode,
354
+ base and SHA separately, so an older handoff cannot hide a newer target. Identical
355
+ observations append nothing; a successful resolution does not clear failures. Facts carry launcher
356
+ lineage, from/to runtimes, resolution mode and authoritative base SHA/ref or original
357
+ installation provenance, plus prepared cache identity. Completion names the successor
358
+ and records completed retirement separately from takeover. During a handoff the
359
+ projection includes both generations, chosen mode, outstanding draining builds
360
+ and deadline. The successor owns repository work after terminal release and lease
361
+ claim, while old local runners retain execution leases until settlement or deadline.
362
+ Remote guests retain independent leases, finish their phase and request neutral
363
+ relaunch; their separate handoff capture never holds retirement open. `dispatcher.upgrade-failed` is immediate repository
364
+ attention; the current generation remains active and identical failed inputs are
365
+ suppressed across native handoff until target or selected-store compatibility evidence changes or a fresh operator launch.
366
+
367
+ Repository status additionally exposes `upgrades.lastRollback` (historical, retained
368
+ when cleared), `upgrades.holds` keyed by launcher lineage, `upgrades.lineages` keyed
369
+ by generation run, optional `upgrades.authoritativeRun` from rollback, accepted takeover or committed operational tick (never startup/yield alone), `upgrades.rollbackIds` for idempotent rollback correlations, and `rollbackHold` for the effective dispatcher lineage.
370
+ `dispatcher.runtime-rolled-back` names failed/restored runtime identities and cache
371
+ roots, target, original handoff/takeover, three failed exits and reason. It is default
372
+ repository attention. `dispatcher.rollback-hold-cleared` records a different
373
+ successfully resolved target. The rollback hold survives store compatibility
374
+ changes, resolution errors and upgrade opt-out; a new operator-launch lineage
375
+ ignores old holds. Preflight failure suppression above remains separate.
@@ -497,7 +497,7 @@ without a journal record, or a repository without builds.
497
497
  | `getRepo` | `GET /repos/{repo}` | none | `200` + `RepositoryRecord`; absent is `404` (the shipped client maps this to `null`) |
498
498
  | `appendRepo` | `POST /repos/{repo}/events` | event write | `201` + repository event envelope |
499
499
  | `getRepoEvents` | `GET /repos/{repo}/events?since={n}&wait={s}` | optional `since` query value, parsed as in section 3; absence defaults to `0`. Optional `wait` in whole seconds, per the event-wait rules of section 3 | `200` + envelopes with `seq >` parsed `since`, in increasing sequence order |
500
- | `getRepoStateEvents` | `GET /repos/{repo}/state-events` | none | `200` + the bounded repository-journal subset (AUT-489): every durable event type (`harvest.*`, `orchestrator.sandbox.*`, the three dispatcher setting types) plus, when the journal has one, the tail from the latest `dispatcher.run-started`, in increasing sequence order; served inside the repository-existence gate like `GET events`, so an unknown repository is `404` |
500
+ | `getRepoStateEvents` | `GET /repos/{repo}/state-events` | none | `200` + the bounded repository-journal subset (AUT-489): every durable event type (`harvest.*`, `orchestrator.sandbox.*`, the three dispatcher setting types, and cross-generation handoff correlation facts: target-prepared, yield-requested, upgrade-failed, handoff-started, terminal-released, takeover, drain-deadline, drain-settled and handoff-completed) plus, when the journal has one, the tail from the latest `dispatcher.run-started`, in increasing sequence order; served inside the repository-existence gate like `GET events`, so an unknown repository is `404` |
501
501
  | `getReducerSnapshot` (repo scope) | `GET /repos/{repo}/snapshots/{reducer}?version={n}` | required `version` query value, a positive integer; `reducer` is a registry name (`^[A-Za-z][A-Za-z0-9._-]{0,63}$`) | `200` + `{"version", "cursor", "state"}` or `200 null` when absent, written by another reducer version, ahead of the journal's tail, or the repository has no journal record; an unknown repository is `404`, which the shipped client also maps to `null` |
502
502
  | `putReducerSnapshot` (repo scope) | `PUT /repos/{repo}/snapshots/{reducer}` | `{"version": int >= 1, "cursor": int >= 0, "state": JSON}`, at most 16 MiB (`413` above) | `200 {"written": boolean}`; the stored cursor never decreases, so a write at an equal or lower cursor (or an equal cursor at an equal or lower version) and one past the journal's tail answer `written: false` |
503
503
  | `appendRepoWithArtifacts` | `POST /repos/{repo}/deposits` | atomic deposit request | `201` + `{event, artifacts}` using repository shapes |
@@ -1006,6 +1006,9 @@ Build grants live until 60 seconds after durable build termination. Phase grants
1006
1006
  also retire 60 seconds after their own session ends, whichever comes first.
1007
1007
  Harvest grants retire 60 seconds after their run stops or their authorized
1008
1008
  execution ends/releases; harvest phases additionally retire on session end.
1009
+ Durable harvest suspension immediately closes the phase grant, without a grace interval.
1010
+ A resumed local harvest turn opens a new bracket and receives fresh credentials;
1011
+ the predecessor grant stays closed.
1009
1012
  The boundary is exclusive: at `end + 60_000ms` the credential is refused. This
1010
1013
  window permits final transcripts, diagnostics, deposits and stream closure.
1011
1014
  Pause/escalation of a build and lease expiry do not end authority. Active grants
@@ -1329,3 +1332,8 @@ The optional `integrationAuditPending` digest fact is introduced on the 0.14
1329
1332
  release line without changing protocol identity 4. It survives build completion
1330
1333
  and is cleared by audit settlement. Services omit it for historical 0.12/0.13
1331
1334
  clients, retaining their decoders and the supported three-line window.
1335
+
1336
+ `tickets.migration-recorded` is a durable, decisive human-authored repository
1337
+ fact: `{ identity, from, to, mapping }`, where mapping contains source ticket IDs
1338
+ and destination IDs. All migration facts survive dispatcher-run turnover.
1339
+ Conflicting identity reuse or source-qualified mappings fail replay closed.
@@ -333,3 +333,8 @@ client version. Without it, both fields are projected away, preserving historica
333
333
  strict decoders. Current hosted clients send all three capability headers and
334
334
  default absent kind to `work`. Unfiltered listing includes all ticket states and
335
335
  empty nodes for `ab ticket tree`; dispatch and landing behavior are unchanged.
336
+
337
+ Completed ticket imports record `tickets.migration-recorded` in the selected
338
+ BuildStore repository journal, with export identity, origin/destination adapter
339
+ names and the actual complete ID mapping. Requested-ID preservation alone does
340
+ not establish continuity for in-flight builds; see the migration procedure.
@@ -33,6 +33,9 @@ need their own demand. Existing frozen transactions, including ones reserved
33
33
  before upgrade, finish first; later demand coalesces onto the latest parent.
34
34
  Leaves keep verify-entry and awaiting-landing restacks for every target.
35
35
 
36
+ For observation cadence, durable wakes and last-check evidence, see
37
+ [node polling and status](integration-tree.md#polling-and-status).
38
+
36
39
  Presence demand uses change identities, never ticket resolution alone. It follows
37
40
  only the path from the nearest proven ancestor source down to the dependent's
38
41
  actual destination, processing ancestors first. Unrelated siblings stay idle;
@@ -82,7 +85,7 @@ archives, changes and merge proofs. Lease expiry recovers the same operation,
82
85
  not a competing one. Prepared/conflicted/replayed item receipts, publication
83
86
  intent, proven replacement and settlement distinguish each recovery boundary.
84
87
  Inventory retains its sampled source boundary even while the confirmed parent
85
- boundary stays unchanged. It exposes source identities, node-owned foreign commits, active operation,
88
+ boundary stays unchanged. It exposes source identities, hand-pushed changes (node-owned foreign commits), active operation,
86
89
  conflict item and unsafe merge evidence.
87
90
 
88
91
  Only a conflicted item attaches a reconcile runner. It receives the original
package/docs/setup.md CHANGED
@@ -222,6 +222,18 @@ requires a published release.
222
222
 
223
223
  ### Guest distribution version selection and delivery
224
224
 
225
+ Cached generations retain explicit archive provenance. A registry generation
226
+ resolves its manifest version’s GitHub release asset on first guest use, validates
227
+ version and digest, and atomically caches it separately from the host archive.
228
+ Local launch requires no GitHub fetch. Isolated and hoisted Bun installations
229
+ retain registry provenance through store-path or lock evidence. Source, Git and local package
230
+ generations deliver their exact packed code. Missing or invalid release assets
231
+ fail guest delivery and remain retryable, without falling back to packing the
232
+ registry installation.
233
+ Remote guests finish their phase before requesting relaunch; re-attachment
234
+ refreshes the archive and marker before the next runner starts. They retain
235
+ independent leases and never hold local retirement open.
236
+
225
237
  The guest's distribution version is selected by the archive source, and both
226
238
  sources agree with the running system by construction:
227
239
 
@@ -400,6 +412,14 @@ Its session instructions must preserve this contract:
400
412
 
401
413
  1. Run `ab context`. The verifier receives `.ab/spec.md`, the configured step,
402
414
  the commit range, and, after escalation is answered, `.ab/guidance.json`.
415
+ Node verify sessions also receive `nodeVerification` in the context manifest:
416
+ contribution specs and a provenance index mapping commits to the builds that
417
+ introduced them. Read those specs through the manifest's allocated paths.
418
+ Also read `handPushedCommits: [{sha, originalSha, message}]` from the manifest
419
+ and index. These hand-pushed node commit messages express maintainer-authorized
420
+ intent; judge quality and consistency, and never fail them solely for lacking
421
+ a covering spec. Other node changes are authorized when the node spec or the introducing
422
+ contribution's spec covers it; use the commit index to find that spec.
403
423
  2. Exercise each applicable acceptance criterion through the repository's real
404
424
  application lifecycle. Prefer the narrowest honest flow that catches a
405
425
  regression.
@@ -541,3 +561,7 @@ gate. External orchestrators follow these through `ab watch` with no slugs or an
541
561
  explicit repository watch; `ab wait` remains build-only. The dashboard and operator
542
562
  repository query retain all failures for that run. After correcting settings or
543
563
  access, revalidate and restart dispatch to refresh its startup diagnostics.
564
+
565
+ Changing the connected ticket source does not itself migrate in-flight builds.
566
+ Follow [ticket migration](ticket-migration.md), keeping the existing BuildStore
567
+ and recording continuity before resuming build-related ticket writes.
@@ -54,10 +54,99 @@ evidence is not.
54
54
 
55
55
  ---
56
56
 
57
+ ## Sizing and splitting
58
+
59
+ Every build pays a fixed cost no matter how small its diff: spec, plan and
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
62
+ that cost ten times, and a blocker chain pays it in series. Prefer fewer,
63
+ larger tickets: one ticket per coherent change, as large as one plan and one
64
+ review pass can hold without the quality bar slipping.
65
+
66
+ A ticket is the right size when its acceptance criteria describe one feature
67
+ or fix a reviewer can judge in a single pass, one plan can cover it without
68
+ deferring a design decision to a later build, and its out-of-scope list is
69
+ short and obvious. It is too big when its criteria fall into groups that share
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
72
+ or must wait.
73
+
74
+ Do not split:
75
+
76
+ - by layer (schema, then API, then UI) when the layers make one behavior
77
+ change;
78
+ - into "refactor, then feature" unless the refactor is valuable and safe on
79
+ its own;
80
+ - to make progress visible, or because the spec got long. A long spec with
81
+ clear criteria is fine.
82
+
83
+ ### Cut along seams
84
+
85
+ A seam decides where to cut once a split is justified; it is not a reason to
86
+ split. A full-stack change that crosses an API boundary stays one ticket
87
+ unless its size says otherwise.
88
+
89
+ When a feature does need several tickets, find the seams before deciding the
90
+ cut: places where the code already has a narrow, stable contract between
91
+ parts — a port or adapter interface, a schema or event type, a wire protocol,
92
+ a CLI command's output, a module's public API. Read the code to find them;
93
+ don't guess. Put each ticket on one side of a seam.
94
+
95
+ A cut at a seam pays twice:
96
+
97
+ - **Fewer conflicts.** Tickets on opposite sides of a contract touch
98
+ different code, so they build in parallel and restack cleanly. Two tickets
99
+ that would edit the same functions are one ticket, or a blocker chain.
100
+ - **Testability.** The contract is the test boundary. Each side is verified
101
+ against it — the provider by contract tests, the consumer against a fake or
102
+ fixture — so neither build needs the other to prove it works.
103
+
104
+ If no seam exists where the work divides, keep it as one ticket, or make the
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
107
+ concurrently.
108
+
109
+ State the seam in each ticket as behavior, not structure: what the contract
110
+ promises observably (the event, the command output, the protocol response) is
111
+ a fair acceptance criterion on both sides; file names and signatures still
112
+ belong to the planner. Record in Evidence why the cut falls where it does, so
113
+ a planner reading one ticket knows what its siblings own.
114
+
115
+ ### Keep the blocker graph wide
116
+
117
+ A split feature takes as long as its longest blocker chain, not as long as
118
+ its ticket count. A wave of independent tickets finishes in about one build's
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
121
+ that establishes a shared contract — keep it to that contract and its tests,
122
+ so the wave behind it starts sooner, and fold nothing unrelated into it.
123
+ Add a blocker only for a real prerequisite, never to express a preferred
124
+ order.
125
+
126
+ ---
127
+
57
128
  ## Immutability during a build
58
129
 
59
- The spec is the build's contract artifact (kind `spec`, revision 0). It
60
- cannot change during a build because every downstream reviewer approves
61
- conformance *to it*. A phase that discovers the spec itself is wrong raises
62
- an escalation (`ab escalate`); a human answers, the spec gets revision N+1,
63
- and the build restarts from `plan`.
130
+ The spec is the build's contract artifact (kind `spec`, revision 0).
131
+ Every downstream reviewer approves conformance to its pinned revision.
132
+ For leaves, a phase that discovers the spec itself is wrong raises an
133
+ escalation (`ab escalate`); a human answers, the spec gets revision N+1,
134
+ and the leaf restarts from `plan`.
135
+
136
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
137
+ integration verification without an escalation. Use
138
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
139
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
140
+ the build. Both forms enforce the same spec standard as leaf revisions.
141
+ Each kernel `spec.revised` records the exact artifact and operator identity
142
+ (with optional transport provenance); earlier revisions remain readable.
143
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
144
+ The node recollects and verifies the new revision, including on the same head
145
+ and parent after a failed cycle. Earlier cycles remain historical evidence
146
+ and cannot block or authorize landing under the replacement. Children keep
147
+ their specs, claims and targets; contributions are not restarted.
148
+ Active verification/reconcile or writer work, restack/reparent work, pause,
149
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
150
+ A concurrent state change refuses publication with a retry explanation;
151
+ uncited artifacts are inert. Leaves still require an open escalation and
152
+ restart from `plan`.
@@ -4,8 +4,9 @@ Export and import use the ordinary file ticket layout. They operate on tickets
4
4
  and current attachments through the ticket source; neither command contacts the
5
5
  forge. File and hosted sources support import. Linear supports export only.
6
6
 
7
- 1. Pause intake and stop other ticket writers for the cutover. Import preflight
8
- does not reserve numbers against concurrent writers.
7
+ 1. Pause intake and quiesce build-related ticket writes and other ticket writers
8
+ for the cutover. In-flight builds need not be aborted. Import preflight does
9
+ not reserve numbers against concurrent writers.
9
10
  2. With the old `[tickets]` configuration, run `ab ticket export /path/to/export`.
10
11
  The destination must be absent or empty. Export reads every state, including
11
12
  archived Linear tickets and empty discoverable states, and publishes the
@@ -14,8 +15,20 @@ forge. File and hosted sources support import. Linear supports export only.
14
15
  hosted ticket service. Keep the export directory intact.
15
16
  4. Run `ab ticket import /path/to/export`. Inspect its printed ticket and state
16
17
  mappings and `/path/to/export/.ab-import-map.json`.
17
- 5. Inspect ticket bodies, labels, blockers, comments and attachments in the new
18
- source. Confirm lifecycle configuration and the ready gate, then resume intake.
18
+ 5. Import records a durable source/ID mapping in the same BuildStore and repository
19
+ that hold the existing builds, after tickets, metadata and assets finish.
20
+ Keep that BuildStore/repository identity through the cutover.
21
+ 6. Inspect ticket bodies, labels, blockers, comments and attachments in the new
22
+ source. Confirm lifecycle configuration and the ready gate, then resume builds and intake.
23
+
24
+ Linear export reads full ticket details in batches and prints `read X/Y tickets`.
25
+ The total is shown as pending until inventory discovery finishes. If Linear reports
26
+ a rate limit with a usable future reset time, export prints the wait time, waits
27
+ until that reset, and retries the failed read while retaining completed pages.
28
+ Without a usable reset time, export fails immediately. A running dispatcher and
29
+ other clients authenticated as the same API user share the API budget, so they
30
+ can cause additional waits. Interrupting export with Ctrl-C publishes nothing;
31
+ the destination stays absent or empty until all ticket and attachment reads succeed.
19
32
 
20
33
  Both commands also accept
21
34
  `--store <ref>` to reach legacy BuildStore attachments. Keep the old store available
@@ -70,3 +83,36 @@ identity, establishes node kinds, then applies targets using the durable id map,
70
83
  just like blockers. Input order does not matter. Resuming also restores edges on
71
84
  adopted tickets; normal destination validation still guards existing graphs and
72
85
  node demotion. Older work-only exports remain valid.
86
+
87
+ ## In-flight builds
88
+
89
+ A recorded migration resolves old source-qualified ticket references through the
90
+ new source, including remapped IDs. Completeness, child targeting, capacity
91
+ ancestry, claimed target checks, lifecycle transitions and notices use that
92
+ mapping. Historical build events and ticket references remain unchanged. Moves
93
+ can chain across sources; mappings are never applied backward. A source switch
94
+ alone establishes no continuity. Missing migration evidence or an uncovered ID
95
+ fails closed and names the build and original ticket when operating on that
96
+ build or its frozen membership. Uncovered historical builds stay in their
97
+ original namespace during history searches; they cannot alias current tickets
98
+ or block unrelated intake. Separate trackers with the
99
+ same adapter name cannot be distinguished by historical references; this does
100
+ not establish continuity between them.
101
+
102
+ When using the export directory directly as the configured file tracker, run
103
+ `ab ticket migration record /path/to/export [--store <ref>]`. This verifies the
104
+ manifest inventory and creation keys against the destination and records identity
105
+ mappings for the original manifest IDs, without importing tickets. Additional
106
+ tickets filed in the directory after export are allowed and are not included in
107
+ the mapping. Every original ID must still exist with its recorded creation key.
108
+ Preserve `.ab-migration.json` for this step;
109
+ the tracker itself can operate without it. `.ab-import-map.json` is progress
110
+ information, never proof of continuity. Repeating an identical recording is safe;
111
+ conflicting evidence is refused.
112
+
113
+ Import is not transactional across ticket and build services. A partial import
114
+ records no continuity; rerun with the same directory to adopt by creation key.
115
+ If tickets finish but journal recording fails, the command reports that boundary:
116
+ rerun the same command to finish recording before resuming builds. The migration
117
+ journal belongs to the selected BuildStore even when ticket assets live on an
118
+ independent hosted service. Validate the destination configuration before resume.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defrex/autobuild",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Agent-driven software delivery from groomed ticket to merged PR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -144,8 +144,8 @@
144
144
  },
145
145
  "devDependencies": {
146
146
  "@biomejs/biome": "2.5.5",
147
- "@defrex/autobuild-postgres-store": "1.0.0-beta.2",
148
- "@defrex/autobuild-vercel-sandbox": "1.0.0-beta.2",
147
+ "@defrex/autobuild-postgres-store": "1.0.0-beta.4",
148
+ "@defrex/autobuild-vercel-sandbox": "1.0.0-beta.4",
149
149
  "@resvg/resvg-js": "2.6.2",
150
150
  "@types/bun": "^1.3.14",
151
151
  "@types/node": "^24.0.0",
@@ -55,16 +55,17 @@ export async function artifactPut(
55
55
  if (kind.trim() === '') {
56
56
  throw new Error("'ab artifact put' requires a non-empty <kind> (§8.2)")
57
57
  }
58
- // §6.3 immutability: the spec cannot change during a build. It enters via
58
+ // §6.3: phase agents cannot change the spec during a build. It enters via
59
59
  // dispatch (spec.imported / spec.authored — dispatcher plumbing, never this
60
- // CLI) and changes only through a human-answered escalation (spec.revised).
60
+ // CLI) and changes only through operator ab answer (spec.revised).
61
61
  // Without this gate, any phase's agent could silently swap the contract
62
62
  // every later reviewer approves conformance to.
63
63
  if (kind === 'spec') {
64
64
  throw new Error(
65
- "'ab artifact put spec' is rejected: the spec is immutable during a build " +
65
+ "'ab artifact put spec' is rejected: the spec is immutable to phase agents during a build " +
66
66
  '(§6.3) — a phase that finds the spec itself wrong should raise ' +
67
- "'ab escalate' so a human can revise it (spec.revised restarts from plan).",
67
+ "'ab escalate' so a human can revise it. Leaf revisions require an escalation and restart from plan; " +
68
+ 'operators may revise idle collecting or verification-failed nodes through ab answer without an escalation.',
68
69
  )
69
70
  }
70
71
  const file = Bun.file(filePath)
@@ -57,6 +57,8 @@ export function repositoryNeedsAttention(event: RepositoryEvent): boolean {
57
57
  case 'harvest.recovery-exhausted':
58
58
  case 'dispatcher.forge-readiness-failed':
59
59
  case 'dispatcher.config-rejected':
60
+ case 'dispatcher.runtime-rolled-back':
61
+ case 'dispatcher.upgrade-failed':
60
62
  return true
61
63
  case 'dispatcher.config-reloaded':
62
64
  return event.payload.restartRequired.length > 0