@defrex/autobuild 1.2.0 → 1.4.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 (164) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +416 -36
  3. package/docs/accounts.md +50 -1
  4. package/docs/answering-blocked-builds.md +4 -1
  5. package/docs/architecture.md +298 -17
  6. package/docs/build-store.md +18 -0
  7. package/docs/builds.md +7 -1
  8. package/docs/cli.md +1 -1
  9. package/docs/configuration-overview.md +6 -0
  10. package/docs/configuration.md +44 -19
  11. package/docs/dispatcher-hosting.md +42 -0
  12. package/docs/dispatcher.md +41 -0
  13. package/docs/forges.md +5 -0
  14. package/docs/integration-tree.md +24 -5
  15. package/docs/operating.md +11 -3
  16. package/docs/operator-api.md +81 -10
  17. package/docs/operator-surfaces.md +29 -0
  18. package/docs/plugin-authoring.md +51 -2
  19. package/docs/remote-store-protocol.md +321 -46
  20. package/docs/remote-ticket-protocol.md +12 -10
  21. package/docs/restacking.md +105 -3
  22. package/docs/setup.md +37 -8
  23. package/docs/skills.md +1 -1
  24. package/docs/spec-standard.md +41 -5
  25. package/docs/ticket-dependencies.md +8 -0
  26. package/docs/troubleshooting.md +9 -0
  27. package/docs/workspaces.md +1 -1
  28. package/package.json +4 -3
  29. package/packages/core/src/accounts/availability.ts +96 -0
  30. package/packages/core/src/accounts/local-owner.ts +49 -2
  31. package/packages/core/src/cli/attention.ts +2 -0
  32. package/packages/core/src/cli/binary.ts +17 -1
  33. package/packages/core/src/cli/context.ts +62 -0
  34. package/packages/core/src/cli/dashboard/model.ts +12 -3
  35. package/packages/core/src/cli/dashboard/poll.ts +65 -8
  36. package/packages/core/src/cli/dashboard/refresh.ts +2 -0
  37. package/packages/core/src/cli/dashboard/render.ts +46 -5
  38. package/packages/core/src/cli/dispatch-args.ts +27 -3
  39. package/packages/core/src/cli/dispatch-frontend.ts +179 -52
  40. package/packages/core/src/cli/dispatch-mode.ts +94 -0
  41. package/packages/core/src/cli/dispatch-preflight.ts +43 -0
  42. package/packages/core/src/cli/dispatch-repository-feed.ts +150 -33
  43. package/packages/core/src/cli/dispatch.ts +209 -36
  44. package/packages/core/src/cli/dispatcher-liveness.ts +6 -1
  45. package/packages/core/src/cli/forge-clear.ts +30 -0
  46. package/packages/core/src/cli/harvest.ts +2 -1
  47. package/packages/core/src/cli/help.ts +17 -3
  48. package/packages/core/src/cli/historical-build-state.ts +6 -0
  49. package/packages/core/src/cli/main.ts +43 -2
  50. package/packages/core/src/cli/publication-settlement.ts +17 -0
  51. package/packages/core/src/cli/remote-poll.ts +11 -1
  52. package/packages/core/src/cli/repository-status.ts +11 -0
  53. package/packages/core/src/cli/status.ts +7 -1
  54. package/packages/core/src/cli/wait.ts +9 -2
  55. package/packages/core/src/cli/watch.ts +47 -16
  56. package/packages/core/src/config/roles.ts +16 -1
  57. package/packages/core/src/events/catalog.ts +8 -0
  58. package/packages/core/src/events/forge-degradation-policy.ts +11 -0
  59. package/packages/core/src/events/payloads.ts +95 -2
  60. package/packages/core/src/events/policy.ts +19 -0
  61. package/packages/core/src/events/repository.ts +108 -2
  62. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +464 -0
  63. package/packages/core/src/kernel/change-presence.ts +74 -8
  64. package/packages/core/src/kernel/dispatch-placement.ts +30 -0
  65. package/packages/core/src/kernel/engine.ts +27 -12
  66. package/packages/core/src/kernel/generators/leaf-restack-log.ts +17 -1
  67. package/packages/core/src/kernel/generators/node-restack-log.ts +14 -0
  68. package/packages/core/src/kernel/leaf-restack-state.ts +24 -2
  69. package/packages/core/src/kernel/log-index.ts +1 -1
  70. package/packages/core/src/kernel/node-landing.ts +27 -10
  71. package/packages/core/src/kernel/node-polling.ts +40 -7
  72. package/packages/core/src/kernel/node-restack-demand.ts +75 -0
  73. package/packages/core/src/kernel/node-restack-state.ts +20 -1
  74. package/packages/core/src/kernel/node-restack-transaction.ts +47 -1
  75. package/packages/core/src/kernel/read-facts.ts +120 -9
  76. package/packages/core/src/kernel/reconcile-head.ts +34 -11
  77. package/packages/core/src/kernel/reconcile-restack.ts +106 -72
  78. package/packages/core/src/kernel/reducer-registry.ts +6 -0
  79. package/packages/core/src/kernel/reducer.ts +20 -2
  80. package/packages/core/src/kernel/replay-retention.ts +176 -0
  81. package/packages/core/src/kernel/target-lineage.ts +65 -0
  82. package/packages/core/src/kernel/target-observation.ts +117 -0
  83. package/packages/core/src/kernel/ticket-preparation.ts +66 -0
  84. package/packages/core/src/operator/annotations.ts +6 -0
  85. package/packages/core/src/operator/control.ts +20 -0
  86. package/packages/core/src/operator/index.ts +2 -0
  87. package/packages/core/src/operator/registry.ts +25 -13
  88. package/packages/core/src/operator/tickets.ts +8 -2
  89. package/packages/core/src/plugin-sdk/index.ts +1 -0
  90. package/packages/core/src/ports/forge/fake.ts +22 -0
  91. package/packages/core/src/ports/forge/git-rewrite.ts +49 -12
  92. package/packages/core/src/ports/forge/github.ts +42 -10
  93. package/packages/core/src/ports/forge/local-git.ts +16 -1
  94. package/packages/core/src/ports/runner/account-env.ts +60 -9
  95. package/packages/core/src/ports/runner/claude.ts +49 -45
  96. package/packages/core/src/ports/types.ts +58 -4
  97. package/packages/core/src/ports/workspace/account-policy.ts +2 -1
  98. package/packages/core/src/ports/workspace/commit-preservation.ts +175 -0
  99. package/packages/core/src/ports/workspace/create.ts +2 -0
  100. package/packages/core/src/ports/workspace/fake.ts +4 -0
  101. package/packages/core/src/ports/workspace/git-worktree.ts +22 -1
  102. package/packages/core/src/ports/workspace/vercel-sandbox.ts +304 -56
  103. package/packages/core/src/processes/build-runner.ts +240 -111
  104. package/packages/core/src/processes/dispatcher-selectors.ts +3 -2
  105. package/packages/core/src/processes/dispatcher.ts +732 -201
  106. package/packages/core/src/processes/execution-no-progress.ts +8 -0
  107. package/packages/core/src/processes/harvest-runner.ts +6 -7
  108. package/packages/core/src/processes/harvest.ts +11 -16
  109. package/packages/core/src/processes/publication-state.ts +2 -1
  110. package/packages/core/src/processes/repo-view.ts +25 -0
  111. package/packages/core/src/processes/workspace-preservation.ts +164 -0
  112. package/packages/core/src/scenarios/harness.ts +7 -0
  113. package/packages/core/src/store/adapter.ts +9 -0
  114. package/packages/core/src/store/artifact-meta.ts +7 -0
  115. package/packages/core/src/store/build-scope.ts +28 -0
  116. package/packages/core/src/store/contract.ts +182 -0
  117. package/packages/core/src/store/event-reads.ts +156 -0
  118. package/packages/core/src/store/local/schema.ts +11 -0
  119. package/packages/core/src/store/local/store.ts +117 -2
  120. package/packages/core/src/store/memory.ts +241 -0
  121. package/packages/core/src/store/phase-session.ts +47 -0
  122. package/packages/core/src/store/reduced-reads.ts +8 -0
  123. package/packages/core/src/store/reducer-value-shapes.json +10546 -8877
  124. package/packages/core/src/store/reducer-value-validation.ts +109 -6
  125. package/packages/core/src/store/reducer-values.ts +62 -2
  126. package/packages/core/src/store/remote/client.ts +208 -23
  127. package/packages/core/src/store/remote/compatibility.ts +195 -25
  128. package/packages/core/src/store/remote/errors.ts +16 -0
  129. package/packages/core/src/store/remote/index.ts +17 -0
  130. package/packages/core/src/store/remote/protocol.ts +30 -1
  131. package/packages/core/src/store/remote/released-clients.json +37 -0
  132. package/packages/core/src/store/remote/released-clients.ts +88 -0
  133. package/packages/core/src/store/remote/released-reducer-values/1.2.0.json +8129 -0
  134. package/packages/core/src/store/remote/released-reducer-values/1.3.0.json +25093 -0
  135. package/packages/core/src/store/remote/released-reducer-values/1.4.0.json +26128 -0
  136. package/packages/core/src/store/remote/released-reducer-values/index.ts +13 -0
  137. package/packages/core/src/store/remote/version.ts +8 -1
  138. package/packages/core/src/store/repo-state-events.ts +6 -3
  139. package/packages/core/src/store/scan-cadence.ts +15 -0
  140. package/packages/core/src/store/session-handle.ts +18 -0
  141. package/packages/core/src/store/snapshots.ts +16 -3
  142. package/packages/core/src/store/types.ts +29 -6
  143. package/packages/core/src/testing/dispatch-read-budget.ts +457 -7
  144. package/packages/core/src/testing/index.ts +6 -1
  145. package/packages/core/src/testing/reduced-read-budget.ts +1240 -9
  146. package/skills/guide/SKILL.md +220 -22
  147. package/skills/guide/references/accounts.md +50 -1
  148. package/skills/guide/references/integration-tree.md +24 -5
  149. package/skills/guide/references/operator-api.md +81 -10
  150. package/skills/guide/references/plugin-authoring.md +51 -2
  151. package/skills/guide/references/remote-store-protocol.md +321 -46
  152. package/skills/guide/references/remote-ticket-protocol.md +12 -10
  153. package/skills/guide/references/restacking.md +105 -3
  154. package/skills/guide/references/setup.md +37 -8
  155. package/skills/guide/references/spec-standard.md +41 -5
  156. package/skills/guide/references/ticket-dependencies.md +8 -0
  157. package/skills/implement/SKILL.md +12 -3
  158. package/skills/operate/SKILL.md +85 -12
  159. package/skills/plan/SKILL.md +27 -4
  160. package/skills/plan-review/SKILL.md +22 -2
  161. package/skills/reconcile/SKILL.md +16 -1
  162. package/skills/spec/SKILL.md +7 -4
  163. package/skills/tickets/SKILL.md +7 -3
  164. package/templates/hosted-service/package.json +2 -2
@@ -43,6 +43,12 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
43
43
  whether replay conflicted. A replay may originate at verify entry before any
44
44
  PR exists; `restackId` identifies an adopted automatic transaction. Never fetch, merge, rebase, select another base,
45
45
  or move the named branch yourself. Missing replay inputs require escalation, except a node item uses `nodeChange` and `conflict.baseSha` instead of `replay`.
46
+ If the manifest includes `workspaceRecovery`, read that materialized note.
47
+ It distinguishes exact preserved commits restored before the session from
48
+ known lost candidates and unobservable additional work. A retired reconcile
49
+ result is reconstructed on the prepared replay under its retained frozen
50
+ target; do not search for the known nonexistent candidate. Preserved work
51
+ remains the starting point for continuation.
46
52
  2. Inspect `git status` and the prepared replay. If conflicts remain, resolve
47
53
  them with the explicit charge to regress against neither side:
48
54
  - Preserve the behavior the spec and approved plan require.
@@ -51,7 +57,10 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
51
57
  change is now redundant, preserve an empty commit with `git commit
52
58
  --allow-empty --no-edit`; never skip away the build's identity. A clean
53
59
  replay already has its commit and still needs inspection and checks.
54
- 3. Run the repository's required checks. The result must be exactly one commit
60
+ 3. Run fast checks that cover the resolution — typecheck, lint, unit or focused
61
+ tests. Skip slow suites (integration, end-to-end, browser): post-reconcile
62
+ verification reruns the configured steps, and a step the repository's
63
+ post-reconcile policy skips is a risk it chose. The result must be exactly one commit
55
64
  with exactly one parent equal to `replay.targetBase` (or `conflict.baseSha` for a
56
65
  node item) and exactly one terminal
57
66
  `Autobuild-Build: <build>` trailer. For node items use the source identity in
@@ -73,6 +82,12 @@ do not repeat `ab done` after success. Post-reconcile verification follows the
73
82
  captured policy and begins a fresh cycle after confirmed publication. A conflict
74
83
  at initial verify entry still requires initial checks regardless of that policy.
75
84
 
85
+ A leaf replay resumed after a spec revision uses the revised spec as its
86
+ contract. Its historical plan and implement notes describe the retained change;
87
+ they cannot override that contract. After confirmed publication the build
88
+ restarts planning, implementation and review before verification, rather than
89
+ entering the ordinary post-reconcile verification cycle directly.
90
+
76
91
  ## When not to resolve
77
92
 
78
93
  Escalate semantic conflicts, incompatible or deleted branch history, or choices
@@ -87,7 +87,10 @@ in order, but as a conversation, not a form:
87
87
  [sizing and splitting](../ab-guide/references/spec-standard.md#sizing-and-splitting)
88
88
  before treating the work as several tickets: default to one larger ticket,
89
89
  and when a split is warranted, propose the seams and the blocker graph to
90
- the user with the reason for each cut.
90
+ the user with the reason for each cut. Check a large ticket against the
91
+ standard's implement-session ceiling even when its criteria hang together:
92
+ estimate the reading, edit sites, and iteration the implementer faces, and
93
+ tell the user when it looks too big for one session.
91
94
  3. **Out of scope.** Ask what adjacent work is explicitly excluded. Propose
92
95
  candidates — the tempting expansions you noticed while reading the code.
93
96
  4. **Evidence.** Link what exists: the error rates, the user reports, the
@@ -258,9 +261,9 @@ repository, report that rather than waiting on builds that cannot start.
258
261
 
259
262
  ## Rules
260
263
 
261
- - **Fewer, larger tickets.** Split only when sizing calls for it, cut at
262
- seams, and keep the blocker graph wide so independent tickets build
263
- together.
264
+ - **Fewer, larger tickets.** Split only when sizing calls for it — including
265
+ when a ticket would outgrow one implement session — cut at seams, and keep
266
+ the blocker graph wide so independent tickets build together.
264
267
  - The spec says **what and why, never how.** An exported, attached `design`
265
268
  asset is a contract on observable visual and reference outcomes — layout,
266
269
  content, states, copy, look — that plan, review, and verify judge against;
@@ -70,7 +70,7 @@ dispatcher never moves tickets into it and never dispatches from it unless
70
70
  .autobuild/tickets/
71
71
  triage/ # filed, not groomed — the inbox
72
72
  ready/ # groomed; file lifecycle-state gate satisfied
73
- doing/ # claimed; a build is running
73
+ doing/ # claimed; preparing or running a build
74
74
  done/ # merged
75
75
  icebox/ # example of a repo-added state, present only once created
76
76
  ```
@@ -165,9 +165,13 @@ capacity. Blocker edits must use the source-agnostic `ab ticket block` and
165
165
 
166
166
  When the dispatcher claims an eligible file ticket, it moves it to `doing/`,
167
167
  then to `done/` on merge or back to `triage/` if the build aborts or the spec
168
- bounces.
168
+ bounces. A caught failure before build creation returns it to configured Ready
169
+ after safe ownership checks; unfinished recovery stays durably tracked and
170
+ withheld from another claim. Uncertain ownership or externally changed/missing
171
+ tickets end automatic recovery with an `abandoned` resolution, leaving the
172
+ ticket unchanged for operator inspection. See [preparation recovery](../ab-guide/references/restacking.md#ticket-preparation-before-build-creation).
169
173
 
170
- **Don't hand-move anything out of `doing/`** — a build owns it. If you need to
174
+ **Don't hand-move anything out of `doing/`** — dispatch preparation or a build owns it. If you need to
171
175
  stop a build, that's `ab` (or a human), not `mv`.
172
176
 
173
177
  Before moving work into `ready/` (or any source's configured ready state),
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.2.0",
8
- "@defrex/autobuild": "1.2.0",
7
+ "@defrex/autobuild-hosted-store-service": "1.4.0",
8
+ "@defrex/autobuild": "1.4.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"