@defrex/autobuild 1.3.0 → 1.4.1
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.
- package/README.md +1 -1
- package/SPEC.md +307 -27
- package/docs/accounts.md +38 -0
- package/docs/architecture.md +198 -25
- package/docs/build-store.md +18 -0
- package/docs/builds.md +5 -1
- package/docs/cli.md +1 -1
- package/docs/configuration.md +38 -19
- package/docs/dispatcher-hosting.md +42 -0
- package/docs/dispatcher.md +41 -0
- package/docs/forges.md +5 -0
- package/docs/integration-tree.md +8 -0
- package/docs/operating.md +11 -3
- package/docs/operator-api.md +37 -4
- package/docs/plugin-authoring.md +45 -1
- package/docs/remote-store-protocol.md +262 -42
- package/docs/remote-ticket-protocol.md +12 -10
- package/docs/restacking.md +60 -3
- package/docs/setup.md +37 -8
- package/docs/skills.md +1 -1
- package/docs/spec-standard.md +37 -3
- package/docs/troubleshooting.md +9 -0
- package/docs/workspaces.md +1 -1
- package/package.json +4 -3
- package/packages/core/src/accounts/availability.ts +96 -0
- package/packages/core/src/accounts/local-owner.ts +49 -2
- package/packages/core/src/cli/attention.ts +2 -0
- package/packages/core/src/cli/binary.ts +17 -1
- package/packages/core/src/cli/context.ts +62 -0
- package/packages/core/src/cli/dashboard/model.ts +12 -3
- package/packages/core/src/cli/dashboard/poll.ts +65 -8
- package/packages/core/src/cli/dashboard/refresh.ts +2 -0
- package/packages/core/src/cli/dashboard/render.ts +46 -5
- package/packages/core/src/cli/dispatch-args.ts +27 -3
- package/packages/core/src/cli/dispatch-frontend.ts +187 -53
- package/packages/core/src/cli/dispatch-mode.ts +94 -0
- package/packages/core/src/cli/dispatch-preflight.ts +43 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +45 -9
- package/packages/core/src/cli/dispatch.ts +145 -11
- package/packages/core/src/cli/harvest.ts +2 -1
- package/packages/core/src/cli/help.ts +16 -3
- package/packages/core/src/cli/historical-build-state.ts +6 -0
- package/packages/core/src/cli/main.ts +15 -2
- package/packages/core/src/cli/publication-settlement.ts +17 -0
- package/packages/core/src/cli/remote-poll.ts +11 -1
- package/packages/core/src/cli/repository-status.ts +11 -0
- package/packages/core/src/cli/status.ts +7 -1
- package/packages/core/src/cli/wait.ts +9 -2
- package/packages/core/src/cli/watch.ts +38 -3
- package/packages/core/src/config/roles.ts +16 -1
- package/packages/core/src/events/catalog.ts +7 -0
- package/packages/core/src/events/payloads.ts +85 -2
- package/packages/core/src/events/policy.ts +10 -0
- package/packages/core/src/events/repository.ts +35 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +189 -0
- package/packages/core/src/kernel/dispatch-placement.ts +30 -0
- package/packages/core/src/kernel/engine.ts +19 -12
- package/packages/core/src/kernel/generators/leaf-restack-log.ts +17 -1
- package/packages/core/src/kernel/leaf-restack-state.ts +24 -2
- package/packages/core/src/kernel/log-index.ts +1 -1
- package/packages/core/src/kernel/node-landing.ts +27 -10
- package/packages/core/src/kernel/node-restack-demand.ts +1 -0
- package/packages/core/src/kernel/node-restack-state.ts +16 -1
- package/packages/core/src/kernel/node-restack-transaction.ts +14 -0
- package/packages/core/src/kernel/read-facts.ts +114 -9
- package/packages/core/src/kernel/reconcile-head.ts +34 -11
- package/packages/core/src/kernel/reconcile-restack.ts +106 -72
- package/packages/core/src/kernel/reducer-registry.ts +3 -0
- package/packages/core/src/kernel/reducer.ts +20 -2
- package/packages/core/src/kernel/replay-retention.ts +176 -0
- package/packages/core/src/kernel/target-lineage.ts +65 -0
- package/packages/core/src/kernel/target-observation.ts +117 -0
- package/packages/core/src/operator/registry.ts +5 -13
- package/packages/core/src/operator/tickets.ts +8 -2
- package/packages/core/src/plugin-sdk/index.ts +1 -0
- package/packages/core/src/ports/forge/fake.ts +22 -0
- package/packages/core/src/ports/forge/git-rewrite.ts +49 -12
- package/packages/core/src/ports/forge/github.ts +42 -10
- package/packages/core/src/ports/forge/local-git.ts +16 -1
- package/packages/core/src/ports/types.ts +58 -4
- package/packages/core/src/ports/workspace/account-policy.ts +2 -1
- package/packages/core/src/ports/workspace/commit-preservation.ts +175 -0
- package/packages/core/src/ports/workspace/create.ts +2 -0
- package/packages/core/src/ports/workspace/distribution-archive.ts +14 -4
- package/packages/core/src/ports/workspace/fake.ts +4 -0
- package/packages/core/src/ports/workspace/git-worktree.ts +22 -1
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +304 -56
- package/packages/core/src/processes/build-runner.ts +240 -111
- package/packages/core/src/processes/dispatcher-selectors.ts +3 -2
- package/packages/core/src/processes/dispatcher.ts +262 -80
- package/packages/core/src/processes/execution-no-progress.ts +7 -0
- package/packages/core/src/processes/harvest-runner.ts +6 -7
- package/packages/core/src/processes/publication-state.ts +2 -1
- package/packages/core/src/processes/repo-view.ts +22 -0
- package/packages/core/src/processes/tick-publication.ts +35 -47
- package/packages/core/src/processes/workspace-preservation.ts +164 -0
- package/packages/core/src/scenarios/harness.ts +7 -0
- package/packages/core/src/store/adapter.ts +9 -0
- package/packages/core/src/store/build-scope.ts +28 -0
- package/packages/core/src/store/contract.ts +125 -0
- package/packages/core/src/store/event-reads.ts +156 -0
- package/packages/core/src/store/local/schema.ts +11 -0
- package/packages/core/src/store/local/store.ts +117 -2
- package/packages/core/src/store/memory.ts +237 -0
- package/packages/core/src/store/phase-session.ts +47 -0
- package/packages/core/src/store/reduced-reads.ts +8 -0
- package/packages/core/src/store/reducer-value-shapes.json +6262 -5227
- package/packages/core/src/store/reducer-value-validation.ts +3 -0
- package/packages/core/src/store/reducer-values.ts +62 -2
- package/packages/core/src/store/remote/client.ts +161 -16
- package/packages/core/src/store/remote/compatibility.ts +177 -46
- package/packages/core/src/store/remote/errors.ts +16 -0
- package/packages/core/src/store/remote/index.ts +11 -0
- package/packages/core/src/store/remote/protocol.ts +22 -0
- package/packages/core/src/store/remote/released-clients.json +48 -0
- package/packages/core/src/store/remote/released-clients.ts +88 -0
- package/packages/core/src/store/remote/released-reducer-values/1.3.0.json +25093 -0
- package/packages/core/src/store/remote/released-reducer-values/1.4.0.json +26128 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +13 -0
- package/packages/core/src/store/remote/version.ts +5 -2
- package/packages/core/src/store/repo-state-events.ts +4 -3
- package/packages/core/src/store/scan-cadence.ts +15 -0
- package/packages/core/src/store/session-handle.ts +18 -0
- package/packages/core/src/store/types.ts +27 -6
- package/packages/core/src/testing/dispatch-read-budget.ts +313 -2
- package/packages/core/src/testing/index.ts +5 -0
- package/packages/core/src/testing/reduced-read-budget.ts +728 -5
- package/skills/guide/SKILL.md +201 -18
- package/skills/guide/references/accounts.md +38 -0
- package/skills/guide/references/integration-tree.md +8 -0
- package/skills/guide/references/operator-api.md +37 -4
- package/skills/guide/references/plugin-authoring.md +45 -1
- package/skills/guide/references/remote-store-protocol.md +262 -42
- package/skills/guide/references/remote-ticket-protocol.md +12 -10
- package/skills/guide/references/restacking.md +60 -3
- package/skills/guide/references/setup.md +37 -8
- package/skills/guide/references/spec-standard.md +37 -3
- package/skills/implement/SKILL.md +12 -3
- package/skills/operate/SKILL.md +87 -15
- package/skills/plan/SKILL.md +27 -4
- package/skills/plan-review/SKILL.md +22 -2
- package/skills/reconcile/SKILL.md +10 -1
- package/skills/spec/SKILL.md +7 -4
- package/templates/hosted-service/package.json +2 -2
package/docs/integration-tree.md
CHANGED
|
@@ -297,3 +297,11 @@ A concurrent state change refuses publication with a retry explanation;
|
|
|
297
297
|
uncited artifacts are inert. Leaves still require an open escalation and
|
|
298
298
|
restart from `plan` after any unfinished reconcile resumes under the revised
|
|
299
299
|
spec and its publication is confirmed.
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
Parent node restacks are kernel rewrites. Child admission uses the dispatcher's
|
|
304
|
+
bounded indexed publication-receipt proof, retained in `target.moved.lineage`,
|
|
305
|
+
including after a child was paused across multiple restacks. External rewrites
|
|
306
|
+
without proof raise attention; node ownership alone never authorizes replay.
|
|
307
|
+
See [restacking](restacking.md).
|
package/docs/operating.md
CHANGED
|
@@ -59,16 +59,24 @@ without withdrawal support fall back silently. SIGKILL still relies on TTL expir
|
|
|
59
59
|
|
|
60
60
|
Re-arm with `bun ab watch --operator --json --since <watch-cursor>` using only
|
|
61
61
|
the standing watch's own cursor. This preserves one ID and original start time
|
|
62
|
-
across a re-arm gap of up to five minutes.
|
|
62
|
+
across a presence re-arm gap of up to five minutes. This presence TTL is separate
|
|
63
|
+
from hosted event-window eligibility. After termination withdraws presence,
|
|
63
64
|
the same cursor re-registers the same ID and start time. Reconcile current and
|
|
64
65
|
newly dispatched builds after arming and on timeout. Keep operating after the initial work ends,
|
|
65
66
|
until you end or hand off the role. `wait` does not heartbeat or carry registration
|
|
66
67
|
identity: a separate unflagged diagnostic wait/watch must never replace the
|
|
67
68
|
standing monitor or supply its resume cursor. MCP presence is deferred.
|
|
68
69
|
|
|
70
|
+
Keep `--since` for normal re-arms. Hosted resume accepts cursors at or above
|
|
71
|
+
`max(0, head - 1000)` in each monitored stream: the inclusive window is 1,000
|
|
72
|
+
sequence positions behind its head. If a cursor is too old, re-arm without
|
|
73
|
+
`--since` and reconcile repository and build status. That fresh attachment cannot
|
|
74
|
+
recover the unavailable historical gap; status reconciliation does not restore
|
|
75
|
+
one-off events from that gap.
|
|
76
|
+
|
|
69
77
|
- **Default filter:** actionable attention only, such as escalations and ready merges awaiting consent. Add `--event` globs for routine lifecycle events.
|
|
70
78
|
- **Starts now:** a fresh watch ignores history, so check current status too.
|
|
71
|
-
- **Resumable:** pass the opaque cursor from the JSON output back with `--since` to receive events recorded while away. The final JSON line always carries one.
|
|
79
|
+
- **Resumable:** pass the opaque cursor from the JSON output back with `--since` to receive events recorded while away within the hosted window described above. The final JSON line always carries one.
|
|
72
80
|
- **Duration:** 30 minutes by default; `--timeout 0` keeps it open.
|
|
73
81
|
|
|
74
82
|
```
|
|
@@ -83,7 +91,7 @@ bun ab wait my-build --for attention --json --timeout 5m
|
|
|
83
91
|
| 2 | Every named build ended without matching |
|
|
84
92
|
| 3 | Timed out |
|
|
85
93
|
|
|
86
|
-
Existing attention returns immediately, even with a cursor, so looping `wait` doesn't consume events. Use `watch --since` for that.
|
|
94
|
+
Existing attention returns immediately, even with a cursor, so looping `wait` doesn't consume events. Use `watch --since` for that. Hosted `wait --since` uses the same inclusive 1,000-position resume window and too-old recovery described above: re-arm without `--since`, reconcile repository and build status, and account for the unavailable historical gap.
|
|
87
95
|
|
|
88
96
|
## Answer and pause
|
|
89
97
|
|
package/docs/operator-api.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A conforming hosted instance implements this normative polling-oriented operator
|
|
4
4
|
contract at
|
|
5
|
-
`/operator/v1/repos/{repo}`. It is versioned with remote store protocol **
|
|
5
|
+
`/operator/v1/repos/{repo}`. It is versioned with remote store protocol **7**.
|
|
6
6
|
Every request must send `X-Autobuild-Version`,
|
|
7
|
-
`X-Autobuild-Protocol-Version:
|
|
7
|
+
`X-Autobuild-Protocol-Version: 7`, and `Authorization: Bearer …`. Identity is
|
|
8
8
|
checked before authentication or resource lookup.
|
|
9
9
|
|
|
10
10
|
Project credentials are opaque `abp_1_<id>_<secret>` bearer values bound to one
|
|
@@ -271,7 +271,7 @@ The default watch reports actionable conditions only:
|
|
|
271
271
|
- `build.janitor-failing`: a build has reached the configured consecutive-failure threshold; a successful janitor attempt clears it.
|
|
272
272
|
- `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
|
|
273
273
|
|
|
274
|
-
- Build `escalation.raised`, `integration.landed`, `node.item-conflicted`, or
|
|
274
|
+
- Build `escalation.raised`, `integration.landed`, `node.item-conflicted`, `target.rewritten`, or
|
|
275
275
|
conflicted `restack.replayed` events. `build.consent-ready` is the single
|
|
276
276
|
signal for a ready consent or held merge, including first repository-wide
|
|
277
277
|
discovery. Its target has the queue entry shape `{kind, branch, ticket?, build?}`.
|
|
@@ -311,7 +311,7 @@ have `repo` and null build/state. Source observations also report
|
|
|
311
311
|
|
|
312
312
|
Every record carries a cursor, including timer-only records. Resuming suppresses
|
|
313
313
|
delivered merge decisions and persistence episodes even when stream positions
|
|
314
|
-
did not advance. Old v1 cursors remain valid: historical eligible merge
|
|
314
|
+
did not advance. Old v1 cursors remain valid inside the hosted 1,000-position resume window: historical eligible merge
|
|
315
315
|
decisions are treated as consumed; active overdue repository episodes may
|
|
316
316
|
report because old watches had no persistence notification. Fresh attachment
|
|
317
317
|
silently baselines historical direct events and merge decisions, but retains
|
|
@@ -328,11 +328,32 @@ self-healing failures. A merge match uses the watch observation with
|
|
|
328
328
|
`condition: "attention"`. Explicit `--event` globs remain event-only.
|
|
329
329
|
Watch and wait preserve each other's cursor notification metadata.
|
|
330
330
|
|
|
331
|
+
Normal re-arms retain `--since`. Hosted watch/wait resume is gap-proportional
|
|
332
|
+
inside a 1,000-sequence-position window, inclusive at `head - 1000`. Expired
|
|
333
|
+
cursors fail with typed `cursor-too-old` and the oldest servable cursor; re-arm
|
|
334
|
+
without `--since` and reconcile repository/build status, acknowledging the lost
|
|
335
|
+
historical gap. An ordinary reducer upgrade preserves valid cursors. A retired
|
|
336
|
+
seed generation instead requires an upgrade/restart before fresh attachment;
|
|
337
|
+
checkpoint integrity errors are terminal and never trigger replay from zero.
|
|
338
|
+
|
|
339
|
+
The MCP `builds.events` tool returns `{events, cursor, hasMore}`, at most 256
|
|
340
|
+
events per call. Follow `cursor` while `hasMore` is true to traverse a build's
|
|
341
|
+
complete history without omission. Waiting remains bounded and applies only
|
|
342
|
+
when no events are available. Repository event reads have a 1,000-position
|
|
343
|
+
window; build history itself remains available through explicit pages.
|
|
344
|
+
|
|
345
|
+
|
|
331
346
|
Hosted ticket tools resolve independent project ticket policy before legacy uploaded
|
|
332
347
|
configuration. Queue, detail, state discovery and mutations work before any build
|
|
333
348
|
or dispatcher run; detail reports a null matching build. Ticket policy publication
|
|
334
349
|
never creates synthetic build or repository history.
|
|
335
350
|
|
|
351
|
+
Ticket detail and mutation results prefer exact normalized ticket ids when associating
|
|
352
|
+
a build. If no exact match exists, only legacy hosted `ticket-<uuid>` storage
|
|
353
|
+
references require optional alias resolution, once per distinct reference. Readable
|
|
354
|
+
historical ids require no ticket lookup. Failed optional alias resolution does not
|
|
355
|
+
fail ticket detail or a completed mutation; matches already resolved remain eligible.
|
|
356
|
+
|
|
336
357
|
Ticket results include kind (default work) and optional same-source node target.
|
|
337
358
|
Metadata-only patches are accepted. Target validation and demotion guards apply
|
|
338
359
|
to CLI, HTTP and MCP alike; unsupported sources refuse even explicit defaults
|
|
@@ -451,6 +472,18 @@ projects return the same unknown-repository result as absent projects. Machine c
|
|
|
451
472
|
|
|
452
473
|
### Permanent project deletion
|
|
453
474
|
|
|
475
|
+
The browser requires the exact full repository identity in a transient dialog field;
|
|
476
|
+
confirm stays disabled for empty or mismatched input and focus starts in the field.
|
|
477
|
+
The handler independently binds that identity to the selected repository and its
|
|
478
|
+
fresh validated preview. Only JSON `{deleted:true}` acknowledges completion.
|
|
479
|
+
After any failed or unrecognized deletion response, the browser shows
|
|
480
|
+
“Deletion outcome unknown; reload to check” and holds the row in its original slot
|
|
481
|
+
without actions, even after dismissal. Only a complete successful discovery begun
|
|
482
|
+
by Reload after the attempt settles it: absence removes the row, presence restores
|
|
483
|
+
its authorized actions, and pending cleanup restores Finish deletion with a fresh
|
|
484
|
+
preview and exact typing. An earlier or unsuccessful read cannot settle the outcome.
|
|
485
|
+
The server's `{repo}` body and generation-bound If-Match contract are unchanged.
|
|
486
|
+
|
|
454
487
|
Super users and the owner of a project's organization can delete it from the
|
|
455
488
|
Projects page. Owners see only projects in organizations they own; Move and
|
|
456
489
|
Assign remain super-user operations. The shared confirmation dialog names the project,
|
package/docs/plugin-authoring.md
CHANGED
|
@@ -61,7 +61,12 @@ Declare served model prefixes and a default. Optional tool-free `oneShot` sits b
|
|
|
61
61
|
Reconcile requires the optional grouped `Forge.rewrite` capability:
|
|
62
62
|
|
|
63
63
|
1. Snapshot the actual build branch into a build-private ref.
|
|
64
|
-
2. Publish immutable exact-SHA refs under `refs/autobuild/archive/<slug>/<sha>`.
|
|
64
|
+
2. Publish immutable exact-SHA refs under `refs/autobuild/archive/<slug>/<sha>`. Remote
|
|
65
|
+
archives also publish commits present only on the remote: GitHub uses create-only
|
|
66
|
+
Git-reference REST creation when the workspace lacks the commit, retaining guarded
|
|
67
|
+
Git pushes for local objects. Exact remote readback confirms publication, then a
|
|
68
|
+
depth-one fetch by the archive ref (without tags or configured refmap expansion)
|
|
69
|
+
restores missing commits and verifies them locally before returning.
|
|
65
70
|
3. Replace the explicit branch, leased on an explicit expected remote head.
|
|
66
71
|
|
|
67
72
|
- Return `lease-mismatch` separately from transport, auth and policy failures.
|
|
@@ -71,6 +76,45 @@ Reconcile requires the optional grouped `Forge.rewrite` capability:
|
|
|
71
76
|
- Older forge plugins still load; reconcile refuses them actionably.
|
|
72
77
|
- Remote workspace providers also need trusted `WorkspacePublication.rewrite` after guest teardown; ordinary `publish` can't publish a restack.
|
|
73
78
|
|
|
79
|
+
### Destination observation and ancestry
|
|
80
|
+
|
|
81
|
+
`remoteBranchSha(branch)` must read the authoritative forge branch. Its absence
|
|
82
|
+
or failure defers observation; there is no host-checkout fallback. The optional
|
|
83
|
+
`isCommitAncestor(ancestor, descendant)` compares immutable full OIDs: return
|
|
84
|
+
false only for a proven non-descendant, and throw for missing objects, transport,
|
|
85
|
+
authentication, malformed responses or rate limits. Missing capability withholds
|
|
86
|
+
new replay requiring proof. GitHub uses exact-SHA comparison; local-git requires
|
|
87
|
+
an explicit served `repoRoot`. Unknown ancestry never authorizes replay.
|
|
88
|
+
|
|
89
|
+
Stores may expose `getNodeRewrite(node, previousHead, beforePrevious)` as a bounded point
|
|
90
|
+
lookup of a durable `node.rewritten` receipt. Built-in adapters index these
|
|
91
|
+
validated publication facts atomically with append, including transactional
|
|
92
|
+
deposits. The dispatcher uses at most 64 hops per baseline to prove kernel node
|
|
93
|
+
restacks and records `target.moved.lineage` for scoped runners. There is no
|
|
94
|
+
history-download fallback when the capability or a receipt is absent.
|
|
95
|
+
With `beforePrevious`, return the publication immediately preceding the latest
|
|
96
|
+
receipt keyed by that previous head, using indexed cursor and result lookups.
|
|
97
|
+
This lets lineage proofs cross forward sibling landings between restacks; every
|
|
98
|
+
intervening forward gap still requires immutable ancestry proof.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Workspace preservation
|
|
102
|
+
|
|
103
|
+
Remote providers expose trusted `WorkspacePublication.preserve` and
|
|
104
|
+
`recoverCandidate`; local providers may supply `WorkspaceProvider.preservation`
|
|
105
|
+
without changing the remote-publication discriminator. Missing capabilities fail
|
|
106
|
+
safely at destructive boundaries. `WorkspaceRecovery.fence(handle)` reports
|
|
107
|
+
confirmed, absent, or unknown without deleting an environment or its snapshots.
|
|
108
|
+
Only dispatcher-authorized reap follows the durable fence and preservation/loss
|
|
109
|
+
receipt. `provision` accepts exact `restoration` heads; branch ancestry must be
|
|
110
|
+
verified, and detached producer objects must never overwrite the named branch.
|
|
111
|
+
Provision/start failures signal `WorkspaceCleanupRequired` rather than deleting
|
|
112
|
+
or implicitly recreating an existing checkout. A confirmed `snapshot_not_found`
|
|
113
|
+
lookup establishes filesystem absence, while retaining the stale name for
|
|
114
|
+
dispatcher-authorized deletion. Other provider failures remain unknown and must
|
|
115
|
+
never be converted into loss evidence. Credentials stay in trusted transport policy,
|
|
116
|
+
never guest environment or agent commands.
|
|
117
|
+
|
|
74
118
|
### Publication readback
|
|
75
119
|
|
|
76
120
|
Publication succeeds only when an authoritative branch-head readback equals the frozen intended SHA, including recovery after a failed push. Unconfirmed candidate ancestry never proves publication.
|