@cat-factory/orchestration 0.302.2 → 0.304.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.
Files changed (35) hide show
  1. package/dist/container/dependencies.d.ts +8 -1
  2. package/dist/container/dependencies.d.ts.map +1 -1
  3. package/dist/container/environmentsModule.factory.d.ts +2 -0
  4. package/dist/container/environmentsModule.factory.d.ts.map +1 -1
  5. package/dist/container/environmentsModule.factory.js +17 -0
  6. package/dist/container/environmentsModule.factory.js.map +1 -1
  7. package/dist/container/modules.d.ts +23 -3
  8. package/dist/container/modules.d.ts.map +1 -1
  9. package/dist/container/modules.js +61 -1
  10. package/dist/container/modules.js.map +1 -1
  11. package/dist/container/platform-modules.d.ts +6 -0
  12. package/dist/container/platform-modules.d.ts.map +1 -1
  13. package/dist/container/platform-modules.js +2 -2
  14. package/dist/container/platform-modules.js.map +1 -1
  15. package/dist/container.d.ts +1 -1
  16. package/dist/container.d.ts.map +1 -1
  17. package/dist/container.js +5 -37
  18. package/dist/container.js.map +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/modules/environments/EnvironmentTestService.d.ts +132 -2
  24. package/dist/modules/environments/EnvironmentTestService.d.ts.map +1 -1
  25. package/dist/modules/environments/EnvironmentTestService.js +305 -9
  26. package/dist/modules/environments/EnvironmentTestService.js.map +1 -1
  27. package/dist/modules/environments/environmentProbeStage.d.ts +105 -0
  28. package/dist/modules/environments/environmentProbeStage.d.ts.map +1 -0
  29. package/dist/modules/environments/environmentProbeStage.js +221 -0
  30. package/dist/modules/environments/environmentProbeStage.js.map +1 -0
  31. package/dist/modules/execution/AgentContextBuilder.d.ts +17 -0
  32. package/dist/modules/execution/AgentContextBuilder.d.ts.map +1 -1
  33. package/dist/modules/execution/AgentContextBuilder.js +34 -8
  34. package/dist/modules/execution/AgentContextBuilder.js.map +1 -1
  35. package/package.json +11 -11
@@ -1,30 +1,45 @@
1
- import { assertFound, ConflictError, describeTerminalEnvironment, getErrorMessage, NotFoundError, requireWorkspace, } from '@cat-factory/kernel';
1
+ import { assertFound, ConflictError, describeTerminalEnvironment, getErrorMessage, NotFoundError, noopLogger, requireWorkspace, runBestEffort, } from '@cat-factory/kernel';
2
+ import { environmentProbeAgentKind } from '@cat-factory/contracts';
2
3
  function toRun(record) {
3
4
  return {
4
5
  id: record.id,
5
6
  workspaceId: record.workspaceId,
6
7
  blockId: record.blockId,
8
+ mode: record.mode,
7
9
  status: record.status,
8
10
  stage: record.stage,
9
11
  branch: record.branch,
10
12
  envUrl: record.envUrl,
11
13
  error: record.error,
12
14
  failedStage: record.failedStage,
15
+ probe: record.probe,
16
+ probeProgress: record.probeProgress,
13
17
  createdAt: record.createdAt,
14
18
  updatedAt: record.updatedAt,
15
19
  };
16
20
  }
17
21
  // ---------------------------------------------------------------------------
18
- // EnvironmentTestService — the ephemeral-environment SELF-TEST run.
22
+ // EnvironmentTestService: the ephemeral-environment SELF-TEST run, in two modes.
19
23
  //
20
24
  // A developer-triggered diagnostic that exercises a service frame's configured
21
25
  // provisioning end to end against a THROWAWAY branch and always cleans up:
22
- // creating_branch → provisioning → tearing_down → deleting_branch → done
26
+ // creating_branch → provisioning → [probing] → tearing_down → deleting_branch → done
23
27
  // (or `failed` with the stage it failed at). It touches no board block and
24
28
  // leaves no branch/env behind. Modelled like a bootstrap run: `startTest`
25
29
  // does the fast up-front work + dispatch and hands off to the durable driver;
26
30
  // `pollEnvTest` advances the state machine idempotently so replays are safe.
27
31
  //
32
+ // `probing` is the AGENT DRY RUN (`mode: 'agent-probe'`): the environment is handed to a prober
33
+ // that tries to OPERATE the service and reports what it managed and what it could not work out
34
+ // (see `environmentProbeStage.ts`). It is ONE state machine rather than two services on purpose:
35
+ // the always-cleans-up contract, the stop⇄driver race guard and the sweeper are the hard parts of
36
+ // this flow, and a second implementation of them is a second set of ways to strand an
37
+ // environment. The extra mode costs one stage, one claim field and one report field.
38
+ //
39
+ // The run's `status` stays a statement about the LIFECYCLE in both modes: a dry run that reports
40
+ // `inoperable` SUCCEEDED, because the diagnostic did its job and cleaned up. What the agent found
41
+ // is the report's own `verdict`; see the contract's note on `status`.
42
+ //
28
43
  // Repo/registry isolation (see EnvironmentProvisioningService): provisioning
29
44
  // resolves the repo from `frameId ?? blockId`, and `recordProvisioned`
30
45
  // supersedes any prior env for the `(blockId, frameId)` pair. So the run passes
@@ -43,8 +58,14 @@ function toRun(record) {
43
58
  // ---------------------------------------------------------------------------
44
59
  export class EnvironmentTestService {
45
60
  deps;
61
+ /**
62
+ * The injected logger, normalised once so every site can log unconditionally (and so
63
+ * `runBestEffort`, which requires one, can be used at all). See CLAUDE.md's logging rules.
64
+ */
65
+ log;
46
66
  constructor(deps) {
47
67
  this.deps = deps;
68
+ this.log = deps.logger ?? noopLogger;
48
69
  }
49
70
  /** The synthetic provisioning block id for a run (registry-key + namespace isolation). */
50
71
  provisionBlockId(runId) {
@@ -61,14 +82,62 @@ export class EnvironmentTestService {
61
82
  const records = await this.deps.environmentTestRunRepository.listRunningByWorkspace(workspaceId);
62
83
  return records.map(toRun);
63
84
  }
85
+ /**
86
+ * The agent kind an `agent-probe` self-test of this block would run as, so the START edge can
87
+ * gate the run on the initiator's personal subscription BEFORE anything is created.
88
+ *
89
+ * Asked of the service rather than derived at the edge because the answer is the frame's TYPE
90
+ * (a frontend frame is driven by a browser prober, everything else by an HTTP one), and the
91
+ * dispatch resolves its model under this exact kind. A gate that guessed a different one would
92
+ * either demand a credential the run never leases or admit a run that then fails at the lease,
93
+ * after a branch, a provision and a teardown.
94
+ *
95
+ * `null` means there is NO dry run to gate, which covers every way that can be true: this
96
+ * deployment cannot drive one, the block is gone, or the block is not something a dry run can be
97
+ * run against at all (a task or module, or a service with no ephemeral provisioning). The last
98
+ * two are the ones worth stating: answering a prober kind for a block `startTest` will refuse
99
+ * outright is what asks a developer for their unlock password before telling them the run was
100
+ * never possible.
101
+ */
102
+ async probeAgentKind(workspaceId, blockId) {
103
+ if (!this.deps.probeStage)
104
+ return null;
105
+ const frame = await this.deps.blockRepository.get(workspaceId, blockId);
106
+ if (!frame || frame.level !== 'frame')
107
+ return null;
108
+ if (!frame.provisioning || frame.provisioning.type === 'infraless')
109
+ return null;
110
+ return environmentProbeAgentKind(this.deps.probeStage.surfaceFor(frame));
111
+ }
64
112
  /**
65
113
  * Kick off a self-test against a service frame's provisioning config and return
66
114
  * immediately with the `running` run. Pre-flights (frame provisionable, git provider
67
115
  * connected) throw as 409s BEFORE any record exists; after the record is inserted,
68
116
  * every failure runs best-effort cleanup and returns the run already `failed`.
117
+ *
118
+ * `resolveActivation` produces the closure that mints the initiator's individual-usage credential
119
+ * for THIS run. Passed in rather than resolved here for the reason the pipeline path passes its
120
+ * equivalent: only the HTTP edge holds the unlock password, and only it can answer a caller who
121
+ * has not supplied one.
122
+ *
123
+ * It is a CLOSURE returning a closure, so that resolving it (which is what raises the
124
+ * `428 credential_required` a client re-prompts on) happens AFTER every structural refusal
125
+ * below. Resolved eagerly at the edge instead, a dry run that could never have started (a
126
+ * self-test already running for the frame, a model the deployment cannot dispatch) asked the
127
+ * developer for their password first and only then answered the 409 that needed no credential to
128
+ * establish. Returning `undefined` means the run needs no personal credential: a `provision`
129
+ * self-test always, and an `agent-probe` whose model is not an individual-usage one.
69
130
  */
70
- async startTest(workspaceId, blockId, initiatedBy) {
131
+ async startTest(workspaceId, blockId, initiatedBy, mode = 'provision', resolveActivation) {
71
132
  await requireWorkspace(this.deps.workspaceRepository, workspaceId);
133
+ // Refuse an agent dry run this deployment cannot drive BEFORE anything is provisioned. A run
134
+ // admitted here would create a branch, stand an environment up and then park at a stage with
135
+ // nothing to advance it, until the sweeper tore the whole thing down with a timeout for a
136
+ // reason (a wiring gap) that was knowable before a single side effect.
137
+ if (mode === 'agent-probe' && !this.deps.probeStage) {
138
+ throw new ConflictError('Agent dry runs are not available on this deployment: they need a container runner and a ' +
139
+ 'connected repository.', 'env_test_probe_unavailable');
140
+ }
72
141
  const frame = assertFound(await this.deps.blockRepository.get(workspaceId, blockId), 'Block', blockId);
73
142
  if (frame.level !== 'frame') {
74
143
  throw new ConflictError('Environment tests run against a service frame, not a task or module.', 'env_test_not_a_frame');
@@ -77,6 +146,17 @@ export class EnvironmentTestService {
77
146
  if (!provisioning || provisioning.type === 'infraless') {
78
147
  throw new ConflictError('This service has no ephemeral-environment provisioning configured to test.', 'env_test_infraless');
79
148
  }
149
+ // ONE self-test at a time per frame, whichever mode. Each run provisions its own environment
150
+ // under a synthetic per-run key that nothing supersedes or sweeps, so two in flight is two live
151
+ // environments for one service: billed twice, and racing each other to create on any provider
152
+ // whose namespace is derived per service rather than per branch. Enforced here rather than in
153
+ // the SPA's button state, which is per mode and per tab and so cannot see the other run.
154
+ const live = (await this.deps.environmentTestRunRepository.listRunningByWorkspace(workspaceId)).find((row) => row.blockId === blockId);
155
+ if (live) {
156
+ throw new ConflictError('A self-test is already running for this service. Wait for it to finish, or stop it first.', 'env_test_already_running', { runId: live.id, runMode: live.mode });
157
+ }
158
+ if (mode === 'agent-probe')
159
+ await this.assertProbeAdmissible(workspaceId, frame, initiatedBy);
80
160
  const gate = await this.deps.provisioning.canProvision(workspaceId, provisioning, initiatedBy);
81
161
  if (!gate.ok) {
82
162
  throw new ConflictError('This service’s provisioning cannot run yet — configure its environment handler first.', 'env_test_not_provisionable',
@@ -102,11 +182,24 @@ export class EnvironmentTestService {
102
182
  if (!bound) {
103
183
  throw new ConflictError('This workspace is not connected to a git provider, so no test branch can be created.', 'env_test_no_vcs');
104
184
  }
185
+ // The last gate, and deliberately last: resolving it is what asks the caller for a password,
186
+ // so every refusal that needs no credential has already been answered by here.
187
+ const activate = await resolveActivation?.();
105
188
  const now = this.deps.clock.now();
189
+ const id = this.deps.idGenerator.next('envtest');
190
+ // Mint the activation BEFORE the row exists, and OUTSIDE the try below, exactly as
191
+ // `RunLifecycleController.start` does: a credential that cannot be unlocked has to reach the
192
+ // caller as the refusal it is. Run after the insert instead, `activate` throwing
193
+ // `CredentialRequiredError` was caught by the cleanup path and answered 201 with a `failed`
194
+ // run: a RESOLVED action to the SPA, so the 428 that reopens the password modal never fired,
195
+ // the stale cached password was never cleared, and every retry silently burned another run.
196
+ // There is nothing to clean up here yet: no branch, no environment, no row.
197
+ await activate?.(id);
106
198
  const record = {
107
- id: this.deps.idGenerator.next('envtest'),
199
+ id,
108
200
  workspaceId,
109
201
  blockId,
202
+ mode,
110
203
  status: 'running',
111
204
  stage: 'creating_branch',
112
205
  initiatedBy: initiatedBy ?? null,
@@ -119,13 +212,22 @@ export class EnvironmentTestService {
119
212
  envUrl: null,
120
213
  error: null,
121
214
  failedStage: null,
215
+ probeSurface: null,
216
+ probeDispatchedAt: null,
217
+ probeModel: null,
218
+ probeSubscriptionTokenId: null,
219
+ probeSubscriptionVendor: null,
220
+ probeProgress: null,
221
+ probe: null,
122
222
  createdAt: now,
123
223
  updatedAt: now,
124
224
  };
125
225
  await this.deps.environmentTestRunRepository.insert(record);
126
226
  await this.emit(record);
127
227
  try {
128
- // Create the throwaway branch off the frame repo's default head.
228
+ // Create the throwaway branch off the frame repo's default head. The activation minted above
229
+ // outlives a provision by hours (12h TTL), so the probe stage minutes later still finds it
230
+ // live.
129
231
  const baseSha = await bound.repo.headSha(bound.baseBranch);
130
232
  if (!baseSha) {
131
233
  throw new Error(`The repository's default branch '${bound.baseBranch}' has no head commit.`);
@@ -169,6 +271,69 @@ export class EnvironmentTestService {
169
271
  return this.fail(record, getErrorMessage(error), error);
170
272
  }
171
273
  }
274
+ /**
275
+ * The three gates an AGENT DRY RUN answers to beyond the provisioning self-test's, all asked
276
+ * BEFORE the first side effect, because each is knowable then and none is knowable cheaply
277
+ * afterwards. Every one of them, left to the dispatch, costs a throwaway branch, a full
278
+ * provision and (on the way back out) a teardown to report something already decided.
279
+ *
280
+ * A wired prober is not the same question as a runnable one, and there are two ways to be
281
+ * unrunnable. The IMAGE: each surface runs on its own executor image, so a deployment that binds
282
+ * the plain container class and not the browser one serves an `api` dry run and refuses a `ui`
283
+ * one deep inside `stage.dispatch`. The MODEL: the prober runs whatever this workspace's preset
284
+ * names for its kind, which may be a provider the LLM proxy cannot serve, or a subscription-only
285
+ * model whose credential nobody connected. Both are the facade's answers, asked through the
286
+ * stage; the refusals stay separate because the fixes are (an image to bind vs a preset to
287
+ * change), and one message covering both would name the wrong one every other time.
288
+ *
289
+ * And a workspace past its spend ceiling would pay for exactly the same sequence before the
290
+ * proxy refused the container's first completion.
291
+ */
292
+ async assertProbeAdmissible(workspaceId, frame, initiatedBy) {
293
+ const stage = this.deps.probeStage;
294
+ if (!stage)
295
+ return;
296
+ const surface = stage.surfaceFor(frame);
297
+ if (!(await stage.supports(workspaceId, surface))) {
298
+ throw new ConflictError(surface === 'ui'
299
+ ? 'A dry run for a frontend service runs in a browser container, and this deployment ' +
300
+ 'has no browser executor image wired. Dry runs of its backend services still run.'
301
+ : 'This deployment has no executor image wired for an agent dry run of this service.', 'env_test_probe_unavailable', { surface });
302
+ }
303
+ // The facade's own verdict, carried verbatim: it is produced by the code that would otherwise
304
+ // have thrown at dispatch, so admission and dispatch cannot name different causes for one
305
+ // misconfiguration. The `detail` rides its own key, never `reason`, which `ConflictError`
306
+ // reserves for the code the SPA keys its localized copy off.
307
+ const dispatchable = await stage.checkDispatchable({ workspaceId, blockId: frame.id, initiatedBy: initiatedBy ?? null }, surface);
308
+ if (!dispatchable.ok) {
309
+ throw new ConflictError(`An agent dry run cannot run on the model this service resolves to. ${dispatchable.detail}`, 'env_test_probe_model_unavailable', { surface, modelIssue: dispatchable.detail });
310
+ }
311
+ if (await this.overBudget(workspaceId, initiatedBy)) {
312
+ throw new ConflictError('This workspace has reached a spend budget, and an agent dry run is a billable model ' +
313
+ 'call. Raise the budget (or wait for the billing period to reset) and try again; the ' +
314
+ 'provisioning self-test beside it costs nothing and still runs.', 'env_test_over_budget');
315
+ }
316
+ }
317
+ /**
318
+ * Whether the workspace is over its model budget. Fails CLOSED, as the monorepo survey's probe
319
+ * does: a ledger nobody can read is not a licence to spend against it.
320
+ */
321
+ async overBudget(workspaceId, initiatedBy) {
322
+ const probe = this.deps.isOverBudget;
323
+ if (!probe)
324
+ return false;
325
+ try {
326
+ return await probe(workspaceId);
327
+ }
328
+ catch (error) {
329
+ this.log.warn('environment dry run: budget probe failed; refusing the run', {
330
+ workspaceId,
331
+ initiatedBy: initiatedBy ?? null,
332
+ err: getErrorMessage(error),
333
+ });
334
+ return true;
335
+ }
336
+ }
172
337
  /**
173
338
  * Advance one running self-test by one stage (idempotent — a terminal run is returned
174
339
  * as-is, so the driver's retries/replays are safe). Returns the poll's terminal-ness.
@@ -189,6 +354,8 @@ export class EnvironmentTestService {
189
354
  throw new Error('The environment test did not finish starting (the start request was interrupted).');
190
355
  case 'provisioning':
191
356
  return await this.advanceProvisioning(record);
357
+ case 'probing':
358
+ return await this.advanceProbing(record);
192
359
  case 'tearing_down':
193
360
  return await this.advanceTeardown(record);
194
361
  case 'deleting_branch':
@@ -217,7 +384,7 @@ export class EnvironmentTestService {
217
384
  const handle = await this.deps.provisioning.refreshStatus(record.workspaceId, record.environmentId);
218
385
  if (handle.status === 'ready') {
219
386
  await this.patch(record, {
220
- stage: 'tearing_down',
387
+ stage: this.stageAfterProvisioning(record),
221
388
  ...(handle.url ? { envUrl: handle.url } : {}),
222
389
  });
223
390
  return { state: 'running' };
@@ -264,12 +431,136 @@ export class EnvironmentTestService {
264
431
  throw new Error(handle.lastError ?? 'Environment provisioning failed.');
265
432
  }
266
433
  await this.patch(record, {
267
- stage: 'tearing_down',
434
+ stage: this.stageAfterProvisioning(record),
268
435
  environmentId: handle.id,
269
436
  envUrl: handle.url,
270
437
  });
271
438
  return { state: 'running' };
272
439
  }
440
+ /**
441
+ * Where a run goes once its environment is up: straight to teardown, or through the dry run
442
+ * first. One helper rather than the ternary twice, because `advanceProvisioning` has two exits
443
+ * (the synchronous provider's readiness poll and the deploy job's finalize) and a mode honoured
444
+ * at only one of them is a dry run that silently skips the probe for half the providers.
445
+ */
446
+ stageAfterProvisioning(record) {
447
+ return record.mode === 'agent-probe' ? 'probing' : 'tearing_down';
448
+ }
449
+ /**
450
+ * Advance the AGENT DRY RUN: claim and dispatch the prober, then poll it, then record what it
451
+ * reported and move on to teardown.
452
+ *
453
+ * Three writes in a fixed order, and each one is load-bearing:
454
+ *
455
+ * 1. the CLAIM (`probeSurface`), before the dispatch, so a replay cannot start a second agent
456
+ * against the same environment;
457
+ * 2. the DISPATCH;
458
+ * 3. the MARK (`probeDispatchedAt`), after it is accepted, so a replay that landed in between
459
+ * can tell a claim with no container behind it from a running job. Without the mark, such a
460
+ * replay polls a job that was never started and the backend's "no such job" comes back as an
461
+ * EVICTION: a lost isolate reported to the developer as a container failure. With it, the
462
+ * replay re-dispatches instead, which is safe because a dispatch is idempotent per job id.
463
+ *
464
+ * Every write goes through the same running-guard, which makes the stop ⇄ driver race
465
+ * first-writer-wins in both directions. The mark's guard does double duty: a stop that landed
466
+ * while the dispatch was in flight ran its reclaim against a container that did not exist yet, so
467
+ * a rejected mark means the container now starting has nobody left to reclaim it. That throws,
468
+ * and `fail()` (whose FIRST action is the reclaim) is what actually collects it.
469
+ *
470
+ * A probe that FAILS (an evicted container, a reply with no JSON) throws, so the run fails at
471
+ * this stage with the container's error and `fail()` reclaims the environment. A probe that
472
+ * REPORTS advances, whatever its verdict: an `inoperable` verdict is the diagnostic working, and
473
+ * the run still owes the developer its teardown.
474
+ */
475
+ async advanceProbing(record) {
476
+ const stage = this.deps.probeStage;
477
+ if (!stage) {
478
+ // Only reachable when a deployment lost the capability between the start and the poll (a
479
+ // redeploy mid-run). Nothing can advance the run, so fail it here rather than spin: the
480
+ // environment is up and every poll is costing the developer.
481
+ throw new Error('Agent dry runs are no longer configured on this deployment.');
482
+ }
483
+ const claimed = record.probeSurface;
484
+ if (!claimed || !record.probeDispatchedAt) {
485
+ // ONE frame read, shared by the surface and the prompt: see `resolveTarget`. The PINNED
486
+ // surface still wins on a re-dispatch, because the claim addresses a container.
487
+ const target = await stage.resolveTarget(record);
488
+ const surface = claimed ?? target.surface;
489
+ if (!claimed && !(await this.guardedUpdate(record, { probeSurface: surface }))) {
490
+ throw new Error('The environment test was stopped before the agent dry run started.');
491
+ }
492
+ record.probeSurface = surface;
493
+ const handle = await stage.dispatch(record, surface, target.frame);
494
+ const probeDispatchedAt = this.deps.clock.now();
495
+ // The MARK and the dispatch's ATTRIBUTION in one write, because they are one fact: what the
496
+ // dispatch resolved is only meaningful for a dispatch that happened, and every later poll
497
+ // rebuilds its handle from this row (see `EnvironmentProbeDispatch`). The model that ran and
498
+ // the pooled token that paid for it are what the poll cannot re-derive: one because the
499
+ // frame and preset it came from can change while the container works, the other because the
500
+ // lease happens once, here.
501
+ const attribution = {
502
+ probeModel: handle.dispatch?.model ?? null,
503
+ probeSubscriptionTokenId: handle.dispatch?.subscriptionTokenId ?? null,
504
+ probeSubscriptionVendor: handle.dispatch?.subscriptionVendor ?? null,
505
+ };
506
+ if (!(await this.guardedUpdate(record, { probeDispatchedAt, ...attribution }))) {
507
+ throw new Error('The environment test was stopped while the agent dry run was starting.');
508
+ }
509
+ record.probeDispatchedAt = probeDispatchedAt;
510
+ Object.assign(record, attribution);
511
+ return { state: 'running' };
512
+ }
513
+ const outcome = await stage.poll(record, claimed);
514
+ if (outcome.state === 'running') {
515
+ await this.writeProbeProgress(record, outcome.subtasks);
516
+ return { state: 'running' };
517
+ }
518
+ // The report is in hand, so the prober's container has nothing left to do: reclaim it before
519
+ // teardown rather than leaving it to idle out beside an environment that is about to vanish.
520
+ await this.releaseProbe(record);
521
+ // The live counts go with it: the report is the finer answer to the same question, and a stale
522
+ // "3 of 5" left beside a finished run reads as a probe still working.
523
+ await this.patch(record, {
524
+ stage: 'tearing_down',
525
+ probe: outcome.report,
526
+ probeProgress: null,
527
+ });
528
+ return { state: 'running' };
529
+ }
530
+ /**
531
+ * Persist the prober's live todo counts, and push them, when they MOVED.
532
+ *
533
+ * `probing` is the only stage of this run measured in minutes; every other one turns over in
534
+ * seconds. With nothing written the run row never changes, so no `envTestChanged` event fires
535
+ * for the whole probe and the SPA sits on "probing with an agent" for the entire container run,
536
+ * which is indistinguishable from a wedge. Compared on the COUNTS alone: the item labels move
537
+ * whenever the agent rewords a todo, and a write per poll is the cost this guard exists to
538
+ * avoid.
539
+ */
540
+ async writeProbeProgress(record, subtasks) {
541
+ if (!subtasks)
542
+ return;
543
+ const current = record.probeProgress;
544
+ if (current &&
545
+ current.completed === subtasks.completed &&
546
+ current.inProgress === subtasks.inProgress &&
547
+ current.total === subtasks.total) {
548
+ return;
549
+ }
550
+ await this.patch(record, { probeProgress: subtasks });
551
+ }
552
+ /**
553
+ * Reclaim the dry run's container, if one was ever claimed. Best-effort by contract (an
554
+ * unreachable runner idles out on its own), and it must never propagate: every caller is either
555
+ * settling a run or already failing one.
556
+ */
557
+ async releaseProbe(record) {
558
+ const stage = this.deps.probeStage;
559
+ const surface = record.probeSurface;
560
+ if (!stage || !surface)
561
+ return;
562
+ await runBestEffort(this.log, 'release environment dry-run container', () => stage.release(record, surface), { workspaceId: record.workspaceId, runId: record.id, surface });
563
+ }
273
564
  async advanceTeardown(record) {
274
565
  if (record.environmentId) {
275
566
  try {
@@ -377,13 +668,18 @@ export class EnvironmentTestService {
377
668
  // record + SPA aside). Carries the stage + message (which now includes any provider
378
669
  // field-level detail) and the stack when the cause is an `Error`, so an unexpected throw is
379
670
  // debuggable from the logs rather than just the terminal run row.
380
- this.deps.logger?.warn('environment self-test failed', {
671
+ this.log.warn('environment self-test failed', {
381
672
  workspaceId: record.workspaceId,
382
673
  runId: record.id,
383
674
  failedStage,
384
675
  err: message,
385
676
  ...(cause instanceof Error && cause.stack ? { stack: cause.stack } : {}),
386
677
  });
678
+ // Reclaim the dry run's container when one was claimed and never settled (a stop mid-probe, a
679
+ // dispatch that threw, a replay that failed the run). It is claimed before it is dispatched,
680
+ // so a claim with no container behind it is a tolerated no-op. The opposite ordering would
681
+ // leave a browser container running for its full lifetime beside a torn-down environment.
682
+ await this.releaseProbe(record);
387
683
  // Release any in-flight deploy job when provisioning never settled (a stop
388
684
  // mid-provision, a dispatch that threw or crashed before the stage patch landed):
389
685
  // best-effort abort of the deploy runner so a stopped test doesn't keep a container
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentTestService.js","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentTestService.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,WAAW,EACX,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,aAAa,EACb,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AAwF5B,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;AA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IACK,KAAK,CAAC,KAAK,CACjB,MAAgC,EAChC,KAA+F;QAE/F,MAAM,IAAI,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,CAAA;QAC3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,eAAe,CAC1E,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,EAAE,EACT,IAAI,CACL,CAAA;QACD,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAA;QAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC3B,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,kFAAkF;IAC1E,KAAK,CAAC,aAAa,CACzB,MAAgC,EAChC,KAAqF;QAErF,OAAO,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE;YAC3F,GAAG,KAAK;YACR,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;SACjC,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,MAAgC;QACjD,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;IACrF,CAAC;CACF"}
1
+ {"version":3,"file":"EnvironmentTestService.js","sourceRoot":"","sources":["../../../src/modules/environments/EnvironmentTestService.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,WAAW,EACX,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,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GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,eAAe,CAC1E,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,EAAE,EACT,IAAI,CACL,CAAA;QACD,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAA;QAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC3B,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,kFAAkF;IAC1E,KAAK,CAAC,aAAa,CACzB,MAAgC,EAChC,KAKC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE;YAC3F,GAAG,KAAK;YACR,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;SACjC,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,MAAgC;QACjD,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;IACrF,CAAC;CACF"}
@@ -0,0 +1,105 @@
1
+ import type { Block, BlockRepository, EnvironmentHandle, EnvironmentProbeAgent, EnvironmentProbeDispatchCheck, EnvironmentProbeHandle, EnvironmentProbeReport, EnvironmentProbeSurface, EnvironmentTestRunRecord, Logger, ResolveRunRepoContext, StepSubtasks } from '@cat-factory/kernel';
2
+ /** The environment reads the probe stage makes: the live handle, WITH its decrypted access. */
3
+ export interface EnvironmentProbeRegistry {
4
+ getHandleWithAccess(workspaceId: string, id: string): Promise<EnvironmentHandle | null>;
5
+ }
6
+ export interface EnvironmentProbeStageDependencies {
7
+ /** Dispatches, polls and reclaims the probe container (a facade implementation). */
8
+ agent: EnvironmentProbeAgent;
9
+ blockRepository: Pick<BlockRepository, 'get'>;
10
+ environments: EnvironmentProbeRegistry;
11
+ /** Resolves the frame's repo identity, so the prober gets a checkout of what is running. */
12
+ resolveRunRepoContext: ResolveRunRepoContext;
13
+ logger?: Logger;
14
+ }
15
+ /** What one poll of the probing stage settled on. */
16
+ export type EnvironmentProbeOutcome =
17
+ /**
18
+ * Still working. `subtasks` is the container's own live todo count when it reported one, which
19
+ * the caller persists: `probing` is the only stage of this run that lasts minutes, so it is the
20
+ * only one where writing nothing leaves the SPA unable to tell work from a wedge.
21
+ */
22
+ {
23
+ state: 'running';
24
+ subtasks?: StepSubtasks;
25
+ }
26
+ /** The agent reported; the report is already coerced, capped, scrubbed and platform-graded. */
27
+ | {
28
+ state: 'reported';
29
+ report: EnvironmentProbeReport;
30
+ };
31
+ export declare class EnvironmentProbeStage {
32
+ private readonly deps;
33
+ /** The injected logger, normalised once so every site can log unconditionally (CLAUDE.md). */
34
+ private readonly log;
35
+ constructor(deps: EnvironmentProbeStageDependencies);
36
+ /**
37
+ * Which prober a frame's dry run would run, through the shared rule the SPA's button label
38
+ * reads. Pure, so ADMISSION can ask it with the frame it has already loaded and no record yet.
39
+ */
40
+ surfaceFor(frame: Block): EnvironmentProbeSurface;
41
+ /**
42
+ * Whether this deployment can actually run `surface`'s prober for this workspace, asked at
43
+ * admission. Delegated to the agent, which is where the runner backend is known; see the port
44
+ * for why an unknown answers yes.
45
+ */
46
+ supports(workspaceId: string, surface: EnvironmentProbeSurface): Promise<boolean>;
47
+ /**
48
+ * Whether the model this frame's dry run would run on can actually be dispatched, asked at
49
+ * admission beside {@link supports}. Delegated for the same reason: the model, the harness and
50
+ * the credential that opens it are all facade concerns, and this stage is deliberately free of
51
+ * every one of them.
52
+ */
53
+ checkDispatchable(record: Pick<EnvironmentTestRunRecord, 'workspaceId' | 'blockId' | 'initiatedBy'>, surface: EnvironmentProbeSurface): Promise<EnvironmentProbeDispatchCheck>;
54
+ /**
55
+ * The frame this run is probing, read ONCE per tick, with the prober its type selects.
56
+ *
57
+ * One read rather than one per collaborator: the surface decides which container the job runs
58
+ * in and the title and description go into the prompt, and two reads a moment apart can observe
59
+ * two different frames, so a rename between them puts a service name in the prompt that does not
60
+ * match the surface the claim pinned. The caller PINS the surface on the run at the claim
61
+ * (`probeSurface`) and passes the pinned value back to {@link dispatch}: every later poll and
62
+ * reclaim must address the container that actually started, not one re-derived from a frame that
63
+ * may since have been retyped or deleted.
64
+ */
65
+ resolveTarget(record: EnvironmentTestRunRecord): Promise<{
66
+ frame: Block;
67
+ surface: EnvironmentProbeSurface;
68
+ }>;
69
+ /**
70
+ * Dispatch the dry run for `record`, whose environment is `ready`.
71
+ *
72
+ * Throws when anything it needs is missing, and each throw is the run's terminal error, so the
73
+ * messages name what a human has to fix rather than what this function could not find. The
74
+ * caller has already CLAIMED the probe (see `EnvironmentTestRunRecord.probeSurface`), so a throw
75
+ * here fails the run at the `probing` stage with the environment still up for `fail()` to
76
+ * reclaim.
77
+ */
78
+ dispatch(record: EnvironmentTestRunRecord, surface: EnvironmentProbeSurface, frame: Block): Promise<EnvironmentProbeHandle>;
79
+ /**
80
+ * Poll the dispatched dry run.
81
+ *
82
+ * A `failed` update THROWS rather than being reported as a verdict: an evicted container or a
83
+ * reply carrying no JSON is a diagnostic that never happened, and returning it as a finding
84
+ * would tell an operator their service is inoperable when it is the platform's own step that
85
+ * broke. The run then fails at the `probing` stage with the container's own error, which is the
86
+ * honest reading and the one the sweeper's cleanup already handles.
87
+ */
88
+ poll(record: EnvironmentTestRunRecord, surface: EnvironmentProbeSurface): Promise<EnvironmentProbeOutcome>;
89
+ /** Reclaim the probe's container. Best-effort by contract; never throws at the caller. */
90
+ release(record: EnvironmentTestRunRecord, surface: EnvironmentProbeSurface): Promise<void>;
91
+ /**
92
+ * The dispatched probe's handle, rebuilt from the RECORD rather than remembered from the
93
+ * dispatch: the durable driver polls from a fresh process, so the record is the only thing both
94
+ * sides of a replay share. The SURFACE is passed in rather than re-derived, because the claim on
95
+ * the record addresses a container and a frame edited mid-run would address a different one.
96
+ *
97
+ * The DISPATCH ATTRIBUTION rides along for the same reason the surface does, and it is why the
98
+ * record carries it at all: everything else on this handle is an address, but the model that ran
99
+ * and the token that paid for it are facts about a moment that has passed. Rebuilt from the row,
100
+ * they survive the replay; re-derived, they would be answers about the frame as it is now. Absent
101
+ * until the dispatch is accepted, which the port documents as a state rather than a hole.
102
+ */
103
+ private handle;
104
+ }
105
+ //# sourceMappingURL=environmentProbeStage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentProbeStage.d.ts","sourceRoot":"","sources":["../../../src/modules/environments/environmentProbeStage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EAEvB,wBAAwB,EACxB,MAAM,EACN,qBAAqB,EACrB,YAAY,EACb,MAAM,qBAAqB,CAAA;AAyB5B,+FAA+F;AAC/F,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CACxF;AAED,MAAM,WAAW,iCAAiC;IAChD,oFAAoF;IACpF,KAAK,EAAE,qBAAqB,CAAA;IAC5B,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;IAC7C,YAAY,EAAE,wBAAwB,CAAA;IACtC,4FAA4F;IAC5F,qBAAqB,EAAE,qBAAqB,CAAA;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,qDAAqD;AACrD,MAAM,MAAM,uBAAuB;AACjC;;;;GAIG;AACD;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;CAAE;AAC/C,+FAA+F;GAC7F;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MA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