@defrex/autobuild 1.0.0-beta.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/SPEC.md +362 -56
- package/bin/ab-dispatch-generation.ts +93 -0
- package/docs/agent-runtimes.md +157 -0
- package/docs/answering-blocked-builds.md +21 -3
- package/docs/architecture.md +166 -7
- package/docs/build-store.md +123 -0
- package/docs/builds.md +82 -0
- package/docs/cli.md +48 -0
- package/docs/configuration-overview.md +93 -0
- package/docs/configuration.md +1778 -188
- package/docs/dispatcher-hosting.md +115 -0
- package/docs/dispatcher.md +59 -0
- package/docs/forges.md +121 -0
- package/docs/getting-started.md +60 -0
- package/docs/glossary.md +60 -0
- package/docs/hosted-service.md +2 -2
- package/docs/intake.md +48 -0
- package/docs/integration-overview.md +81 -0
- package/docs/integration-tree.md +87 -2
- package/docs/integration.md +54 -0
- package/docs/operating.md +114 -0
- package/docs/operator-api.md +64 -11
- package/docs/operator-surfaces.md +90 -0
- package/docs/overview.md +49 -0
- package/docs/plugin-authoring.md +426 -0
- package/docs/remote-store-protocol.md +12 -9
- package/docs/restacking.md +4 -1
- package/docs/seams.md +66 -0
- package/docs/setup.md +28 -6
- package/docs/skills.md +119 -0
- package/docs/spec-standard.md +23 -5
- package/docs/ticket-sources.md +132 -0
- package/docs/tickets.md +69 -0
- package/docs/troubleshooting.md +111 -0
- package/docs/upgrading.md +50 -0
- package/docs/verification.md +146 -0
- package/docs/website.md +47 -5
- package/docs/workspaces.md +152 -0
- package/package.json +5 -4
- package/packages/core/src/cli/artifact.ts +5 -4
- package/packages/core/src/cli/attention.ts +2 -0
- package/packages/core/src/cli/binary-direct.ts +190 -0
- package/packages/core/src/cli/binary-lifecycle.ts +46 -0
- package/packages/core/src/cli/binary.ts +24 -210
- package/packages/core/src/cli/build-control.ts +105 -2
- package/packages/core/src/cli/context.ts +41 -1
- package/packages/core/src/cli/dashboard/hand-pushed.ts +24 -0
- package/packages/core/src/cli/dashboard/handoff.ts +64 -0
- package/packages/core/src/cli/dashboard/integration-detail.ts +3 -0
- package/packages/core/src/cli/dashboard/model.ts +34 -10
- package/packages/core/src/cli/dashboard/render.ts +24 -2
- package/packages/core/src/cli/dashboard/rollback.ts +30 -0
- package/packages/core/src/cli/dispatch-args.ts +53 -0
- package/packages/core/src/cli/dispatch-crash-budget.ts +15 -0
- package/packages/core/src/cli/dispatch-frontend.ts +52 -5
- package/packages/core/src/cli/dispatch-handoff.ts +276 -0
- package/packages/core/src/cli/dispatch-launch-contract.ts +170 -0
- package/packages/core/src/cli/dispatch-launcher.ts +580 -0
- package/packages/core/src/cli/dispatch-parent-watch.ts +44 -0
- package/packages/core/src/cli/dispatch-preflight.ts +272 -0
- package/packages/core/src/cli/dispatch-presentation-job.ts +46 -0
- package/packages/core/src/cli/dispatch-presentation-ownership.ts +9 -0
- package/packages/core/src/cli/dispatch-process.ts +22 -90
- package/packages/core/src/cli/dispatch-readiness.ts +47 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +5 -1
- package/packages/core/src/cli/dispatch-runtime-cache.ts +522 -0
- package/packages/core/src/cli/dispatch-runtime-dependencies.ts +291 -0
- package/packages/core/src/cli/dispatch-runtime-use.ts +336 -0
- package/packages/core/src/cli/dispatch-upgrade-controller.ts +221 -0
- package/packages/core/src/cli/dispatch-upgrade-install.ts +258 -0
- package/packages/core/src/cli/dispatch-upgrade-source.ts +309 -0
- package/packages/core/src/cli/dispatch-upgrade-target.ts +190 -0
- package/packages/core/src/cli/dispatch.ts +604 -60
- package/packages/core/src/cli/dispatcher-liveness.ts +1 -1
- package/packages/core/src/cli/env.ts +1 -1
- package/packages/core/src/cli/harvest.ts +28 -11
- package/packages/core/src/cli/help.ts +10 -5
- package/packages/core/src/cli/installation.ts +5 -3
- package/packages/core/src/cli/main-checkout.ts +59 -0
- package/packages/core/src/cli/main.ts +15 -45
- package/packages/core/src/cli/node-verification-provenance.ts +97 -0
- package/packages/core/src/cli/repo-state.ts +3 -58
- package/packages/core/src/cli/repository-status.ts +67 -3
- package/packages/core/src/cli/runtime-spawn.ts +16 -0
- package/packages/core/src/cli/status.ts +57 -3
- package/packages/core/src/cli/upgrade-followup.ts +25 -0
- package/packages/core/src/cli/wait.ts +3 -0
- package/packages/core/src/cli/watch.ts +7 -0
- package/packages/core/src/config/landing.ts +8 -0
- package/packages/core/src/config/live.ts +1 -0
- package/packages/core/src/config/reference-metadata.ts +31 -0
- package/packages/core/src/config/reference.ts +342 -0
- package/packages/core/src/config/roles.ts +1 -1
- package/packages/core/src/config/schema.ts +352 -10
- package/packages/core/src/distribution-packaging.ts +116 -0
- package/packages/core/src/events/catalog.ts +6 -0
- package/packages/core/src/events/payloads.ts +53 -9
- package/packages/core/src/events/policy.ts +25 -0
- package/packages/core/src/events/repository.ts +184 -4
- package/packages/core/src/events/runtime.ts +16 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +2515 -78
- package/packages/core/src/kernel/dispatch-drain-recovery.ts +121 -0
- package/packages/core/src/kernel/dispatch-status.ts +4 -2
- package/packages/core/src/kernel/dispatch-upgrade.ts +171 -0
- package/packages/core/src/kernel/dispatcher-liveness.ts +7 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +82 -0
- package/packages/core/src/kernel/guarded-forge.ts +1 -1
- package/packages/core/src/kernel/harvest.ts +98 -4
- package/packages/core/src/kernel/integration-attention.ts +20 -0
- package/packages/core/src/kernel/integration-state.ts +80 -11
- package/packages/core/src/kernel/landing-readiness.ts +6 -1
- package/packages/core/src/kernel/mixed-version.ts +34 -0
- package/packages/core/src/kernel/node-polling.ts +160 -0
- package/packages/core/src/kernel/read-facts.ts +40 -5
- package/packages/core/src/kernel/reducer-registry.ts +3 -0
- package/packages/core/src/kernel/reducer.ts +75 -14
- package/packages/core/src/kernel/service-facts.ts +11 -4
- package/packages/core/src/ontology.ts +2 -2
- package/packages/core/src/open-map.ts +3 -1
- package/packages/core/src/operator/presentation.ts +7 -0
- package/packages/core/src/operator/query.ts +6 -2
- package/packages/core/src/operator/registry.ts +1 -1
- package/packages/core/src/plugins/load.ts +4 -1
- package/packages/core/src/plugins/runtime-snapshot.ts +128 -0
- package/packages/core/src/ports/forge/contract.ts +29 -0
- package/packages/core/src/ports/forge/github.ts +189 -61
- package/packages/core/src/ports/forge-failure.ts +1 -0
- package/packages/core/src/ports/forge-telemetry.ts +3 -0
- package/packages/core/src/ports/runner/session-env.ts +1 -0
- package/packages/core/src/ports/types.ts +10 -0
- package/packages/core/src/ports/workspace/distribution-archive.ts +22 -149
- package/packages/core/src/ports/workspace/distribution-release.ts +56 -0
- package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
- package/packages/core/src/ports/workspace/local-build-execution.ts +37 -17
- package/packages/core/src/processes/build-child-exit.ts +5 -26
- package/packages/core/src/processes/build-runner.ts +81 -11
- package/packages/core/src/processes/dispatcher.ts +254 -23
- package/packages/core/src/processes/execution-no-progress.ts +6 -0
- package/packages/core/src/processes/execution-relaunch.ts +30 -0
- package/packages/core/src/processes/execution-settlement.ts +16 -7
- package/packages/core/src/processes/harvest-runner.ts +328 -292
- package/packages/core/src/processes/process-group-reaper.ts +17 -10
- package/packages/core/src/runtime-identity.ts +22 -3
- package/packages/core/src/store/contract.ts +153 -0
- package/packages/core/src/store/local/store.ts +197 -72
- package/packages/core/src/store/reduced-reads.ts +8 -0
- package/packages/core/src/store/reducer-value-shapes.json +5783 -3305
- package/packages/core/src/store/remote/client.ts +43 -0
- package/packages/core/src/store/repo-state-events.ts +20 -3
- package/packages/core/src/store/types.ts +7 -0
- package/skills/finalize/SKILL.md +3 -1
- package/skills/guide/SKILL.md +273 -48
- package/skills/guide/references/integration-tree.md +87 -2
- package/skills/guide/references/operator-api.md +71 -14
- package/skills/guide/references/plugin-authoring.md +231 -266
- package/skills/guide/references/remote-store-protocol.md +12 -9
- package/skills/guide/references/restacking.md +4 -1
- package/skills/guide/references/setup.md +28 -6
- package/skills/guide/references/spec-standard.md +23 -5
- package/skills/harvest/SKILL.md +4 -0
- package/skills/harvest-review/SKILL.md +4 -0
- package/skills/implement/SKILL.md +4 -2
- package/skills/operate/SKILL.md +104 -35
- package/skills/plan/SKILL.md +12 -4
- package/skills/spec/SKILL.md +20 -2
- package/skills/tickets/SKILL.md +20 -1
- package/templates/hosted-service/package.json +2 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clientIdentityError,
|
|
3
|
+
classifyClient,
|
|
4
|
+
releaseVersion,
|
|
5
|
+
supportedClientRangeSchema,
|
|
6
|
+
} from './compatibility'
|
|
1
7
|
import { stampCompatibility, buildEventPolicy, repositoryEventPolicy } from '../../events/policy'
|
|
2
8
|
import { READ_CATALOG_IDENTITY, projectStoredEvents } from '../../events/compatibility'
|
|
3
9
|
import { CATALOG_IDENTITY_HEADER } from './version'
|
|
@@ -197,6 +203,43 @@ export class RemoteBuildStore implements BuildStore {
|
|
|
197
203
|
}
|
|
198
204
|
}
|
|
199
205
|
|
|
206
|
+
async inspectDispatcherOverlap(signal: AbortSignal) {
|
|
207
|
+
const response = await this.raw('GET', '/health', undefined, signal)
|
|
208
|
+
if (response.status === 404 || response.status === 405)
|
|
209
|
+
return { compatible: false, evidence: 'hosted admission metadata unavailable' }
|
|
210
|
+
if (!response.ok) throw await this.toError(response)
|
|
211
|
+
const health = (await response.json().catch(() => null)) as {
|
|
212
|
+
autobuildVersion?: string
|
|
213
|
+
protocolVersion?: string
|
|
214
|
+
supportedClientRange?: unknown
|
|
215
|
+
} | null
|
|
216
|
+
const range = supportedClientRangeSchema.safeParse(health?.supportedClientRange)
|
|
217
|
+
if (
|
|
218
|
+
!range.success ||
|
|
219
|
+
!health?.autobuildVersion ||
|
|
220
|
+
!releaseVersion(health.autobuildVersion) ||
|
|
221
|
+
!health.protocolVersion
|
|
222
|
+
)
|
|
223
|
+
return { compatible: false, evidence: 'hosted admission metadata unavailable' }
|
|
224
|
+
if (classifyClient(this.identity.autobuildVersion, range.data) !== 'supported')
|
|
225
|
+
return {
|
|
226
|
+
compatible: false,
|
|
227
|
+
evidence: `hosted service rejects client ${this.identity.autobuildVersion}; supported >=${range.data.minVersion} <${range.data.maxVersionExclusive}`,
|
|
228
|
+
}
|
|
229
|
+
const error = clientIdentityError(
|
|
230
|
+
this.identity.autobuildVersion,
|
|
231
|
+
this.identity.protocolVersion,
|
|
232
|
+
health.autobuildVersion,
|
|
233
|
+
health.protocolVersion,
|
|
234
|
+
)
|
|
235
|
+
return {
|
|
236
|
+
compatible: !error,
|
|
237
|
+
evidence:
|
|
238
|
+
error ??
|
|
239
|
+
`hosted service ${health.autobuildVersion} admits client ${this.identity.autobuildVersion} protocol ${this.identity.protocolVersion}`,
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
200
243
|
scopeBuild(slug: string): BuildScopedStore {
|
|
201
244
|
return createBuildScopedStore(this, slug)
|
|
202
245
|
}
|
|
@@ -17,6 +17,20 @@ import {
|
|
|
17
17
|
/** The anchor fact a bounded read's tail hangs from. */
|
|
18
18
|
const RUN_STARTED = 'dispatcher.run-started'
|
|
19
19
|
|
|
20
|
+
/** Handoff correlation spans dispatcher generations. These facts must survive
|
|
21
|
+
* later run anchors, including failures that invalidate prepared requests. */
|
|
22
|
+
export const DISPATCH_HANDOFF_EVENT_TYPES = [
|
|
23
|
+
'dispatcher.target-prepared',
|
|
24
|
+
'dispatcher.yield-requested',
|
|
25
|
+
'dispatcher.upgrade-failed',
|
|
26
|
+
'dispatcher.handoff-started',
|
|
27
|
+
'dispatcher.terminal-released',
|
|
28
|
+
'dispatcher.takeover',
|
|
29
|
+
'dispatcher.drain-deadline',
|
|
30
|
+
'dispatcher.drain-settled',
|
|
31
|
+
'dispatcher.handoff-completed',
|
|
32
|
+
] as const satisfies readonly RepositoryEventType[]
|
|
33
|
+
|
|
20
34
|
/** Durable, slow-growing repository event types: every fact a state reducer
|
|
21
35
|
* may consult at full replay depth. Derived from the catalog groups so a new
|
|
22
36
|
* harvest or sandbox event type joins automatically; the three dispatcher
|
|
@@ -24,6 +38,7 @@ const RUN_STARTED = 'dispatcher.run-started'
|
|
|
24
38
|
* run-correlated `dispatcher.config-reloaded`. */
|
|
25
39
|
export const REPOSITORY_STATE_EVENT_TYPES: readonly RepositoryEventType[] = [
|
|
26
40
|
'tickets.migration-recorded',
|
|
41
|
+
...DISPATCH_HANDOFF_EVENT_TYPES,
|
|
27
42
|
'dispatcher.forge-degraded',
|
|
28
43
|
'dispatcher.forge-recovered',
|
|
29
44
|
...Object.keys(changePresenceEventPayloadSchemas),
|
|
@@ -46,7 +61,9 @@ const LATEST_TYPES = new Set<string>(REPOSITORY_LATEST_EVENT_TYPES)
|
|
|
46
61
|
* `dispatcher.run-started` contains everything those consumers keep. */
|
|
47
62
|
export const REPOSITORY_RUN_SCOPED_EVENT_TYPES: readonly RepositoryEventType[] = [
|
|
48
63
|
...Object.keys(dispatcherStatusEventPayloadSchemas).filter(
|
|
49
|
-
(type) =>
|
|
64
|
+
(type) =>
|
|
65
|
+
!REPOSITORY_LATEST_EVENT_TYPES.includes(type as RepositoryEventType) &&
|
|
66
|
+
!REPOSITORY_STATE_EVENT_TYPES.includes(type as RepositoryEventType),
|
|
50
67
|
),
|
|
51
68
|
'dispatcher.config-reloaded',
|
|
52
69
|
] as RepositoryEventType[]
|
|
@@ -106,7 +123,7 @@ export interface RepositoryStateEventsAcc {
|
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
/** Bump when `RepositoryStateEventsAcc` or its fold changes. */
|
|
109
|
-
export const REPOSITORY_STATE_EVENTS_REDUCER_VERSION =
|
|
126
|
+
export const REPOSITORY_STATE_EVENTS_REDUCER_VERSION = 6
|
|
110
127
|
|
|
111
128
|
const keeps = (event: RepositoryEvent, anchor: number | undefined): boolean =>
|
|
112
129
|
STATE_TYPES.has(event.type) ||
|
|
@@ -154,7 +171,7 @@ export interface JournalViewAcc {
|
|
|
154
171
|
}
|
|
155
172
|
|
|
156
173
|
/** Bump when `JournalViewAcc` or its fold changes. */
|
|
157
|
-
export const JOURNAL_VIEW_REDUCER_VERSION =
|
|
174
|
+
export const JOURNAL_VIEW_REDUCER_VERSION = 7
|
|
158
175
|
|
|
159
176
|
/** Fold seq-ordered events into a journal view in place. */
|
|
160
177
|
export function foldJournalView(acc: JournalViewAcc, events: readonly RepositoryEvent[]): void {
|
|
@@ -272,6 +272,13 @@ export interface SubscribeOptions {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
export interface BuildStore {
|
|
275
|
+
/** Optional provider-owned evidence. Absent/unknown evidence requires
|
|
276
|
+
* cutover; journal write admission is checked separately before yield. */
|
|
277
|
+
inspectDispatcherOverlap?(signal: AbortSignal): Promise<{
|
|
278
|
+
compatible: boolean
|
|
279
|
+
evidence: string
|
|
280
|
+
}>
|
|
281
|
+
|
|
275
282
|
/** Catalog used for event-derived batch answers, when known by this adapter. */
|
|
276
283
|
readonly catalogIdentity?: string
|
|
277
284
|
/** Reads cross a network boundary; presentation polling may use a relaxed cadence. */
|
package/skills/finalize/SKILL.md
CHANGED
|
@@ -9,6 +9,8 @@ The build is green: plan approved, code approved, every verify step passed.
|
|
|
9
9
|
You write the PR description; the kernel opens the PR when you finish (you
|
|
10
10
|
never touch the forge).
|
|
11
11
|
|
|
12
|
+
Guidance is an external operator answer, from the operator agent or a human.
|
|
13
|
+
|
|
12
14
|
## Session shape
|
|
13
15
|
|
|
14
16
|
1. Run `ab context`. You get `.ab/spec.md`, `.ab/plan.md`, every verify report,
|
|
@@ -36,7 +38,7 @@ never touch the forge).
|
|
|
36
38
|
`ab done` validates the deposit; the kernel opens the PR from it. One
|
|
37
39
|
terminal command; if validation fails, fix what it names and rerun.
|
|
38
40
|
|
|
39
|
-
`.ab/guidance.json`, when present, is
|
|
41
|
+
`.ab/guidance.json`, when present, is an operator's answer to the
|
|
40
42
|
escalation that blocked this build: the escalation id and the answer text. It
|
|
41
43
|
is authoritative feedback for this attempt and the PR description must act on
|
|
42
44
|
it, while the spec remains the contract this phase is measured against — if the
|