@defrex/autobuild 1.19.0 → 1.21.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.
- package/README.md +1 -1
- package/SPEC.md +88 -11
- package/docs/architecture.md +48 -8
- package/docs/assets/headline-wide.png +0 -0
- package/docs/dispatcher-hosting.md +6 -1
- package/docs/dispatcher.md +2 -2
- package/docs/merge-policy.md +2 -1
- package/docs/operator-surfaces.md +1 -1
- package/docs/plugin-authoring.md +11 -4
- package/docs/process-ownership.md +43 -0
- package/docs/remote-store-protocol.md +7 -0
- package/docs/restacking.md +11 -2
- package/docs/setup.md +7 -2
- package/docs/troubleshooting.md +6 -0
- package/docs/verification.md +1 -1
- package/package.json +3 -3
- package/packages/core/src/cli/dashboard/model.ts +1 -0
- package/packages/core/src/cli/dashboard/vocabulary.ts +3 -0
- package/packages/core/src/cli/dispatch.ts +3 -0
- package/packages/core/src/events/repository.ts +45 -1
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +1 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/3f0c4e6d1d54e5bf.json +92 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/b440840a01ea216f.json +115 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +47 -6
- package/packages/core/src/kernel/engine.ts +15 -2
- package/packages/core/src/kernel/janitor-failure.ts +1 -0
- package/packages/core/src/kernel/reducer-revisions.ts +3 -0
- package/packages/core/src/kernel/repository-read-facts.ts +6 -1
- package/packages/core/src/processes/build-runner.ts +67 -7
- package/packages/core/src/processes/check-termination.ts +44 -0
- package/packages/core/src/processes/dispatcher.ts +472 -57
- package/packages/core/src/processes/pass-stages.ts +94 -4
- package/packages/core/src/processes/publication-loss.ts +29 -0
- package/packages/core/src/processes/repo-view.ts +50 -10
- package/packages/core/src/store/contract.ts +43 -0
- package/packages/core/src/store/digest.ts +19 -1
- package/packages/core/src/store/reducer-value-shapes.json +5605 -5454
- package/packages/core/src/store/remote/protocol.ts +3 -0
- package/packages/core/src/store/remote/released-clients.json +22 -0
- package/packages/core/src/store/remote/released-reducer-values/1.20.0.json +36469 -0
- package/packages/core/src/store/remote/released-reducer-values/1.21.0.json +36612 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -14
- package/packages/core/src/store/types.ts +5 -0
- package/packages/core/src/testing/reduced-read-budget.ts +412 -2
- package/skills/code-review/SKILL.md +5 -0
- package/skills/finalize/SKILL.md +5 -0
- package/skills/guide/SKILL.md +36 -9
- package/skills/guide/references/merge-policy.md +2 -1
- package/skills/guide/references/plugin-authoring.md +11 -4
- package/skills/guide/references/process-ownership.md +43 -0
- package/skills/guide/references/remote-store-protocol.md +7 -0
- package/skills/guide/references/restacking.md +11 -2
- package/skills/guide/references/setup.md +7 -2
- package/skills/harvest/SKILL.md +5 -0
- package/skills/harvest-review/SKILL.md +5 -0
- package/skills/implement/SKILL.md +5 -0
- package/skills/judge/SKILL.md +4 -0
- package/skills/operate/SKILL.md +12 -0
- package/skills/plan/SKILL.md +5 -0
- package/skills/plan-review/SKILL.md +5 -0
- package/skills/propose/SKILL.md +5 -0
- package/skills/reconcile/SKILL.md +5 -0
- package/templates/hosted-service/package.json +2 -2
|
@@ -264,7 +264,8 @@ displaced history under immutable exact archive refs
|
|
|
264
264
|
- **Workspace preservation** keeps unpublished workspace commits under archive
|
|
265
265
|
refs, else as BuildStore copies. When neither holds them, release is refused,
|
|
266
266
|
except under abort cleanup, which records `workspace.commits-lost` and
|
|
267
|
-
releases
|
|
267
|
+
releases, and merged completion, which releases without preserving: the
|
|
268
|
+
merged commit is already on the target.
|
|
268
269
|
- There is never a branch or tag fallback. When an environment refuses non-branch
|
|
269
270
|
Git pushes, as Claude Code on the web's GitHub proxy does, the GitHub adapter
|
|
270
271
|
creates the same archive ref through REST ref creation and confirms it by exact
|
|
@@ -136,8 +136,8 @@ applying a thin replay pack whose base is missing, and return true for an
|
|
|
136
136
|
available leaf candidate even when archiving it is refused. Missing capabilities fail
|
|
137
137
|
safely at destructive boundaries. `WorkspaceRecovery.fence(handle)` reports
|
|
138
138
|
confirmed, absent, or unknown without deleting an environment or its snapshots.
|
|
139
|
-
|
|
140
|
-
receipt. `provision` accepts exact `restoration` heads; branch ancestry must be
|
|
139
|
+
Outside merged completion, dispatcher-authorized reap follows only the durable
|
|
140
|
+
fence and preservation/loss receipt. `provision` accepts exact `restoration` heads; branch ancestry must be
|
|
141
141
|
verified, and detached producer objects must never overwrite the named branch.
|
|
142
142
|
`provision` also receives `restorationArchives`: `local` for the local-git
|
|
143
143
|
forge, whose repository already holds the archive refs and must not be fetched
|
|
@@ -158,9 +158,16 @@ archive transport refuses a head's archive ref, call it with your trusted Git
|
|
|
158
158
|
transport. It keeps the head as a BuildStore copy and resolves to the copy's
|
|
159
159
|
exclusion base; record the head with that `storeBase` in place of `remoteRef`.
|
|
160
160
|
It throws when the head cannot be kept; rethrow so release is refused. A
|
|
161
|
-
provider that ignores it preserves strictly. Abort cleanup is
|
|
161
|
+
provider that ignores it preserves strictly. Abort cleanup is one exception:
|
|
162
162
|
when preservation fails, the dispatcher records the commits as lost
|
|
163
|
-
(`workspace.commits-lost`) and releases anyway.
|
|
163
|
+
(`workspace.commits-lost`) and releases anyway. Merged completion is the other:
|
|
164
|
+
the merged commit is on the target, so the dispatcher records `build.completed`
|
|
165
|
+
first, then reaps the workspace with no fence, `preserve` call or resume. A
|
|
166
|
+
pending publication passes the merged pre-release guard before reap. For a
|
|
167
|
+
merged build, `reap` can rely only on that guard having run and on the build
|
|
168
|
+
being terminal; it must not expect a fence or receipt, and a reap that cannot
|
|
169
|
+
finish stays pending and is retried on later janitor visits. Every other
|
|
170
|
+
release keeps the strict ordering above. A `restoration` head may name
|
|
164
171
|
`storeBase` instead of `remoteRef`. Then `provision` receives
|
|
165
172
|
`restoreStored({ exec, workspacePath, sha })`: when the commit is absent, call
|
|
166
173
|
it with your trusted transport, and fail provisioning when it resolves false.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Stopping processes on a shared host
|
|
2
|
+
|
|
3
|
+
Several builds' agents and the kernel's verify commands run side by side on
|
|
4
|
+
one host. A name or pattern kill matches every process with that name, so it
|
|
5
|
+
also stops other builds' work. The victim's verify check records an ordinary
|
|
6
|
+
failed attempt and spends verify budget, and nothing in its output tells the
|
|
7
|
+
kill apart from a real failure.
|
|
8
|
+
|
|
9
|
+
## Rule
|
|
10
|
+
|
|
11
|
+
Stop only processes your session started, by the PID or process group you
|
|
12
|
+
recorded when you started them.
|
|
13
|
+
|
|
14
|
+
## Forbidden
|
|
15
|
+
|
|
16
|
+
- `pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`.
|
|
17
|
+
- Any selection by command name or pattern, including names that look like
|
|
18
|
+
yours: `tsc`, `node`, `bun`, browsers, dev servers.
|
|
19
|
+
|
|
20
|
+
## Recipes
|
|
21
|
+
|
|
22
|
+
| Need | Do |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Stop a background command | `cmd & pid=$!` when starting it, then `kill "$pid"` |
|
|
25
|
+
| Stop a process tree | `setsid cmd & pid=$!`, then `kill -TERM -- -"$pid"` |
|
|
26
|
+
| Bound a command's runtime | `timeout 300 cmd`, or the harness's own background-task stop |
|
|
27
|
+
| The PID was lost | Leave the process; it ends with the session's teardown. Never hunt for it by name. |
|
|
28
|
+
|
|
29
|
+
**Not yours:** the kernel's verify check commands and every other session's
|
|
30
|
+
processes, whatever their names.
|
|
31
|
+
|
|
32
|
+
## Reading a signal-killed verify report
|
|
33
|
+
|
|
34
|
+
A check command that dies from a signal names the signal on the first line
|
|
35
|
+
of its `verify-report:<step>` artifact, and its metadata carries `signal` and
|
|
36
|
+
`runnerShutdown`.
|
|
37
|
+
|
|
38
|
+
- `runnerShutdown: false` — the runner's own shutdown was not in effect, so
|
|
39
|
+
another process sent the signal. Rerun the check before changing code, and
|
|
40
|
+
record it with `ab observe` if it recurs.
|
|
41
|
+
- `runnerShutdown: true` — the runner stopped the check during its own
|
|
42
|
+
shutdown. That is an orderly stop: not a failure, not counted, and the step
|
|
43
|
+
reruns after relaunch.
|
|
@@ -899,6 +899,13 @@ The member is additive and keeps the protocol version. A digest without it is
|
|
|
899
899
|
an older service's answer: the activity pass fails closed with a typed
|
|
900
900
|
capability error and never reads the build's events instead.
|
|
901
901
|
|
|
902
|
+
`releasePending` is `true` on a completed build whose PR merged while its
|
|
903
|
+
workspace is still open (no `workspace.released` after its latest
|
|
904
|
+
`workspace.provisioned` or `workspace.cleanup-required`). It keeps the build in
|
|
905
|
+
the dispatcher's janitor work set until its release lands. The member is
|
|
906
|
+
additive and keeps the protocol version; an older service omits it, and its
|
|
907
|
+
clients retry a merged build's pending release only once the service deploys.
|
|
908
|
+
|
|
902
909
|
The digest is derived from the event log on every call — the server persists
|
|
903
910
|
nothing and there is no refresh step. Protocol version `3` reshaped the
|
|
904
911
|
digest's `observations` from bare sequence numbers to `{seq, ts}` pairs and
|
|
@@ -199,8 +199,17 @@ displaced heads and the temporary change, best effort, per commit:
|
|
|
199
199
|
transaction reserves again from the published branches.
|
|
200
200
|
- Workspace preservation is strict: archive ref, else a `history-objects-<sha>`
|
|
201
201
|
store copy over the preservation base, else release is refused. Abort cleanup
|
|
202
|
-
is
|
|
203
|
-
`workspace.commits-lost` and releases.
|
|
202
|
+
is one exception: when preservation fails it records
|
|
203
|
+
`workspace.commits-lost` and releases. Merged completion is the other: the
|
|
204
|
+
merged commit is on the target, so a merged build's workspace is released
|
|
205
|
+
without preservation, after `build.completed` is recorded.
|
|
206
|
+
Before cleanup, a pending `publication.requested` is covered when its commit
|
|
207
|
+
equals the merged PR's head or landing, or a host-side forge ancestry proof
|
|
208
|
+
places it below either. A covered request is recorded `publication.lost`
|
|
209
|
+
without settlement; an uncovered request, or one whose ancestry is unknown,
|
|
210
|
+
is settled as every release settles it. A cleanup the pass cannot finish
|
|
211
|
+
leaves the build completed with `releasePending` set, and later janitor
|
|
212
|
+
visits retry it. Store-kept
|
|
204
213
|
heads go on decisive `workspace.commits-retained`, and replacement
|
|
205
214
|
provisioning restores them on any host.
|
|
206
215
|
|
|
@@ -416,6 +416,9 @@ repositories or configuration through parent directories, including focused test
|
|
|
416
416
|
and Git probes. Do not relocate required installed tooling or retained evidence;
|
|
417
417
|
manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
418
418
|
|
|
419
|
+
Stop only processes the session started, by recorded PID or process group;
|
|
420
|
+
see [process ownership](process-ownership.md).
|
|
421
|
+
|
|
419
422
|
|
|
420
423
|
1. Run `ab context` and read `"$AB_CONTEXT_DIR/context.json"`. The verifier receives
|
|
421
424
|
`$AB_CONTEXT_DIR/spec.md`, the configured step,
|
|
@@ -519,8 +522,10 @@ Archive refs are a recommendation (WARN or UNKNOWN, never FAIL):
|
|
|
519
522
|
build and proceed.
|
|
520
523
|
- **Workspace preservation** keeps unpublished workspace commits as BuildStore
|
|
521
524
|
copies where refused, and refuses to release the workspace only when the store
|
|
522
|
-
copy fails too. Abort cleanup is
|
|
523
|
-
`workspace.commits-lost` and releases.
|
|
525
|
+
copy fails too. Abort cleanup is one exception: it records
|
|
526
|
+
`workspace.commits-lost` and releases. Merged completion is the other: the
|
|
527
|
+
merged PR head already covers the work, so the workspace is released without
|
|
528
|
+
preservation after the build completes.
|
|
524
529
|
|
|
525
530
|
Require **linear history** on protected root and node target branches to prevent
|
|
526
531
|
merge commits from GitHub's update-branch action. On the configured root, enable
|
package/skills/harvest/SKILL.md
CHANGED
|
@@ -9,6 +9,11 @@ You are the harvest producer. The repository runner has already scanned and
|
|
|
9
9
|
claimed a fixed set of structured `observation.recorded` occurrences. You
|
|
10
10
|
cluster and author; you never create or move tickets.
|
|
11
11
|
|
|
12
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
13
|
+
your session started, by the PID or process group you recorded; never by name
|
|
14
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
15
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
16
|
+
|
|
12
17
|
1. Run `ab harvest context`. Read `.ab/observations.json`,
|
|
13
18
|
`.ab/originating-tickets.json`, and `.ab/ledger.json`. The originating-ticket
|
|
14
19
|
context shows scan-time source match, existence, and resolution state; filing
|
|
@@ -8,6 +8,11 @@ description: Fresh adversarial review of one harvest proposal set. Invoked only
|
|
|
8
8
|
You are the fresh skeptic in the observation-harvest convergence loop. You do
|
|
9
9
|
not author proposals or touch tickets.
|
|
10
10
|
|
|
11
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
12
|
+
your session started, by the PID or process group you recorded; never by name
|
|
13
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
14
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
15
|
+
|
|
11
16
|
1. Run `ab harvest context`.
|
|
12
17
|
2. Review `.ab/proposals.json` against `.ab/observations.json`,
|
|
13
18
|
`.ab/originating-tickets.json`, `.ab/ledger.json`, and every prior
|
|
@@ -24,6 +24,11 @@ repositories or configuration through parent directories, including focused test
|
|
|
24
24
|
and Git probes. Do not relocate required installed tooling or retained evidence;
|
|
25
25
|
manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
26
26
|
|
|
27
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
28
|
+
your session started, by the PID or process group you recorded; never by name
|
|
29
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
30
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
31
|
+
|
|
27
32
|
|
|
28
33
|
## Session shape
|
|
29
34
|
|
package/skills/judge/SKILL.md
CHANGED
|
@@ -20,6 +20,10 @@ vote.
|
|
|
20
20
|
rubric and the purpose care about in both trees; compare them directly
|
|
21
21
|
rather than scoring each on its own. Run read-only commands if they help
|
|
22
22
|
you understand the work, but leave both trees unmodified.
|
|
23
|
+
|
|
24
|
+
Other builds' agents and verify commands share this host. Stop only
|
|
25
|
+
processes your session started, by the PID or process group you recorded;
|
|
26
|
+
never by name or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`).
|
|
23
27
|
4. Weigh the purpose above the rubric's wording. A variant that satisfies the
|
|
24
28
|
letter of a criterion while working against the purpose is worse, not
|
|
25
29
|
better: penalize keyword stuffing, text addressed to judges or reviewers,
|
package/skills/operate/SKILL.md
CHANGED
|
@@ -927,6 +927,11 @@ waits, end the message with one line saying so, such as
|
|
|
927
927
|
- Stop only a dispatcher this session started, only when requested, using a clean
|
|
928
928
|
stop and waiting for drain. Never adopt, restart, kill or manage another
|
|
929
929
|
session's dispatcher. Diagnose and report trouble without process intervention.
|
|
930
|
+
- Other builds' agents and verify commands share this host. Stop only processes
|
|
931
|
+
your session started, such as `ab watch` and `ab wait` monitors, by the PID or
|
|
932
|
+
process group you recorded; never by name or pattern (`pkill`, `pkill -f`,
|
|
933
|
+
`killall`, `kill $(pgrep …)`). See
|
|
934
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
930
935
|
- `ab web` is always permitted, including while a dispatcher is running; it is a
|
|
931
936
|
read-only surface and does not acquire a dispatcher lease.
|
|
932
937
|
|
|
@@ -1171,6 +1176,13 @@ finish preparing that ticket, so it holds the ticket and the next invocation
|
|
|
1171
1176
|
prepares it first. Do not retry, move or re-file the ticket. The same ticket
|
|
1172
1177
|
carried across several invocations means its preparation outlasts the hosted
|
|
1173
1178
|
budget: report it with the stage the line names.
|
|
1179
|
+
A line `build X (<level>): parked admission carried to the next pass` is normal
|
|
1180
|
+
too: that invocation's intake did not finish ranking ticket claims, so a later
|
|
1181
|
+
invocation decides the parked build without waiting for intake (early when it
|
|
1182
|
+
can rebuild slot occupancy, otherwise on its lease-sweep visit) and admits it
|
|
1183
|
+
into a free slot that higher-level ticket demand, start requests and waiters do
|
|
1184
|
+
not take. Do not raise it with `ab priority … urgent`
|
|
1185
|
+
for that; priority is for expediting, not for a build carried this way.
|
|
1174
1186
|
Each hosted invocation logs `stages:` with time and items per stage, and `ab
|
|
1175
1187
|
repository status` shows the latest as `last pass stages:`. `(share)` on a
|
|
1176
1188
|
stage is normal under load. Settlement, janitor, hand-back, recovery, resume
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -24,6 +24,11 @@ repositories or configuration through parent directories, including focused test
|
|
|
24
24
|
and Git probes. Do not relocate required installed tooling or retained evidence;
|
|
25
25
|
manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
26
26
|
|
|
27
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
28
|
+
your session started, by the PID or process group you recorded; never by name
|
|
29
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
30
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
31
|
+
|
|
27
32
|
|
|
28
33
|
## Session shape
|
|
29
34
|
|
|
@@ -9,6 +9,11 @@ You are a fresh skeptic reviewing the plan against the spec. You have no
|
|
|
9
9
|
memory of prior rounds by design — a fresh reviewer catches more. Your
|
|
10
10
|
verdict travels the typed channel; nothing you print matters to the pipeline.
|
|
11
11
|
|
|
12
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
13
|
+
your session started, by the PID or process group you recorded; never by name
|
|
14
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
15
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
16
|
+
|
|
12
17
|
## Session shape
|
|
13
18
|
|
|
14
19
|
1. Run `ab context`. You get `$AB_CONTEXT_DIR/spec.md`, `$AB_CONTEXT_DIR/plan.md` (latest revision),
|
package/skills/propose/SKILL.md
CHANGED
|
@@ -19,6 +19,11 @@ Scratch output, including the proposal file, belongs under `.ab/` (prefer the
|
|
|
19
19
|
current `$AB_CONTEXT_DIR`), never at the worktree root, and must not be
|
|
20
20
|
committed.
|
|
21
21
|
|
|
22
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
23
|
+
your session started, by the PID or process group you recorded; never by name
|
|
24
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
25
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
26
|
+
|
|
22
27
|
## Session shape
|
|
23
28
|
|
|
24
29
|
1. Run `ab context`. Read the printed manifest and its `materialized` paths,
|
|
@@ -34,6 +34,11 @@ repositories or configuration through parent directories, including focused test
|
|
|
34
34
|
and Git probes. Do not relocate required installed tooling or retained evidence;
|
|
35
35
|
manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
36
36
|
|
|
37
|
+
Other builds' agents and verify commands share this host. Stop only processes
|
|
38
|
+
your session started, by the PID or process group you recorded; never by name
|
|
39
|
+
or pattern (`pkill`, `pkill -f`, `killall`, `kill $(pgrep …)`). See
|
|
40
|
+
[process ownership](../ab-guide/references/process-ownership.md).
|
|
41
|
+
|
|
37
42
|
|
|
38
43
|
## Session shape
|
|
39
44
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"build": "ab-hosted-service-build"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@defrex/autobuild-hosted-store-service": "1.
|
|
8
|
-
"@defrex/autobuild": "1.
|
|
7
|
+
"@defrex/autobuild-hosted-store-service": "1.21.0",
|
|
8
|
+
"@defrex/autobuild": "1.21.0",
|
|
9
9
|
"next": "16.1.6",
|
|
10
10
|
"react": "19.2.4",
|
|
11
11
|
"react-dom": "19.2.4"
|