@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
@@ -0,0 +1,165 @@
1
+ import * as v from 'valibot';
2
+ export declare const humanTestEnvironmentSchema: v.ObjectSchema<{
3
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
4
+ readonly id: v.StringSchema<undefined>;
5
+ /** The provisioned public URL the human tests against (null while still provisioning). */
6
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
8
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
9
+ /** Epoch ms the environment expires (TTL), when known. */
10
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
11
+ }, undefined>;
12
+ export type HumanTestEnvironment = v.InferOutput<typeof humanTestEnvironmentSchema>;
13
+ /**
14
+ * One round of human-driven remediation on a `human-test` gate: the human wrote findings and
15
+ * asked for a fix (helper `fixer`), or pulled main and hit a conflict (helper
16
+ * `conflict-resolver`). Appended when the round opens and stamped with its outcome once the
17
+ * helper job settles, so the window can show the full history of what was asked and how it ended.
18
+ */
19
+ export declare const humanTestRoundSchema: v.ObjectSchema<{
20
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
21
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
22
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
23
+ readonly findings: v.StringSchema<undefined>;
24
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
25
+ readonly helperKind: v.StringSchema<undefined>;
26
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
27
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
28
+ /** How the helper ended once its job settled. Absent while still in flight. */
29
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
30
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
31
+ readonly at: v.NumberSchema<undefined>;
32
+ }, undefined>;
33
+ export type HumanTestRound = v.InferOutput<typeof humanTestRoundSchema>;
34
+ /**
35
+ * State a `human-test` gate carries while it runs. Unlike a polling gate (`ci`/`conflicts`)
36
+ * there is no programmatic verdict — the HUMAN is the verdict — so the step spins up an
37
+ * ephemeral environment, parks for a person to validate it, and on demand dispatches the same
38
+ * helpers the other gates use (the Tester's `fixer` for findings; the `conflict-resolver` for a
39
+ * conflicting pull-main). Phases:
40
+ * - `provisioning` — an environment is being stood up (the driver polls until ready).
41
+ * - `awaiting_human` — parked: the human tests the env and confirms / requests a fix / etc.
42
+ * - `fixing` — a `fixer` job (from the human's findings) is in flight.
43
+ * - `resolving_conflicts` — a `conflict-resolver` job (from a conflicting pull-main) is in flight.
44
+ * - `passed` — the human confirmed; the env is torn down and the run advances.
45
+ */
46
+ export declare const humanTestStepStateSchema: v.ObjectSchema<{
47
+ readonly phase: v.PicklistSchema<["provisioning", "awaiting_human", "fixing", "resolving_conflicts", "passed"], undefined>;
48
+ /** The live ephemeral environment (null in degraded manual mode / after destroy). */
49
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
50
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
51
+ readonly id: v.StringSchema<undefined>;
52
+ /** The provisioned public URL the human tests against (null while still provisioning). */
53
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
54
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
55
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
56
+ /** Epoch ms the environment expires (TTL), when known. */
57
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
58
+ }, undefined>, undefined>, undefined>;
59
+ /**
60
+ * Why no environment was auto-provisioned — set in degraded manual mode (no env provider
61
+ * wired, or provisioning errored) so the window can explain it and let the human test
62
+ * against the PR branch manually. Absent when an env was provisioned.
63
+ */
64
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
65
+ /** How many helper (fixer / conflict-resolver) attempts have been dispatched so far. */
66
+ readonly attempts: v.NumberSchema<undefined>;
67
+ /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
68
+ readonly maxAttempts: v.NumberSchema<undefined>;
69
+ /** The PR head commit being tested, when known. */
70
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
71
+ /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
72
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
73
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
74
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
75
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
76
+ readonly findings: v.StringSchema<undefined>;
77
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
78
+ readonly helperKind: v.StringSchema<undefined>;
79
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
80
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
81
+ /** How the helper ended once its job settled. Absent while still in flight. */
82
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
83
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
84
+ readonly at: v.NumberSchema<undefined>;
85
+ }, undefined>, undefined>, undefined>;
86
+ /**
87
+ * Transient action the human requested while the gate is parked — recorded on the parked
88
+ * step and consumed by the durable driver when it re-enters the gate (the analogue of
89
+ * `pendingIncorporation` on a requirements gate). Cleared once the driver acts on it.
90
+ */
91
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
92
+ readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
93
+ /** The findings prompt for a `request-fix` action. */
94
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
95
+ }, undefined>, undefined>, undefined>;
96
+ }, undefined>;
97
+ export type HumanTestStepState = v.InferOutput<typeof humanTestStepStateSchema>;
98
+ /**
99
+ * One actual-vs-reference pairing the visual-confirmation gate shows the human: a logical
100
+ * view, the screenshot the UI tester captured of it (`actualArtifactId`), and the reference
101
+ * design image for the same view when one was uploaded (`referenceArtifactId`). Either side
102
+ * may be absent (a captured view with no reference, or a reference whose view wasn't captured).
103
+ */
104
+ export declare const visualConfirmPairSchema: v.ObjectSchema<{
105
+ readonly view: v.StringSchema<undefined>;
106
+ readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
107
+ readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
108
+ }, undefined>;
109
+ export type VisualConfirmPair = v.InferOutput<typeof visualConfirmPairSchema>;
110
+ /** One human-requested fix round on a visual-confirmation gate (dispatches the `fixer`). */
111
+ export declare const visualConfirmRoundSchema: v.ObjectSchema<{
112
+ readonly findings: v.StringSchema<undefined>;
113
+ readonly helperKind: v.StringSchema<undefined>;
114
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
115
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
116
+ readonly at: v.NumberSchema<undefined>;
117
+ }, undefined>;
118
+ export type VisualConfirmRound = v.InferOutput<typeof visualConfirmRoundSchema>;
119
+ /**
120
+ * State a `visual-confirmation` gate carries while it runs. Like `human-test` there is no
121
+ * programmatic verdict — a HUMAN reviews the UI tester's screenshots against the uploaded
122
+ * reference designs and approves, or requests a fix (which dispatches the `fixer` and then
123
+ * re-captures via the UI tester). Phases:
124
+ * - `awaiting_human`— parked: the human reviews actual-vs-reference and approves / requests a fix.
125
+ * - `fixing` — a `fixer` job (from the human's findings) is in flight.
126
+ * - `approved` — the human approved; the run advances.
127
+ *
128
+ * (A dedicated `capturing` phase for an auto re-run of the UI tester after a fix is deferred
129
+ * until that loop is wired — see the visual-confirmation handover doc — so it is intentionally
130
+ * absent from the picklist rather than carried as dead state.)
131
+ */
132
+ export declare const visualConfirmStepStateSchema: v.ObjectSchema<{
133
+ readonly phase: v.PicklistSchema<["awaiting_human", "fixing", "approved"], undefined>;
134
+ /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
135
+ readonly pairs: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
136
+ readonly view: v.StringSchema<undefined>;
137
+ readonly actualArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
138
+ readonly referenceArtifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
139
+ }, undefined>, undefined>, undefined>;
140
+ /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
141
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
142
+ /** How many fixer attempts have been dispatched so far. */
143
+ readonly attempts: v.NumberSchema<undefined>;
144
+ /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
145
+ readonly maxAttempts: v.NumberSchema<undefined>;
146
+ /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
147
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
148
+ readonly findings: v.StringSchema<undefined>;
149
+ readonly helperKind: v.StringSchema<undefined>;
150
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
151
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
152
+ readonly at: v.NumberSchema<undefined>;
153
+ }, undefined>, undefined>, undefined>;
154
+ /**
155
+ * Transient action the human requested while parked — consumed by the durable driver
156
+ * when it re-enters the gate. Cleared once acted on.
157
+ */
158
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
159
+ readonly type: v.PicklistSchema<["approve", "request-fix", "recapture"], undefined>;
160
+ /** The findings prompt for a `request-fix` action. */
161
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
162
+ }, undefined>, undefined>, undefined>;
163
+ }, undefined>;
164
+ export type VisualConfirmStepState = v.InferOutput<typeof visualConfirmStepStateSchema>;
165
+ //# sourceMappingURL=human-verdict-gates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-verdict-gates.d.ts","sourceRoot":"","sources":["../src/human-verdict-gates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAe5B,eAAO,MAAM,0BAA0B;IACrC,wFAAwF;;IAExF,0FAA0F;;IAE1F,6EAA6E;;IAE7E,0DAA0D;;aAE1D,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;IAC/B,uFAAuF;;IAEvF,qFAAqF;;IAErF,uFAAuF;;IAEvF,gFAAgF;;IAEhF,+EAA+E;;IAE/E,6EAA6E;;aAE7E,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB;;IAEnC,qFAAqF;;QA/CrF,wFAAwF;;QAExF,0FAA0F;;QAE1F,6EAA6E;;QAE7E,0DAA0D;;;IA2C1D;;;;OAIG;;IAEH,wFAAwF;;IAExF,2FAA2F;;IAE3F,mDAAmD;;IAEnD,uFAAuF;;QA3CvF,uFAAuF;;QAEvF,qFAAqF;;QAErF,uFAAuF;;QAEvF,gFAAgF;;QAEhF,+EAA+E;;QAE/E,6EAA6E;;;IAmC7E;;;;OAIG;;;QAKG,sDAAsD;;;aAK5D,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;aAIlC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,4FAA4F;AAC5F,eAAO,MAAM,wBAAwB;;;;;;aAMnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;;IAEvC,sFAAsF;;;;;;IAEtF,+FAA+F;;IAE/F,2DAA2D;;IAE3D,0FAA0F;;IAE1F,+EAA+E;;;;;;;;IAE/E;;;OAGG;;;QAKG,sDAAsD;;;aAK5D,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
@@ -0,0 +1,139 @@
1
+ import * as v from 'valibot';
2
+ import { environmentStatusSchema } from './environments.js';
3
+ // ---------------------------------------------------------------------------
4
+ // HUMAN-VERDICT gate step states: the parked state of the two gates whose verdict is a PERSON,
5
+ // not a provider probe — `human-test` (validate a live ephemeral environment) and
6
+ // `visual-confirmation` (review the UI tester's screenshots against the reference designs).
7
+ //
8
+ // They are grouped here, apart from the polling gates' `GateStepState` in `execution.ts`, because
9
+ // they share a shape the programmatic gates do not have: an append-only history of human-requested
10
+ // helper `rounds`, and a transient `pendingAction` the human sets while the step is parked, which
11
+ // the durable driver consumes on re-entry (the analogue of a requirements gate's
12
+ // `pendingIncorporation`). A third human-verdict gate belongs in this file, not in `execution.ts`.
13
+ // ---------------------------------------------------------------------------
14
+ export const humanTestEnvironmentSchema = v.object({
15
+ /** The `environments` row id, so the window can fetch access creds / re-poll status. */
16
+ id: v.string(),
17
+ /** The provisioned public URL the human tests against (null while still provisioning). */
18
+ url: v.nullable(v.string()),
19
+ /** The environment lifecycle status; see {@link environmentStatusSchema}. */
20
+ status: environmentStatusSchema,
21
+ /** Epoch ms the environment expires (TTL), when known. */
22
+ expiresAt: v.optional(v.nullable(v.number())),
23
+ });
24
+ /**
25
+ * One round of human-driven remediation on a `human-test` gate: the human wrote findings and
26
+ * asked for a fix (helper `fixer`), or pulled main and hit a conflict (helper
27
+ * `conflict-resolver`). Appended when the round opens and stamped with its outcome once the
28
+ * helper job settles, so the window can show the full history of what was asked and how it ended.
29
+ */
30
+ export const humanTestRoundSchema = v.object({
31
+ /** The kind of round — a findings-driven fix or a pull-main-with-conflicts resolve. */
32
+ kind: v.picklist(['fix', 'pull-main']),
33
+ /** The human's findings prompt (fix), or a one-line note for the pull-main round. */
34
+ findings: v.string(),
35
+ /** The helper container kind this round dispatched (`fixer` / `conflict-resolver`). */
36
+ helperKind: v.string(),
37
+ /** The helper job's id while it ran, for cross-referencing the run timeline. */
38
+ jobId: v.optional(v.nullable(v.string())),
39
+ /** How the helper ended once its job settled. Absent while still in flight. */
40
+ outcome: v.optional(v.nullable(v.picklist(['completed', 'failed']))),
41
+ /** Epoch ms the round opened (the human clicked Request fix / Pull main). */
42
+ at: v.number(),
43
+ });
44
+ /**
45
+ * State a `human-test` gate carries while it runs. Unlike a polling gate (`ci`/`conflicts`)
46
+ * there is no programmatic verdict — the HUMAN is the verdict — so the step spins up an
47
+ * ephemeral environment, parks for a person to validate it, and on demand dispatches the same
48
+ * helpers the other gates use (the Tester's `fixer` for findings; the `conflict-resolver` for a
49
+ * conflicting pull-main). Phases:
50
+ * - `provisioning` — an environment is being stood up (the driver polls until ready).
51
+ * - `awaiting_human` — parked: the human tests the env and confirms / requests a fix / etc.
52
+ * - `fixing` — a `fixer` job (from the human's findings) is in flight.
53
+ * - `resolving_conflicts` — a `conflict-resolver` job (from a conflicting pull-main) is in flight.
54
+ * - `passed` — the human confirmed; the env is torn down and the run advances.
55
+ */
56
+ export const humanTestStepStateSchema = v.object({
57
+ phase: v.picklist(['provisioning', 'awaiting_human', 'fixing', 'resolving_conflicts', 'passed']),
58
+ /** The live ephemeral environment (null in degraded manual mode / after destroy). */
59
+ environment: v.optional(v.nullable(humanTestEnvironmentSchema)),
60
+ /**
61
+ * Why no environment was auto-provisioned — set in degraded manual mode (no env provider
62
+ * wired, or provisioning errored) so the window can explain it and let the human test
63
+ * against the PR branch manually. Absent when an env was provisioned.
64
+ */
65
+ degradedReason: v.optional(v.nullable(v.string())),
66
+ /** How many helper (fixer / conflict-resolver) attempts have been dispatched so far. */
67
+ attempts: v.number(),
68
+ /** Ceiling on helper attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
69
+ maxAttempts: v.number(),
70
+ /** The PR head commit being tested, when known. */
71
+ headSha: v.optional(v.nullable(v.string())),
72
+ /** Append-only history of fix / pull-main rounds; see {@link humanTestRoundSchema}. */
73
+ rounds: v.optional(v.array(humanTestRoundSchema)),
74
+ /**
75
+ * Transient action the human requested while the gate is parked — recorded on the parked
76
+ * step and consumed by the durable driver when it re-enters the gate (the analogue of
77
+ * `pendingIncorporation` on a requirements gate). Cleared once the driver acts on it.
78
+ */
79
+ pendingAction: v.optional(v.nullable(v.object({
80
+ type: v.picklist(['confirm', 'request-fix', 'pull-main', 'recreate']),
81
+ /** The findings prompt for a `request-fix` action. */
82
+ findings: v.optional(v.string()),
83
+ }))),
84
+ });
85
+ /**
86
+ * One actual-vs-reference pairing the visual-confirmation gate shows the human: a logical
87
+ * view, the screenshot the UI tester captured of it (`actualArtifactId`), and the reference
88
+ * design image for the same view when one was uploaded (`referenceArtifactId`). Either side
89
+ * may be absent (a captured view with no reference, or a reference whose view wasn't captured).
90
+ */
91
+ export const visualConfirmPairSchema = v.object({
92
+ view: v.string(),
93
+ actualArtifactId: v.optional(v.nullable(v.string())),
94
+ referenceArtifactId: v.optional(v.nullable(v.string())),
95
+ });
96
+ /** One human-requested fix round on a visual-confirmation gate (dispatches the `fixer`). */
97
+ export const visualConfirmRoundSchema = v.object({
98
+ findings: v.string(),
99
+ helperKind: v.string(),
100
+ jobId: v.optional(v.nullable(v.string())),
101
+ outcome: v.optional(v.nullable(v.picklist(['completed', 'failed']))),
102
+ at: v.number(),
103
+ });
104
+ /**
105
+ * State a `visual-confirmation` gate carries while it runs. Like `human-test` there is no
106
+ * programmatic verdict — a HUMAN reviews the UI tester's screenshots against the uploaded
107
+ * reference designs and approves, or requests a fix (which dispatches the `fixer` and then
108
+ * re-captures via the UI tester). Phases:
109
+ * - `awaiting_human`— parked: the human reviews actual-vs-reference and approves / requests a fix.
110
+ * - `fixing` — a `fixer` job (from the human's findings) is in flight.
111
+ * - `approved` — the human approved; the run advances.
112
+ *
113
+ * (A dedicated `capturing` phase for an auto re-run of the UI tester after a fix is deferred
114
+ * until that loop is wired — see the visual-confirmation handover doc — so it is intentionally
115
+ * absent from the picklist rather than carried as dead state.)
116
+ */
117
+ export const visualConfirmStepStateSchema = v.object({
118
+ phase: v.picklist(['awaiting_human', 'fixing', 'approved']),
119
+ /** The actual-vs-reference pairs the human reviews, refreshed on each (re)capture. */
120
+ pairs: v.optional(v.array(visualConfirmPairSchema)),
121
+ /** Set when no screenshots could be gathered (no UI tester ran / no storage) — manual mode. */
122
+ degradedReason: v.optional(v.nullable(v.string())),
123
+ /** How many fixer attempts have been dispatched so far. */
124
+ attempts: v.number(),
125
+ /** Ceiling on fixer attempts, resolved from the task's merge preset (`ciMaxAttempts`). */
126
+ maxAttempts: v.number(),
127
+ /** Append-only history of fix rounds; see {@link visualConfirmRoundSchema}. */
128
+ rounds: v.optional(v.array(visualConfirmRoundSchema)),
129
+ /**
130
+ * Transient action the human requested while parked — consumed by the durable driver
131
+ * when it re-enters the gate. Cleared once acted on.
132
+ */
133
+ pendingAction: v.optional(v.nullable(v.object({
134
+ type: v.picklist(['approve', 'request-fix', 'recapture']),
135
+ /** The findings prompt for a `request-fix` action. */
136
+ findings: v.optional(v.string()),
137
+ }))),
138
+ });
139
+ //# sourceMappingURL=human-verdict-gates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-verdict-gates.js","sourceRoot":"","sources":["../src/human-verdict-gates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,8EAA8E;AAC9E,+FAA+F;AAC/F,kFAAkF;AAClF,4FAA4F;AAC5F,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,iFAAiF;AACjF,mGAAmG;AACnG,8EAA8E;AAE9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,wFAAwF;IACxF,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,0FAA0F;IAC1F,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3B,6EAA6E;IAC7E,MAAM,EAAE,uBAAuB;IAC/B,0DAA0D;IAC1D,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CAC9C,CAAC,CAAA;AAGF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,uFAAuF;IACvF,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACtC,qFAAqF;IACrF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,uFAAuF;IACvF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,gFAAgF;IAChF,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,Q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C,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACnD,+FAA+F;IAC/F,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,0FAA0F;IAC1F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,+EAA+E;IAC/E,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACrD;;;OAGG;IACH,aAAa,EAAE,CAAC,CAAC,QAAQ,CACvB,CAAC,CAAC,QAAQ,CACR,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QACzD,sDAAsD;QACtD,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACjC,CAAC,CACH,CACF;CACF,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './errors.js';
3
3
  export * from './config.js';
4
4
  export * from './entities.js';
5
5
  export * from './execution.js';
6
+ export * from './human-verdict-gates.js';
6
7
  export * from './frontend.js';
7
8
  export * from './service-connections.js';
8
9
  export * from './preview.js';
@@ -42,6 +43,8 @@ export * from './requirements.js';
42
43
  export * from './doc-interview.js';
43
44
  export * from './followUp.js';
44
45
  export * from './forkDecision.js';
46
+ export * from './gate.js';
47
+ export * from './judge.js';
45
48
  export * from './ralph.js';
46
49
  export * from './validation-checks.js';
47
50
  export * from './reproduction.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;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BAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export * from './errors.js';
3
3
  export * from './config.js';
4
4
  export * from './entities.js';
5
5
  export * from './execution.js';
6
+ export * from './human-verdict-gates.js';
6
7
  export * from './frontend.js';
7
8
  export * from './service-connections.js';
8
9
  export * from './preview.js';
@@ -42,6 +43,8 @@ export * from './requirements.js';
42
43
  export * from './doc-interview.js';
43
44
  export * from './followUp.js';
44
45
  export * from './forkDecision.js';
46
+ export * from './gate.js';
47
+ export * from './judge.js';
45
48
  export * from './ralph.js';
46
49
  export * from './validation-checks.js';
47
50
  export * from './reproduction.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa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gB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1,181 @@
1
+ import * as v from 'valibot';
2
+ /** Default minimum verdict score (0..1) a judge requires to advance the run. */
3
+ export declare const DEFAULT_JUDGE_MIN_SCORE = 0.7;
4
+ /** Default number of bounce rounds a judge may spend before it must ask a human. */
5
+ export declare const DEFAULT_JUDGE_MAX_BOUNCES = 1;
6
+ /** How serious one judge finding is. Ordered low < medium < high < critical. */
7
+ export declare const judgeFindingSeveritySchema: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
8
+ export type JudgeFindingSeverity = v.InferOutput<typeof judgeFindingSeveritySchema>;
9
+ /**
10
+ * One concrete thing the rubric flagged. `title` is the headline a human (or the bounced
11
+ * producer) acts on; `detail` is the evidence. Both are MODEL-AUTHORED text — every render
12
+ * of them onto a host-parsed surface (the PR body) goes through kernel's `hostMarkdown`
13
+ * helpers plus `redactSecrets`, exactly like the rest of the verification report.
14
+ */
15
+ export declare const judgeFindingSchema: v.ObjectSchema<{
16
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
17
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
18
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
19
+ /** Where the finding applies, when the judge could localise it (`path` or `path:line`). */
20
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
21
+ }, undefined>;
22
+ export type JudgeFinding = v.InferOutput<typeof judgeFindingSchema>;
23
+ /**
24
+ * The canonical structured verdict a judge's assessment returns. A registration MAY supply
25
+ * its own valibot schema (the driver parses against whatever it registered), but the value
26
+ * must still expose a `score` — that is the number the per-task threshold compares — so the
27
+ * shared window and the PR report can render any judge without knowing its rubric.
28
+ *
29
+ * Every field is `v.fallback`-wrapped so ONE noisy field degrades to its default instead of
30
+ * discarding an otherwise-usable verdict (the `securityAssessment` precedent in the example
31
+ * custom-agent package): a model that reports `score` on a 0..100 scale must not cost us the
32
+ * findings beside it.
33
+ */
34
+ export declare const judgeVerdictSchema: v.ObjectSchema<{
35
+ /** How well the work meets the rubric, 0..1 (higher is better). Missing ⇒ 0 (fails). */
36
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
37
+ /** The judge's prose justification — what it looked at and why it scored that way. */
38
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
39
+ /** What the rubric flagged. Empty on a clean verdict. */
40
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
41
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
42
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
43
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
44
+ /** Where the finding applies, when the judge could localise it (`path` or `path:line`). */
45
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
46
+ }, undefined>, undefined>, readonly []>, readonly []>;
47
+ }, undefined>;
48
+ export type JudgeVerdict = v.InferOutput<typeof judgeVerdictSchema>;
49
+ /**
50
+ * What the engine DID with a verdict:
51
+ * - `pass` — at or above the threshold; the run advances.
52
+ * - `park` — a human must decide (the registration's `onFail`, or a spent bounce budget).
53
+ * - `bounce` — the preceding producing step was re-armed with the findings as rework.
54
+ * - `fail` — the run was failed with the verdict summary.
55
+ */
56
+ export declare const judgeDispositionSchema: v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>;
57
+ export type JudgeDisposition = v.InferOutput<typeof judgeDispositionSchema>;
58
+ /**
59
+ * The judge step's lifecycle:
60
+ * - `evaluating` — the assessment is running (transient; the driver holds the step).
61
+ * - `awaiting_decision` — parked; a human picks proceed / bounce / stop.
62
+ * - `bouncing` — the producer was re-armed; the judge re-runs when it returns.
63
+ * - `passed` / `failed` — settled.
64
+ * - `skipped` — no assessor wired (pass-through), or nothing to judge.
65
+ */
66
+ export declare const judgeStatusSchema: v.PicklistSchema<["evaluating", "awaiting_decision", "bouncing", "passed", "failed", "skipped"], undefined>;
67
+ export type JudgeStatus = v.InferOutput<typeof judgeStatusSchema>;
68
+ /** One completed round of the judge loop (assessment + what the engine did with it). */
69
+ export declare const judgeRoundSchema: v.ObjectSchema<{
70
+ /** 1-based round number; the first assessment is round 1. */
71
+ readonly round: v.NumberSchema<undefined>;
72
+ readonly at: v.NumberSchema<undefined>;
73
+ readonly verdict: v.ObjectSchema<{
74
+ /** How well the work meets the rubric, 0..1 (higher is better). Missing ⇒ 0 (fails). */
75
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
76
+ /** The judge's prose justification — what it looked at and why it scored that way. */
77
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
78
+ /** What the rubric flagged. Empty on a clean verdict. */
79
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
80
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
81
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
82
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
83
+ /** Where the finding applies, when the judge could localise it (`path` or `path:line`). */
84
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
85
+ }, undefined>, undefined>, readonly []>, readonly []>;
86
+ }, undefined>;
87
+ readonly disposition: v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>;
88
+ /** The model that produced this round's verdict. */
89
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
90
+ }, undefined>;
91
+ export type JudgeRound = v.InferOutput<typeof judgeRoundSchema>;
92
+ /**
93
+ * Live judge state carried on the run's judge step — the analogue of `GateStepState`.
94
+ * Created lazily by the engine on first entry; the rubric itself is NOT persisted here
95
+ * (only its identity), since a rubric body can be many KB and the step row is re-serialized
96
+ * on every progress write.
97
+ */
98
+ export declare const judgeStepStateSchema: v.ObjectSchema<{
99
+ readonly status: v.PicklistSchema<["evaluating", "awaiting_decision", "bouncing", "passed", "failed", "skipped"], undefined>;
100
+ /** The rubric's stable id (the registration's, or the overriding fragment's). */
101
+ readonly rubricId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
102
+ /** The rubric's human name, for the window + the PR report. */
103
+ readonly rubricName: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
104
+ /** Whether the rubric body came from a workspace fragment override rather than the default. */
105
+ readonly rubricOverridden: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
106
+ /** The most recent verdict; null until the first assessment settles. */
107
+ readonly verdict: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
108
+ /** How well the work meets the rubric, 0..1 (higher is better). Missing ⇒ 0 (fails). */
109
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
110
+ /** The judge's prose justification — what it looked at and why it scored that way. */
111
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
112
+ /** What the rubric flagged. Empty on a clean verdict. */
113
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
114
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
115
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
116
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
117
+ /** Where the finding applies, when the judge could localise it (`path` or `path:line`). */
118
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
119
+ }, undefined>, undefined>, readonly []>, readonly []>;
120
+ }, undefined>, undefined>, undefined>;
121
+ /** The score the verdict had to reach, resolved from the task's merge preset. */
122
+ readonly threshold: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
123
+ /** What the engine did with the most recent verdict. */
124
+ readonly disposition: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>, undefined>, undefined>;
125
+ /** How many bounce rounds have been spent, and the ceiling from the merge preset. */
126
+ readonly bounces: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
127
+ readonly maxBounces: v.OptionalSchema<v.NumberSchema<undefined>, 1>;
128
+ /** The model that produced the most recent verdict. */
129
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
130
+ /** Every settled round, oldest first — so the window shows the loop, not just its end. */
131
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
132
+ /** 1-based round number; the first assessment is round 1. */
133
+ readonly round: v.NumberSchema<undefined>;
134
+ readonly at: v.NumberSchema<undefined>;
135
+ readonly verdict: v.ObjectSchema<{
136
+ /** How well the work meets the rubric, 0..1 (higher is better). Missing ⇒ 0 (fails). */
137
+ readonly score: v.SchemaWithFallback<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, 0>;
138
+ /** The judge's prose justification — what it looked at and why it scored that way. */
139
+ readonly summary: v.SchemaWithFallback<v.StringSchema<undefined>, "">;
140
+ /** What the rubric flagged. Empty on a clean verdict. */
141
+ readonly findings: v.OptionalSchema<v.SchemaWithFallback<v.ArraySchema<v.ObjectSchema<{
142
+ readonly title: v.SchemaWithFallback<v.StringSchema<undefined>, "Untitled finding">;
143
+ readonly detail: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
144
+ readonly severity: v.SchemaWithFallback<v.PicklistSchema<["low", "medium", "high", "critical"], undefined>, "medium">;
145
+ /** Where the finding applies, when the judge could localise it (`path` or `path:line`). */
146
+ readonly where: v.SchemaWithFallback<v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>;
147
+ }, undefined>, undefined>, readonly []>, readonly []>;
148
+ }, undefined>;
149
+ readonly disposition: v.PicklistSchema<["pass", "park", "bounce", "fail"], undefined>;
150
+ /** The model that produced this round's verdict. */
151
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
152
+ }, undefined>, undefined>, readonly []>;
153
+ /**
154
+ * Why the judge is `skipped`, or why a disposition degraded (e.g. a `bounce` with no
155
+ * preceding producing step to bounce to). Surfaced verbatim in the window + PR report,
156
+ * because a judge that quietly did nothing is indistinguishable from one that passed.
157
+ */
158
+ readonly note: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
159
+ /** The human's resolution of a park, once made. */
160
+ readonly resolution: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
161
+ readonly choice: v.PicklistSchema<["proceed", "bounce", "stop"], undefined>;
162
+ readonly feedback: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
163
+ readonly at: v.NumberSchema<undefined>;
164
+ }, undefined>, undefined>, undefined>;
165
+ }, undefined>;
166
+ export type JudgeStepState = v.InferOutput<typeof judgeStepStateSchema>;
167
+ /**
168
+ * Resolve a parked judge:
169
+ * - `proceed` — advance despite the verdict (the human overrules the rubric);
170
+ * - `bounce` — spend a rework round on the producing step, even past the budget;
171
+ * - `stop` — fail the run.
172
+ * `feedback` is folded into a `bounce`'s rework brief (and recorded either way).
173
+ */
174
+ export declare const resolveJudgeSchema: v.ObjectSchema<{
175
+ readonly choice: v.PicklistSchema<["proceed", "bounce", "stop"], undefined>;
176
+ readonly feedback: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 4000, undefined>]>, undefined>, undefined>;
177
+ }, undefined>;
178
+ export type ResolveJudgeInput = v.InferOutput<typeof resolveJudgeSchema>;
179
+ /** Parse-or-throw a verdict payload an assessment returned (the engine validates it). */
180
+ export declare function parseJudgeVerdict(value: unknown): JudgeVerdict;
181
+ //# sourceMappingURL=judge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../src/judge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAoB5B,gFAAgF;AAChF,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,IAAI,CAAA;AAE1C,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,oEAAoD,CAAA;AAC3F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;IAI7B,2FAA2F;;aAE3F,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB;IAC7B,wFAAwF;;IAExF,sFAAsF;;IAEtF,yDAAyD;;;;;QArBzD,2FAA2F;;;aAuB3F,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,iEAAiD,CAAA;AACpF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,6GAO5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE,wFAAwF;AACxF,eAAO,MAAM,gBAAgB;IAC3B,6DAA6D;;;;QAvC7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