@cat-factory/orchestration 0.193.0 → 0.195.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/dist/container/dependencies.d.ts +17 -1
- package/dist/container/dependencies.d.ts.map +1 -1
- package/dist/container/module-shapes.d.ts +5 -0
- package/dist/container/module-shapes.d.ts.map +1 -1
- package/dist/container/platform-modules.d.ts.map +1 -1
- package/dist/container/platform-modules.js +14 -1
- package/dist/container/platform-modules.js.map +1 -1
- package/dist/container.d.ts +20 -2
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +14 -0
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/board/BoardService.d.ts +2 -0
- package/dist/modules/board/BoardService.d.ts.map +1 -1
- package/dist/modules/board/BoardService.js +4 -0
- package/dist/modules/board/BoardService.js.map +1 -1
- package/dist/modules/board/publicBoardReads.d.ts +12 -0
- package/dist/modules/board/publicBoardReads.d.ts.map +1 -1
- package/dist/modules/board/publicBoardReads.js +19 -4
- package/dist/modules/board/publicBoardReads.js.map +1 -1
- package/dist/modules/debug/RunDebugService.d.ts +27 -1
- package/dist/modules/debug/RunDebugService.d.ts.map +1 -1
- package/dist/modules/debug/RunDebugService.js +24 -2
- package/dist/modules/debug/RunDebugService.js.map +1 -1
- package/dist/modules/debug/debug.logic.d.ts +3 -3
- package/dist/modules/debug/debug.logic.d.ts.map +1 -1
- package/dist/modules/debug/debug.logic.js +4 -1
- package/dist/modules/debug/debug.logic.js.map +1 -1
- package/dist/modules/execution/AgentDispatchController.d.ts +115 -0
- package/dist/modules/execution/AgentDispatchController.d.ts.map +1 -0
- package/dist/modules/execution/AgentDispatchController.js +307 -0
- package/dist/modules/execution/AgentDispatchController.js.map +1 -0
- package/dist/modules/execution/ExecutionService.d.ts +18 -105
- package/dist/modules/execution/ExecutionService.d.ts.map +1 -1
- package/dist/modules/execution/ExecutionService.js +77 -589
- package/dist/modules/execution/ExecutionService.js.map +1 -1
- package/dist/modules/execution/ExecutionServiceDependencies.d.ts +6 -0
- package/dist/modules/execution/ExecutionServiceDependencies.d.ts.map +1 -1
- package/dist/modules/execution/IterationCapController.d.ts +57 -0
- package/dist/modules/execution/IterationCapController.d.ts.map +1 -0
- package/dist/modules/execution/IterationCapController.js +141 -0
- package/dist/modules/execution/IterationCapController.js.map +1 -0
- package/dist/modules/execution/MergeResolver.d.ts +14 -2
- package/dist/modules/execution/MergeResolver.d.ts.map +1 -1
- package/dist/modules/execution/MergeResolver.js +83 -30
- package/dist/modules/execution/MergeResolver.js.map +1 -1
- package/dist/modules/execution/PrVerificationReportController.d.ts +23 -0
- package/dist/modules/execution/PrVerificationReportController.d.ts.map +1 -1
- package/dist/modules/execution/PrVerificationReportController.js +18 -0
- package/dist/modules/execution/PrVerificationReportController.js.map +1 -1
- package/dist/modules/execution/RunDispatcher.d.ts +31 -195
- package/dist/modules/execution/RunDispatcher.d.ts.map +1 -1
- package/dist/modules/execution/RunDispatcher.js +47 -313
- package/dist/modules/execution/RunDispatcher.js.map +1 -1
- package/dist/modules/execution/RunDispatcherDependencies.d.ts +142 -0
- package/dist/modules/execution/RunDispatcherDependencies.d.ts.map +1 -0
- package/dist/modules/execution/RunDispatcherDependencies.js +27 -0
- package/dist/modules/execution/RunDispatcherDependencies.js.map +1 -0
- package/dist/modules/execution/RunLifecycleController.d.ts +154 -0
- package/dist/modules/execution/RunLifecycleController.d.ts.map +1 -0
- package/dist/modules/execution/RunLifecycleController.js +507 -0
- package/dist/modules/execution/RunLifecycleController.js.map +1 -0
- package/dist/modules/execution/RunStateMachine.d.ts.map +1 -1
- package/dist/modules/execution/RunStateMachine.js +27 -14
- package/dist/modules/execution/RunStateMachine.js.map +1 -1
- package/dist/modules/execution/StepDecisionController.d.ts +20 -0
- package/dist/modules/execution/StepDecisionController.d.ts.map +1 -1
- package/dist/modules/execution/StepDecisionController.js +30 -0
- package/dist/modules/execution/StepDecisionController.js.map +1 -1
- package/dist/modules/execution/policy-types.d.ts +14 -1
- package/dist/modules/execution/policy-types.d.ts.map +1 -1
- package/dist/modules/execution/prReport.commands.d.ts +54 -0
- package/dist/modules/execution/prReport.commands.d.ts.map +1 -0
- package/dist/modules/execution/prReport.commands.js +316 -0
- package/dist/modules/execution/prReport.commands.js.map +1 -0
- package/dist/modules/execution/prReport.environments.d.ts +11 -0
- package/dist/modules/execution/prReport.environments.d.ts.map +1 -1
- package/dist/modules/execution/prReport.environments.js +9 -1
- package/dist/modules/execution/prReport.environments.js.map +1 -1
- package/dist/modules/execution/prReport.logic.d.ts.map +1 -1
- package/dist/modules/execution/prReport.logic.js +23 -2
- package/dist/modules/execution/prReport.logic.js.map +1 -1
- package/dist/modules/execution/reproductionProof.logic.js +1 -1
- package/dist/modules/execution/reproductionProof.logic.js.map +1 -1
- package/dist/modules/execution/retry.logic.d.ts +3 -2
- package/dist/modules/execution/retry.logic.d.ts.map +1 -1
- package/dist/modules/execution/retry.logic.js +14 -2
- package/dist/modules/execution/retry.logic.js.map +1 -1
- package/dist/modules/execution/run-action-controllers.d.ts +18 -0
- package/dist/modules/execution/run-action-controllers.d.ts.map +1 -0
- package/dist/modules/execution/run-action-controllers.js +19 -0
- package/dist/modules/execution/run-action-controllers.js.map +1 -0
- package/dist/modules/execution/runMode.logic.d.ts +78 -0
- package/dist/modules/execution/runMode.logic.d.ts.map +1 -0
- package/dist/modules/execution/runMode.logic.js +78 -0
- package/dist/modules/execution/runMode.logic.js.map +1 -0
- package/dist/modules/execution/runStartOptions.d.ts +16 -1
- package/dist/modules/execution/runStartOptions.d.ts.map +1 -1
- package/dist/modules/merge/RiskPolicyService.d.ts.map +1 -1
- package/dist/modules/merge/RiskPolicyService.js +4 -0
- package/dist/modules/merge/RiskPolicyService.js.map +1 -1
- package/dist/modules/observability/LlmObservabilityService.d.ts +35 -4
- package/dist/modules/observability/LlmObservabilityService.d.ts.map +1 -1
- package/dist/modules/observability/LlmObservabilityService.js +43 -7
- package/dist/modules/observability/LlmObservabilityService.js.map +1 -1
- package/dist/modules/observability/observability.logic.d.ts +12 -2
- package/dist/modules/observability/observability.logic.d.ts.map +1 -1
- package/dist/modules/observability/observability.logic.js +31 -2
- package/dist/modules/observability/observability.logic.js.map +1 -1
- package/dist/modules/tutorial/TutorialProgressService.d.ts +51 -0
- package/dist/modules/tutorial/TutorialProgressService.d.ts.map +1 -0
- package/dist/modules/tutorial/TutorialProgressService.js +111 -0
- package/dist/modules/tutorial/TutorialProgressService.js.map +1 -0
- package/dist/modules/tutorial/TutorialTelemetryService.d.ts +47 -0
- package/dist/modules/tutorial/TutorialTelemetryService.d.ts.map +1 -0
- package/dist/modules/tutorial/TutorialTelemetryService.js +67 -0
- package/dist/modules/tutorial/TutorialTelemetryService.js.map +1 -0
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunDispatcher.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/RunDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RunDispatcher.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/RunDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EACf,cAAc,EAId,6BAA6B,EAC7B,eAAe,EAGf,iBAAiB,EAEjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EAId,eAAe,EACf,cAAc,EAEd,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,oBAAoB,EAIrB,MAAM,qBAAqB,CAAA;AAmD5B,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAYjE,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,gCAAgC,CAAA;AAKvC,YAAY,EAAE,kBAAkB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AAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,CAE7B;IAED,kDAAkD;IAClD,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,CAE7B;IAED;;;;;;;OAOG;YACW,eAAe;IAsB7B;;;;;OAKG;YACW,UAAU;CAWzB"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isAsyncAgentExecutor, noopLogger, runBestEffort, RunContendedError, } from '@cat-factory/kernel';
|
|
2
2
|
import { parseBlueprintService, parseSpecDoc } from '@cat-factory/contracts';
|
|
3
|
-
import { applyContainerRunning, applySubtaskProgress
|
|
4
|
-
import { FORK_PROPOSER_KIND
|
|
3
|
+
import { applyContainerRunning, applySubtaskProgress } from './step-fold.logic.js';
|
|
4
|
+
import { FORK_PROPOSER_KIND } from '@cat-factory/agents';
|
|
5
5
|
import { isDeployStep } from '@cat-factory/integrations';
|
|
6
6
|
import { reviewableArtifactOutput } from './artifact-review.logic.js';
|
|
7
7
|
import { HUMAN_TEST_AGENT_KIND } from './ci.logic.js';
|
|
8
|
-
import { classifyDispatchFailure } from './job.logic.js';
|
|
9
8
|
import { AgentContextBuilder } from './AgentContextBuilder.js';
|
|
10
9
|
import { DeployerStepController } from './DeployerStepController.js';
|
|
11
10
|
import { FollowUpGateController } from './FollowUpGateController.js';
|
|
@@ -18,10 +17,8 @@ import { ForkDecisionController } from './ForkDecisionController.js';
|
|
|
18
17
|
import { JudgeStepController } from './JudgeStepController.js';
|
|
19
18
|
import { GateHelperDispatcher } from './GateHelperDispatcher.js';
|
|
20
19
|
import { GateStepController } from './GateStepController.js';
|
|
21
|
-
import { GateOutcomeRecorder } from '../observability/GateOutcomeRecorder.js';
|
|
22
20
|
import { buildGateMap, makeGateContext, makeJudgeContext, } from './extension-contexts.js';
|
|
23
21
|
import { PrReviewController } from './PrReviewController.js';
|
|
24
|
-
import { initialPrReviewState } from './prReview.logic.js';
|
|
25
22
|
import { PrReviewResolutionController } from './PrReviewResolutionController.js';
|
|
26
23
|
import { PollCompletionController } from './PollCompletionController.js';
|
|
27
24
|
import { PollRunningController } from './PollRunningController.js';
|
|
@@ -35,6 +32,8 @@ import { RalphController } from './RalphController.js';
|
|
|
35
32
|
import { VisualConfirmationController } from './VisualConfirmationController.js';
|
|
36
33
|
import {} from './step-handler-registry.js';
|
|
37
34
|
import { buildStepCompletionInterceptors as buildStepCompletionInterceptorsImpl, buildStepHandlerRegistry as buildStepHandlerRegistryImpl, buildStepResolverRegistry as buildStepResolverRegistryImpl, } from './dispatcher-registries.js';
|
|
35
|
+
import { AgentDispatchController } from './AgentDispatchController.js';
|
|
36
|
+
import { gateOutcomeRecording, } from './RunDispatcherDependencies.js';
|
|
38
37
|
/**
|
|
39
38
|
* The per-step dispatch + completion spine of the execution engine. It owns the four
|
|
40
39
|
* registries (step handlers, completion interceptors, post-completion / terminal resolvers,
|
|
@@ -51,30 +50,6 @@ import { buildStepCompletionInterceptors as buildStepCompletionInterceptorsImpl,
|
|
|
51
50
|
* engine's `finalizeMerge`). `ExecutionService.stepInstance` / `pollAgentJob` / `pollGate`
|
|
52
51
|
* delegate here; no behaviour changes in the move.
|
|
53
52
|
*/
|
|
54
|
-
/**
|
|
55
|
-
* The `recordGateOutcome` callback both gate-settling controllers take, or nothing when no
|
|
56
|
-
* projection is wired.
|
|
57
|
-
*
|
|
58
|
-
* Computed ONCE and spread into both: a gate reaches a terminal verdict down two paths, the
|
|
59
|
-
* precheck/exhaustion machine in {@link GateStepController} and the investigate-don't-fix
|
|
60
|
-
* completion in {@link PollRunningController}, and wiring only the first is why the
|
|
61
|
-
* `post-release-health` gate was absent from the statistics entirely. Two call sites, one
|
|
62
|
-
* recorder, so a third settling path has one obvious thing to reach for.
|
|
63
|
-
*
|
|
64
|
-
* A free function rather than an inline branch in the constructor: each controller takes ONE
|
|
65
|
-
* bound callback and must stay independent of the sink's collaborators, and the constructor is
|
|
66
|
-
* already at its statement budget (budgets are split triggers).
|
|
67
|
-
*/
|
|
68
|
-
function gateOutcomeRecording(deps, logger) {
|
|
69
|
-
if (!deps.gateOutcomeRepository)
|
|
70
|
-
return {};
|
|
71
|
-
const recorder = new GateOutcomeRecorder({
|
|
72
|
-
gateOutcomeRepository: deps.gateOutcomeRepository,
|
|
73
|
-
now: () => deps.clock.now(),
|
|
74
|
-
logger,
|
|
75
|
-
});
|
|
76
|
-
return { recordGateOutcome: (settled) => recorder.record(settled) };
|
|
77
|
-
}
|
|
78
53
|
export class RunDispatcher {
|
|
79
54
|
blockRepository;
|
|
80
55
|
executionRepository;
|
|
@@ -113,10 +88,11 @@ export class RunDispatcher {
|
|
|
113
88
|
notificationService;
|
|
114
89
|
blueprintReconciler;
|
|
115
90
|
initiativeService;
|
|
116
|
-
resolveRunRepoContext;
|
|
117
|
-
resolveProviderCapabilities;
|
|
118
91
|
resolveRiskPolicy;
|
|
119
|
-
modelIdIsMetered
|
|
92
|
+
// `resolveRunRepoContext` / `resolveProviderCapabilities` / `modelIdIsMetered` are NOT held
|
|
93
|
+
// here: their only readers moved to {@link AgentDispatchController}, which takes them straight
|
|
94
|
+
// off the deps object. A field kept "for symmetry" would be write-only state that no
|
|
95
|
+
// typecheck flags (TypeScript does not report an assigned-but-unread private member).
|
|
120
96
|
/**
|
|
121
97
|
* The deterministic `deployer` step family (the multi-frame provision fan-out, the async
|
|
122
98
|
* deploy-job poll, and the environment projection env-aware steps surface), extracted to
|
|
@@ -131,6 +107,13 @@ export class RunDispatcher {
|
|
|
131
107
|
pollCompletion;
|
|
132
108
|
/** The RUNNING half of the poll branch tree — the sibling of {@link pollCompletion}. */
|
|
133
109
|
pollRunning;
|
|
110
|
+
/**
|
|
111
|
+
* The DISPATCH side of a step — the other side of the park from the two poll controllers above:
|
|
112
|
+
* context build, registered pre-ops, the async start-and-park / inline call, and the facts only a
|
|
113
|
+
* dispatch can record (resolved model, job attribution, investigation diagnostics). The public
|
|
114
|
+
* methods below are thin pass-throughs the execution service and the step registries re-export.
|
|
115
|
+
*/
|
|
116
|
+
agentDispatch;
|
|
134
117
|
/** The one-shot engine steps (`tracker` / `bug-intake` / `initiative-committer`). */
|
|
135
118
|
oneShot;
|
|
136
119
|
/**
|
|
@@ -199,10 +182,7 @@ export class RunDispatcher {
|
|
|
199
182
|
this.notificationService = deps.notificationService;
|
|
200
183
|
this.blueprintReconciler = deps.blueprintReconciler;
|
|
201
184
|
this.initiativeService = deps.initiativeService;
|
|
202
|
-
this.resolveRunRepoContext = deps.resolveRunRepoContext;
|
|
203
|
-
this.resolveProviderCapabilities = deps.resolveProviderCapabilities;
|
|
204
185
|
this.resolveRiskPolicy = deps.resolveRiskPolicy;
|
|
205
|
-
this.modelIdIsMetered = deps.modelIdIsMetered;
|
|
206
186
|
this.deployer = new DeployerStepController({
|
|
207
187
|
blockRepository: deps.blockRepository,
|
|
208
188
|
contextBuilder: deps.contextBuilder,
|
|
@@ -234,6 +214,20 @@ export class RunDispatcher {
|
|
|
234
214
|
issueWriteback: deps.issueWriteback,
|
|
235
215
|
logger: deps.logger,
|
|
236
216
|
});
|
|
217
|
+
this.agentDispatch = new AgentDispatchController({
|
|
218
|
+
agentExecutor: deps.agentExecutor,
|
|
219
|
+
blockRepository: deps.blockRepository,
|
|
220
|
+
clock: deps.clock,
|
|
221
|
+
contextBuilder: deps.contextBuilder,
|
|
222
|
+
deployer: this.deployer,
|
|
223
|
+
repoOps: this.repoOps,
|
|
224
|
+
runStateMachine: deps.runStateMachine,
|
|
225
|
+
runInitiatorScope: this.runInitiatorScope,
|
|
226
|
+
resolveRunRepoContext: deps.resolveRunRepoContext,
|
|
227
|
+
resolveProviderCapabilities: deps.resolveProviderCapabilities,
|
|
228
|
+
modelIdIsMetered: deps.modelIdIsMetered,
|
|
229
|
+
recordStepResult: (ws, instance, step, isFinalStep, result) => this.recordStepResult(ws, instance, step, isFinalStep, result),
|
|
230
|
+
});
|
|
237
231
|
this.prReviewResolution = new PrReviewResolutionController({
|
|
238
232
|
runStateMachine: deps.runStateMachine,
|
|
239
233
|
resolveRunRepoContext: deps.resolveRunRepoContext,
|
|
@@ -371,267 +365,28 @@ export class RunDispatcher {
|
|
|
371
365
|
throw error;
|
|
372
366
|
}
|
|
373
367
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
* what the dispatch chain falls through to; all the deterministic / gate / inline-review
|
|
381
|
-
* kinds are claimed earlier by their own handlers (see {@link buildStepHandlerRegistry}).
|
|
382
|
-
*/
|
|
383
|
-
async handleAgentStep(ctx, dispatchKind, augmentContext) {
|
|
384
|
-
const { workspaceId, instance, step, block, isFinalStep, options } = ctx;
|
|
385
|
-
// Async (container) steps don't block: dispatch the job and park. The durable
|
|
386
|
-
// driver polls `pollAgentJob` between sleeps so the run can span far longer
|
|
387
|
-
// than a single durable step's timeout, while each step stays short. A set
|
|
388
|
-
// `jobId` means a prior (possibly replayed) dispatch already started the job,
|
|
389
|
-
// so we re-attach instead of starting a duplicate.
|
|
390
|
-
//
|
|
391
|
-
// `dispatchKind` overrides the dispatched agent kind WITHOUT changing `step.agentKind`
|
|
392
|
-
// — used by the fork-decision phase to dispatch the read-only `fork-proposer` explore
|
|
393
|
-
// job as a HELPER off the coder step (Phase A). The completion still records against the
|
|
394
|
-
// coder step, and the fork-proposal interceptor keys on `step.agentKind` + the fork state.
|
|
395
|
-
const context = await this.contextBuilder.buildContext(workspaceId, instance, step, isFinalStep, block, dispatchKind ? { agentKind: dispatchKind } : undefined);
|
|
396
|
-
// A caller re-dispatching this step under an overriding kind can fold extra context in
|
|
397
|
-
// (e.g. the PR-review `fix` resolution points the Fixer at the reviewed PR's head branch and
|
|
398
|
-
// hands it the selected findings). Runs before pre-ops / dispatch so the job body sees it.
|
|
399
|
-
augmentContext?.(context);
|
|
400
|
-
// A registered custom kind's PRE-ops run deterministic backend repo work before the
|
|
401
|
-
// agent dispatches (e.g. read a baseline `spec/` shard into the prompt). Gated on the
|
|
402
|
-
// step not having dispatched yet so a Workflows replay (jobId already set) doesn't
|
|
403
|
-
// re-run them; a no-op for built-in kinds and when GitHub isn't wired.
|
|
404
|
-
if (!step.jobId) {
|
|
405
|
-
await this.repoOps.runRegisteredPreOps(workspaceId, instance, block, step, context);
|
|
406
|
-
}
|
|
407
|
-
const executor = this.agentExecutor;
|
|
408
|
-
if (isAsyncAgentExecutor(executor) && executor.runsAsync(context)) {
|
|
409
|
-
if (!step.jobId) {
|
|
410
|
-
// The model is fixed the moment its ref resolves (block pin > workspace
|
|
411
|
-
// default > env routing) — long before the container is up — so name it on
|
|
412
|
-
// the very first "spinning up container" emit instead of waiting for the
|
|
413
|
-
// dispatch to return. startJob confirms the same value below.
|
|
414
|
-
const previewModel = await this.previewStepModel(context);
|
|
415
|
-
if (previewModel)
|
|
416
|
-
step.model = previewModel;
|
|
417
|
-
// Surface the explicit container lifecycle for the cold-boot window: dispatch
|
|
418
|
-
// blocks until the per-run container is up and has accepted the job, so emitting
|
|
419
|
-
// `starting` now lets the details show the boot (and then the live phase + the
|
|
420
|
-
// container id/url) instead of a blank "working" state.
|
|
421
|
-
step.container = { status: 'starting' };
|
|
422
|
-
// Seed the in-flight PR-review state so a `pr-reviewer` run surfaces a real `reviewing`
|
|
423
|
-
// phase in the deep-review window (the reviewed PR + the live slices-reviewed progress
|
|
424
|
-
// off the step's todo subtasks) instead of an empty panel until the findings land. Only
|
|
425
|
-
// on the reviewer's OWN first dispatch: a `fix`/`post` re-dispatch reuses this step under
|
|
426
|
-
// an overriding kind and already carries `prReview` (`fixing`/`posting`), which must not
|
|
427
|
-
// be reset back to `reviewing`.
|
|
428
|
-
if (step.agentKind === PR_REVIEWER_KIND && !step.prReview) {
|
|
429
|
-
const prUrl = block?.taskTypeFields?.prUrl?.trim() || null;
|
|
430
|
-
// Capture the PR head sha NOW (review start), so the `post` resolution can detect a
|
|
431
|
-
// branch update between here and posting and fold drifted findings into the summary.
|
|
432
|
-
const reviewedHeadSha = await this.resolveReviewedHeadSha(workspaceId, instance, block);
|
|
433
|
-
step.prReview = initialPrReviewState(prUrl, step.model ?? null, reviewedHeadSha);
|
|
434
|
-
}
|
|
435
|
-
// Surface the block's ephemeral environment (if any) alongside the cold-boot
|
|
436
|
-
// phase, so a run's details show the env spinning up next to the container.
|
|
437
|
-
await this.deployer.attachEnvironmentProjection(workspaceId, instance.blockId, step);
|
|
438
|
-
await this.runStateMachine.casPersist(workspaceId, instance);
|
|
439
|
-
await this.runStateMachine.emitInstance(workspaceId, instance);
|
|
440
|
-
let handle;
|
|
441
|
-
try {
|
|
442
|
-
handle = await executor.startJob(context);
|
|
443
|
-
}
|
|
444
|
-
catch (error) {
|
|
445
|
-
// Classify the throw (see {@link classifyDispatchFailure}). A genuine container
|
|
446
|
-
// accept failure (HTTP/network/capacity) is framed as `dispatch` ("container failed
|
|
447
|
-
// to start") with the EXACT provider response as detail; a dispatch-time eviction
|
|
448
|
-
// routes to `evicted`. But a job is BUILT before any container is contacted, so a
|
|
449
|
-
// precondition (e.g. `github_not_connected` — no connected repo) is a `preflight`
|
|
450
|
-
// rejection that surfaces its own actionable message + machine-readable reason
|
|
451
|
-
// instead of the misleading container framing.
|
|
452
|
-
step.container = { status: 'errored' };
|
|
453
|
-
await this.runStateMachine.casPersist(workspaceId, instance);
|
|
454
|
-
await this.runStateMachine.emitInstance(workspaceId, instance);
|
|
455
|
-
// Hand the classifier the step's run history so a container lost AFTER work began (a
|
|
456
|
-
// failed eviction-recovery re-dispatch, `evictionRecoveries > 0`) is reported as an
|
|
457
|
-
// unrecoverable eviction — with elapsed minutes + any partial slice count — rather than
|
|
458
|
-
// the misleading "container failed to start". See ADR 0026 D1.
|
|
459
|
-
return {
|
|
460
|
-
kind: 'job_failed',
|
|
461
|
-
...classifyDispatchFailure(error, {
|
|
462
|
-
evictionRecoveries: step.evictionRecoveries,
|
|
463
|
-
transientEvictionRecoveries: step.transientEvictionRecoveries,
|
|
464
|
-
startedAt: step.startedAt,
|
|
465
|
-
sliceCount: step.prReview?.slices?.length,
|
|
466
|
-
}),
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
step.jobId = handle.jobId;
|
|
470
|
-
// Record the model at dispatch — the poll site can't resolve it later.
|
|
471
|
-
recordDispatchAttribution(step, handle, context.agentKind);
|
|
472
|
-
// Surface web-search availability + provider on the step (run details), resolved
|
|
473
|
-
// backend-side at dispatch. A static per-run fact, not gated by prompt telemetry.
|
|
474
|
-
if (handle.search)
|
|
475
|
-
step.search = handle.search;
|
|
476
|
-
// Stamp after-the-fact investigation diagnostics for this dispatch: the step's
|
|
477
|
-
// agent kind, resolved model, and repo — the facts a failure post-mortem needs but
|
|
478
|
-
// that are otherwise spread across DB joins / the harness transcript. The execution
|
|
479
|
-
// backend (native vs. container) is unknown until the transport reports it on the
|
|
480
|
-
// first poll, so `pollAgentJob` fills it in then.
|
|
481
|
-
this.recordDispatchDiagnostics(instance, context, handle);
|
|
482
|
-
// The dispatch returned, so the container is up and the job is accepted; the
|
|
483
|
-
// live phase + the container id/url arrive on the first poll.
|
|
484
|
-
step.container = { status: 'up' };
|
|
485
|
-
await this.runStateMachine.casPersist(workspaceId, instance);
|
|
486
|
-
await this.runStateMachine.emitInstance(workspaceId, instance);
|
|
487
|
-
}
|
|
488
|
-
return { kind: 'awaiting_job', jobId: step.jobId, stepIndex: instance.currentStep };
|
|
489
|
-
}
|
|
490
|
-
// Inline path: the model is resolved before the (blocking) LLM call, so surface
|
|
491
|
-
// it now — the board names the model while the step is querying instead of only
|
|
492
|
-
// once the result lands. recordStepResult re-asserts it from the result.
|
|
493
|
-
const previewModel = await this.previewStepModel(context);
|
|
494
|
-
if (previewModel && previewModel !== step.model) {
|
|
495
|
-
step.model = previewModel;
|
|
496
|
-
await this.runStateMachine.casPersist(workspaceId, instance);
|
|
497
|
-
await this.runStateMachine.emitInstance(workspaceId, instance);
|
|
498
|
-
}
|
|
499
|
-
const result = await this.runAgent(context, options);
|
|
500
|
-
return this.recordStepResult(workspaceId, instance, step, isFinalStep, result);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Stamp the run's investigation diagnostics from a container dispatch (the `lastDispatch`
|
|
504
|
-
* block + the control-plane host). Mutates `instance` in place; the caller upserts. Reflects
|
|
505
|
-
* the MOST RECENT dispatch — a run's failure is almost always in its latest step, and keeping
|
|
506
|
-
* one block (not a per-step history) keeps the record small. `executionBackend` is left for the
|
|
507
|
-
* first poll to fill (the transport reports it). Never carries a token/secret.
|
|
508
|
-
*/
|
|
509
|
-
recordDispatchDiagnostics(instance, context, handle) {
|
|
510
|
-
// Orchestration is runtime-neutral (no @types/node), so read `process.platform` off globalThis
|
|
511
|
-
// with a guard rather than the bare global — undefined on a runtime that doesn't expose it
|
|
512
|
-
// (e.g. workerd), which just omits the host block. Best-effort investigation context.
|
|
513
|
-
const platform = globalThis.process?.platform;
|
|
514
|
-
instance.diagnostics = {
|
|
515
|
-
...instance.diagnostics,
|
|
516
|
-
lastDispatch: {
|
|
517
|
-
stepIndex: instance.currentStep,
|
|
518
|
-
agentKind: context.agentKind,
|
|
519
|
-
...(handle.model ? { model: handle.model } : {}),
|
|
520
|
-
...(handle.repo ? { repo: handle.repo } : {}),
|
|
521
|
-
at: this.clock.now(),
|
|
522
|
-
},
|
|
523
|
-
...(platform ? { host: { platform } } : {}),
|
|
524
|
-
};
|
|
368
|
+
// ---- Dispatch-side pass-throughs ----------------------------------------
|
|
369
|
+
// The dispatch half of a step lives on {@link AgentDispatchController}; these thin delegations
|
|
370
|
+
// keep the dispatcher the single surface `ExecutionService` and the step registries re-export.
|
|
371
|
+
/** @see AgentDispatchController.handleAgentStep */
|
|
372
|
+
handleAgentStep(ctx, dispatchKind, augmentContext) {
|
|
373
|
+
return this.agentDispatch.handleAgentStep(ctx, dispatchKind, augmentContext);
|
|
525
374
|
}
|
|
526
|
-
/**
|
|
527
|
-
* Fill in `diagnostics.lastDispatch.executionBackend` from the transport-reported backend on
|
|
528
|
-
* the first poll that carries it (native host process vs. sandboxed container — the datum that
|
|
529
|
-
* is otherwise indistinguishable after the fact). Idempotent: a no-op once set, or when the
|
|
530
|
-
* update carries no backend / the dispatch block is missing. Returns whether it changed
|
|
531
|
-
* anything (so the caller can skip a redundant upsert).
|
|
532
|
-
*/
|
|
375
|
+
/** @see AgentDispatchController.recordBackendDiagnostics */
|
|
533
376
|
recordBackendDiagnostics(instance, backend) {
|
|
534
|
-
|
|
535
|
-
if (!backend || !dispatch || dispatch.executionBackend === backend)
|
|
536
|
-
return false;
|
|
537
|
-
instance.diagnostics = {
|
|
538
|
-
...instance.diagnostics,
|
|
539
|
-
lastDispatch: { ...dispatch, executionBackend: backend },
|
|
540
|
-
};
|
|
541
|
-
return true;
|
|
377
|
+
return this.agentDispatch.recordBackendDiagnostics(instance, backend);
|
|
542
378
|
}
|
|
543
|
-
/**
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
* once the result or job handle lands. Best-effort: the executor may not implement
|
|
547
|
-
* a preview, and a resolution failure (e.g. an unwired container kind that fails at
|
|
548
|
-
* dispatch anyway) must never break the run — both yield undefined.
|
|
549
|
-
*/
|
|
550
|
-
async previewStepModel(context) {
|
|
551
|
-
if (!this.agentExecutor.resolveModel)
|
|
552
|
-
return undefined;
|
|
553
|
-
try {
|
|
554
|
-
return await this.agentExecutor.resolveModel(context);
|
|
555
|
-
}
|
|
556
|
-
catch {
|
|
557
|
-
return undefined;
|
|
558
|
-
}
|
|
379
|
+
/** @see AgentDispatchController.previewStepModel */
|
|
380
|
+
previewStepModel(context) {
|
|
381
|
+
return this.agentDispatch.previewStepModel(context);
|
|
559
382
|
}
|
|
560
|
-
/**
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
* - a flat-rate SUBSCRIPTION (quota) model — Claude Code / Codex on a pooled token;
|
|
564
|
-
* resolved through the executor (the authority on "subscriptions always win").
|
|
565
|
-
* - a LOCAL-runner model (Ollama / LM Studio / …) — keyless, runs on the user's own
|
|
566
|
-
* endpoint, so it costs the deployment nothing; detected off the resolved model id.
|
|
567
|
-
* This is what makes a `0` budget mean "no PAID spend" without bricking a workspace that
|
|
568
|
-
* deliberately runs only local models or subscriptions (see the spend-budget docs).
|
|
569
|
-
*
|
|
570
|
-
* Once the executor resolves the step's concrete model id, the metered/non-metered
|
|
571
|
-
* decision is delegated to the SAME {@link modelIdIsMetered} predicate the up-front
|
|
572
|
-
* {@link assertBudgetAllowsPipeline} gate uses, so the two gates can't classify a model
|
|
573
|
-
* differently (a divergence would let a run pass the start gate then immediately pause,
|
|
574
|
-
* or vice versa). The executor's `isQuotaBased` is still consulted first as the
|
|
575
|
-
* authoritative subscription-routing signal; the shared predicate covers local-runner +
|
|
576
|
-
* subscription-by-capability + Cloudflare classification identically to the start gate.
|
|
577
|
-
* Falls back to a bare local-id check when no capability resolver is wired.
|
|
578
|
-
*
|
|
579
|
-
* Best-effort and side-effect-free: an executor without the capability, a missing block,
|
|
580
|
-
* or any resolution error all report false (treated as budget-metered, the prior
|
|
581
|
-
* behaviour). Only consulted on the over-budget path, so it never touches the happy path.
|
|
582
|
-
*/
|
|
583
|
-
async currentStepIsNonMetered(workspaceId, instance, step) {
|
|
584
|
-
try {
|
|
585
|
-
const block = await this.blockRepository.get(workspaceId, instance.blockId);
|
|
586
|
-
if (!block)
|
|
587
|
-
return false;
|
|
588
|
-
const isFinalStep = instance.currentStep === instance.steps.length - 1;
|
|
589
|
-
const context = await this.contextBuilder.buildContext(workspaceId, instance, step, isFinalStep, block);
|
|
590
|
-
if (this.agentExecutor.isQuotaBased && (await this.agentExecutor.isQuotaBased(context))) {
|
|
591
|
-
return true;
|
|
592
|
-
}
|
|
593
|
-
if (this.agentExecutor.resolveModel) {
|
|
594
|
-
const modelId = await this.agentExecutor.resolveModel(context);
|
|
595
|
-
// Classify the resolved id through the shared predicate (same as the start gate)
|
|
596
|
-
// when capabilities are wired; else fall back to the bare local-runner check.
|
|
597
|
-
if (this.resolveProviderCapabilities) {
|
|
598
|
-
const caps = await this.resolveProviderCapabilities(workspaceId, instance.initiatedBy, block.modelPresetId);
|
|
599
|
-
if (!this.modelIdIsMetered(modelId, caps))
|
|
600
|
-
return true;
|
|
601
|
-
}
|
|
602
|
-
else if (parseLocalModelId(modelId)) {
|
|
603
|
-
return true;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
return false;
|
|
607
|
-
}
|
|
608
|
-
catch {
|
|
609
|
-
return false;
|
|
610
|
-
}
|
|
383
|
+
/** @see AgentDispatchController.currentStepIsNonMetered */
|
|
384
|
+
currentStepIsNonMetered(workspaceId, instance, step) {
|
|
385
|
+
return this.agentDispatch.currentStepIsNonMetered(workspaceId, instance, step);
|
|
611
386
|
}
|
|
612
|
-
/**
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
* every finding into the summary when it moved (the frozen line numbers may have drifted). Best
|
|
616
|
-
* effort: null on any failure, no PR number, or a client without the `pullRequestHeadSha`
|
|
617
|
-
* capability — the drift check then simply doesn't run (posting falls back to per-line filtering).
|
|
618
|
-
*/
|
|
619
|
-
async resolveReviewedHeadSha(workspaceId, instance, block) {
|
|
620
|
-
if (!block)
|
|
621
|
-
return null;
|
|
622
|
-
const prNumber = resolvePrNumber(block.taskTypeFields ?? undefined);
|
|
623
|
-
if (prNumber == null)
|
|
624
|
-
return null;
|
|
625
|
-
try {
|
|
626
|
-
const runRepo = await this.resolveRunRepoContext?.(workspaceId, block.id);
|
|
627
|
-
const headSha = runRepo?.repo.pullRequestHeadSha;
|
|
628
|
-
if (!headSha)
|
|
629
|
-
return null;
|
|
630
|
-
return await this.runInitiatorScope({ workspaceId, initiatedBy: instance.initiatedBy }, () => headSha(prNumber));
|
|
631
|
-
}
|
|
632
|
-
catch {
|
|
633
|
-
return null;
|
|
634
|
-
}
|
|
387
|
+
/** @see AgentDispatchController.runAgent */
|
|
388
|
+
runAgent(context, options = {}) {
|
|
389
|
+
return this.agentDispatch.runAgent(context, options);
|
|
635
390
|
}
|
|
636
391
|
/**
|
|
637
392
|
* Poll the asynchronous job a parked step dispatched. Returns `awaiting_job`
|
|
@@ -1376,27 +1131,6 @@ export class RunDispatcher {
|
|
|
1376
1131
|
dismissFollowUp(workspaceId, executionId, itemId) {
|
|
1377
1132
|
return this.followUpGate.dismissFollowUp(workspaceId, executionId, itemId);
|
|
1378
1133
|
}
|
|
1379
|
-
/**
|
|
1380
|
-
* Invoke the agent for an already-built context. Failures are swallowed into the
|
|
1381
|
-
* step output so a run never wedges — unless `rethrowAgentErrors` is set (the
|
|
1382
|
-
* durable path), in which case the error propagates so the driver's per-step
|
|
1383
|
-
* retry can take over.
|
|
1384
|
-
*/
|
|
1385
|
-
async runAgent(context, options = {}) {
|
|
1386
|
-
try {
|
|
1387
|
-
return await this.agentExecutor.run(context);
|
|
1388
|
-
}
|
|
1389
|
-
catch (error) {
|
|
1390
|
-
// The durable driver wants real failures to surface so its per-step retry
|
|
1391
|
-
// can kick in (and the error gets persisted after retries are exhausted).
|
|
1392
|
-
if (options.rethrowAgentErrors)
|
|
1393
|
-
throw error;
|
|
1394
|
-
// Otherwise a failed agent must not wedge the run; record and complete.
|
|
1395
|
-
return {
|
|
1396
|
-
output: `Agent error: ${getErrorMessage(error)}`,
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
1134
|
/**
|
|
1401
1135
|
* Strictly parse a Blueprinter step's tree and reconcile it onto the board. The
|
|
1402
1136
|
* blueprint maps the whole repository, so it is reconciled onto the run block's
|