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

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 (162) hide show
  1. package/README.md +9 -4
  2. package/SPEC.md +295 -62
  3. package/bin/ab-build-runner.ts +10 -8
  4. package/docs/architecture.md +179 -25
  5. package/docs/configuration.md +41 -6
  6. package/docs/hosted-service.md +35 -0
  7. package/docs/integration-tree.md +81 -4
  8. package/docs/landing-policy.md +11 -0
  9. package/docs/migration-1.0.md +9 -0
  10. package/docs/operator-api.md +18 -0
  11. package/docs/remote-store-protocol.md +11 -0
  12. package/docs/restacking.md +42 -7
  13. package/docs/setup.md +25 -0
  14. package/docs/ticket-dependencies.md +6 -45
  15. package/package.json +3 -3
  16. package/packages/core/src/cli/attention.ts +4 -1
  17. package/packages/core/src/cli/binary.ts +17 -1
  18. package/packages/core/src/cli/context.ts +53 -1
  19. package/packages/core/src/cli/dashboard/actions.ts +4 -0
  20. package/packages/core/src/cli/dashboard/detail.ts +45 -1
  21. package/packages/core/src/cli/dashboard/facts.ts +7 -2
  22. package/packages/core/src/cli/dashboard/integration-detail.ts +142 -0
  23. package/packages/core/src/cli/dashboard/integration-row.ts +248 -0
  24. package/packages/core/src/cli/dashboard/landing-display.ts +64 -0
  25. package/packages/core/src/cli/dashboard/model.ts +140 -16
  26. package/packages/core/src/cli/dashboard/poll.ts +40 -4
  27. package/packages/core/src/cli/dashboard/refresh.ts +20 -13
  28. package/packages/core/src/cli/dashboard/render.ts +106 -5
  29. package/packages/core/src/cli/dashboard/transcript.ts +2 -1
  30. package/packages/core/src/cli/dispatch-frontend.ts +22 -12
  31. package/packages/core/src/cli/dispatch.ts +59 -25
  32. package/packages/core/src/cli/help.ts +19 -2
  33. package/packages/core/src/cli/main.ts +37 -0
  34. package/packages/core/src/cli/publication-settlement.ts +49 -5
  35. package/packages/core/src/cli/repository-status.ts +97 -2
  36. package/packages/core/src/cli/status.ts +24 -1
  37. package/packages/core/src/cli/terminals.ts +94 -93
  38. package/packages/core/src/cli/wait.ts +11 -2
  39. package/packages/core/src/cli/watch.ts +12 -0
  40. package/packages/core/src/config/schema.ts +3 -0
  41. package/packages/core/src/events/catalog.ts +38 -0
  42. package/packages/core/src/events/compatibility.ts +183 -0
  43. package/packages/core/src/events/native-session.ts +13 -0
  44. package/packages/core/src/events/payloads.ts +148 -2
  45. package/packages/core/src/events/policy.ts +209 -0
  46. package/packages/core/src/events/repository.ts +48 -0
  47. package/packages/core/src/integration/harness.ts +4 -4
  48. package/packages/core/src/kernel/__snapshots__/{reducer-registry.test.ts.snap → reducer-accumulator-shapes.json} +771 -538
  49. package/packages/core/src/kernel/change-presence.ts +4 -2
  50. package/packages/core/src/kernel/dispatch-capacity.ts +119 -0
  51. package/packages/core/src/kernel/dispatcher-liveness.ts +5 -1
  52. package/packages/core/src/kernel/engine.ts +25 -5
  53. package/packages/core/src/kernel/forge-health.ts +19 -0
  54. package/packages/core/src/kernel/generators/build-log.ts +18 -0
  55. package/packages/core/src/kernel/generators/node-restack-log.ts +1 -1
  56. package/packages/core/src/kernel/generators/repository-journals.ts +10 -0
  57. package/packages/core/src/kernel/guarded-forge.ts +159 -0
  58. package/packages/core/src/kernel/incremental.ts +4 -2
  59. package/packages/core/src/kernel/integration-completeness.ts +61 -0
  60. package/packages/core/src/kernel/integration-landing.ts +5 -4
  61. package/packages/core/src/kernel/janitor-failure.ts +36 -0
  62. package/packages/core/src/kernel/landing-publication.ts +35 -15
  63. package/packages/core/src/kernel/landing-state.ts +7 -0
  64. package/packages/core/src/kernel/leaf-restack-state.ts +1 -1
  65. package/packages/core/src/kernel/log-index.ts +12 -1
  66. package/packages/core/src/kernel/mixed-version.ts +52 -0
  67. package/packages/core/src/kernel/node-landing.ts +14 -11
  68. package/packages/core/src/kernel/node-restack-demand.ts +29 -0
  69. package/packages/core/src/kernel/node-restack-state.ts +46 -16
  70. package/packages/core/src/kernel/node-restack-transaction.ts +151 -8
  71. package/packages/core/src/kernel/node-restack.ts +34 -10
  72. package/packages/core/src/kernel/publication.ts +22 -0
  73. package/packages/core/src/kernel/read-deferrals.ts +111 -0
  74. package/packages/core/src/kernel/read-facts.ts +27 -6
  75. package/packages/core/src/kernel/reconcile-restack.ts +23 -2
  76. package/packages/core/src/kernel/reducer-registry.ts +15 -2
  77. package/packages/core/src/kernel/reducer.ts +196 -10
  78. package/packages/core/src/kernel/repository-attention.ts +38 -1
  79. package/packages/core/src/kernel/terminal-guard.ts +11 -4
  80. package/packages/core/src/operator/annotations.ts +6 -0
  81. package/packages/core/src/operator/index.ts +2 -0
  82. package/packages/core/src/operator/presentation.ts +5 -0
  83. package/packages/core/src/operator/query.ts +45 -11
  84. package/packages/core/src/operator/registry.ts +17 -1
  85. package/packages/core/src/operator/restack.ts +51 -0
  86. package/packages/core/src/plugin-sdk/index.ts +10 -0
  87. package/packages/core/src/plugins/load.ts +3 -4
  88. package/packages/core/src/plugins/manifest.ts +1 -1
  89. package/packages/core/src/ports/forge/contract.ts +23 -0
  90. package/packages/core/src/ports/forge/fake.ts +6 -2
  91. package/packages/core/src/ports/forge/git-rewrite.ts +92 -64
  92. package/packages/core/src/ports/forge/github-transport.ts +45 -2
  93. package/packages/core/src/ports/forge/github.ts +56 -17
  94. package/packages/core/src/ports/forge/local-git.ts +7 -2
  95. package/packages/core/src/ports/forge-failure.ts +40 -0
  96. package/packages/core/src/ports/forge-request-context.ts +35 -0
  97. package/packages/core/src/ports/forge-telemetry.ts +16 -0
  98. package/packages/core/src/ports/runner/claude.ts +136 -9
  99. package/packages/core/src/ports/runner/codex.ts +112 -7
  100. package/packages/core/src/ports/runner/contract.ts +78 -0
  101. package/packages/core/src/ports/runner/fake.ts +59 -1
  102. package/packages/core/src/ports/runner/native-cli-fixture.ts +86 -0
  103. package/packages/core/src/ports/runner/native-process-fixture.ts +38 -0
  104. package/packages/core/src/ports/runner/native-session.ts +110 -0
  105. package/packages/core/src/ports/runner/pi-rpc.ts +7 -1
  106. package/packages/core/src/ports/runner/pi.ts +162 -2
  107. package/packages/core/src/ports/types.ts +53 -5
  108. package/packages/core/src/ports/workspace/git-worktree.ts +45 -51
  109. package/packages/core/src/ports/workspace/vercel-sandbox.ts +28 -12
  110. package/packages/core/src/processes/build-child-exit.ts +50 -2
  111. package/packages/core/src/processes/build-child.ts +15 -7
  112. package/packages/core/src/processes/build-runner.ts +909 -213
  113. package/packages/core/src/processes/dispatcher.ts +652 -334
  114. package/packages/core/src/processes/execution-no-progress.ts +15 -0
  115. package/packages/core/src/processes/pause-execution-fixture.ts +37 -0
  116. package/packages/core/src/processes/phase-failure-budget.ts +2 -1
  117. package/packages/core/src/processes/publication-loss.ts +7 -3
  118. package/packages/core/src/processes/repo-view.ts +53 -6
  119. package/packages/core/src/processes/tick-publication.ts +6 -2
  120. package/packages/core/src/runtime-identity.ts +37 -0
  121. package/packages/core/src/store/adapter.ts +4 -2
  122. package/packages/core/src/store/build-scope.ts +9 -0
  123. package/packages/core/src/store/contract.ts +203 -16
  124. package/packages/core/src/store/digest.ts +20 -2
  125. package/packages/core/src/store/local/schema.ts +6 -0
  126. package/packages/core/src/store/local/store.ts +57 -4
  127. package/packages/core/src/store/memory.ts +83 -2
  128. package/packages/core/src/store/new-build.ts +2 -2
  129. package/packages/core/src/store/phase-session.ts +13 -0
  130. package/packages/core/src/store/reduced-reads.ts +43 -4
  131. package/packages/core/src/store/reducer-value-shapes.json +8238 -5764
  132. package/packages/core/src/store/reducer-value-validation.ts +103 -3
  133. package/packages/core/src/store/reducer-values.ts +21 -6
  134. package/packages/core/src/store/remote/client.ts +146 -20
  135. package/packages/core/src/store/remote/compatibility.ts +6 -0
  136. package/packages/core/src/store/remote/index.ts +2 -0
  137. package/packages/core/src/store/remote/protocol.ts +19 -0
  138. package/packages/core/src/store/remote/version.ts +2 -0
  139. package/packages/core/src/store/repo-state-events.ts +3 -1
  140. package/packages/core/src/store/repo-tick.ts +6 -1
  141. package/packages/core/src/store/session-handle.ts +8 -0
  142. package/packages/core/src/store/snapshots.ts +21 -5
  143. package/packages/core/src/store/types.ts +19 -1
  144. package/packages/core/src/testing/dispatch-read-budget.ts +17 -2
  145. package/packages/core/src/testing/index.ts +7 -0
  146. package/packages/core/src/testing/newer-writer.ts +37 -0
  147. package/packages/core/src/testing/reduced-read-budget.ts +3 -0
  148. package/skills/guide/SKILL.md +144 -27
  149. package/skills/guide/references/integration-tree.md +81 -4
  150. package/skills/guide/references/landing-policy.md +11 -0
  151. package/skills/guide/references/migration-1.0.md +9 -0
  152. package/skills/guide/references/operator-api.md +18 -0
  153. package/skills/guide/references/plugin-authoring.md +55 -7
  154. package/skills/guide/references/remote-store-protocol.md +11 -0
  155. package/skills/guide/references/restacking.md +42 -7
  156. package/skills/guide/references/setup.md +25 -0
  157. package/skills/guide/references/ticket-dependencies.md +6 -45
  158. package/skills/implement/SKILL.md +4 -2
  159. package/skills/operate/SKILL.md +63 -6
  160. package/skills/reconcile/SKILL.md +3 -1
  161. package/skills/spec/SKILL.md +49 -39
  162. package/skills/tickets/SKILL.md +15 -43
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env bun
2
2
  /** Private shipped child: one operating-system process per build. */
3
3
  import { runBuildChild } from '../packages/core/src/processes/build-child'
4
- import { BuildChildExitCoordinator } from '../packages/core/src/processes/build-child-exit'
4
+ import {
5
+ BuildChildExitCoordinator,
6
+ BuildChildShutdown,
7
+ } from '../packages/core/src/processes/build-child-exit'
5
8
  import { watchBuildParent } from '../packages/core/src/processes/build-parent-watch'
6
9
  import { BUILD_RUNNER_OPTIONS_ENV } from '../packages/core/src/ports/workspace/local-build-execution'
7
10
  import {
@@ -30,17 +33,16 @@ if (input.supervision.kind === 'local-parent') {
30
33
  // session. Environment-owned execution deliberately installs neither this
31
34
  // group reaper nor a meaningless host-PID watchdog.
32
35
  const terminal = new BuildChildExitCoordinator({ groupId: process.pid })
33
- process.on('SIGINT', () => terminal.terminate(130))
34
- process.on('SIGTERM', () => terminal.terminate(143))
35
- terminal.setParentWatch(
36
- watchBuildParent(input.supervision.parentPid, () => terminal.terminate(143)),
37
- )
36
+ const shutdown = new BuildChildShutdown(terminal)
37
+ process.on('SIGINT', () => shutdown.request(130))
38
+ process.on('SIGTERM', () => shutdown.request(143))
39
+ terminal.setParentWatch(watchBuildParent(input.supervision.parentPid, () => shutdown.finish(143)))
38
40
  try {
39
- await runBuildChild(input, process.env, undefined, { guest })
41
+ await runBuildChild(input, process.env, undefined, { guest, shutdownSignal: shutdown.signal })
40
42
  } catch {
41
43
  exitCode = 1
42
44
  }
43
- terminal.terminate(exitCode)
45
+ shutdown.finish(exitCode)
44
46
  } else {
45
47
  // Vercel owns teardown of the complete VM session. Addressing a POSIX group
46
48
  // here could leave the SDK believing a still-running environment completed.
@@ -85,7 +85,7 @@ remote-store protocol requires matching client and server versions.
85
85
  | `packages/vercel-sandbox/` | Published `@defrex/autobuild-vercel-sandbox` provider plugin: transitional manifest over the shared capability object with a guarded factory (implementation stays builtin-hosted until AUT-505) | §3.2.1 |
86
86
  | `packages/hosted-store-service/server.ts`, `packages/hosted-store-service/vercel.json` | One host-neutral Bun listener used locally and by Vercel's Bun preset | §7.2 |
87
87
  | `packages/core/src/kernel/` | Phase table, build reducer, engine; pure harvest, dispatcher-settings, dispatcher-status, and PR-attachment selectors; converge, stall detection, verify gating | §5, §7.5, §10, §12, §14, §15.4–15.5 |
88
- | `packages/core/src/ports/` | TicketSource / Workspace / Forge / AgentRunner / Telemetry interfaces, adapters, and fakes; registry-aware builtin/plugin construction; eager primary/alternate runtime routing and provider-failure classification under `ports/runner/` | §3.2, §9, §13 |
88
+ | `packages/core/src/ports/` | TicketSource / Workspace / Forge / AgentRunner / Telemetry interfaces, adapters, and fakes; registry-aware builtin/plugin construction; eager primary/alternate runtime routing and provider-failure classification, awaited native identity observation and optional fresh-process native resume under `ports/runner/` | §3.2, §9, §13 |
89
89
  | `packages/core/src/plugins/` | Strict versioned plugin manifests, dual-root repository/package Bun loading, owner-aware adapter registration, contract/credential metadata, and runtime-factory materialization | §3.2.1, §9 |
90
90
  | `packages/core/src/plugin-sdk/` | The sole supported `@defrex/autobuild/plugin-sdk` barrel: port/manifest types, contract suites, and reference fakes | §3.2.1 |
91
91
  | `packages/core/src/processes/` | build-runner and standalone child composition, durable execution config/diagnostics, dispatcher (+ janitor duty, harvest trigger, and the last-step orchestrator resume/reap/wake pass, origin-mode-gated), orchestrator tick step, harvest deterministic core + runner | §3.3, §7.1.2, §12, §15.7 |
@@ -156,8 +156,8 @@ of a cursor: `getReducerSnapshot(scope, reducer, version)` and
156
156
  (`packages/core/src/store/snapshots.ts`). The log stays the only authority. The
157
157
  store enforces the invariants: the stored cursor never decreases (a write whose
158
158
  cursor does not advance is a no-op, so concurrent writers cannot undo each
159
- other), a row of another reducer version reads as absent and is replaced once a
160
- writer advances past it, and a cursor beyond the log's tail is refused and never
159
+ other), a row of another reducer version reads as absent, and a lower-version
160
+ writer never replaces a higher-version row even after advancing its cursor, and a cursor beyond the log's tail is refused and never
161
161
  returned. Every consumer treats a missing, mismatched, ahead-of-log, malformed
162
162
  or unreadable snapshot as a miss and replays the log, with identical results;
163
163
  deleting all snapshots changes no observable output (the integration harness
@@ -173,6 +173,24 @@ reads every snapshot as missing and replays (SQLSTATE `42P01` is never an
173
173
  error), and an older client never asks. Run `bun run postgres:migrate` once to
174
174
  gain the table; until then the dispatcher and every other reader replay in full.
175
175
 
176
+ **Mixed-version event decoding.** `events/compatibility.ts` separates opaque
177
+ stored facts from the known event unions. Strict producer schemas stay in
178
+ `events/payloads.ts` and `events/repository.ts`; `events/policy.ts` exhaustively
179
+ classifies every type and stamps writer release metadata. Named read boundaries
180
+ project known payloads before adapting selector rows, while build and repository
181
+ facts retain compatibility counts across incremental resumes. Unknown facts
182
+ still advance sequence cursors. `kernel/mixed-version.ts` guards affected build
183
+ decisions and deduplicates the default-watch attention fact. Other builds and
184
+ read-only queries continue. The [hosted upgrade guarantee](hosted-service.md#reading-across-upgrades)
185
+ describes recovery and the supported-window boundary.
186
+
187
+ All event-derived checkpoints include the combined read-catalog fingerprint in
188
+ their keys, independently of numeric reducer versions. Snapshot envelopes validate
189
+ that fingerprint; another catalog's rows remain untouched. Remote named values
190
+ use `x-autobuild-catalog-identity` for cache acceptance, keeping their strict
191
+ three-field JSON body unchanged. Missing or mismatching identity, version or
192
+ finished shape causes bounded local replay without a remote cache write.
193
+
176
194
  **Named reducer values.** `BuildStore.getReducerValue(scope, {reducer, args?})`
177
195
  returns `{version, cursor, value}` for each eligible entry in the executable
178
196
  reducer registry. Eligible reducers consume build or repository events and finish
@@ -230,6 +248,11 @@ the requested historical run. A never-started fresh invocation does not request
230
248
  historical correlation. Stopped dispatcher history is not copied into every
231
249
  current read.
232
250
 
251
+ Consumer validation failures report the reducer name, scope, returned store
252
+ cursor, structural field path and expected shape without persisted values.
253
+ Dispatcher tick warnings and stored failures add the running distribution's
254
+ version and source commit, captured at startup (or `unknown` without metadata).
255
+
233
256
  Hosted project build listings use the optional backing-store
234
257
  `listBuildsForRepo` capability with the authenticated repository. Postgres filters
235
258
  build rows in SQL before hosted ticket readable-id projection. Admin listings
@@ -345,8 +368,8 @@ requirement from the phase table.
345
368
  **Finalize publication.** Content-producing `finalize:*` checks or agents
346
369
  select and commit files locally and leave a clean worktree. `build-runner.ts`
347
370
  derives the last published head from event facts, rejects a non-descendant
348
- `HEAD`, and uses the `Forge.pushBranch` port for a regular kernel-side push
349
- before checkpointing the new head on `finalize.step-completed`. An unchanged
371
+ `HEAD`, freezes that SHA, and uses the Forge port for a regular kernel-side push
372
+ and exact authoritative readback before checkpointing the new head on `finalize.step-completed`. An unchanged
350
373
  head is a no-op; Git/Forge failures stay failure-tolerant observations.
351
374
 
352
375
  **Verify gating.** `packages/core/src/ontology.ts` owns the canonical
@@ -416,15 +439,25 @@ the repository record even with an unchanged event cursor, merging matching-run
416
439
  completion samples with journal ticks. Heartbeat renewal cannot invent progress.
417
440
  The memory, SQLite, Postgres and remote adapters share this contract, including
418
441
  no mutation after lease expiry and no partial publication on validation failure.
442
+ Repository read failures fail a watch tick and retry on the next iteration;
443
+ continuous failures use the existing five-minute persistent-tick attention.
444
+ Failure settlement writes through the fenced backing store without reading the
445
+ failed projection. Repository view writes distinguish a committed result from a
446
+ subsequent refresh failure, retaining the last complete snapshot while propagating
447
+ the read error to the operational caller. Exact metadata confirmation acknowledges
448
+ lost finish responses without requiring another projection read or duplicating
449
+ boundaries. Every operational tick refreshes facts before routing work. Startup
450
+ configuration errors, fatal forge publication errors, lease fencing and once-mode
451
+ failure behavior retain their existing semantics.
419
452
 
420
453
  Timeout escalation is held while the matching repository tick observation is open
421
454
  (with historical `tick-started` journal fallback when no observation exists),
422
455
  because force-killing the ticket claim before build creation would not be
423
456
  recoverable. After a build child claims a takeover lease, it reduces one
424
- captured event prefix and appends transcriptless reclaimed `session.ended`
425
- facts for every session open there before `runner.attached` cites that same
426
- boundary. Partial closure is retry-safe and an observed attachment therefore
427
- proves all pre-boundary sessions closed; historical orphan-only logs keep their
457
+ captured event prefix, retains an eligible local native recovery candidate, and
458
+ appends transcriptless reclaimed `session.ended` facts for unrelated open
459
+ sessions before `runner.attached` cites that same boundary. Partial closure is
460
+ retry-safe; historical orphan-only logs keep their
428
461
  old projection until an actual takeover records those facts. The supervisor
429
462
  rechecks kernel-child liveness at the force boundary
430
463
  and projects the same normal, forced, or abnormal result (with available
@@ -503,16 +536,19 @@ optional `localPath` explicitly identifies dispatcher reachability. Local Forge
503
536
  operations fall back to the main checkout when `localPath` is absent.
504
537
  `packages/core/src/ports/workspace/git-worktree.ts` selects the branch-cut base once
505
538
  at first creation, fetching into a build-scoped private ref; re-provisioning
506
- resumes at the branch tip and never re-cuts, so the first provisioning fact
507
- remains immutable provenance. Separately, each successful implementation terminal in
508
- `packages/core/src/cli/terminals.ts` asks the Forge to snapshot its authoritative base when
509
- that optional capability exists; otherwise it privately refreshes the frozen
510
- target branch from `origin` and records
511
- the unique merge-base of that snapshot and `HEAD` in `implement.completed`.
512
- It fails before publication/deposit on fetch, ref, ancestry, or ambiguity
513
- errors and writes neither `FETCH_HEAD` nor operator refs. Reconcile's
514
- execution-time target refresh in `packages/core/src/processes/build-runner.ts` remains a
515
- third, deliberately separate boundary and also fails closed.
539
+ resumes at the branch tip, so the first provisioning fact remains immutable
540
+ original provenance. A remote workspace lost before its branch is published
541
+ can be freshly cut again; the latest `remote` or `local` provisioning base is
542
+ the fallback review boundary, while `existing` facts only describe resumes.
543
+ Each implementation terminal in `packages/core/src/cli/terminals.ts` records
544
+ its proven contribution boundary verbatim: the projected implementation/replay
545
+ base, falling back to the latest fresh cut. Branch-cut target sampling remains
546
+ separate from review provenance. The immutable boundary must belong to HEAD's
547
+ history; missing or invalid provenance fails before publication or notes deposit.
548
+ There is no review-time target fetch or destination merge-base. Successful leaf
549
+ rewrite facts project `targetBase..headSha` for context, review and agent verify
550
+ steps without changing historical ranges. Node cycles retain separate semantics.
551
+ Reconcile's execution-time target refresh remains a separate boundary.
516
552
 
517
553
  The builtin `vercel-sandbox` adapter provisions an exact GitHub revision into a
518
554
  fixed guest path. Fresh-environment bootstrap scrubs clone authority, installs
@@ -743,9 +779,13 @@ adapter operation, so slug naming, provisioning, runners, and Harvest cannot
743
779
  block input.
744
780
 
745
781
  `packages/core/src/cli/dashboard/refresh.ts` owns the shared presentation read
746
- scheduler for both terminal paths: focused by default, paused on focus-out,
782
+ scheduler for both terminal paths: focused by default, independent of focus for
783
+ local stores, and 5-second polling when unfocused for network stores,
747
784
  immediate on focus-in or keys, 500 ms with retained builds or during a 30-second
748
- interaction hold, and 5 seconds when idle. Presentation store facades check
785
+ interaction hold, and 5 seconds when idle. The optional BuildStore.networkReads
786
+ capability identifies remote HTTP and Postgres adapters, including wrapped stores.
787
+ Session feeds and automatic recovery follow the same cadence; unchanged network
788
+ polls retain the change-position savings and bounded enrichment exception. Presentation store facades check
749
789
  admission at every asynchronous read stage; the kernel uses its original store
750
790
  and independent tick timers. Cached clock paints perform no reads. The mode
751
791
  ledger owns focus reporting through teardown and catchable faults; job-control
@@ -1024,7 +1064,12 @@ validates issuance, durable lifecycle bindings and the 60-second terminal grace;
1024
1064
  `machine-auth.ts` authenticates these signed version-2 grants as delegated
1025
1065
  principals. `remote-store-server.ts` enforces resource mutations before deposits,
1026
1066
  including body-selected and addressed-stream resources. Operator routes reject
1027
- these principals. Ticket routes deny build grants and allow harvest grants only the reads and
1067
+ these principals. Build-runner and build-phase grants may append only the
1068
+ kernel's `dispatcher.forge-degraded` repository fact, in their own project,
1069
+ so runner/CLI guards can record a newly observed rate limit and wait for
1070
+ durable dispatcher recovery. This exception grants no repository administration,
1071
+ recovery, lease, or other journal writes. The agent-visible build-scoped Store
1072
+ still denies repository writes. Ticket routes deny build grants and allow harvest grants only the reads and
1028
1073
  runner filing operations they require. Ticket sources and assets are partitioned
1029
1074
  by the authenticated project.
1030
1075
 
@@ -1125,7 +1170,9 @@ Historical merge completions retain their original shape and semantics.
1125
1170
  The optional grouped Forge rewrite capability owns authoritative head snapshots,
1126
1171
  immutable `refs/autobuild/archive/<slug>/<sha>` publication and expected-head CAS.
1127
1172
  GitHub uses explicit Git transport leases; local-git uses shared-database
1128
- `update-ref` CAS without network calls. Trusted remote publication archives before
1173
+ `update-ref` CAS without network calls. Exact authoritative readback acknowledges
1174
+ publication. Remote-backed local refs are caches refreshed without expected-old
1175
+ CAS after confirmation, even if absent or recreated; checkout files are untouched. Trusted remote publication archives before
1129
1176
  replacement after guest teardown; it never uses ordinary append-only publication
1130
1177
  for restacks. Prepared, replayed, intended and rewritten facts support recovery.
1131
1178
  A contended rewrite preserves the observed work and retries on the same base.
@@ -1224,12 +1271,23 @@ exhaustive source listings, frozen claims and retained contribution identities.
1224
1271
  `integration.*` events retain observations, immutable cycle inputs, landing
1225
1272
  intents, provenance and tree audits. The build reducer projects these facts and
1226
1273
  `engine.ts` routes nodes directly through verification, without producer phases.
1274
+ The shared `cli/dashboard/integration-detail.ts` projection supplies both
1275
+ dashboards with all child titles/states, current verification outcomes, landing
1276
+ rule explanations and restack files. Optional `integration.observed.children`
1277
+ metadata stores source/id, title and contribution identity without changing the
1278
+ authoritative membership arrays. Completed build records supply legacy title
1279
+ fallbacks; missing historical titles remain explicit. Optional `files` on
1280
+ `node.item-conflicted` and conflicted `restack.replayed` are captured as
1281
+ NUL-delimited unmerged Git paths; historical missing filenames remain explicit.
1282
+ Repository enrichment refreshes live child phases even without a parent delta.
1227
1283
  Failed cycles park for repair children. The dispatcher temporarily provisions
1228
1284
  verification resources and rechecks head, parent, controls and completeness
1229
1285
  before publication. `integration-landing.ts` owns source-reserved root landing
1230
1286
  and immutable result audits; nested nodes use the destination writer transaction
1231
- in `node-landing.ts`. GitHub uses guarded PR rebase; local-git uses an ancestry
1232
- proof and exact-parent fast-forward. Shared status vocabulary exposes provenance
1287
+ in `node-landing.ts`. GitHub uses guarded PR rebase; local-git validates
1288
+ fast-forward shape against the frozen parent. Exact authoritative head readback
1289
+ or a durable confirmed receipt establishes publication; ancestry alone cannot
1290
+ acknowledge an unconfirmed candidate. Shared status vocabulary exposes provenance
1233
1291
  and mismatch attention in both frontends. Human forge merges remain observable
1234
1292
  escape hatches independent of completeness and verification.
1235
1293
 
@@ -1241,3 +1299,99 @@ decisions and persistent hold/land commands. The dispatcher owns readiness,
1241
1299
  ticket label sampling and native-state convergence. `kernel/landing-publication.ts`
1242
1300
  confirms native cancellation at local and trusted remote head-publication seams.
1243
1301
  Node landings retain the existing writer serialization and gate proof.
1302
+
1303
+ Build native session handles are kernel-authored `session.native-handle-recorded`
1304
+ facts. The build reducer retains them by bracket session id after session end;
1305
+ absence means no harness identity was reported. Adapters guard host/workspace
1306
+ and resume only native persisted state with fresh execution options.
1307
+
1308
+ Operator pause immediately cancels live turns, records suspension with cause
1309
+ `pause` (with or without a native handle, including remote workspaces), then
1310
+ acknowledges the still-current request. A newer resume supersedes pause; abort
1311
+ wins. Check-only steps and builds without a live agent retain boundary behavior.
1312
+
1313
+ Local git-worktree runners suspend an interrupted agent turn on dispatcher
1314
+ SIGINT/SIGTERM. A conditional artifact deposit records `session.suspended`
1315
+ with cause `shutdown`, the native handle, active milliseconds, partial transcript
1316
+ and any known incremental usage. A terminal fact that lands first prevents
1317
+ suspension; suspension fences the old session's terminal credentials permanently.
1318
+ The process supervisor retains its existing bounded force-stop path if provider
1319
+ cleanup or persistence cannot complete.
1320
+
1321
+ On attachment the runner retains an eligible current phase/round session and
1322
+ records takeover. Matching host, workspace and runtime permit native resume;
1323
+ remote workspaces, missing handles, unsupported runtimes and unavailable native
1324
+ state produce a reasoned `session.resume-fallback` and fresh execution. Provider
1325
+ failures retain ordinary retry/alternate policy. Native state is an optimization;
1326
+ the Store remains authoritative for durable resumption.
1327
+
1328
+ A continuation is a new Autobuild bracket with fresh credentials and a new
1329
+ stream. `session.started.continuation` durably records its predecessor, logical
1330
+ root, inherited handle, interruption cause and accumulated budget before launch.
1331
+ This is write-ahead resume intent, not a handshake: the prompt may execute and
1332
+ its terminal may land before the adapter reports native acceptance through
1333
+ `session.resumed`. Recovery retries an unaccepted attempt using the inherited
1334
+ handle; a superseded attempt's late acceptance is marked stale and changes no
1335
+ lifecycle state. The interruption prompt names pause, shutdown or runner loss and asks
1336
+ the agent to re-check the worktree and re-run anything in flight. Phase and round
1337
+ are retained, including uncommitted local work.
1338
+
1339
+ The original budget ceiling persists across interruptions. Monotonic elapsed
1340
+ milliseconds charge each live segment; suspended intervals are excluded. An
1341
+ abruptly lost segment is conservatively charged from its recorded start to
1342
+ recovery. Interrupted and continuation transcripts remain separate artifacts;
1343
+ logical totals sum known segment usage once and preserve every transcript ref.
1344
+ Unknown crash usage is not fabricated. Pause interrupts live turns and retains
1345
+ the suspension cause through continuation.
1346
+
1347
+ ### Failure budgets and own-build read deferrals
1348
+
1349
+ `policy.maxVerifyAttempts` counts distinct failed logical verify cycles after
1350
+ the latest spec revision. Passing and skipped cycles, including target movement
1351
+ through restack or reconcile, consume zero. Cycle identifiers remain monotonic;
1352
+ pass, pass, pass, fail at cycle 4 spends one failure. Duplicate completion
1353
+ evidence for a failed cycle does not charge it twice.
1354
+
1355
+ Classified session deferrals consume no phase failures. Unsupported decisive
1356
+ facts retain the mixed-version wait gate and durable compatibility diagnostic.
1357
+ When the scoped `ab context` initial own-build read fails, the CLI best-effort
1358
+ writes `session.build-read-failed` with exact session, phase, round, operation
1359
+ `context`, reason `own-build-read`, and diagnostic. A valid terminal from that
1360
+ session wins if the agent recovers. Otherwise settlement records `phase.deferred`
1361
+ and `phase.deferral-escalated`, immediately projecting ordinary blocked attention.
1362
+ The raise cites `own-build-read:<evidenceSeq>`; replay repairs either settlement
1363
+ crash gap before launching another agent. An `escalation.answered` retry or
1364
+ guidance authorizes one fresh session without resetting genuine phase failures;
1365
+ a new classified failure parks again. There are zero automatic paid retries
1366
+ after this deferral. If evidence cannot be written, ordinary recovery applies;
1367
+ agent output and `no-terminal` alone never classify a read failure.
1368
+
1369
+ Ordinary silence, provider failures and session timeouts retain the runner's
1370
+ phase failure limit (`BuildRunnerOpts.maxPhaseAttempts`, default 2). This is
1371
+ an internal runner option, not an accepted `[policy]` TOML key. Reconcile
1372
+ execution and unchanged-base progress budgets retain their existing accounting.
1373
+
1374
+ ## Forge failure recovery
1375
+
1376
+ Janitor failures are durable per-build episodes. Eligible failures retry after
1377
+ 30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
1378
+ Skipped polls preserve the episode across restart. After
1379
+ `policy.janitorFailureAttentionSeconds` (600 by default), `build.janitor-failing`
1380
+ notifies default watchers and appears on the build row. A successful attempt
1381
+ clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
1382
+
1383
+ A classified forge rate limit records repository degradation with `resetAt`.
1384
+ Forge work waits during cooldown; passing the deadline permits a recovery
1385
+ request, and only success clears degradation. A further limit extends cooldown.
1386
+ Native landing application failures keep candidate-specific retry eligibility,
1387
+ including automatic decisions without a human command. Retries recheck consent,
1388
+ holds, verification and the exact candidate. Uncertain enables remain pending
1389
+ until cancellation can be confirmed after cooldown. Publication retries reuse
1390
+ cancellation receipts only when the forge confirms the same disabled state for
1391
+ the same candidate and publication operation.
1392
+
1393
+ Tick telemetry counts provider wire requests, including failures. Counts are
1394
+ unavailable for uninstrumented adapters. Attribution retains at most ten builds
1395
+ ordered by descending count then build name; repository requests are unattributed.
1396
+ Repository status names a hotspot only when one build makes at least two requests
1397
+ and more than half of attributed requests. Telemetry never controls workflow.
@@ -1,5 +1,9 @@
1
1
  # Configuration reference
2
2
 
3
+ Install Autobuild in the target repository with `bun add -d --exact @defrex/autobuild`.
4
+ Here, `ab <command>` means the repository-installed CLI; run it as
5
+ `bun ab <command>`, for example `bun ab init`.
6
+
3
7
  Autobuild reads one declarative `autobuild.toml` from the repository root.
4
8
  Commands in the file are shell strings; the file itself is never evaluated as
5
9
  code. A running dispatcher owns an accepted snapshot from the main checkout,
@@ -249,7 +253,7 @@ any table header.
249
253
  |---|---:|---|---|
250
254
  | `baseBranch` | `"main"` | nonempty string | Branch used to cut builds, target PRs, and merge during reconciliation. |
251
255
  | `ticketScanIntervalSeconds` | `60` | positive integer seconds | Ticket-source ready scan cadence; tick spacing is the effective minimum. |
252
- | `capacity` | `1` | positive integer | Maximum concurrent nonterminal builds for this repository. Paused and blocked builds still occupy capacity. |
256
+ | `capacity` | `1` | positive integer | Concurrent occupied slots for this repository. Paused and blocked work retains slots. Node reconcile and verification exclude their own blocked/paused descendants at admission; new claims use total occupancy. See [integration capacity](integration-tree.md). |
253
257
  | `forge` | `"github"` | nonblank string | Forge adapter name. Shipped values are `github` and `local-git`; configured plugins may register other names. |
254
258
  | `plugins` | `[]` | array of unique nonblank module specifiers | Trusted Bun plugin modules loaded by dispatch, `ab ticket`, and scoped phase CLI processes. |
255
259
 
@@ -278,8 +282,8 @@ root whose config is being read. In a scoped phase process that root is the
278
282
  immutable build worktree. Bare npm package specifiers resolve first from the
279
283
  consuming repository's main checkout and therefore use its installed
280
284
  dependencies; a package the repository lacks then resolves from Autobuild's own
281
- installation, so an extension installed next to the CLI (`bun add -g
282
- @defrex/autobuild-<extension>`) loads without being added to the repository. A
285
+ installation as a fallback. Install extensions in the consuming repository with
286
+ `bun add -d --exact @defrex/autobuild-<extension>`. A
283
287
  repository copy always wins over an installed one. This package lookup remains
284
288
  stable when a relocated local store places a linked worktree outside the
285
289
  checkout. Dispatch and sessionless commands use the main checkout for both
@@ -1057,7 +1061,7 @@ session starts, with a copyable table and all registered runtime names.
1057
1061
  | `model` | inherited; otherwise selected runtime's own default | optional nonempty model id compatible with the resolved runtime | Select the exact model. Codex uses unqualified `gpt-*`; Pi ids are provider-qualified. |
1058
1062
  | `args` | inherited; otherwise `[]` | optional array of nonempty strings; `[]` allowed | Ordered extra CLI argv tokens applied to every phase and tool-free one-shot invocation. A supplied list replaces, rather than unions with, the inherited list. |
1059
1063
  | `extensions` | no effect | deprecated optional array of nonempty strings | Compatibility-only field. Dispatch warns for each declaring role; migrate explicit runtime options to `args`. |
1060
- | `sessionBudgetSeconds` | inherited; otherwise `[policy].sessionBudgetSeconds` | optional positive integer | Wall-clock budget for each build phase session routed through this logical role. One budget covers the primary and every alternate target. |
1064
+ | `sessionBudgetSeconds` | inherited; otherwise `[policy].sessionBudgetSeconds` | optional positive integer | Active-time budget for each build phase session routed through this logical role. Suspended intervals are excluded; native continuation retains the original ceiling and accumulated active time. One budget covers the primary and every alternate target. |
1061
1065
  | `alternates` | inherited; otherwise `[]` | optional ordered array of strict `{ runtime?, model?, args?, extensions? }` entries; `[]` allowed | Failure-triggered execution targets (provider failures and a runtime whose CLI is not installed). A role's list replaces the inherited list wholesale; each entry overlays that role's effective primary axes. `extensions` is accepted there only as the same deprecated no-op. |
1062
1066
 
1063
1067
  <!-- config-fragment:roles -->
@@ -1196,7 +1200,7 @@ Optional. Every field receives its own default. All are positive integers except
1196
1200
 
1197
1201
  | Field | Default | Constraints | Purpose |
1198
1202
  |---|---:|---|---|
1199
- | `sessionBudgetSeconds` | `3600` | positive integer | Wall-clock bound for each build agent session unless its logical role overrides it. |
1203
+ | `sessionBudgetSeconds` | `3600` | positive integer | Active-time bound for each build agent session unless its logical role overrides it. Native continuation retains the original ceiling; suspension does not consume it. |
1200
1204
  | `stallRounds` | `3` | positive integer | Escalate when the same review finding survives this many rounds. |
1201
1205
  | `maxVerifyAttempts` | `3` | positive integer | Bound failure-driven verify → implement retry cycles. |
1202
1206
  | `maxDispatchAttempts` | `3` | positive integer | Bound consecutive dispatch failures before human escalation. |
@@ -1205,6 +1209,8 @@ Optional. Every field receives its own default. All are positive integers except
1205
1209
  | `maxReconcileAttempts` | `3` | positive integer | Bound completed reconciles that leave the PR conflicted against an unchanged authoritative base. Moving-base races do not consume the bound. |
1206
1210
  | `maxReviewRounds` | `6` | positive integer | Default bound for each plan/review and implement/review convergence loop. An operator may replace it for one parked build loop and current spec revision with `ab answer --review-round-ceiling`; other builds are unaffected. |
1207
1211
  | `harvestThreshold` | `5` | positive integer | New unclaimed observation occurrences needed to start one harvest run. |
1212
+ | `janitorFailureAttentionSeconds` | `600` | positive integer | Consecutive janitor failure duration before build attention. |
1213
+ | `janitorBackoffMaxSeconds` | `300` | positive integer | Cap on exponential janitor retry delay, starting at 30 seconds. |
1208
1214
  | `harvestMaxDrift` | `3` | nonnegative integer | Other builds merged after the oldest unclaimed observation needed to start a run; `0` disables drift. |
1209
1215
 
1210
1216
  Dispatch failures share a `[policy].maxDispatchAttempts` budget (default 3) across
@@ -2015,4 +2021,33 @@ human landing needs no operator attention; overriding a hold is informational.
2015
2021
  If native auto-merge was armed, or an enable was in flight or indeterminate,
2016
2022
  record a possible stale-enable landing as contrary to policy and raise operator
2017
2023
  attention. Autobuild never rewrites the target to undo either outcome. Merge
2018
- gates and the serialized node-writer publication rules remain authoritative.
2024
+ gates and the serialized node-writer publication rules remain authoritative.
2025
+ ### Failure budgets and own-build read deferrals
2026
+
2027
+ `policy.maxVerifyAttempts` counts distinct failed logical verify cycles after
2028
+ the latest spec revision. Passing and skipped cycles, including target movement
2029
+ through restack or reconcile, consume zero. Cycle identifiers remain monotonic;
2030
+ pass, pass, pass, fail at cycle 4 spends one failure. Duplicate completion
2031
+ evidence for a failed cycle does not charge it twice.
2032
+
2033
+ Classified session deferrals consume no phase failures. Unsupported decisive
2034
+ facts retain the mixed-version wait gate and durable compatibility diagnostic.
2035
+ When the scoped `ab context` initial own-build read fails, the CLI best-effort
2036
+ writes `session.build-read-failed` with exact session, phase, round, operation
2037
+ `context`, reason `own-build-read`, and diagnostic. A valid terminal from that
2038
+ session wins if the agent recovers. Otherwise settlement records `phase.deferred`
2039
+ and `phase.deferral-escalated`, immediately projecting ordinary blocked attention.
2040
+ The raise cites `own-build-read:<evidenceSeq>`; replay repairs either settlement
2041
+ crash gap before launching another agent. An `escalation.answered` retry or
2042
+ guidance authorizes one fresh session without resetting genuine phase failures;
2043
+ a new classified failure parks again. There are zero automatic paid retries
2044
+ after this deferral. If evidence cannot be written, ordinary recovery applies;
2045
+ agent output and `no-terminal` alone never classify a read failure.
2046
+
2047
+ Ordinary silence, provider failures and session timeouts retain the runner's
2048
+ phase failure limit (`BuildRunnerOpts.maxPhaseAttempts`, default 2). This is
2049
+ an internal runner option, not an accepted `[policy]` TOML key. Reconcile
2050
+ execution and unchanged-base progress budgets retain their existing accounting.
2051
+
2052
+ Default `ab watch` and `ab wait --for attention` include
2053
+ `phase.deferral-escalated`; explicit event filters replace the default set.
@@ -256,3 +256,38 @@ client version. Without it, both fields are projected away, preserving historica
256
256
  strict decoders. Current hosted clients send all three capability headers and
257
257
  default absent kind to `work`. Unfiltered listing includes all ticket states and
258
258
  empty nodes for `ab ticket tree`; dispatch and landing behavior are unchanged.
259
+
260
+ ## Reading across upgrades
261
+
262
+ Within the advertised client compatibility window, readers with mixed-version
263
+ read support tolerate newer build and repository facts. Raw event endpoints
264
+ retain unknown types, payload fields and the producer's `compatibility`
265
+ metadata (`writerVersion` and `classification`). Known payload fields remain
266
+ validated. Adding an advisory field to an existing type is safe; a semantic
267
+ change that older kernels must respect requires a new decisive event type.
268
+
269
+ Named reduction responses retain exactly `{version, cursor, value}`. The
270
+ `x-autobuild-catalog-identity` response header identifies the backend's read
271
+ catalog independently of its package release and reducer version. Clients
272
+ accept an answer only when that identity, reducer version and finished shape
273
+ match their own; otherwise they replay raw events locally through the response
274
+ cursor. A missing header from an earlier service also triggers replay. A
275
+ service never invents an identity for a backend that supplies none. This keeps
276
+ released strict JSON decoders working without a new request capability.
277
+
278
+ Unknown advisory facts are counted and skipped. Unknown decisive facts defer
279
+ claiming, routing, landing and publication only for their build; status,
280
+ context and dashboards remain readable. One `build.compatibility-deferred`
281
+ attention fact per decisive boundary appears in the default `ab watch` stream.
282
+ Its diagnostic names unsupported types and producer releases: restart with a
283
+ build that understands those types. The type names matter even when both
284
+ processes report the same package version, as source builds may differ.
285
+ Legacy unknown facts lacking metadata are decisive and report that the writer
286
+ version is unavailable. Restarting with a reader that understands the facts
287
+ clears the guard through replay, without an escalation answer.
288
+
289
+ Caches are scoped to the reader's catalog. Replaying a reduction from an
290
+ unrecognized reducer version never overwrites its bytes; lower-version snapshot
291
+ writes cannot replace higher-version rows even at a later cursor. This
292
+ protects both upgrade directions. Readers predating this support still fail
293
+ closed; this guarantee does not widen the advertised client window.
@@ -15,7 +15,44 @@ build generation supplies evidence; ambiguous or unavailable evidence leaves the
15
15
  dependent queued. Confirmed landing SHA reachability can prove presence without
16
16
  a trailer, and a landed node transports its whole owned contribution. Empty
17
17
  completed nodes contribute nothing. Sibling work waits for landing into the common
18
- ancestor and cascade; same-node landings satisfy presence directly.
18
+ ancestor and demand the minimal restack path; same-node landings satisfy presence directly.
19
+
20
+ ## Choosing a destination
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
24
+ as one integrated change, or intermediate states should not ship independently.
25
+ Use root when every ticket is independently valuable and safe to land alone.
26
+ Nested nodes can collect a subfeature before contributing it to a larger feature.
27
+ A node provides one integrated delivery to its parent under the configured forge
28
+ method; it does not promise one physical Git commit.
29
+
30
+ Blockers and targets are independent: blockers order work; targets decide where
31
+ it lands. A blocker inside the same node resolves when its change lands into that
32
+ node, so a dependency chain can advance without waiting for root consent, subject
33
+ to the normal claim gates and presence rules. Dependencies across destinations
34
+ still need the presence evidence described above and in
35
+ [blocker resolution](ticket-dependencies.md#when-a-blocker-resolves).
36
+
37
+ Read the consuming repository's `autobuild.toml` and evaluate its effective
38
+ [landing policy](landing-policy.md) for the actual ticket kinds, destinations and
39
+ labels. Ordered `[[landing]]` rules use the first match; `from`, `into` and `label`
40
+ predicates are ANDed, with omitted predicates acting as wildcards. Without a
41
+ match, leaves default to auto and nodes to consent. Explain the resulting landing
42
+ and consent flow to the human in plain terms. Ask when grooming does not make the
43
+ destination choice clear. This decision is separate from workflow-state placement
44
+ and never authorizes promoting tickets to ready.
45
+
46
+ For example, **if** the matched rules require consent into root and allow automatic
47
+ landing into nodes (the staged-release example in the policy reference), a
48
+ root-targeted chain waits for consent separately for each ticket and ships each
49
+ intermediate change to the base branch. Under those same rules, children collect
50
+ automatically in a node and the verified, complete node waits for consent once
51
+ into root. Other matching rules can produce different flows; auto authorization
52
+ still obeys every readiness and merge gate. If the live dispatcher rejected a
53
+ configuration reload, the edited file is not evidence of its effective policy.
54
+ Resolve or report that uncertainty using existing operator repository status
55
+ and configuration-reload evidence before claiming which policy is active.
19
56
 
20
57
  ## Tickets and admission
21
58
 
@@ -25,8 +62,13 @@ cycles are refused. A node with targeting tickets cannot be demoted, even when
25
62
  those children are completed. Clear or reparent its children first.
26
63
 
27
64
  File tickets persist kind and target in frontmatter. Hosted tickets validate
28
- changes transactionally within the project. Linear uses the exact `node` label
29
- for kind and the parent relation for target only when that parent has the node
65
+ changes transactionally within the project. Existing tickets default to work with
66
+ no target; metadata changes increment the revision once, while equivalent aliases
67
+ and unchanged values do not. Legacy plugins without `integrationTree` support
68
+ read as work with no target and refuse explicit metadata writes, including clears
69
+ and mixed patches, with guidance to use a capable source.
70
+
71
+ Linear uses the exact `node` label for kind and the parent relation for target only when that parent has the node
30
72
  label. Ordinary grouping parents remain grouping and survive unrelated edits;
31
73
  explicit target clear clears the parent relation. Label replacement can demote a
32
74
  node and receives the same guards; explicit kind and labels must agree. Linear
@@ -40,6 +82,17 @@ no placeholder commit or PR. Idle nodes need no provisioned workspace, runner,
40
82
  execution lease or dispatch capacity. A PR opens or is adopted when the node
41
83
  has commits its current parent lacks; parent-only advancement remains empty.
42
84
 
85
+
86
+ A node requesting reconcile or verification is admitted before new ticket
87
+ claims. Its candidate occupancy excludes itself and capacity-bearing blocked or
88
+ paused descendants, following accepted source-qualified build target ancestry.
89
+ Running descendants and unrelated builds still count; ordinary blocked and
90
+ paused work retains its slot for every other admission. Provisioning reserves
91
+ node occupancy before the runner starts. This exception never raises the budget
92
+ for new claims. Status and both dashboards report actual occupancy, configured
93
+ capacity, effective display capacity and the nodes using descendant-held slots.
94
+ Idle collecting nodes remain free.
95
+
43
96
  Claims freeze the destination build generation and branch. Missing, unopened,
44
97
  landed, closed or aborted targets leave work queued with diagnostics. The newest
45
98
  generation wins; a closed generation never falls back to an older open one.
@@ -96,7 +149,7 @@ children retain their frozen destination.
96
149
  `--no-target` moves it to the root. Omitted fields preserve existing values;
97
150
  `--kind work` resets kind when valid. Only owned contributions replay onto the
98
151
  new parent, then the same PR is retargeted. Empty and same-head moves need no
99
- new commit or PR. Descendants follow through the normal cascade.
152
+ new commit or PR. Descendants restack only on their own demand.
100
153
 
101
154
  The request is durable before the provider write. Source readback accepts the
102
155
  new effective ancestry; branch publication, PR retargeting and completion have
@@ -115,3 +168,27 @@ written: abort and re-dispatch instead.
115
168
 
116
169
  See [forge requirements](landing-policy.md#forge-requirements),
117
170
  [restacking](restacking.md), and [migration from 0.x](migration-1.0.md).
171
+
172
+ ## Integration detail
173
+
174
+ Both dashboards show destination (with the configured-base annotation for root
175
+ targets), row progress and steps, branch/restack state, and all open and landed
176
+ children with titles and states. Open children come first; live children show
177
+ their current phase, unbuilt children read `queued`, contributions read `landed`.
178
+ Cancelled tickets without contributions are excluded. Verification names the
179
+ expected steps and only outcomes bound to the current node head and destination;
180
+ failures name the repair-child instruction. Landing explains the rule and mode;
181
+ ready consent names `l` and `ab land <slug>`. Conflicts name recorded files.
182
+ These are Store-only projections: additive `integration.observed.children`
183
+ metadata carries source/id, optional title and contribution build identity;
184
+ `node.item-conflicted.files` and conflicted `restack.replayed.files` retain paths.
185
+ Older events remain readable, with explicit unavailable titles/files. Display
186
+ metadata never changes completeness or landing eligibility.
187
+
188
+ ## Demand-driven parent freshness
189
+
190
+ Collecting nodes may intentionally trail their parent. They refresh before
191
+ verification and landing, for queued dependency presence, on operator request,
192
+ and after accepted re-parenting. Descendants need independent demand; presence
193
+ requests follow only the minimal proven ancestor path. See
194
+ [restacking](restacking.md#timing-and-evidence) for timing, requests and distance.
@@ -148,3 +148,14 @@ compatibility does not grant forge tree capabilities. Upgrade adapters before
148
148
  admitting nodes or requesting unsupported retargeting or landing operations.
149
149
  For the lifecycle see [integration trees](integration-tree.md); for old controls
150
150
  and upgrade conversion see [migration](migration-1.0.md).
151
+
152
+ Publication acknowledgement requires exact authoritative head readback, including
153
+ recovery. An unconfirmed candidate's descendants do not prove success. Durable
154
+ confirmed receipts preserve historical writes. Local refs cache confirmed heads;
155
+ remote expected-head leases and durable writer reservations still guard writes.
156
+ Local-git's shared database retains authoritative CAS.
157
+
158
+ Native cancellation receipts are candidate- and operation-specific. Publication
159
+ retries confirm forge state before reusing a receipt; external re-enables require
160
+ another confirmed cancellation. Classified transient landing failures retain
161
+ retry eligibility and recheck authorization after repository forge cooldown.
@@ -66,3 +66,12 @@ Check [forge requirements](landing-policy.md#forge-requirements) and
66
66
  [restacking](restacking.md) before enabling nodes on a plugin forge. Ensure
67
67
  archive publication/read permissions, tree capabilities and required merge
68
68
  methods are available; legacy read compatibility is insufficient.
69
+
70
+ ## Demand-driven node restacks
71
+
72
+ Parent movement is now observed without starting a node replay. Existing frozen
73
+ transactions finish after upgrade; subsequent replay needs completeness before
74
+ verification, freshness before landing, dependency presence, operator demand
75
+ (`ab restack <node>`), or accepted re-parenting. Nested nodes need independent
76
+ demand. Leaves keep their existing timing. There is no eager compatibility mode.
77
+ See [restacking](restacking.md) for durable requests and parent commit distance.