@cat-factory/orchestration 0.106.8 → 0.107.1
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.d.ts +18 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +19 -0
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/environments/EnvironmentTestService.d.ts +126 -0
- package/dist/modules/environments/EnvironmentTestService.d.ts.map +1 -0
- package/dist/modules/environments/EnvironmentTestService.js +405 -0
- package/dist/modules/environments/EnvironmentTestService.js.map +1 -0
- package/dist/modules/execution/RunDispatcher.d.ts.map +1 -1
- package/dist/modules/execution/RunDispatcher.js +3 -3
- package/dist/modules/execution/RunDispatcher.js.map +1 -1
- package/dist/modules/execution/job.logic.d.ts +3 -13
- package/dist/modules/execution/job.logic.d.ts.map +1 -1
- package/dist/modules/execution/job.logic.js +3 -27
- package/dist/modules/execution/job.logic.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { assertFound, ConflictError, getErrorMessage, NotFoundError, requireWorkspace, } from '@cat-factory/kernel';
|
|
2
|
+
function toRun(record) {
|
|
3
|
+
return {
|
|
4
|
+
id: record.id,
|
|
5
|
+
workspaceId: record.workspaceId,
|
|
6
|
+
blockId: record.blockId,
|
|
7
|
+
status: record.status,
|
|
8
|
+
stage: record.stage,
|
|
9
|
+
branch: record.branch,
|
|
10
|
+
envUrl: record.envUrl,
|
|
11
|
+
error: record.error,
|
|
12
|
+
failedStage: record.failedStage,
|
|
13
|
+
createdAt: record.createdAt,
|
|
14
|
+
updatedAt: record.updatedAt,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// EnvironmentTestService — the ephemeral-environment SELF-TEST run.
|
|
19
|
+
//
|
|
20
|
+
// A developer-triggered diagnostic that exercises a service frame's configured
|
|
21
|
+
// provisioning end to end against a THROWAWAY branch and always cleans up:
|
|
22
|
+
// creating_branch → provisioning → tearing_down → deleting_branch → done
|
|
23
|
+
// (or `failed` with the stage it failed at). It touches no board block and
|
|
24
|
+
// leaves no branch/env behind. Modelled like a bootstrap run: `startTest`
|
|
25
|
+
// does the fast up-front work + dispatch and hands off to the durable driver;
|
|
26
|
+
// `pollEnvTest` advances the state machine idempotently so replays are safe.
|
|
27
|
+
//
|
|
28
|
+
// Repo/registry isolation (see EnvironmentProvisioningService): provisioning
|
|
29
|
+
// resolves the repo from `frameId ?? blockId`, and `recordProvisioned`
|
|
30
|
+
// supersedes any prior env for the `(blockId, frameId)` pair. So the run passes
|
|
31
|
+
// the REAL frame block as `frameId` (correct repo + preflight + clone) and a
|
|
32
|
+
// SYNTHETIC per-run `blockId` (`env-test:<runId>`), which no real deployer env
|
|
33
|
+
// uses — so the test never clobbers a live environment and its own namespace is
|
|
34
|
+
// unique. Teardown always targets the specific env id the run provisioned.
|
|
35
|
+
//
|
|
36
|
+
// The always-cleans-up contract is enforced by `fail()`: EVERY failure path —
|
|
37
|
+
// a pre-dispatch throw, a failed deploy view, a user stop mid-provision, a
|
|
38
|
+
// driver replay — funnels through it, and it (best-effort) releases the deploy
|
|
39
|
+
// runner, tears down the env, reclaims the synthetic registry row, and deletes
|
|
40
|
+
// the branch BEFORE writing the terminal state. Cleanup state is persisted the
|
|
41
|
+
// moment the side effect it tracks happens (the branch right after creation),
|
|
42
|
+
// never after a later step, so a crash between steps can't orphan it.
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
export class EnvironmentTestService {
|
|
45
|
+
deps;
|
|
46
|
+
constructor(deps) {
|
|
47
|
+
this.deps = deps;
|
|
48
|
+
}
|
|
49
|
+
/** The synthetic provisioning block id for a run (registry-key + namespace isolation). */
|
|
50
|
+
provisionBlockId(runId) {
|
|
51
|
+
return `env-test:${runId}`;
|
|
52
|
+
}
|
|
53
|
+
ref(runId) {
|
|
54
|
+
return { runId, jobId: runId };
|
|
55
|
+
}
|
|
56
|
+
async getRun(workspaceId, id) {
|
|
57
|
+
return toRun(assertFound(await this.deps.environmentTestRunRepository.get(workspaceId, id), 'Environment test run', id));
|
|
58
|
+
}
|
|
59
|
+
/** In-flight self-test runs (carried in the workspace snapshot for reconnect). */
|
|
60
|
+
async listRunning(workspaceId) {
|
|
61
|
+
const records = await this.deps.environmentTestRunRepository.listRunningByWorkspace(workspaceId);
|
|
62
|
+
return records.map(toRun);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Kick off a self-test against a service frame's provisioning config and return
|
|
66
|
+
* immediately with the `running` run. Pre-flights (frame provisionable, git provider
|
|
67
|
+
* connected) throw as 409s BEFORE any record exists; after the record is inserted,
|
|
68
|
+
* every failure runs best-effort cleanup and returns the run already `failed`.
|
|
69
|
+
*/
|
|
70
|
+
async startTest(workspaceId, blockId, initiatedBy) {
|
|
71
|
+
await requireWorkspace(this.deps.workspaceRepository, workspaceId);
|
|
72
|
+
const frame = assertFound(await this.deps.blockRepository.get(workspaceId, blockId), 'Block', blockId);
|
|
73
|
+
if (frame.level !== 'frame') {
|
|
74
|
+
throw new ConflictError('Environment tests run against a service frame, not a task or module.', 'env_test_not_a_frame');
|
|
75
|
+
}
|
|
76
|
+
const provisioning = frame.provisioning;
|
|
77
|
+
if (!provisioning || provisioning.type === 'infraless') {
|
|
78
|
+
throw new ConflictError('This service has no ephemeral-environment provisioning configured to test.', 'env_test_infraless');
|
|
79
|
+
}
|
|
80
|
+
const gate = await this.deps.provisioning.canProvision(workspaceId, provisioning, initiatedBy);
|
|
81
|
+
if (!gate.ok) {
|
|
82
|
+
throw new ConflictError('This service’s provisioning cannot run yet — configure its environment handler first.', 'env_test_not_provisionable', gate.reason ? { reason: gate.reason } : undefined);
|
|
83
|
+
}
|
|
84
|
+
// Resolve the git provider up front so a missing VCS is a real 409 (the SPA keys its
|
|
85
|
+
// hint off the reason code) rather than a run born `failed`.
|
|
86
|
+
const bound = await this.deps.resolveRunRepoContext(workspaceId, blockId);
|
|
87
|
+
if (!bound) {
|
|
88
|
+
throw new ConflictError('This workspace is not connected to a git provider, so no test branch can be created.', 'env_test_no_vcs');
|
|
89
|
+
}
|
|
90
|
+
const now = this.deps.clock.now();
|
|
91
|
+
const record = {
|
|
92
|
+
id: this.deps.idGenerator.next('envtest'),
|
|
93
|
+
workspaceId,
|
|
94
|
+
blockId,
|
|
95
|
+
status: 'running',
|
|
96
|
+
stage: 'creating_branch',
|
|
97
|
+
initiatedBy: initiatedBy ?? null,
|
|
98
|
+
// Pin the provisioning config on the record so the durable poll finalizes and
|
|
99
|
+
// cleans up against exactly what was dispatched (a mid-flight frame edit or
|
|
100
|
+
// deletion can't strand a live environment).
|
|
101
|
+
provisioning,
|
|
102
|
+
branch: null,
|
|
103
|
+
environmentId: null,
|
|
104
|
+
envUrl: null,
|
|
105
|
+
error: null,
|
|
106
|
+
failedStage: null,
|
|
107
|
+
createdAt: now,
|
|
108
|
+
updatedAt: now,
|
|
109
|
+
};
|
|
110
|
+
await this.deps.environmentTestRunRepository.insert(record);
|
|
111
|
+
await this.emit(record);
|
|
112
|
+
try {
|
|
113
|
+
// Create the throwaway branch off the frame repo's default head.
|
|
114
|
+
const baseSha = await bound.repo.headSha(bound.baseBranch);
|
|
115
|
+
if (!baseSha) {
|
|
116
|
+
throw new Error(`The repository's default branch '${bound.baseBranch}' has no head commit.`);
|
|
117
|
+
}
|
|
118
|
+
const branch = `cat-factory/env-test/${record.id}`;
|
|
119
|
+
await bound.repo.createBranch(branch, baseSha);
|
|
120
|
+
// Persist the branch BEFORE dispatching, so any later failure — including a
|
|
121
|
+
// dispatch throw — can reclaim it (`fail()` deletes `record.branch`). A rejected
|
|
122
|
+
// write means a stop already finalized the run — don't dispatch onto it.
|
|
123
|
+
record.branch = branch;
|
|
124
|
+
if (!(await this.guardedUpdate(record, { branch }))) {
|
|
125
|
+
throw new Error('The environment test was stopped while starting.');
|
|
126
|
+
}
|
|
127
|
+
// Dispatch provisioning for the temp branch under the synthetic block id.
|
|
128
|
+
const dispatch = await this.deps.provisioning.startProvision(this.provisionArgs(record, branch), this.ref(record.id));
|
|
129
|
+
const patch = dispatch.kind === 'completed'
|
|
130
|
+
? {
|
|
131
|
+
stage: 'provisioning',
|
|
132
|
+
environmentId: dispatch.handle.id,
|
|
133
|
+
envUrl: dispatch.handle.url,
|
|
134
|
+
}
|
|
135
|
+
: { stage: 'provisioning' };
|
|
136
|
+
if (!(await this.patch(record, patch))) {
|
|
137
|
+
// The run was stopped while we were dispatching; the stop already ran cleanup,
|
|
138
|
+
// but the branch/dispatch may postdate its snapshot — fail() re-runs cleanup
|
|
139
|
+
// idempotently and leaves the stop's terminal state in place.
|
|
140
|
+
throw new Error('The environment test was stopped while starting.');
|
|
141
|
+
}
|
|
142
|
+
// Hand off the long poll loop to the durable driver (tests poll directly).
|
|
143
|
+
await this.deps.runner?.startRun(workspaceId, record.id);
|
|
144
|
+
return toRun(record);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return this.fail(record, getErrorMessage(error));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Advance one running self-test by one stage (idempotent — a terminal run is returned
|
|
152
|
+
* as-is, so the driver's retries/replays are safe). Returns the poll's terminal-ness.
|
|
153
|
+
*/
|
|
154
|
+
async pollEnvTest(workspaceId, id) {
|
|
155
|
+
const record = assertFound(await this.deps.environmentTestRunRepository.get(workspaceId, id), 'Environment test run', id);
|
|
156
|
+
if (record.status === 'succeeded')
|
|
157
|
+
return { state: 'done' };
|
|
158
|
+
if (record.status === 'failed')
|
|
159
|
+
return { state: 'failed', error: record.error ?? undefined };
|
|
160
|
+
try {
|
|
161
|
+
switch (record.stage) {
|
|
162
|
+
case 'creating_branch':
|
|
163
|
+
// Only observable when the start request died between the insert and the
|
|
164
|
+
// dispatch — `startTest` moves the record to `provisioning` before handing
|
|
165
|
+
// off to the driver, so a (sweeper-driven) poll seeing this stage means the
|
|
166
|
+
// start never completed. Fail it (with cleanup) instead of spinning forever.
|
|
167
|
+
throw new Error('The environment test did not finish starting (the start request was interrupted).');
|
|
168
|
+
case 'provisioning':
|
|
169
|
+
return await this.advanceProvisioning(record);
|
|
170
|
+
case 'tearing_down':
|
|
171
|
+
return await this.advanceTeardown(record);
|
|
172
|
+
case 'deleting_branch':
|
|
173
|
+
return await this.advanceDeleteBranch(record);
|
|
174
|
+
default:
|
|
175
|
+
// `done` is terminal and short-circuited above; nothing else is pollable.
|
|
176
|
+
return { state: 'running' };
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
const run = await this.fail(record, getErrorMessage(error));
|
|
181
|
+
return { state: 'failed', error: run.error ?? undefined };
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
async advanceProvisioning(record) {
|
|
185
|
+
// The synchronous (raw-manifest / compose) path already recorded the env in
|
|
186
|
+
// `startTest`; nothing to poll, just move on to teardown.
|
|
187
|
+
if (record.environmentId) {
|
|
188
|
+
await this.patch(record, { stage: 'tearing_down' });
|
|
189
|
+
return { state: 'running' };
|
|
190
|
+
}
|
|
191
|
+
const view = await this.deps.provisioning.pollProvisionJob(record.workspaceId, this.ref(record.id));
|
|
192
|
+
if (view.state === 'running')
|
|
193
|
+
return { state: 'running' };
|
|
194
|
+
if (view.state === 'failed') {
|
|
195
|
+
// Reclaim the deploy runner (mirrors RunDispatcher.pollDeployerJob) and settle the
|
|
196
|
+
// failed view into the registry — the deploy may have partially applied infra, and
|
|
197
|
+
// the finalized record (externalId et al.) is what cleanup tears it down through.
|
|
198
|
+
await this.deps.provisioning.releaseProvisionJob(record.workspaceId, this.ref(record.id));
|
|
199
|
+
try {
|
|
200
|
+
const handle = await this.deps.provisioning.finalizeProvision(this.provisionArgs(record, record.branch), view);
|
|
201
|
+
record.environmentId = handle.id;
|
|
202
|
+
await this.guardedUpdate(record, { environmentId: handle.id });
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// Best-effort — fail() reclaims whatever registry row remains regardless.
|
|
206
|
+
}
|
|
207
|
+
throw new Error(view.error ?? 'Environment provisioning failed.');
|
|
208
|
+
}
|
|
209
|
+
// Done: reclaim the deploy runner, finalize the env record, move to teardown.
|
|
210
|
+
await this.deps.provisioning.releaseProvisionJob(record.workspaceId, this.ref(record.id));
|
|
211
|
+
const handle = await this.deps.provisioning.finalizeProvision(this.provisionArgs(record, record.branch), view);
|
|
212
|
+
if (handle.status === 'failed') {
|
|
213
|
+
// Persist the finalized env id first so fail()'s cleanup tears it down.
|
|
214
|
+
record.environmentId = handle.id;
|
|
215
|
+
await this.guardedUpdate(record, { environmentId: handle.id });
|
|
216
|
+
throw new Error(handle.lastError ?? 'Environment provisioning failed.');
|
|
217
|
+
}
|
|
218
|
+
await this.patch(record, {
|
|
219
|
+
stage: 'tearing_down',
|
|
220
|
+
environmentId: handle.id,
|
|
221
|
+
envUrl: handle.url,
|
|
222
|
+
});
|
|
223
|
+
return { state: 'running' };
|
|
224
|
+
}
|
|
225
|
+
async advanceTeardown(record) {
|
|
226
|
+
if (record.environmentId) {
|
|
227
|
+
try {
|
|
228
|
+
await this.deps.teardown.teardown(record.workspaceId, record.environmentId);
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
// A durable-driver replay can re-enter this stage after teardown already tombstoned the
|
|
232
|
+
// env, if the stage-advance write was lost to a crash between the two. Teardown then
|
|
233
|
+
// 404s on the now-missing env — that means it already succeeded, so treat it as done and
|
|
234
|
+
// move on. Only a GENUINE provider teardown failure (the env is still standing) should
|
|
235
|
+
// fail the self-test, so anything other than a not-found is re-thrown.
|
|
236
|
+
if (!(error instanceof NotFoundError))
|
|
237
|
+
throw error;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
await this.patch(record, { stage: 'deleting_branch' });
|
|
241
|
+
return { state: 'running' };
|
|
242
|
+
}
|
|
243
|
+
async advanceDeleteBranch(record) {
|
|
244
|
+
await this.deleteBranch(record);
|
|
245
|
+
const applied = await this.patch(record, { status: 'succeeded', stage: 'done' });
|
|
246
|
+
// A concurrent stop finalized the run first — its terminal state wins.
|
|
247
|
+
return applied ? { state: 'done' } : { state: 'failed' };
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Stop a running self-test: tear down the durable driver, run best-effort cleanup
|
|
251
|
+
* (release the in-flight deploy job, tear down the env, reclaim the registry row,
|
|
252
|
+
* delete the branch), then mark it `failed`. Idempotent — a terminal run is returned
|
|
253
|
+
* unchanged.
|
|
254
|
+
*/
|
|
255
|
+
async stop(workspaceId, id) {
|
|
256
|
+
await requireWorkspace(this.deps.workspaceRepository, workspaceId);
|
|
257
|
+
const record = assertFound(await this.deps.environmentTestRunRepository.get(workspaceId, id), 'Environment test run', id);
|
|
258
|
+
if (record.status !== 'running')
|
|
259
|
+
return toRun(record);
|
|
260
|
+
await this.deps.runner?.cancelRun(workspaceId, id);
|
|
261
|
+
return this.fail(record, 'Stopped by the user.');
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Finalize a wedged run — its durable driver ended (poll budget exhausted, instance
|
|
265
|
+
* terminal) without settling it. Runs the same best-effort cleanup as a stop, then
|
|
266
|
+
* marks the run `failed` with `reason`. Idempotent: a terminal run is returned as-is.
|
|
267
|
+
* Called by the drivers' budget-exhaustion paths and the cron sweeper.
|
|
268
|
+
*/
|
|
269
|
+
async expire(workspaceId, id, reason) {
|
|
270
|
+
const record = assertFound(await this.deps.environmentTestRunRepository.get(workspaceId, id), 'Environment test run', id);
|
|
271
|
+
if (record.status !== 'running')
|
|
272
|
+
return toRun(record);
|
|
273
|
+
return this.fail(record, reason);
|
|
274
|
+
}
|
|
275
|
+
// ---- helpers ------------------------------------------------------------
|
|
276
|
+
/** Build the provision args: real frame as `frameId`, synthetic `blockId` (see class docs). */
|
|
277
|
+
provisionArgs(record, branch) {
|
|
278
|
+
return {
|
|
279
|
+
workspaceId: record.workspaceId,
|
|
280
|
+
blockId: this.provisionBlockId(record.id),
|
|
281
|
+
frameId: record.blockId,
|
|
282
|
+
serviceProvisioning: record.provisioning,
|
|
283
|
+
initiatedBy: record.initiatedBy,
|
|
284
|
+
...(branch ? { context: { branch } } : {}),
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
/** Delete the run's temporary branch (best-effort — a missing branch is not an error). */
|
|
288
|
+
async deleteBranch(record) {
|
|
289
|
+
if (!record.branch)
|
|
290
|
+
return;
|
|
291
|
+
const bound = await this.deps.resolveRunRepoContext(record.workspaceId, record.blockId);
|
|
292
|
+
await bound?.repo.deleteBranch(record.branch);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Reclaim whatever registry row is still keyed under the run's synthetic block id —
|
|
296
|
+
* the `provisioning` placeholder from `startProvision`, or a failed finalize's record.
|
|
297
|
+
* The synthetic key is unique per run with no TTL, so nothing else ever supersedes or
|
|
298
|
+
* sweeps it: without this, every failed self-test would accrete a live row in the
|
|
299
|
+
* workspace registry forever. A row that reached real infra (`externalId`) goes
|
|
300
|
+
* through the full provider teardown; a pure placeholder is tombstoned directly, and
|
|
301
|
+
* a failing provider teardown falls back to the tombstone (the run's error already
|
|
302
|
+
* carries the diagnosis — a wedged registry helps nobody).
|
|
303
|
+
*/
|
|
304
|
+
async reclaimRegistryRow(record) {
|
|
305
|
+
const row = await this.deps.environmentRegistry.getByBlockAndFrame(record.workspaceId, this.provisionBlockId(record.id), record.blockId);
|
|
306
|
+
if (!row)
|
|
307
|
+
return;
|
|
308
|
+
if (row.externalId) {
|
|
309
|
+
try {
|
|
310
|
+
await this.deps.teardown.teardown(record.workspaceId, row.id);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
// fall through to the tombstone
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
await this.deps.environmentRegistry.softDelete(record.workspaceId, row.id, this.deps.clock.now());
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Record a failure, running best-effort cleanup FIRST so a failed diagnostic never
|
|
321
|
+
* leaks a branch, environment, registry row, or deploy runner. `failedStage` captures
|
|
322
|
+
* where it broke. Cleanup runs unconditionally (it is idempotent), but the terminal
|
|
323
|
+
* write is guarded: if a concurrent stop/driver already finalized the run, its state
|
|
324
|
+
* is returned unchanged.
|
|
325
|
+
*/
|
|
326
|
+
async fail(record, message) {
|
|
327
|
+
const failedStage = record.stage;
|
|
328
|
+
// Release any in-flight deploy job when provisioning never settled (a stop
|
|
329
|
+
// mid-provision, a dispatch that threw or crashed before the stage patch landed):
|
|
330
|
+
// best-effort abort of the deploy runner so a stopped test doesn't keep a container
|
|
331
|
+
// applying infra. Releasing when nothing was dispatched is a tolerated no-op.
|
|
332
|
+
if (!record.environmentId) {
|
|
333
|
+
try {
|
|
334
|
+
await this.deps.provisioning.releaseProvisionJob(record.workspaceId, this.ref(record.id));
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
// best-effort — an unreachable runner idles out on its own
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
// Tear the env down if one was provisioned (or finalized as failed).
|
|
341
|
+
if (record.environmentId) {
|
|
342
|
+
try {
|
|
343
|
+
await this.deps.teardown.teardown(record.workspaceId, record.environmentId);
|
|
344
|
+
}
|
|
345
|
+
catch {
|
|
346
|
+
// best-effort — the registry reclaim below tombstones the row regardless
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// Reclaim any registry row still keyed under the synthetic block id.
|
|
350
|
+
try {
|
|
351
|
+
await this.reclaimRegistryRow(record);
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
// best-effort
|
|
355
|
+
}
|
|
356
|
+
// Delete the branch if one was created.
|
|
357
|
+
try {
|
|
358
|
+
await this.deleteBranch(record);
|
|
359
|
+
}
|
|
360
|
+
catch {
|
|
361
|
+
// best-effort — a stale `cat-factory/env-test/*` branch is harmless
|
|
362
|
+
}
|
|
363
|
+
const patch = {
|
|
364
|
+
status: 'failed',
|
|
365
|
+
error: message,
|
|
366
|
+
failedStage,
|
|
367
|
+
updatedAt: this.deps.clock.now(),
|
|
368
|
+
};
|
|
369
|
+
const applied = await this.deps.environmentTestRunRepository.updateIfRunning(record.workspaceId, record.id, patch);
|
|
370
|
+
if (!applied) {
|
|
371
|
+
// A concurrent stop (or driver) finalized the run first; its terminal state is
|
|
372
|
+
// authoritative — the cleanup above was still worth re-running (idempotent).
|
|
373
|
+
const current = await this.deps.environmentTestRunRepository.get(record.workspaceId, record.id);
|
|
374
|
+
return toRun(current ?? { ...record, ...patch });
|
|
375
|
+
}
|
|
376
|
+
const failed = { ...record, ...patch };
|
|
377
|
+
await this.emit(failed);
|
|
378
|
+
return toRun(failed);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Persist a stage/status patch on a still-running run, stamp `updatedAt`, and push the
|
|
382
|
+
* transition. Returns false (writing and emitting nothing) when the run was
|
|
383
|
+
* concurrently finalized — the terminal state wins.
|
|
384
|
+
*/
|
|
385
|
+
async patch(record, patch) {
|
|
386
|
+
const full = { ...patch, updatedAt: this.deps.clock.now() };
|
|
387
|
+
const applied = await this.deps.environmentTestRunRepository.updateIfRunning(record.workspaceId, record.id, full);
|
|
388
|
+
if (!applied)
|
|
389
|
+
return false;
|
|
390
|
+
Object.assign(record, full);
|
|
391
|
+
await this.emit(record);
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
/** A guarded field write with an `updatedAt` stamp, without emitting an event. */
|
|
395
|
+
async guardedUpdate(record, patch) {
|
|
396
|
+
return this.deps.environmentTestRunRepository.updateIfRunning(record.workspaceId, record.id, {
|
|
397
|
+
...patch,
|
|
398
|
+
updatedAt: this.deps.clock.now(),
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
async emit(record) {
|
|
402
|
+
await this.deps.eventPublisher?.envTestChanged?.(record.workspaceId, toRun(record));
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
//# sourceMappingURL=EnvironmentTestService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvironmentTestService.js","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentTestService.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,EACb,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AA6D5B,SAAS,KAAK,CAAC,MAAgC;IAC7C,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAA;AACH,CAAC;AAED,8EAA8E;AAC9E,oEAAoE;AACpE,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,EAAE;AACF,6EAA6E;AAC7E,uEAAuE;AACvE,gFAAgF;AAChF,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAE9E,MAAM,OAAO,sBAAsB;IACJ,IAAI;IAAjC,YAA6B,IAAwC;oBAAxC,IAAI;IAAuC,CAAC;IAEzE,0FAA0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AAI,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;IACrF,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunDispatcher.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/RunDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,eAAe,EACf,cAAc,EAEd,KAAK,EACL,eAAe,EAEf,iBAAiB,EACjB,aAAa,EACb,KAAK,EAGL,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EAEnB,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EAEpB,cAAc,EAEd,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAGhB,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EAErB,iBAAiB,EAMjB,qBAAqB,EACrB,UAAU,EACX,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"RunDispatcher.d.ts","sourceRoot":"","sources":["../../../src/modules/execution/RunDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,eAAe,EACf,cAAc,EAEd,KAAK,EACL,eAAe,EAEf,iBAAiB,EACjB,aAAa,EACb,KAAK,EAGL,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EAEnB,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EAEpB,cAAc,EAEd,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAGhB,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EAErB,iBAAiB,EAMjB,qBAAqB,EACrB,UAAU,EACX,MAAM,qBAAqB,CAAA;AAwC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OA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ErrorMessage, getErrorReason, getProvider, INITIATIVE_ANALYST_AGENT_KIND, INITIATIVE_COMMITTER_AGENT_KIND, INITIATIVE_PLANNER_AGENT_KIND, isAsyncAgentExecutor, NotFoundError, parseLocalModelId, recordGateAttempt, registeredGateFactories, registeredStepResolverFactories, requireProvider, RunContendedError, sameSubtasks, } from '@cat-factory/kernel';
|
|
1
|
+
import { ConflictError, DEFAULT_RISK_POLICY, failureKindFromHarnessCause, getErrorMessage, getErrorReason, getProvider, INITIATIVE_ANALYST_AGENT_KIND, INITIATIVE_COMMITTER_AGENT_KIND, INITIATIVE_PLANNER_AGENT_KIND, isAsyncAgentExecutor, NotFoundError, parseLocalModelId, recordGateAttempt, registeredGateFactories, registeredStepResolverFactories, requireProvider, RunContendedError, sameSubtasks, } from '@cat-factory/kernel';
|
|
2
2
|
import { frontendOriginsForService, parseBlueprintService, parseSpecDoc, resolveAprioriWorkingBranch, } from '@cat-factory/contracts';
|
|
3
3
|
import { blueprintPostOp, commitInitiativeTracker, FORK_PROPOSER_KIND, hasTrait, isCompanionKind, isContainerBackedCompanion, INTERVIEW_GATE_TRAIT, moduleSlug, runRepoOps, specPostOp, TASK_ESTIMATOR_AGENT_KIND, } from '@cat-factory/agents';
|
|
4
4
|
import { DEPLOYER_AGENT_KIND, isDeployStep } from '@cat-factory/integrations';
|
|
@@ -11,7 +11,7 @@ import { renderReproDigest } from './reproTest.logic.js';
|
|
|
11
11
|
import { frameOf, validInvolvedServiceFrames } from './frame.logic.js';
|
|
12
12
|
import { ANALYSIS_AGENT_KIND, ARCHITECTURE_BRAINSTORM_AGENT_KIND, BLUEPRINTS_AGENT_KIND, BUG_INVESTIGATOR_AGENT_KIND, CLARITY_REVIEW_AGENT_KIND, CONFLICTS_AGENT_KIND, HUMAN_TEST_AGENT_KIND, isTesterKind, MERGER_AGENT_KIND, REPRO_TEST_AGENT_KIND, REQUIREMENTS_BRAINSTORM_AGENT_KIND, REQUIREMENTS_REVIEW_AGENT_KIND, SPEC_WRITER_AGENT_KIND, TESTER_AGENT_KIND, TRACKER_AGENT_KIND, UI_TESTER_AGENT_KIND, VISUAL_CONFIRM_AGENT_KIND, } from './ci.logic.js';
|
|
13
13
|
import { followUpsToSendBack, hasPendingFollowUps, renderFollowUpRework, shouldLoopCoder, } from './followUp.logic.js';
|
|
14
|
-
import {
|
|
14
|
+
import { classifyAgentFailure, classifyDispatchFailure, evictionKindOf, MAX_EVICTION_RECOVERIES, MAX_TRANSIENT_EVICTION_RECOVERIES, } from './job.logic.js';
|
|
15
15
|
import { AgentContextBuilder } from './AgentContextBuilder.js';
|
|
16
16
|
import { CompanionController } from './CompanionController.js';
|
|
17
17
|
import { HumanTestController } from './HumanTestController.js';
|
|
@@ -676,7 +676,7 @@ export class RunDispatcher {
|
|
|
676
676
|
return {
|
|
677
677
|
kind: 'job_failed',
|
|
678
678
|
error: update.error,
|
|
679
|
-
failureKind:
|
|
679
|
+
failureKind: failureKindFromHarnessCause(update.failureCause) ?? classifyAgentFailure(update.error),
|
|
680
680
|
detail: update.detail ?? update.error,
|
|
681
681
|
// Preserve the harness's FINE-GRAINED cause (git / api / no-usable-output / no-changes)
|
|
682
682
|
// that `failureKind` collapses to the coarse `agent` — recorded on the failure's
|