@defrex/autobuild 1.0.0-beta.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +362 -56
  3. package/bin/ab-dispatch-generation.ts +93 -0
  4. package/docs/agent-runtimes.md +157 -0
  5. package/docs/answering-blocked-builds.md +21 -3
  6. package/docs/architecture.md +166 -7
  7. package/docs/build-store.md +123 -0
  8. package/docs/builds.md +82 -0
  9. package/docs/cli.md +48 -0
  10. package/docs/configuration-overview.md +93 -0
  11. package/docs/configuration.md +1778 -188
  12. package/docs/dispatcher-hosting.md +115 -0
  13. package/docs/dispatcher.md +59 -0
  14. package/docs/forges.md +121 -0
  15. package/docs/getting-started.md +60 -0
  16. package/docs/glossary.md +60 -0
  17. package/docs/hosted-service.md +2 -2
  18. package/docs/intake.md +48 -0
  19. package/docs/integration-overview.md +81 -0
  20. package/docs/integration-tree.md +87 -2
  21. package/docs/integration.md +54 -0
  22. package/docs/operating.md +114 -0
  23. package/docs/operator-api.md +64 -11
  24. package/docs/operator-surfaces.md +90 -0
  25. package/docs/overview.md +49 -0
  26. package/docs/plugin-authoring.md +426 -0
  27. package/docs/remote-store-protocol.md +12 -9
  28. package/docs/restacking.md +4 -1
  29. package/docs/seams.md +66 -0
  30. package/docs/setup.md +28 -6
  31. package/docs/skills.md +119 -0
  32. package/docs/spec-standard.md +23 -5
  33. package/docs/ticket-sources.md +132 -0
  34. package/docs/tickets.md +69 -0
  35. package/docs/troubleshooting.md +111 -0
  36. package/docs/upgrading.md +50 -0
  37. package/docs/verification.md +146 -0
  38. package/docs/website.md +47 -5
  39. package/docs/workspaces.md +152 -0
  40. package/package.json +5 -4
  41. package/packages/core/src/cli/artifact.ts +5 -4
  42. package/packages/core/src/cli/attention.ts +2 -0
  43. package/packages/core/src/cli/binary-direct.ts +190 -0
  44. package/packages/core/src/cli/binary-lifecycle.ts +46 -0
  45. package/packages/core/src/cli/binary.ts +24 -210
  46. package/packages/core/src/cli/build-control.ts +105 -2
  47. package/packages/core/src/cli/context.ts +41 -1
  48. package/packages/core/src/cli/dashboard/hand-pushed.ts +24 -0
  49. package/packages/core/src/cli/dashboard/handoff.ts +64 -0
  50. package/packages/core/src/cli/dashboard/integration-detail.ts +3 -0
  51. package/packages/core/src/cli/dashboard/model.ts +34 -10
  52. package/packages/core/src/cli/dashboard/render.ts +24 -2
  53. package/packages/core/src/cli/dashboard/rollback.ts +30 -0
  54. package/packages/core/src/cli/dispatch-args.ts +53 -0
  55. package/packages/core/src/cli/dispatch-crash-budget.ts +15 -0
  56. package/packages/core/src/cli/dispatch-frontend.ts +52 -5
  57. package/packages/core/src/cli/dispatch-handoff.ts +276 -0
  58. package/packages/core/src/cli/dispatch-launch-contract.ts +170 -0
  59. package/packages/core/src/cli/dispatch-launcher.ts +580 -0
  60. package/packages/core/src/cli/dispatch-parent-watch.ts +44 -0
  61. package/packages/core/src/cli/dispatch-preflight.ts +272 -0
  62. package/packages/core/src/cli/dispatch-presentation-job.ts +46 -0
  63. package/packages/core/src/cli/dispatch-presentation-ownership.ts +9 -0
  64. package/packages/core/src/cli/dispatch-process.ts +22 -90
  65. package/packages/core/src/cli/dispatch-readiness.ts +47 -0
  66. package/packages/core/src/cli/dispatch-repository-feed.ts +5 -1
  67. package/packages/core/src/cli/dispatch-runtime-cache.ts +522 -0
  68. package/packages/core/src/cli/dispatch-runtime-dependencies.ts +291 -0
  69. package/packages/core/src/cli/dispatch-runtime-use.ts +336 -0
  70. package/packages/core/src/cli/dispatch-upgrade-controller.ts +221 -0
  71. package/packages/core/src/cli/dispatch-upgrade-install.ts +258 -0
  72. package/packages/core/src/cli/dispatch-upgrade-source.ts +309 -0
  73. package/packages/core/src/cli/dispatch-upgrade-target.ts +190 -0
  74. package/packages/core/src/cli/dispatch.ts +604 -60
  75. package/packages/core/src/cli/dispatcher-liveness.ts +1 -1
  76. package/packages/core/src/cli/env.ts +1 -1
  77. package/packages/core/src/cli/harvest.ts +28 -11
  78. package/packages/core/src/cli/help.ts +10 -5
  79. package/packages/core/src/cli/installation.ts +5 -3
  80. package/packages/core/src/cli/main-checkout.ts +59 -0
  81. package/packages/core/src/cli/main.ts +15 -45
  82. package/packages/core/src/cli/node-verification-provenance.ts +97 -0
  83. package/packages/core/src/cli/repo-state.ts +3 -58
  84. package/packages/core/src/cli/repository-status.ts +67 -3
  85. package/packages/core/src/cli/runtime-spawn.ts +16 -0
  86. package/packages/core/src/cli/status.ts +57 -3
  87. package/packages/core/src/cli/upgrade-followup.ts +25 -0
  88. package/packages/core/src/cli/wait.ts +3 -0
  89. package/packages/core/src/cli/watch.ts +7 -0
  90. package/packages/core/src/config/landing.ts +8 -0
  91. package/packages/core/src/config/live.ts +1 -0
  92. package/packages/core/src/config/reference-metadata.ts +31 -0
  93. package/packages/core/src/config/reference.ts +342 -0
  94. package/packages/core/src/config/roles.ts +1 -1
  95. package/packages/core/src/config/schema.ts +352 -10
  96. package/packages/core/src/distribution-packaging.ts +116 -0
  97. package/packages/core/src/events/catalog.ts +6 -0
  98. package/packages/core/src/events/payloads.ts +53 -9
  99. package/packages/core/src/events/policy.ts +25 -0
  100. package/packages/core/src/events/repository.ts +184 -4
  101. package/packages/core/src/events/runtime.ts +16 -0
  102. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +2515 -78
  103. package/packages/core/src/kernel/dispatch-drain-recovery.ts +121 -0
  104. package/packages/core/src/kernel/dispatch-status.ts +4 -2
  105. package/packages/core/src/kernel/dispatch-upgrade.ts +171 -0
  106. package/packages/core/src/kernel/dispatcher-liveness.ts +7 -0
  107. package/packages/core/src/kernel/generators/repository-journals.ts +82 -0
  108. package/packages/core/src/kernel/guarded-forge.ts +1 -1
  109. package/packages/core/src/kernel/harvest.ts +98 -4
  110. package/packages/core/src/kernel/integration-attention.ts +20 -0
  111. package/packages/core/src/kernel/integration-state.ts +80 -11
  112. package/packages/core/src/kernel/landing-readiness.ts +6 -1
  113. package/packages/core/src/kernel/mixed-version.ts +34 -0
  114. package/packages/core/src/kernel/node-polling.ts +160 -0
  115. package/packages/core/src/kernel/read-facts.ts +40 -5
  116. package/packages/core/src/kernel/reducer-registry.ts +3 -0
  117. package/packages/core/src/kernel/reducer.ts +75 -14
  118. package/packages/core/src/kernel/service-facts.ts +11 -4
  119. package/packages/core/src/ontology.ts +2 -2
  120. package/packages/core/src/open-map.ts +3 -1
  121. package/packages/core/src/operator/presentation.ts +7 -0
  122. package/packages/core/src/operator/query.ts +6 -2
  123. package/packages/core/src/operator/registry.ts +1 -1
  124. package/packages/core/src/plugins/load.ts +4 -1
  125. package/packages/core/src/plugins/runtime-snapshot.ts +128 -0
  126. package/packages/core/src/ports/forge/contract.ts +29 -0
  127. package/packages/core/src/ports/forge/github.ts +189 -61
  128. package/packages/core/src/ports/forge-failure.ts +1 -0
  129. package/packages/core/src/ports/forge-telemetry.ts +3 -0
  130. package/packages/core/src/ports/runner/session-env.ts +1 -0
  131. package/packages/core/src/ports/types.ts +10 -0
  132. package/packages/core/src/ports/workspace/distribution-archive.ts +22 -149
  133. package/packages/core/src/ports/workspace/distribution-release.ts +56 -0
  134. package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
  135. package/packages/core/src/ports/workspace/local-build-execution.ts +37 -17
  136. package/packages/core/src/processes/build-child-exit.ts +5 -26
  137. package/packages/core/src/processes/build-runner.ts +81 -11
  138. package/packages/core/src/processes/dispatcher.ts +254 -23
  139. package/packages/core/src/processes/execution-no-progress.ts +6 -0
  140. package/packages/core/src/processes/execution-relaunch.ts +30 -0
  141. package/packages/core/src/processes/execution-settlement.ts +16 -7
  142. package/packages/core/src/processes/harvest-runner.ts +328 -292
  143. package/packages/core/src/processes/process-group-reaper.ts +17 -10
  144. package/packages/core/src/runtime-identity.ts +22 -3
  145. package/packages/core/src/store/contract.ts +153 -0
  146. package/packages/core/src/store/local/store.ts +197 -72
  147. package/packages/core/src/store/reduced-reads.ts +8 -0
  148. package/packages/core/src/store/reducer-value-shapes.json +5783 -3305
  149. package/packages/core/src/store/remote/client.ts +43 -0
  150. package/packages/core/src/store/repo-state-events.ts +20 -3
  151. package/packages/core/src/store/types.ts +7 -0
  152. package/skills/finalize/SKILL.md +3 -1
  153. package/skills/guide/SKILL.md +273 -48
  154. package/skills/guide/references/integration-tree.md +87 -2
  155. package/skills/guide/references/operator-api.md +71 -14
  156. package/skills/guide/references/plugin-authoring.md +231 -266
  157. package/skills/guide/references/remote-store-protocol.md +12 -9
  158. package/skills/guide/references/restacking.md +4 -1
  159. package/skills/guide/references/setup.md +28 -6
  160. package/skills/guide/references/spec-standard.md +23 -5
  161. package/skills/harvest/SKILL.md +4 -0
  162. package/skills/harvest-review/SKILL.md +4 -0
  163. package/skills/implement/SKILL.md +4 -2
  164. package/skills/operate/SKILL.md +104 -35
  165. package/skills/plan/SKILL.md +12 -4
  166. package/skills/spec/SKILL.md +20 -2
  167. package/skills/tickets/SKILL.md +20 -1
  168. package/templates/hosted-service/package.json +2 -2
package/SPEC.md CHANGED
@@ -217,6 +217,157 @@ surface remains the remote HTTP protocol rather than in-process registration.
217
217
 
218
218
  Small, independently runnable, crash-safe:
219
219
 
220
+ Resident checkout-backed `ab dispatch` starts a launcher and one dispatcher
221
+ **generation**. The launcher eagerly loads its own filesystem/process code,
222
+ opens no Store, holds no repository/execution lease and makes no kernel
223
+ decisions. Before starting the generation it freezes the invoking distribution
224
+ and its already installed production dependency graph into the canonical
225
+ checkout's `.autobuild/runtime/` cache, offline. Source edits (including
226
+ uncommitted edits) and dependency bytes participate in content identity; version
227
+ alone never selects a snapshot. Completed distribution roots are immutable.
228
+ The generation, kernel, later local runners and agent PATH `ab` all execute
229
+ from that same root. Run/attach runtime identities name the cached directory.
230
+ Source generations capture their guest archive from that exact snapshot.
231
+ Registry generations preserve the normalized host archive and resolve their
232
+ manifest version's published GitHub release asset on first guest use. Host launch
233
+ is offline; version and SHA256 validation precede atomic guest-asset completion.
234
+ Missing, corrupt or wrong-version assets fail guest delivery and remain retryable.
235
+ Metadata retains explicit provenance and the host digest, adding the guest digest
236
+ after resolution; older entries without provenance are not silently reused.
237
+
238
+ The versioned v1 launch contract consists of argv, a consumed one-shot
239
+ `AB_DISPATCH_GENERATION` marker, graceful signals and exit reasons `stopped`,
240
+ `handoff`, `failed`. Public invocations discard inherited markers. No private
241
+ operational channel exists; work outcomes still come only from durable state.
242
+ The launcher observes presentation stop/continue liveness so Ctrl-Z returns the
243
+ shell prompt and `fg` resumes only the presentation; the kernel keeps running.
244
+ Terminal restoration by the launcher is a fallback for abnormal termination,
245
+ never a second alternate-screen exit after a clean generation stop.
246
+ Automatic upgrades default on (`[upgrade] automatic = true`). The resident
247
+ kernel checks immediately and every 60 seconds independently of dispatch ticks.
248
+ It resolves the root manifest and Bun lock from a single authoritative base
249
+ branch commit through the forge, never from a feature branch, checkout pin or
250
+ stale tracking ref. A declared dependency selects pinned mode; unsupported or
251
+ inconsistent metadata is an attention failure. With no declaration (including
252
+ no root manifest), installed mode rereads the original public installation
253
+ pathname retained across handoffs. A launch from a source root in the dispatched
254
+ repository's Git common-directory topology selects source mode instead. That
255
+ eligibility and its initial packaged snapshot are frozen across successors. The
256
+ target is the forge-authoritative base commit, exported into private cache staging
257
+ without changing any operator or build worktree. A frozen-lockfile, script-free
258
+ Bun install supplies dependencies; the completed immutable runtime records the
259
+ exact commit and follows ordinary cache retention and pruning. Source adoption
260
+ compares packaged contents and production-reachable dependency resolution rather
261
+ than version or commit: excluded-file advances do not hand off. Included shipped
262
+ documentation counts as packaged content.
263
+
264
+ A changed exact version (including a downgrade) is installed in isolation and
265
+ validated in the immutable cache before cutover. The operator's installation
266
+ and consuming dependency graph are untouched. Registry/lock/install/contract
267
+ failures retain the running generation and record repository attention. Failed
268
+ inputs are suppressed until their target metadata changes or an operator starts
269
+ a fresh launcher; unrelated base commits do not reset suppression.
270
+
271
+ The kernel records `dispatcher.upgrade-target-resolved` once per changed successful
272
+ target observation per run, including equal-content source advances. Repository
273
+ status exposes its mode, base and target SHA independently of the running commit
274
+ and earlier failure or handoff evidence. Identical polls append nothing.
275
+ A successor first validates configuration and the actual selected store without
276
+ starting repository work or terminal input/output. Provider compatibility evidence
277
+ chooses drain when sharing is safe and cutover otherwise. SQLite compares its
278
+ untouched catalog semantically (columns, indexes, keys and constraints) with target
279
+ requirements, accepting equivalent schemas built by guarded ALTER migrations; HTTP uses the live service's client
280
+ and protocol admission. Missing evidence chooses cutover. A target outside the hosted client overlap
281
+ window also requires cutover; target admission and successful protocol writes
282
+ are still mandatory. Cutover never makes a rejected target runnable. Successful durable
283
+ protocol writes are also required: a service that admits the client but rejects
284
+ a new yield fact fails preflight, leaving the predecessor active with target and
285
+ reason in repository attention. Failed targets are not retried every tick; a change in selected-store compatibility
286
+ evidence allows the normal target-check cadence to retry.
287
+
288
+ Local harvest suspends durably before repository lease release on handoff or
289
+ clean stop. The next generation resumes eligible native sessions with fresh
290
+ logical credentials, or records a reasoned `harvest.session.resume-fallback`
291
+ and starts fresh. Orderly suspension spends no recovery attempt; real crashes
292
+ retain recovery accounting.
293
+
294
+ The predecessor serializes acceptance with ticks and launch admission, joins
295
+ repository-owned harvest and provisioning work, and records the exact local
296
+ executions, start time and deadline. Its terminal frontend removes and joins
297
+ input/render work before acknowledging terminal release. Only after that durable
298
+ acknowledgement and a successful repository lease claim may the successor draw
299
+ or consume input. Only the successor ticks, claims, runs janitor/harvest and
300
+ launches runners. Execution leases remain with existing local runners; remote
301
+ executions detach immediately. Their exact instances and recorded guest runtimes
302
+ are captured separately on `dispatcher.handoff-started.remoteBuilds`. This
303
+ authorization work survives local retirement completion and late attachment;
304
+ it never adds to local drain counts or delays predecessor exit. Recovery reads
305
+ only builds whose repository digest records an open execution, at most once per
306
+ build per tick; historical captures of ended executions add no build reads. Guests retain
307
+ their leases and heartbeats and request neutral relaunch after their current
308
+ phase completes. The successor re-attaches with refreshed guest bytes.
309
+
310
+ A draining predecessor supervises its captured local executions until they settle
311
+ or `policy.upgradeDrainSeconds` (900 seconds by default) elapses. The deadline
312
+ tracks accepted live policy changes relative to the original start. Remaining
313
+ local sessions suspend through the normal durable native-resume path before
314
+ process-group cleanup. Cutover uses this suspension path immediately and waits
315
+ for predecessor stop before takeover. Retirement completion records drained and
316
+ suspended counts separately from takeover. A successor reconstructs unfinished
317
+ retirement from execution leases and durable build facts after predecessor death.
318
+ An unrelated dispatcher taking the lease still causes ordinary supersession and
319
+ teardown.
320
+
321
+ At each completed phase boundary, a local or remote build runner compares its immutable
322
+ attach runtime with the accepted handoff target mirrored in its instance-scoped
323
+ build-log drain authorization. The comparison uses existing boundary facts and
324
+ adds no Store read. A mismatch records `execution.relaunch-requested` and exits
325
+ after normal phase completion, publication settlement and session cleanup.
326
+ Confirmed teardown records the neutral `relaunch` execution outcome; it consumes
327
+ no failure or no-progress allowance. The current repository lease holder
328
+ relaunches from durable state on its own immutable runtime, including after an
329
+ ownership gap. Equal or absent targets preserve normal execution. Remote guests
330
+ re-attach through the provider, which reinstalls the accepted generation’s archive
331
+ before launching the next execution. Deadline suspension applies only to local phases.
332
+
333
+ With rollback-capable launcher and generation peers, three failed successor exits
334
+ within ten minutes of the original durable takeover restore the immediately previous
335
+ cached runtime. The first two failures restart the same runtime without repeating
336
+ preflight. Preflight failures never count; outside that window ordinary failure
337
+ exit behavior applies. Rollback goes back one runtime only. The launcher opens no
338
+ store: it passes a validated, versioned recovery context to the restored generation,
339
+ which records `dispatcher.runtime-rolled-back` under repository authority and holds
340
+ the failed target for that launcher lineage. Store compatibility changes, resolution
341
+ errors and disabling/re-enabling upgrades do not clear this hold. A successfully
342
+ resolved different target records `dispatcher.rollback-hold-cleared`; a fresh operator
343
+ launch starts a new lineage. Both previous and held runtimes remain protected from
344
+ cache pruning. Existing phase executions keep their leases and continue on the
345
+ restored runtime at the next boundary; unreadable decisive facts defer a build with
346
+ attention before any action. Peers without negotiated rollback capability retain
347
+ existing failure behavior and report that capable runtimes are required.
348
+
349
+ The journal records `dispatcher.target-prepared`, `dispatcher.yield-requested`,
350
+ `dispatcher.handoff-started`, `dispatcher.terminal-released`, `dispatcher.takeover`,
351
+ per-execution `dispatcher.drain-settled`, deadline changes and
352
+ `dispatcher.handoff-completed`, plus rollback and hold-clear facts, correlated by predecessor run, successor run,
353
+ launcher lineage, both runtimes and cached target. Legacy handoffs without a
354
+ mode mean cutover. The launcher first binds the runtime-owned journal transport to its persisted
355
+ repository record, so rejected configuration edits cannot redirect readers away
356
+ from the held run. It reads runtime-owned durable projections while generations overlap; it owns no store or operational authority and keeps each
357
+ live runtime reserved. Overlap requires explicit launcher and target capabilities; unsupported
358
+ targets fail safely with manual-restart attention. Operator stop wins and joins
359
+ all live children. Only the presentation owner installs terminal cleanup.
360
+ `[upgrade] automatic = false` disables target preparation; `--once`, origin
361
+ `--repository`, hosted cron and development hot rendering remain direct.
362
+
363
+ Cache publication is atomic after validation. Current, distinct previous,
364
+ explicitly held and live process-use entries survive pruning independently of
365
+ Store leases. Process-start identities distinguish PID reuse; uncertain
366
+ liveness retains code. Each cached Bun entry disables automatic installation
367
+ and pins a cache-owned neutral compiler config before evaluating JavaScript.
368
+ Autobuild compiler chains must remain inside the runtime. Third-party package
369
+ files, including development configs, remain exactly as installed.
370
+
220
371
  - **build-runner** — one operating-system process per build; owns one pipeline
221
372
  execution end to end. The local implementation starts the process beside its
222
373
  Git worktree in its own POSIX session/process group and owns teardown of that
@@ -244,7 +395,7 @@ Small, independently runnable, crash-safe:
244
395
  - **harvest-runner** — one staged repository workflow (`scan → synthesize ⇄
245
396
  review → file`) under a repository lease; not a build and not a phase.
246
397
  - **ingesters** — other outer-loop processes turning signals into proposals (§12).
247
- - **operator** — UI process(es); see §14.
398
+ - **operator UI** — UI process(es); see §14.
248
399
 
249
400
  Ticket-source ready scans run immediately when no completed measurement exists,
250
401
  then every
@@ -292,6 +443,9 @@ One name, used everywhere. Every noun lives in exactly one layer.
292
443
 
293
444
  | Term | Meaning |
294
445
  |---|---|
446
+ | **Operator** | The role driving Autobuild through `ab` or MCP, normally an agent; a human may also drive the interface directly |
447
+ | **Operator agent** | An agent taking the operator role, guided by `ab-operate` |
448
+ | **Human (maintainer)** | The person authorizing work and making human decisions; addressed as “you” in reader-facing prose |
295
449
  | **Signal** | Raw input from the world — a Sentry issue, an observation |
296
450
  | **Proposal** | A synthesized candidate ticket sitting in Triage, awaiting grooming |
297
451
  | **Ticket** | A source record of kind `work` (default) or `node`, optionally targeting a same-source node; ordinary groomed work is dispatchable |
@@ -305,7 +459,7 @@ One name, used everywhere. Every noun lives in exactly one layer.
305
459
  | **Verdict** | Structured terminal outcome: reviews use `approve` \| `revise(findings)` \| `escalate(reason)`; agent verification uses `pass` \| `fail(report)` \| `skip(reason)` |
306
460
  | **Finding** | One structured item inside a `revise` verdict (file refs, description, severity) |
307
461
  | **Observation** | An out-of-scope discovery emitted mid-build: `followup` \| `refactor` \| `latent-bug` |
308
- | **Escalation** | A parked request for human input, answerable from any UI |
462
+ | **Escalation** | A parked request for external judgment from the operator agent or human, answerable from any UI |
309
463
  | **Event** | An append-only log record; everything above leaves one |
310
464
 
311
465
  Reserved-word discipline: **build** names the whole pipeline execution and
@@ -322,7 +476,7 @@ mechanically:
322
476
  | `plan-review` | `/plan-review <build>` | `plan-review.verdict` | `plan-review` (rev N) |
323
477
  | `implement` | `/implement <build>` | `implement.completed` | diff + `implement-notes` |
324
478
  | `code-review` | `/code-review <build>` | `code-review.verdict` | `code-review` (rev N) |
325
- | `verify:e2e` | `/verify-app-e2e <build>` (repository-authored) | `verify.completed {step, outcome}` | `verify-report:e2e` on pass/fail when present |
479
+ | `verify:acceptance` | `/verify-acceptance <build>` (repository-authored) | `verify.completed {step, outcome}` | `verify-report:acceptance` on pass/fail when present |
326
480
  | `finalize` | `/finalize <build>` | `finalize.completed` | PR ref, summary |
327
481
  | `reconcile` | `/reconcile <build>` | `reconcile.started`, `reconcile.prepared`, `reconcile.replayed`, `reconcile.publish-intended`, `reconcile.rewritten`, `reconcile.contended`, `reconcile.completed` | `reconcile-notes` + one replayed change |
328
482
 
@@ -330,8 +484,11 @@ Every phase skill takes **only the build slug**; everything else it needs
330
484
  comes from the store via the `ab` CLI (§8).
331
485
 
332
486
  Canonical skills installed into a repo carry the `ab-` namespace prefix
333
- (§16.3), for example `/ab-plan` and `/ab-code-review`. Repository-authored
334
- extension skills use their own names, such as `/verify-app-e2e`. This spec uses
487
+ (§16.3), for example `/ab-plan` and `/ab-code-review`.
488
+
489
+ An **acceptance check** is a repository-owned agent verify step that runs the built software, exercises each acceptance criterion in the spec, attaches evidence, and returns a typed verdict. Every repository must configure one. It is not a test suite and leaves no test files behind.
490
+
491
+ Repository-authored extension skills use their own names, such as `/verify-acceptance`. This spec uses
335
492
  the bare phase names throughout.
336
493
 
337
494
  ## 5. Pipeline grammar
@@ -445,13 +602,31 @@ output, error, or timeout. Naming failure never prevents build creation. The
445
602
  slug and its `ab/<slug>` branch are recorded once and never renamed.
446
603
 
447
604
  **Immutability:** the spec cannot change during a build except through the
448
- explicit escalation revision protocol. Every downstream reviewer approves
605
+ explicit operator revision protocol (leaf escalation or the node exception below). Every downstream reviewer approves
449
606
  conformance *to it*; a drifting spec silently converts approvals into
450
607
  approvals-of-something-else. A phase discovering the spec itself is wrong
451
608
  raises an `escalation`; a human uses `ab answer --revise-spec` (or
452
- `--revise-spec-from-ticket`), the spec gets rev N+1, and the build restarts
609
+ `--revise-spec-from-ticket`), the spec gets rev N+1, and the leaf restarts
453
610
  from `plan` (cheap — downstream was invalidated anyway).
454
611
 
612
+ Operators may explicitly revise an opened idle collecting node or a node blocked on failed
613
+ integration verification without an escalation. Use
614
+ `ab answer <node> --revise-spec replacement.md` or, after amending its ticket,
615
+ `ab answer <node> --revise-spec-from-ticket`. Ticket edits alone do not revise
616
+ the build. Both forms enforce the same spec standard as leaf revisions.
617
+ Each kernel `spec.revised` records the exact artifact and operator identity
618
+ (with optional transport provenance); earlier revisions remain readable.
619
+ Ticket-origin revisions re-pin assets; supplied bodies preserve asset pins.
620
+ The node recollects and verifies the new revision, including on the same head
621
+ and parent after a failed cycle. Earlier cycles remain historical evidence
622
+ and cannot block or authorize landing under the replacement. Children keep
623
+ their specs, claims and targets; contributions are not restarted.
624
+ Active verification/reconcile or writer work, restack/reparent work, pause,
625
+ pending controls, landing intent and ended PRs refuse the no-escalation path.
626
+ A concurrent state change refuses publication with a retry explanation;
627
+ uncited artifacts are inert. Leaves still require an open escalation and
628
+ restart from `plan`.
629
+
455
630
  **Ticket assets are frozen with the spec.** Claiming a ticket pins the
456
631
  ticket's current assets (§7.1.3) into the build the same way the spec becomes
457
632
  revision 0: `build.created.assets` lists exactly which `(kind, name, revision)`
@@ -510,10 +685,10 @@ ticket_assets repo, ticket_id, kind, name, revision, layout, manifest (JSON), si
510
685
  #### 7.1.1 Operator sessions (the third resource kind)
511
686
 
512
687
  An operator session is durable orchestrator-conversation state — a record keyed
513
- by repository and operator, hosted-only. It is neither a build nor a
688
+ by repository and session owner (the human account stored in `operator`), hosted-only. It is neither a build nor a
514
689
  repository fact: folding it into the build streams would leak conversation
515
690
  facts into the build reducer, and folding it into the repository journal would
516
- mix one operator's chat with dispatcher and harvest history that every process
691
+ mix one session owner's chat with dispatcher and harvest history that every process
517
692
  reads. The store's data model therefore gains a third resource family with the
518
693
  same shape as the other two:
519
694
 
@@ -564,7 +739,7 @@ stream read's ([docs/remote-store-protocol.md](docs/remote-store-protocol.md),
564
739
 
565
740
  #### 7.1.2 The embedded orchestrator (turns)
566
741
 
567
- The orchestrator is a role, not a deployment: the agent that files tickets,
742
+ The operator agent is the agent that files tickets,
568
743
  watches builds, unblocks them, and discusses direction. Any agent can take it
569
744
  on — a coding-agent session at the repository root using the `ab` CLI or
570
745
  `ab mcp` needs no initialization — and the canonical `ab-operate` skill is its
@@ -576,8 +751,8 @@ exists). Posting a message to a session of an enabled repository starts a
576
751
  turn in the same invocation: an AI SDK tool-loop agent, running with the
577
752
  registry bound in process, reads the conversation from the session's durable
578
753
  state, streams its output as protocol parts onto the turn's session-scoped
579
- stream (§7.6), calls tools with the operator's attributed identity — the
580
- session operator as the human actor, `via: {kind: "session", id}` —
754
+ stream (§7.6), calls tools with the session owner’s attributed identity — the
755
+ authorizing human account as the `human` actor, `via: {kind: "session", id}` —
581
756
  checkpoints as it goes, and completes or suspends.
582
757
 
583
758
  **Turn lifecycle.** `turn.started` (naming a new session-scoped stream and
@@ -640,7 +815,7 @@ turn (`turn.failed`, kind `internal`) after 15 minutes of stream silence,
640
815
  closing the stream `aborted` and leaving the session `idle`. The reaper never
641
816
  touches suspended or awaiting-approval sessions — a turn suspended for
642
817
  approval is precisely an open stream that goes quiet for however long the
643
- operator takes.
818
+ human takes.
644
819
 
645
820
  **Typed failures.** Model failures are typed on `turn.failed`:
646
821
  `provider-unavailable`, `exhausted`, `credentials`, `configuration` (plus
@@ -656,7 +831,7 @@ registry, and calls no model), and in origin mode it returns immediately
656
831
  unless the effective config enables the orchestrator. The system prompt is
657
832
  the canonical `ab-operate` skill shipped in `skills/operate/` — self-contained
658
833
  per the vendored-skill rule, teaching the tool surface, the attention set,
659
- and when to escalate to the operator rather than act — plus the current
834
+ and when to escalate to the human rather than act — plus the current
660
835
  `operator-notes` artifact, the session's wake settings, and the session's
661
836
  repository identity. The model never supplies a repository argument: the
662
837
  tools' model-facing schemas strip `repo`, and the runner injects the
@@ -813,9 +988,12 @@ per-build scan paid only when a gate actually trips and a scan packet is built.
813
988
 
814
989
  Stateless repository-level readers also have a bounded journal read,
815
990
  `getRepoStateEvents(repo)` (AUT-489): every durable, slow-growing event type
816
- (all harvest facts, operator-sandbox facts, and the three dispatcher setting
991
+ (all harvest facts, operator-sandbox facts, cross-generation handoff correlation
992
+ facts including preparation, request, failure, start, release, takeover, deadline,
993
+ settlement and completion, and the three dispatcher setting
817
994
  types) plus, when the journal has one, the tail from the latest
818
- `dispatcher.run-started`. Reducing this subset with the state readers yields
995
+ `dispatcher.run-started`. The run-scoped `dispatcher.runtime-recorded` companion
996
+ is retained in this same bounded tail. Reducing this subset with the state readers yields
819
997
  exactly what a full replay yields, so the cost of reading repository state no
820
998
  longer grows with the number of past dispatcher invocations. The journal
821
999
  itself stays append-only: full replay remains the normative truth, and
@@ -880,7 +1058,7 @@ The base-selection invariants make this safe with Git:
880
1058
  - **The base is chosen once, at first branch creation**, from the freshly
881
1059
  fetched origin tip of the configured base branch (fetched into a
882
1060
  build-scoped internal ref so concurrent dispatches cannot clobber each
883
- other or the operator's refs). If the remote is unavailable, creation falls
1061
+ other or the user's refs). If the remote is unavailable, creation falls
884
1062
  back to the local base and records the diagnostic.
885
1063
  - **Re-provisioning resumes; eligible restacks rewrite.** Provisioning alone
886
1064
  resumes the published branch. The kernel collapses and restacks at verify
@@ -1149,7 +1327,7 @@ Delegated grants have no fixed wall-clock expiry. The service checks signed
1149
1327
  bindings against authoritative durable lifecycle facts on every request and
1150
1328
  fails closed if those reads fail. Active, paused and escalated builds may outlive
1151
1329
  a dispatcher restart or a week-long parent credential. Build termination,
1152
- harvest execution/run termination, or the phase's own session end retires the
1330
+ harvest execution/run termination, or the phase's own session end or suspension retires the
1153
1331
  corresponding grant after a 60-second evidence grace window. A durable ending
1154
1332
  permanently closes that grant; recovered harvest executions use fresh durable
1155
1333
  authorizations and fresh grants. Project removal denies all its grants immediately.
@@ -1217,6 +1395,8 @@ A phase-scoped hydration into the gitignored scratch dir:
1217
1395
  context.json # manifest: build, phase, round, artifact revs,
1218
1396
  # required deposits, allowed terminal commands
1219
1397
  spec.md
1398
+ node-verification.json # node verify: exhaustive commit provenance index
1399
+ contributions/ # node verify: <build>/spec.md
1220
1400
  plan.md # per phase needs (see table)
1221
1401
  findings.json # current feedback, when round > 1
1222
1402
  history/ # prior-round artifacts where the phase needs them
@@ -1241,10 +1421,36 @@ terminals:
1241
1421
  | `plan-review` | spec, plan@latest, all prior rounds' findings (for `persists` marking) | `verdict` (requires notes artifact) |
1242
1422
  | `implement` | spec, approved plan, feedback (findings **or** verify report), own prior notes | `done` (requires clean worktree + notes) |
1243
1423
  | `code-review` | spec, plan, commit range `{base, head}`, prior findings, implement-notes | `verdict` |
1244
- | `verify:<step>` (agent) | spec (acceptance criteria), step config, commit range | `verdict pass` \| `verdict fail --report` \| `verdict skip --reason` |
1424
+ | `verify:<step>` (agent) | spec (acceptance criteria), step config, commit range; node contribution specs and provenance | `verdict pass` \| `verdict fail --report` \| `verdict skip --reason` |
1245
1425
  | `finalize` | spec, plan, verify reports, PR template config | `done` (requires `pr-description` artifact) |
1246
1426
  | `reconcile` | spec, plan, implement-notes, conflict `{baseSha}` and kernel-prepared replay transaction | `done` (requires one replayed commit on the frozen base) |
1247
1427
 
1428
+ In node `verify:*` context, `nodeVerification` in the manifest identifies the frozen
1429
+ `range`, `indexPath`, `contributions`, `handPushedCommits` and `unattributedCommits`. Each contribution
1430
+ has `build`, its current stored `ticket` identity, `spec: {kind: 'spec', rev}`,
1431
+ `specPath` and `commits`. The JSON index repeats this metadata and adds the
1432
+ exhaustive ordered `commits: [{sha, build?}]` mapping. Paths are workspace-relative
1433
+ and reflect scratch allocation, including legacy tracked-file collisions.
1434
+ Contribution specs normally live at `.ab/contributions/<build>/spec.md`; the index
1435
+ normally lives at `.ab/node-verification.json`. These files are marked `derived`
1436
+ in `materialized`, with their source build and revision recorded in the metadata.
1437
+
1438
+ Membership comes from build identity trailers on every commit reachable in the
1439
+ frozen parent-to-head range, including earlier cycles and merge side history.
1440
+ Specs use the current event-authorized revision, never an unsanctioned latest
1441
+ deposit or mutable ticket body. Unknown identities, ambiguous or invalid trailers,
1442
+ and missing source data fail hydration. Commits without a build trailer are
1443
+ listed as unattributed, a mechanical absence of a trailer rather than an authorization verdict.
1444
+ `handPushedCommits: [{sha, originalSha, message}]` identifies node-owned hand-pushed
1445
+ commits in the frozen range. Ownership uses the durable first-parent contribution
1446
+ boundary; inherited and merge-side history are not automatically owned. Confirmed
1447
+ rewrite aliases preserve original identity, and `message` is the full commit message.
1448
+ These messages express maintainer-authorized intent: judge quality and consistency;
1449
+ never fail these commits solely for lacking a covering spec.
1450
+ Other node changes are authorized when the node spec or the spec of the contribution
1451
+ that introduced it covers it; use the commit mapping to find that spec.
1452
+ Leaf verification context is unchanged.
1453
+
1248
1454
  Scoping is deliberate: the planner never sees code-review rounds; the
1249
1455
  reviewer sees prior findings but not the producer's session. What a phase
1250
1456
  *can't* see is part of its design.
@@ -1534,8 +1740,10 @@ SIGINT/SIGTERM. A conditional artifact deposit records `session.suspended`
1534
1740
  with cause `shutdown`, the native handle, active milliseconds, partial transcript
1535
1741
  and any known incremental usage. A terminal fact that lands first prevents
1536
1742
  suspension; suspension fences the old session's terminal credentials permanently.
1537
- The process supervisor retains its existing bounded force-stop path if provider
1538
- cleanup or persistence cannot complete.
1743
+ Graceful shutdown waits for provider cleanup and durable suspension without a
1744
+ wall-clock force-exit deadline. Only after the runner leader exits does bounded
1745
+ process-group cleanup reap remaining descendants. Abnormal parent loss retains
1746
+ the detached reaper recovery path.
1539
1747
 
1540
1748
  On attachment the runner retains an eligible current phase/round session and
1541
1749
  records takeover. Matching host, workspace and runtime permit native resume;
@@ -1611,11 +1819,11 @@ deterministic fail-safe.
1611
1819
  their *logical step name*; core phases select `[roles.<phase>]`.
1612
1820
 
1613
1821
  ```toml
1614
- [verify.e2e]
1822
+ [verify.acceptance]
1615
1823
  kind = "agent"
1616
- skill = "verify-app-e2e" # repository-authored skill
1824
+ skill = "verify-acceptance" # repository-authored skill
1617
1825
 
1618
- [roles.e2e] # the STEP name — not "verify-app-e2e"
1826
+ [roles.acceptance] # the STEP name — not "verify-acceptance"
1619
1827
  runtime = "pi"
1620
1828
  ```
1621
1829
 
@@ -1799,14 +2007,16 @@ body file changes the spec only.
1799
2007
 
1800
2008
  Only an operator answering an open `review-round-limit` policy escalation may
1801
2009
  set `escalation.answered.reviewRoundCeiling`. The same event both clears the
1802
- human gate and replaces the cap; no standalone or pre-emptive form exists. A
2010
+ external judgment gate and replaces the cap; no standalone or pre-emptive form exists. A
1803
2011
  ceiling cannot accompany a spec revision because `spec.revised` resets both
1804
2012
  loops to the configured default. The value is attached only to the matching
1805
2013
  review-limit answer, so unrelated blockers answered in the same command do not
1806
- acquire it and agents cannot widen their own build's loop.
2014
+ acquire it and build-phase agents cannot widen their own build's loop.
1807
2015
 
1808
- Every open escalation remains a human judgment gate until an operator answers
1809
- it. This includes all policy and setup causes. Starting either `ab dispatch` or
2016
+ Every open escalation remains an external judgment gate until an operator answers
2017
+ it. The answer may come from the operator agent or a human; build-phase agents
2018
+ cannot answer their own escalations. This includes all policy and setup causes;
2019
+ human authorization requirements still apply. Starting either `ab dispatch` or
1810
2020
  `ab dispatch --once` never appends `escalation.answered` and never re-arms a
1811
2021
  budget. Startup still recovers every actionable current build and delivers
1812
2022
  pending operator commands, whose decisions take precedence over a blocked wait;
@@ -2282,7 +2492,7 @@ displays is a reduction of the logs, and anything it does is an event — so
2282
2492
  every frontend (terminal today, web later) is the same adapter pattern
2283
2493
  against the same store, and a dead runner still receives commands on resume.
2284
2494
 
2285
- Interactive `ab dispatch` owns the terminal in a frontend process and supervises
2495
+ Within the immutable generation, interactive `ab dispatch` owns the terminal in a frontend process and supervises
2286
2496
  one private child containing the dispatcher, build runners, Harvest, config and
2287
2497
  plugin loading, and every ticket/forge/workspace/runtime adapter. The frontend
2288
2498
  has no handle on those adapters: it reads build and repository streams plus
@@ -2312,9 +2522,10 @@ child is terminated unless such a tick is open, in which case that tick first
2312
2522
  reaches a recoverable durable boundary. The run-stopped fact and frontend result
2313
2523
  distinguish a graceful drain, an actual forced termination requested by the
2314
2524
  operator, and an unsolicited abnormal exit, retaining available exit-code,
2315
- signal, and error evidence. `--plain`, non-TTY,
2316
- and `--once` kernel semantics remain the line-oriented/direct compatibility
2317
- path; `--once` still performs one tick and drains its in-flight work.
2525
+ signal, and error evidence. Resident `--plain` and non-TTY generations run
2526
+ the line-oriented kernel directly. `--once` bypasses the launcher, performs
2527
+ one tick and drains its in-flight work. The launcher forwards stop signals and
2528
+ waits for the generation to drain before returning.
2318
2529
 
2319
2530
  Interactive watch presentation enables xterm focus reporting (mode 1004) only
2320
2531
  while it owns terminal input. Local-store reads keep the same cadence regardless
@@ -2360,17 +2571,17 @@ live in the build log. Landing policy is declarative dispatcher configuration
2360
2571
  (§15.7); there is no writable repository auto-merge default.
2361
2572
 
2362
2573
  The **operator sandbox** is the third execution kind beside build and harvest
2363
- executions: a persistent, credential-free, per-operator-per-repository
2574
+ executions: a persistent, credential-free, per-session-owner-per-repository
2364
2575
  environment behind registry tools (`sandbox.*`, AUT-340), provisioned like a
2365
2576
  build workspace and exposed to operator agents only through those tools. The
2366
2577
  typed tools are the only route to state from inside it — the environment
2367
2578
  receives no store, forge, ticket-provider, or model credential, and
2368
2579
  `[orchestrator].sandbox.environmentVariables` may never name one. Its lifecycle
2369
2580
  is repository-journal fact: provisioned/resumed/activity/stopped/released facts
2370
- bracket one deterministic environment per operator × repository, the
2581
+ bracket one deterministic environment per session owner × repository, the
2371
2582
  dispatcher tick's idle settlement stops an environment whose evidence is
2372
2583
  stale (settling an orphan exactly as harvest executions are settled), and
2373
- `ab repository status` reports each operator's sandbox. An operator's work
2584
+ `ab repository status` reports each session owner's sandbox. A session owner's work
2374
2585
  leaves the sandbox only through `sandbox.publish`, which takes the checkout's
2375
2586
  head (or an explicit commit) to a deterministic operator branch and a pull
2376
2587
  request against the base branch and records published/publish-failed journal
@@ -2394,12 +2605,19 @@ stands in for tick completion. Telemetry survives lease release. Safe shutdown
2394
2605
  uses the matching run's open observation, historical journal boundaries when
2395
2606
  absent, and refuses forced termination when the observation cannot be read.
2396
2607
 
2608
+ Both dashboards show each accepted unfinished generation handoff, naming its source
2609
+ and target runtimes (version and abbreviated commit), mode and drain deadline
2610
+ (`unknown` for missing historical facts). A drain-mode outstanding execution
2611
+ adds `(draining)` to its build without replacing lifecycle status. Matching
2612
+ settlement clears the marker; accepted completion clears the banner. Takeover,
2613
+ an expired deadline and an empty outstanding set do not clear the banner.
2614
+
2397
2615
  The operator's job across many concurrent builds: see status at a glance,
2398
2616
  act on a selected build, find blocked builds, answer escalations, and inspect
2399
2617
  any build's trail. Each dashboard build row spends its header on identity and
2400
2618
  lifecycle status, with the pipeline and its per-step elapsed values below it;
2401
2619
  controls and diagnostic lines expose actions, pending dispatch, abort cleanup,
2402
- setup failures, and blockers. Dashboard rows derive from build events and
2620
+ setup failures, and blockers. Dashboard rows derive from build and repository events and
2403
2621
  effective configuration only, so heartbeat or lease renewal without an event
2404
2622
  does not alter them. Every nonterminal build, including `queued`, has a
2405
2623
  dashboard row; a pre-run row names its pending dispatch boundary or latest
@@ -2452,9 +2670,9 @@ validated by the separate repository catalog so build reducers cannot
2452
2670
  accidentally interpret repository state.
2453
2671
 
2454
2672
  A human actor may carry an optional `via` marker for delegated writes —
2455
- `{kind: "session", id}` (the operator's orchestrator session) or
2673
+ `{kind: "session", id}` (the human account's operator-agent session) or
2456
2674
  `{kind: "mcp", client}` (an MCP client) — so a team's audit trail can
2457
- distinguish "the operator did this" from "the operator's orchestrator session
2675
+ distinguish "the human did this" from "the human’s delegated session
2458
2676
  did this" or "an MCP client did this" forever. `via` is valid only on human
2459
2677
  actors and only on build and repository events (session events are the
2460
2678
  delegate's own log); validation rejects it anywhere else. The hosted service
@@ -2474,7 +2692,7 @@ rejection is `EventValidationError`.
2474
2692
 
2475
2693
  1. **Closed vocabularies live in type names; open ones live in payloads.**
2476
2694
  Phases are a closed set → `plan.completed`. Verify and finalize steps are
2477
- config-defined (open) → `verify.completed {step: "e2e"}`.
2695
+ config-defined (open) → `verify.completed {step: "acceptance"}`.
2478
2696
  2. **Events carry facts, never derived state.** Build status is a reduction
2479
2697
  (§15.5); no event ever says "status is now X".
2480
2698
  3. **Blobs live in artifacts; events carry refs** `{kind, rev}`.
@@ -2493,7 +2711,7 @@ rejection is `EventValidationError`.
2493
2711
  5. **Append-only; corrections are new events.**
2494
2712
  6. **Liveness is not history.** Heartbeats and runner leases are mutable
2495
2713
  columns on the `builds` table, never events — they would drown the log.
2496
- 7. **[D2] Operator commands are events in the same log.** Humans append
2714
+ 7. **[D2] Operator commands are events in the same log.** Operators (agents or humans) append
2497
2715
  `*-requested`/`*-cancelled` events (including queued-only discard), `escalation.answered`, and dispatcher
2498
2716
  setting facts; kernel or dispatcher plumbing acknowledges effects that
2499
2717
  require a boundary. The store is the *only* coordination surface — no side
@@ -2516,13 +2734,14 @@ with illustrative members:
2516
2734
 
2517
2735
  | Family | Examples |
2518
2736
  |---|---|
2519
- | Build lifecycle | `build.created` (carrying `assets`, the claim-time pin, §6.3), `workspace.provisioned`, `workspace.released`, `execution.started`, `execution.ended`, `infrastructure.failed`, `infrastructure.cleanup-attempted`, `dispatch.comment-posted`, `dispatch.failed`, `runner.attached`, `runner.setup-failed`, `abort.remote-branch-deleted`, `abort.local-branch-deleted`, `abort.ticket-returned`, `build.completed` |
2737
+ | Build lifecycle | `build.created` (carrying `assets`, the claim-time pin, §6.3), `workspace.provisioned`, `workspace.released`, `execution.started`, `execution.ended`, `infrastructure.failed`, `infrastructure.cleanup-attempted`, `dispatch.comment-posted`, `dispatch.failed`, `runner.attached`, `runner.runtime-recorded`, `runner.setup-failed`, `abort.remote-branch-deleted`, `abort.local-branch-deleted`, `abort.ticket-returned`, `build.completed` |
2520
2738
  | Operator commands [D2] | `build.pause-requested` → `build.paused`; `build.discard-requested`; `build.hold-requested`; `build.land-requested` → `landing.command-acknowledged`; `escalation.answered` (optionally carrying a validated `reviewRoundCeiling`, or the `assets` sampled with a revise-from-ticket authorization) |
2521
2739
  | Landing policy | `landing.decided` (candidate, matched rule/default, labels, target, mode); `landing.native-enable-started`; `landing.native-applied` |
2522
- | Spec | `spec.imported`, `spec.authored`, `spec.revised` (optionally carrying `assets`, a re-pin of the ticket's assets, §6.3) |
2740
+ | Spec | `spec.imported`, `spec.authored`, `spec.revised` (either positive `escalation` sequence or exclusive `operator: {user, via?}` provenance for an idle node; optionally carrying `assets`, a re-pin of the ticket's assets, §6.3) |
2523
2741
  | Sessions | `session.started` (including optional write-ahead continuation intent and budget ceiling); `session.suspended` with partial transcript and active duration; `session.resumed` acceptance (stale reports are inert); reasoned `session.resume-fallback`; kernel-only `session.native-handle-recorded` with bracket and native execution identity; `session.ended` with transcript ref and usage (ordinary completion — the analysis corpus), or `session.ended {outcome: reclaimed, reclaimedBy: {instance, resumedFromSeq}}` (explicit transcriptless takeover) |
2524
2742
  | Plan/code loops | `plan.started` … `plan-review.verdict`; `implement.started` … `code-review.verdict` |
2525
2743
  | Verify/finalize | `verify.started {step, attempt, feedback?, baseSha?, headSha?, restackId?}`, `verify.completed {step, outcome, skipCause?, baseSha?, headSha?, restackId?}`, `verify.reconcile-policy-captured {reconcileSeq, steps}`, `finalize.completed {pr}`, `finalize.step-started {step}`, `finalize.step-completed {step, ok, headSha?}` |
2744
+ | Integration attention | Kernel/dispatcher `integration.verification-failed {id, head, parent, steps, guidance}`: one durable failed-cycle notification, recovered from exact verification receipts |
2526
2745
  | PR summary | Kernel-authored `pr-summary.requested {occurrence, boundary}`, `pr-summary.attempted {occurrence, boundary, pr}`, `pr-summary.result {attempt, outcome, eligibleAfter?}`, `pr-summary.settled {request, disposition}`; sequence identities correlate durable starts, completed boundaries, attempts, and handoffs (§7.5) |
2527
2746
  | PR attachments | `pr-attachment.designated`, `pr-attachment.hosted`, `pr-attachment.reclaimed`, `pr-attachment.reclaim-failed` |
2528
2747
  | Leaf restacking | `target.moved {branch, sha}`, `restack.prepared`, `restack.replayed`, `restack.publish-intended`, `restack.rewritten`, `restack.contended`, `restack.completed` |
@@ -2589,7 +2808,12 @@ routing, integration and landing/publication decisions for that build only;
2589
2808
  read-only status/context/dashboard reads retain the lifecycle status. The
2590
2809
  kernel or dispatcher records advisory `build.compatibility-deferred` with the
2591
2810
  decisive boundary, types, versions and diagnostic, deduplicated per boundary.
2592
- Default `ab watch` attention includes it. Diagnostics request a build that
2811
+ Default `ab watch` attention includes it. An unsettled dispatcher-written
2812
+ `execution.drain-authorized` in the build's own log suppresses that attention
2813
+ only for the matching execution instance and predecessor runtime during an
2814
+ accepted draining handoff. The decisive-fact fence and exit-for-relaunch remain.
2815
+ `execution.ended` or matching `execution.drain-settled` settles authorization;
2816
+ a later unrelated execution never inherits it. Diagnostics request a build that
2593
2817
  understands the unsupported types and name the writer releases, even when
2594
2818
  writer and reader share a release string. Upgrading clears deferral through
2595
2819
  local replay without answering an escalation. Repository unknown counts do
@@ -2697,7 +2921,7 @@ plan-review.started{r1} → plan-review.verdict{approve}
2697
2921
  implement.started{r1} → implement.completed{commits, notes@1}
2698
2922
  code-review.started{r1} → code-review.verdict{approve}
2699
2923
  verify.started{types} → verify.completed{outcome:pass} → …unit
2700
- verify.started{e2e} → pr-attachment.designated{artifact,filename,mediaType} → verify.completed{outcome:pass}
2924
+ verify.started{acceptance} → pr-attachment.designated{artifact,filename,mediaType} → verify.completed{outcome:pass}
2701
2925
  finalize.started → pr-attachment.hosted{designationSeq,asset} → finalize.completed{pr} → finalize.step-completed{release-notes}
2702
2926
  (later, janitor:) pr.merged → workspace.released → build.completed{merged} → pr-attachment.reclaimed{hostedSeq}
2703
2927
  ```
@@ -2724,7 +2948,7 @@ any unexpired execution lease, then releases a partial workspace and stale
2724
2948
  lease, returns the ticket to Ready, and appends `build.completed {outcome:
2725
2949
  discarded}` last. No runner is required.
2726
2950
 
2727
- **A — verify failure:** `verify.completed {step: e2e, outcome: fail,
2951
+ **A — verify failure:** `verify.completed {step: acceptance, outcome: fail,
2728
2952
  report}` → kernel routes back into the code loop: `implement.started
2729
2953
  {round: 2, feedback: {verify: {step, report}}}` → fix → `code-review` round
2730
2954
  2 → approve → verify re-runs **from the first step** (implement changed the
@@ -2763,6 +2987,42 @@ answer appended after delivery is a new eligible winner. Destinations remain
2763
2987
  independent, and the kernel derives both the winner and its delivery from the
2764
2988
  event history so replay and restart preserve the result.
2765
2989
 
2990
+ Automatic upgrade repository facts are run- and launcher-lineage-correlated.
2991
+ `dispatcher.upgrade-detected` is advisory; preparation, yield, acceptance,
2992
+ terminal release, takeover, drain settlement/deadline, completion and upgrade
2993
+ failure, `dispatcher.runtime-rolled-back` and `dispatcher.rollback-hold-cleared`
2994
+ are decisive. Rollback is immediate repository attention naming failed and restored
2995
+ runtimes. A run-start fact may carry its launcher lineage for effective-hold
2996
+ projection; historical rollback remains visible after a hold clears or lineage changes.
2997
+ Start and completion retain runtime/target provenance;
2998
+ retirement completion is distinct from takeover. Failure is immediate repository
2999
+ attention. A launcher consumes only its exact lineage/run's pending target and
3000
+ never an operator-stopped run. See §3.3 for the draining protocol.
3001
+
3002
+ Every dispatcher run start is immediately followed by an advisory
3003
+ `dispatcher.runtime-recorded {run, startedSeq, runtime}` fact. Every successful
3004
+ runner attach is immediately followed by advisory
3005
+ `runner.runtime-recorded {instance, attachedSeq, runtime}` before dispatch work
3006
+ or phases begin. Persistence failure prevents that work. Existing lifecycle
3007
+ facts remain decisive; older readers skip the advisory companions without
3008
+ compatibility deferral. Interrupted pairs and historical logs remain readable
3009
+ with runtime null in JSON and `runtime unrecorded` in human detail.
3010
+
3011
+ The runtime is captured once per executing process from its own distribution,
3012
+ never the consuming repository or dispatcher on behalf of a runner. It includes
3013
+ `version`, `commit` (a Git object id or explicit `unknown`), and
3014
+ `source: {kind: source | package, location}` with an absolute distribution root
3015
+ (realpath when available). A source distribution owns its Git top level,
3016
+ including worktrees; nested package installs cannot inherit a consumer's HEAD.
3017
+ Packages use valid manifest `gitHead` when available. Missing diagnostic metadata
3018
+ never prevents startup. Capture survives later checkout movement.
3019
+
3020
+ Repository status reports the authoritative lease holder's runtime independently
3021
+ of the newest invocation. Build detail reports chronological runner attaches;
3022
+ each phase is attributable to the preceding attach boundary. Companions correlate
3023
+ by exact start/attach sequence and run/instance, never by proximity or instance
3024
+ alone. Writer-version stamping and runtime selection are unchanged.
3025
+
2766
3026
  **C — setup failure:** the first attach retains the normal `runner.attached`
2767
3027
  fact, then a failed setup appends `runner.setup-failed
2768
3028
  {command,attempt,exitStatus,output}` and starts no phase or session. A retry runs
@@ -2843,8 +3103,10 @@ build-owned Store state. The kernel claims each execution's durable lease before
2843
3103
  launch and releases that exact holder only after completion; the child renews it.
2844
3104
  The lease remains the cross-process recovery and workspace-teardown gate (the
2845
3105
  in-memory guard is deliberately not durable: a dead process's memory disappears
2846
- with it). Ordinary dispatcher shutdown gracefully signals each local process
2847
- group, escalates the whole group after the bounded stop delay, and reaps it.
3106
+ with it). Ordinary dispatcher shutdown gracefully signals each local runner leader and
3107
+ waits for it to finish suspension and exit. It then reaps remaining descendants
3108
+ with bounded TERM-then-KILL process-group cleanup. The frontend waits for kernel
3109
+ teardown without a wall-clock force-kill deadline.
2848
3110
  Before every build-child terminal path exits — natural success or failure,
2849
3111
  SIGINT/SIGTERM, or immutable-parent watchdog death — it launches one detached
2850
3112
  group reaper while the leader still pins the group's identity. That owner
@@ -3210,6 +3472,9 @@ ticketScanIntervalSeconds = 60 # positive integer; ready scans, with tick spaci
3210
3472
  forge = "github" # builtin: github | local-git; or a plugin name
3211
3473
  plugins = ["./plugins/local.ts", "@acme/autobuild-plugin"]
3212
3474
 
3475
+ [upgrade]
3476
+ automatic = true # immediate/60-second target checks; false requires manual restart
3477
+
3213
3478
  #[workspace] # optional; default provider = "git-worktree"
3214
3479
  #provider = "vercel-sandbox" # shipped remote provider, or plugin name
3215
3480
  #[workspace.config]
@@ -3231,16 +3496,16 @@ test = "bun run test"
3231
3496
  publish = "bun run publish"
3232
3497
 
3233
3498
  [verify]
3234
- steps = ["types", "unit", "e2e"]
3499
+ steps = ["types", "unit", "acceptance"]
3235
3500
  [verify.types]
3236
3501
  kind = "check" # deterministic: command + pass/fail
3237
3502
  command = "typecheck" # ref into [commands]
3238
3503
  [verify.unit]
3239
3504
  kind = "check"
3240
3505
  command = "test"
3241
- [verify.e2e]
3506
+ [verify.acceptance]
3242
3507
  kind = "agent" # agent-verify: skill + pass|fail|skip verdict
3243
- skill = "verify-app-e2e" # repository-authored agent verifier
3508
+ skill = "verify-acceptance" # repository-authored agent verifier
3244
3509
  paths = ["web/**"] # optional changed-path applicability
3245
3510
 
3246
3511
  [finalize]
@@ -3261,6 +3526,7 @@ model = "moonshotai/kimi-k3"
3261
3526
  sessionBudgetSeconds = 7200 # optional role override
3262
3527
 
3263
3528
  [policy]
3529
+ upgradeDrainSeconds = 900 # local generation drain deadline, hot-reloaded
3264
3530
  sessionBudgetSeconds = 3600 # non-infinite default for build agent sessions
3265
3531
  stallRounds = 3
3266
3532
  maxVerifyAttempts = 3
@@ -3315,7 +3581,7 @@ decide where a build's effective configuration is composed from:
3315
3581
  |---|---|---|
3316
3582
  | Build-owned (pinned) | `[verify]` and `[verify.<step>]`, `[finalize]` and `[finalize.<step>]`, `[commands]`, `[workspace]` (provider and config, including `provisioning` and `runtimeProvisioning`) | The build's own branch: its branch head once it has published commits, otherwise the recorded base commit its workspace was cut from. The exact commit is recorded once per deposit in the effective-config artifact metadata — except in checkout mode when the worktree read cannot be attributed to the branch-head commit: because the worktree file has uncommitted edits, because the clean/dirty comparison could not be performed (non-git workspace or a transient git error), or because the branch head never carried the file. The deposit then records the source `worktree-dirty` and no commit, because no commit claims the worktree bytes (the build still runs them). |
3317
3583
  | Deployment-owned (live) | `[roles]` (runtime, model, args, alternates, per-role `sessionBudgetSeconds`) and `[policy]` (budgets, retry bounds, stall and harvest knobs) | The dispatcher's live snapshot; an accepted reload delivers these to active builds. |
3318
- | Dispatcher-owned | `baseBranch`, `capacity`, `ticketScanIntervalSeconds`, `forge`, `plugins`, `pr`, `tickets`, `orchestrator`, `landing` | The dispatcher's live snapshot; the build runner never interprets them. |
3584
+ | Dispatcher-owned | `baseBranch`, `capacity`, `ticketScanIntervalSeconds`, `forge`, `plugins`, `pr`, `tickets`, `orchestrator`, `landing`, `upgrade` | The dispatcher's live snapshot; the build runner never interprets them. |
3319
3585
 
3320
3586
  A build's pipeline definition is therefore composed from the build's own
3321
3587
  branch: in origin mode the dispatcher reads `autobuild.toml` at the build's
@@ -3385,8 +3651,8 @@ is not re-verified, so breakage that only exists in the combination can land.
3385
3651
  This project ships 11 canonical default skills for the fixed phases, the
3386
3652
  non-phase surfaces (`spec`, `tickets`, and `guide`), and the outer-loop skills.
3387
3653
  Repository setup guidance ships as `guide/references/setup.md`, not as a skill;
3388
- agent verifier skills are authored by each repository when needed. `ab init`
3389
- installs into a repo:
3654
+ each repository authors its own acceptance-check skill. No generic verifier
3655
+ skill ships. `ab init` installs into a repo:
3390
3656
 
3391
3657
  - **A stack-neutral `autobuild.toml` skeleton**, rendered only when absent. It
3392
3658
  declares no setup command or verify step and inspects no language or package
@@ -3413,7 +3679,8 @@ installs into a repo:
3413
3679
  point: this repo's code-review standards and setup reference live in the
3414
3680
  vendored trees. Harness-specific discovery paths are symlinks to the one
3415
3681
  canonical editable copy. Setup directs the repository to author and configure
3416
- its own agent verifier when judgment-driven end-to-end coverage is warranted.
3682
+ an acceptance-check skill selected from an agent verify step in every repository.
3683
+ Wire an existing maintained end-to-end or browser test suite into an ordinary `check` step. If none exists, do not create one during setup. The acceptance check neither substitutes for nor seeds a suite.
3417
3684
  - **Model-invocation discipline.** Phase skills are installed
3418
3685
  non-agent-invocable: they are invoked explicitly by the runner or a human,
3419
3686
  never auto-triggered by a model pattern-matching a description — a model
@@ -3488,7 +3755,7 @@ written. A replacement child marked as a handoff but missing that pre-update
3488
3755
  baseline — as when an older parent launches a newer child without the newer
3489
3756
  context — suppresses the entire automatic commit, names the cross-version
3490
3757
  compatibility reason, and leaves all upgrade-owned changes uncommitted for the
3491
- operator. The skill-upgrade results and merge-derived exit status are unchanged.
3758
+ human. The skill-upgrade results and merge-derived exit status are unchanged.
3492
3759
  Any content conflict, Claude discovery conflict, pre-existing dirt in an owned
3493
3760
  path, non-Git target, changed HEAD/worktree identity, or in-progress merge,
3494
3761
  rebase, or cherry-pick likewise suppresses the whole commit and prints the
@@ -3674,7 +3941,7 @@ current decision is required; auto-authorized and consented candidates are absen
3674
3941
  Source `ab ticket tree` / `tickets.tree` enumerate all ticket states with listing
3675
3942
  diagnostics; effective build targets remain frozen independently of source metadata.
3676
3943
 
3677
- Default watch attention includes `integration.landed`, `node.item-conflicted`,
3944
+ Default watch attention includes `integration.verification-failed`, `integration.landed`, `node.item-conflicted`,
3678
3945
  and conflicted `restack.replayed`. Derived `build.consent-ready` observations
3679
3946
  carry target, branch, candidate and the durable readiness entry position in the
3680
3947
  existing cursor envelope. Cursor identities retain readiness episodes across
@@ -3714,3 +3981,42 @@ unavailable for uninstrumented adapters. Attribution retains at most ten builds
3714
3981
  ordered by descending count then build name; repository requests are unattributed.
3715
3982
  Repository status names a hotspot only when one build makes at least two requests
3716
3983
  and more than half of attributed requests. Telemetry never controls workflow.
3984
+
3985
+ GitHub shares in-flight and completed PR, branch/ref and comparison observations
3986
+ across builds within one dispatcher tick. Opened nodes prime their tips and
3987
+ commit distance with at most two reads: PR plus comparison, or parent branch
3988
+ plus reversed comparison without a PR. Priming is best-effort: failures add a
3989
+ diagnostic and ordinary parent/target observations continue, so a deleted parent
3990
+ can still be replaced. Forge cooldowns and rate limits retain their gates.
3991
+ Each admitted poll revalidates mutable resources
3992
+ using exact-resource ETags; authenticated 304s spare the REST primary quota.
3993
+ Adapter caches are bounded and restart/eviction falls back to fresh reads.
3994
+ Writes, including Git publication and rewrites, invalidate observations before
3995
+ attempting the mutation so acknowledgement reads remain fresh. Leaf PR polling
3996
+ keeps its existing cadence. Readiness and landing inspections remain fresh.
3997
+
3998
+ Opened integration nodes poll every tick until their durable activity has been
3999
+ quiet for `policy.nodeIdleAfterSeconds` (default 600 seconds), then poll every
4000
+ `policy.nodeIdlePollSeconds` (default 120 seconds). Holds and waiting for consent
4001
+ qualify normally. Child claims, PR and landing activity, operator commands
4002
+ (including repeated holds), restack requests and answers wake the next tick.
4003
+ GitHub-only changes are discovered on the next due check, within the idle
4004
+ interval plus normal tick scheduling while the dispatcher is running; failure,
4005
+ cooldown and transport-budget gates still apply. Pending operations retain
4006
+ active polling and action-time readiness checks remain fresh. Successful
4007
+ `node.poll-checked` facts preserve quiet history across restarts; missing facts
4008
+ force a fresh check. `ab build status` reports active or idle cadence and the
4009
+ last successful check (or unrecorded evidence).
4010
+
4011
+
4012
+ The total includes all attempted requests. Optional `restPrimary`,
4013
+ `restNotModified` and `graphql` counts distinguish REST responses charged to the
4014
+ primary quota, REST 304s and GraphQL calls. Transport failures and historical or
4015
+ legacy observations can remain unclassified; absent fields never imply zero.
4016
+ Shared requests are attributed to their first requester; cache hits count zero.
4017
+
4018
+ ## Integration verification attention
4019
+
4020
+ A failed node verification cycle records `integration.verification-failed` with its prepared cycle id, failed steps, exact head and parent, and guidance to file a repair child targeting the node. The kernel reports durable failed receipts; dispatcher housekeeping recovers missing reports for the current cycle using a per-cycle CAS guard. Superseded cycles are never backfilled with repair instructions: recovery requires the latest prepared cycle to match the node’s observed head and parent. This fact is decisive evidence and bookkeeping, and does not change verification or leaf routing.
4021
+
4022
+ Default watch and new hosted wake settings include this event. Watch cursors deliver each failed cycle once and baseline failures when first armed; reconcile build status after arming. `ab wait --for attention` also detects a current failed node cycle before the report is written. Historical facts remain queryable after repair without retaining current attention. Explicit event globs and existing stored wake choices are preserved.