@dsh-enhanced/plugin-control-plane 0.1.64 → 0.1.66
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 +81 -5
- package/lib/attestation.d.ts.map +1 -1
- package/lib/attestation.js +33 -1
- package/lib/attestation.js.map +1 -1
- package/lib/creation-capability-empty-handoff.d.ts +57 -0
- package/lib/creation-capability-empty-handoff.d.ts.map +1 -0
- package/lib/creation-capability-empty-handoff.js +147 -0
- package/lib/creation-capability-empty-handoff.js.map +1 -0
- package/lib/creation-capability-execution.d.ts +9 -0
- package/lib/creation-capability-execution.d.ts.map +1 -0
- package/lib/creation-capability-execution.js +70 -0
- package/lib/creation-capability-execution.js.map +1 -0
- package/lib/creation-capability-feedback.d.ts +58 -1
- package/lib/creation-capability-feedback.d.ts.map +1 -1
- package/lib/creation-capability-feedback.js +532 -50
- package/lib/creation-capability-feedback.js.map +1 -1
- package/lib/creation-capability-handoff-common.d.ts +60 -0
- package/lib/creation-capability-handoff-common.d.ts.map +1 -0
- package/lib/creation-capability-handoff-common.js +195 -0
- package/lib/creation-capability-handoff-common.js.map +1 -0
- package/lib/creation-capability-journal.d.ts +19 -0
- package/lib/creation-capability-journal.d.ts.map +1 -1
- package/lib/creation-capability-journal.js +62 -21
- package/lib/creation-capability-journal.js.map +1 -1
- package/lib/creation-capability-runtime.d.ts +18 -0
- package/lib/creation-capability-runtime.d.ts.map +1 -1
- package/lib/creation-capability-runtime.js +76 -18
- package/lib/creation-capability-runtime.js.map +1 -1
- package/lib/creation-capability-sealed-audit.d.ts +19 -0
- package/lib/creation-capability-sealed-audit.d.ts.map +1 -0
- package/lib/creation-capability-sealed-audit.js +114 -0
- package/lib/creation-capability-sealed-audit.js.map +1 -0
- package/lib/creation-capability-sealed-handoff.d.ts +160 -0
- package/lib/creation-capability-sealed-handoff.d.ts.map +1 -0
- package/lib/creation-capability-sealed-handoff.js +695 -0
- package/lib/creation-capability-sealed-handoff.js.map +1 -0
- package/lib/creation-capability-trend-snapshot.d.ts +70 -0
- package/lib/creation-capability-trend-snapshot.d.ts.map +1 -0
- package/lib/creation-capability-trend-snapshot.js +117 -0
- package/lib/creation-capability-trend-snapshot.js.map +1 -0
- package/lib/creation-capability-types.d.ts +254 -4
- package/lib/creation-capability-types.d.ts.map +1 -1
- package/lib/in-process-reload.d.ts +191 -0
- package/lib/in-process-reload.d.ts.map +1 -0
- package/lib/in-process-reload.js +284 -0
- package/lib/in-process-reload.js.map +1 -0
- package/lib/index.d.ts +12 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -2
- package/lib/index.js.map +1 -1
- package/lib/linux-source-build.d.ts +16 -0
- package/lib/linux-source-build.d.ts.map +1 -0
- package/lib/linux-source-build.js +268 -0
- package/lib/linux-source-build.js.map +1 -0
- package/lib/linux-source-preflight.d.ts +31 -0
- package/lib/linux-source-preflight.d.ts.map +1 -0
- package/lib/linux-source-preflight.js +101 -0
- package/lib/linux-source-preflight.js.map +1 -0
- package/lib/live-qualification-runtime.d.ts +6 -2
- package/lib/live-qualification-runtime.d.ts.map +1 -1
- package/lib/live-qualification-runtime.js +65 -11
- package/lib/live-qualification-runtime.js.map +1 -1
- package/lib/owner-task-gap-types.d.ts +23 -0
- package/lib/owner-task-gap-types.d.ts.map +1 -1
- package/lib/owner-task-gaps.d.ts +4 -0
- package/lib/owner-task-gaps.d.ts.map +1 -1
- package/lib/owner-task-gaps.js +35 -1
- package/lib/owner-task-gaps.js.map +1 -1
- package/lib/scanner-owner-runtime.d.ts +34 -0
- package/lib/scanner-owner-runtime.d.ts.map +1 -0
- package/lib/scanner-owner-runtime.js +99 -0
- package/lib/scanner-owner-runtime.js.map +1 -0
- package/lib/service.d.ts +82 -5
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +450 -45
- package/lib/service.js.map +1 -1
- package/lib/source-approval-authority.d.ts.map +1 -1
- package/lib/source-approval-authority.js +25 -7
- package/lib/source-approval-authority.js.map +1 -1
- package/lib/source-build-diagnostics.d.ts +31 -0
- package/lib/source-build-diagnostics.d.ts.map +1 -0
- package/lib/source-build-diagnostics.js +110 -0
- package/lib/source-build-diagnostics.js.map +1 -0
- package/lib/source-build.d.ts +25 -2
- package/lib/source-build.d.ts.map +1 -1
- package/lib/source-build.js +145 -26
- package/lib/source-build.js.map +1 -1
- package/lib/source-creation.d.ts +6 -2
- package/lib/source-creation.d.ts.map +1 -1
- package/lib/source-creation.js +11 -2
- package/lib/source-creation.js.map +1 -1
- package/lib/source-job-types.d.ts +3 -1
- package/lib/source-job-types.d.ts.map +1 -1
- package/lib/source-jobs.d.ts +28 -1
- package/lib/source-jobs.d.ts.map +1 -1
- package/lib/source-jobs.js +117 -26
- package/lib/source-jobs.js.map +1 -1
- package/lib/sqlite.d.ts +1 -1
- package/lib/sqlite.d.ts.map +1 -1
- package/lib/sqlite.js +36 -1
- package/lib/sqlite.js.map +1 -1
- package/lib/store.d.ts +21 -1
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +470 -174
- package/lib/store.js.map +1 -1
- package/lib/systemd-host-authority.d.ts.map +1 -1
- package/lib/systemd-host-authority.js +4 -0
- package/lib/systemd-host-authority.js.map +1 -1
- package/lib/task-observation-runtime.d.ts +6 -2
- package/lib/task-observation-runtime.d.ts.map +1 -1
- package/lib/task-observation-runtime.js +69 -11
- package/lib/task-observation-runtime.js.map +1 -1
- package/lib/types.d.ts +47 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/work-item-creation-contract.d.ts +17 -0
- package/lib/work-item-creation-contract.d.ts.map +1 -0
- package/lib/work-item-creation-contract.js +61 -0
- package/lib/work-item-creation-contract.js.map +1 -0
- package/package.json +10 -10
package/lib/source-jobs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-jobs.d.ts","sourceRoot":"","sources":["../src/source-jobs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"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IAUf,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,WAAW;IAqBnB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAcrD,YAAY;IAoF1B,OAAO,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,eAAe,CAAA;KAAE,GAAG,mBAAmB;IAY3E,uEAAuE;IACvE,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,yBAAyB;IAKjC,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,QAAQ;IAkEhB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAOxB,8HAA8H;IAC9H,OAAO,CAAC,oBAAoB;IAyC5B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,sBAAsB;IAU9B,kFAAkF;IAClF,OAAO,CAAC,sBAAsB;YAShB,oBAAoB;IA6BlC,OAAO,CAAC,cAAc;YASR,OAAO;IAiHrB,qFAAqF;IACrF,gBAAgB,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,eAAe,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAqB9F"}
|
package/lib/source-jobs.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import { normalizeSourceCreationGrant } from './source-creation.js';
|
|
1
2
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
3
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
3
4
|
import { realpath } from 'node:fs/promises';
|
|
4
|
-
import { SourceGrowthRunUnavailableError, isSourceOwnerContinuation, validateSourceGrowthRunBinding } from '@dsh-enhanced/assistant-growth-contract';
|
|
5
|
+
import { SourceGrowthRunUnavailableError, isSourceOwnerContinuation, validateAnySourceGrowthRunBinding as validateSourceGrowthRunBinding } from '@dsh-enhanced/assistant-growth-contract';
|
|
5
6
|
import { automationDefinitionDigest } from '@dsh-enhanced/assistant-automations';
|
|
6
7
|
import { controlPlaneDigest, expectedSourceRelease } from './store.js';
|
|
7
8
|
import { awaitSourceSignal, inspectSourceContext } from './source-context.js';
|
|
8
9
|
import { assertPluginModificationAllowed, removeSourceJobWorktree, validateScopedPluginFiles } from './source-workspace.js';
|
|
9
10
|
import { assertManagedVersionPaths } from './source-versioning.js';
|
|
10
11
|
import { resolveSourceBaseline, validateSourceBaselineConfig } from './source-baseline.js';
|
|
11
|
-
import { removeSourceJobContainer } from './source-build.js';
|
|
12
|
+
import { removeSourceJobContainer, validateSourceBuildConfig } from './source-build.js';
|
|
12
13
|
import { inspectSourceRevisionContext, validateSourceRevisionGrant } from './source-revision.js';
|
|
13
14
|
import { inspectSourceCreationContext, validateSourceCreationFiles, validateSourceCreationGrant } from './source-creation.js';
|
|
14
15
|
import { inheritedEnvironment } from './trust.js';
|
|
16
|
+
import { SOURCE_BUILD_CHECK_FAILED } from './source-build-diagnostics.js';
|
|
15
17
|
export const SOURCE_JOB_OWNER = 'plugin-control-plane-source';
|
|
16
18
|
const EXECUTOR = 'plugin-control-plane-source-check';
|
|
17
19
|
const CATALOG = controlPlaneDigest({ executor: EXECUTOR, version: 1, operation: 'isolated-check-pending-plan' });
|
|
@@ -34,6 +36,7 @@ export function validateSourceJobsConfig(value, build) {
|
|
|
34
36
|
|| !Number.isSafeInteger(value.budgetAmount) || value.budgetAmount < 1) {
|
|
35
37
|
throw new Error('plugin-control-plane: invalid sourceJobs authority configuration');
|
|
36
38
|
}
|
|
39
|
+
validateSourceBuildConfig(build);
|
|
37
40
|
if (value.baseline !== undefined)
|
|
38
41
|
validateSourceBaselineConfig(value.baseline);
|
|
39
42
|
if (value.allowedModes !== undefined && (!Array.isArray(value.allowedModes) || value.allowedModes.length < 1
|
|
@@ -45,18 +48,24 @@ export function validateSourceJobsConfig(value, build) {
|
|
|
45
48
|
validateSourceCreationGrant(value.creation);
|
|
46
49
|
if (value.revision !== undefined)
|
|
47
50
|
validateSourceRevisionGrant(value.revision);
|
|
48
|
-
if (
|
|
51
|
+
if ('backend' in build && build.backend === 'macos-seatbelt'
|
|
49
52
|
&& (!value.allowedModes || value.allowedModes.some(mode => mode === 'modify')
|
|
50
53
|
|| value.creation === undefined && value.revision === undefined)) {
|
|
51
54
|
throw new Error('plugin-control-plane: native source jobs require finite create/revise-created grants');
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
|
-
function
|
|
57
|
+
export function normalizeSourceJobsConfig(value, build) {
|
|
58
|
+
validateSourceJobsConfig(value, build);
|
|
59
|
+
return { ...structuredClone(value), ...(value.creation ? { creation: normalizeSourceCreationGrant(value.creation) } : {}) };
|
|
60
|
+
}
|
|
61
|
+
function projection(job, diagnostics) {
|
|
55
62
|
return { id: job.id, name: job.intent.name, gapId: job.intent.gapId, baseCommit: job.intent.baseCommit,
|
|
56
63
|
...(job.intent.mode === undefined ? {} : { mode: job.intent.mode }),
|
|
57
64
|
status: job.status, createdAt: job.createdAt, expiresAt: job.expiresAt,
|
|
58
|
-
...(job.planId === undefined ? {} : { planId: job.planId }), ...(job.failureCode === undefined ? {} : { failureCode: job.failureCode })
|
|
65
|
+
...(job.planId === undefined ? {} : { planId: job.planId }), ...(job.failureCode === undefined ? {} : { failureCode: job.failureCode }),
|
|
66
|
+
...(diagnostics !== undefined && job.status === 'failed' && job.failureCode === SOURCE_BUILD_CHECK_FAILED ? { diagnostics } : {}) };
|
|
59
67
|
}
|
|
68
|
+
const MAX_RETAINED_DIAGNOSTICS = 64;
|
|
60
69
|
/** Persisted intent + native Automations execution. This class owns no scheduler. */
|
|
61
70
|
export class SourceJobRuntime {
|
|
62
71
|
options;
|
|
@@ -75,9 +84,15 @@ export class SourceJobRuntime {
|
|
|
75
84
|
continuationCursor = 0;
|
|
76
85
|
continuationStatus;
|
|
77
86
|
continuationTransition = 0;
|
|
87
|
+
/** Process-local, bounded build diagnostics; the failure code itself is durable. */
|
|
88
|
+
diagnostics = new Map();
|
|
78
89
|
constructor(options) {
|
|
79
90
|
this.options = options;
|
|
80
91
|
validateSourceJobsConfig(options.config, options.build);
|
|
92
|
+
// Preserve the live object identity used by effect-boundary drift checks.
|
|
93
|
+
// False has no authority and is canonically absent, just like the default.
|
|
94
|
+
if (options.config.creation?.workItemFailures === false)
|
|
95
|
+
delete options.config.creation.workItemFailures;
|
|
81
96
|
this.authorityDigest = controlPlaneDigest({ config: options.config, build: options.build });
|
|
82
97
|
this.continuationNonce = controlPlaneDigest({ authority: this.authorityDigest, generation: this.generation });
|
|
83
98
|
}
|
|
@@ -265,6 +280,16 @@ export class SourceJobRuntime {
|
|
|
265
280
|
await this.options.adoptReleased(job, signal, assertCurrent);
|
|
266
281
|
}
|
|
267
282
|
}
|
|
283
|
+
inspectWorkItemReadiness(owner) {
|
|
284
|
+
if (!this.available() || !this.modeAllowed('create') || ('expiresAt' in this.options.build && Date.now() >= this.options.build.expiresAt) || this.options.config.creation?.workItemFailures !== true || Date.now() >= this.options.config.creation.expiresAt)
|
|
285
|
+
return undefined;
|
|
286
|
+
const current = this.receipt();
|
|
287
|
+
if (!isSourceOwnerContinuation(current, owner))
|
|
288
|
+
return undefined;
|
|
289
|
+
const config = this.options.config;
|
|
290
|
+
const authority = { id: config.authorityId, digest: this.authorityDigest, expiresAt: config.expiresAt };
|
|
291
|
+
return { authority, creation: structuredClone(config.creation), remaining: this.options.store.inspectSourceJobQuota({ authority: { ...authority, maxSubmissions: config.maxSubmissions }, creation: config.creation }) };
|
|
292
|
+
}
|
|
268
293
|
available() { return this.active && !this.abort.signal.aborted && Date.now() < this.options.config.expiresAt; }
|
|
269
294
|
close() {
|
|
270
295
|
return this.closing ??= (async () => {
|
|
@@ -313,8 +338,15 @@ export class SourceJobRuntime {
|
|
|
313
338
|
throw new Error('source job caller scope mismatch');
|
|
314
339
|
return owner;
|
|
315
340
|
}
|
|
316
|
-
withGapSource(gapId, owner, callback)
|
|
317
|
-
|
|
341
|
+
withJobSource(job, callback) { return this.withGapSource(job.intent.gapId, job.intent.owner, callback, job.intent.creation?.growthRun ?? job.intent.revision?.growthRun); }
|
|
342
|
+
withGapSource(gapId, owner, callback, growthRun) {
|
|
343
|
+
const reference = this.options.store.getOwnerTaskFailureReference(gapId);
|
|
344
|
+
if (reference?.schemaVersion === 2) {
|
|
345
|
+
if (growthRun?.protocol !== 'assistant-growth/source-run/v2' || !this.options.withWorkItemGrowthRunFence)
|
|
346
|
+
throw new SourceGrowthRunUnavailableError('work item growth source fence unavailable');
|
|
347
|
+
return this.options.withWorkItemGrowthRunFence(growthRun, gapId, owner, false, callback);
|
|
348
|
+
}
|
|
349
|
+
if (reference === undefined)
|
|
318
350
|
return callback();
|
|
319
351
|
if (!this.options.withGapSourceFence)
|
|
320
352
|
throw new Error('source job task provenance service unavailable');
|
|
@@ -346,7 +378,7 @@ export class SourceJobRuntime {
|
|
|
346
378
|
if (!parent || parent.name !== job.intent.name || controlPlaneDigest(parent.parent) !== controlPlaneDigest(job.intent.revision.parent))
|
|
347
379
|
throw new Error('source revision parent changed');
|
|
348
380
|
}
|
|
349
|
-
this.
|
|
381
|
+
this.withJobSource(job, () => this.assertGrowthRun((job.intent.creation?.growthRun ?? job.intent.revision?.growthRun), job.intent.mode, job.intent.gapId, job.intent.owner, false));
|
|
350
382
|
}
|
|
351
383
|
assertGrowthRun(growthRun, mode, gapId, owner, generation) {
|
|
352
384
|
const taskBacked = this.options.store.getOwnerTaskFailureReference(gapId) !== undefined;
|
|
@@ -358,12 +390,16 @@ export class SourceJobRuntime {
|
|
|
358
390
|
if (growthRun === undefined)
|
|
359
391
|
throw new Error('task-backed creation requires a frozen source growth run');
|
|
360
392
|
validateSourceGrowthRunBinding(growthRun);
|
|
393
|
+
if (growthRun.protocol === 'assistant-growth/source-run/v2' && (mode !== 'create' || this.options.config.creation?.workItemFailures !== true || this.options.store.getOwnerTaskFailureReference(gapId)?.schemaVersion !== 2))
|
|
394
|
+
throw new Error('work item growth requires explicit create authority');
|
|
361
395
|
if (!this.options.assertGrowthRun)
|
|
362
396
|
throw new SourceGrowthRunUnavailableError('source growth run producer unavailable');
|
|
363
397
|
this.options.assertGrowthRun(growthRun, gapId, owner, generation);
|
|
364
398
|
}
|
|
365
399
|
enqueue(input) {
|
|
366
400
|
this.assertMode(input.mode);
|
|
401
|
+
if (input.growthRun?.protocol === 'assistant-growth/source-run/v2' && input.mode !== 'create')
|
|
402
|
+
throw new Error('work item growth only permits create');
|
|
367
403
|
if (input.mode !== 'create' && input.mode !== 'revise-created' && input.growthRun !== undefined)
|
|
368
404
|
throw new Error('modify source job cannot carry a growth run');
|
|
369
405
|
if (input.mode === 'create' || input.mode === 'revise-created')
|
|
@@ -382,7 +418,7 @@ export class SourceJobRuntime {
|
|
|
382
418
|
async enqueueOwned(input) {
|
|
383
419
|
this.assertMode(input.mode);
|
|
384
420
|
const signal = AbortSignal.any([input.signal, this.abort.signal, AbortSignal.timeout(15_000)]);
|
|
385
|
-
const assertCurrent = async () => { signal.throwIfAborted(); await awaitSourceSignal(signal, input.assertCurrent); this.withGapSource(input.gapId, this.assertCaller(input.owner), () => { }); if (!this.available())
|
|
421
|
+
const assertCurrent = async () => { signal.throwIfAborted(); await awaitSourceSignal(signal, input.assertCurrent); this.withGapSource(input.gapId, this.assertCaller(input.owner), () => { }, input.growthRun); if (!this.available())
|
|
386
422
|
throw new Error('source job authority unavailable'); signal.throwIfAborted(); };
|
|
387
423
|
await assertCurrent();
|
|
388
424
|
if (input.mode === 'create' || input.mode === 'revise-created')
|
|
@@ -410,7 +446,7 @@ export class SourceJobRuntime {
|
|
|
410
446
|
const owner = reference?.owner ?? currentOwner;
|
|
411
447
|
if (reference && !isSourceOwnerContinuation(currentOwner, owner))
|
|
412
448
|
throw new Error('source job task owner changed');
|
|
413
|
-
this.withGapSource(input.gapId, currentOwner, () => this.assertGrowthRun(input.growthRun, input.mode, input.gapId, owner, true));
|
|
449
|
+
this.withGapSource(input.gapId, currentOwner, () => this.assertGrowthRun(input.growthRun, input.mode, input.gapId, owner, true), input.growthRun);
|
|
414
450
|
const parent = input.mode === 'revise-created' ? this.options.inspectRevisionParent?.(input.parentPlanId) : undefined;
|
|
415
451
|
if (input.mode === 'revise-created' && (!parent || parent.name !== input.name))
|
|
416
452
|
throw new Error('adopted revision parent unavailable or mismatched');
|
|
@@ -464,7 +500,7 @@ export class SourceJobRuntime {
|
|
|
464
500
|
files: structuredClone(input.files), ttlMs: input.ttlMs, build: structuredClone(this.options.build),
|
|
465
501
|
worktree: join(this.options.statePath, 'source-worktrees', `worktree-job-${token}`),
|
|
466
502
|
...('backend' in this.options.build
|
|
467
|
-
? { nativeResource: { backend:
|
|
503
|
+
? { nativeResource: { backend: this.options.build.backend, key: id } }
|
|
468
504
|
: { containerName: `dsh-source-job-${token}` }),
|
|
469
505
|
};
|
|
470
506
|
await assertCurrent();
|
|
@@ -472,7 +508,7 @@ export class SourceJobRuntime {
|
|
|
472
508
|
const job = this.withGapSource(gap.id, owner, () => {
|
|
473
509
|
this.assertGrowthRun(input.growthRun, input.mode, gap.id, owner, true);
|
|
474
510
|
return this.options.store.enqueueSourceJob({ id, automationId: id, idempotencyKey: input.idempotencyKey, intent });
|
|
475
|
-
});
|
|
511
|
+
}, input.growthRun);
|
|
476
512
|
if (job.status === 'queued')
|
|
477
513
|
this.scheduleOrFail(job);
|
|
478
514
|
return projection(this.options.store.getSourceJob(id));
|
|
@@ -487,7 +523,7 @@ export class SourceJobRuntime {
|
|
|
487
523
|
|| job.intent.owner.principalVersion !== owner.principalVersion || job.intent.owner.workspace !== owner.workspace
|
|
488
524
|
|| job.intent.owner.agentPreset !== owner.agentPreset)
|
|
489
525
|
throw new Error('source job not found for current owner');
|
|
490
|
-
return projection(this.refreshQueued(job));
|
|
526
|
+
return projection(this.refreshQueued(job), this.diagnostics.get(job.id));
|
|
491
527
|
}
|
|
492
528
|
/** Native runner admission can fail before our executor is invoked. */
|
|
493
529
|
refreshQueued(job) {
|
|
@@ -503,10 +539,13 @@ export class SourceJobRuntime {
|
|
|
503
539
|
code = 'source-job-growth-run-missing';
|
|
504
540
|
else {
|
|
505
541
|
try {
|
|
506
|
-
this.
|
|
542
|
+
this.withJobSource(job, () => { providerUnavailable = this.growthProducerUnavailable(job); });
|
|
507
543
|
}
|
|
508
|
-
catch {
|
|
509
|
-
|
|
544
|
+
catch (error) {
|
|
545
|
+
if (error instanceof SourceGrowthRunUnavailableError)
|
|
546
|
+
providerUnavailable = true;
|
|
547
|
+
else
|
|
548
|
+
code = 'source-job-task-source-changed';
|
|
510
549
|
}
|
|
511
550
|
}
|
|
512
551
|
if (job.expiresAt <= Date.now())
|
|
@@ -534,10 +573,24 @@ export class SourceJobRuntime {
|
|
|
534
573
|
throw error;
|
|
535
574
|
}
|
|
536
575
|
}
|
|
576
|
+
linuxRevisionReviewTimeoutMs() {
|
|
577
|
+
// A Linux revision can run two independently bounded reviews after its
|
|
578
|
+
// repository build. This outer window never changes their own budgets or
|
|
579
|
+
// the frozen source expiry; legacy backend definitions retain their identity.
|
|
580
|
+
if (!('backend' in this.options.build) || this.options.build.backend !== 'linux-native')
|
|
581
|
+
return 0;
|
|
582
|
+
return (this.options.verifyPreparedRevision ? 1_800_000 : 0)
|
|
583
|
+
+ (this.options.verifyPreparedRevisionRegression ? 1_800_000 : 0);
|
|
584
|
+
}
|
|
537
585
|
definition(job) {
|
|
538
586
|
const config = this.options.config;
|
|
539
587
|
return { name: `Source check: ${job.intent.name}`, schedule: { kind: 'at', at: new Date(job.dispatchAt ?? job.createdAt + 1000).toISOString() },
|
|
540
|
-
workspace: config.workspace, agentPreset: config.preset, timeoutMs: job.intent.build.timeoutMs + 120_000
|
|
588
|
+
workspace: config.workspace, agentPreset: config.preset, timeoutMs: job.intent.build.timeoutMs + 120_000
|
|
589
|
+
+ (job.intent.mode === 'revise-created' ? this.linuxRevisionReviewTimeoutMs() : 0)
|
|
590
|
+
+ (job.intent.mode === 'create' && job.intent.creation?.growthRun?.protocol === 'assistant-growth/source-run/v2'
|
|
591
|
+
&& 'backend' in this.options.build
|
|
592
|
+
&& this.options.build.backend === 'linux-native' && this.options.verifyPreparedCreation ? 1_800_000 : 0)
|
|
593
|
+
+ (this.options.advanceReleased ? this.options.releaseTimeoutMs ?? 40_000 : 0) + (this.options.adoptReleased ? this.options.adoptionTimeoutMs ?? 60_000 : 0),
|
|
541
594
|
misfire: { kind: 'latest' }, overlap: 'skip', retrySafety: 'never', maxRetries: 0, principal: config.principalId,
|
|
542
595
|
...(config.budgetId === undefined ? {} : { budgetId: config.budgetId, budgetAmount: config.budgetAmount }),
|
|
543
596
|
execution: { kind: 'host', executorId: EXECUTOR, executorContractVersion: 1, runbookId: EXECUTOR, runbookVersion: 1, catalogDigest: CATALOG,
|
|
@@ -556,7 +609,7 @@ export class SourceJobRuntime {
|
|
|
556
609
|
if ((health.automationStatus === 'paused' && dueAt <= Date.now())
|
|
557
610
|
|| (terminal !== undefined && terminal.immutableContext.state === 'verified'
|
|
558
611
|
&& terminal.immutableContext.definitionHash === job.definitionHash && terminal.createdAt >= job.createdAt)) {
|
|
559
|
-
job = this.
|
|
612
|
+
job = this.withJobSource(job, () => {
|
|
560
613
|
this.assertGrowthRun(job.intent.creation?.growthRun ?? job.intent.revision?.growthRun, job.intent.mode, job.intent.gapId, job.intent.owner, false);
|
|
561
614
|
return this.options.store.rearmQueuedGrowthSourceJob({ id: job.id, revision: job.revision,
|
|
562
615
|
priorDefinitionHash: job.definitionHash, priorDefinitionVersion: health.definitionVersion, dispatchAt: Date.now() + 1000 });
|
|
@@ -671,7 +724,7 @@ export class SourceJobRuntime {
|
|
|
671
724
|
return false;
|
|
672
725
|
try {
|
|
673
726
|
this.assertOwner(job);
|
|
674
|
-
this.
|
|
727
|
+
this.withJobSource(job, () => {
|
|
675
728
|
this.assertGrowthRun(job.intent.creation?.growthRun, job.intent.mode, job.intent.gapId, job.intent.owner, false);
|
|
676
729
|
});
|
|
677
730
|
}
|
|
@@ -707,7 +760,7 @@ export class SourceJobRuntime {
|
|
|
707
760
|
continuationTimeoutMs() {
|
|
708
761
|
const release = this.options.releaseTimeoutMs ?? 40_000, adoption = this.options.adoptionTimeoutMs ?? 60_000;
|
|
709
762
|
const needed = (this.options.adoptReleased ? adoption : 0) + (this.options.advanceReleased ? release + 40_000 : this.options.releasePrepared ? 40_000 : 10_000);
|
|
710
|
-
return Math.max(this.options.verifyPreparedCreation ? 1_800_000 : 10_000, needed);
|
|
763
|
+
return Math.max(this.linuxRevisionReviewTimeoutMs(), this.options.verifyPreparedCreation ? 1_800_000 : 10_000, needed);
|
|
711
764
|
}
|
|
712
765
|
continuationSignalTimeoutMs(job) {
|
|
713
766
|
if (job.planId) {
|
|
@@ -812,7 +865,7 @@ export class SourceJobRuntime {
|
|
|
812
865
|
const health = this.options.ports.automations.inspectSystemOwned({ owner: SOURCE_JOB_OWNER, automationId: job.automationId });
|
|
813
866
|
if (health.definitionHash !== rebound.definitionHash)
|
|
814
867
|
throw new Error('source job premature occurrence native binding changed');
|
|
815
|
-
const pending = this.
|
|
868
|
+
const pending = this.withJobSource(rebound, () => {
|
|
816
869
|
this.assertGrowthRun(rebound.intent.creation?.growthRun ?? rebound.intent.revision?.growthRun, rebound.intent.mode, rebound.intent.gapId, rebound.intent.owner, false);
|
|
817
870
|
return this.options.store.rearmQueuedGrowthSourceJob({ id: rebound.id, revision: rebound.revision,
|
|
818
871
|
priorDefinitionHash: rebound.definitionHash, priorDefinitionVersion: health.definitionVersion, dispatchAt: Date.now() + 1000 });
|
|
@@ -825,12 +878,15 @@ export class SourceJobRuntime {
|
|
|
825
878
|
return failure(false);
|
|
826
879
|
}
|
|
827
880
|
let claimed = false;
|
|
881
|
+
let claimedJob;
|
|
828
882
|
const growthController = (job.intent.creation?.growthRun ?? job.intent.revision?.growthRun) === undefined ? undefined : new AbortController();
|
|
829
883
|
if (growthController)
|
|
830
884
|
this.growthControllers.add(growthController);
|
|
831
885
|
const signal = AbortSignal.any([input.signal, this.abort.signal,
|
|
832
886
|
...(growthController ? [growthController.signal] : []),
|
|
833
|
-
AbortSignal.timeout(Math.max(1, Math.min(job.intent.build.timeoutMs + 120_000
|
|
887
|
+
AbortSignal.timeout(Math.max(1, Math.min(job.intent.build.timeoutMs + 120_000
|
|
888
|
+
+ (job.intent.mode === 'revise-created' && this.linuxRevisionReviewTimeoutMs()
|
|
889
|
+
? this.linuxRevisionReviewTimeoutMs() : this.options.verifyPreparedCreation ? 1_800_000 : 0)
|
|
834
890
|
+ (this.options.advanceReleased ? this.options.releaseTimeoutMs ?? 40_000 : 0) + (this.options.adoptReleased ? this.options.adoptionTimeoutMs ?? 60_000 : 0), job.expiresAt - Date.now())))]);
|
|
835
891
|
try {
|
|
836
892
|
this.assertOwner(job);
|
|
@@ -839,9 +895,11 @@ export class SourceJobRuntime {
|
|
|
839
895
|
|| input.ownerRouteId !== job.intent.owner.authorityId || input.principal !== job.intent.owner.principalId
|
|
840
896
|
|| input.targetScope.workspace !== job.intent.owner.workspace || input.targetScope.preset !== job.intent.owner.agentPreset)
|
|
841
897
|
throw new Error('source job executor binding mismatch');
|
|
842
|
-
|
|
898
|
+
const queuedJob = job;
|
|
899
|
+
job = this.withJobSource(queuedJob, () => this.options.store.claimSourceJob({ id: queuedJob.id, revision: queuedJob.revision, definitionHash: input.definitionHash, occurrenceId: input.occurrenceId }));
|
|
843
900
|
claimed = true;
|
|
844
901
|
const owned = job;
|
|
902
|
+
claimedJob = owned;
|
|
845
903
|
const assertCurrent = async () => {
|
|
846
904
|
signal.throwIfAborted();
|
|
847
905
|
this.assertOwner(owned);
|
|
@@ -874,8 +932,40 @@ export class SourceJobRuntime {
|
|
|
874
932
|
if (!claimed && current?.status === 'queued'
|
|
875
933
|
&& (current.revision !== job.revision || current.definitionHash !== input.definitionHash))
|
|
876
934
|
return failure(false);
|
|
877
|
-
if (
|
|
878
|
-
|
|
935
|
+
if (claimed && claimedJob && current?.status === 'running' && current.revision === claimedJob.revision
|
|
936
|
+
&& current.occurrenceId === claimedJob.occurrenceId && current.intentDigest === claimedJob.intentDigest) {
|
|
937
|
+
let notStarted = false;
|
|
938
|
+
try {
|
|
939
|
+
notStarted = this.options.isPreparationNotStarted?.(error, claimedJob) === true;
|
|
940
|
+
}
|
|
941
|
+
catch { /* Unavailable proof remains unknown. */ }
|
|
942
|
+
let diagnostics;
|
|
943
|
+
if (!notStarted) {
|
|
944
|
+
try {
|
|
945
|
+
diagnostics = this.options.deterministicBuildFailure?.(error, claimedJob);
|
|
946
|
+
}
|
|
947
|
+
catch { /* Unavailable proof remains unknown. */ }
|
|
948
|
+
}
|
|
949
|
+
if (diagnostics !== undefined) {
|
|
950
|
+
this.options.store.settleSourceJob({ id: claimedJob.id, revision: claimedJob.revision,
|
|
951
|
+
status: 'failed', failureCode: SOURCE_BUILD_CHECK_FAILED });
|
|
952
|
+
this.diagnostics.delete(claimedJob.id);
|
|
953
|
+
this.diagnostics.set(claimedJob.id, diagnostics);
|
|
954
|
+
while (this.diagnostics.size > MAX_RETAINED_DIAGNOSTICS)
|
|
955
|
+
this.diagnostics.delete(this.diagnostics.keys().next().value);
|
|
956
|
+
return { outcome: 'failed', failureClass: 'execution', failurePhase: 'host-execution',
|
|
957
|
+
failureCode: SOURCE_BUILD_CHECK_FAILED, sideEffectState: 'possible', retryability: 'unsafe' };
|
|
958
|
+
}
|
|
959
|
+
if (notStarted) {
|
|
960
|
+
this.options.store.settleSourceJob({ id: claimedJob.id, revision: claimedJob.revision,
|
|
961
|
+
status: 'failed', failureCode: 'source-job-preparation-not-started' });
|
|
962
|
+
return { outcome: 'failed', failureClass: 'configuration', failurePhase: 'host-execution',
|
|
963
|
+
failureCode: 'source-job-preparation-not-started', sideEffectState: 'possible', retryability: 'unsafe' };
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (!claimed && current?.status === 'queued' && current.revision === job.revision
|
|
967
|
+
|| claimed && current?.status === 'running' && current.revision === job.revision && current.occurrenceId === input.occurrenceId) {
|
|
968
|
+
this.options.store.settleSourceJob({ id: job.id, revision: job.revision, status: claimed ? 'unknown' : 'failed', failureCode: claimed ? 'source-job-interrupted' : 'source-job-preflight-rejected' });
|
|
879
969
|
}
|
|
880
970
|
return failure(claimed);
|
|
881
971
|
}
|
|
@@ -895,7 +985,8 @@ export class SourceJobRuntime {
|
|
|
895
985
|
if (controlPlaneDigest(trust) !== job.intent.trustDigest)
|
|
896
986
|
throw new Error('source job trust changed');
|
|
897
987
|
if ('backend' in job.intent.build) {
|
|
898
|
-
if (job.intent.nativeResource?.backend !==
|
|
988
|
+
if (job.intent.nativeResource?.backend !== job.intent.build.backend || job.intent.nativeResource.key !== job.id
|
|
989
|
+
|| controlPlaneDigest(this.options.build) !== controlPlaneDigest(job.intent.build)
|
|
899
990
|
|| await this.options.inspectNativeQuiescence?.(job.id) !== 'quiescent') {
|
|
900
991
|
throw new Error('native source job has no valid durable quiescence receipt');
|
|
901
992
|
}
|