@cat-factory/contracts 0.169.0 → 0.171.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/agent-presentation.d.ts +2 -2
  2. package/dist/errors.d.ts +1 -1
  3. package/dist/errors.d.ts.map +1 -1
  4. package/dist/errors.js +6 -0
  5. package/dist/errors.js.map +1 -1
  6. package/dist/execution.d.ts +110 -804
  7. package/dist/execution.d.ts.map +1 -1
  8. package/dist/execution.js +27 -328
  9. package/dist/execution.js.map +1 -1
  10. package/dist/gate.d.ts +283 -0
  11. package/dist/gate.d.ts.map +1 -0
  12. package/dist/gate.js +209 -0
  13. package/dist/gate.js.map +1 -0
  14. package/dist/human-verdict-gates.d.ts +165 -0
  15. package/dist/human-verdict-gates.d.ts.map +1 -0
  16. package/dist/human-verdict-gates.js +139 -0
  17. package/dist/human-verdict-gates.js.map +1 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/judge.d.ts +181 -0
  23. package/dist/judge.d.ts.map +1 -0
  24. package/dist/judge.js +147 -0
  25. package/dist/judge.js.map +1 -0
  26. package/dist/merge.d.ts +17 -0
  27. package/dist/merge.d.ts.map +1 -1
  28. package/dist/merge.js +19 -0
  29. package/dist/merge.js.map +1 -1
  30. package/dist/notification-webhooks.d.ts +3 -3
  31. package/dist/notifications.d.ts +3 -3
  32. package/dist/notifications.d.ts.map +1 -1
  33. package/dist/notifications.js +2 -0
  34. package/dist/notifications.js.map +1 -1
  35. package/dist/pr-report.d.ts +101 -0
  36. package/dist/pr-report.d.ts.map +1 -1
  37. package/dist/pr-report.js +40 -0
  38. package/dist/pr-report.js.map +1 -1
  39. package/dist/public-api.d.ts +75 -1
  40. package/dist/public-api.d.ts.map +1 -1
  41. package/dist/public-api.js +75 -1
  42. package/dist/public-api.js.map +1 -1
  43. package/dist/public-decisions.d.ts +94 -1
  44. package/dist/public-decisions.d.ts.map +1 -1
  45. package/dist/public-decisions.js +34 -1
  46. package/dist/public-decisions.js.map +1 -1
  47. package/dist/result-views.d.ts +1 -1
  48. package/dist/result-views.d.ts.map +1 -1
  49. package/dist/result-views.js +1 -0
  50. package/dist/result-views.js.map +1 -1
  51. package/dist/routes/agent-runs.d.ts +86 -0
  52. package/dist/routes/agent-runs.d.ts.map +1 -1
  53. package/dist/routes/execution.d.ts +344 -0
  54. package/dist/routes/execution.d.ts.map +1 -1
  55. package/dist/routes/human-review.d.ts +43 -0
  56. package/dist/routes/human-review.d.ts.map +1 -1
  57. package/dist/routes/human-test.d.ts +215 -0
  58. package/dist/routes/human-test.d.ts.map +1 -1
  59. package/dist/routes/index.d.ts +1 -0
  60. package/dist/routes/index.d.ts.map +1 -1
  61. package/dist/routes/index.js +1 -0
  62. package/dist/routes/index.js.map +1 -1
  63. package/dist/routes/judge.d.ts +158 -0
  64. package/dist/routes/judge.d.ts.map +1 -0
  65. package/dist/routes/judge.js +28 -0
  66. package/dist/routes/judge.js.map +1 -0
  67. package/dist/routes/merge.d.ts +12 -0
  68. package/dist/routes/merge.d.ts.map +1 -1
  69. package/dist/routes/notification-webhooks.d.ts +3 -3
  70. package/dist/routes/notifications.d.ts +3 -3
  71. package/dist/routes/public-api.d.ts +70 -4
  72. package/dist/routes/public-api.d.ts.map +1 -1
  73. package/dist/routes/public-api.js +18 -2
  74. package/dist/routes/public-api.js.map +1 -1
  75. package/dist/routes/public-decisions.d.ts +246 -0
  76. package/dist/routes/public-decisions.d.ts.map +1 -1
  77. package/dist/routes/public-decisions.js +10 -1
  78. package/dist/routes/public-decisions.js.map +1 -1
  79. package/dist/routes/slack.d.ts +3 -3
  80. package/dist/routes/visual-confirm.d.ts +129 -0
  81. package/dist/routes/visual-confirm.d.ts.map +1 -1
  82. package/dist/routes/workspaces.d.ts +94 -4
  83. package/dist/routes/workspaces.d.ts.map +1 -1
  84. package/dist/slack.d.ts +2 -2
  85. package/dist/snapshot.d.ts +47 -2
  86. package/dist/snapshot.d.ts.map +1 -1
  87. package/package.json +1 -1
@@ -225,287 +225,6 @@ export declare const priorStepOutputSchema: v.ObjectSchema<{
225
225
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
226
226
  }, undefined>;
227
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
228
  /**
510
229
  * State a `tester` step carries while it runs the Tester → Fixer loop. Unlike `ci`,
511
230
  * the gate's own work IS a container job (the Tester); on a withheld greenlight the
@@ -517,7 +236,7 @@ export type GateStepState = v.InferOutput<typeof gateStepStateSchema>;
517
236
  /**
518
237
  * One round of the Tester→Fixer loop, recorded when a `fixer` job finishes so the test
519
238
  * 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
239
+ * a polling gate's `gateAttemptSchema`, since a fixer run is otherwise an opaque
521
240
  * sub-job with no surface of its own (only a bare `attempts` count).
522
241
  */
523
242
  export declare const testerAttemptSchema: v.ObjectSchema<{
@@ -851,169 +570,6 @@ export declare const deployEnvsSchema: v.RecordSchema<v.StringSchema<undefined>,
851
570
  readonly error: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
852
571
  }, undefined>, undefined>;
853
572
  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
573
  /**
1018
574
  * Per-step LLM observability rollup: a compact aggregate over every model call the
1019
575
  * step's container made, recorded by the LLM proxy and summed by the engine for the
@@ -1104,92 +660,26 @@ export declare const pipelineStepSchema: v.ObjectSchema<{
1104
660
  */
1105
661
  readonly gate: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1106
662
  readonly phase: v.PicklistSchema<["checking", "working"], undefined>;
1107
- /** How many helper-agent attempts have been dispatched so far. */
1108
663
  readonly attempts: v.NumberSchema<undefined>;
1109
- /** Ceiling on attempts, resolved from the task's merge preset at step start. */
1110
664
  readonly maxAttempts: v.NumberSchema<undefined>;
1111
- /** The PR head commit being gated, once resolved (the own-service PR on a multi-repo block). */
1112
665
  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
666
  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
667
  readonly conflictTarget: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1127
668
  readonly repo: v.StringSchema<undefined>;
1128
669
  readonly frameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1129
670
  readonly branch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1130
671
  }, 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
672
  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
673
  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
674
  readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1149
675
  readonly name: v.StringSchema<undefined>;
1150
- /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
1151
676
  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
677
  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
678
  readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1162
679
  }, 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
680
  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
681
  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
682
  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
683
  readonly regressedSignals: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1194
684
  readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
1195
685
  readonly id: v.StringSchema<undefined>;
@@ -1197,102 +687,25 @@ export declare const pipelineStepSchema: v.ObjectSchema<{
1197
687
  readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
1198
688
  readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1199
689
  }, 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
690
  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
691
  readonly attempt: v.NumberSchema<undefined>;
1209
- /** Epoch ms when the helper job finished. */
1210
692
  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
693
  readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
1219
- /** The PR head commit the helper worked against, when known. */
1220
694
  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
695
  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
696
  readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
1238
697
  readonly name: v.StringSchema<undefined>;
1239
- /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
1240
698
  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
699
  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
700
  readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1251
701
  }, undefined>, undefined>, undefined>, undefined>;
1252
- /** The helper's own summary (or the failure reason), naming what it did / what remains. */
1253
702
  readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1254
703
  }, 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
704
  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
705
  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
706
  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
707
  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
708
  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
709
  readonly pendingFix: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1297
710
  readonly instructions: v.StringSchema<undefined>;
1298
711
  readonly at: v.NumberSchema<undefined>;
@@ -1470,52 +883,26 @@ export declare const pipelineStepSchema: v.ObjectSchema<{
1470
883
  */
1471
884
  readonly humanTest: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1472
885
  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
886
  readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1475
- /** The `environments` row id, so the window can fetch access creds / re-poll status. */
1476
887
  readonly id: v.StringSchema<undefined>;
1477
- /** The provisioned public URL the human tests against (null while still provisioning). */
1478
888
  readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1479
- /** The environment lifecycle status; see {@link environmentStatusSchema}. */
1480
889
  readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
1481
- /** Epoch ms the environment expires (TTL), when known. */
1482
890
  readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1483
891
  }, 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
892
  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
893
  readonly attempts: v.NumberSchema<undefined>;
1492
- /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
1493
894
  readonly maxAttempts: v.NumberSchema<undefined>;
1494
- /** The PR head commit being tested, when known. */
1495
895
  readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1496
- /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
1497
896
  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
897
  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
898
  readonly findings: v.StringSchema<undefined>;
1502
- /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
1503
899
  readonly helperKind: v.StringSchema<undefined>;
1504
- /** The helper job's id while it ran, for cross-referencing the run timeline. */
1505
900
  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
901
  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
902
  readonly at: v.NumberSchema<undefined>;
1510
903
  }, 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
904
  readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1517
905
  readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
1518
- /** The findings prompt for a `request-fix` action. */
1519
906
  readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1520
907
  }, undefined>, undefined>, undefined>;
1521
908
  }, undefined>, undefined>, undefined>;
@@ -1525,19 +912,14 @@ export declare const pipelineStepSchema: v.ObjectSchema<{
1525
912
  */
1526
913
  readonly visualConfirm: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1527
914
  readonly phase: v.PicklistSchema<["awaiting_human", "fixing", "approved"], undefined>;
1528
- /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
1529
915
  readonly pairs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1530
916
  readonly view: v.StringSchema<undefined>;
1531
917
  readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1532
918
  readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1533
919
  }, undefined>, undefined>, undefined>;
1534
- /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
1535
920
  readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1536
- /** How many fixer attempts have been dispatched so far. */
1537
921
  readonly attempts: v.NumberSchema<undefined>;
1538
- /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
1539
922
  readonly maxAttempts: v.NumberSchema<undefined>;
1540
- /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
1541
923
  readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1542
924
  readonly findings: v.StringSchema<undefined>;
1543
925
  readonly helperKind: v.StringSchema<undefined>;
@@ -1545,13 +927,8 @@ export declare const pipelineStepSchema: v.ObjectSchema<{
1545
927
  readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
1546
928
  readonly at: v.NumberSchema<undefined>;
1547
929
  }, 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
930
  readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1553
931
  readonly type: v.PicklistSchema<["approve", "request-fix", "recapture"], undefined>;
1554
- /** The findings prompt for a `request-fix` action. */
1555
932
  readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1556
933
  }, undefined>, undefined>, undefined>;
1557
934
  }, undefined>, undefined>, undefined>;
@@ -1800,6 +1177,57 @@ export declare const pipelineStepSchema: v.ObjectSchema<{
1800
1177
  }, "Provide exactly one of forkId or custom.">]>, undefined>, undefined>;
1801
1178
  readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1802
1179
  }, undefined>, undefined>, undefined>;
1180
+ /**
1181
+ * Live JUDGE state on a judge step (the fourth taxonomy bucket): the rubric identity, the
1182
+ * latest structured verdict, the per-task threshold it was compared against, the bounce
1183
+ * budget, and the round history. Created lazily by the engine on first entry and — like
1184
+ * `forkDecision` / `followUps` — deliberately PRESERVED across `resetStepForRerun`, so a
1185
+ * bounce that re-runs the producer plus this step does not erase the verdict it is looping
1186
+ * on. Absent for non-judge steps. See {@link judgeStepStateSchema}.
1187
+ */
1188
+ readonly judge: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1189
+ readonly status: v.PicklistSchema<["evaluating", "awaiting_decision", "bouncing", "passed", "failed", "skipped"], undefined>;
1190
+ readonly rubricId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1191
+ readonly rubricName: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1192
+ readonly rubricOverridden: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
1193
+ readonly verdict: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1194
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
1195
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
1196
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
1197
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
1198
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
1199
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
1200
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
1201
+ }, undefined>, undefined>, readonly []>, readonly []>;
1202
+ }, undefined>, undefined>, undefined>;
1203
+ readonly threshold: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
1204
+ readonly disposition: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>, undefined>, undefined>;
1205
+ readonly bounces: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
1206
+ readonly maxBounces: v.OptionalSchema<v.NumberSchema<undefined>, 1>;
1207
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1208
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1209
+ readonly round: v.NumberSchema<undefined>;
1210
+ readonly at: v.NumberSchema<undefined>;
1211
+ readonly verdict: v.ObjectSchema<{
1212
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
1213
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
1214
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
1215
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
1216
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
1217
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
1218
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
1219
+ }, undefined>, undefined>, readonly []>, readonly []>;
1220
+ }, undefined>;
1221
+ readonly disposition: v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>;
1222
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1223
+ }, undefined>, undefined>, readonly []>;
1224
+ readonly note: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1225
+ readonly resolution: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
1226
+ readonly choice: v.PicklistSchema<["proceed", "bounce", "stop"], undefined>;
1227
+ readonly feedback: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1228
+ readonly at: v.NumberSchema<undefined>;
1229
+ }, undefined>, undefined>, undefined>;
1230
+ }, undefined>, undefined>, undefined>;
1803
1231
  /**
1804
1232
  * Live "Ralph loop" state carried on a `ralph` step: the persistent retry-until-done
1805
1233
  * loop's iteration count, budget, validation command, and per-iteration history. Seeded
@@ -2596,92 +2024,26 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
2596
2024
  */
2597
2025
  readonly gate: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2598
2026
  readonly phase: v.PicklistSchema<["checking", "working"], undefined>;
2599
- /** How many helper-agent attempts have been dispatched so far. */
2600
2027
  readonly attempts: v.NumberSchema<undefined>;
2601
- /** Ceiling on attempts, resolved from the task's merge preset at step start. */
2602
2028
  readonly maxAttempts: v.NumberSchema<undefined>;
2603
- /** The PR head commit being gated, once resolved (the own-service PR on a multi-repo block). */
2604
2029
  readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2605
- /**
2606
- * Per-PR head commits for a MULTI-REPO block (service-connections phase 4), keyed by repo
2607
- * full name (owner/name) — own-service PR plus each peer-service PR. Set by the CI /
2608
- * conflicts gates whose precheck aggregates across every PR the task opened. Absent for a
2609
- * single-repo block (the scalar {@link headSha} is the only head).
2610
- */
2611
2030
  readonly headShas: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>, undefined>;
2612
- /**
2613
- * The repo the conflicts gate's most recent `fail` verdict found conflicted, so the
2614
- * single-repo conflict-resolver is dispatched at THAT repo (own-service or a peer) rather
2615
- * than always the own-service one. Absent ⇒ the own-service repo. Only the conflicts gate
2616
- * sets it (the CI-fixer runs across all repos, so the CI gate leaves it undefined).
2617
- */
2618
2031
  readonly conflictTarget: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2619
2032
  readonly repo: v.StringSchema<undefined>;
2620
2033
  readonly frameId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2621
2034
  readonly branch: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2622
2035
  }, undefined>, undefined>, undefined>;
2623
- /**
2624
- * The most recent precheck verdict, so the UI can show why the gate is looping
2625
- * (failing → a helper is fixing) vs idle-passing. Set on every probe.
2626
- */
2627
2036
  readonly lastVerdict: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "pending", "fail"], undefined>, undefined>, undefined>;
2628
- /**
2629
- * Human-readable summary of the latest failing precheck (the failing CI checks /
2630
- * the conflict reason) — the conclusion detail that used to be fed only to the
2631
- * helper agent and then discarded. Carried across the helper dispatch so the
2632
- * window keeps showing what is being fixed. Null when the last probe passed.
2633
- */
2634
2037
  readonly lastFailureSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2635
- /**
2636
- * Structured failing checks behind {@link lastFailureSummary} for the CI gate, so
2637
- * the UI can list each red check by name + conclusion. Absent for the conflicts
2638
- * gate (GitHub reports no file-level detail) and when the last probe passed.
2639
- */
2640
2038
  readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2641
2039
  readonly name: v.StringSchema<undefined>;
2642
- /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
2643
2040
  readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2644
- /**
2645
- * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
2646
- * failed run's logs. Null when GitHub didn't report one.
2647
- */
2648
2041
  readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2649
- /**
2650
- * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
2651
- * failing checks by service. Absent on a single-repo block (there is only the own repo).
2652
- */
2653
2042
  readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2654
2043
  }, undefined>, undefined>, undefined>, undefined>;
2655
- /**
2656
- * The fixing instructions handed to the most-recently dispatched helper (the failing-check
2657
- * summary / conflict reason / human fix prompt), stashed at dispatch so the attempt recorded
2658
- * when that helper's job settles can carry WHAT the round was asked to fix onto its
2659
- * {@link gateAttemptSchema} entry. Transient bookkeeping — the durable per-round history lives
2660
- * on {@link attemptLog}. Null when the gate hands its fixer no textual instructions.
2661
- */
2662
2044
  readonly lastDispatchedInstructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2663
- /**
2664
- * Epoch ms of the release marker for a time-windowed gate (post-release-health) — the
2665
- * moment it began watching the deployed release. The gate keeps polling `pending`
2666
- * until this + the preset's watch window has elapsed (then a clean run passes) or a
2667
- * monitor/SLO regresses (then it escalates to the on-call agent). Absent for the
2668
- * CI/conflicts gates.
2669
- */
2670
2045
  readonly watchSince: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2671
- /**
2672
- * The watch-window length (minutes) for a time-windowed gate (post-release-health),
2673
- * resolved from the task's merge preset ONCE on first entry (alongside `maxAttempts`)
2674
- * so the probe doesn't re-load the block + re-resolve the preset on every poll. Absent
2675
- * for the CI/conflicts gates.
2676
- */
2677
2046
  readonly watchWindowMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2678
- /**
2679
- * The regressed signals captured when the post-release-health gate escalated to the
2680
- * on-call agent, so the agent's completion handler can build the `release_regression`
2681
- * notification + incident enrichment from the SAME evidence the agent investigated
2682
- * — rather than re-reading Datadog (a third round-trip that could also disagree with
2683
- * what the agent saw if the window moved). Absent for the CI/conflicts gates.
2684
- */
2685
2047
  readonly regressedSignals: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2686
2048
  readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
2687
2049
  readonly id: v.StringSchema<undefined>;
@@ -2689,102 +2051,25 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
2689
2051
  readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
2690
2052
  readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2691
2053
  }, undefined>, undefined>, undefined>, undefined>;
2692
- /**
2693
- * Append-only history of the helper-agent attempts this gate dispatched (ci-fixer /
2694
- * conflict-resolver runs), each recorded when its job finished. Lets the UI show what
2695
- * every attempt tried and how it ended, instead of only a bare `attempts` count.
2696
- * Absent for the post-release-health gate (its on-call helper is resolved specially).
2697
- */
2698
2054
  readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2699
- /** 1-based attempt number (matches `attempts` at the time the helper was dispatched). */
2700
2055
  readonly attempt: v.NumberSchema<undefined>;
2701
- /** Epoch ms when the helper job finished. */
2702
2056
  readonly at: v.NumberSchema<undefined>;
2703
- /**
2704
- * How the helper job ended:
2705
- * - `completed` — the container finished (it may or may not have fully fixed the
2706
- * issue; the gate's next precheck is the source of truth, and `summary` carries
2707
- * the agent's own account, e.g. which files it left conflicting).
2708
- * - `failed` — the job errored / was evicted without finishing.
2709
- */
2710
2057
  readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
2711
- /** The PR head commit the helper worked against, when known. */
2712
2058
  readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2713
- /**
2714
- * The fixing instructions handed to the helper for this round — the failing-check
2715
- * summary the CI gate fed the `ci-fixer`, the conflict reason / human-review comments
2716
- * the other gates fed their fixer. Stashed at dispatch and recorded with the attempt so
2717
- * the run-detail UI can show WHAT each round was asked to fix (not only that a round
2718
- * happened) — the gate analogue of the Tester attempt's `concerns`. Null when the gate
2719
- * hands its fixer no textual instructions (the conflicts gate: GitHub reports mergeability
2720
- * as a single bit and the harness leaves the conflict markers for the resolver).
2721
- */
2722
2059
  readonly instructions: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2723
- /**
2724
- * Structured failing checks handed to this attempt's helper (the CI gate's red check runs
2725
- * behind {@link instructions}), snapshotted at dispatch so each attempt shows the checks it
2726
- * set out to fix. Absent for the conflicts gate (no file-level detail) and when the round
2727
- * carried no structured checks.
2728
- */
2729
2060
  readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
2730
2061
  readonly name: v.StringSchema<undefined>;
2731
- /** GitHub conclusion (e.g. `failure`, `timed_out`), or null when not reported. */
2732
2062
  readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2733
- /**
2734
- * The check run's GitHub web URL (`html_url`), so the UI can link straight to the
2735
- * failed run's logs. Null when GitHub didn't report one.
2736
- */
2737
2063
  readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2738
- /**
2739
- * The repo (owner/name) this check belongs to, on a MULTI-REPO block — so the UI can group
2740
- * failing checks by service. Absent on a single-repo block (there is only the own repo).
2741
- */
2742
2064
  readonly repo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2743
2065
  }, undefined>, undefined>, undefined>, undefined>;
2744
- /** The helper's own summary (or the failure reason), naming what it did / what remains. */
2745
2066
  readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2746
2067
  }, undefined>, undefined>, undefined>, undefined>;
2747
- /**
2748
- * The number of approving reviews the PR had at the last probe, so the UI can show
2749
- * "1 / N approvals". The "required" side is derived from {@link requiredApprovingReviewCount}
2750
- * via the same `max(1, …)` floor the gate applies (see review.logic.ts) rather than persisted
2751
- * a second time. Absent for the other gates.
2752
- */
2753
2068
  readonly lastApprovals: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2754
- /**
2755
- * The raw branch-protection required-approving-review count, cached after the FIRST probe
2756
- * resolves it so subsequent polls skip the static protection read (branch protection is repo
2757
- * config, not PR activity — re-reading it every poll over a multi-day review only burns GitHub
2758
- * rate budget). The UI's displayed "required" count is `max(1, this)` (the gate's effective
2759
- * floor). Absent for the other gates.
2760
- */
2761
2069
  readonly requiredApprovingReviewCount: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2762
- /**
2763
- * The GraphQL ids of the review threads the gate just handed the `fixer`, stashed at
2764
- * dispatch so the helper-completion hook can post a reply + RESOLVE exactly those threads
2765
- * on GitHub before the next probe reads them. Absent for the other gates.
2766
- */
2767
2070
  readonly pendingThreadIds: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
2768
- /**
2769
- * Epoch ms of the newest plain PR comment the gate has already handed the `fixer`. Plain
2770
- * conversation comments (unlike review threads) can't be "resolved" on GitHub, so they are
2771
- * tracked by timestamp: a comment newer than this is outstanding; the dispatch advances it to
2772
- * the batch max. A reviewer's later comment (newer timestamp) re-opens the work. Absent for
2773
- * the other gates.
2774
- */
2775
2071
  readonly lastAddressedCommentAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2776
- /**
2777
- * The grace window (minutes) the human-review gate waits after the latest review comment
2778
- * before dispatching the fixer, resolved from the task's merge preset ONCE on first entry
2779
- * (alongside `maxAttempts`) so the probe doesn't re-resolve the preset every poll. Absent
2780
- * for the other gates.
2781
- */
2782
2072
  readonly humanReviewGraceMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2783
- /**
2784
- * A human-initiated freeform fix request parked on the gate (an in-app prompt). Consumed at
2785
- * the top of the next `evaluateGate` pass, which dispatches the fixer with these instructions
2786
- * folded in — bypassing the grace window. Absent for the other gates.
2787
- */
2788
2073
  readonly pendingFix: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2789
2074
  readonly instructions: v.StringSchema<undefined>;
2790
2075
  readonly at: v.NumberSchema<undefined>;
@@ -2962,52 +2247,26 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
2962
2247
  */
2963
2248
  readonly humanTest: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2964
2249
  readonly phase: v.PicklistSchema<["provisioning", "awaiting_human", "fixing", "resolving_conflicts", "passed"], undefined>;
2965
- /** The live ephemeral environment (null in degraded manual mode / after destroy). */
2966
2250
  readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2967
- /** The `environments` row id, so the window can fetch access creds / re-poll status. */
2968
2251
  readonly id: v.StringSchema<undefined>;
2969
- /** The provisioned public URL the human tests against (null while still provisioning). */
2970
2252
  readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
2971
- /** The environment lifecycle status; see {@link environmentStatusSchema}. */
2972
2253
  readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
2973
- /** Epoch ms the environment expires (TTL), when known. */
2974
2254
  readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2975
2255
  }, undefined>, undefined>, undefined>;
2976
- /**
2977
- * Why no environment was auto-provisioned — set in degraded manual mode (no env provider
2978
- * wired, or provisioning errored) so the window can explain it and let the human test
2979
- * against the PR branch manually. Absent when an env was provisioned.
2980
- */
2981
2256
  readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2982
- /** How many helper (fixer / conflict-resolver) attempts have been dispatched so far. */
2983
2257
  readonly attempts: v.NumberSchema<undefined>;
2984
- /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
2985
2258
  readonly maxAttempts: v.NumberSchema<undefined>;
2986
- /** The PR head commit being tested, when known. */
2987
2259
  readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2988
- /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
2989
2260
  readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2990
- /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
2991
2261
  readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
2992
- /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
2993
2262
  readonly findings: v.StringSchema<undefined>;
2994
- /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
2995
2263
  readonly helperKind: v.StringSchema<undefined>;
2996
- /** The helper job's id while it ran, for cross-referencing the run timeline. */
2997
2264
  readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2998
- /** How the helper ended once its job settled. Absent while still in flight. */
2999
2265
  readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
3000
- /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
3001
2266
  readonly at: v.NumberSchema<undefined>;
3002
2267
  }, undefined>, undefined>, undefined>;
3003
- /**
3004
- * Transient action the human requested while the gate is parked — recorded on the parked
3005
- * step and consumed by the durable driver when it re-enters the gate (the analogue of
3006
- * `pendingIncorporation` on a requirements gate). Cleared once the driver acts on it.
3007
- */
3008
2268
  readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3009
2269
  readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
3010
- /** The findings prompt for a `request-fix` action. */
3011
2270
  readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3012
2271
  }, undefined>, undefined>, undefined>;
3013
2272
  }, undefined>, undefined>, undefined>;
@@ -3017,19 +2276,14 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
3017
2276
  */
3018
2277
  readonly visualConfirm: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3019
2278
  readonly phase: v.PicklistSchema<["awaiting_human", "fixing", "approved"], undefined>;
3020
- /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
3021
2279
  readonly pairs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3022
2280
  readonly view: v.StringSchema<undefined>;
3023
2281
  readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3024
2282
  readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3025
2283
  }, undefined>, undefined>, undefined>;
3026
- /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
3027
2284
  readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3028
- /** How many fixer attempts have been dispatched so far. */
3029
2285
  readonly attempts: v.NumberSchema<undefined>;
3030
- /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
3031
2286
  readonly maxAttempts: v.NumberSchema<undefined>;
3032
- /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
3033
2287
  readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
3034
2288
  readonly findings: v.StringSchema<undefined>;
3035
2289
  readonly helperKind: v.StringSchema<undefined>;
@@ -3037,13 +2291,8 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
3037
2291
  readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
3038
2292
  readonly at: v.NumberSchema<undefined>;
3039
2293
  }, undefined>, undefined>, undefined>;
3040
- /**
3041
- * Transient action the human requested while parked — consumed by the durable driver
3042
- * when it re-enters the gate. Cleared once acted on.
3043
- */
3044
2294
  readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3045
2295
  readonly type: v.PicklistSchema<["approve", "request-fix", "recapture"], undefined>;
3046
- /** The findings prompt for a `request-fix` action. */
3047
2296
  readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3048
2297
  }, undefined>, undefined>, undefined>;
3049
2298
  }, undefined>, undefined>, undefined>;
@@ -3292,6 +2541,57 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
3292
2541
  }, "Provide exactly one of forkId or custom.">]>, undefined>, undefined>;
3293
2542
  readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3294
2543
  }, undefined>, undefined>, undefined>;
2544
+ /**
2545
+ * Live JUDGE state on a judge step (the fourth taxonomy bucket): the rubric identity, the
2546
+ * latest structured verdict, the per-task threshold it was compared against, the bounce
2547
+ * budget, and the round history. Created lazily by the engine on first entry and — like
2548
+ * `forkDecision` / `followUps` — deliberately PRESERVED across `resetStepForRerun`, so a
2549
+ * bounce that re-runs the producer plus this step does not erase the verdict it is looping
2550
+ * on. Absent for non-judge steps. See {@link judgeStepStateSchema}.
2551
+ */
2552
+ readonly judge: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2553
+ readonly status: v.PicklistSchema<["evaluating", "awaiting_decision", "bouncing", "passed", "failed", "skipped"], undefined>;
2554
+ readonly rubricId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2555
+ readonly rubricName: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2556
+ readonly rubricOverridden: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
2557
+ readonly verdict: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2558
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
2559
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
2560
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
2561
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
2562
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
2563
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
2564
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
2565
+ }, undefined>, undefined>, readonly []>, readonly []>;
2566
+ }, undefined>, undefined>, undefined>;
2567
+ readonly threshold: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
2568
+ readonly disposition: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>, undefined>, undefined>;
2569
+ readonly bounces: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
2570
+ readonly maxBounces: v.OptionalSchema<v.NumberSchema<undefined>, 1>;
2571
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2572
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2573
+ readonly round: v.NumberSchema<undefined>;
2574
+ readonly at: v.NumberSchema<undefined>;
2575
+ readonly verdict: v.ObjectSchema<{
2576
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
2577
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
2578
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
2579
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
2580
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
2581
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
2582
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
2583
+ }, undefined>, undefined>, readonly []>, readonly []>;
2584
+ }, undefined>;
2585
+ readonly disposition: v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>;
2586
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2587
+ }, undefined>, undefined>, readonly []>;
2588
+ readonly note: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2589
+ readonly resolution: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
2590
+ readonly choice: v.PicklistSchema<["proceed", "bounce", "stop"], undefined>;
2591
+ readonly feedback: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2592
+ readonly at: v.NumberSchema<undefined>;
2593
+ }, undefined>, undefined>, undefined>;
2594
+ }, undefined>, undefined>, undefined>;
3295
2595
  /**
3296
2596
  * Live "Ralph loop" state carried on a `ralph` step: the persistent retry-until-done
3297
2597
  * loop's iteration count, budget, validation command, and per-iteration history. Seeded
@@ -4126,7 +3426,13 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
4126
3426
  /**
4127
3427
  * Epoch-ms creation time, stamped when the run is first started. Gives a run a stable
4128
3428
  * creation timestamp independent of when its first step actually starts (the public-API
4129
- * job view reports it as `createdAt`). Absent on legacy runs persisted before this field.
3429
+ * job view reports it as `createdAt`).
3430
+ *
3431
+ * On a run READ BACK from storage this is the `agent_runs.created_at` COLUMN — the value
3432
+ * chronological reads order by — so a keyset cursor minted from a run names exactly the
3433
+ * position the next query resumes at. The insert adopts whatever the instance was stamped with
3434
+ * at start (`adoptCreatedAt`), so the in-memory run and its row never disagree. Optional only
3435
+ * because a run assembled in memory has not been persisted yet.
4130
3436
  */
4131
3437
  readonly createdAt: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
4132
3438
  /**