@cat-factory/contracts 0.151.0 → 0.152.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.
Files changed (42) hide show
  1. package/dist/bootstrap.js +1 -1
  2. package/dist/bootstrap.js.map +1 -1
  3. package/dist/companion.js +1 -1
  4. package/dist/companion.js.map +1 -1
  5. package/dist/entities.d.ts +14 -3925
  6. package/dist/entities.d.ts.map +1 -1
  7. package/dist/entities.js +17 -1284
  8. package/dist/entities.js.map +1 -1
  9. package/dist/env-config-repair.js +1 -1
  10. package/dist/env-config-repair.js.map +1 -1
  11. package/dist/events.d.ts +2 -1
  12. package/dist/events.d.ts.map +1 -1
  13. package/dist/execution.d.ts +3882 -0
  14. package/dist/execution.d.ts.map +1 -0
  15. package/dist/execution.js +1290 -0
  16. package/dist/execution.js.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/observability.js +1 -1
  22. package/dist/observability.js.map +1 -1
  23. package/dist/requests.d.ts +1 -0
  24. package/dist/requests.d.ts.map +1 -1
  25. package/dist/requests.js +5 -0
  26. package/dist/requests.js.map +1 -1
  27. package/dist/routes/agent-runs.js +1 -1
  28. package/dist/routes/agent-runs.js.map +1 -1
  29. package/dist/routes/board.d.ts +1 -0
  30. package/dist/routes/board.d.ts.map +1 -1
  31. package/dist/routes/execution.d.ts.map +1 -1
  32. package/dist/routes/execution.js +2 -1
  33. package/dist/routes/execution.js.map +1 -1
  34. package/dist/routes/human-review.js +1 -1
  35. package/dist/routes/human-review.js.map +1 -1
  36. package/dist/routes/human-test.js +1 -1
  37. package/dist/routes/human-test.js.map +1 -1
  38. package/dist/routes/visual-confirm.js +1 -1
  39. package/dist/routes/visual-confirm.js.map +1 -1
  40. package/dist/snapshot.js +2 -1
  41. package/dist/snapshot.js.map +1 -1
  42. package/package.json +6 -3
@@ -0,0 +1,3882 @@
1
+ import * as v from 'valibot';
2
+ export declare const decisionSchema: v.ObjectSchema<{
3
+ readonly id: v.StringSchema<undefined>;
4
+ readonly question: v.StringSchema<undefined>;
5
+ readonly options: v.ArraySchema<v.StringSchema<undefined>, undefined>;
6
+ readonly chosen: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7
+ }, undefined>;
8
+ export type Decision = v.InferOutput<typeof decisionSchema>;
9
+ /** One entry of a running step's todo list — its label and current status. */
10
+ export declare const stepSubtaskItemSchema: v.ObjectSchema<{
11
+ /** The task's human-readable subject, as the agent wrote it. */
12
+ readonly label: v.StringSchema<undefined>;
13
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
14
+ }, undefined>;
15
+ export type StepSubtaskItem = v.InferOutput<typeof stepSubtaskItemSchema>;
16
+ /**
17
+ * Live subtask counts for a running step, reported by the container agent from
18
+ * the coding tool's own todo list (e.g. "3/8 done, 1 in progress"). Present only
19
+ * while an async job is in flight and the agent maintains a todo list; the board
20
+ * renders it as a finer-grained progress indicator than `progress` alone.
21
+ *
22
+ * `items` carries the individual todo entries (label + status) so a zoomed-in
23
+ * card can render the actual task list, not just the count. It is optional — an
24
+ * older agent/poll that only reported counts, or the simpler `todos[].done`
25
+ * fallback shape, still validates without it.
26
+ */
27
+ export declare const stepSubtasksSchema: v.ObjectSchema<{
28
+ readonly completed: v.NumberSchema<undefined>;
29
+ readonly inProgress: v.NumberSchema<undefined>;
30
+ readonly total: v.NumberSchema<undefined>;
31
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
32
+ /** The task's human-readable subject, as the agent wrote it. */
33
+ readonly label: v.StringSchema<undefined>;
34
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
35
+ }, undefined>, undefined>, undefined>;
36
+ }, undefined>;
37
+ export type StepSubtasks = v.InferOutput<typeof stepSubtasksSchema>;
38
+ /**
39
+ * One GitHub-review-style comment left on a specific block or item of an agent's
40
+ * proposal — either by a human reviewing an approval gate, or by a quality
41
+ * companion (e.g. the Spec Reviewer) grading a structured output. `quotedSource`
42
+ * is the verbatim raw markdown of the block the comment targets (sliced from the
43
+ * proposal by its source line range), so a "request changes" re-run can quote the
44
+ * agent's own text back to it rather than a re-rendered approximation. It is
45
+ * OPTIONAL because a comment may instead anchor to a structured item via
46
+ * {@link anchorId} (e.g. a spec requirement / acceptance-criterion id), where the
47
+ * reviewed output is rendered as discrete items rather than free prose and there is
48
+ * no quoted source range — the shape a companion returns.
49
+ */
50
+ export declare const stepReviewCommentSchema: v.ObjectSchema<{
51
+ /**
52
+ * Verbatim raw-markdown source of the commented prose block. Optional: a comment
53
+ * may instead anchor to a structured item via {@link anchorId}, where there is no
54
+ * prose source to quote.
55
+ */
56
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
57
+ /**
58
+ * 0-based source line range [start, end) of the commented prose block, for
59
+ * best-effort re-anchoring. Optional: a comment may instead anchor to a structured
60
+ * item via {@link anchorId} (e.g. a spec requirement/acceptance-criterion id), where
61
+ * there is no prose line range.
62
+ */
63
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
64
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
65
+ /**
66
+ * Stable id of the structured item the comment targets (e.g. a spec
67
+ * requirement/criterion id), when the reviewed output is rendered as structured
68
+ * items rather than free prose. Absent for prose-range comments.
69
+ */
70
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
71
+ /** The reviewer's note on this block / item. */
72
+ readonly body: v.StringSchema<undefined>;
73
+ }, undefined>;
74
+ export type StepReviewComment = v.InferOutput<typeof stepReviewCommentSchema>;
75
+ /**
76
+ * The standardized, stored verdict a quality companion produced for an output it
77
+ * graded — shared by every companion site (the pipeline companion step and the
78
+ * requirements-rework gate). The raw model response is {@link companionAssessmentSchema}
79
+ * (rating + summary + comments); this is the persisted, self-describing record of how
80
+ * that assessment was applied: the `rating`, the `threshold` it was judged against,
81
+ * whether it `passed`, and the `feedback` surfaced to the human / fed into a rework.
82
+ */
83
+ export declare const companionVerdictSchema: v.ObjectSchema<{
84
+ /** Overall quality of the graded output (0..1, higher = better). */
85
+ readonly rating: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
86
+ /** The quality bar the rating had to reach to pass. */
87
+ readonly threshold: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
88
+ /** Whether the rating met the threshold. */
89
+ readonly passed: v.BooleanSchema<undefined>;
90
+ /** The companion's challenge / justification (its assessment summary). */
91
+ readonly feedback: v.StringSchema<undefined>;
92
+ }, undefined>;
93
+ export type CompanionVerdict = v.InferOutput<typeof companionVerdictSchema>;
94
+ /**
95
+ * A human approval gate raised after a step whose pipeline marked it
96
+ * `requiresApproval`. Unlike a {@link Decision} (which an agent raises and which
97
+ * re-runs the same step on resolution), an approval gate fires once the step has
98
+ * already produced its `proposal`; approving advances the run (carrying the —
99
+ * possibly edited — proposal forward as context), requesting changes re-runs the
100
+ * same step with the human's `feedback` (+ per-block `comments`), and rejecting
101
+ * stops the run entirely (a terminal `rejected` failure the board can retry).
102
+ */
103
+ export declare const stepApprovalSchema: v.ObjectSchema<{
104
+ /** Unique id of this gate; the durable run parks on it like a decision. */
105
+ readonly id: v.StringSchema<undefined>;
106
+ /** `pending` while awaiting the human; terminal `approved`/`rejected`; `changes_requested` re-runs the step. */
107
+ readonly status: v.PicklistSchema<["pending", "approved", "changes_requested", "rejected"], undefined>;
108
+ /** The agent's output the human is reviewing (editable before approval). */
109
+ readonly proposal: v.StringSchema<undefined>;
110
+ /** When changes were requested, the human's freeform guidance fed into the re-run. */
111
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
112
+ /** When changes were requested, per-block review comments fed into the re-run. */
113
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
114
+ /**
115
+ * Verbatim raw-markdown source of the commented prose block. Optional: a comment
116
+ * may instead anchor to a structured item via {@link anchorId}, where there is no
117
+ * prose source to quote.
118
+ */
119
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
120
+ /**
121
+ * 0-based source line range [start, end) of the commented prose block, for
122
+ * best-effort re-anchoring. Optional: a comment may instead anchor to a structured
123
+ * item via {@link anchorId} (e.g. a spec requirement/acceptance-criterion id), where
124
+ * there is no prose line range.
125
+ */
126
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
127
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
128
+ /**
129
+ * Stable id of the structured item the comment targets (e.g. a spec
130
+ * requirement/criterion id), when the reviewed output is rendered as structured
131
+ * items rather than free prose. Absent for prose-range comments.
132
+ */
133
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
134
+ /** The reviewer's note on this block / item. */
135
+ readonly body: v.StringSchema<undefined>;
136
+ }, undefined>, undefined>, undefined>;
137
+ }, undefined>;
138
+ export type StepApproval = v.InferOutput<typeof stepApprovalSchema>;
139
+ /**
140
+ * The agent flows that produce an "agent run" (a container-backed job whose
141
+ * lifecycle, progress and failure the board surfaces uniformly):
142
+ * - `bootstrap` — a "bootstrap repo" run that scaffolds/adapts a new repo.
143
+ * - `execution` — a task pipeline run that implements a board task.
144
+ * - `env-config-repair` — a coding agent that repairs an environment-provider
145
+ * config file in an existing repo (no board block; surfaced on the infra window).
146
+ */
147
+ export declare const agentRunKindSchema: v.PicklistSchema<["bootstrap", "execution", "env-config-repair"], undefined>;
148
+ export type AgentRunKind = v.InferOutput<typeof agentRunKindSchema>;
149
+ /**
150
+ * How an agent run faulted, so the board can classify the failure (and hint
151
+ * whether a retry is likely to help). The union spans both flows; a given flow
152
+ * only ever produces a subset:
153
+ * - `preflight` — rejected before dispatch (repo missing/not empty, not connected). [bootstrap]
154
+ * - `dispatch` — the container accept-request itself failed (HTTP / network). [bootstrap]
155
+ * - `evicted` — the container vanished mid-run (eviction/crash). Retrying spins a fresh one.
156
+ * - `timeout` — a container watchdog fired (inactivity or max-duration).
157
+ * - `agent` — the agent / git push reported a failure.
158
+ * - `job_failed` — an async container job came back failed. [execution]
159
+ * - `rejected` — a human rejected a gated proposal, stopping the run. [execution]
160
+ * - `cancelled` — the user (or an orphan sweep) explicitly stopped the run.
161
+ * - `unknown` — anything not otherwise classified.
162
+ */
163
+ export declare const agentFailureKindSchema: v.PicklistSchema<["preflight", "dispatch", "environment", "evicted", "timeout", "agent", "job_failed", "rejected", "companion_rejected", "stalled", "cancelled", "unknown"], undefined>;
164
+ export type AgentFailureKind = v.InferOutput<typeof agentFailureKindSchema>;
165
+ /**
166
+ * Structured diagnostics captured when an agent run fails, stored on the run and
167
+ * surfaced on the board so a crash isn't just a one-line message. The container's
168
+ * stdout/stderr can't always be pulled into this record (an evicted container is
169
+ * gone), so for `evicted`/`timeout` failures the `hint` points at where to look.
170
+ */
171
+ export declare const agentFailureSchema: v.ObjectSchema<{
172
+ readonly kind: v.PicklistSchema<["preflight", "dispatch", "environment", "evicted", "timeout", "agent", "job_failed", "rejected", "companion_rejected", "stalled", "cancelled", "unknown"], undefined>;
173
+ /** Human-readable summary (mirrors the run's `error` for back-compat). */
174
+ readonly message: v.StringSchema<undefined>;
175
+ /** Extended detail when available (the harness's reason, an HTTP body, …). */
176
+ readonly detail: v.NullableSchema<v.StringSchema<undefined>, undefined>;
177
+ /** Where to look next (e.g. "check the container logs for this job id"). */
178
+ readonly hint: v.NullableSchema<v.StringSchema<undefined>, undefined>;
179
+ /**
180
+ * Optional machine-readable cause code so the SPA can render precise, actionable guidance
181
+ * without string-matching the prose `message`/`detail` (the failure analogue of a
182
+ * {@link ConflictReason}). Kind-scoped: an `environment` failure carries an
183
+ * {@link EnvironmentFailureReason} (e.g. `deploy_runner_unwired`). Absent when the cause has
184
+ * no client-specific handling.
185
+ */
186
+ readonly reason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
187
+ /** Epoch ms the failure was recorded. */
188
+ readonly occurredAt: v.NumberSchema<undefined>;
189
+ /** Last subtask counts seen before the failure, for context (null if none). */
190
+ readonly lastSubtasks: v.NullableSchema<v.ObjectSchema<{
191
+ readonly completed: v.NumberSchema<undefined>;
192
+ readonly inProgress: v.NumberSchema<undefined>;
193
+ readonly total: v.NumberSchema<undefined>;
194
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
195
+ /** The task's human-readable subject, as the agent wrote it. */
196
+ readonly label: v.StringSchema<undefined>;
197
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
198
+ }, undefined>, undefined>, undefined>;
199
+ }, undefined>, undefined>;
200
+ /**
201
+ * Index of the pipeline step that was in flight when the run failed (the run's
202
+ * `currentStep` at fail time), so the per-attempt failure trail can be attributed to a
203
+ * specific step — the step-detail overlay filters its "execution history" to the failures
204
+ * recorded for that step. Absent on a bootstrap failure (no steps) and on legacy records.
205
+ */
206
+ readonly stepIndex: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
207
+ }, undefined>;
208
+ export type AgentFailure = v.InferOutput<typeof agentFailureSchema>;
209
+ /**
210
+ * A SUCCESSFUL step attempt whose output a restart later superseded — the positive
211
+ * complement of {@link agentFailureSchema}. When a run is restarted from a step, that
212
+ * step and every later one are reset and their `output` dropped; the ones that had
213
+ * already succeeded are recorded here so the step-detail overlay's "execution history"
214
+ * surfaces what a superseded attempt PRODUCED, not only the errors. Attributed to a
215
+ * `stepIndex` exactly like a failure, and rides in the run's `detail` JSON (no column).
216
+ */
217
+ export declare const priorStepOutputSchema: v.ObjectSchema<{
218
+ /** Index of the pipeline step that produced this output (see {@link agentFailureSchema} `stepIndex`). */
219
+ readonly stepIndex: v.NumberSchema<undefined>;
220
+ /** Epoch ms the superseded attempt finished (its `finishedAt`, else when it was recorded). */
221
+ readonly occurredAt: v.NumberSchema<undefined>;
222
+ /** The attempt's prose/JSON output, clipped to a stored-size bound when {@link truncated}. */
223
+ readonly output: v.StringSchema<undefined>;
224
+ /** Whether {@link output} was clipped because the original exceeded the per-entry size bound. */
225
+ readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
226
+ }, undefined>;
227
+ export type PriorStepOutput = v.InferOutput<typeof priorStepOutputSchema>;
228
+ /**
229
+ * State a polling **gate** step carries (today `ci` and `conflicts`). A gate is
230
+ * special (like a `deployer` step): it is NOT itself an LLM/container agent. It
231
+ * runs a programmatic precheck against a provider (CI check runs / PR mergeability)
232
+ * for the PR head commit and only escalates to a helper container agent (`ci-fixer`
233
+ * / `conflict-resolver`) on a negative verdict, looping until the precheck passes or
234
+ * the attempt budget is spent. Which gate a step is comes from its `agentKind`, so it
235
+ * is not duplicated here. See the engine's `GateDefinition` registry.
236
+ * - `phase: 'checking'` — running the precheck / waiting for the provider.
237
+ * - `phase: 'working'` — a helper agent is in flight (tracked via the step's
238
+ * `jobId`); on completion the gate returns to `checking`.
239
+ */
240
+ /** One failing check the CI gate's precheck saw, flattened for display. */
241
+ export declare const gateFailingCheckSchema: v.ObjectSchema<{
242
+ readonly name: v.StringSchema<undefined>;
243
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
244
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
245
+ /**
246
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
247
+ * failed run's logs. Null when GitHub didn't report one.
248
+ */
249
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
250
+ /**
251
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
252
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
253
+ */
254
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
255
+ }, undefined>;
256
+ export type GateFailingCheck = v.InferOutput<typeof gateFailingCheckSchema>;
257
+ /**
258
+ * One helper-agent attempt the gate dispatched (a ci-fixer / conflict-resolver run),
259
+ * recorded when the job finishes so the UI can show what each attempt tried and how it
260
+ * ended — detail that used to be discarded the moment the gate re-probed.
261
+ */
262
+ export declare const gateAttemptSchema: v.ObjectSchema<{
263
+ /** 1-based attempt number (matches `attempts` at the time the helper was dispatched). */
264
+ readonly attempt: v.NumberSchema<undefined>;
265
+ /** Epoch ms when the helper job finished. */
266
+ readonly at: v.NumberSchema<undefined>;
267
+ /**
268
+ * How the helper job ended:
269
+ * - `completed` — the container finished (it may or may not have fully fixed the
270
+ * issue; the gate's next precheck is the source of truth, and `summary` carries
271
+ * the agent's own account, e.g. which files it left conflicting).
272
+ * - `failed` — the job errored / was evicted without finishing.
273
+ */
274
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
275
+ /** The PR head commit the helper worked against, when known. */
276
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
277
+ /**
278
+ * The fixing instructions handed to the helper for this round — the failing-check
279
+ * summary the CI gate fed the `ci-fixer`, the conflict reason / human-review comments
280
+ * the other gates fed their fixer. Stashed at dispatch and recorded with the attempt so
281
+ * the run-detail UI can show WHAT each round was asked to fix (not only that a round
282
+ * happened) — the gate analogue of the Tester attempt's `concerns`. Null when the gate
283
+ * hands its fixer no textual instructions (the conflicts gate: GitHub reports mergeability
284
+ * as a single bit and the harness leaves the conflict markers for the resolver).
285
+ */
286
+ readonly instructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
287
+ /**
288
+ * Structured failing checks handed to this attempt's helper (the CI gate's red check runs
289
+ * behind {@link instructions}), snapshotted at dispatch so each attempt shows the checks it
290
+ * set out to fix. Absent for the conflicts gate (no file-level detail) and when the round
291
+ * carried no structured checks.
292
+ */
293
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
294
+ readonly name: v.StringSchema<undefined>;
295
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
296
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
297
+ /**
298
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
299
+ * failed run's logs. Null when GitHub didn't report one.
300
+ */
301
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
302
+ /**
303
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
304
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
305
+ */
306
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
307
+ }, undefined>, undefined>, undefined>, undefined>;
308
+ /** The helper's own summary (or the failure reason), naming what it did / what remains. */
309
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
310
+ }, undefined>;
311
+ export type GateAttempt = v.InferOutput<typeof gateAttemptSchema>;
312
+ export declare const gateStepStateSchema: v.ObjectSchema<{
313
+ readonly phase: v.PicklistSchema<["checking", "working"], undefined>;
314
+ /** How many helper-agent attempts have been dispatched so far. */
315
+ readonly attempts: v.NumberSchema<undefined>;
316
+ /** Ceiling on attempts, resolved from the task's merge preset at step start. */
317
+ readonly maxAttempts: v.NumberSchema<undefined>;
318
+ /** The PR head commit being gated, once resolved (the own-service PR on a multi-repo block). */
319
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
320
+ /**
321
+ * Per-PR head commits for a MULTI-REPO block (service-connections phase 4), keyed by repo
322
+ * full name (owner/name) — own-service PR plus each peer-service PR. Set by the CI /
323
+ * conflicts gates whose precheck aggregates across every PR the task opened. Absent for a
324
+ * single-repo block (the scalar {@link headSha} is the only head).
325
+ */
326
+ readonly headShas: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>, undefined>;
327
+ /**
328
+ * The repo the conflicts gate's most recent `fail` verdict found conflicted, so the
329
+ * single-repo conflict-resolver is dispatched at THAT repo (own-service or a peer) rather
330
+ * than always the own-service one. Absent ⇒ the own-service repo. Only the conflicts gate
331
+ * sets it (the CI-fixer runs across all repos, so the CI gate leaves it undefined).
332
+ */
333
+ readonly conflictTarget: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
334
+ readonly repo: v.StringSchema<undefined>;
335
+ readonly frameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
336
+ readonly branch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
337
+ }, undefined>, undefined>, undefined>;
338
+ /**
339
+ * The most recent precheck verdict, so the UI can show why the gate is looping
340
+ * (failing → a helper is fixing) vs idle-passing. Set on every probe.
341
+ */
342
+ readonly lastVerdict: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "pending", "fail"], undefined>, undefined>, undefined>;
343
+ /**
344
+ * Human-readable summary of the latest failing precheck (the failing CI checks /
345
+ * the conflict reason) — the conclusion detail that used to be fed only to the
346
+ * helper agent and then discarded. Carried across the helper dispatch so the
347
+ * window keeps showing what is being fixed. Null when the last probe passed.
348
+ */
349
+ readonly lastFailureSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
350
+ /**
351
+ * Structured failing checks behind {@link lastFailureSummary} for the CI gate, so
352
+ * the UI can list each red check by name + conclusion. Absent for the conflicts
353
+ * gate (GitHub reports no file-level detail) and when the last probe passed.
354
+ */
355
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
356
+ readonly name: v.StringSchema<undefined>;
357
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
358
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
359
+ /**
360
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
361
+ * failed run's logs. Null when GitHub didn't report one.
362
+ */
363
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
364
+ /**
365
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
366
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
367
+ */
368
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
369
+ }, undefined>, undefined>, undefined>, undefined>;
370
+ /**
371
+ * The fixing instructions handed to the most-recently dispatched helper (the failing-check
372
+ * summary / conflict reason / human fix prompt), stashed at dispatch so the attempt recorded
373
+ * when that helper's job settles can carry WHAT the round was asked to fix onto its
374
+ * {@link gateAttemptSchema} entry. Transient bookkeeping — the durable per-round history lives
375
+ * on {@link attemptLog}. Null when the gate hands its fixer no textual instructions.
376
+ */
377
+ readonly lastDispatchedInstructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
378
+ /**
379
+ * Epoch ms of the release marker for a time-windowed gate (post-release-health) — the
380
+ * moment it began watching the deployed release. The gate keeps polling `pending`
381
+ * until this + the preset's watch window has elapsed (then a clean run passes) or a
382
+ * monitor/SLO regresses (then it escalates to the on-call agent). Absent for the
383
+ * CI/conflicts gates.
384
+ */
385
+ readonly watchSince: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
386
+ /**
387
+ * The watch-window length (minutes) for a time-windowed gate (post-release-health),
388
+ * resolved from the task's merge preset ONCE on first entry (alongside `maxAttempts`)
389
+ * so the probe doesn't re-load the block + re-resolve the preset on every poll. Absent
390
+ * for the CI/conflicts gates.
391
+ */
392
+ readonly watchWindowMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
393
+ /**
394
+ * The regressed signals captured when the post-release-health gate escalated to the
395
+ * on-call agent, so the agent's completion handler can build the `release_regression`
396
+ * notification + incident enrichment from the SAME evidence the agent investigated
397
+ * — rather than re-reading Datadog (a third round-trip that could also disagree with
398
+ * what the agent saw if the window moved). Absent for the CI/conflicts gates.
399
+ */
400
+ readonly regressedSignals: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
401
+ readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
402
+ readonly id: v.StringSchema<undefined>;
403
+ readonly name: v.StringSchema<undefined>;
404
+ readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
405
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
406
+ }, undefined>, undefined>, undefined>, undefined>;
407
+ /**
408
+ * Append-only history of the helper-agent attempts this gate dispatched (ci-fixer /
409
+ * conflict-resolver runs), each recorded when its job finished. Lets the UI show what
410
+ * every attempt tried and how it ended, instead of only a bare `attempts` count.
411
+ * Absent for the post-release-health gate (its on-call helper is resolved specially).
412
+ */
413
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
414
+ /** 1-based attempt number (matches `attempts` at the time the helper was dispatched). */
415
+ readonly attempt: v.NumberSchema<undefined>;
416
+ /** Epoch ms when the helper job finished. */
417
+ readonly at: v.NumberSchema<undefined>;
418
+ /**
419
+ * How the helper job ended:
420
+ * - `completed` — the container finished (it may or may not have fully fixed the
421
+ * issue; the gate's next precheck is the source of truth, and `summary` carries
422
+ * the agent's own account, e.g. which files it left conflicting).
423
+ * - `failed` — the job errored / was evicted without finishing.
424
+ */
425
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
426
+ /** The PR head commit the helper worked against, when known. */
427
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
428
+ /**
429
+ * The fixing instructions handed to the helper for this round — the failing-check
430
+ * summary the CI gate fed the `ci-fixer`, the conflict reason / human-review comments
431
+ * the other gates fed their fixer. Stashed at dispatch and recorded with the attempt so
432
+ * the run-detail UI can show WHAT each round was asked to fix (not only that a round
433
+ * happened) — the gate analogue of the Tester attempt's `concerns`. Null when the gate
434
+ * hands its fixer no textual instructions (the conflicts gate: GitHub reports mergeability
435
+ * as a single bit and the harness leaves the conflict markers for the resolver).
436
+ */
437
+ readonly instructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
438
+ /**
439
+ * Structured failing checks handed to this attempt's helper (the CI gate's red check runs
440
+ * behind {@link instructions}), snapshotted at dispatch so each attempt shows the checks it
441
+ * set out to fix. Absent for the conflicts gate (no file-level detail) and when the round
442
+ * carried no structured checks.
443
+ */
444
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
445
+ readonly name: v.StringSchema<undefined>;
446
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
447
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
448
+ /**
449
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
450
+ * failed run's logs. Null when GitHub didn't report one.
451
+ */
452
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
453
+ /**
454
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
455
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
456
+ */
457
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
458
+ }, undefined>, undefined>, undefined>, undefined>;
459
+ /** The helper's own summary (or the failure reason), naming what it did / what remains. */
460
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
461
+ }, undefined>, undefined>, undefined>, undefined>;
462
+ /**
463
+ * The number of approving reviews the PR had at the last probe, so the UI can show
464
+ * "1 / N approvals". The "required" side is derived from {@link requiredApprovingReviewCount}
465
+ * via the same `max(1, …)` floor the gate applies (see review.logic.ts) rather than persisted
466
+ * a second time. Absent for the other gates.
467
+ */
468
+ readonly lastApprovals: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
469
+ /**
470
+ * The raw branch-protection required-approving-review count, cached after the FIRST probe
471
+ * resolves it so subsequent polls skip the static protection read (branch protection is repo
472
+ * config, not PR activity — re-reading it every poll over a multi-day review only burns GitHub
473
+ * rate budget). The UI's displayed "required" count is `max(1, this)` (the gate's effective
474
+ * floor). Absent for the other gates.
475
+ */
476
+ readonly requiredApprovingReviewCount: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
477
+ /**
478
+ * The GraphQL ids of the review threads the gate just handed the `fixer`, stashed at
479
+ * dispatch so the helper-completion hook can post a reply + RESOLVE exactly those threads
480
+ * on GitHub before the next probe reads them. Absent for the other gates.
481
+ */
482
+ readonly pendingThreadIds: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
483
+ /**
484
+ * Epoch ms of the newest plain PR comment the gate has already handed the `fixer`. Plain
485
+ * conversation comments (unlike review threads) can't be "resolved" on GitHub, so they are
486
+ * tracked by timestamp: a comment newer than this is outstanding; the dispatch advances it to
487
+ * the batch max. A reviewer's later comment (newer timestamp) re-opens the work. Absent for
488
+ * the other gates.
489
+ */
490
+ readonly lastAddressedCommentAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
491
+ /**
492
+ * The grace window (minutes) the human-review gate waits after the latest review comment
493
+ * before dispatching the fixer, resolved from the task's merge preset ONCE on first entry
494
+ * (alongside `maxAttempts`) so the probe doesn't re-resolve the preset every poll. Absent
495
+ * for the other gates.
496
+ */
497
+ readonly humanReviewGraceMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
498
+ /**
499
+ * A human-initiated freeform fix request parked on the gate (an in-app prompt). Consumed at
500
+ * the top of the next `evaluateGate` pass, which dispatches the fixer with these instructions
501
+ * folded in — bypassing the grace window. Absent for the other gates.
502
+ */
503
+ readonly pendingFix: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
504
+ readonly instructions: v.StringSchema<undefined>;
505
+ readonly at: v.NumberSchema<undefined>;
506
+ }, undefined>, undefined>, undefined>;
507
+ }, undefined>;
508
+ export type GateStepState = v.InferOutput<typeof gateStepStateSchema>;
509
+ /**
510
+ * State a `tester` step carries while it runs the Tester → Fixer loop. Unlike `ci`,
511
+ * the gate's own work IS a container job (the Tester); on a withheld greenlight the
512
+ * engine loops a `fixer` container agent and re-tests.
513
+ * - `phase: 'testing'` — a Tester job is in flight (tracked via the step's `jobId`).
514
+ * - `phase: 'fixing'` — a Fixer job is in flight; on completion the step returns to
515
+ * `testing` and a fresh Tester job is dispatched.
516
+ */
517
+ /**
518
+ * One round of the Tester→Fixer loop, recorded when a `fixer` job finishes so the test
519
+ * window can show what each fixer attempt set out to fix and how it ended — the analogue of
520
+ * a polling gate's {@link gateAttemptSchema}, since a fixer run is otherwise an opaque
521
+ * sub-job with no surface of its own (only a bare `attempts` count).
522
+ */
523
+ export declare const testerAttemptSchema: v.ObjectSchema<{
524
+ /** 1-based fixer round (matches `attempts` after the fixer for this round was dispatched). */
525
+ readonly attempt: v.NumberSchema<undefined>;
526
+ /** Epoch ms when the fixer job finished. */
527
+ readonly at: v.NumberSchema<undefined>;
528
+ /** Whether the fixer container finished (`completed`) or errored/was evicted (`failed`). */
529
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
530
+ /** The fixer's own summary (or the failure reason), naming what it changed / what failed. */
531
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
532
+ /**
533
+ * The concerns the fixer was handed for this round (from the Tester report that withheld
534
+ * its greenlight), so the window can show WHAT each round tried to address — not only that
535
+ * a round happened.
536
+ */
537
+ readonly concerns: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
538
+ readonly title: v.StringSchema<undefined>;
539
+ readonly detail: v.StringSchema<undefined>;
540
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
541
+ }, undefined>, undefined>, undefined>, undefined>;
542
+ }, undefined>;
543
+ export type TesterAttempt = v.InferOutput<typeof testerAttemptSchema>;
544
+ export declare const testerStepStateSchema: v.ObjectSchema<{
545
+ readonly phase: v.PicklistSchema<["testing", "fixing"], undefined>;
546
+ /** How many `fixer` attempts have been dispatched so far. */
547
+ readonly attempts: v.NumberSchema<undefined>;
548
+ /** Ceiling on fixer attempts, resolved from the task's merge preset at step start. */
549
+ readonly maxAttempts: v.NumberSchema<undefined>;
550
+ /** The most recent Tester report (what was tested, outcomes, concerns, greenlight). */
551
+ readonly lastReport: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
552
+ readonly greenlight: v.BooleanSchema<undefined>;
553
+ readonly summary: v.StringSchema<undefined>;
554
+ readonly tested: v.ArraySchema<v.StringSchema<undefined>, undefined>;
555
+ readonly outcomes: v.ArraySchema<v.ObjectSchema<{
556
+ readonly name: v.StringSchema<undefined>;
557
+ readonly status: v.PicklistSchema<["passed", "failed", "skipped"], undefined>;
558
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
559
+ }, undefined>, undefined>;
560
+ readonly concerns: v.ArraySchema<v.ObjectSchema<{
561
+ readonly title: v.StringSchema<undefined>;
562
+ readonly detail: v.StringSchema<undefined>;
563
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
564
+ }, undefined>, undefined>;
565
+ readonly environment: v.OptionalSchema<v.PicklistSchema<["local", "ephemeral"], undefined>, undefined>;
566
+ readonly screenshots: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
567
+ readonly view: v.StringSchema<undefined>;
568
+ readonly artifactId: v.StringSchema<undefined>;
569
+ readonly hash: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
570
+ readonly width: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
571
+ readonly height: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
572
+ readonly referenceArtifactId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
573
+ }, undefined>, undefined>, undefined>;
574
+ readonly abort: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
575
+ readonly reason: v.StringSchema<undefined>;
576
+ }, undefined>, undefined>, undefined>;
577
+ }, undefined>, v.TransformAction<{
578
+ greenlight: boolean;
579
+ summary: string;
580
+ tested: string[];
581
+ outcomes: {
582
+ name: string;
583
+ status: "failed" | "passed" | "skipped";
584
+ detail?: string | undefined;
585
+ }[];
586
+ concerns: {
587
+ title: string;
588
+ detail: string;
589
+ severity: "critical" | "high" | "low" | "medium";
590
+ }[];
591
+ environment?: "ephemeral" | "local" | undefined;
592
+ screenshots?: {
593
+ view: string;
594
+ artifactId: string;
595
+ hash?: string | undefined;
596
+ width?: number | undefined;
597
+ height?: number | undefined;
598
+ referenceArtifactId?: string | undefined;
599
+ }[] | undefined;
600
+ abort?: {
601
+ reason: string;
602
+ } | null | undefined;
603
+ }, {
604
+ greenlight: boolean;
605
+ summary: string;
606
+ tested: string[];
607
+ outcomes: {
608
+ name: string;
609
+ status: "failed" | "passed" | "skipped";
610
+ detail?: string | undefined;
611
+ }[];
612
+ concerns: {
613
+ title: string;
614
+ detail: string;
615
+ severity: "critical" | "high" | "low" | "medium";
616
+ }[];
617
+ environment?: "ephemeral" | "local" | undefined;
618
+ screenshots?: {
619
+ view: string;
620
+ artifactId: string;
621
+ hash?: string | undefined;
622
+ width?: number | undefined;
623
+ height?: number | undefined;
624
+ referenceArtifactId?: string | undefined;
625
+ }[] | undefined;
626
+ abort?: {
627
+ reason: string;
628
+ } | null | undefined;
629
+ }>]>, undefined>, undefined>;
630
+ /**
631
+ * Append-only history of the `fixer` rounds this Tester step looped through, each recorded
632
+ * when its job finished. Lets the test window surface an inspectable timeline of the fixer
633
+ * attempts (what each addressed, how it ended) instead of only a bare `attempts` count.
634
+ */
635
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
636
+ /** 1-based fixer round (matches `attempts` after the fixer for this round was dispatched). */
637
+ readonly attempt: v.NumberSchema<undefined>;
638
+ /** Epoch ms when the fixer job finished. */
639
+ readonly at: v.NumberSchema<undefined>;
640
+ /** Whether the fixer container finished (`completed`) or errored/was evicted (`failed`). */
641
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
642
+ /** The fixer's own summary (or the failure reason), naming what it changed / what failed. */
643
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
644
+ /**
645
+ * The concerns the fixer was handed for this round (from the Tester report that withheld
646
+ * its greenlight), so the window can show WHAT each round tried to address — not only that
647
+ * a round happened.
648
+ */
649
+ readonly concerns: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
650
+ readonly title: v.StringSchema<undefined>;
651
+ readonly detail: v.StringSchema<undefined>;
652
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
653
+ }, undefined>, undefined>, undefined>, undefined>;
654
+ }, undefined>, undefined>, undefined>, undefined>;
655
+ /**
656
+ * The most recent in-container docker-compose dependency stand-up record (local-infra
657
+ * tester): whether the dependencies came up and the captured (redacted, bounded)
658
+ * `docker compose up` logs. Refreshed on each Tester round (it stands the infra up anew),
659
+ * so the test window can surface WHY local infra failed to come up — the failure-class
660
+ * artifact the orchestrator-side provisioning logs can't see. Absent for ephemeral /
661
+ * no-infra runs. See {@link testerInfraSetupSchema}.
662
+ */
663
+ readonly infraSetup: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
664
+ readonly started: v.BooleanSchema<undefined>;
665
+ readonly composePath: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
666
+ readonly at: v.NumberSchema<undefined>;
667
+ readonly durationMs: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
668
+ readonly logs: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
669
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
670
+ }, undefined>, undefined>, undefined>;
671
+ }, undefined>;
672
+ export type TesterStepState = v.InferOutput<typeof testerStepStateSchema>;
673
+ /**
674
+ * One test quality-control companion verdict, recorded per QC evaluation of a Tester
675
+ * report (in order; newest last). `adequate` is the QC's judgement that the report is
676
+ * complete enough to conclude testing / go to the fixer; when false, `gaps` lists the
677
+ * concrete things the Tester still needs to exercise and `feedback` is the prose the
678
+ * Tester is handed on its re-run.
679
+ */
680
+ export declare const testerQualityVerdictSchema: v.ObjectSchema<{
681
+ /** Whether the report is complete/coherent enough to proceed (no QC re-run needed). */
682
+ readonly adequate: v.BooleanSchema<undefined>;
683
+ /** The QC's prose challenge / justification, folded into the Tester's re-run context. */
684
+ readonly feedback: v.StringSchema<undefined>;
685
+ /** Concrete coverage gaps the Tester must still address (empty when adequate). */
686
+ readonly gaps: v.ArraySchema<v.StringSchema<undefined>, undefined>;
687
+ /** Epoch ms the verdict was produced. */
688
+ readonly at: v.NumberSchema<undefined>;
689
+ /** The model that produced the verdict, for transparency. */
690
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
691
+ }, undefined>;
692
+ export type TesterQualityVerdict = v.InferOutput<typeof testerQualityVerdictSchema>;
693
+ /**
694
+ * Live test quality-control loop state carried on a run's Tester step, copied from the
695
+ * pipeline's per-step `testerQualityConfigSchema` (see entities.ts) at run start. The QC companion reads
696
+ * each Tester report BEFORE the greenlight/fixer decision; when the report is inadequate and
697
+ * `attempts < maxAttempts` it loops the Tester (folding the prior report + `feedback` in),
698
+ * bounded independently of the fixer budget. `verdicts` records each evaluation for the UI.
699
+ */
700
+ export declare const testerQualityStepStateSchema: v.ObjectSchema<{
701
+ /** Whether the QC companion is active on this Tester step (the builder toggle). */
702
+ readonly enabled: v.BooleanSchema<undefined>;
703
+ /** How many QC-driven Tester re-runs have been dispatched so far. */
704
+ readonly attempts: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
705
+ /** Ceiling on QC-driven re-runs, from the task's merge preset (`maxTesterQualityIterations`). */
706
+ readonly maxAttempts: v.NumberSchema<undefined>;
707
+ /** Optional estimate gating copied from the pipeline; evaluated against the block estimate. */
708
+ readonly gating: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
709
+ readonly enabled: v.BooleanSchema<undefined>;
710
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
711
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
712
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
713
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["run", "skip"], undefined>, "run">;
714
+ }, undefined>, undefined>, undefined>;
715
+ /** One verdict per QC evaluation, in order (newest last). Empty before the first grade. */
716
+ readonly verdicts: v.ArraySchema<v.ObjectSchema<{
717
+ /** Whether the report is complete/coherent enough to proceed (no QC re-run needed). */
718
+ readonly adequate: v.BooleanSchema<undefined>;
719
+ /** The QC's prose challenge / justification, folded into the Tester's re-run context. */
720
+ readonly feedback: v.StringSchema<undefined>;
721
+ /** Concrete coverage gaps the Tester must still address (empty when adequate). */
722
+ readonly gaps: v.ArraySchema<v.StringSchema<undefined>, undefined>;
723
+ /** Epoch ms the verdict was produced. */
724
+ readonly at: v.NumberSchema<undefined>;
725
+ /** The model that produced the verdict, for transparency. */
726
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
727
+ }, undefined>, undefined>;
728
+ /** Set true once the QC budget was spent with the report still judged inadequate. */
729
+ readonly exceeded: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
730
+ }, undefined>;
731
+ export type TesterQualityStepState = v.InferOutput<typeof testerQualityStepStateSchema>;
732
+ /**
733
+ * The compact ephemeral-environment view a `human-test` gate carries on its step, so the
734
+ * dedicated window can surface the live URL/status without a second fetch. The full record
735
+ * (with encrypted access creds) lives in the `environments` table; this is the non-secret
736
+ * projection. Null in degraded manual mode (no env provider wired) or after the human
737
+ * destroys the env from the gate.
738
+ */
739
+ /**
740
+ * The compact, non-secret projection of the ephemeral environment a run's step is
741
+ * associated with — its lifecycle state, public URL, TTL, and (when failed) the
742
+ * exact provider error. Surfaced in a run's details (esp. the Tester step) so the
743
+ * env's spinning-up / running / shut-down / errored state is visible without a
744
+ * second fetch. The full record (with encrypted creds) lives in the `environments`
745
+ * table. {@link humanTestEnvironmentSchema} is the human-test gate's subset of this.
746
+ */
747
+ export declare const runEnvironmentSchema: v.ObjectSchema<{
748
+ /** The `environments` row id (lets a window fetch access creds / re-poll status). */
749
+ readonly id: v.StringSchema<undefined>;
750
+ /** The provisioned public URL (null while still provisioning). */
751
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
752
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
753
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
754
+ /** Epoch ms the environment expires (TTL), when known. */
755
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
756
+ /** The verbatim provider error when the environment failed/expired, else null. */
757
+ readonly lastError: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
758
+ /**
759
+ * The service's declared provision type this environment was stood up for
760
+ * (`kubernetes` | `docker-compose` | `custom` | `infraless`), recorded at provision
761
+ * time so a run's details show exactly what was provisioned. Null for legacy rows /
762
+ * pre-resolution.
763
+ */
764
+ readonly provisionType: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["kubernetes", "docker-compose", "custom", "infraless"], undefined>, undefined>, undefined>;
765
+ /**
766
+ * The resolved engine that handled the provisioning (`local-docker` | `local-k3s` |
767
+ * `remote-kubernetes` | `remote-custom` | `none`), surfaced in run details alongside the
768
+ * environment state. Null for legacy rows / pre-resolution.
769
+ */
770
+ readonly engine: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["local-docker", "local-k3s", "remote-kubernetes", "remote-custom", "none"], undefined>, undefined>, undefined>;
771
+ }, undefined>;
772
+ export type RunEnvironment = v.InferOutput<typeof runEnvironmentSchema>;
773
+ /**
774
+ * The lifecycle status of the per-run container backing a container agent step:
775
+ * `starting` (dispatching / cold-booting), `up` (running the agent's job),
776
+ * `errored` (the container failed to start, was evicted, or its job faulted), and
777
+ * `destroyed` (the run's container has been reclaimed). The SPA additionally derives
778
+ * `destroyed` for a finished run's container steps (the container is reclaimed as a
779
+ * unit when the run terminates), so the backend only ever persists the first three.
780
+ */
781
+ export declare const runContainerStatusSchema: v.PicklistSchema<["starting", "up", "errored", "destroyed"], undefined>;
782
+ export type RunContainerStatus = v.InferOutput<typeof runContainerStatusSchema>;
783
+ /**
784
+ * The compact, non-secret projection of the per-run container a container agent step
785
+ * runs in, so a run's details can show WHAT the container is doing and WHERE it lives
786
+ * instead of a step's "spinning up container…" badge vanishing into a blank "working"
787
+ * state once the container is up. Populated by the engine across the dispatch + poll
788
+ * lifecycle of an async (container) step; only ever set on container-backed steps.
789
+ */
790
+ export declare const runContainerSchema: v.ObjectSchema<{
791
+ /** The container lifecycle status; see {@link runContainerStatusSchema}. */
792
+ readonly status: v.PicklistSchema<["starting", "up", "errored", "destroyed"], undefined>;
793
+ /**
794
+ * The coarse phase the agent's job is in while the container is `up` (`clone` →
795
+ * `agent` → `push`, seeded `starting`), forwarded from the harness. Lets the details
796
+ * distinguish "still preparing the checkout" from "the agent is making calls". Absent
797
+ * until the first poll, or when the runner doesn't report a phase.
798
+ */
799
+ readonly phase: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
800
+ /** Provider container/runner id (Cloudflare DO id, docker container id), when known. */
801
+ readonly id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
802
+ /** A reachable address for the running container (the local docker host URL), when one exists. */
803
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
804
+ }, undefined>;
805
+ export type RunContainer = v.InferOutput<typeof runContainerSchema>;
806
+ /** The web-search backend a run's container searches through, when search is available. */
807
+ export declare const webSearchProviderSchema: v.PicklistSchema<["brave", "searxng"], undefined>;
808
+ export type WebSearchProvider = v.InferOutput<typeof webSearchProviderSchema>;
809
+ /**
810
+ * Narrow a free-text stored value (a telemetry `provider` column, which is plain TEXT) back
811
+ * to the {@link WebSearchProvider} union, or null when it isn't one. The single source of
812
+ * truth both telemetry stores use to map their rows, so the union is defined once.
813
+ */
814
+ export declare function isWebSearchProvider(value: unknown): value is WebSearchProvider;
815
+ /**
816
+ * Whether a container agent had web search available for its run, and — when it did —
817
+ * which upstream backend served it (resolved backend-side at dispatch from the run's
818
+ * account keys, else the deployment default). Surfaced on a container step so the run
819
+ * details can say "Web search: SearXNG" vs "Web search: unavailable"; it is a static
820
+ * dispatch-time fact, NOT gated by prompt-recording telemetry (the performed queries
821
+ * are — see the agent-search-query observability sink). `provider` is null when search
822
+ * was unavailable.
823
+ */
824
+ export declare const webSearchAvailabilitySchema: v.ObjectSchema<{
825
+ readonly available: v.BooleanSchema<undefined>;
826
+ readonly provider: v.NullableSchema<v.PicklistSchema<["brave", "searxng"], undefined>, undefined>;
827
+ }, undefined>;
828
+ export type WebSearchAvailability = v.InferOutput<typeof webSearchAvailabilitySchema>;
829
+ /**
830
+ * The TERMINAL per-frame outcome of one environment a `deployer` step provisioned during a
831
+ * multi-env fan-out (the task's own service frame + every involved-service frame): `ready`
832
+ * (a live env, `url` set), `failed` (the provision broke, `error` carries the cause), or
833
+ * `skipped` (the frame is `infraless`, nothing stood up). The IN-FLIGHT frame is not recorded
834
+ * here — it lives on `step.jobId`/`step.deployFrameId` until it settles. See
835
+ * {@link pipelineStepSchema.entries.deployEnvs}.
836
+ */
837
+ export declare const deployEnvStateSchema: v.ObjectSchema<{
838
+ readonly status: v.PicklistSchema<["ready", "failed", "skipped"], undefined>;
839
+ /** The provisioned URL for a `ready` env (absent for `failed`/`skipped`). */
840
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
841
+ /** The verbatim provider error for a `failed` env. */
842
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
843
+ }, undefined>;
844
+ export type DeployEnvState = v.InferOutput<typeof deployEnvStateSchema>;
845
+ /** Per-frame deploy outcomes keyed by service-frame block id; see {@link deployEnvStateSchema}. */
846
+ export declare const deployEnvsSchema: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
847
+ readonly status: v.PicklistSchema<["ready", "failed", "skipped"], undefined>;
848
+ /** The provisioned URL for a `ready` env (absent for `failed`/`skipped`). */
849
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
850
+ /** The verbatim provider error for a `failed` env. */
851
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
852
+ }, undefined>, undefined>;
853
+ export type DeployEnvs = v.InferOutput<typeof deployEnvsSchema>;
854
+ export declare const humanTestEnvironmentSchema: v.ObjectSchema<{
855
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
856
+ readonly id: v.StringSchema<undefined>;
857
+ /** The provisioned public URL the human tests against (null while still provisioning). */
858
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
859
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
860
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
861
+ /** Epoch ms the environment expires (TTL), when known. */
862
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
863
+ }, undefined>;
864
+ export type HumanTestEnvironment = v.InferOutput<typeof humanTestEnvironmentSchema>;
865
+ /**
866
+ * One round of human-driven remediation on a `human-test` gate: the human wrote findings and
867
+ * asked for a fix (helper `fixer`), or pulled main and hit a conflict (helper
868
+ * `conflict-resolver`). Appended when the round opens and stamped with its outcome once the
869
+ * helper job settles, so the window can show the full history of what was asked and how it ended.
870
+ */
871
+ export declare const humanTestRoundSchema: v.ObjectSchema<{
872
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
873
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
874
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
875
+ readonly findings: v.StringSchema<undefined>;
876
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
877
+ readonly helperKind: v.StringSchema<undefined>;
878
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
879
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
880
+ /** How the helper ended once its job settled. Absent while still in flight. */
881
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
882
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
883
+ readonly at: v.NumberSchema<undefined>;
884
+ }, undefined>;
885
+ export type HumanTestRound = v.InferOutput<typeof humanTestRoundSchema>;
886
+ /**
887
+ * State a `human-test` gate carries while it runs. Unlike a polling gate (`ci`/`conflicts`)
888
+ * there is no programmatic verdict — the HUMAN is the verdict — so the step spins up an
889
+ * ephemeral environment, parks for a person to validate it, and on demand dispatches the same
890
+ * helpers the other gates use (the Tester's `fixer` for findings; the `conflict-resolver` for a
891
+ * conflicting pull-main). Phases:
892
+ * - `provisioning` — an environment is being stood up (the driver polls until ready).
893
+ * - `awaiting_human` — parked: the human tests the env and confirms / requests a fix / etc.
894
+ * - `fixing` — a `fixer` job (from the human's findings) is in flight.
895
+ * - `resolving_conflicts` — a `conflict-resolver` job (from a conflicting pull-main) is in flight.
896
+ * - `passed` — the human confirmed; the env is torn down and the run advances.
897
+ */
898
+ export declare const humanTestStepStateSchema: v.ObjectSchema<{
899
+ readonly phase: v.PicklistSchema<["provisioning", "awaiting_human", "fixing", "resolving_conflicts", "passed"], undefined>;
900
+ /** The live ephemeral environment (null in degraded manual mode / after destroy). */
901
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
902
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
903
+ readonly id: v.StringSchema<undefined>;
904
+ /** The provisioned public URL the human tests against (null while still provisioning). */
905
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
906
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
907
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
908
+ /** Epoch ms the environment expires (TTL), when known. */
909
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
910
+ }, undefined>, undefined>, undefined>;
911
+ /**
912
+ * Why no environment was auto-provisioned — set in degraded manual mode (no env provider
913
+ * wired, or provisioning errored) so the window can explain it and let the human test
914
+ * against the PR branch manually. Absent when an env was provisioned.
915
+ */
916
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
917
+ /** How many helper (fixer / conflict-resolver) attempts have been dispatched so far. */
918
+ readonly attempts: v.NumberSchema<undefined>;
919
+ /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
920
+ readonly maxAttempts: v.NumberSchema<undefined>;
921
+ /** The PR head commit being tested, when known. */
922
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
923
+ /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
924
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
925
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
926
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
927
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
928
+ readonly findings: v.StringSchema<undefined>;
929
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
930
+ readonly helperKind: v.StringSchema<undefined>;
931
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
932
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
933
+ /** How the helper ended once its job settled. Absent while still in flight. */
934
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
935
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
936
+ readonly at: v.NumberSchema<undefined>;
937
+ }, undefined>, undefined>, undefined>;
938
+ /**
939
+ * Transient action the human requested while the gate is parked — recorded on the parked
940
+ * step and consumed by the durable driver when it re-enters the gate (the analogue of
941
+ * `pendingIncorporation` on a requirements gate). Cleared once the driver acts on it.
942
+ */
943
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
944
+ readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
945
+ /** The findings prompt for a `request-fix` action. */
946
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
947
+ }, undefined>, undefined>, undefined>;
948
+ }, undefined>;
949
+ export type HumanTestStepState = v.InferOutput<typeof humanTestStepStateSchema>;
950
+ /**
951
+ * One actual-vs-reference pairing the visual-confirmation gate shows the human: a logical
952
+ * view, the screenshot the UI tester captured of it (`actualArtifactId`), and the reference
953
+ * design image for the same view when one was uploaded (`referenceArtifactId`). Either side
954
+ * may be absent (a captured view with no reference, or a reference whose view wasn't captured).
955
+ */
956
+ export declare const visualConfirmPairSchema: v.ObjectSchema<{
957
+ readonly view: v.StringSchema<undefined>;
958
+ readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
959
+ readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
960
+ }, undefined>;
961
+ export type VisualConfirmPair = v.InferOutput<typeof visualConfirmPairSchema>;
962
+ /** One human-requested fix round on a visual-confirmation gate (dispatches the `fixer`). */
963
+ export declare const visualConfirmRoundSchema: v.ObjectSchema<{
964
+ readonly findings: v.StringSchema<undefined>;
965
+ readonly helperKind: v.StringSchema<undefined>;
966
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
967
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
968
+ readonly at: v.NumberSchema<undefined>;
969
+ }, undefined>;
970
+ export type VisualConfirmRound = v.InferOutput<typeof visualConfirmRoundSchema>;
971
+ /**
972
+ * State a `visual-confirmation` gate carries while it runs. Like `human-test` there is no
973
+ * programmatic verdict — a HUMAN reviews the UI tester's screenshots against the uploaded
974
+ * reference designs and approves, or requests a fix (which dispatches the `fixer` and then
975
+ * re-captures via the UI tester). Phases:
976
+ * - `awaiting_human`— parked: the human reviews actual-vs-reference and approves / requests a fix.
977
+ * - `fixing` — a `fixer` job (from the human's findings) is in flight.
978
+ * - `approved` — the human approved; the run advances.
979
+ *
980
+ * (A dedicated `capturing` phase for an auto re-run of the UI tester after a fix is deferred
981
+ * until that loop is wired — see the visual-confirmation handover doc — so it is intentionally
982
+ * absent from the picklist rather than carried as dead state.)
983
+ */
984
+ export declare const visualConfirmStepStateSchema: v.ObjectSchema<{
985
+ readonly phase: v.PicklistSchema<["awaiting_human", "fixing", "approved"], undefined>;
986
+ /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
987
+ readonly pairs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
988
+ readonly view: v.StringSchema<undefined>;
989
+ readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
990
+ readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
991
+ }, undefined>, undefined>, undefined>;
992
+ /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
993
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
994
+ /** How many fixer attempts have been dispatched so far. */
995
+ readonly attempts: v.NumberSchema<undefined>;
996
+ /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
997
+ readonly maxAttempts: v.NumberSchema<undefined>;
998
+ /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
999
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1000
+ readonly findings: v.StringSchema<undefined>;
1001
+ readonly helperKind: v.StringSchema<undefined>;
1002
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1003
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
1004
+ readonly at: v.NumberSchema<undefined>;
1005
+ }, undefined>, undefined>, undefined>;
1006
+ /**
1007
+ * Transient action the human requested while parked — consumed by the durable driver
1008
+ * when it re-enters the gate. Cleared once acted on.
1009
+ */
1010
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1011
+ readonly type: v.PicklistSchema<["approve", "request-fix", "recapture"], undefined>;
1012
+ /** The findings prompt for a `request-fix` action. */
1013
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1014
+ }, undefined>, undefined>, undefined>;
1015
+ }, undefined>;
1016
+ export type VisualConfirmStepState = v.InferOutput<typeof visualConfirmStepStateSchema>;
1017
+ /**
1018
+ * Per-step LLM observability rollup: a compact aggregate over every model call the
1019
+ * step's container made, recorded by the LLM proxy and summed by the engine for the
1020
+ * board. It surfaces, at a glance, token usage, how close the step ran to its
1021
+ * output-token limit (truncation), the latency split between transport/proxy
1022
+ * overhead and actual model execution, and any errors/warnings. The full per-call
1023
+ * detail (prompts + responses) is fetched on demand for the drill-down panel.
1024
+ * Absent when the observability sink is not wired.
1025
+ */
1026
+ export declare const stepMetricsSchema: v.ObjectSchema<{
1027
+ /** Number of model calls recorded for this step. */
1028
+ readonly calls: v.NumberSchema<undefined>;
1029
+ /** Sum of prompt (input) tokens across the step's calls. */
1030
+ readonly promptTokens: v.NumberSchema<undefined>;
1031
+ /**
1032
+ * Sum of prompt tokens served from the provider's prefix cache. A subset of
1033
+ * promptTokens on OpenAI/DeepSeek, but on Anthropic cache reads are reported
1034
+ * separately from input tokens, so this can exceed promptTokens. 0 on a cache-less
1035
+ * flavour (Workers AI); the metrics bar shows the cached split when present. Absent ⇒
1036
+ * unknown (older snapshot).
1037
+ */
1038
+ readonly cachedPromptTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1039
+ /** Sum of completion (output) tokens across the step's calls. */
1040
+ readonly completionTokens: v.NumberSchema<undefined>;
1041
+ /** Largest single completion the model produced (closest approach to the limit). */
1042
+ readonly peakCompletionTokens: v.NumberSchema<undefined>;
1043
+ /** The output ceiling in effect (max requested `max_tokens`), or null when unknown. */
1044
+ readonly maxOutputTokens: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1045
+ /** Calls cut short by the output limit (`finish_reason === 'length'`). */
1046
+ readonly truncatedCalls: v.NumberSchema<undefined>;
1047
+ /** Sum of model execution time (ms) — the "actual prompt/tool execution" slice. */
1048
+ readonly upstreamMs: v.NumberSchema<undefined>;
1049
+ /** Sum of transport/proxy overhead (ms) — the interim-layer cost. */
1050
+ readonly overheadMs: v.NumberSchema<undefined>;
1051
+ /** Calls that failed (non-2xx / refused / in-process error). */
1052
+ readonly errors: v.NumberSchema<undefined>;
1053
+ /** Successful calls that warned (truncated or content-filtered). */
1054
+ readonly warnings: v.NumberSchema<undefined>;
1055
+ }, undefined>;
1056
+ export type StepMetrics = v.InferOutput<typeof stepMetricsSchema>;
1057
+ export declare const pipelineStepSchema: v.ObjectSchema<{
1058
+ /**
1059
+ * Id of the execution run (the {@link executionInstanceSchema} `id`) this step
1060
+ * belongs to — surfaced on every step so a lone step in a log line or a detail view
1061
+ * can name its run, for easier debugging. A projection that always equals the parent
1062
+ * instance's `id`: stamped from the enclosing instance when the run is read or
1063
+ * emitted, not persisted independently. Absent only on steps not yet round-tripped.
1064
+ */
1065
+ readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1066
+ readonly agentKind: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1067
+ readonly state: v.PicklistSchema<["pending", "working", "waiting_decision", "done"], undefined>;
1068
+ readonly progress: v.NumberSchema<undefined>;
1069
+ /** LLM observability rollup for this step; see {@link stepMetricsSchema}. */
1070
+ readonly metrics: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1071
+ /** Number of model calls recorded for this step. */
1072
+ readonly calls: v.NumberSchema<undefined>;
1073
+ /** Sum of prompt (input) tokens across the step's calls. */
1074
+ readonly promptTokens: v.NumberSchema<undefined>;
1075
+ /**
1076
+ * Sum of prompt tokens served from the provider's prefix cache. A subset of
1077
+ * promptTokens on OpenAI/DeepSeek, but on Anthropic cache reads are reported
1078
+ * separately from input tokens, so this can exceed promptTokens. 0 on a cache-less
1079
+ * flavour (Workers AI); the metrics bar shows the cached split when present. Absent ⇒
1080
+ * unknown (older snapshot).
1081
+ */
1082
+ readonly cachedPromptTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1083
+ /** Sum of completion (output) tokens across the step's calls. */
1084
+ readonly completionTokens: v.NumberSchema<undefined>;
1085
+ /** Largest single completion the model produced (closest approach to the limit). */
1086
+ readonly peakCompletionTokens: v.NumberSchema<undefined>;
1087
+ /** The output ceiling in effect (max requested `max_tokens`), or null when unknown. */
1088
+ readonly maxOutputTokens: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
1089
+ /** Calls cut short by the output limit (`finish_reason === 'length'`). */
1090
+ readonly truncatedCalls: v.NumberSchema<undefined>;
1091
+ /** Sum of model execution time (ms) — the "actual prompt/tool execution" slice. */
1092
+ readonly upstreamMs: v.NumberSchema<undefined>;
1093
+ /** Sum of transport/proxy overhead (ms) — the interim-layer cost. */
1094
+ readonly overheadMs: v.NumberSchema<undefined>;
1095
+ /** Calls that failed (non-2xx / refused / in-process error). */
1096
+ readonly errors: v.NumberSchema<undefined>;
1097
+ /** Successful calls that warned (truncated or content-filtered). */
1098
+ readonly warnings: v.NumberSchema<undefined>;
1099
+ }, undefined>, undefined>, undefined>;
1100
+ /**
1101
+ * Live gate state while a polling gate step (`ci` / `conflicts`) runs its
1102
+ * precheck-or-escalate loop; see {@link gateStepStateSchema}. The gate kind is
1103
+ * `agentKind`.
1104
+ */
1105
+ readonly gate: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1106
+ readonly phase: v.PicklistSchema<["checking", "working"], undefined>;
1107
+ /** How many helper-agent attempts have been dispatched so far. */
1108
+ readonly attempts: v.NumberSchema<undefined>;
1109
+ /** Ceiling on attempts, resolved from the task's merge preset at step start. */
1110
+ readonly maxAttempts: v.NumberSchema<undefined>;
1111
+ /** The PR head commit being gated, once resolved (the own-service PR on a multi-repo block). */
1112
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1113
+ /**
1114
+ * Per-PR head commits for a MULTI-REPO block (service-connections phase 4), keyed by repo
1115
+ * full name (owner/name) — own-service PR plus each peer-service PR. Set by the CI /
1116
+ * conflicts gates whose precheck aggregates across every PR the task opened. Absent for a
1117
+ * single-repo block (the scalar {@link headSha} is the only head).
1118
+ */
1119
+ readonly headShas: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>, undefined>;
1120
+ /**
1121
+ * The repo the conflicts gate's most recent `fail` verdict found conflicted, so the
1122
+ * single-repo conflict-resolver is dispatched at THAT repo (own-service or a peer) rather
1123
+ * than always the own-service one. Absent ⇒ the own-service repo. Only the conflicts gate
1124
+ * sets it (the CI-fixer runs across all repos, so the CI gate leaves it undefined).
1125
+ */
1126
+ readonly conflictTarget: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1127
+ readonly repo: v.StringSchema<undefined>;
1128
+ readonly frameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1129
+ readonly branch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1130
+ }, undefined>, undefined>, undefined>;
1131
+ /**
1132
+ * The most recent precheck verdict, so the UI can show why the gate is looping
1133
+ * (failing → a helper is fixing) vs idle-passing. Set on every probe.
1134
+ */
1135
+ readonly lastVerdict: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "pending", "fail"], undefined>, undefined>, undefined>;
1136
+ /**
1137
+ * Human-readable summary of the latest failing precheck (the failing CI checks /
1138
+ * the conflict reason) — the conclusion detail that used to be fed only to the
1139
+ * helper agent and then discarded. Carried across the helper dispatch so the
1140
+ * window keeps showing what is being fixed. Null when the last probe passed.
1141
+ */
1142
+ readonly lastFailureSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1143
+ /**
1144
+ * Structured failing checks behind {@link lastFailureSummary} for the CI gate, so
1145
+ * the UI can list each red check by name + conclusion. Absent for the conflicts
1146
+ * gate (GitHub reports no file-level detail) and when the last probe passed.
1147
+ */
1148
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1149
+ readonly name: v.StringSchema<undefined>;
1150
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
1151
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1152
+ /**
1153
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
1154
+ * failed run's logs. Null when GitHub didn't report one.
1155
+ */
1156
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1157
+ /**
1158
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
1159
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
1160
+ */
1161
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1162
+ }, undefined>, undefined>, undefined>, undefined>;
1163
+ /**
1164
+ * The fixing instructions handed to the most-recently dispatched helper (the failing-check
1165
+ * summary / conflict reason / human fix prompt), stashed at dispatch so the attempt recorded
1166
+ * when that helper's job settles can carry WHAT the round was asked to fix onto its
1167
+ * {@link gateAttemptSchema} entry. Transient bookkeeping — the durable per-round history lives
1168
+ * on {@link attemptLog}. Null when the gate hands its fixer no textual instructions.
1169
+ */
1170
+ readonly lastDispatchedInstructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1171
+ /**
1172
+ * Epoch ms of the release marker for a time-windowed gate (post-release-health) — the
1173
+ * moment it began watching the deployed release. The gate keeps polling `pending`
1174
+ * until this + the preset's watch window has elapsed (then a clean run passes) or a
1175
+ * monitor/SLO regresses (then it escalates to the on-call agent). Absent for the
1176
+ * CI/conflicts gates.
1177
+ */
1178
+ readonly watchSince: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1179
+ /**
1180
+ * The watch-window length (minutes) for a time-windowed gate (post-release-health),
1181
+ * resolved from the task's merge preset ONCE on first entry (alongside `maxAttempts`)
1182
+ * so the probe doesn't re-load the block + re-resolve the preset on every poll. Absent
1183
+ * for the CI/conflicts gates.
1184
+ */
1185
+ readonly watchWindowMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1186
+ /**
1187
+ * The regressed signals captured when the post-release-health gate escalated to the
1188
+ * on-call agent, so the agent's completion handler can build the `release_regression`
1189
+ * notification + incident enrichment from the SAME evidence the agent investigated
1190
+ * — rather than re-reading Datadog (a third round-trip that could also disagree with
1191
+ * what the agent saw if the window moved). Absent for the CI/conflicts gates.
1192
+ */
1193
+ readonly regressedSignals: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1194
+ readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
1195
+ readonly id: v.StringSchema<undefined>;
1196
+ readonly name: v.StringSchema<undefined>;
1197
+ readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
1198
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1199
+ }, undefined>, undefined>, undefined>, undefined>;
1200
+ /**
1201
+ * Append-only history of the helper-agent attempts this gate dispatched (ci-fixer /
1202
+ * conflict-resolver runs), each recorded when its job finished. Lets the UI show what
1203
+ * every attempt tried and how it ended, instead of only a bare `attempts` count.
1204
+ * Absent for the post-release-health gate (its on-call helper is resolved specially).
1205
+ */
1206
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1207
+ /** 1-based attempt number (matches `attempts` at the time the helper was dispatched). */
1208
+ readonly attempt: v.NumberSchema<undefined>;
1209
+ /** Epoch ms when the helper job finished. */
1210
+ readonly at: v.NumberSchema<undefined>;
1211
+ /**
1212
+ * How the helper job ended:
1213
+ * - `completed` — the container finished (it may or may not have fully fixed the
1214
+ * issue; the gate's next precheck is the source of truth, and `summary` carries
1215
+ * the agent's own account, e.g. which files it left conflicting).
1216
+ * - `failed` — the job errored / was evicted without finishing.
1217
+ */
1218
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
1219
+ /** The PR head commit the helper worked against, when known. */
1220
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1221
+ /**
1222
+ * The fixing instructions handed to the helper for this round — the failing-check
1223
+ * summary the CI gate fed the `ci-fixer`, the conflict reason / human-review comments
1224
+ * the other gates fed their fixer. Stashed at dispatch and recorded with the attempt so
1225
+ * the run-detail UI can show WHAT each round was asked to fix (not only that a round
1226
+ * happened) — the gate analogue of the Tester attempt's `concerns`. Null when the gate
1227
+ * hands its fixer no textual instructions (the conflicts gate: GitHub reports mergeability
1228
+ * as a single bit and the harness leaves the conflict markers for the resolver).
1229
+ */
1230
+ readonly instructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1231
+ /**
1232
+ * Structured failing checks handed to this attempt's helper (the CI gate's red check runs
1233
+ * behind {@link instructions}), snapshotted at dispatch so each attempt shows the checks it
1234
+ * set out to fix. Absent for the conflicts gate (no file-level detail) and when the round
1235
+ * carried no structured checks.
1236
+ */
1237
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1238
+ readonly name: v.StringSchema<undefined>;
1239
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
1240
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1241
+ /**
1242
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
1243
+ * failed run's logs. Null when GitHub didn't report one.
1244
+ */
1245
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1246
+ /**
1247
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
1248
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
1249
+ */
1250
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1251
+ }, undefined>, undefined>, undefined>, undefined>;
1252
+ /** The helper's own summary (or the failure reason), naming what it did / what remains. */
1253
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1254
+ }, undefined>, undefined>, undefined>, undefined>;
1255
+ /**
1256
+ * The number of approving reviews the PR had at the last probe, so the UI can show
1257
+ * "1 / N approvals". The "required" side is derived from {@link requiredApprovingReviewCount}
1258
+ * via the same `max(1, …)` floor the gate applies (see review.logic.ts) rather than persisted
1259
+ * a second time. Absent for the other gates.
1260
+ */
1261
+ readonly lastApprovals: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1262
+ /**
1263
+ * The raw branch-protection required-approving-review count, cached after the FIRST probe
1264
+ * resolves it so subsequent polls skip the static protection read (branch protection is repo
1265
+ * config, not PR activity — re-reading it every poll over a multi-day review only burns GitHub
1266
+ * rate budget). The UI's displayed "required" count is `max(1, this)` (the gate's effective
1267
+ * floor). Absent for the other gates.
1268
+ */
1269
+ readonly requiredApprovingReviewCount: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1270
+ /**
1271
+ * The GraphQL ids of the review threads the gate just handed the `fixer`, stashed at
1272
+ * dispatch so the helper-completion hook can post a reply + RESOLVE exactly those threads
1273
+ * on GitHub before the next probe reads them. Absent for the other gates.
1274
+ */
1275
+ readonly pendingThreadIds: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
1276
+ /**
1277
+ * Epoch ms of the newest plain PR comment the gate has already handed the `fixer`. Plain
1278
+ * conversation comments (unlike review threads) can't be "resolved" on GitHub, so they are
1279
+ * tracked by timestamp: a comment newer than this is outstanding; the dispatch advances it to
1280
+ * the batch max. A reviewer's later comment (newer timestamp) re-opens the work. Absent for
1281
+ * the other gates.
1282
+ */
1283
+ readonly lastAddressedCommentAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1284
+ /**
1285
+ * The grace window (minutes) the human-review gate waits after the latest review comment
1286
+ * before dispatching the fixer, resolved from the task's merge preset ONCE on first entry
1287
+ * (alongside `maxAttempts`) so the probe doesn't re-resolve the preset every poll. Absent
1288
+ * for the other gates.
1289
+ */
1290
+ readonly humanReviewGraceMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1291
+ /**
1292
+ * A human-initiated freeform fix request parked on the gate (an in-app prompt). Consumed at
1293
+ * the top of the next `evaluateGate` pass, which dispatches the fixer with these instructions
1294
+ * folded in — bypassing the grace window. Absent for the other gates.
1295
+ */
1296
+ readonly pendingFix: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1297
+ readonly instructions: v.StringSchema<undefined>;
1298
+ readonly at: v.NumberSchema<undefined>;
1299
+ }, undefined>, undefined>, undefined>;
1300
+ }, undefined>, undefined>, undefined>;
1301
+ /** Live Tester→Fixer loop state while a `tester` step runs/fixes; see {@link testerStepStateSchema}. */
1302
+ readonly test: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1303
+ readonly phase: v.PicklistSchema<["testing", "fixing"], undefined>;
1304
+ /** How many `fixer` attempts have been dispatched so far. */
1305
+ readonly attempts: v.NumberSchema<undefined>;
1306
+ /** Ceiling on fixer attempts, resolved from the task's merge preset at step start. */
1307
+ readonly maxAttempts: v.NumberSchema<undefined>;
1308
+ /** The most recent Tester report (what was tested, outcomes, concerns, greenlight). */
1309
+ readonly lastReport: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
1310
+ readonly greenlight: v.BooleanSchema<undefined>;
1311
+ readonly summary: v.StringSchema<undefined>;
1312
+ readonly tested: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1313
+ readonly outcomes: v.ArraySchema<v.ObjectSchema<{
1314
+ readonly name: v.StringSchema<undefined>;
1315
+ readonly status: v.PicklistSchema<["passed", "failed", "skipped"], undefined>;
1316
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1317
+ }, undefined>, undefined>;
1318
+ readonly concerns: v.ArraySchema<v.ObjectSchema<{
1319
+ readonly title: v.StringSchema<undefined>;
1320
+ readonly detail: v.StringSchema<undefined>;
1321
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
1322
+ }, undefined>, undefined>;
1323
+ readonly environment: v.OptionalSchema<v.PicklistSchema<["local", "ephemeral"], undefined>, undefined>;
1324
+ readonly screenshots: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1325
+ readonly view: v.StringSchema<undefined>;
1326
+ readonly artifactId: v.StringSchema<undefined>;
1327
+ readonly hash: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1328
+ readonly width: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1329
+ readonly height: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1330
+ readonly referenceArtifactId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1331
+ }, undefined>, undefined>, undefined>;
1332
+ readonly abort: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1333
+ readonly reason: v.StringSchema<undefined>;
1334
+ }, undefined>, undefined>, undefined>;
1335
+ }, undefined>, v.TransformAction<{
1336
+ greenlight: boolean;
1337
+ summary: string;
1338
+ tested: string[];
1339
+ outcomes: {
1340
+ name: string;
1341
+ status: "failed" | "passed" | "skipped";
1342
+ detail?: string | undefined;
1343
+ }[];
1344
+ concerns: {
1345
+ title: string;
1346
+ detail: string;
1347
+ severity: "critical" | "high" | "low" | "medium";
1348
+ }[];
1349
+ environment?: "ephemeral" | "local" | undefined;
1350
+ screenshots?: {
1351
+ view: string;
1352
+ artifactId: string;
1353
+ hash?: string | undefined;
1354
+ width?: number | undefined;
1355
+ height?: number | undefined;
1356
+ referenceArtifactId?: string | undefined;
1357
+ }[] | undefined;
1358
+ abort?: {
1359
+ reason: string;
1360
+ } | null | undefined;
1361
+ }, {
1362
+ greenlight: boolean;
1363
+ summary: string;
1364
+ tested: string[];
1365
+ outcomes: {
1366
+ name: string;
1367
+ status: "failed" | "passed" | "skipped";
1368
+ detail?: string | undefined;
1369
+ }[];
1370
+ concerns: {
1371
+ title: string;
1372
+ detail: string;
1373
+ severity: "critical" | "high" | "low" | "medium";
1374
+ }[];
1375
+ environment?: "ephemeral" | "local" | undefined;
1376
+ screenshots?: {
1377
+ view: string;
1378
+ artifactId: string;
1379
+ hash?: string | undefined;
1380
+ width?: number | undefined;
1381
+ height?: number | undefined;
1382
+ referenceArtifactId?: string | undefined;
1383
+ }[] | undefined;
1384
+ abort?: {
1385
+ reason: string;
1386
+ } | null | undefined;
1387
+ }>]>, undefined>, undefined>;
1388
+ /**
1389
+ * Append-only history of the `fixer` rounds this Tester step looped through, each recorded
1390
+ * when its job finished. Lets the test window surface an inspectable timeline of the fixer
1391
+ * attempts (what each addressed, how it ended) instead of only a bare `attempts` count.
1392
+ */
1393
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1394
+ /** 1-based fixer round (matches `attempts` after the fixer for this round was dispatched). */
1395
+ readonly attempt: v.NumberSchema<undefined>;
1396
+ /** Epoch ms when the fixer job finished. */
1397
+ readonly at: v.NumberSchema<undefined>;
1398
+ /** Whether the fixer container finished (`completed`) or errored/was evicted (`failed`). */
1399
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
1400
+ /** The fixer's own summary (or the failure reason), naming what it changed / what failed. */
1401
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1402
+ /**
1403
+ * The concerns the fixer was handed for this round (from the Tester report that withheld
1404
+ * its greenlight), so the window can show WHAT each round tried to address — not only that
1405
+ * a round happened.
1406
+ */
1407
+ readonly concerns: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1408
+ readonly title: v.StringSchema<undefined>;
1409
+ readonly detail: v.StringSchema<undefined>;
1410
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
1411
+ }, undefined>, undefined>, undefined>, undefined>;
1412
+ }, undefined>, undefined>, undefined>, undefined>;
1413
+ /**
1414
+ * The most recent in-container docker-compose dependency stand-up record (local-infra
1415
+ * tester): whether the dependencies came up and the captured (redacted, bounded)
1416
+ * `docker compose up` logs. Refreshed on each Tester round (it stands the infra up anew),
1417
+ * so the test window can surface WHY local infra failed to come up — the failure-class
1418
+ * artifact the orchestrator-side provisioning logs can't see. Absent for ephemeral /
1419
+ * no-infra runs. See {@link testerInfraSetupSchema}.
1420
+ */
1421
+ readonly infraSetup: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1422
+ readonly started: v.BooleanSchema<undefined>;
1423
+ readonly composePath: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1424
+ readonly at: v.NumberSchema<undefined>;
1425
+ readonly durationMs: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1426
+ readonly logs: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1427
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1428
+ }, undefined>, undefined>, undefined>;
1429
+ }, undefined>, undefined>, undefined>;
1430
+ /**
1431
+ * Live test quality-control companion state on a `tester-api`/`tester-ui` step, copied
1432
+ * from the pipeline's per-step `testerQuality` config at run start. Drives the QC loop that
1433
+ * gates each Tester report for completeness before the greenlight/fixer decision. Absent
1434
+ * for non-Tester steps / when the companion is disabled. See {@link testerQualityStepStateSchema}.
1435
+ */
1436
+ readonly testerQuality: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1437
+ /** Whether the QC companion is active on this Tester step (the builder toggle). */
1438
+ readonly enabled: v.BooleanSchema<undefined>;
1439
+ /** How many QC-driven Tester re-runs have been dispatched so far. */
1440
+ readonly attempts: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
1441
+ /** Ceiling on QC-driven re-runs, from the task's merge preset (`maxTesterQualityIterations`). */
1442
+ readonly maxAttempts: v.NumberSchema<undefined>;
1443
+ /** Optional estimate gating copied from the pipeline; evaluated against the block estimate. */
1444
+ readonly gating: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1445
+ readonly enabled: v.BooleanSchema<undefined>;
1446
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1447
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1448
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1449
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["run", "skip"], undefined>, "run">;
1450
+ }, undefined>, undefined>, undefined>;
1451
+ /** One verdict per QC evaluation, in order (newest last). Empty before the first grade. */
1452
+ readonly verdicts: v.ArraySchema<v.ObjectSchema<{
1453
+ /** Whether the report is complete/coherent enough to proceed (no QC re-run needed). */
1454
+ readonly adequate: v.BooleanSchema<undefined>;
1455
+ /** The QC's prose challenge / justification, folded into the Tester's re-run context. */
1456
+ readonly feedback: v.StringSchema<undefined>;
1457
+ /** Concrete coverage gaps the Tester must still address (empty when adequate). */
1458
+ readonly gaps: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1459
+ /** Epoch ms the verdict was produced. */
1460
+ readonly at: v.NumberSchema<undefined>;
1461
+ /** The model that produced the verdict, for transparency. */
1462
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1463
+ }, undefined>, undefined>;
1464
+ /** Set true once the QC budget was spent with the report still judged inadequate. */
1465
+ readonly exceeded: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1466
+ }, undefined>, undefined>, undefined>;
1467
+ /**
1468
+ * Live state of a `human-test` gate (ephemeral env + human validation loop); see
1469
+ * {@link humanTestStepStateSchema}. Absent for every other step kind.
1470
+ */
1471
+ readonly humanTest: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1472
+ readonly phase: v.PicklistSchema<["provisioning", "awaiting_human", "fixing", "resolving_conflicts", "passed"], undefined>;
1473
+ /** The live ephemeral environment (null in degraded manual mode / after destroy). */
1474
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1475
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
1476
+ readonly id: v.StringSchema<undefined>;
1477
+ /** The provisioned public URL the human tests against (null while still provisioning). */
1478
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1479
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
1480
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
1481
+ /** Epoch ms the environment expires (TTL), when known. */
1482
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1483
+ }, undefined>, undefined>, undefined>;
1484
+ /**
1485
+ * Why no environment was auto-provisioned — set in degraded manual mode (no env provider
1486
+ * wired, or provisioning errored) so the window can explain it and let the human test
1487
+ * against the PR branch manually. Absent when an env was provisioned.
1488
+ */
1489
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1490
+ /** How many helper (fixer / conflict-resolver) attempts have been dispatched so far. */
1491
+ readonly attempts: v.NumberSchema<undefined>;
1492
+ /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
1493
+ readonly maxAttempts: v.NumberSchema<undefined>;
1494
+ /** The PR head commit being tested, when known. */
1495
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1496
+ /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
1497
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1498
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
1499
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
1500
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
1501
+ readonly findings: v.StringSchema<undefined>;
1502
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
1503
+ readonly helperKind: v.StringSchema<undefined>;
1504
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
1505
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1506
+ /** How the helper ended once its job settled. Absent while still in flight. */
1507
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
1508
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
1509
+ readonly at: v.NumberSchema<undefined>;
1510
+ }, undefined>, undefined>, undefined>;
1511
+ /**
1512
+ * Transient action the human requested while the gate is parked — recorded on the parked
1513
+ * step and consumed by the durable driver when it re-enters the gate (the analogue of
1514
+ * `pendingIncorporation` on a requirements gate). Cleared once the driver acts on it.
1515
+ */
1516
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1517
+ readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
1518
+ /** The findings prompt for a `request-fix` action. */
1519
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1520
+ }, undefined>, undefined>, undefined>;
1521
+ }, undefined>, undefined>, undefined>;
1522
+ /**
1523
+ * Live state of a `visual-confirmation` gate (screenshot review + fix loop); see
1524
+ * {@link visualConfirmStepStateSchema}. Absent for every other step kind.
1525
+ */
1526
+ readonly visualConfirm: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1527
+ readonly phase: v.PicklistSchema<["awaiting_human", "fixing", "approved"], undefined>;
1528
+ /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
1529
+ readonly pairs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1530
+ readonly view: v.StringSchema<undefined>;
1531
+ readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1532
+ readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1533
+ }, undefined>, undefined>, undefined>;
1534
+ /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
1535
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1536
+ /** How many fixer attempts have been dispatched so far. */
1537
+ readonly attempts: v.NumberSchema<undefined>;
1538
+ /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
1539
+ readonly maxAttempts: v.NumberSchema<undefined>;
1540
+ /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
1541
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1542
+ readonly findings: v.StringSchema<undefined>;
1543
+ readonly helperKind: v.StringSchema<undefined>;
1544
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1545
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
1546
+ readonly at: v.NumberSchema<undefined>;
1547
+ }, undefined>, undefined>, undefined>;
1548
+ /**
1549
+ * Transient action the human requested while parked — consumed by the durable driver
1550
+ * when it re-enters the gate. Cleared once acted on.
1551
+ */
1552
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1553
+ readonly type: v.PicklistSchema<["approve", "request-fix", "recapture"], undefined>;
1554
+ /** The findings prompt for a `request-fix` action. */
1555
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1556
+ }, undefined>, undefined>, undefined>;
1557
+ }, undefined>, undefined>, undefined>;
1558
+ /**
1559
+ * The ephemeral environment this step runs against (when the block has one), so a
1560
+ * run's details can show its spinning-up / running / shut-down / errored state +
1561
+ * the exact error. Populated by the engine for container/deployer steps from the
1562
+ * block's live environment; see {@link runEnvironmentSchema}. The `human-test` gate
1563
+ * keeps its own richer `humanTest.environment` and is not double-populated here.
1564
+ */
1565
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1566
+ /** The `environments` row id (lets a window fetch access creds / re-poll status). */
1567
+ readonly id: v.StringSchema<undefined>;
1568
+ /** The provisioned public URL (null while still provisioning). */
1569
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1570
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
1571
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
1572
+ /** Epoch ms the environment expires (TTL), when known. */
1573
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1574
+ /** The verbatim provider error when the environment failed/expired, else null. */
1575
+ readonly lastError: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1576
+ /**
1577
+ * The service's declared provision type this environment was stood up for
1578
+ * (`kubernetes` | `docker-compose` | `custom` | `infraless`), recorded at provision
1579
+ * time so a run's details show exactly what was provisioned. Null for legacy rows /
1580
+ * pre-resolution.
1581
+ */
1582
+ readonly provisionType: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["kubernetes", "docker-compose", "custom", "infraless"], undefined>, undefined>, undefined>;
1583
+ /**
1584
+ * The resolved engine that handled the provisioning (`local-docker` | `local-k3s` |
1585
+ * `remote-kubernetes` | `remote-custom` | `none`), surfaced in run details alongside the
1586
+ * environment state. Null for legacy rows / pre-resolution.
1587
+ */
1588
+ readonly engine: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["local-docker", "local-k3s", "remote-kubernetes", "remote-custom", "none"], undefined>, undefined>, undefined>;
1589
+ }, undefined>, undefined>, undefined>;
1590
+ /** Live subtask counts while an async (container) step runs; see {@link stepSubtasksSchema}. */
1591
+ readonly subtasks: v.OptionalSchema<v.ObjectSchema<{
1592
+ readonly completed: v.NumberSchema<undefined>;
1593
+ readonly inProgress: v.NumberSchema<undefined>;
1594
+ readonly total: v.NumberSchema<undefined>;
1595
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1596
+ /** The task's human-readable subject, as the agent wrote it. */
1597
+ readonly label: v.StringSchema<undefined>;
1598
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
1599
+ }, undefined>, undefined>, undefined>;
1600
+ }, undefined>, undefined>;
1601
+ /**
1602
+ * The per-run container this async (container) step runs in — its lifecycle status
1603
+ * (starting / up / errored), the agent's current phase (clone / agent / push), and
1604
+ * the container's id + reachable URL once up. Lets a run's details surface what the
1605
+ * container is doing and where it lives, so the board shows an explicit "Spinning up
1606
+ * container…" → live-phase progression instead of a blank "working" state. Set the
1607
+ * moment the job is dispatched (the dispatch blocks until the container accepts the
1608
+ * job) and refined on each poll. Only ever set on async (container) steps; absent on
1609
+ * non-container steps and steps not yet dispatched. See {@link runContainerSchema}.
1610
+ */
1611
+ readonly container: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1612
+ /** The container lifecycle status; see {@link runContainerStatusSchema}. */
1613
+ readonly status: v.PicklistSchema<["starting", "up", "errored", "destroyed"], undefined>;
1614
+ /**
1615
+ * The coarse phase the agent's job is in while the container is `up` (`clone` →
1616
+ * `agent` → `push`, seeded `starting`), forwarded from the harness. Lets the details
1617
+ * distinguish "still preparing the checkout" from "the agent is making calls". Absent
1618
+ * until the first poll, or when the runner doesn't report a phase.
1619
+ */
1620
+ readonly phase: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1621
+ /** Provider container/runner id (Cloudflare DO id, docker container id), when known. */
1622
+ readonly id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1623
+ /** A reachable address for the running container (the local docker host URL), when one exists. */
1624
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1625
+ }, undefined>, undefined>, undefined>;
1626
+ /**
1627
+ * Whether web search was available to this container step, and which upstream backend
1628
+ * served it. Set at dispatch (a static per-run fact resolved from the account's
1629
+ * web-search keys, else the deployment default). Only ever set on async (container)
1630
+ * steps; absent on non-container steps and steps not yet dispatched. Distinct from the
1631
+ * telemetry-gated per-query log — this is always surfaced. See {@link webSearchAvailabilitySchema}.
1632
+ */
1633
+ readonly search: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1634
+ readonly available: v.BooleanSchema<undefined>;
1635
+ readonly provider: v.NullableSchema<v.PicklistSchema<["brave", "searxng"], undefined>, undefined>;
1636
+ }, undefined>, undefined>, undefined>;
1637
+ readonly decision: v.NullableSchema<v.ObjectSchema<{
1638
+ readonly id: v.StringSchema<undefined>;
1639
+ readonly question: v.StringSchema<undefined>;
1640
+ readonly options: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1641
+ readonly chosen: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1642
+ }, undefined>, undefined>;
1643
+ /**
1644
+ * Whether a human approval gate fires after this step completes. Copied from
1645
+ * the pipeline's `gates` at run start; absent means no gate.
1646
+ */
1647
+ readonly requiresApproval: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1648
+ /**
1649
+ * The live approval gate for this step (see {@link stepApprovalSchema}). Set
1650
+ * once the step's proposal is ready and `requiresApproval` is true; null/absent
1651
+ * otherwise.
1652
+ */
1653
+ readonly approval: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1654
+ /** Unique id of this gate; the durable run parks on it like a decision. */
1655
+ readonly id: v.StringSchema<undefined>;
1656
+ /** `pending` while awaiting the human; terminal `approved`/`rejected`; `changes_requested` re-runs the step. */
1657
+ readonly status: v.PicklistSchema<["pending", "approved", "changes_requested", "rejected"], undefined>;
1658
+ /** The agent's output the human is reviewing (editable before approval). */
1659
+ readonly proposal: v.StringSchema<undefined>;
1660
+ /** When changes were requested, the human's freeform guidance fed into the re-run. */
1661
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1662
+ /** When changes were requested, per-block review comments fed into the re-run. */
1663
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1664
+ /**
1665
+ * Verbatim raw-markdown source of the commented prose block. Optional: a comment
1666
+ * may instead anchor to a structured item via {@link anchorId}, where there is no
1667
+ * prose source to quote.
1668
+ */
1669
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1670
+ /**
1671
+ * 0-based source line range [start, end) of the commented prose block, for
1672
+ * best-effort re-anchoring. Optional: a comment may instead anchor to a structured
1673
+ * item via {@link anchorId} (e.g. a spec requirement/acceptance-criterion id), where
1674
+ * there is no prose line range.
1675
+ */
1676
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1677
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1678
+ /**
1679
+ * Stable id of the structured item the comment targets (e.g. a spec
1680
+ * requirement/criterion id), when the reviewed output is rendered as structured
1681
+ * items rather than free prose. Absent for prose-range comments.
1682
+ */
1683
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1684
+ /** The reviewer's note on this block / item. */
1685
+ readonly body: v.StringSchema<undefined>;
1686
+ }, undefined>, undefined>, undefined>;
1687
+ }, undefined>, undefined>, undefined>;
1688
+ /**
1689
+ * Live state of a companion step that reviews a preceding producer step. Set when
1690
+ * this step's `agentKind` is a companion kind. `threshold` is the quality bar the
1691
+ * companion's latest rating (the last `verdicts` entry) must reach; `attempts`
1692
+ * counts only the AUTOMATIC reworks performed, and once it reaches `maxAttempts` the
1693
+ * step parks on the iteration-cap gate (`exceeded`) for a human rather than failing.
1694
+ * A human "request changes" on the companion's gate also re-runs the producer but does
1695
+ * NOT consume `attempts` (only the automatic loop is budgeted). Absent for non-companion steps.
1696
+ */
1697
+ readonly companion: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1698
+ /** The quality bar (0..1) the latest verdict's rating must reach; seeded from the pipeline. */
1699
+ readonly threshold: v.NumberSchema<undefined>;
1700
+ /** The automatic rework budget: once `attempts` reaches this the gate parks for a human (`exceeded`). */
1701
+ readonly maxAttempts: v.NumberSchema<undefined>;
1702
+ /**
1703
+ * How many AUTOMATIC reworks the companion has driven so far (the producer is
1704
+ * looped back once per failed verdict). Human "request changes" cycles are not
1705
+ * counted. Defaults to 0; once it reaches `maxAttempts` the step parks on the
1706
+ * iteration-cap gate (`exceeded`) — an "extra round" raises `maxAttempts` by one.
1707
+ */
1708
+ readonly attempts: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
1709
+ /**
1710
+ * One standardized {@link companionVerdictSchema} per grading cycle, in order —
1711
+ * the full sequence of correction iterations (the producer is re-run after each
1712
+ * rejected verdict), including any human-driven ones. Empty before the first
1713
+ * grade; the last entry is the latest.
1714
+ */
1715
+ readonly verdicts: v.ArraySchema<v.ObjectSchema<{
1716
+ /** Overall quality of the graded output (0..1, higher = better). */
1717
+ readonly rating: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
1718
+ /** The quality bar the rating had to reach to pass. */
1719
+ readonly threshold: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
1720
+ /** Whether the rating met the threshold. */
1721
+ readonly passed: v.BooleanSchema<undefined>;
1722
+ /** The companion's challenge / justification (its assessment summary). */
1723
+ readonly feedback: v.StringSchema<undefined>;
1724
+ }, undefined>, undefined>;
1725
+ /**
1726
+ * Set true when the automatic rework budget (`maxAttempts`) was spent with the
1727
+ * rating still below the bar: instead of failing the run, the step parks on its
1728
+ * approval gate for a human to resolve via the shared iteration-cap surface
1729
+ * (one more round / proceed anyway / stop & reset). Cleared once the human grants
1730
+ * an extra round (the loop resumes). Absent until/unless the cap is hit.
1731
+ */
1732
+ readonly exceeded: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1733
+ }, undefined>, undefined>, undefined>;
1734
+ /**
1735
+ * Live Follow-up companion state while a `coder` step runs/parks: the items the Coder
1736
+ * streamed (loose ends / side-tasks / questions), whether the companion is enabled, and
1737
+ * the send-back loop budget. Items accrue live as the harness streams them (the blinking
1738
+ * companion); at the step's completion the engine parks the run while any item is
1739
+ * `pending`, then loops the Coder for any `queued` follow-up / `answered` question. See
1740
+ * {@link followUpsStepStateSchema}. Absent for non-`coder` steps / when the companion is off.
1741
+ */
1742
+ readonly followUps: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1743
+ readonly enabled: v.BooleanSchema<undefined>;
1744
+ readonly items: v.ArraySchema<v.ObjectSchema<{
1745
+ readonly id: v.StringSchema<undefined>;
1746
+ readonly kind: v.PicklistSchema<["follow_up", "question"], undefined>;
1747
+ readonly title: v.StringSchema<undefined>;
1748
+ readonly detail: v.StringSchema<undefined>;
1749
+ readonly suggestedAction: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1750
+ readonly status: v.PicklistSchema<["pending", "filed", "queued", "answered", "dismissed"], undefined>;
1751
+ readonly answer: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1752
+ readonly sentToCoder: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1753
+ readonly ticketExternalId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1754
+ readonly ticketUrl: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1755
+ readonly createdAt: v.NumberSchema<undefined>;
1756
+ readonly updatedAt: v.NumberSchema<undefined>;
1757
+ }, undefined>, undefined>;
1758
+ readonly loops: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
1759
+ readonly maxLoops: v.OptionalSchema<v.NumberSchema<undefined>, 3>;
1760
+ }, undefined>, undefined>, undefined>;
1761
+ /**
1762
+ * Live implementation-fork decision state while a `coder` step runs its optional
1763
+ * two-phase flow: the proposer explore job (`proposing`), the human park
1764
+ * (`awaiting_choice` / `answering`), the resolved choice (`chosen`), or one of the
1765
+ * pass-through terminals (`single_path` / `skipped`). Created lazily by the engine
1766
+ * when the phase activates — the config lives on the block + the risk policy, never
1767
+ * on the step. Absent for non-`coder` steps / when the phase never activated. See
1768
+ * {@link forkDecisionStepStateSchema}.
1769
+ */
1770
+ readonly forkDecision: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1771
+ readonly status: v.PicklistSchema<["proposing", "awaiting_choice", "answering", "chosen", "single_path", "skipped"], undefined>;
1772
+ readonly seamSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1773
+ readonly forks: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1774
+ readonly id: v.StringSchema<undefined>;
1775
+ readonly title: v.StringSchema<undefined>;
1776
+ readonly summary: v.StringSchema<undefined>;
1777
+ readonly approach: v.StringSchema<undefined>;
1778
+ readonly tradeoffs: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1779
+ readonly riskNotes: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1780
+ readonly recommended: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1781
+ }, undefined>, undefined>, readonly []>;
1782
+ readonly singlePathReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1783
+ readonly chat: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1784
+ readonly id: v.StringSchema<undefined>;
1785
+ readonly role: v.PicklistSchema<["human", "assistant"], undefined>;
1786
+ readonly text: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
1787
+ readonly createdAt: v.NumberSchema<undefined>;
1788
+ }, undefined>, undefined>, readonly []>;
1789
+ readonly maxChatTurns: v.OptionalSchema<v.NumberSchema<undefined>, 15>;
1790
+ readonly chosen: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
1791
+ readonly forkId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1792
+ readonly custom: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1793
+ readonly note: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1794
+ readonly at: v.NumberSchema<undefined>;
1795
+ }, undefined>, v.CheckAction<{
1796
+ forkId?: string | null | undefined;
1797
+ custom?: string | null | undefined;
1798
+ note?: string | null | undefined;
1799
+ at: number;
1800
+ }, "Provide exactly one of forkId or custom.">]>, undefined>, undefined>;
1801
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1802
+ }, undefined>, undefined>, undefined>;
1803
+ /**
1804
+ * Live "Ralph loop" state carried on a `ralph` step: the persistent retry-until-done
1805
+ * loop's iteration count, budget, validation command, and per-iteration history. Seeded
1806
+ * from the block's per-task agent config at step start, then advanced each iteration by
1807
+ * the engine's `RalphController`. Because it rides the run's persisted `detail` blob, both
1808
+ * durable drivers + both stale-run sweepers re-drive a mid-loop run from exactly this
1809
+ * state after a restart. Absent for non-`ralph` steps. See {@link ralphStepStateSchema}.
1810
+ */
1811
+ readonly ralph: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1812
+ readonly phase: v.PicklistSchema<["iterating"], undefined>;
1813
+ readonly attempts: v.NumberSchema<undefined>;
1814
+ readonly maxIterations: v.NumberSchema<undefined>;
1815
+ readonly validationCommand: v.StringSchema<undefined>;
1816
+ readonly progressPath: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1817
+ readonly lastExitCode: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1818
+ readonly lastValidationTail: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1819
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1820
+ readonly attempt: v.NumberSchema<undefined>;
1821
+ readonly at: v.NumberSchema<undefined>;
1822
+ readonly validationPassed: v.BooleanSchema<undefined>;
1823
+ readonly exitCode: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1824
+ readonly outputTail: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1825
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1826
+ }, undefined>, undefined>, undefined>, undefined>;
1827
+ }, undefined>, undefined>, undefined>;
1828
+ /**
1829
+ * Transient re-entry marker carried on a parked `coder` step whose fork decision is
1830
+ * `answering`: set when the human sends a chat message so the run is signalled to
1831
+ * wake and the durable driver, on re-entering, runs the inline chat LLM and appends
1832
+ * the assistant reply (the LLM work that must not block the HTTP request). Cleared
1833
+ * once that async cycle completes. Documented beside `pendingIncorporation` /
1834
+ * `pendingInterview`. Absent when no chat turn is pending.
1835
+ */
1836
+ readonly pendingForkChat: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1837
+ readonly messageId: v.StringSchema<undefined>;
1838
+ }, undefined>, undefined>, undefined>;
1839
+ /**
1840
+ * Live PR deep-review state carried on a `pr-reviewer` step: the sliced, severity-ordered
1841
+ * findings the read-only reviewer produced, the human's curated selection, and how it was
1842
+ * resolved. Recorded by the engine when the reviewer container job completes; the run then
1843
+ * parks (`awaiting_selection`) for the human to select findings through the dedicated
1844
+ * window and resolve. Absent for non-`pr-reviewer` steps. See {@link prReviewStepStateSchema}.
1845
+ */
1846
+ readonly prReview: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1847
+ readonly status: v.PicklistSchema<["reviewing", "awaiting_selection", "fixing", "posting", "done", "skipped"], undefined>;
1848
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1849
+ readonly slices: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1850
+ readonly id: v.StringSchema<undefined>;
1851
+ readonly title: v.StringSchema<undefined>;
1852
+ readonly rationale: v.StringSchema<undefined>;
1853
+ readonly paths: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1854
+ }, undefined>, undefined>, readonly []>;
1855
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1856
+ readonly id: v.StringSchema<undefined>;
1857
+ readonly sliceId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1858
+ readonly path: v.StringSchema<undefined>;
1859
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1860
+ readonly side: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["LEFT", "RIGHT"], undefined>, undefined>, undefined>;
1861
+ readonly severity: v.PicklistSchema<["blocker", "high", "medium", "low", "nit"], undefined>;
1862
+ readonly category: v.PicklistSchema<["correctness", "security", "performance", "maintainability", "style", "test", "other"], undefined>;
1863
+ readonly title: v.StringSchema<undefined>;
1864
+ readonly detail: v.StringSchema<undefined>;
1865
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1866
+ }, undefined>, undefined>, readonly []>;
1867
+ readonly selectedFindingIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
1868
+ readonly resolution: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["finish", "fix", "post"], undefined>, undefined>, undefined>;
1869
+ readonly prUrl: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1870
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1871
+ }, undefined>, undefined>, undefined>;
1872
+ /**
1873
+ * The at-most-once driver marker for the PR-review "post" resolution: set when the human
1874
+ * resolves a parked review with `post`, so the durable driver — on re-entry, off the HTTP
1875
+ * request — publishes the selected findings as inline PR review comments (via
1876
+ * `RepoFiles.createReview`) exactly once. Consumed (cleared + persisted) BEFORE the posting
1877
+ * side effect so a Workflows retry/replay can't post the review twice. Cleared once posted.
1878
+ */
1879
+ readonly pendingPrReviewPost: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
1880
+ /**
1881
+ * Transient rework feedback carried on a PRODUCER step while it is being re-run by
1882
+ * a downstream companion (the analogue of an approval's `changes_requested`
1883
+ * feedback for the automatic path). Folded into the agent's revision context on the
1884
+ * re-run, then cleared. Absent when no companion rework is in flight.
1885
+ */
1886
+ readonly rework: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1887
+ /** The producer's previous proposal the companion challenged. */
1888
+ readonly previousProposal: v.StringSchema<undefined>;
1889
+ /** The companion's prose feedback driving the rework. */
1890
+ readonly feedback: v.StringSchema<undefined>;
1891
+ /** Optional per-item / per-block challenges to address. */
1892
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1893
+ /**
1894
+ * Verbatim raw-markdown source of the commented prose block. Optional: a comment
1895
+ * may instead anchor to a structured item via {@link anchorId}, where there is no
1896
+ * prose source to quote.
1897
+ */
1898
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1899
+ /**
1900
+ * 0-based source line range [start, end) of the commented prose block, for
1901
+ * best-effort re-anchoring. Optional: a comment may instead anchor to a structured
1902
+ * item via {@link anchorId} (e.g. a spec requirement/acceptance-criterion id), where
1903
+ * there is no prose line range.
1904
+ */
1905
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1906
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1907
+ /**
1908
+ * Stable id of the structured item the comment targets (e.g. a spec
1909
+ * requirement/criterion id), when the reviewed output is rendered as structured
1910
+ * items rather than free prose. Absent for prose-range comments.
1911
+ */
1912
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1913
+ /** The reviewer's note on this block / item. */
1914
+ readonly body: v.StringSchema<undefined>;
1915
+ }, undefined>, undefined>, undefined>;
1916
+ }, undefined>, undefined>, undefined>;
1917
+ /**
1918
+ * Transient incorporation intent carried on a parked `requirements-review` gate step.
1919
+ * Set when the human answers the findings and asks to incorporate: the run is signalled
1920
+ * to wake and the durable driver, on re-entering the gate, folds the answers into a
1921
+ * document and re-reviews it (the LLM work that used to block the HTTP request). Cleared
1922
+ * once that async cycle completes. `feedback` is the human's optional "do it differently"
1923
+ * direction (a redo). Absent when no incorporation is pending.
1924
+ */
1925
+ readonly pendingIncorporation: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1926
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1927
+ }, undefined>, undefined>, undefined>;
1928
+ /**
1929
+ * Transient recommendation intent carried on a parked `requirements-review` gate step.
1930
+ * Set when the human asks the Requirement Writer to suggest answers for a batch of findings
1931
+ * (or re-requests one): the run is signalled to wake and the durable driver, on re-entering
1932
+ * the gate, runs the Writer per finding — filling in the `pending` placeholder
1933
+ * recommendations — then re-parks (recommendations never advance the run). Cleared once that
1934
+ * async batch completes. `itemIds` are the findings to recommend for; `note` steers the
1935
+ * whole batch. Absent when no recommendation batch is pending.
1936
+ */
1937
+ readonly pendingRecommendation: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1938
+ readonly itemIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1939
+ readonly note: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1940
+ }, undefined>, undefined>, undefined>;
1941
+ /**
1942
+ * Transient interview intent carried on a parked `initiative-interviewer` gate step. Set
1943
+ * when the human has answered the planning questions and asked to continue (or proceed):
1944
+ * the run is signalled to wake and the durable driver, on re-entering the gate, runs the
1945
+ * interviewer LLM again against the answers — asking follow-ups (re-park) or synthesizing
1946
+ * the goal/constraints brief and advancing. `proceed` skips any remaining questions.
1947
+ * Cleared once that async re-entry completes. Absent when no continuation is pending.
1948
+ */
1949
+ readonly pendingInterview: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1950
+ readonly proceed: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1951
+ }, undefined>, undefined>, undefined>;
1952
+ /**
1953
+ * Consensus configuration for this step, copied from the pipeline's `consensus`
1954
+ * array at run start. Present (with `enabled: true`) when this step should run
1955
+ * through the multi-model consensus mechanism; read by the consensus executor
1956
+ * (and to decide gating against the block estimate). Absent ⇒ standard agent.
1957
+ * See {@link consensusStepConfigSchema}.
1958
+ */
1959
+ readonly consensus: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1960
+ readonly enabled: v.BooleanSchema<undefined>;
1961
+ readonly strategy: v.PicklistSchema<["specialist-panel", "debate", "ranked-voting"], undefined>;
1962
+ readonly participants: v.ArraySchema<v.ObjectSchema<{
1963
+ readonly id: v.StringSchema<undefined>;
1964
+ readonly role: v.StringSchema<undefined>;
1965
+ readonly systemFraming: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1966
+ readonly modelId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1967
+ }, undefined>, undefined>;
1968
+ readonly synthesizerModelId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1969
+ readonly rounds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 5, undefined>]>, undefined>;
1970
+ readonly gating: v.OptionalSchema<v.ObjectSchema<{
1971
+ readonly enabled: v.BooleanSchema<undefined>;
1972
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1973
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1974
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1975
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["consensus", "standard"], undefined>, "consensus">;
1976
+ }, undefined>, undefined>;
1977
+ }, undefined>, undefined>, undefined>;
1978
+ /**
1979
+ * Estimate-based gating for this step, copied from the pipeline's `gating` array at
1980
+ * run start. When present (with `enabled: true`) the step is skipped at runtime unless
1981
+ * the block's task estimate meets the threshold. Absent ⇒ always run. See
1982
+ * {@link stepGatingSchema}.
1983
+ */
1984
+ readonly gating: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1985
+ readonly enabled: v.BooleanSchema<undefined>;
1986
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1987
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1988
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
1989
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["run", "skip"], undefined>, "run">;
1990
+ }, undefined>, undefined>, undefined>;
1991
+ /**
1992
+ * Per-step options bag copied from the pipeline's `stepOptions` array at run start (see
1993
+ * {@link stepOptionsSchema}). Absent ⇒ all defaults for this step. Read by the engine —
1994
+ * e.g. the requirements-review gate consults `stepOptions.autoRecommend`.
1995
+ */
1996
+ readonly stepOptions: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1997
+ readonly autoRecommend: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1998
+ readonly skillId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1999
+ }, undefined>, undefined>, undefined>;
2000
+ /**
2001
+ * True when this step was skipped at runtime because its `gating` was not satisfied
2002
+ * (the task estimate fell below the threshold). The step's `state` is `done` with no
2003
+ * output; the UI renders it as "skipped (gated)". Absent ⇒ the step ran normally.
2004
+ */
2005
+ readonly skipped: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2006
+ /**
2007
+ * Set `true` on a `spec-writer` step that determined the task is purely technical and
2008
+ * produced no business specs (its result's `noBusinessSpecs`). Recorded on the step so
2009
+ * the spec-companion's convergence — the one point both signals coexist — can combine it
2010
+ * with the companion's `technicalCorroborated` verdict to infer the block's `technical`
2011
+ * label. Absent for every other kind / a writer that produced specs.
2012
+ */
2013
+ readonly noBusinessSpecs: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2014
+ /**
2015
+ * Set on a `spec-companion` step from its `technicalCorroborated` verdict (whether it
2016
+ * agreed the task is purely technical). Recorded on the step — not just read off the
2017
+ * live assessment — so the engine can infer the block's `technical` label both on the
2018
+ * companion's automatic convergence AND on a human "proceed" past the iteration cap,
2019
+ * where only the persisted step survives. Absent for every other kind / no opinion.
2020
+ */
2021
+ readonly technicalCorroborated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2022
+ /** Text the agent produced for this step (when LLM execution is enabled). */
2023
+ readonly output: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2024
+ /**
2025
+ * The structured JSON a registered CUSTOM kind's agent step returned (the generic
2026
+ * manifest-driven `agent` dispatch's `custom` channel). Recorded so the SPA can render
2027
+ * it in the `generic-structured` result view (and a post-op already consumed it
2028
+ * server-side). Absent for built-in / prose kinds.
2029
+ */
2030
+ readonly custom: v.OptionalSchema<v.UnknownSchema, undefined>;
2031
+ /** Identifier of the model that produced `output`, for transparency. */
2032
+ readonly model: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2033
+ /**
2034
+ * Ids of the prompt-fragment library entries that were folded into this step's
2035
+ * system prompt — the manual selection on the block unioned with the relevance
2036
+ * selector's pick. Recorded for observability and replay-stability; absent when
2037
+ * the fragment-library module is not configured.
2038
+ */
2039
+ readonly selectedFragmentIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
2040
+ /**
2041
+ * The repo-sourced Claude Skill this step was PINNED to at dispatch (a `skill` step; see
2042
+ * `docs/initiatives/repo-skills.md`). Recorded so a run executes a stable version of the
2043
+ * skill even if its source resyncs mid-run, and so a later investigation knows exactly
2044
+ * which skill (and at which commit / manifest blob) ran. `commit` is the source dir's head
2045
+ * commit the resources were fetched at (null if the skill was never synced to a commit);
2046
+ * `sha` is the `SKILL.md` blob sha. Absent for every non-`skill` step.
2047
+ */
2048
+ readonly skillVersion: v.OptionalSchema<v.ObjectSchema<{
2049
+ readonly skillId: v.StringSchema<undefined>;
2050
+ readonly commit: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2051
+ readonly sha: v.StringSchema<undefined>;
2052
+ }, undefined>, undefined>;
2053
+ /**
2054
+ * Identifier of an in-flight asynchronous agent job (a container run polled by
2055
+ * the durable driver). Set while the step is dispatched-but-not-yet-finished so
2056
+ * a Workflows replay re-attaches to the running job instead of starting a new
2057
+ * one; cleared once the job's result is recorded.
2058
+ */
2059
+ readonly jobId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2060
+ /**
2061
+ * Epoch ms the step first began executing (transitioned to `working`). Set once
2062
+ * and never overwritten on subsequent state changes, so a re-run/replay keeps the
2063
+ * original start. Absent until the step starts.
2064
+ */
2065
+ readonly startedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2066
+ /**
2067
+ * Epoch ms the step finished (transitioned to `done`). With {@link startedAt}
2068
+ * this yields the step's execution duration. Absent until the step completes.
2069
+ */
2070
+ readonly finishedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2071
+ /**
2072
+ * Epoch ms the step parked on a human (an approval gate, a raised decision, or an
2073
+ * iteration-cap gate), freezing its duration clock: while parked, elapsed time stops
2074
+ * accruing — the symmetric counterpart of {@link finishedAt}'s terminal freeze, so a
2075
+ * step waiting on input is not billed for the human's deliberation. Set once on park,
2076
+ * cleared (null) when the step resumes working or finishes. Absent until first parked.
2077
+ */
2078
+ readonly pausedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2079
+ /**
2080
+ * How many times this step's container was evicted/crashed and recovered by
2081
+ * automatically re-dispatching a fresh container (bounded by
2082
+ * `MAX_EVICTION_RECOVERIES`). Once spent, a further eviction fails the run as
2083
+ * `evicted` rather than looping. Absent/0 until the first eviction.
2084
+ */
2085
+ readonly evictionRecoveries: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
2086
+ /**
2087
+ * How many times this step's container was evicted by *transient infrastructure
2088
+ * churn* — an event the runtime facade flags as not-a-crash (e.g. a deploy
2089
+ * draining the sandbox) — and recovered by re-dispatching a fresh container.
2090
+ * Counted separately from {@link evictionRecoveries} and bounded by a larger
2091
+ * `MAX_TRANSIENT_EVICTION_RECOVERIES`, since such churn can recur several times in
2092
+ * a short window, unlike a crash. Absent/0 until the first transient eviction.
2093
+ */
2094
+ readonly transientEvictionRecoveries: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
2095
+ /**
2096
+ * The service-provisioning config a `deployer` step PINNED when it dispatched its async,
2097
+ * container-backed deploy job, so the later poll/finalize maps the job against the same config
2098
+ * the container was built from — NOT a fresh read of the service frame (which a person may have
2099
+ * edited mid-flight, e.g. flipping it to `infraless`, which would otherwise fail a deploy whose
2100
+ * container already succeeded). Absent for the synchronous raw-manifest path and the undeclared
2101
+ * legacy single-connection path (re-resolution is harmless there). See {@link serviceProvisioningSchema}.
2102
+ */
2103
+ readonly deployProvisioning: v.OptionalSchema<v.ObjectSchema<{
2104
+ readonly type: v.PicklistSchema<["kubernetes", "docker-compose", "custom", "infraless"], undefined>;
2105
+ readonly manifestSource: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
2106
+ readonly type: v.LiteralSchema<"colocated", undefined>;
2107
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2108
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
2109
+ }, undefined>, v.ObjectSchema<{
2110
+ readonly type: v.LiteralSchema<"separate", undefined>;
2111
+ readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
2112
+ readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
2113
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2114
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
2115
+ }, undefined>], undefined>, undefined>;
2116
+ readonly composePath: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2117
+ readonly localDevOnly: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2118
+ readonly composeBuild: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2119
+ readonly recipe: v.OptionalSchema<v.ObjectSchema<{
2120
+ readonly composeFiles: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>, undefined>;
2121
+ readonly composeProfiles: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
2122
+ readonly envFiles: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2123
+ readonly template: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2124
+ readonly target: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2125
+ }, undefined>, undefined>, undefined>;
2126
+ readonly externalNetworks: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
2127
+ readonly sharedStackRefs: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
2128
+ readonly prerequisites: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2129
+ readonly check: v.PicklistSchema<["docker-daemon", "disk-space", "memory", "registry-auth", "tcp-reachable", "http-reachable", "mkcert-ca", "hosts-entries", "env-secrets-marker"], undefined>;
2130
+ readonly params: v.OptionalSchema<v.ObjectSchema<{
2131
+ readonly minGib: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1024, undefined>]>, undefined>;
2132
+ readonly registry: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2133
+ readonly host: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2134
+ readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
2135
+ readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
2136
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
2137
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2138
+ readonly hostnames: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, undefined>;
2139
+ readonly file: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2140
+ readonly marker: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2141
+ }, undefined>, undefined>;
2142
+ readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2143
+ readonly remediation: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>, undefined>;
2144
+ readonly label: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2145
+ }, undefined>, undefined>, undefined>;
2146
+ readonly setupSteps: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"kind", [v.ObjectSchema<{
2147
+ readonly kind: v.LiteralSchema<"compose-exec", undefined>;
2148
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2149
+ readonly service: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
2150
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
2151
+ readonly stdinFile: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2152
+ readonly user: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
2153
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2154
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2155
+ }, undefined>, v.ObjectSchema<{
2156
+ readonly kind: v.LiteralSchema<"copy-file", undefined>;
2157
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2158
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2159
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2160
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2161
+ }, undefined>, v.ObjectSchema<{
2162
+ readonly kind: v.LiteralSchema<"wait-http", undefined>;
2163
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2164
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2165
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
2166
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2167
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2168
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2169
+ }, undefined>, v.ObjectSchema<{
2170
+ readonly kind: v.LiteralSchema<"wait-file", undefined>;
2171
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2172
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2173
+ readonly service: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
2174
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2175
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2176
+ }, undefined>, v.ObjectSchema<{
2177
+ readonly kind: v.LiteralSchema<"host-command", undefined>;
2178
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2179
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
2180
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2181
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2182
+ }, undefined>], undefined>, undefined>, undefined>;
2183
+ readonly healthGate: v.OptionalSchema<v.VariantSchema<"kind", [v.ObjectSchema<{
2184
+ readonly kind: v.LiteralSchema<"compose-healthy", undefined>;
2185
+ }, undefined>, v.ObjectSchema<{
2186
+ readonly kind: v.LiteralSchema<"http", undefined>;
2187
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2188
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
2189
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2190
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2191
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2192
+ }, undefined>, v.ObjectSchema<{
2193
+ readonly kind: v.LiteralSchema<"compose-exec", undefined>;
2194
+ readonly service: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
2195
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
2196
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2197
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2198
+ }, undefined>], undefined>, undefined>;
2199
+ readonly teardownSteps: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"kind", [v.ObjectSchema<{
2200
+ readonly kind: v.LiteralSchema<"compose-exec", undefined>;
2201
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2202
+ readonly service: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
2203
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
2204
+ readonly stdinFile: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2205
+ readonly user: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
2206
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2207
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2208
+ }, undefined>, v.ObjectSchema<{
2209
+ readonly kind: v.LiteralSchema<"copy-file", undefined>;
2210
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2211
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2212
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2213
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2214
+ }, undefined>, v.ObjectSchema<{
2215
+ readonly kind: v.LiteralSchema<"wait-http", undefined>;
2216
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2217
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
2218
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
2219
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2220
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2221
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2222
+ }, undefined>, v.ObjectSchema<{
2223
+ readonly kind: v.LiteralSchema<"wait-file", undefined>;
2224
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2225
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2226
+ readonly service: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
2227
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
2228
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2229
+ }, undefined>, v.ObjectSchema<{
2230
+ readonly kind: v.LiteralSchema<"host-command", undefined>;
2231
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
2232
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
2233
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2234
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
2235
+ }, undefined>], undefined>, undefined>, undefined>;
2236
+ }, undefined>, undefined>;
2237
+ readonly manifestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
2238
+ readonly manifestPath: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2239
+ readonly images: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
2240
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2241
+ readonly newNameTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2242
+ readonly newTagTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2243
+ readonly digestTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2244
+ }, undefined>, v.CheckAction<{
2245
+ name: string;
2246
+ newNameTemplate?: string | undefined;
2247
+ newTagTemplate?: string | undefined;
2248
+ digestTemplate?: string | undefined;
2249
+ }, "an image override must set at least one of newNameTemplate, newTagTemplate, or digestTemplate.">, v.CheckAction<{
2250
+ name: string;
2251
+ newNameTemplate?: string | undefined;
2252
+ newTagTemplate?: string | undefined;
2253
+ digestTemplate?: string | undefined;
2254
+ }, "newTagTemplate and digestTemplate are mutually exclusive on an image override.">]>, undefined>, undefined>;
2255
+ readonly helmReleases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2256
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2257
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2258
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
2259
+ readonly version: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "version must be a pinned semver (e.g. 1.2.3), not a floating tag like latest or ^1.0.">]>;
2260
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
2261
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
2262
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2263
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2264
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
2265
+ }, undefined>, undefined>, undefined>;
2266
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2267
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2268
+ readonly secretRef: v.ObjectSchema<{
2269
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2270
+ }, undefined>;
2271
+ }, undefined>, undefined>, undefined>;
2272
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
2273
+ }, undefined>, undefined>, undefined>;
2274
+ readonly secretInjections: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"mode", [v.ObjectSchema<{
2275
+ readonly mode: v.LiteralSchema<"secret", undefined>;
2276
+ readonly secretName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2277
+ readonly secretType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
2278
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
2279
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
2280
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
2281
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2282
+ }, undefined>, undefined>;
2283
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
2284
+ }, undefined>, v.CheckAction<{
2285
+ key: string;
2286
+ secretRef?: {
2287
+ key: string;
2288
+ } | undefined;
2289
+ valueTemplate?: string | undefined;
2290
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
2291
+ }, undefined>, v.ObjectSchema<{
2292
+ readonly mode: v.LiteralSchema<"generatorEnvFile", undefined>;
2293
+ readonly envFilePath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
2294
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
2295
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
2296
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
2297
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
2298
+ }, undefined>, undefined>;
2299
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
2300
+ }, undefined>, v.CheckAction<{
2301
+ key: string;
2302
+ secretRef?: {
2303
+ key: string;
2304
+ } | undefined;
2305
+ valueTemplate?: string | undefined;
2306
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
2307
+ }, undefined>], undefined>, undefined>, undefined>;
2308
+ }, undefined>, undefined>;
2309
+ /**
2310
+ * A `deployer` step fanning out over several service frames (the task's own frame + each
2311
+ * involved-service frame; see the connections initiative) records each frame's TERMINAL
2312
+ * outcome here, keyed by frame block id — so a durable replay knows which frames are already
2313
+ * provisioned and only the remaining ones are dispatched. The in-flight frame is tracked by
2314
+ * {@link deployFrameId} + {@link jobId} until it settles into this map. Absent for a
2315
+ * single-frame deploy that never fanned out. See {@link deployEnvsSchema}.
2316
+ */
2317
+ readonly deployEnvs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
2318
+ readonly status: v.PicklistSchema<["ready", "failed", "skipped"], undefined>;
2319
+ /** The provisioned URL for a `ready` env (absent for `failed`/`skipped`). */
2320
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2321
+ /** The verbatim provider error for a `failed` env. */
2322
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2323
+ }, undefined>, undefined>, undefined>;
2324
+ /**
2325
+ * The service FRAME the deployer step's currently in-flight deploy job ({@link jobId}) is
2326
+ * provisioning, during a multi-env fan-out — so the poll/finalize maps the settled job onto the
2327
+ * right frame's {@link deployEnvs} entry. Cleared once that frame settles; absent when no deploy
2328
+ * job is in flight or the step never fanned out.
2329
+ */
2330
+ readonly deployFrameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2331
+ /**
2332
+ * The task's OWN (primary) service frame, pinned on the FIRST target resolution of a `deployer`
2333
+ * fan-out and reused on every re-entry/replay. Keeps the primary classification STABLE against a
2334
+ * mid-flight reparent (which would otherwise re-derive a different own frame and flip an
2335
+ * own-service provisioning failure from terminal to a non-terminal peer failure — completing the
2336
+ * run `done` despite a failed deploy). Absent until the first resolution / for a step that never
2337
+ * fanned out.
2338
+ */
2339
+ readonly deployPrimaryFrameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2340
+ }, undefined>;
2341
+ export type PipelineStep = v.InferOutput<typeof pipelineStepSchema>;
2342
+ export declare const executionStatusSchema: v.PicklistSchema<["running", "blocked", "done", "paused", "failed"], undefined>;
2343
+ export type ExecutionStatus = v.InferOutput<typeof executionStatusSchema>;
2344
+ /**
2345
+ * Per-run diagnostic context captured for AFTER-THE-FACT investigation of a run (esp. a
2346
+ * failure) — the "where/what did this run actually execute on" facts that were previously
2347
+ * spread across the DB (repo↔service↔installation joins), the harness transcript (model), or
2348
+ * lost entirely (which backend a step ran on). Stamped by the engine at dispatch and refined
2349
+ * on the first poll; it reflects the MOST RECENT container-step dispatch (the step most likely
2350
+ * relevant to a failure), not a per-step history. Rides in the run's `detail` JSON (no dedicated
2351
+ * column), like {@link ExecutionInstance.notes}/`frontendBindings`. Absent on legacy runs and on
2352
+ * runs with no container step (pure inline/gate pipelines). NEVER carries a token or secret.
2353
+ */
2354
+ export declare const runDiagnosticsSchema: v.ObjectSchema<{
2355
+ /** Context of the most recent container-step dispatch. */
2356
+ readonly lastDispatch: v.OptionalSchema<v.ObjectSchema<{
2357
+ /** Index of the dispatched step within the pipeline. */
2358
+ readonly stepIndex: v.NumberSchema<undefined>;
2359
+ /** The step's agent kind (`coder`, `merger`, a custom kind, …). */
2360
+ readonly agentKind: v.StringSchema<undefined>;
2361
+ /** Resolved model ref `provider:model` (e.g. `anthropic:claude-opus-4-8`); null if unresolved. */
2362
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2363
+ /**
2364
+ * Which runner backend the step actually ran on — the datum that distinguishes a native
2365
+ * host-process run from a sandboxed container: `local-native` | `local-container` |
2366
+ * `runner-pool` | `cloudflare-container`. Filled on the first poll (the transport reports
2367
+ * it); absent until then or on an older runtime.
2368
+ */
2369
+ readonly executionBackend: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2370
+ /** The repo the step operated on. */
2371
+ readonly repo: v.OptionalSchema<v.ObjectSchema<{
2372
+ readonly owner: v.StringSchema<undefined>;
2373
+ readonly name: v.StringSchema<undefined>;
2374
+ /** The base branch the work branched from. */
2375
+ readonly baseBranch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2376
+ /** VCS provider (`github` | `gitlab`), resolved from the run's repo origin. */
2377
+ readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2378
+ }, undefined>, undefined>;
2379
+ /** Epoch ms the dispatch was recorded. */
2380
+ readonly at: v.NumberSchema<undefined>;
2381
+ }, undefined>, undefined>;
2382
+ /**
2383
+ * The control-plane (orchestrator) host running the engine — NOT necessarily where the agent
2384
+ * ran (a container step runs elsewhere; see `lastDispatch.executionBackend`). `platform` is the
2385
+ * orchestrator's `process.platform` (e.g. `win32` pins a Windows local deployment — the class
2386
+ * of host that surfaced the native-Windows git-auth break). Best-effort.
2387
+ */
2388
+ readonly host: v.OptionalSchema<v.ObjectSchema<{
2389
+ readonly platform: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2390
+ }, undefined>, undefined>;
2391
+ }, undefined>;
2392
+ export type RunDiagnostics = v.InferOutput<typeof runDiagnosticsSchema>;
2393
+ export declare const executionInstanceSchema: v.ObjectSchema<{
2394
+ readonly id: v.StringSchema<undefined>;
2395
+ readonly blockId: v.StringSchema<undefined>;
2396
+ readonly pipelineId: v.StringSchema<undefined>;
2397
+ readonly pipelineName: v.StringSchema<undefined>;
2398
+ readonly steps: v.ArraySchema<v.ObjectSchema<{
2399
+ /**
2400
+ * Id of the execution run (the {@link executionInstanceSchema} `id`) this step
2401
+ * belongs to — surfaced on every step so a lone step in a log line or a detail view
2402
+ * can name its run, for easier debugging. A projection that always equals the parent
2403
+ * instance's `id`: stamped from the enclosing instance when the run is read or
2404
+ * emitted, not persisted independently. Absent only on steps not yet round-tripped.
2405
+ */
2406
+ readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2407
+ readonly agentKind: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2408
+ readonly state: v.PicklistSchema<["pending", "working", "waiting_decision", "done"], undefined>;
2409
+ readonly progress: v.NumberSchema<undefined>;
2410
+ /** LLM observability rollup for this step; see {@link stepMetricsSchema}. */
2411
+ readonly metrics: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2412
+ /** Number of model calls recorded for this step. */
2413
+ readonly calls: v.NumberSchema<undefined>;
2414
+ /** Sum of prompt (input) tokens across the step's calls. */
2415
+ readonly promptTokens: v.NumberSchema<undefined>;
2416
+ /**
2417
+ * Sum of prompt tokens served from the provider's prefix cache. A subset of
2418
+ * promptTokens on OpenAI/DeepSeek, but on Anthropic cache reads are reported
2419
+ * separately from input tokens, so this can exceed promptTokens. 0 on a cache-less
2420
+ * flavour (Workers AI); the metrics bar shows the cached split when present. Absent ⇒
2421
+ * unknown (older snapshot).
2422
+ */
2423
+ readonly cachedPromptTokens: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
2424
+ /** Sum of completion (output) tokens across the step's calls. */
2425
+ readonly completionTokens: v.NumberSchema<undefined>;
2426
+ /** Largest single completion the model produced (closest approach to the limit). */
2427
+ readonly peakCompletionTokens: v.NumberSchema<undefined>;
2428
+ /** The output ceiling in effect (max requested `max_tokens`), or null when unknown. */
2429
+ readonly maxOutputTokens: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
2430
+ /** Calls cut short by the output limit (`finish_reason === 'length'`). */
2431
+ readonly truncatedCalls: v.NumberSchema<undefined>;
2432
+ /** Sum of model execution time (ms) — the "actual prompt/tool execution" slice. */
2433
+ readonly upstreamMs: v.NumberSchema<undefined>;
2434
+ /** Sum of transport/proxy overhead (ms) — the interim-layer cost. */
2435
+ readonly overheadMs: v.NumberSchema<undefined>;
2436
+ /** Calls that failed (non-2xx / refused / in-process error). */
2437
+ readonly errors: v.NumberSchema<undefined>;
2438
+ /** Successful calls that warned (truncated or content-filtered). */
2439
+ readonly warnings: v.NumberSchema<undefined>;
2440
+ }, undefined>, undefined>, undefined>;
2441
+ /**
2442
+ * Live gate state while a polling gate step (`ci` / `conflicts`) runs its
2443
+ * precheck-or-escalate loop; see {@link gateStepStateSchema}. The gate kind is
2444
+ * `agentKind`.
2445
+ */
2446
+ readonly gate: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2447
+ readonly phase: v.PicklistSchema<["checking", "working"], undefined>;
2448
+ /** How many helper-agent attempts have been dispatched so far. */
2449
+ readonly attempts: v.NumberSchema<undefined>;
2450
+ /** Ceiling on attempts, resolved from the task's merge preset at step start. */
2451
+ readonly maxAttempts: v.NumberSchema<undefined>;
2452
+ /** The PR head commit being gated, once resolved (the own-service PR on a multi-repo block). */
2453
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2454
+ /**
2455
+ * Per-PR head commits for a MULTI-REPO block (service-connections phase 4), keyed by repo
2456
+ * full name (owner/name) — own-service PR plus each peer-service PR. Set by the CI /
2457
+ * conflicts gates whose precheck aggregates across every PR the task opened. Absent for a
2458
+ * single-repo block (the scalar {@link headSha} is the only head).
2459
+ */
2460
+ readonly headShas: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>, undefined>;
2461
+ /**
2462
+ * The repo the conflicts gate's most recent `fail` verdict found conflicted, so the
2463
+ * single-repo conflict-resolver is dispatched at THAT repo (own-service or a peer) rather
2464
+ * than always the own-service one. Absent ⇒ the own-service repo. Only the conflicts gate
2465
+ * sets it (the CI-fixer runs across all repos, so the CI gate leaves it undefined).
2466
+ */
2467
+ readonly conflictTarget: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2468
+ readonly repo: v.StringSchema<undefined>;
2469
+ readonly frameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2470
+ readonly branch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2471
+ }, undefined>, undefined>, undefined>;
2472
+ /**
2473
+ * The most recent precheck verdict, so the UI can show why the gate is looping
2474
+ * (failing → a helper is fixing) vs idle-passing. Set on every probe.
2475
+ */
2476
+ readonly lastVerdict: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "pending", "fail"], undefined>, undefined>, undefined>;
2477
+ /**
2478
+ * Human-readable summary of the latest failing precheck (the failing CI checks /
2479
+ * the conflict reason) — the conclusion detail that used to be fed only to the
2480
+ * helper agent and then discarded. Carried across the helper dispatch so the
2481
+ * window keeps showing what is being fixed. Null when the last probe passed.
2482
+ */
2483
+ readonly lastFailureSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2484
+ /**
2485
+ * Structured failing checks behind {@link lastFailureSummary} for the CI gate, so
2486
+ * the UI can list each red check by name + conclusion. Absent for the conflicts
2487
+ * gate (GitHub reports no file-level detail) and when the last probe passed.
2488
+ */
2489
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2490
+ readonly name: v.StringSchema<undefined>;
2491
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
2492
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2493
+ /**
2494
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
2495
+ * failed run's logs. Null when GitHub didn't report one.
2496
+ */
2497
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2498
+ /**
2499
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
2500
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
2501
+ */
2502
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2503
+ }, undefined>, undefined>, undefined>, undefined>;
2504
+ /**
2505
+ * The fixing instructions handed to the most-recently dispatched helper (the failing-check
2506
+ * summary / conflict reason / human fix prompt), stashed at dispatch so the attempt recorded
2507
+ * when that helper's job settles can carry WHAT the round was asked to fix onto its
2508
+ * {@link gateAttemptSchema} entry. Transient bookkeeping — the durable per-round history lives
2509
+ * on {@link attemptLog}. Null when the gate hands its fixer no textual instructions.
2510
+ */
2511
+ readonly lastDispatchedInstructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2512
+ /**
2513
+ * Epoch ms of the release marker for a time-windowed gate (post-release-health) — the
2514
+ * moment it began watching the deployed release. The gate keeps polling `pending`
2515
+ * until this + the preset's watch window has elapsed (then a clean run passes) or a
2516
+ * monitor/SLO regresses (then it escalates to the on-call agent). Absent for the
2517
+ * CI/conflicts gates.
2518
+ */
2519
+ readonly watchSince: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2520
+ /**
2521
+ * The watch-window length (minutes) for a time-windowed gate (post-release-health),
2522
+ * resolved from the task's merge preset ONCE on first entry (alongside `maxAttempts`)
2523
+ * so the probe doesn't re-load the block + re-resolve the preset on every poll. Absent
2524
+ * for the CI/conflicts gates.
2525
+ */
2526
+ readonly watchWindowMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2527
+ /**
2528
+ * The regressed signals captured when the post-release-health gate escalated to the
2529
+ * on-call agent, so the agent's completion handler can build the `release_regression`
2530
+ * notification + incident enrichment from the SAME evidence the agent investigated
2531
+ * — rather than re-reading Datadog (a third round-trip that could also disagree with
2532
+ * what the agent saw if the window moved). Absent for the CI/conflicts gates.
2533
+ */
2534
+ readonly regressedSignals: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2535
+ readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
2536
+ readonly id: v.StringSchema<undefined>;
2537
+ readonly name: v.StringSchema<undefined>;
2538
+ readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
2539
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2540
+ }, undefined>, undefined>, undefined>, undefined>;
2541
+ /**
2542
+ * Append-only history of the helper-agent attempts this gate dispatched (ci-fixer /
2543
+ * conflict-resolver runs), each recorded when its job finished. Lets the UI show what
2544
+ * every attempt tried and how it ended, instead of only a bare `attempts` count.
2545
+ * Absent for the post-release-health gate (its on-call helper is resolved specially).
2546
+ */
2547
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2548
+ /** 1-based attempt number (matches `attempts` at the time the helper was dispatched). */
2549
+ readonly attempt: v.NumberSchema<undefined>;
2550
+ /** Epoch ms when the helper job finished. */
2551
+ readonly at: v.NumberSchema<undefined>;
2552
+ /**
2553
+ * How the helper job ended:
2554
+ * - `completed` — the container finished (it may or may not have fully fixed the
2555
+ * issue; the gate's next precheck is the source of truth, and `summary` carries
2556
+ * the agent's own account, e.g. which files it left conflicting).
2557
+ * - `failed` — the job errored / was evicted without finishing.
2558
+ */
2559
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
2560
+ /** The PR head commit the helper worked against, when known. */
2561
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2562
+ /**
2563
+ * The fixing instructions handed to the helper for this round — the failing-check
2564
+ * summary the CI gate fed the `ci-fixer`, the conflict reason / human-review comments
2565
+ * the other gates fed their fixer. Stashed at dispatch and recorded with the attempt so
2566
+ * the run-detail UI can show WHAT each round was asked to fix (not only that a round
2567
+ * happened) — the gate analogue of the Tester attempt's `concerns`. Null when the gate
2568
+ * hands its fixer no textual instructions (the conflicts gate: GitHub reports mergeability
2569
+ * as a single bit and the harness leaves the conflict markers for the resolver).
2570
+ */
2571
+ readonly instructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2572
+ /**
2573
+ * Structured failing checks handed to this attempt's helper (the CI gate's red check runs
2574
+ * behind {@link instructions}), snapshotted at dispatch so each attempt shows the checks it
2575
+ * set out to fix. Absent for the conflicts gate (no file-level detail) and when the round
2576
+ * carried no structured checks.
2577
+ */
2578
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2579
+ readonly name: v.StringSchema<undefined>;
2580
+ /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
2581
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2582
+ /**
2583
+ * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
2584
+ * failed run's logs. Null when GitHub didn't report one.
2585
+ */
2586
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2587
+ /**
2588
+ * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
2589
+ * failing checks by service. Absent on a single-repo block (there is only the own repo).
2590
+ */
2591
+ readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2592
+ }, undefined>, undefined>, undefined>, undefined>;
2593
+ /** The helper's own summary (or the failure reason), naming what it did / what remains. */
2594
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2595
+ }, undefined>, undefined>, undefined>, undefined>;
2596
+ /**
2597
+ * The number of approving reviews the PR had at the last probe, so the UI can show
2598
+ * "1 / N approvals". The "required" side is derived from {@link requiredApprovingReviewCount}
2599
+ * via the same `max(1, …)` floor the gate applies (see review.logic.ts) rather than persisted
2600
+ * a second time. Absent for the other gates.
2601
+ */
2602
+ readonly lastApprovals: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2603
+ /**
2604
+ * The raw branch-protection required-approving-review count, cached after the FIRST probe
2605
+ * resolves it so subsequent polls skip the static protection read (branch protection is repo
2606
+ * config, not PR activity — re-reading it every poll over a multi-day review only burns GitHub
2607
+ * rate budget). The UI's displayed "required" count is `max(1, this)` (the gate's effective
2608
+ * floor). Absent for the other gates.
2609
+ */
2610
+ readonly requiredApprovingReviewCount: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2611
+ /**
2612
+ * The GraphQL ids of the review threads the gate just handed the `fixer`, stashed at
2613
+ * dispatch so the helper-completion hook can post a reply + RESOLVE exactly those threads
2614
+ * on GitHub before the next probe reads them. Absent for the other gates.
2615
+ */
2616
+ readonly pendingThreadIds: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
2617
+ /**
2618
+ * Epoch ms of the newest plain PR comment the gate has already handed the `fixer`. Plain
2619
+ * conversation comments (unlike review threads) can't be "resolved" on GitHub, so they are
2620
+ * tracked by timestamp: a comment newer than this is outstanding; the dispatch advances it to
2621
+ * the batch max. A reviewer's later comment (newer timestamp) re-opens the work. Absent for
2622
+ * the other gates.
2623
+ */
2624
+ readonly lastAddressedCommentAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2625
+ /**
2626
+ * The grace window (minutes) the human-review gate waits after the latest review comment
2627
+ * before dispatching the fixer, resolved from the task's merge preset ONCE on first entry
2628
+ * (alongside `maxAttempts`) so the probe doesn't re-resolve the preset every poll. Absent
2629
+ * for the other gates.
2630
+ */
2631
+ readonly humanReviewGraceMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2632
+ /**
2633
+ * A human-initiated freeform fix request parked on the gate (an in-app prompt). Consumed at
2634
+ * the top of the next `evaluateGate` pass, which dispatches the fixer with these instructions
2635
+ * folded in — bypassing the grace window. Absent for the other gates.
2636
+ */
2637
+ readonly pendingFix: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2638
+ readonly instructions: v.StringSchema<undefined>;
2639
+ readonly at: v.NumberSchema<undefined>;
2640
+ }, undefined>, undefined>, undefined>;
2641
+ }, undefined>, undefined>, undefined>;
2642
+ /** Live Tester→Fixer loop state while a `tester` step runs/fixes; see {@link testerStepStateSchema}. */
2643
+ readonly test: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2644
+ readonly phase: v.PicklistSchema<["testing", "fixing"], undefined>;
2645
+ /** How many `fixer` attempts have been dispatched so far. */
2646
+ readonly attempts: v.NumberSchema<undefined>;
2647
+ /** Ceiling on fixer attempts, resolved from the task's merge preset at step start. */
2648
+ readonly maxAttempts: v.NumberSchema<undefined>;
2649
+ /** The most recent Tester report (what was tested, outcomes, concerns, greenlight). */
2650
+ readonly lastReport: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
2651
+ readonly greenlight: v.BooleanSchema<undefined>;
2652
+ readonly summary: v.StringSchema<undefined>;
2653
+ readonly tested: v.ArraySchema<v.StringSchema<undefined>, undefined>;
2654
+ readonly outcomes: v.ArraySchema<v.ObjectSchema<{
2655
+ readonly name: v.StringSchema<undefined>;
2656
+ readonly status: v.PicklistSchema<["passed", "failed", "skipped"], undefined>;
2657
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2658
+ }, undefined>, undefined>;
2659
+ readonly concerns: v.ArraySchema<v.ObjectSchema<{
2660
+ readonly title: v.StringSchema<undefined>;
2661
+ readonly detail: v.StringSchema<undefined>;
2662
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
2663
+ }, undefined>, undefined>;
2664
+ readonly environment: v.OptionalSchema<v.PicklistSchema<["local", "ephemeral"], undefined>, undefined>;
2665
+ readonly screenshots: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2666
+ readonly view: v.StringSchema<undefined>;
2667
+ readonly artifactId: v.StringSchema<undefined>;
2668
+ readonly hash: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2669
+ readonly width: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
2670
+ readonly height: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
2671
+ readonly referenceArtifactId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2672
+ }, undefined>, undefined>, undefined>;
2673
+ readonly abort: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2674
+ readonly reason: v.StringSchema<undefined>;
2675
+ }, undefined>, undefined>, undefined>;
2676
+ }, undefined>, v.TransformAction<{
2677
+ greenlight: boolean;
2678
+ summary: string;
2679
+ tested: string[];
2680
+ outcomes: {
2681
+ name: string;
2682
+ status: "failed" | "passed" | "skipped";
2683
+ detail?: string | undefined;
2684
+ }[];
2685
+ concerns: {
2686
+ title: string;
2687
+ detail: string;
2688
+ severity: "critical" | "high" | "low" | "medium";
2689
+ }[];
2690
+ environment?: "ephemeral" | "local" | undefined;
2691
+ screenshots?: {
2692
+ view: string;
2693
+ artifactId: string;
2694
+ hash?: string | undefined;
2695
+ width?: number | undefined;
2696
+ height?: number | undefined;
2697
+ referenceArtifactId?: string | undefined;
2698
+ }[] | undefined;
2699
+ abort?: {
2700
+ reason: string;
2701
+ } | null | undefined;
2702
+ }, {
2703
+ greenlight: boolean;
2704
+ summary: string;
2705
+ tested: string[];
2706
+ outcomes: {
2707
+ name: string;
2708
+ status: "failed" | "passed" | "skipped";
2709
+ detail?: string | undefined;
2710
+ }[];
2711
+ concerns: {
2712
+ title: string;
2713
+ detail: string;
2714
+ severity: "critical" | "high" | "low" | "medium";
2715
+ }[];
2716
+ environment?: "ephemeral" | "local" | undefined;
2717
+ screenshots?: {
2718
+ view: string;
2719
+ artifactId: string;
2720
+ hash?: string | undefined;
2721
+ width?: number | undefined;
2722
+ height?: number | undefined;
2723
+ referenceArtifactId?: string | undefined;
2724
+ }[] | undefined;
2725
+ abort?: {
2726
+ reason: string;
2727
+ } | null | undefined;
2728
+ }>]>, undefined>, undefined>;
2729
+ /**
2730
+ * Append-only history of the `fixer` rounds this Tester step looped through, each recorded
2731
+ * when its job finished. Lets the test window surface an inspectable timeline of the fixer
2732
+ * attempts (what each addressed, how it ended) instead of only a bare `attempts` count.
2733
+ */
2734
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2735
+ /** 1-based fixer round (matches `attempts` after the fixer for this round was dispatched). */
2736
+ readonly attempt: v.NumberSchema<undefined>;
2737
+ /** Epoch ms when the fixer job finished. */
2738
+ readonly at: v.NumberSchema<undefined>;
2739
+ /** Whether the fixer container finished (`completed`) or errored/was evicted (`failed`). */
2740
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
2741
+ /** The fixer's own summary (or the failure reason), naming what it changed / what failed. */
2742
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2743
+ /**
2744
+ * The concerns the fixer was handed for this round (from the Tester report that withheld
2745
+ * its greenlight), so the window can show WHAT each round tried to address — not only that
2746
+ * a round happened.
2747
+ */
2748
+ readonly concerns: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2749
+ readonly title: v.StringSchema<undefined>;
2750
+ readonly detail: v.StringSchema<undefined>;
2751
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
2752
+ }, undefined>, undefined>, undefined>, undefined>;
2753
+ }, undefined>, undefined>, undefined>, undefined>;
2754
+ /**
2755
+ * The most recent in-container docker-compose dependency stand-up record (local-infra
2756
+ * tester): whether the dependencies came up and the captured (redacted, bounded)
2757
+ * `docker compose up` logs. Refreshed on each Tester round (it stands the infra up anew),
2758
+ * so the test window can surface WHY local infra failed to come up — the failure-class
2759
+ * artifact the orchestrator-side provisioning logs can't see. Absent for ephemeral /
2760
+ * no-infra runs. See {@link testerInfraSetupSchema}.
2761
+ */
2762
+ readonly infraSetup: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2763
+ readonly started: v.BooleanSchema<undefined>;
2764
+ readonly composePath: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2765
+ readonly at: v.NumberSchema<undefined>;
2766
+ readonly durationMs: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2767
+ readonly logs: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2768
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2769
+ }, undefined>, undefined>, undefined>;
2770
+ }, undefined>, undefined>, undefined>;
2771
+ /**
2772
+ * Live test quality-control companion state on a `tester-api`/`tester-ui` step, copied
2773
+ * from the pipeline's per-step `testerQuality` config at run start. Drives the QC loop that
2774
+ * gates each Tester report for completeness before the greenlight/fixer decision. Absent
2775
+ * for non-Tester steps / when the companion is disabled. See {@link testerQualityStepStateSchema}.
2776
+ */
2777
+ readonly testerQuality: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2778
+ /** Whether the QC companion is active on this Tester step (the builder toggle). */
2779
+ readonly enabled: v.BooleanSchema<undefined>;
2780
+ /** How many QC-driven Tester re-runs have been dispatched so far. */
2781
+ readonly attempts: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
2782
+ /** Ceiling on QC-driven re-runs, from the task's merge preset (`maxTesterQualityIterations`). */
2783
+ readonly maxAttempts: v.NumberSchema<undefined>;
2784
+ /** Optional estimate gating copied from the pipeline; evaluated against the block estimate. */
2785
+ readonly gating: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2786
+ readonly enabled: v.BooleanSchema<undefined>;
2787
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
2788
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
2789
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
2790
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["run", "skip"], undefined>, "run">;
2791
+ }, undefined>, undefined>, undefined>;
2792
+ /** One verdict per QC evaluation, in order (newest last). Empty before the first grade. */
2793
+ readonly verdicts: v.ArraySchema<v.ObjectSchema<{
2794
+ /** Whether the report is complete/coherent enough to proceed (no QC re-run needed). */
2795
+ readonly adequate: v.BooleanSchema<undefined>;
2796
+ /** The QC's prose challenge / justification, folded into the Tester's re-run context. */
2797
+ readonly feedback: v.StringSchema<undefined>;
2798
+ /** Concrete coverage gaps the Tester must still address (empty when adequate). */
2799
+ readonly gaps: v.ArraySchema<v.StringSchema<undefined>, undefined>;
2800
+ /** Epoch ms the verdict was produced. */
2801
+ readonly at: v.NumberSchema<undefined>;
2802
+ /** The model that produced the verdict, for transparency. */
2803
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2804
+ }, undefined>, undefined>;
2805
+ /** Set true once the QC budget was spent with the report still judged inadequate. */
2806
+ readonly exceeded: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2807
+ }, undefined>, undefined>, undefined>;
2808
+ /**
2809
+ * Live state of a `human-test` gate (ephemeral env + human validation loop); see
2810
+ * {@link humanTestStepStateSchema}. Absent for every other step kind.
2811
+ */
2812
+ readonly humanTest: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2813
+ readonly phase: v.PicklistSchema<["provisioning", "awaiting_human", "fixing", "resolving_conflicts", "passed"], undefined>;
2814
+ /** The live ephemeral environment (null in degraded manual mode / after destroy). */
2815
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2816
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
2817
+ readonly id: v.StringSchema<undefined>;
2818
+ /** The provisioned public URL the human tests against (null while still provisioning). */
2819
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2820
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
2821
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
2822
+ /** Epoch ms the environment expires (TTL), when known. */
2823
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2824
+ }, undefined>, undefined>, undefined>;
2825
+ /**
2826
+ * Why no environment was auto-provisioned — set in degraded manual mode (no env provider
2827
+ * wired, or provisioning errored) so the window can explain it and let the human test
2828
+ * against the PR branch manually. Absent when an env was provisioned.
2829
+ */
2830
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2831
+ /** How many helper (fixer / conflict-resolver) attempts have been dispatched so far. */
2832
+ readonly attempts: v.NumberSchema<undefined>;
2833
+ /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
2834
+ readonly maxAttempts: v.NumberSchema<undefined>;
2835
+ /** The PR head commit being tested, when known. */
2836
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2837
+ /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
2838
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2839
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
2840
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
2841
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
2842
+ readonly findings: v.StringSchema<undefined>;
2843
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
2844
+ readonly helperKind: v.StringSchema<undefined>;
2845
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
2846
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2847
+ /** How the helper ended once its job settled. Absent while still in flight. */
2848
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
2849
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
2850
+ readonly at: v.NumberSchema<undefined>;
2851
+ }, undefined>, undefined>, undefined>;
2852
+ /**
2853
+ * Transient action the human requested while the gate is parked — recorded on the parked
2854
+ * step and consumed by the durable driver when it re-enters the gate (the analogue of
2855
+ * `pendingIncorporation` on a requirements gate). Cleared once the driver acts on it.
2856
+ */
2857
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2858
+ readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
2859
+ /** The findings prompt for a `request-fix` action. */
2860
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2861
+ }, undefined>, undefined>, undefined>;
2862
+ }, undefined>, undefined>, undefined>;
2863
+ /**
2864
+ * Live state of a `visual-confirmation` gate (screenshot review + fix loop); see
2865
+ * {@link visualConfirmStepStateSchema}. Absent for every other step kind.
2866
+ */
2867
+ readonly visualConfirm: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2868
+ readonly phase: v.PicklistSchema<["awaiting_human", "fixing", "approved"], undefined>;
2869
+ /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
2870
+ readonly pairs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2871
+ readonly view: v.StringSchema<undefined>;
2872
+ readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2873
+ readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2874
+ }, undefined>, undefined>, undefined>;
2875
+ /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
2876
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2877
+ /** How many fixer attempts have been dispatched so far. */
2878
+ readonly attempts: v.NumberSchema<undefined>;
2879
+ /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
2880
+ readonly maxAttempts: v.NumberSchema<undefined>;
2881
+ /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
2882
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2883
+ readonly findings: v.StringSchema<undefined>;
2884
+ readonly helperKind: v.StringSchema<undefined>;
2885
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2886
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
2887
+ readonly at: v.NumberSchema<undefined>;
2888
+ }, undefined>, undefined>, undefined>;
2889
+ /**
2890
+ * Transient action the human requested while parked — consumed by the durable driver
2891
+ * when it re-enters the gate. Cleared once acted on.
2892
+ */
2893
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2894
+ readonly type: v.PicklistSchema<["approve", "request-fix", "recapture"], undefined>;
2895
+ /** The findings prompt for a `request-fix` action. */
2896
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2897
+ }, undefined>, undefined>, undefined>;
2898
+ }, undefined>, undefined>, undefined>;
2899
+ /**
2900
+ * The ephemeral environment this step runs against (when the block has one), so a
2901
+ * run's details can show its spinning-up / running / shut-down / errored state +
2902
+ * the exact error. Populated by the engine for container/deployer steps from the
2903
+ * block's live environment; see {@link runEnvironmentSchema}. The `human-test` gate
2904
+ * keeps its own richer `humanTest.environment` and is not double-populated here.
2905
+ */
2906
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2907
+ /** The `environments` row id (lets a window fetch access creds / re-poll status). */
2908
+ readonly id: v.StringSchema<undefined>;
2909
+ /** The provisioned public URL (null while still provisioning). */
2910
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2911
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
2912
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
2913
+ /** Epoch ms the environment expires (TTL), when known. */
2914
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2915
+ /** The verbatim provider error when the environment failed/expired, else null. */
2916
+ readonly lastError: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2917
+ /**
2918
+ * The service's declared provision type this environment was stood up for
2919
+ * (`kubernetes` | `docker-compose` | `custom` | `infraless`), recorded at provision
2920
+ * time so a run's details show exactly what was provisioned. Null for legacy rows /
2921
+ * pre-resolution.
2922
+ */
2923
+ readonly provisionType: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["kubernetes", "docker-compose", "custom", "infraless"], undefined>, undefined>, undefined>;
2924
+ /**
2925
+ * The resolved engine that handled the provisioning (`local-docker` | `local-k3s` |
2926
+ * `remote-kubernetes` | `remote-custom` | `none`), surfaced in run details alongside the
2927
+ * environment state. Null for legacy rows / pre-resolution.
2928
+ */
2929
+ readonly engine: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["local-docker", "local-k3s", "remote-kubernetes", "remote-custom", "none"], undefined>, undefined>, undefined>;
2930
+ }, undefined>, undefined>, undefined>;
2931
+ /** Live subtask counts while an async (container) step runs; see {@link stepSubtasksSchema}. */
2932
+ readonly subtasks: v.OptionalSchema<v.ObjectSchema<{
2933
+ readonly completed: v.NumberSchema<undefined>;
2934
+ readonly inProgress: v.NumberSchema<undefined>;
2935
+ readonly total: v.NumberSchema<undefined>;
2936
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2937
+ /** The task's human-readable subject, as the agent wrote it. */
2938
+ readonly label: v.StringSchema<undefined>;
2939
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
2940
+ }, undefined>, undefined>, undefined>;
2941
+ }, undefined>, undefined>;
2942
+ /**
2943
+ * The per-run container this async (container) step runs in — its lifecycle status
2944
+ * (starting / up / errored), the agent's current phase (clone / agent / push), and
2945
+ * the container's id + reachable URL once up. Lets a run's details surface what the
2946
+ * container is doing and where it lives, so the board shows an explicit "Spinning up
2947
+ * container…" → live-phase progression instead of a blank "working" state. Set the
2948
+ * moment the job is dispatched (the dispatch blocks until the container accepts the
2949
+ * job) and refined on each poll. Only ever set on async (container) steps; absent on
2950
+ * non-container steps and steps not yet dispatched. See {@link runContainerSchema}.
2951
+ */
2952
+ readonly container: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2953
+ /** The container lifecycle status; see {@link runContainerStatusSchema}. */
2954
+ readonly status: v.PicklistSchema<["starting", "up", "errored", "destroyed"], undefined>;
2955
+ /**
2956
+ * The coarse phase the agent's job is in while the container is `up` (`clone` →
2957
+ * `agent` → `push`, seeded `starting`), forwarded from the harness. Lets the details
2958
+ * distinguish "still preparing the checkout" from "the agent is making calls". Absent
2959
+ * until the first poll, or when the runner doesn't report a phase.
2960
+ */
2961
+ readonly phase: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2962
+ /** Provider container/runner id (Cloudflare DO id, docker container id), when known. */
2963
+ readonly id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2964
+ /** A reachable address for the running container (the local docker host URL), when one exists. */
2965
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2966
+ }, undefined>, undefined>, undefined>;
2967
+ /**
2968
+ * Whether web search was available to this container step, and which upstream backend
2969
+ * served it. Set at dispatch (a static per-run fact resolved from the account's
2970
+ * web-search keys, else the deployment default). Only ever set on async (container)
2971
+ * steps; absent on non-container steps and steps not yet dispatched. Distinct from the
2972
+ * telemetry-gated per-query log — this is always surfaced. See {@link webSearchAvailabilitySchema}.
2973
+ */
2974
+ readonly search: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2975
+ readonly available: v.BooleanSchema<undefined>;
2976
+ readonly provider: v.NullableSchema<v.PicklistSchema<["brave", "searxng"], undefined>, undefined>;
2977
+ }, undefined>, undefined>, undefined>;
2978
+ readonly decision: v.NullableSchema<v.ObjectSchema<{
2979
+ readonly id: v.StringSchema<undefined>;
2980
+ readonly question: v.StringSchema<undefined>;
2981
+ readonly options: v.ArraySchema<v.StringSchema<undefined>, undefined>;
2982
+ readonly chosen: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2983
+ }, undefined>, undefined>;
2984
+ /**
2985
+ * Whether a human approval gate fires after this step completes. Copied from
2986
+ * the pipeline's `gates` at run start; absent means no gate.
2987
+ */
2988
+ readonly requiresApproval: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2989
+ /**
2990
+ * The live approval gate for this step (see {@link stepApprovalSchema}). Set
2991
+ * once the step's proposal is ready and `requiresApproval` is true; null/absent
2992
+ * otherwise.
2993
+ */
2994
+ readonly approval: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2995
+ /** Unique id of this gate; the durable run parks on it like a decision. */
2996
+ readonly id: v.StringSchema<undefined>;
2997
+ /** `pending` while awaiting the human; terminal `approved`/`rejected`; `changes_requested` re-runs the step. */
2998
+ readonly status: v.PicklistSchema<["pending", "approved", "changes_requested", "rejected"], undefined>;
2999
+ /** The agent's output the human is reviewing (editable before approval). */
3000
+ readonly proposal: v.StringSchema<undefined>;
3001
+ /** When changes were requested, the human's freeform guidance fed into the re-run. */
3002
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3003
+ /** When changes were requested, per-block review comments fed into the re-run. */
3004
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3005
+ /**
3006
+ * Verbatim raw-markdown source of the commented prose block. Optional: a comment
3007
+ * may instead anchor to a structured item via {@link anchorId}, where there is no
3008
+ * prose source to quote.
3009
+ */
3010
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3011
+ /**
3012
+ * 0-based source line range [start, end) of the commented prose block, for
3013
+ * best-effort re-anchoring. Optional: a comment may instead anchor to a structured
3014
+ * item via {@link anchorId} (e.g. a spec requirement/acceptance-criterion id), where
3015
+ * there is no prose line range.
3016
+ */
3017
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3018
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3019
+ /**
3020
+ * Stable id of the structured item the comment targets (e.g. a spec
3021
+ * requirement/criterion id), when the reviewed output is rendered as structured
3022
+ * items rather than free prose. Absent for prose-range comments.
3023
+ */
3024
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3025
+ /** The reviewer's note on this block / item. */
3026
+ readonly body: v.StringSchema<undefined>;
3027
+ }, undefined>, undefined>, undefined>;
3028
+ }, undefined>, undefined>, undefined>;
3029
+ /**
3030
+ * Live state of a companion step that reviews a preceding producer step. Set when
3031
+ * this step's `agentKind` is a companion kind. `threshold` is the quality bar the
3032
+ * companion's latest rating (the last `verdicts` entry) must reach; `attempts`
3033
+ * counts only the AUTOMATIC reworks performed, and once it reaches `maxAttempts` the
3034
+ * step parks on the iteration-cap gate (`exceeded`) for a human rather than failing.
3035
+ * A human "request changes" on the companion's gate also re-runs the producer but does
3036
+ * NOT consume `attempts` (only the automatic loop is budgeted). Absent for non-companion steps.
3037
+ */
3038
+ readonly companion: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3039
+ /** The quality bar (0..1) the latest verdict's rating must reach; seeded from the pipeline. */
3040
+ readonly threshold: v.NumberSchema<undefined>;
3041
+ /** The automatic rework budget: once `attempts` reaches this the gate parks for a human (`exceeded`). */
3042
+ readonly maxAttempts: v.NumberSchema<undefined>;
3043
+ /**
3044
+ * How many AUTOMATIC reworks the companion has driven so far (the producer is
3045
+ * looped back once per failed verdict). Human "request changes" cycles are not
3046
+ * counted. Defaults to 0; once it reaches `maxAttempts` the step parks on the
3047
+ * iteration-cap gate (`exceeded`) — an "extra round" raises `maxAttempts` by one.
3048
+ */
3049
+ readonly attempts: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
3050
+ /**
3051
+ * One standardized {@link companionVerdictSchema} per grading cycle, in order —
3052
+ * the full sequence of correction iterations (the producer is re-run after each
3053
+ * rejected verdict), including any human-driven ones. Empty before the first
3054
+ * grade; the last entry is the latest.
3055
+ */
3056
+ readonly verdicts: v.ArraySchema<v.ObjectSchema<{
3057
+ /** Overall quality of the graded output (0..1, higher = better). */
3058
+ readonly rating: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
3059
+ /** The quality bar the rating had to reach to pass. */
3060
+ readonly threshold: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
3061
+ /** Whether the rating met the threshold. */
3062
+ readonly passed: v.BooleanSchema<undefined>;
3063
+ /** The companion's challenge / justification (its assessment summary). */
3064
+ readonly feedback: v.StringSchema<undefined>;
3065
+ }, undefined>, undefined>;
3066
+ /**
3067
+ * Set true when the automatic rework budget (`maxAttempts`) was spent with the
3068
+ * rating still below the bar: instead of failing the run, the step parks on its
3069
+ * approval gate for a human to resolve via the shared iteration-cap surface
3070
+ * (one more round / proceed anyway / stop & reset). Cleared once the human grants
3071
+ * an extra round (the loop resumes). Absent until/unless the cap is hit.
3072
+ */
3073
+ readonly exceeded: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3074
+ }, undefined>, undefined>, undefined>;
3075
+ /**
3076
+ * Live Follow-up companion state while a `coder` step runs/parks: the items the Coder
3077
+ * streamed (loose ends / side-tasks / questions), whether the companion is enabled, and
3078
+ * the send-back loop budget. Items accrue live as the harness streams them (the blinking
3079
+ * companion); at the step's completion the engine parks the run while any item is
3080
+ * `pending`, then loops the Coder for any `queued` follow-up / `answered` question. See
3081
+ * {@link followUpsStepStateSchema}. Absent for non-`coder` steps / when the companion is off.
3082
+ */
3083
+ readonly followUps: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3084
+ readonly enabled: v.BooleanSchema<undefined>;
3085
+ readonly items: v.ArraySchema<v.ObjectSchema<{
3086
+ readonly id: v.StringSchema<undefined>;
3087
+ readonly kind: v.PicklistSchema<["follow_up", "question"], undefined>;
3088
+ readonly title: v.StringSchema<undefined>;
3089
+ readonly detail: v.StringSchema<undefined>;
3090
+ readonly suggestedAction: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3091
+ readonly status: v.PicklistSchema<["pending", "filed", "queued", "answered", "dismissed"], undefined>;
3092
+ readonly answer: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3093
+ readonly sentToCoder: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3094
+ readonly ticketExternalId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3095
+ readonly ticketUrl: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3096
+ readonly createdAt: v.NumberSchema<undefined>;
3097
+ readonly updatedAt: v.NumberSchema<undefined>;
3098
+ }, undefined>, undefined>;
3099
+ readonly loops: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
3100
+ readonly maxLoops: v.OptionalSchema<v.NumberSchema<undefined>, 3>;
3101
+ }, undefined>, undefined>, undefined>;
3102
+ /**
3103
+ * Live implementation-fork decision state while a `coder` step runs its optional
3104
+ * two-phase flow: the proposer explore job (`proposing`), the human park
3105
+ * (`awaiting_choice` / `answering`), the resolved choice (`chosen`), or one of the
3106
+ * pass-through terminals (`single_path` / `skipped`). Created lazily by the engine
3107
+ * when the phase activates — the config lives on the block + the risk policy, never
3108
+ * on the step. Absent for non-`coder` steps / when the phase never activated. See
3109
+ * {@link forkDecisionStepStateSchema}.
3110
+ */
3111
+ readonly forkDecision: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3112
+ readonly status: v.PicklistSchema<["proposing", "awaiting_choice", "answering", "chosen", "single_path", "skipped"], undefined>;
3113
+ readonly seamSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3114
+ readonly forks: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3115
+ readonly id: v.StringSchema<undefined>;
3116
+ readonly title: v.StringSchema<undefined>;
3117
+ readonly summary: v.StringSchema<undefined>;
3118
+ readonly approach: v.StringSchema<undefined>;
3119
+ readonly tradeoffs: v.ArraySchema<v.StringSchema<undefined>, undefined>;
3120
+ readonly riskNotes: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3121
+ readonly recommended: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3122
+ }, undefined>, undefined>, readonly []>;
3123
+ readonly singlePathReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3124
+ readonly chat: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3125
+ readonly id: v.StringSchema<undefined>;
3126
+ readonly role: v.PicklistSchema<["human", "assistant"], undefined>;
3127
+ readonly text: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
3128
+ readonly createdAt: v.NumberSchema<undefined>;
3129
+ }, undefined>, undefined>, readonly []>;
3130
+ readonly maxChatTurns: v.OptionalSchema<v.NumberSchema<undefined>, 15>;
3131
+ readonly chosen: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3132
+ readonly forkId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3133
+ readonly custom: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3134
+ readonly note: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3135
+ readonly at: v.NumberSchema<undefined>;
3136
+ }, undefined>, v.CheckAction<{
3137
+ forkId?: string | null | undefined;
3138
+ custom?: string | null | undefined;
3139
+ note?: string | null | undefined;
3140
+ at: number;
3141
+ }, "Provide exactly one of forkId or custom.">]>, undefined>, undefined>;
3142
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3143
+ }, undefined>, undefined>, undefined>;
3144
+ /**
3145
+ * Live "Ralph loop" state carried on a `ralph` step: the persistent retry-until-done
3146
+ * loop's iteration count, budget, validation command, and per-iteration history. Seeded
3147
+ * from the block's per-task agent config at step start, then advanced each iteration by
3148
+ * the engine's `RalphController`. Because it rides the run's persisted `detail` blob, both
3149
+ * durable drivers + both stale-run sweepers re-drive a mid-loop run from exactly this
3150
+ * state after a restart. Absent for non-`ralph` steps. See {@link ralphStepStateSchema}.
3151
+ */
3152
+ readonly ralph: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3153
+ readonly phase: v.PicklistSchema<["iterating"], undefined>;
3154
+ readonly attempts: v.NumberSchema<undefined>;
3155
+ readonly maxIterations: v.NumberSchema<undefined>;
3156
+ readonly validationCommand: v.StringSchema<undefined>;
3157
+ readonly progressPath: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3158
+ readonly lastExitCode: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
3159
+ readonly lastValidationTail: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3160
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
3161
+ readonly attempt: v.NumberSchema<undefined>;
3162
+ readonly at: v.NumberSchema<undefined>;
3163
+ readonly validationPassed: v.BooleanSchema<undefined>;
3164
+ readonly exitCode: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
3165
+ readonly outputTail: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3166
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3167
+ }, undefined>, undefined>, undefined>, undefined>;
3168
+ }, undefined>, undefined>, undefined>;
3169
+ /**
3170
+ * Transient re-entry marker carried on a parked `coder` step whose fork decision is
3171
+ * `answering`: set when the human sends a chat message so the run is signalled to
3172
+ * wake and the durable driver, on re-entering, runs the inline chat LLM and appends
3173
+ * the assistant reply (the LLM work that must not block the HTTP request). Cleared
3174
+ * once that async cycle completes. Documented beside `pendingIncorporation` /
3175
+ * `pendingInterview`. Absent when no chat turn is pending.
3176
+ */
3177
+ readonly pendingForkChat: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3178
+ readonly messageId: v.StringSchema<undefined>;
3179
+ }, undefined>, undefined>, undefined>;
3180
+ /**
3181
+ * Live PR deep-review state carried on a `pr-reviewer` step: the sliced, severity-ordered
3182
+ * findings the read-only reviewer produced, the human's curated selection, and how it was
3183
+ * resolved. Recorded by the engine when the reviewer container job completes; the run then
3184
+ * parks (`awaiting_selection`) for the human to select findings through the dedicated
3185
+ * window and resolve. Absent for non-`pr-reviewer` steps. See {@link prReviewStepStateSchema}.
3186
+ */
3187
+ readonly prReview: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3188
+ readonly status: v.PicklistSchema<["reviewing", "awaiting_selection", "fixing", "posting", "done", "skipped"], undefined>;
3189
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3190
+ readonly slices: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3191
+ readonly id: v.StringSchema<undefined>;
3192
+ readonly title: v.StringSchema<undefined>;
3193
+ readonly rationale: v.StringSchema<undefined>;
3194
+ readonly paths: v.ArraySchema<v.StringSchema<undefined>, undefined>;
3195
+ }, undefined>, undefined>, readonly []>;
3196
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3197
+ readonly id: v.StringSchema<undefined>;
3198
+ readonly sliceId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3199
+ readonly path: v.StringSchema<undefined>;
3200
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
3201
+ readonly side: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["LEFT", "RIGHT"], undefined>, undefined>, undefined>;
3202
+ readonly severity: v.PicklistSchema<["blocker", "high", "medium", "low", "nit"], undefined>;
3203
+ readonly category: v.PicklistSchema<["correctness", "security", "performance", "maintainability", "style", "test", "other"], undefined>;
3204
+ readonly title: v.StringSchema<undefined>;
3205
+ readonly detail: v.StringSchema<undefined>;
3206
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3207
+ }, undefined>, undefined>, readonly []>;
3208
+ readonly selectedFindingIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, readonly []>;
3209
+ readonly resolution: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["finish", "fix", "post"], undefined>, undefined>, undefined>;
3210
+ readonly prUrl: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3211
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3212
+ }, undefined>, undefined>, undefined>;
3213
+ /**
3214
+ * The at-most-once driver marker for the PR-review "post" resolution: set when the human
3215
+ * resolves a parked review with `post`, so the durable driver — on re-entry, off the HTTP
3216
+ * request — publishes the selected findings as inline PR review comments (via
3217
+ * `RepoFiles.createReview`) exactly once. Consumed (cleared + persisted) BEFORE the posting
3218
+ * side effect so a Workflows retry/replay can't post the review twice. Cleared once posted.
3219
+ */
3220
+ readonly pendingPrReviewPost: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
3221
+ /**
3222
+ * Transient rework feedback carried on a PRODUCER step while it is being re-run by
3223
+ * a downstream companion (the analogue of an approval's `changes_requested`
3224
+ * feedback for the automatic path). Folded into the agent's revision context on the
3225
+ * re-run, then cleared. Absent when no companion rework is in flight.
3226
+ */
3227
+ readonly rework: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3228
+ /** The producer's previous proposal the companion challenged. */
3229
+ readonly previousProposal: v.StringSchema<undefined>;
3230
+ /** The companion's prose feedback driving the rework. */
3231
+ readonly feedback: v.StringSchema<undefined>;
3232
+ /** Optional per-item / per-block challenges to address. */
3233
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3234
+ /**
3235
+ * Verbatim raw-markdown source of the commented prose block. Optional: a comment
3236
+ * may instead anchor to a structured item via {@link anchorId}, where there is no
3237
+ * prose source to quote.
3238
+ */
3239
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3240
+ /**
3241
+ * 0-based source line range [start, end) of the commented prose block, for
3242
+ * best-effort re-anchoring. Optional: a comment may instead anchor to a structured
3243
+ * item via {@link anchorId} (e.g. a spec requirement/acceptance-criterion id), where
3244
+ * there is no prose line range.
3245
+ */
3246
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3247
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3248
+ /**
3249
+ * Stable id of the structured item the comment targets (e.g. a spec
3250
+ * requirement/criterion id), when the reviewed output is rendered as structured
3251
+ * items rather than free prose. Absent for prose-range comments.
3252
+ */
3253
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3254
+ /** The reviewer's note on this block / item. */
3255
+ readonly body: v.StringSchema<undefined>;
3256
+ }, undefined>, undefined>, undefined>;
3257
+ }, undefined>, undefined>, undefined>;
3258
+ /**
3259
+ * Transient incorporation intent carried on a parked `requirements-review` gate step.
3260
+ * Set when the human answers the findings and asks to incorporate: the run is signalled
3261
+ * to wake and the durable driver, on re-entering the gate, folds the answers into a
3262
+ * document and re-reviews it (the LLM work that used to block the HTTP request). Cleared
3263
+ * once that async cycle completes. `feedback` is the human's optional "do it differently"
3264
+ * direction (a redo). Absent when no incorporation is pending.
3265
+ */
3266
+ readonly pendingIncorporation: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3267
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3268
+ }, undefined>, undefined>, undefined>;
3269
+ /**
3270
+ * Transient recommendation intent carried on a parked `requirements-review` gate step.
3271
+ * Set when the human asks the Requirement Writer to suggest answers for a batch of findings
3272
+ * (or re-requests one): the run is signalled to wake and the durable driver, on re-entering
3273
+ * the gate, runs the Writer per finding — filling in the `pending` placeholder
3274
+ * recommendations — then re-parks (recommendations never advance the run). Cleared once that
3275
+ * async batch completes. `itemIds` are the findings to recommend for; `note` steers the
3276
+ * whole batch. Absent when no recommendation batch is pending.
3277
+ */
3278
+ readonly pendingRecommendation: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3279
+ readonly itemIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
3280
+ readonly note: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3281
+ }, undefined>, undefined>, undefined>;
3282
+ /**
3283
+ * Transient interview intent carried on a parked `initiative-interviewer` gate step. Set
3284
+ * when the human has answered the planning questions and asked to continue (or proceed):
3285
+ * the run is signalled to wake and the durable driver, on re-entering the gate, runs the
3286
+ * interviewer LLM again against the answers — asking follow-ups (re-park) or synthesizing
3287
+ * the goal/constraints brief and advancing. `proceed` skips any remaining questions.
3288
+ * Cleared once that async re-entry completes. Absent when no continuation is pending.
3289
+ */
3290
+ readonly pendingInterview: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3291
+ readonly proceed: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3292
+ }, undefined>, undefined>, undefined>;
3293
+ /**
3294
+ * Consensus configuration for this step, copied from the pipeline's `consensus`
3295
+ * array at run start. Present (with `enabled: true`) when this step should run
3296
+ * through the multi-model consensus mechanism; read by the consensus executor
3297
+ * (and to decide gating against the block estimate). Absent ⇒ standard agent.
3298
+ * See {@link consensusStepConfigSchema}.
3299
+ */
3300
+ readonly consensus: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3301
+ readonly enabled: v.BooleanSchema<undefined>;
3302
+ readonly strategy: v.PicklistSchema<["specialist-panel", "debate", "ranked-voting"], undefined>;
3303
+ readonly participants: v.ArraySchema<v.ObjectSchema<{
3304
+ readonly id: v.StringSchema<undefined>;
3305
+ readonly role: v.StringSchema<undefined>;
3306
+ readonly systemFraming: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3307
+ readonly modelId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3308
+ }, undefined>, undefined>;
3309
+ readonly synthesizerModelId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3310
+ readonly rounds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 5, undefined>]>, undefined>;
3311
+ readonly gating: v.OptionalSchema<v.ObjectSchema<{
3312
+ readonly enabled: v.BooleanSchema<undefined>;
3313
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
3314
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
3315
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
3316
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["consensus", "standard"], undefined>, "consensus">;
3317
+ }, undefined>, undefined>;
3318
+ }, undefined>, undefined>, undefined>;
3319
+ /**
3320
+ * Estimate-based gating for this step, copied from the pipeline's `gating` array at
3321
+ * run start. When present (with `enabled: true`) the step is skipped at runtime unless
3322
+ * the block's task estimate meets the threshold. Absent ⇒ always run. See
3323
+ * {@link stepGatingSchema}.
3324
+ */
3325
+ readonly gating: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3326
+ readonly enabled: v.BooleanSchema<undefined>;
3327
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
3328
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
3329
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
3330
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["run", "skip"], undefined>, "run">;
3331
+ }, undefined>, undefined>, undefined>;
3332
+ /**
3333
+ * Per-step options bag copied from the pipeline's `stepOptions` array at run start (see
3334
+ * {@link stepOptionsSchema}). Absent ⇒ all defaults for this step. Read by the engine —
3335
+ * e.g. the requirements-review gate consults `stepOptions.autoRecommend`.
3336
+ */
3337
+ readonly stepOptions: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3338
+ readonly autoRecommend: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3339
+ readonly skillId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3340
+ }, undefined>, undefined>, undefined>;
3341
+ /**
3342
+ * True when this step was skipped at runtime because its `gating` was not satisfied
3343
+ * (the task estimate fell below the threshold). The step's `state` is `done` with no
3344
+ * output; the UI renders it as "skipped (gated)". Absent ⇒ the step ran normally.
3345
+ */
3346
+ readonly skipped: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3347
+ /**
3348
+ * Set `true` on a `spec-writer` step that determined the task is purely technical and
3349
+ * produced no business specs (its result's `noBusinessSpecs`). Recorded on the step so
3350
+ * the spec-companion's convergence — the one point both signals coexist — can combine it
3351
+ * with the companion's `technicalCorroborated` verdict to infer the block's `technical`
3352
+ * label. Absent for every other kind / a writer that produced specs.
3353
+ */
3354
+ readonly noBusinessSpecs: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3355
+ /**
3356
+ * Set on a `spec-companion` step from its `technicalCorroborated` verdict (whether it
3357
+ * agreed the task is purely technical). Recorded on the step — not just read off the
3358
+ * live assessment — so the engine can infer the block's `technical` label both on the
3359
+ * companion's automatic convergence AND on a human "proceed" past the iteration cap,
3360
+ * where only the persisted step survives. Absent for every other kind / no opinion.
3361
+ */
3362
+ readonly technicalCorroborated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3363
+ /** Text the agent produced for this step (when LLM execution is enabled). */
3364
+ readonly output: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3365
+ /**
3366
+ * The structured JSON a registered CUSTOM kind's agent step returned (the generic
3367
+ * manifest-driven `agent` dispatch's `custom` channel). Recorded so the SPA can render
3368
+ * it in the `generic-structured` result view (and a post-op already consumed it
3369
+ * server-side). Absent for built-in / prose kinds.
3370
+ */
3371
+ readonly custom: v.OptionalSchema<v.UnknownSchema, undefined>;
3372
+ /** Identifier of the model that produced `output`, for transparency. */
3373
+ readonly model: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3374
+ /**
3375
+ * Ids of the prompt-fragment library entries that were folded into this step's
3376
+ * system prompt — the manual selection on the block unioned with the relevance
3377
+ * selector's pick. Recorded for observability and replay-stability; absent when
3378
+ * the fragment-library module is not configured.
3379
+ */
3380
+ readonly selectedFragmentIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
3381
+ /**
3382
+ * The repo-sourced Claude Skill this step was PINNED to at dispatch (a `skill` step; see
3383
+ * `docs/initiatives/repo-skills.md`). Recorded so a run executes a stable version of the
3384
+ * skill even if its source resyncs mid-run, and so a later investigation knows exactly
3385
+ * which skill (and at which commit / manifest blob) ran. `commit` is the source dir's head
3386
+ * commit the resources were fetched at (null if the skill was never synced to a commit);
3387
+ * `sha` is the `SKILL.md` blob sha. Absent for every non-`skill` step.
3388
+ */
3389
+ readonly skillVersion: v.OptionalSchema<v.ObjectSchema<{
3390
+ readonly skillId: v.StringSchema<undefined>;
3391
+ readonly commit: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3392
+ readonly sha: v.StringSchema<undefined>;
3393
+ }, undefined>, undefined>;
3394
+ /**
3395
+ * Identifier of an in-flight asynchronous agent job (a container run polled by
3396
+ * the durable driver). Set while the step is dispatched-but-not-yet-finished so
3397
+ * a Workflows replay re-attaches to the running job instead of starting a new
3398
+ * one; cleared once the job's result is recorded.
3399
+ */
3400
+ readonly jobId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3401
+ /**
3402
+ * Epoch ms the step first began executing (transitioned to `working`). Set once
3403
+ * and never overwritten on subsequent state changes, so a re-run/replay keeps the
3404
+ * original start. Absent until the step starts.
3405
+ */
3406
+ readonly startedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
3407
+ /**
3408
+ * Epoch ms the step finished (transitioned to `done`). With {@link startedAt}
3409
+ * this yields the step's execution duration. Absent until the step completes.
3410
+ */
3411
+ readonly finishedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
3412
+ /**
3413
+ * Epoch ms the step parked on a human (an approval gate, a raised decision, or an
3414
+ * iteration-cap gate), freezing its duration clock: while parked, elapsed time stops
3415
+ * accruing — the symmetric counterpart of {@link finishedAt}'s terminal freeze, so a
3416
+ * step waiting on input is not billed for the human's deliberation. Set once on park,
3417
+ * cleared (null) when the step resumes working or finishes. Absent until first parked.
3418
+ */
3419
+ readonly pausedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
3420
+ /**
3421
+ * How many times this step's container was evicted/crashed and recovered by
3422
+ * automatically re-dispatching a fresh container (bounded by
3423
+ * `MAX_EVICTION_RECOVERIES`). Once spent, a further eviction fails the run as
3424
+ * `evicted` rather than looping. Absent/0 until the first eviction.
3425
+ */
3426
+ readonly evictionRecoveries: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3427
+ /**
3428
+ * How many times this step's container was evicted by *transient infrastructure
3429
+ * churn* — an event the runtime facade flags as not-a-crash (e.g. a deploy
3430
+ * draining the sandbox) — and recovered by re-dispatching a fresh container.
3431
+ * Counted separately from {@link evictionRecoveries} and bounded by a larger
3432
+ * `MAX_TRANSIENT_EVICTION_RECOVERIES`, since such churn can recur several times in
3433
+ * a short window, unlike a crash. Absent/0 until the first transient eviction.
3434
+ */
3435
+ readonly transientEvictionRecoveries: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3436
+ /**
3437
+ * The service-provisioning config a `deployer` step PINNED when it dispatched its async,
3438
+ * container-backed deploy job, so the later poll/finalize maps the job against the same config
3439
+ * the container was built from — NOT a fresh read of the service frame (which a person may have
3440
+ * edited mid-flight, e.g. flipping it to `infraless`, which would otherwise fail a deploy whose
3441
+ * container already succeeded). Absent for the synchronous raw-manifest path and the undeclared
3442
+ * legacy single-connection path (re-resolution is harmless there). See {@link serviceProvisioningSchema}.
3443
+ */
3444
+ readonly deployProvisioning: v.OptionalSchema<v.ObjectSchema<{
3445
+ readonly type: v.PicklistSchema<["kubernetes", "docker-compose", "custom", "infraless"], undefined>;
3446
+ readonly manifestSource: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
3447
+ readonly type: v.LiteralSchema<"colocated", undefined>;
3448
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3449
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
3450
+ }, undefined>, v.ObjectSchema<{
3451
+ readonly type: v.LiteralSchema<"separate", undefined>;
3452
+ readonly repo: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "must be \"owner/repo\"">]>;
3453
+ readonly ref: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3454
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3455
+ readonly renderer: v.OptionalSchema<v.PicklistSchema<["raw", "kustomize"], undefined>, undefined>;
3456
+ }, undefined>], undefined>, undefined>;
3457
+ readonly composePath: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3458
+ readonly localDevOnly: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3459
+ readonly composeBuild: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3460
+ readonly recipe: v.OptionalSchema<v.ObjectSchema<{
3461
+ readonly composeFiles: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>, undefined>;
3462
+ readonly composeProfiles: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
3463
+ readonly envFiles: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3464
+ readonly template: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3465
+ readonly target: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3466
+ }, undefined>, undefined>, undefined>;
3467
+ readonly externalNetworks: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
3468
+ readonly sharedStackRefs: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
3469
+ readonly prerequisites: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3470
+ readonly check: v.PicklistSchema<["docker-daemon", "disk-space", "memory", "registry-auth", "tcp-reachable", "http-reachable", "mkcert-ca", "hosts-entries", "env-secrets-marker"], undefined>;
3471
+ readonly params: v.OptionalSchema<v.ObjectSchema<{
3472
+ readonly minGib: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1024, undefined>]>, undefined>;
3473
+ readonly registry: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3474
+ readonly host: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3475
+ readonly port: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 65535, undefined>]>, undefined>;
3476
+ readonly url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
3477
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
3478
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3479
+ readonly hostnames: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, undefined>;
3480
+ readonly file: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3481
+ readonly marker: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3482
+ }, undefined>, undefined>;
3483
+ readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3484
+ readonly remediation: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>, undefined>;
3485
+ readonly label: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3486
+ }, undefined>, undefined>, undefined>;
3487
+ readonly setupSteps: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"kind", [v.ObjectSchema<{
3488
+ readonly kind: v.LiteralSchema<"compose-exec", undefined>;
3489
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3490
+ readonly service: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
3491
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
3492
+ readonly stdinFile: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3493
+ readonly user: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3494
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3495
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3496
+ }, undefined>, v.ObjectSchema<{
3497
+ readonly kind: v.LiteralSchema<"copy-file", undefined>;
3498
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3499
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3500
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3501
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3502
+ }, undefined>, v.ObjectSchema<{
3503
+ readonly kind: v.LiteralSchema<"wait-http", undefined>;
3504
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3505
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3506
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
3507
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3508
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3509
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3510
+ }, undefined>, v.ObjectSchema<{
3511
+ readonly kind: v.LiteralSchema<"wait-file", undefined>;
3512
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3513
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3514
+ readonly service: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3515
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3516
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3517
+ }, undefined>, v.ObjectSchema<{
3518
+ readonly kind: v.LiteralSchema<"host-command", undefined>;
3519
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3520
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
3521
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3522
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3523
+ }, undefined>], undefined>, undefined>, undefined>;
3524
+ readonly healthGate: v.OptionalSchema<v.VariantSchema<"kind", [v.ObjectSchema<{
3525
+ readonly kind: v.LiteralSchema<"compose-healthy", undefined>;
3526
+ }, undefined>, v.ObjectSchema<{
3527
+ readonly kind: v.LiteralSchema<"http", undefined>;
3528
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3529
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
3530
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3531
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3532
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3533
+ }, undefined>, v.ObjectSchema<{
3534
+ readonly kind: v.LiteralSchema<"compose-exec", undefined>;
3535
+ readonly service: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
3536
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
3537
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3538
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3539
+ }, undefined>], undefined>, undefined>;
3540
+ readonly teardownSteps: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"kind", [v.ObjectSchema<{
3541
+ readonly kind: v.LiteralSchema<"compose-exec", undefined>;
3542
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3543
+ readonly service: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
3544
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
3545
+ readonly stdinFile: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3546
+ readonly user: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3547
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3548
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3549
+ }, undefined>, v.ObjectSchema<{
3550
+ readonly kind: v.LiteralSchema<"copy-file", undefined>;
3551
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3552
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3553
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3554
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3555
+ }, undefined>, v.ObjectSchema<{
3556
+ readonly kind: v.LiteralSchema<"wait-http", undefined>;
3557
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3558
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
3559
+ readonly expectStatus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 100, undefined>, v.MaxValueAction<number, 599, undefined>]>, undefined>;
3560
+ readonly expectBodyContains: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3561
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3562
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3563
+ }, undefined>, v.ObjectSchema<{
3564
+ readonly kind: v.LiteralSchema<"wait-file", undefined>;
3565
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3566
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3567
+ readonly service: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3568
+ readonly intervalMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 250, undefined>, v.MaxValueAction<number, 60000, undefined>]>, undefined>;
3569
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3570
+ }, undefined>, v.ObjectSchema<{
3571
+ readonly kind: v.LiteralSchema<"host-command", undefined>;
3572
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
3573
+ readonly command: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
3574
+ readonly workdir: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3575
+ readonly timeoutMs: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1000, undefined>, v.MaxValueAction<number, 3600000, undefined>]>, undefined>;
3576
+ }, undefined>], undefined>, undefined>, undefined>;
3577
+ }, undefined>, undefined>;
3578
+ readonly manifestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
3579
+ readonly manifestPath: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3580
+ readonly images: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3581
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3582
+ readonly newNameTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3583
+ readonly newTagTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3584
+ readonly digestTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3585
+ }, undefined>, v.CheckAction<{
3586
+ name: string;
3587
+ newNameTemplate?: string | undefined;
3588
+ newTagTemplate?: string | undefined;
3589
+ digestTemplate?: string | undefined;
3590
+ }, "an image override must set at least one of newNameTemplate, newTagTemplate, or digestTemplate.">, v.CheckAction<{
3591
+ name: string;
3592
+ newNameTemplate?: string | undefined;
3593
+ newTagTemplate?: string | undefined;
3594
+ digestTemplate?: string | undefined;
3595
+ }, "newTagTemplate and digestTemplate are mutually exclusive on an image override.">]>, undefined>, undefined>;
3596
+ readonly helmReleases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3597
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3598
+ readonly chart: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3599
+ readonly repo: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
3600
+ readonly version: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.RegexAction<string, "version must be a pinned semver (e.g. 1.2.3), not a floating tag like latest or ^1.0.">]>;
3601
+ readonly namespaceTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
3602
+ readonly values: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
3603
+ readonly set: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3604
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3605
+ readonly valueTemplate: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>;
3606
+ }, undefined>, undefined>, undefined>;
3607
+ readonly valuesSecretRefs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3608
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3609
+ readonly secretRef: v.ObjectSchema<{
3610
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3611
+ }, undefined>;
3612
+ }, undefined>, undefined>, undefined>;
3613
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["per-environment", "shared"], undefined>, undefined>;
3614
+ }, undefined>, undefined>, undefined>;
3615
+ readonly secretInjections: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"mode", [v.ObjectSchema<{
3616
+ readonly mode: v.LiteralSchema<"secret", undefined>;
3617
+ readonly secretName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3618
+ readonly secretType: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3619
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3620
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
3621
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
3622
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3623
+ }, undefined>, undefined>;
3624
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
3625
+ }, undefined>, v.CheckAction<{
3626
+ key: string;
3627
+ secretRef?: {
3628
+ key: string;
3629
+ } | undefined;
3630
+ valueTemplate?: string | undefined;
3631
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
3632
+ }, undefined>, v.ObjectSchema<{
3633
+ readonly mode: v.LiteralSchema<"generatorEnvFile", undefined>;
3634
+ readonly envFilePath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 500, undefined>]>;
3635
+ readonly entries: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3636
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
3637
+ readonly secretRef: v.OptionalSchema<v.ObjectSchema<{
3638
+ readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>;
3639
+ }, undefined>, undefined>;
3640
+ readonly valueTemplate: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
3641
+ }, undefined>, v.CheckAction<{
3642
+ key: string;
3643
+ secretRef?: {
3644
+ key: string;
3645
+ } | undefined;
3646
+ valueTemplate?: string | undefined;
3647
+ }, "a secret entry must set exactly one of secretRef or valueTemplate.">]>, undefined>;
3648
+ }, undefined>], undefined>, undefined>, undefined>;
3649
+ }, undefined>, undefined>;
3650
+ /**
3651
+ * A `deployer` step fanning out over several service frames (the task's own frame + each
3652
+ * involved-service frame; see the connections initiative) records each frame's TERMINAL
3653
+ * outcome here, keyed by frame block id — so a durable replay knows which frames are already
3654
+ * provisioned and only the remaining ones are dispatched. The in-flight frame is tracked by
3655
+ * {@link deployFrameId} + {@link jobId} until it settles into this map. Absent for a
3656
+ * single-frame deploy that never fanned out. See {@link deployEnvsSchema}.
3657
+ */
3658
+ readonly deployEnvs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
3659
+ readonly status: v.PicklistSchema<["ready", "failed", "skipped"], undefined>;
3660
+ /** The provisioned URL for a `ready` env (absent for `failed`/`skipped`). */
3661
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3662
+ /** The verbatim provider error for a `failed` env. */
3663
+ readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3664
+ }, undefined>, undefined>, undefined>;
3665
+ /**
3666
+ * The service FRAME the deployer step's currently in-flight deploy job ({@link jobId}) is
3667
+ * provisioning, during a multi-env fan-out — so the poll/finalize maps the settled job onto the
3668
+ * right frame's {@link deployEnvs} entry. Cleared once that frame settles; absent when no deploy
3669
+ * job is in flight or the step never fanned out.
3670
+ */
3671
+ readonly deployFrameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3672
+ /**
3673
+ * The task's OWN (primary) service frame, pinned on the FIRST target resolution of a `deployer`
3674
+ * fan-out and reused on every re-entry/replay. Keeps the primary classification STABLE against a
3675
+ * mid-flight reparent (which would otherwise re-derive a different own frame and flip an
3676
+ * own-service provisioning failure from terminal to a non-terminal peer failure — completing the
3677
+ * run `done` despite a failed deploy). Absent until the first resolution / for a step that never
3678
+ * fanned out.
3679
+ */
3680
+ readonly deployPrimaryFrameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3681
+ }, undefined>, undefined>;
3682
+ readonly currentStep: v.NumberSchema<undefined>;
3683
+ readonly status: v.PicklistSchema<["running", "blocked", "done", "paused", "failed"], undefined>;
3684
+ /**
3685
+ * Structured failure diagnostics when `status` is `failed`; absent/null
3686
+ * otherwise. Lets a failed task surface the same failure banner + retry as a
3687
+ * failed bootstrap (shared {@link agentFailureSchema}).
3688
+ */
3689
+ readonly failure: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3690
+ readonly kind: v.PicklistSchema<["preflight", "dispatch", "environment", "evicted", "timeout", "agent", "job_failed", "rejected", "companion_rejected", "stalled", "cancelled", "unknown"], undefined>;
3691
+ /** Human-readable summary (mirrors the run's `error` for back-compat). */
3692
+ readonly message: v.StringSchema<undefined>;
3693
+ /** Extended detail when available (the harness's reason, an HTTP body, …). */
3694
+ readonly detail: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3695
+ /** Where to look next (e.g. "check the container logs for this job id"). */
3696
+ readonly hint: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3697
+ /**
3698
+ * Optional machine-readable cause code so the SPA can render precise, actionable guidance
3699
+ * without string-matching the prose `message`/`detail` (the failure analogue of a
3700
+ * {@link ConflictReason}). Kind-scoped: an `environment` failure carries an
3701
+ * {@link EnvironmentFailureReason} (e.g. `deploy_runner_unwired`). Absent when the cause has
3702
+ * no client-specific handling.
3703
+ */
3704
+ readonly reason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3705
+ /** Epoch ms the failure was recorded. */
3706
+ readonly occurredAt: v.NumberSchema<undefined>;
3707
+ /** Last subtask counts seen before the failure, for context (null if none). */
3708
+ readonly lastSubtasks: v.NullableSchema<v.ObjectSchema<{
3709
+ readonly completed: v.NumberSchema<undefined>;
3710
+ readonly inProgress: v.NumberSchema<undefined>;
3711
+ readonly total: v.NumberSchema<undefined>;
3712
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3713
+ /** The task's human-readable subject, as the agent wrote it. */
3714
+ readonly label: v.StringSchema<undefined>;
3715
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
3716
+ }, undefined>, undefined>, undefined>;
3717
+ }, undefined>, undefined>;
3718
+ /**
3719
+ * Index of the pipeline step that was in flight when the run failed (the run's
3720
+ * `currentStep` at fail time), so the per-attempt failure trail can be attributed to a
3721
+ * specific step — the step-detail overlay filters its "execution history" to the failures
3722
+ * recorded for that step. Absent on a bootstrap failure (no steps) and on legacy records.
3723
+ */
3724
+ readonly stepIndex: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3725
+ }, undefined>, undefined>, undefined>;
3726
+ /**
3727
+ * Failures from the run's PRIOR attempts, oldest→newest. Each retry/restart appends
3728
+ * the then-current {@link failure} here and clears `failure` on the fresh attempt, so
3729
+ * the top failure banner (keyed on `status === 'failed'`) disappears once the task is
3730
+ * restarted while the full error trail stays viewable in the "previous errors" history.
3731
+ * Absent/empty for a run that has never been failed-then-retried.
3732
+ */
3733
+ readonly failureHistory: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3734
+ readonly kind: v.PicklistSchema<["preflight", "dispatch", "environment", "evicted", "timeout", "agent", "job_failed", "rejected", "companion_rejected", "stalled", "cancelled", "unknown"], undefined>;
3735
+ /** Human-readable summary (mirrors the run's `error` for back-compat). */
3736
+ readonly message: v.StringSchema<undefined>;
3737
+ /** Extended detail when available (the harness's reason, an HTTP body, …). */
3738
+ readonly detail: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3739
+ /** Where to look next (e.g. "check the container logs for this job id"). */
3740
+ readonly hint: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3741
+ /**
3742
+ * Optional machine-readable cause code so the SPA can render precise, actionable guidance
3743
+ * without string-matching the prose `message`/`detail` (the failure analogue of a
3744
+ * {@link ConflictReason}). Kind-scoped: an `environment` failure carries an
3745
+ * {@link EnvironmentFailureReason} (e.g. `deploy_runner_unwired`). Absent when the cause has
3746
+ * no client-specific handling.
3747
+ */
3748
+ readonly reason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3749
+ /** Epoch ms the failure was recorded. */
3750
+ readonly occurredAt: v.NumberSchema<undefined>;
3751
+ /** Last subtask counts seen before the failure, for context (null if none). */
3752
+ readonly lastSubtasks: v.NullableSchema<v.ObjectSchema<{
3753
+ readonly completed: v.NumberSchema<undefined>;
3754
+ readonly inProgress: v.NumberSchema<undefined>;
3755
+ readonly total: v.NumberSchema<undefined>;
3756
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3757
+ /** The task's human-readable subject, as the agent wrote it. */
3758
+ readonly label: v.StringSchema<undefined>;
3759
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
3760
+ }, undefined>, undefined>, undefined>;
3761
+ }, undefined>, undefined>;
3762
+ /**
3763
+ * Index of the pipeline step that was in flight when the run failed (the run's
3764
+ * `currentStep` at fail time), so the per-attempt failure trail can be attributed to a
3765
+ * specific step — the step-detail overlay filters its "execution history" to the failures
3766
+ * recorded for that step. Absent on a bootstrap failure (no steps) and on legacy records.
3767
+ */
3768
+ readonly stepIndex: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3769
+ }, undefined>, undefined>, undefined>;
3770
+ /**
3771
+ * Successful outputs from the run's PRIOR attempts that a restart discarded, oldest→newest —
3772
+ * the positive complement of {@link failureHistory}. A restart-from-step resets the chosen
3773
+ * step and every later one, dropping their `output`; those that had already SUCCEEDED are
3774
+ * recorded here (attributed by `stepIndex`) so the step-detail overlay's execution history
3775
+ * surfaces the successful outputs a restart superseded, not only the errors. Bounded in count
3776
+ * and per-entry size so the run's `detail` JSON doesn't bloat. Absent/empty for a run never
3777
+ * restarted past a completed step (a plain retry re-runs only unfinished steps, so it records
3778
+ * nothing).
3779
+ */
3780
+ readonly outputHistory: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3781
+ /** Index of the pipeline step that produced this output (see {@link agentFailureSchema} `stepIndex`). */
3782
+ readonly stepIndex: v.NumberSchema<undefined>;
3783
+ /** Epoch ms the superseded attempt finished (its `finishedAt`, else when it was recorded). */
3784
+ readonly occurredAt: v.NumberSchema<undefined>;
3785
+ /** The attempt's prose/JSON output, clipped to a stored-size bound when {@link truncated}. */
3786
+ readonly output: v.StringSchema<undefined>;
3787
+ /** Whether {@link output} was clipped because the original exceeded the per-entry size bound. */
3788
+ readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3789
+ }, undefined>, undefined>, undefined>;
3790
+ /**
3791
+ * Non-fatal advisories computed once at run start — today the frontend UI-test flow's
3792
+ * resolved-binding notes ({@link buildFrontendRunNotes}: duplicate env vars, or a partial-live
3793
+ * set of bound services where some fall back to WireMock). Mirrors the harness's own
3794
+ * `buildInfraNotes` but surfaced on the RUN so the SPA renders it in the run/step detail
3795
+ * (distinct from a `failure`, which aborts the run). Absent/empty when there is nothing to
3796
+ * flag. Rides in the `detail` JSON column (no dedicated column), reflecting the start-time
3797
+ * state even after the underlying envs change.
3798
+ */
3799
+ readonly notes: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
3800
+ /**
3801
+ * The frontend UI-test flow's backend bindings RESOLVED once at run start (env var → the bound
3802
+ * service's live ephemeral URL, or absent ⇒ mocked; see {@link resolveFrontendBindings}). Stamped
3803
+ * on the run so the SPA's run/step detail projects what the run ACTUALLY drove against — a frozen
3804
+ * snapshot that stays truthful after the underlying envs are torn down, rather than re-resolving
3805
+ * against current live state (which for a finished run could disagree with the co-located
3806
+ * start-time {@link notes}). Rides in the `detail` JSON column; absent for a non-frontend run.
3807
+ */
3808
+ readonly frontendBindings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3809
+ readonly envVar: v.StringSchema<undefined>;
3810
+ readonly serviceUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3811
+ }, undefined>, undefined>, undefined>;
3812
+ /**
3813
+ * Internal user id (`usr_*`) of whoever started this run (or retried it). Recorded
3814
+ * so the individual-usage restricted mode can use the initiator's OWN personal
3815
+ * subscription (e.g. Claude) for the run's steps — a personal credential is never
3816
+ * shared, so only its owner's runs may use it. Absent for runs started without a
3817
+ * signed-in user (auth-disabled/local dev) and for legacy runs.
3818
+ */
3819
+ readonly initiatedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3820
+ /**
3821
+ * Epoch-ms creation time, stamped when the run is first started. Gives a run a stable
3822
+ * creation timestamp independent of when its first step actually starts (the public-API
3823
+ * job view reports it as `createdAt`). Absent on legacy runs persisted before this field.
3824
+ */
3825
+ readonly createdAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3826
+ /**
3827
+ * Optimistic-concurrency token: a monotonic revision of the persisted run row,
3828
+ * bumped on every write. Read back by the repository and used by
3829
+ * `compareAndSwap` so a human-action write (resolve decision / approve /
3830
+ * request changes) that raced another writer is detected and retried on fresh
3831
+ * state instead of silently clobbering it. Defaults to 0 for a run that has
3832
+ * never been persisted. The SPA's execution store also keys its monotonic
3833
+ * reconcile on it, so a lagging snapshot refresh can't regress a run a live
3834
+ * event already advanced.
3835
+ */
3836
+ readonly rev: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3837
+ /**
3838
+ * After-the-fact investigation context — where/what the run's most recent container step
3839
+ * executed on (backend, model, repo) plus the control-plane host. Rides in the `detail` JSON
3840
+ * (see {@link runDiagnosticsSchema}); absent on legacy runs and pure inline pipelines.
3841
+ */
3842
+ readonly diagnostics: v.OptionalSchema<v.ObjectSchema<{
3843
+ /** Context of the most recent container-step dispatch. */
3844
+ readonly lastDispatch: v.OptionalSchema<v.ObjectSchema<{
3845
+ /** Index of the dispatched step within the pipeline. */
3846
+ readonly stepIndex: v.NumberSchema<undefined>;
3847
+ /** The step's agent kind (`coder`, `merger`, a custom kind, …). */
3848
+ readonly agentKind: v.StringSchema<undefined>;
3849
+ /** Resolved model ref `provider:model` (e.g. `anthropic:claude-opus-4-8`); null if unresolved. */
3850
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3851
+ /**
3852
+ * Which runner backend the step actually ran on — the datum that distinguishes a native
3853
+ * host-process run from a sandboxed container: `local-native` | `local-container` |
3854
+ * `runner-pool` | `cloudflare-container`. Filled on the first poll (the transport reports
3855
+ * it); absent until then or on an older runtime.
3856
+ */
3857
+ readonly executionBackend: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3858
+ /** The repo the step operated on. */
3859
+ readonly repo: v.OptionalSchema<v.ObjectSchema<{
3860
+ readonly owner: v.StringSchema<undefined>;
3861
+ readonly name: v.StringSchema<undefined>;
3862
+ /** The base branch the work branched from. */
3863
+ readonly baseBranch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3864
+ /** VCS provider (`github` | `gitlab`), resolved from the run's repo origin. */
3865
+ readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3866
+ }, undefined>, undefined>;
3867
+ /** Epoch ms the dispatch was recorded. */
3868
+ readonly at: v.NumberSchema<undefined>;
3869
+ }, undefined>, undefined>;
3870
+ /**
3871
+ * The control-plane (orchestrator) host running the engine — NOT necessarily where the agent
3872
+ * ran (a container step runs elsewhere; see `lastDispatch.executionBackend`). `platform` is the
3873
+ * orchestrator's `process.platform` (e.g. `win32` pins a Windows local deployment — the class
3874
+ * of host that surfaced the native-Windows git-auth break). Best-effort.
3875
+ */
3876
+ readonly host: v.OptionalSchema<v.ObjectSchema<{
3877
+ readonly platform: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3878
+ }, undefined>, undefined>;
3879
+ }, undefined>, undefined>;
3880
+ }, undefined>;
3881
+ export type ExecutionInstance = v.InferOutput<typeof executionInstanceSchema>;
3882
+ //# sourceMappingURL=execution.d.ts.map