@defrex/autobuild 1.6.0 → 1.8.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 +423 -57
- package/docs/agent-runtimes.md +1 -1
- package/docs/answering-blocked-builds.md +44 -3
- package/docs/architecture.md +124 -29
- package/docs/cli.md +1 -0
- package/docs/configuration-overview.md +11 -1
- package/docs/configuration.md +334 -14
- package/docs/dispatcher.md +1 -1
- package/docs/forges.md +1 -0
- package/docs/integration-overview.md +2 -2
- package/docs/integration-tree.md +7 -4
- package/docs/merge-policy.md +78 -6
- package/docs/migration-1.0.md +4 -2
- package/docs/operating.md +3 -2
- package/docs/operator-api.md +45 -13
- package/docs/operator-surfaces.md +16 -3
- package/docs/plugin-authoring.md +45 -7
- package/docs/remote-store-protocol.md +28 -7
- package/docs/restacking.md +35 -11
- package/docs/ticket-dependencies.md +9 -4
- package/docs/ticket-sources.md +34 -6
- package/docs/tickets.md +7 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/workspaces.md +1 -1
- package/package.json +3 -3
- package/packages/core/src/cli/attention.ts +2 -0
- package/packages/core/src/cli/binary-direct.ts +1 -0
- package/packages/core/src/cli/build-control.ts +65 -7
- package/packages/core/src/cli/context.ts +55 -14
- package/packages/core/src/cli/dashboard/actions.ts +13 -4
- package/packages/core/src/cli/dashboard/landing-display.ts +32 -8
- package/packages/core/src/cli/dashboard/model.ts +61 -8
- package/packages/core/src/cli/dashboard/render.ts +28 -3
- package/packages/core/src/cli/dashboard/tree.ts +9 -1
- package/packages/core/src/cli/dispatch-frontend.ts +10 -14
- package/packages/core/src/cli/dispatch-preflight.ts +1 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +145 -109
- package/packages/core/src/cli/dispatch.ts +9 -3
- package/packages/core/src/cli/help.ts +80 -11
- package/packages/core/src/cli/init-validation.ts +14 -1
- package/packages/core/src/cli/landings.ts +1 -1
- package/packages/core/src/cli/main.ts +60 -9
- package/packages/core/src/cli/publication-settlement.ts +10 -0
- package/packages/core/src/cli/repository-status.ts +37 -2
- package/packages/core/src/cli/status.ts +186 -12
- package/packages/core/src/cli/terminals.ts +197 -4
- package/packages/core/src/cli/ticket.ts +22 -4
- package/packages/core/src/cli/wait.ts +1 -0
- package/packages/core/src/cli/watch.ts +73 -0
- package/packages/core/src/config/landing.ts +12 -0
- package/packages/core/src/config/live.ts +4 -0
- package/packages/core/src/config/path-selectors.ts +68 -0
- package/packages/core/src/config/profiles.ts +96 -0
- package/packages/core/src/config/ready-assignee.ts +43 -11
- package/packages/core/src/config/roles.ts +33 -10
- package/packages/core/src/config/schema.ts +205 -81
- package/packages/core/src/events/catalog.ts +17 -3
- package/packages/core/src/events/compatibility.ts +4 -1
- package/packages/core/src/events/forge-degradation-policy.ts +16 -2
- package/packages/core/src/events/head-paths-limits.ts +25 -0
- package/packages/core/src/events/payloads.ts +323 -20
- package/packages/core/src/events/policy.ts +22 -0
- package/packages/core/src/events/repository.ts +47 -1
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +320 -130
- package/packages/core/src/kernel/build-creation.ts +29 -0
- package/packages/core/src/kernel/consent-revocation.ts +72 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +19 -8
- package/packages/core/src/kernel/engine.ts +48 -8
- package/packages/core/src/kernel/forge-health.ts +47 -0
- package/packages/core/src/kernel/guarded-forge.ts +76 -18
- package/packages/core/src/kernel/head-paths-state.ts +63 -0
- package/packages/core/src/kernel/head-paths.ts +401 -0
- package/packages/core/src/kernel/landing-policy-identity.ts +20 -0
- package/packages/core/src/kernel/landing-policy.ts +55 -2
- package/packages/core/src/kernel/landing-readiness.ts +104 -9
- package/packages/core/src/kernel/landing-state.ts +44 -4
- package/packages/core/src/kernel/leaf-restack-state.ts +50 -2
- package/packages/core/src/kernel/log-index.ts +27 -1
- package/packages/core/src/kernel/node-parent.ts +2 -0
- package/packages/core/src/kernel/node-polling.ts +13 -3
- package/packages/core/src/kernel/node-restack-state.ts +8 -1
- package/packages/core/src/kernel/node-restack-transaction.ts +45 -0
- package/packages/core/src/kernel/read-deferrals.ts +3 -1
- package/packages/core/src/kernel/read-facts.ts +37 -2
- package/packages/core/src/kernel/reducer-registry.ts +22 -1
- package/packages/core/src/kernel/reducer.ts +332 -16
- package/packages/core/src/kernel/target-observation.ts +2 -5
- package/packages/core/src/kernel/terminal-guard.ts +52 -3
- package/packages/core/src/kernel/ticket-handbacks.ts +40 -0
- package/packages/core/src/kernel/ticket-preparation.ts +15 -1
- package/packages/core/src/kernel/ticket-wait.ts +345 -0
- package/packages/core/src/kernel/verify-applicability.ts +9 -19
- package/packages/core/src/ontology.ts +1 -0
- package/packages/core/src/operator/annotations.ts +6 -0
- package/packages/core/src/operator/index.ts +3 -0
- package/packages/core/src/operator/protocol.ts +25 -2
- package/packages/core/src/operator/query.ts +1 -1
- package/packages/core/src/operator/registry.ts +122 -10
- package/packages/core/src/operator/repository-events.ts +67 -0
- package/packages/core/src/operator/sandbox-host.ts +3 -0
- package/packages/core/src/operator/tickets.ts +15 -3
- package/packages/core/src/plugin-sdk/index.ts +4 -0
- package/packages/core/src/ports/forge/create.ts +6 -0
- package/packages/core/src/ports/forge/github-transport.ts +40 -3
- package/packages/core/src/ports/forge/github.ts +12 -1
- package/packages/core/src/ports/forge/workspace-ancestry.ts +60 -0
- package/packages/core/src/ports/forge-failure.ts +31 -2
- package/packages/core/src/ports/runner/routing.ts +66 -5
- package/packages/core/src/ports/tickets/assignees.ts +54 -0
- package/packages/core/src/ports/tickets/contract.ts +164 -4
- package/packages/core/src/ports/tickets/create.ts +17 -3
- package/packages/core/src/ports/tickets/fake.ts +5 -0
- package/packages/core/src/ports/tickets/github-fake.ts +18 -2
- package/packages/core/src/ports/tickets/github.ts +247 -29
- package/packages/core/src/ports/tickets/hosted-index.ts +1 -0
- package/packages/core/src/ports/tickets/operations.ts +6 -1
- package/packages/core/src/ports/tickets/tree.ts +12 -2
- package/packages/core/src/ports/tickets/update.ts +6 -2
- package/packages/core/src/ports/types.ts +36 -5
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +9 -0
- package/packages/core/src/processes/build-child.ts +28 -7
- package/packages/core/src/processes/build-execution-state.ts +34 -2
- package/packages/core/src/processes/build-runner.ts +165 -19
- package/packages/core/src/processes/dispatcher.ts +837 -115
- package/packages/core/src/processes/execution-no-progress.ts +22 -2
- package/packages/core/src/processes/harvest-child.ts +4 -0
- package/packages/core/src/processes/harvest-runner.ts +5 -0
- package/packages/core/src/processes/phase-failure-budget.ts +1 -0
- package/packages/core/src/processes/publication-state.ts +6 -1
- package/packages/core/src/processes/repo-view.ts +2 -0
- package/packages/core/src/scenarios/harness.ts +15 -1
- package/packages/core/src/store/digest.ts +41 -2
- package/packages/core/src/store/reduced-reads.ts +4 -1
- package/packages/core/src/store/reducer-value-shapes.json +10310 -8441
- package/packages/core/src/store/remote/client.ts +49 -10
- package/packages/core/src/store/remote/index.ts +4 -0
- package/packages/core/src/store/remote/protocol.ts +18 -1
- package/packages/core/src/store/remote/released-clients.json +22 -0
- package/packages/core/src/store/remote/released-reducer-values/1.7.0.json +27366 -0
- package/packages/core/src/store/remote/released-reducer-values/1.8.0.json +29043 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +4 -0
- package/packages/core/src/store/repo-state-events.ts +3 -0
- package/packages/core/src/store/types.ts +27 -0
- package/packages/core/src/testing/dispatch-read-budget.ts +84 -58
- package/packages/core/src/testing/index.ts +2 -0
- package/packages/core/src/testing/reduced-read-budget.ts +419 -9
- package/skills/code-review/SKILL.md +8 -0
- package/skills/finalize/SKILL.md +4 -0
- package/skills/guide/SKILL.md +241 -47
- package/skills/guide/references/integration-tree.md +7 -4
- package/skills/guide/references/merge-policy.md +78 -6
- package/skills/guide/references/migration-1.0.md +4 -2
- package/skills/guide/references/operator-api.md +45 -13
- package/skills/guide/references/plugin-authoring.md +45 -7
- package/skills/guide/references/remote-store-protocol.md +28 -7
- package/skills/guide/references/restacking.md +35 -11
- package/skills/guide/references/ticket-dependencies.md +9 -4
- package/skills/implement/SKILL.md +15 -1
- package/skills/operate/SKILL.md +133 -16
- package/skills/plan/SKILL.md +17 -2
- package/skills/plan-review/SKILL.md +8 -0
- package/skills/reconcile/SKILL.md +21 -5
- package/skills/tickets/SKILL.md +23 -6
- package/templates/hosted-service/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StoreWriteTooLargeError } from './errors'
|
|
2
2
|
import {
|
|
3
|
+
BUILD_CREATION_KEY_CAPABILITY,
|
|
3
4
|
DISPATCH_PLACEMENT_CAPABILITY,
|
|
4
5
|
placementCapabilitiesSchema,
|
|
5
6
|
dispatchPlacementSchema,
|
|
@@ -232,20 +233,32 @@ export class RemoteBuildStore implements BuildStore {
|
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
|
|
235
|
-
|
|
236
|
+
/** One `/health` probe per instance; `null` when the service predates it. */
|
|
237
|
+
private healthCapabilities: Promise<string[] | null> | undefined
|
|
236
238
|
|
|
237
|
-
|
|
238
|
-
this.
|
|
239
|
+
private capabilities(): Promise<string[] | null> {
|
|
240
|
+
this.healthCapabilities ??= (async () => {
|
|
239
241
|
const response = await this.raw('GET', '/health')
|
|
240
|
-
if (response.status === 404 || response.status === 405) return
|
|
242
|
+
if (response.status === 404 || response.status === 405) return null
|
|
241
243
|
if (!response.ok) throw await this.toError(response)
|
|
242
|
-
|
|
243
|
-
return health.capabilities?.includes(DISPATCH_PLACEMENT_CAPABILITY) ?? false
|
|
244
|
+
return placementCapabilitiesSchema.parse(await response.json()).capabilities ?? []
|
|
244
245
|
})().catch((error) => {
|
|
245
|
-
this.
|
|
246
|
+
this.healthCapabilities = undefined
|
|
246
247
|
throw error
|
|
247
248
|
})
|
|
248
|
-
|
|
249
|
+
return this.healthCapabilities
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** A project credential's server allocates slugs; one without the creation
|
|
253
|
+
* key capability may allocate one the client never learns. */
|
|
254
|
+
async buildCreationIdentity(): Promise<'keyed' | 'allocated'> {
|
|
255
|
+
return (await this.capabilities())?.includes(BUILD_CREATION_KEY_CAPABILITY)
|
|
256
|
+
? 'keyed'
|
|
257
|
+
: 'allocated'
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async getDispatchPlacement(repo: string): Promise<DispatchPlacement> {
|
|
261
|
+
if (!(await this.capabilities())?.includes(DISPATCH_PLACEMENT_CAPABILITY))
|
|
249
262
|
return { status: 'unknown', reason: 'unsupported-capability' }
|
|
250
263
|
return this.requestJson('GET', `${this.repoPath(repo)}/placement`, dispatchPlacementSchema)
|
|
251
264
|
}
|
|
@@ -915,8 +928,34 @@ export class RemoteBuildStore implements BuildStore {
|
|
|
915
928
|
)
|
|
916
929
|
return value as ReducerValue
|
|
917
930
|
}
|
|
918
|
-
getRepositoryTail(
|
|
919
|
-
|
|
931
|
+
async getRepositoryTail(
|
|
932
|
+
repo: string,
|
|
933
|
+
since = 0,
|
|
934
|
+
opts?: EventReadOptions,
|
|
935
|
+
): Promise<RepositoryEvent[]> {
|
|
936
|
+
validateEventCursor(since)
|
|
937
|
+
const params = new URLSearchParams({ since: String(since) })
|
|
938
|
+
const through = opts?.through
|
|
939
|
+
if (through !== undefined) {
|
|
940
|
+
validateEventCursor(through)
|
|
941
|
+
params.set('through', String(through))
|
|
942
|
+
}
|
|
943
|
+
if (opts?.waitSeconds !== undefined) params.set('wait', String(opts.waitSeconds))
|
|
944
|
+
const events = await this.heldRequest(
|
|
945
|
+
opts?.signal,
|
|
946
|
+
(): RepositoryEvent[] => [],
|
|
947
|
+
() =>
|
|
948
|
+
this.requestJson(
|
|
949
|
+
'GET',
|
|
950
|
+
`${this.repoPath(repo)}/events?${params}`,
|
|
951
|
+
repositoryEventListSchema,
|
|
952
|
+
undefined,
|
|
953
|
+
opts?.signal,
|
|
954
|
+
) as Promise<RepositoryEvent[]>,
|
|
955
|
+
)
|
|
956
|
+
// A server older than `through` ignores it; its resume window still caps
|
|
957
|
+
// the response, and the client never returns rows past the bound.
|
|
958
|
+
return through === undefined ? events : events.filter((event) => event.seq <= through)
|
|
920
959
|
}
|
|
921
960
|
getHarvestHistoryPage(
|
|
922
961
|
repo: string,
|
|
@@ -34,6 +34,8 @@ export type { ReducerSnapshot, SnapshotScope } from '../snapshots'
|
|
|
34
34
|
|
|
35
35
|
export * from './compatibility'
|
|
36
36
|
|
|
37
|
+
export { creationBuildSlug, projectBuildSlugBase } from '../../kernel/build-creation'
|
|
38
|
+
|
|
37
39
|
export { delegateCredential } from './credentials'
|
|
38
40
|
|
|
39
41
|
export { reduceBuild } from '../../kernel/reducer'
|
|
@@ -60,6 +62,8 @@ export { assertPublicSnapshotReducer } from '../snapshots'
|
|
|
60
62
|
|
|
61
63
|
export {
|
|
62
64
|
validateForgeDegradation,
|
|
65
|
+
validateForgeResetHorizon,
|
|
66
|
+
FORGE_RESET_EVENT_TYPES,
|
|
63
67
|
MAX_FORGE_DEGRADATION_MS,
|
|
64
68
|
} from '../../events/forge-degradation-policy'
|
|
65
69
|
|
|
@@ -33,8 +33,9 @@ import { compatibilityMetadataSchema } from '../../events/policy'
|
|
|
33
33
|
import { repoTickCompletionSchema, repoTickObservationSchema } from '../repo-tick'
|
|
34
34
|
import { reducerSnapshotWireSchema } from '../snapshots'
|
|
35
35
|
import { z } from 'zod'
|
|
36
|
+
import { CREATION_KEY } from '../../kernel/build-creation'
|
|
36
37
|
import { actorSchema } from '../../events/envelope'
|
|
37
|
-
import { eventPayloadSchemas } from '../../events/payloads'
|
|
38
|
+
import { eventPayloadSchemas, WAIT_TICKET_LIMIT } from '../../events/payloads'
|
|
38
39
|
import { ticketRefSchema } from '../../ontology'
|
|
39
40
|
import type { ArtifactMeta, RepositoryArtifactMeta, SessionArtifactMeta } from '../types'
|
|
40
41
|
|
|
@@ -95,6 +96,10 @@ export const newBuildBodySchema = z.object({
|
|
|
95
96
|
// Additive optional initial `build.created` event, appended atomically with
|
|
96
97
|
// the record. Loose like every event wire schema: the backing store validates.
|
|
97
98
|
created: eventWriteWireSchema.optional(),
|
|
99
|
+
// Additive optional creation key (`build-creation-key-v1`): a project
|
|
100
|
+
// credential's create lands at the slug this key derives, at most once.
|
|
101
|
+
// Old servers strip it; old clients never send it. No protocol-version bump.
|
|
102
|
+
creationKey: z.string().regex(CREATION_KEY).optional(),
|
|
98
103
|
})
|
|
99
104
|
|
|
100
105
|
export const buildRecordWireSchema = z.object({
|
|
@@ -345,6 +350,16 @@ export const buildDigestWireSchema = z.object({
|
|
|
345
350
|
readinessChangeSeq: z.number().int().positive().optional(),
|
|
346
351
|
reclaimPending: z.literal(true).optional(),
|
|
347
352
|
executionOpen: z.literal(true).optional(),
|
|
353
|
+
// Additive ticket-wait members; an older service omits both, and its
|
|
354
|
+
// clients then see no pending request and no open wait to release.
|
|
355
|
+
waitPending: z.literal(true).optional(),
|
|
356
|
+
ticketWait: z
|
|
357
|
+
.object({
|
|
358
|
+
id: z.string().min(1),
|
|
359
|
+
escalation: z.string().min(1),
|
|
360
|
+
tickets: z.array(ticketRefSchema).max(WAIT_TICKET_LIMIT),
|
|
361
|
+
})
|
|
362
|
+
.optional(),
|
|
348
363
|
})
|
|
349
364
|
export const buildDigestListSchema = z.array(buildDigestWireSchema)
|
|
350
365
|
|
|
@@ -552,6 +567,8 @@ export const nodeRewriteWireSchema = eventPayloadSchemas['node.rewritten'].nulla
|
|
|
552
567
|
|
|
553
568
|
/** Optional and independently negotiated; no change to released value contracts. */
|
|
554
569
|
export const DISPATCH_PLACEMENT_CAPABILITY = 'dispatch-placement-v1'
|
|
570
|
+
/** `/health` capability: keyed project creation lands at `creationBuildSlug`. */
|
|
571
|
+
export const BUILD_CREATION_KEY_CAPABILITY = 'build-creation-key-v1'
|
|
555
572
|
export const placementCapabilitiesSchema = z.object({
|
|
556
573
|
capabilities: z.array(z.string()).optional(),
|
|
557
574
|
})
|
|
@@ -77,5 +77,27 @@
|
|
|
77
77
|
"provenance": {
|
|
78
78
|
"tag": "v1.6.0"
|
|
79
79
|
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"version": "1.7.0",
|
|
83
|
+
"publishedAt": "2026-11-13T01:06:47.187Z",
|
|
84
|
+
"protocol": "7",
|
|
85
|
+
"contract": "1.7.0.json",
|
|
86
|
+
"projects": true,
|
|
87
|
+
"catalogIdentity": "de08611c12803625ec427cb3b6cfda0c3c888ecf3aeea11774e98447d670a6c1",
|
|
88
|
+
"provenance": {
|
|
89
|
+
"tag": "v1.7.0"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"version": "1.8.0",
|
|
94
|
+
"publishedAt": "2026-11-17T14:34:58.721Z",
|
|
95
|
+
"protocol": "7",
|
|
96
|
+
"contract": "1.8.0.json",
|
|
97
|
+
"projects": true,
|
|
98
|
+
"catalogIdentity": "9ba078909b9323a4d0044adacfc3fb005381bb07ca05acaf058e12c0c37da8fb",
|
|
99
|
+
"provenance": {
|
|
100
|
+
"tag": "v1.8.0"
|
|
101
|
+
}
|
|
80
102
|
}
|
|
81
103
|
]
|