@cleocode/contracts 2026.4.69 → 2026.4.72

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 (71) hide show
  1. package/dist/__tests__/acceptance-gate.test.d.ts +14 -0
  2. package/dist/__tests__/acceptance-gate.test.d.ts.map +1 -0
  3. package/dist/__tests__/acceptance-gate.test.js +642 -0
  4. package/dist/__tests__/acceptance-gate.test.js.map +1 -0
  5. package/dist/__tests__/attachment.test.d.ts +17 -0
  6. package/dist/__tests__/attachment.test.d.ts.map +1 -0
  7. package/dist/__tests__/attachment.test.js +505 -0
  8. package/dist/__tests__/attachment.test.js.map +1 -0
  9. package/dist/__tests__/evidence-record.test.d.ts +14 -0
  10. package/dist/__tests__/evidence-record.test.d.ts.map +1 -0
  11. package/dist/__tests__/evidence-record.test.js +362 -0
  12. package/dist/__tests__/evidence-record.test.js.map +1 -0
  13. package/dist/__tests__/invariants.test.d.ts +19 -0
  14. package/dist/__tests__/invariants.test.d.ts.map +1 -0
  15. package/dist/__tests__/invariants.test.js +351 -0
  16. package/dist/__tests__/invariants.test.js.map +1 -0
  17. package/dist/acceptance-gate-schema.d.ts +701 -0
  18. package/dist/acceptance-gate-schema.d.ts.map +1 -0
  19. package/dist/acceptance-gate-schema.js +303 -0
  20. package/dist/acceptance-gate-schema.js.map +1 -0
  21. package/dist/acceptance-gate.d.ts +350 -0
  22. package/dist/acceptance-gate.d.ts.map +1 -0
  23. package/dist/acceptance-gate.js +22 -0
  24. package/dist/acceptance-gate.js.map +1 -0
  25. package/dist/attachment-schema.d.ts +243 -0
  26. package/dist/attachment-schema.d.ts.map +1 -0
  27. package/dist/attachment-schema.js +200 -0
  28. package/dist/attachment-schema.js.map +1 -0
  29. package/dist/attachment.d.ts +224 -0
  30. package/dist/attachment.d.ts.map +1 -0
  31. package/dist/attachment.js +21 -0
  32. package/dist/attachment.js.map +1 -0
  33. package/dist/evidence-record-schema.d.ts +202 -0
  34. package/dist/evidence-record-schema.d.ts.map +1 -0
  35. package/dist/evidence-record-schema.js +130 -0
  36. package/dist/evidence-record-schema.js.map +1 -0
  37. package/dist/evidence-record.d.ts +167 -0
  38. package/dist/evidence-record.d.ts.map +1 -0
  39. package/dist/evidence-record.js +21 -0
  40. package/dist/evidence-record.js.map +1 -0
  41. package/dist/index.d.ts +12 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +6 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/task-evidence.d.ts +251 -0
  46. package/dist/task-evidence.d.ts.map +1 -0
  47. package/dist/task-evidence.js +89 -0
  48. package/dist/task-evidence.js.map +1 -0
  49. package/dist/task.d.ts +23 -4
  50. package/dist/task.d.ts.map +1 -1
  51. package/package.json +8 -2
  52. package/schemas/acceptance-gate.schema.json +9 -0
  53. package/schemas/attachment.schema.json +9 -0
  54. package/schemas/gate-result-details.schema.json +9 -0
  55. package/schemas/gate-result.schema.json +9 -0
  56. package/schemas/manifest-v1.json +176 -0
  57. package/schemas/task-evidence.schema.json +9 -0
  58. package/schemas/task.schema.json +9 -0
  59. package/src/__tests__/acceptance-gate.test.ts +736 -0
  60. package/src/__tests__/attachment.test.ts +601 -0
  61. package/src/__tests__/evidence-record.test.ts +412 -0
  62. package/src/__tests__/invariants.test.ts +445 -0
  63. package/src/acceptance-gate-schema.ts +347 -0
  64. package/src/acceptance-gate.ts +370 -0
  65. package/src/attachment-schema.ts +223 -0
  66. package/src/attachment.ts +245 -0
  67. package/src/evidence-record-schema.ts +158 -0
  68. package/src/evidence-record.ts +182 -0
  69. package/src/index.ts +114 -1
  70. package/src/task-evidence.ts +239 -0
  71. package/src/task.ts +24 -4
@@ -0,0 +1,701 @@
1
+ /**
2
+ * Zod validation schemas for {@link AcceptanceGate} and related types.
3
+ *
4
+ * Kept in a separate file from the plain TypeScript types so that consumers
5
+ * that do not need runtime validation (e.g. type-only imports) pay zero cost.
6
+ *
7
+ * All schemas are named `*Schema` and derive their inferred types from the
8
+ * canonical TypeScript interfaces in `./acceptance-gate.ts`.
9
+ *
10
+ * @epic T760
11
+ * @task T763
12
+ * @task T779
13
+ */
14
+ import { z } from 'zod';
15
+ /**
16
+ * Zod schema for {@link GateBase} — fields every gate variant carries.
17
+ *
18
+ * Not exported as a standalone validator because it is always composed into a
19
+ * full gate schema via `z.discriminatedUnion`. Exported so downstream packages
20
+ * can extend it (e.g. for migration or testing).
21
+ */
22
+ export declare const gateBaseSchema: z.ZodObject<{
23
+ req: z.ZodOptional<z.ZodString>;
24
+ description: z.ZodString;
25
+ advisory: z.ZodOptional<z.ZodBoolean>;
26
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * Zod schema for {@link FileAssertion}.
30
+ *
31
+ * Each variant carries a `type` literal that drives the discriminated union.
32
+ */
33
+ export declare const fileAssertionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ type: z.ZodLiteral<"exists">;
35
+ }, z.core.$strip>, z.ZodObject<{
36
+ type: z.ZodLiteral<"absent">;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ type: z.ZodLiteral<"nonEmpty">;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ type: z.ZodLiteral<"maxBytes">;
41
+ value: z.ZodNumber;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ type: z.ZodLiteral<"minBytes">;
44
+ value: z.ZodNumber;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<"contains">;
47
+ value: z.ZodString;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<"matches">;
50
+ regex: z.ZodString;
51
+ flags: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ type: z.ZodLiteral<"sha256">;
54
+ value: z.ZodString;
55
+ }, z.core.$strip>], "type">;
56
+ /** Inferred TypeScript type from {@link fileAssertionSchema}. */
57
+ export type FileAssertionInput = z.input<typeof fileAssertionSchema>;
58
+ /**
59
+ * Zod schema for {@link TestGate}.
60
+ *
61
+ * Validates that `command` is present and `expect` is one of the two allowed
62
+ * literal values.
63
+ */
64
+ export declare const testGateSchema: z.ZodObject<{
65
+ req: z.ZodOptional<z.ZodString>;
66
+ description: z.ZodString;
67
+ advisory: z.ZodOptional<z.ZodBoolean>;
68
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
69
+ kind: z.ZodLiteral<"test">;
70
+ command: z.ZodString;
71
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ expect: z.ZodEnum<{
73
+ pass: "pass";
74
+ exit0: "exit0";
75
+ }>;
76
+ minCount: z.ZodOptional<z.ZodNumber>;
77
+ cwd: z.ZodOptional<z.ZodString>;
78
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
79
+ }, z.core.$strip>;
80
+ /** Zod schema for {@link FileGate}. */
81
+ export declare const fileGateSchema: z.ZodObject<{
82
+ req: z.ZodOptional<z.ZodString>;
83
+ description: z.ZodString;
84
+ advisory: z.ZodOptional<z.ZodBoolean>;
85
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
86
+ kind: z.ZodLiteral<"file">;
87
+ path: z.ZodOptional<z.ZodString>;
88
+ attachmentSha256: z.ZodOptional<z.ZodString>;
89
+ assertions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ type: z.ZodLiteral<"exists">;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ type: z.ZodLiteral<"absent">;
93
+ }, z.core.$strip>, z.ZodObject<{
94
+ type: z.ZodLiteral<"nonEmpty">;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ type: z.ZodLiteral<"maxBytes">;
97
+ value: z.ZodNumber;
98
+ }, z.core.$strip>, z.ZodObject<{
99
+ type: z.ZodLiteral<"minBytes">;
100
+ value: z.ZodNumber;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ type: z.ZodLiteral<"contains">;
103
+ value: z.ZodString;
104
+ }, z.core.$strip>, z.ZodObject<{
105
+ type: z.ZodLiteral<"matches">;
106
+ regex: z.ZodString;
107
+ flags: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ type: z.ZodLiteral<"sha256">;
110
+ value: z.ZodString;
111
+ }, z.core.$strip>], "type">>;
112
+ }, z.core.$strip>;
113
+ /** Zod schema for {@link CommandGate}. */
114
+ export declare const commandGateSchema: z.ZodObject<{
115
+ req: z.ZodOptional<z.ZodString>;
116
+ description: z.ZodString;
117
+ advisory: z.ZodOptional<z.ZodBoolean>;
118
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
119
+ kind: z.ZodLiteral<"command">;
120
+ cmd: z.ZodString;
121
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ exitCode: z.ZodOptional<z.ZodNumber>;
123
+ stdoutMatches: z.ZodOptional<z.ZodString>;
124
+ stderrMatches: z.ZodOptional<z.ZodString>;
125
+ cwd: z.ZodOptional<z.ZodString>;
126
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
127
+ }, z.core.$strip>;
128
+ /** Zod schema for {@link LintGate}. */
129
+ export declare const lintGateSchema: z.ZodObject<{
130
+ req: z.ZodOptional<z.ZodString>;
131
+ description: z.ZodString;
132
+ advisory: z.ZodOptional<z.ZodBoolean>;
133
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
134
+ kind: z.ZodLiteral<"lint">;
135
+ tool: z.ZodEnum<{
136
+ biome: "biome";
137
+ eslint: "eslint";
138
+ tsc: "tsc";
139
+ prettier: "prettier";
140
+ rustc: "rustc";
141
+ clippy: "clippy";
142
+ }>;
143
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
+ expect: z.ZodEnum<{
145
+ clean: "clean";
146
+ noErrors: "noErrors";
147
+ }>;
148
+ cwd: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strip>;
150
+ /** Zod schema for {@link HttpGate}. */
151
+ export declare const httpGateSchema: z.ZodObject<{
152
+ req: z.ZodOptional<z.ZodString>;
153
+ description: z.ZodString;
154
+ advisory: z.ZodOptional<z.ZodBoolean>;
155
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
156
+ kind: z.ZodLiteral<"http">;
157
+ url: z.ZodString;
158
+ method: z.ZodOptional<z.ZodEnum<{
159
+ GET: "GET";
160
+ HEAD: "HEAD";
161
+ POST: "POST";
162
+ PUT: "PUT";
163
+ DELETE: "DELETE";
164
+ }>>;
165
+ status: z.ZodNumber;
166
+ bodyMatches: z.ZodOptional<z.ZodString>;
167
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
168
+ startCommand: z.ZodOptional<z.ZodString>;
169
+ startupDelayMs: z.ZodOptional<z.ZodNumber>;
170
+ }, z.core.$strip>;
171
+ /** Zod schema for {@link ManualGate}. */
172
+ export declare const manualGateSchema: z.ZodObject<{
173
+ req: z.ZodOptional<z.ZodString>;
174
+ description: z.ZodString;
175
+ advisory: z.ZodOptional<z.ZodBoolean>;
176
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
177
+ kind: z.ZodLiteral<"manual">;
178
+ prompt: z.ZodString;
179
+ verdicts: z.ZodOptional<z.ZodArray<z.ZodEnum<{
180
+ pass: "pass";
181
+ fail: "fail";
182
+ warn: "warn";
183
+ }>>>;
184
+ }, z.core.$strip>;
185
+ /**
186
+ * Zod discriminated-union schema for {@link AcceptanceGate}.
187
+ *
188
+ * Uses `z.discriminatedUnion('kind', [...])` for O(1) variant lookup.
189
+ * Parse with `acceptanceGateSchema.parse(input)` or
190
+ * `acceptanceGateSchema.safeParse(input)`.
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * const gate = acceptanceGateSchema.parse({
195
+ * kind: 'test',
196
+ * command: 'pnpm test',
197
+ * expect: 'pass',
198
+ * description: 'Test suite must pass',
199
+ * });
200
+ * ```
201
+ */
202
+ export declare const acceptanceGateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
+ req: z.ZodOptional<z.ZodString>;
204
+ description: z.ZodString;
205
+ advisory: z.ZodOptional<z.ZodBoolean>;
206
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
207
+ kind: z.ZodLiteral<"test">;
208
+ command: z.ZodString;
209
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
210
+ expect: z.ZodEnum<{
211
+ pass: "pass";
212
+ exit0: "exit0";
213
+ }>;
214
+ minCount: z.ZodOptional<z.ZodNumber>;
215
+ cwd: z.ZodOptional<z.ZodString>;
216
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ req: z.ZodOptional<z.ZodString>;
219
+ description: z.ZodString;
220
+ advisory: z.ZodOptional<z.ZodBoolean>;
221
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
222
+ kind: z.ZodLiteral<"file">;
223
+ path: z.ZodOptional<z.ZodString>;
224
+ attachmentSha256: z.ZodOptional<z.ZodString>;
225
+ assertions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
226
+ type: z.ZodLiteral<"exists">;
227
+ }, z.core.$strip>, z.ZodObject<{
228
+ type: z.ZodLiteral<"absent">;
229
+ }, z.core.$strip>, z.ZodObject<{
230
+ type: z.ZodLiteral<"nonEmpty">;
231
+ }, z.core.$strip>, z.ZodObject<{
232
+ type: z.ZodLiteral<"maxBytes">;
233
+ value: z.ZodNumber;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ type: z.ZodLiteral<"minBytes">;
236
+ value: z.ZodNumber;
237
+ }, z.core.$strip>, z.ZodObject<{
238
+ type: z.ZodLiteral<"contains">;
239
+ value: z.ZodString;
240
+ }, z.core.$strip>, z.ZodObject<{
241
+ type: z.ZodLiteral<"matches">;
242
+ regex: z.ZodString;
243
+ flags: z.ZodOptional<z.ZodString>;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ type: z.ZodLiteral<"sha256">;
246
+ value: z.ZodString;
247
+ }, z.core.$strip>], "type">>;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ req: z.ZodOptional<z.ZodString>;
250
+ description: z.ZodString;
251
+ advisory: z.ZodOptional<z.ZodBoolean>;
252
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
253
+ kind: z.ZodLiteral<"command">;
254
+ cmd: z.ZodString;
255
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
256
+ exitCode: z.ZodOptional<z.ZodNumber>;
257
+ stdoutMatches: z.ZodOptional<z.ZodString>;
258
+ stderrMatches: z.ZodOptional<z.ZodString>;
259
+ cwd: z.ZodOptional<z.ZodString>;
260
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
261
+ }, z.core.$strip>, z.ZodObject<{
262
+ req: z.ZodOptional<z.ZodString>;
263
+ description: z.ZodString;
264
+ advisory: z.ZodOptional<z.ZodBoolean>;
265
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
266
+ kind: z.ZodLiteral<"lint">;
267
+ tool: z.ZodEnum<{
268
+ biome: "biome";
269
+ eslint: "eslint";
270
+ tsc: "tsc";
271
+ prettier: "prettier";
272
+ rustc: "rustc";
273
+ clippy: "clippy";
274
+ }>;
275
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
276
+ expect: z.ZodEnum<{
277
+ clean: "clean";
278
+ noErrors: "noErrors";
279
+ }>;
280
+ cwd: z.ZodOptional<z.ZodString>;
281
+ }, z.core.$strip>, z.ZodObject<{
282
+ req: z.ZodOptional<z.ZodString>;
283
+ description: z.ZodString;
284
+ advisory: z.ZodOptional<z.ZodBoolean>;
285
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
286
+ kind: z.ZodLiteral<"http">;
287
+ url: z.ZodString;
288
+ method: z.ZodOptional<z.ZodEnum<{
289
+ GET: "GET";
290
+ HEAD: "HEAD";
291
+ POST: "POST";
292
+ PUT: "PUT";
293
+ DELETE: "DELETE";
294
+ }>>;
295
+ status: z.ZodNumber;
296
+ bodyMatches: z.ZodOptional<z.ZodString>;
297
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
298
+ startCommand: z.ZodOptional<z.ZodString>;
299
+ startupDelayMs: z.ZodOptional<z.ZodNumber>;
300
+ }, z.core.$strip>, z.ZodObject<{
301
+ req: z.ZodOptional<z.ZodString>;
302
+ description: z.ZodString;
303
+ advisory: z.ZodOptional<z.ZodBoolean>;
304
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
305
+ kind: z.ZodLiteral<"manual">;
306
+ prompt: z.ZodString;
307
+ verdicts: z.ZodOptional<z.ZodArray<z.ZodEnum<{
308
+ pass: "pass";
309
+ fail: "fail";
310
+ warn: "warn";
311
+ }>>>;
312
+ }, z.core.$strip>], "kind">;
313
+ /** Inferred TypeScript type from {@link acceptanceGateSchema}. */
314
+ export type AcceptanceGateSchemaInput = z.input<typeof acceptanceGateSchema>;
315
+ /**
316
+ * Zod discriminated-union schema for {@link GateResultDetails}.
317
+ *
318
+ * Each variant mirrors the corresponding {@link AcceptanceGate} kind so
319
+ * callers can narrow `details` using the `kind` discriminant.
320
+ *
321
+ * @epic T760
322
+ * @task T802
323
+ */
324
+ export declare const gateResultDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
325
+ kind: z.ZodLiteral<"test">;
326
+ exitCode: z.ZodNumber;
327
+ stdout: z.ZodString;
328
+ stderr: z.ZodString;
329
+ duration: z.ZodNumber;
330
+ }, z.core.$strip>, z.ZodObject<{
331
+ kind: z.ZodLiteral<"file">;
332
+ path: z.ZodString;
333
+ passedAssertions: z.ZodArray<z.ZodString>;
334
+ failedAssertions: z.ZodArray<z.ZodString>;
335
+ }, z.core.$strip>, z.ZodObject<{
336
+ kind: z.ZodLiteral<"command">;
337
+ cmd: z.ZodString;
338
+ exitCode: z.ZodNumber;
339
+ stdout: z.ZodString;
340
+ }, z.core.$strip>, z.ZodObject<{
341
+ kind: z.ZodLiteral<"lint">;
342
+ tool: z.ZodString;
343
+ warnings: z.ZodNumber;
344
+ errors: z.ZodNumber;
345
+ }, z.core.$strip>, z.ZodObject<{
346
+ kind: z.ZodLiteral<"http">;
347
+ url: z.ZodString;
348
+ status: z.ZodNumber;
349
+ body: z.ZodString;
350
+ }, z.core.$strip>, z.ZodObject<{
351
+ kind: z.ZodLiteral<"manual">;
352
+ prompt: z.ZodString;
353
+ accepted: z.ZodBoolean;
354
+ }, z.core.$strip>], "kind">;
355
+ /** Inferred TypeScript type from {@link gateResultDetailsSchema}. */
356
+ export type GateResultDetailsInput = z.input<typeof gateResultDetailsSchema>;
357
+ /**
358
+ * Zod schema for {@link AcceptanceGateResult}.
359
+ *
360
+ * Validates the shape produced by the gate runner and stored in
361
+ * `lifecycle_gate_results`.
362
+ */
363
+ export declare const acceptanceGateResultSchema: z.ZodObject<{
364
+ index: z.ZodNumber;
365
+ req: z.ZodOptional<z.ZodString>;
366
+ kind: z.ZodEnum<{
367
+ file: "file";
368
+ test: "test";
369
+ command: "command";
370
+ lint: "lint";
371
+ http: "http";
372
+ manual: "manual";
373
+ }>;
374
+ result: z.ZodEnum<{
375
+ error: "error";
376
+ pass: "pass";
377
+ fail: "fail";
378
+ warn: "warn";
379
+ skipped: "skipped";
380
+ }>;
381
+ durationMs: z.ZodNumber;
382
+ details: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
383
+ kind: z.ZodLiteral<"test">;
384
+ exitCode: z.ZodNumber;
385
+ stdout: z.ZodString;
386
+ stderr: z.ZodString;
387
+ duration: z.ZodNumber;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ kind: z.ZodLiteral<"file">;
390
+ path: z.ZodString;
391
+ passedAssertions: z.ZodArray<z.ZodString>;
392
+ failedAssertions: z.ZodArray<z.ZodString>;
393
+ }, z.core.$strip>, z.ZodObject<{
394
+ kind: z.ZodLiteral<"command">;
395
+ cmd: z.ZodString;
396
+ exitCode: z.ZodNumber;
397
+ stdout: z.ZodString;
398
+ }, z.core.$strip>, z.ZodObject<{
399
+ kind: z.ZodLiteral<"lint">;
400
+ tool: z.ZodString;
401
+ warnings: z.ZodNumber;
402
+ errors: z.ZodNumber;
403
+ }, z.core.$strip>, z.ZodObject<{
404
+ kind: z.ZodLiteral<"http">;
405
+ url: z.ZodString;
406
+ status: z.ZodNumber;
407
+ body: z.ZodString;
408
+ }, z.core.$strip>, z.ZodObject<{
409
+ kind: z.ZodLiteral<"manual">;
410
+ prompt: z.ZodString;
411
+ accepted: z.ZodBoolean;
412
+ }, z.core.$strip>], "kind">>;
413
+ evidence: z.ZodOptional<z.ZodString>;
414
+ errorMessage: z.ZodOptional<z.ZodString>;
415
+ checkedAt: z.ZodString;
416
+ checkedBy: z.ZodString;
417
+ }, z.core.$strip>;
418
+ /** Inferred TypeScript type from {@link acceptanceGateResultSchema}. */
419
+ export type AcceptanceGateResultInput = z.input<typeof acceptanceGateResultSchema>;
420
+ /**
421
+ * Zod schema for a single acceptance criterion — either a non-empty string
422
+ * (legacy) or a structured {@link AcceptanceGate} (machine-verifiable).
423
+ *
424
+ * **Tightened (T800)**: Rejects empty strings, whitespace-only strings, and
425
+ * any non-gate objects. Clear error messages guide callers toward valid input.
426
+ *
427
+ * Strings are validated with `z.string().trim().min(1)` to eliminate empty
428
+ * and whitespace-only criteria. The gate branch uses the existing discriminated-union
429
+ * schema so all six gate kinds (`test`, `file`, `command`, `lint`, `http`, `manual`)
430
+ * are accepted.
431
+ *
432
+ * @example
433
+ * ```ts
434
+ * acceptanceItemSchema.parse('must render in <100ms'); // => 'must render in <100ms'
435
+ * acceptanceItemSchema.parse({ kind: 'test', command: 'pnpm test', expect: 'pass', description: '...' }); // => TestGate
436
+ * acceptanceItemSchema.parse(''); // ERROR: string must be non-empty
437
+ * acceptanceItemSchema.parse({ foo: 'bar' }); // ERROR: invalid gate object
438
+ * ```
439
+ *
440
+ * @epic T760
441
+ * @task T780
442
+ * @task T800
443
+ */
444
+ export declare const acceptanceItemSchema: z.ZodUnion<readonly [z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
445
+ req: z.ZodOptional<z.ZodString>;
446
+ description: z.ZodString;
447
+ advisory: z.ZodOptional<z.ZodBoolean>;
448
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
449
+ kind: z.ZodLiteral<"test">;
450
+ command: z.ZodString;
451
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
452
+ expect: z.ZodEnum<{
453
+ pass: "pass";
454
+ exit0: "exit0";
455
+ }>;
456
+ minCount: z.ZodOptional<z.ZodNumber>;
457
+ cwd: z.ZodOptional<z.ZodString>;
458
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
459
+ }, z.core.$strip>, z.ZodObject<{
460
+ req: z.ZodOptional<z.ZodString>;
461
+ description: z.ZodString;
462
+ advisory: z.ZodOptional<z.ZodBoolean>;
463
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
464
+ kind: z.ZodLiteral<"file">;
465
+ path: z.ZodOptional<z.ZodString>;
466
+ attachmentSha256: z.ZodOptional<z.ZodString>;
467
+ assertions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
468
+ type: z.ZodLiteral<"exists">;
469
+ }, z.core.$strip>, z.ZodObject<{
470
+ type: z.ZodLiteral<"absent">;
471
+ }, z.core.$strip>, z.ZodObject<{
472
+ type: z.ZodLiteral<"nonEmpty">;
473
+ }, z.core.$strip>, z.ZodObject<{
474
+ type: z.ZodLiteral<"maxBytes">;
475
+ value: z.ZodNumber;
476
+ }, z.core.$strip>, z.ZodObject<{
477
+ type: z.ZodLiteral<"minBytes">;
478
+ value: z.ZodNumber;
479
+ }, z.core.$strip>, z.ZodObject<{
480
+ type: z.ZodLiteral<"contains">;
481
+ value: z.ZodString;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ type: z.ZodLiteral<"matches">;
484
+ regex: z.ZodString;
485
+ flags: z.ZodOptional<z.ZodString>;
486
+ }, z.core.$strip>, z.ZodObject<{
487
+ type: z.ZodLiteral<"sha256">;
488
+ value: z.ZodString;
489
+ }, z.core.$strip>], "type">>;
490
+ }, z.core.$strip>, z.ZodObject<{
491
+ req: z.ZodOptional<z.ZodString>;
492
+ description: z.ZodString;
493
+ advisory: z.ZodOptional<z.ZodBoolean>;
494
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
495
+ kind: z.ZodLiteral<"command">;
496
+ cmd: z.ZodString;
497
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
498
+ exitCode: z.ZodOptional<z.ZodNumber>;
499
+ stdoutMatches: z.ZodOptional<z.ZodString>;
500
+ stderrMatches: z.ZodOptional<z.ZodString>;
501
+ cwd: z.ZodOptional<z.ZodString>;
502
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
503
+ }, z.core.$strip>, z.ZodObject<{
504
+ req: z.ZodOptional<z.ZodString>;
505
+ description: z.ZodString;
506
+ advisory: z.ZodOptional<z.ZodBoolean>;
507
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
508
+ kind: z.ZodLiteral<"lint">;
509
+ tool: z.ZodEnum<{
510
+ biome: "biome";
511
+ eslint: "eslint";
512
+ tsc: "tsc";
513
+ prettier: "prettier";
514
+ rustc: "rustc";
515
+ clippy: "clippy";
516
+ }>;
517
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
518
+ expect: z.ZodEnum<{
519
+ clean: "clean";
520
+ noErrors: "noErrors";
521
+ }>;
522
+ cwd: z.ZodOptional<z.ZodString>;
523
+ }, z.core.$strip>, z.ZodObject<{
524
+ req: z.ZodOptional<z.ZodString>;
525
+ description: z.ZodString;
526
+ advisory: z.ZodOptional<z.ZodBoolean>;
527
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
528
+ kind: z.ZodLiteral<"http">;
529
+ url: z.ZodString;
530
+ method: z.ZodOptional<z.ZodEnum<{
531
+ GET: "GET";
532
+ HEAD: "HEAD";
533
+ POST: "POST";
534
+ PUT: "PUT";
535
+ DELETE: "DELETE";
536
+ }>>;
537
+ status: z.ZodNumber;
538
+ bodyMatches: z.ZodOptional<z.ZodString>;
539
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
540
+ startCommand: z.ZodOptional<z.ZodString>;
541
+ startupDelayMs: z.ZodOptional<z.ZodNumber>;
542
+ }, z.core.$strip>, z.ZodObject<{
543
+ req: z.ZodOptional<z.ZodString>;
544
+ description: z.ZodString;
545
+ advisory: z.ZodOptional<z.ZodBoolean>;
546
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
547
+ kind: z.ZodLiteral<"manual">;
548
+ prompt: z.ZodString;
549
+ verdicts: z.ZodOptional<z.ZodArray<z.ZodEnum<{
550
+ pass: "pass";
551
+ fail: "fail";
552
+ warn: "warn";
553
+ }>>>;
554
+ }, z.core.$strip>], "kind">]>;
555
+ /** Inferred TypeScript type from {@link acceptanceItemSchema}. */
556
+ export type AcceptanceItemInput = z.input<typeof acceptanceItemSchema>;
557
+ /**
558
+ * Zod schema for a mixed acceptance array — `(string | AcceptanceGate)[]`.
559
+ *
560
+ * **Tightened (T800)**:
561
+ * - Requires at least 1 item (matching CLEO's anti-hallucination policy).
562
+ * - Rejects duplicate `req:` GSD-style REQ-IDs within the same array.
563
+ *
564
+ * Use this to validate the full `Task.acceptance` field after widening (T780).
565
+ *
566
+ * @example
567
+ * ```ts
568
+ * // Valid: mixed types with unique req IDs
569
+ * acceptanceArraySchema.parse([
570
+ * 'must render in <100ms',
571
+ * { kind: 'test', command: 'pnpm test', expect: 'pass', description: 'Tests pass', req: 'TEST-01' }
572
+ * ]);
573
+ *
574
+ * // ERROR: empty array
575
+ * acceptanceArraySchema.parse([]);
576
+ *
577
+ * // ERROR: duplicate req:'TEST-01' across two gates
578
+ * acceptanceArraySchema.parse([
579
+ * { kind: 'test', command: 'pnpm test', expect: 'pass', description: 'Tests pass', req: 'TEST-01' },
580
+ * { kind: 'file', path: 'README.md', assertions: [{ type: 'exists' }], description: 'README exists', req: 'TEST-01' }
581
+ * ]);
582
+ * ```
583
+ *
584
+ * @epic T760
585
+ * @task T780
586
+ * @task T800
587
+ */
588
+ export declare const acceptanceArraySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
589
+ req: z.ZodOptional<z.ZodString>;
590
+ description: z.ZodString;
591
+ advisory: z.ZodOptional<z.ZodBoolean>;
592
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
593
+ kind: z.ZodLiteral<"test">;
594
+ command: z.ZodString;
595
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
596
+ expect: z.ZodEnum<{
597
+ pass: "pass";
598
+ exit0: "exit0";
599
+ }>;
600
+ minCount: z.ZodOptional<z.ZodNumber>;
601
+ cwd: z.ZodOptional<z.ZodString>;
602
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
603
+ }, z.core.$strip>, z.ZodObject<{
604
+ req: z.ZodOptional<z.ZodString>;
605
+ description: z.ZodString;
606
+ advisory: z.ZodOptional<z.ZodBoolean>;
607
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
608
+ kind: z.ZodLiteral<"file">;
609
+ path: z.ZodOptional<z.ZodString>;
610
+ attachmentSha256: z.ZodOptional<z.ZodString>;
611
+ assertions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
612
+ type: z.ZodLiteral<"exists">;
613
+ }, z.core.$strip>, z.ZodObject<{
614
+ type: z.ZodLiteral<"absent">;
615
+ }, z.core.$strip>, z.ZodObject<{
616
+ type: z.ZodLiteral<"nonEmpty">;
617
+ }, z.core.$strip>, z.ZodObject<{
618
+ type: z.ZodLiteral<"maxBytes">;
619
+ value: z.ZodNumber;
620
+ }, z.core.$strip>, z.ZodObject<{
621
+ type: z.ZodLiteral<"minBytes">;
622
+ value: z.ZodNumber;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ type: z.ZodLiteral<"contains">;
625
+ value: z.ZodString;
626
+ }, z.core.$strip>, z.ZodObject<{
627
+ type: z.ZodLiteral<"matches">;
628
+ regex: z.ZodString;
629
+ flags: z.ZodOptional<z.ZodString>;
630
+ }, z.core.$strip>, z.ZodObject<{
631
+ type: z.ZodLiteral<"sha256">;
632
+ value: z.ZodString;
633
+ }, z.core.$strip>], "type">>;
634
+ }, z.core.$strip>, z.ZodObject<{
635
+ req: z.ZodOptional<z.ZodString>;
636
+ description: z.ZodString;
637
+ advisory: z.ZodOptional<z.ZodBoolean>;
638
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
639
+ kind: z.ZodLiteral<"command">;
640
+ cmd: z.ZodString;
641
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
642
+ exitCode: z.ZodOptional<z.ZodNumber>;
643
+ stdoutMatches: z.ZodOptional<z.ZodString>;
644
+ stderrMatches: z.ZodOptional<z.ZodString>;
645
+ cwd: z.ZodOptional<z.ZodString>;
646
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
647
+ }, z.core.$strip>, z.ZodObject<{
648
+ req: z.ZodOptional<z.ZodString>;
649
+ description: z.ZodString;
650
+ advisory: z.ZodOptional<z.ZodBoolean>;
651
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
652
+ kind: z.ZodLiteral<"lint">;
653
+ tool: z.ZodEnum<{
654
+ biome: "biome";
655
+ eslint: "eslint";
656
+ tsc: "tsc";
657
+ prettier: "prettier";
658
+ rustc: "rustc";
659
+ clippy: "clippy";
660
+ }>;
661
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
662
+ expect: z.ZodEnum<{
663
+ clean: "clean";
664
+ noErrors: "noErrors";
665
+ }>;
666
+ cwd: z.ZodOptional<z.ZodString>;
667
+ }, z.core.$strip>, z.ZodObject<{
668
+ req: z.ZodOptional<z.ZodString>;
669
+ description: z.ZodString;
670
+ advisory: z.ZodOptional<z.ZodBoolean>;
671
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
672
+ kind: z.ZodLiteral<"http">;
673
+ url: z.ZodString;
674
+ method: z.ZodOptional<z.ZodEnum<{
675
+ GET: "GET";
676
+ HEAD: "HEAD";
677
+ POST: "POST";
678
+ PUT: "PUT";
679
+ DELETE: "DELETE";
680
+ }>>;
681
+ status: z.ZodNumber;
682
+ bodyMatches: z.ZodOptional<z.ZodString>;
683
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
684
+ startCommand: z.ZodOptional<z.ZodString>;
685
+ startupDelayMs: z.ZodOptional<z.ZodNumber>;
686
+ }, z.core.$strip>, z.ZodObject<{
687
+ req: z.ZodOptional<z.ZodString>;
688
+ description: z.ZodString;
689
+ advisory: z.ZodOptional<z.ZodBoolean>;
690
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
691
+ kind: z.ZodLiteral<"manual">;
692
+ prompt: z.ZodString;
693
+ verdicts: z.ZodOptional<z.ZodArray<z.ZodEnum<{
694
+ pass: "pass";
695
+ fail: "fail";
696
+ warn: "warn";
697
+ }>>>;
698
+ }, z.core.$strip>], "kind">]>>;
699
+ /** Inferred TypeScript type from {@link acceptanceArraySchema}. */
700
+ export type AcceptanceArrayInput = z.input<typeof acceptanceArraySchema>;
701
+ //# sourceMappingURL=acceptance-gate-schema.d.ts.map