@ai-dev-orchestrator/schemas 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/dist/artifacts/agreement-artifacts.d.ts +311 -0
  4. package/dist/artifacts/agreement-artifacts.js +48 -0
  5. package/dist/artifacts/artifact-dependency-graph.d.ts +775 -0
  6. package/dist/artifacts/artifact-dependency-graph.js +57 -0
  7. package/dist/artifacts/artifact-system.d.ts +657 -0
  8. package/dist/artifacts/artifact-system.js +124 -0
  9. package/dist/artifacts/index.d.ts +3 -0
  10. package/dist/artifacts/index.js +3 -0
  11. package/dist/config/configuration.d.ts +324 -0
  12. package/dist/config/configuration.js +93 -0
  13. package/dist/config/event-bus-config.d.ts +153 -0
  14. package/dist/config/event-bus-config.js +27 -0
  15. package/dist/config/event-payloads.d.ts +919 -0
  16. package/dist/config/event-payloads.js +304 -0
  17. package/dist/config/event-system.d.ts +3231 -0
  18. package/dist/config/event-system.js +428 -0
  19. package/dist/config/event-types.d.ts +62 -0
  20. package/dist/config/event-types.js +66 -0
  21. package/dist/config/index.d.ts +5 -0
  22. package/dist/config/index.js +5 -0
  23. package/dist/dashboard/dashboard-api.d.ts +149 -0
  24. package/dist/dashboard/dashboard-api.js +80 -0
  25. package/dist/dashboard/dashboard-domain.d.ts +1076 -0
  26. package/dist/dashboard/dashboard-domain.js +305 -0
  27. package/dist/dashboard/index.d.ts +3 -0
  28. package/dist/dashboard/index.js +3 -0
  29. package/dist/dashboard/run-creation-params.d.ts +111 -0
  30. package/dist/dashboard/run-creation-params.js +14 -0
  31. package/dist/governance/governance.d.ts +1119 -0
  32. package/dist/governance/governance.js +111 -0
  33. package/dist/governance/index.d.ts +3 -0
  34. package/dist/governance/index.js +3 -0
  35. package/dist/governance/policy-engine.d.ts +634 -0
  36. package/dist/governance/policy-engine.js +214 -0
  37. package/dist/governance/review-resolution.d.ts +1053 -0
  38. package/dist/governance/review-resolution.js +67 -0
  39. package/dist/index.d.ts +10 -0
  40. package/dist/index.js +10 -0
  41. package/dist/observability/diagnostics.d.ts +185 -0
  42. package/dist/observability/diagnostics.js +63 -0
  43. package/dist/observability/index.d.ts +2 -0
  44. package/dist/observability/index.js +2 -0
  45. package/dist/observability/metrics.d.ts +187 -0
  46. package/dist/observability/metrics.js +67 -0
  47. package/dist/persistence/execution-analytics.d.ts +173 -0
  48. package/dist/persistence/execution-analytics.js +71 -0
  49. package/dist/persistence/index.d.ts +5 -0
  50. package/dist/persistence/index.js +5 -0
  51. package/dist/persistence/project-context.d.ts +164 -0
  52. package/dist/persistence/project-context.js +88 -0
  53. package/dist/persistence/repository-model.d.ts +27 -0
  54. package/dist/persistence/repository-model.js +16 -0
  55. package/dist/persistence/run-manifest.d.ts +422 -0
  56. package/dist/persistence/run-manifest.js +118 -0
  57. package/dist/persistence/state-persistence.d.ts +276 -0
  58. package/dist/persistence/state-persistence.js +83 -0
  59. package/dist/runner/built-in-runner-ids.d.ts +8 -0
  60. package/dist/runner/built-in-runner-ids.js +11 -0
  61. package/dist/runner/collaboration-model.d.ts +100 -0
  62. package/dist/runner/collaboration-model.js +19 -0
  63. package/dist/runner/confidence.d.ts +17 -0
  64. package/dist/runner/confidence.js +11 -0
  65. package/dist/runner/index.d.ts +8 -0
  66. package/dist/runner/index.js +8 -0
  67. package/dist/runner/permission-approval.d.ts +38 -0
  68. package/dist/runner/permission-approval.js +14 -0
  69. package/dist/runner/prompt-engine.d.ts +1467 -0
  70. package/dist/runner/prompt-engine.js +193 -0
  71. package/dist/runner/role-system.d.ts +458 -0
  72. package/dist/runner/role-system.js +94 -0
  73. package/dist/runner/runner-system.d.ts +1721 -0
  74. package/dist/runner/runner-system.js +268 -0
  75. package/dist/runner/task-brief.d.ts +18 -0
  76. package/dist/runner/task-brief.js +12 -0
  77. package/dist/shared/index.d.ts +3 -0
  78. package/dist/shared/index.js +3 -0
  79. package/dist/shared/shared.d.ts +30 -0
  80. package/dist/shared/shared.js +27 -0
  81. package/dist/shared/string-enums.d.ts +59 -0
  82. package/dist/shared/string-enums.js +24 -0
  83. package/dist/shared/utils.d.ts +25 -0
  84. package/dist/shared/utils.js +22 -0
  85. package/dist/specification/canonical-specification.d.ts +475 -0
  86. package/dist/specification/canonical-specification.js +151 -0
  87. package/dist/specification/index.d.ts +3 -0
  88. package/dist/specification/index.js +3 -0
  89. package/dist/specification/intake.d.ts +419 -0
  90. package/dist/specification/intake.js +70 -0
  91. package/dist/specification/iteration-contracts.d.ts +421 -0
  92. package/dist/specification/iteration-contracts.js +61 -0
  93. package/dist/workflow/index.d.ts +4 -0
  94. package/dist/workflow/index.js +4 -0
  95. package/dist/workflow/workflow-dsl.d.ts +81 -0
  96. package/dist/workflow/workflow-dsl.js +38 -0
  97. package/dist/workflow/workflow-engine.d.ts +5788 -0
  98. package/dist/workflow/workflow-engine.js +414 -0
  99. package/dist/workflow/workflow-file.d.ts +331 -0
  100. package/dist/workflow/workflow-file.js +41 -0
  101. package/dist/workflow/workflow-journal.d.ts +520 -0
  102. package/dist/workflow/workflow-journal.js +151 -0
  103. package/package.json +39 -0
@@ -0,0 +1,421 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const aggregationStrategySchema: z.ZodEnum<{
3
+ any: "any";
4
+ all_must_pass: "all_must_pass";
5
+ majority: "majority";
6
+ }>;
7
+ export type AggregationStrategy = z.infer<typeof aggregationStrategySchema>;
8
+ export declare const successConditionTypeSchema: z.ZodEnum<{
9
+ custom: "custom";
10
+ no_blocking_findings: "no_blocking_findings";
11
+ all_findings_addressed: "all_findings_addressed";
12
+ }>;
13
+ export type SuccessConditionType = z.infer<typeof successConditionTypeSchema>;
14
+ export declare const successConditionSchema: z.ZodObject<{
15
+ type: z.ZodEnum<{
16
+ custom: "custom";
17
+ no_blocking_findings: "no_blocking_findings";
18
+ all_findings_addressed: "all_findings_addressed";
19
+ }>;
20
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
21
+ }, z.core.$strip>;
22
+ export type SuccessCondition = z.infer<typeof successConditionSchema>;
23
+ export declare const failureConditionTypeSchema: z.ZodEnum<{
24
+ custom: "custom";
25
+ max_iterations_exceeded: "max_iterations_exceeded";
26
+ judge_arbitration_failed: "judge_arbitration_failed";
27
+ }>;
28
+ export type FailureConditionType = z.infer<typeof failureConditionTypeSchema>;
29
+ export declare const failureConditionSchema: z.ZodObject<{
30
+ type: z.ZodEnum<{
31
+ custom: "custom";
32
+ max_iterations_exceeded: "max_iterations_exceeded";
33
+ judge_arbitration_failed: "judge_arbitration_failed";
34
+ }>;
35
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
36
+ }, z.core.$strip>;
37
+ export type FailureCondition = z.infer<typeof failureConditionSchema>;
38
+ export declare const escalationActionSchema: z.ZodEnum<{
39
+ abort: "abort";
40
+ escalate_to_human: "escalate_to_human";
41
+ force_approve: "force_approve";
42
+ }>;
43
+ export type EscalationAction = z.infer<typeof escalationActionSchema>;
44
+ export declare const escalationPolicySchema: z.ZodObject<{
45
+ action: z.ZodEnum<{
46
+ abort: "abort";
47
+ escalate_to_human: "escalate_to_human";
48
+ force_approve: "force_approve";
49
+ }>;
50
+ produceEscalationArtifact: z.ZodBoolean;
51
+ includeFullHistory: z.ZodBoolean;
52
+ }, z.core.$strip>;
53
+ export type EscalationPolicy = z.infer<typeof escalationPolicySchema>;
54
+ export declare const reviewerSpecSchema: z.ZodObject<{
55
+ role: z.ZodString;
56
+ output: z.ZodEnum<{
57
+ intake_requirements: "intake_requirements";
58
+ canonical_specification: "canonical_specification";
59
+ clarification_questions: "clarification_questions";
60
+ clarification_answers: "clarification_answers";
61
+ plan: "plan";
62
+ plan_review: "plan_review";
63
+ test_plan: "test_plan";
64
+ implementation: "implementation";
65
+ static_review: "static_review";
66
+ security_review: "security_review";
67
+ performance_review: "performance_review";
68
+ adversarial_review: "adversarial_review";
69
+ design_review: "design_review";
70
+ docs_review: "docs_review";
71
+ ux_review: "ux_review";
72
+ review_report: "review_report";
73
+ remediation_plan: "remediation_plan";
74
+ verification: "verification";
75
+ judge_decision: "judge_decision";
76
+ planning_agreement: "planning_agreement";
77
+ implementation_agreement: "implementation_agreement";
78
+ verification_agreement: "verification_agreement";
79
+ release_summary: "release_summary";
80
+ release_agreement: "release_agreement";
81
+ escalation_context: "escalation_context";
82
+ run_manifest: "run_manifest";
83
+ codebase_context: "codebase_context";
84
+ test_suite: "test_suite";
85
+ acceptance_validation: "acceptance_validation";
86
+ review_findings: "review_findings";
87
+ task_breakdown: "task_breakdown";
88
+ decomposition_review: "decomposition_review";
89
+ task_specifications: "task_specifications";
90
+ pr_diff_context: "pr_diff_context";
91
+ }>;
92
+ inputs: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
93
+ intake_requirements: "intake_requirements";
94
+ canonical_specification: "canonical_specification";
95
+ clarification_questions: "clarification_questions";
96
+ clarification_answers: "clarification_answers";
97
+ plan: "plan";
98
+ plan_review: "plan_review";
99
+ test_plan: "test_plan";
100
+ implementation: "implementation";
101
+ static_review: "static_review";
102
+ security_review: "security_review";
103
+ performance_review: "performance_review";
104
+ adversarial_review: "adversarial_review";
105
+ design_review: "design_review";
106
+ docs_review: "docs_review";
107
+ ux_review: "ux_review";
108
+ review_report: "review_report";
109
+ remediation_plan: "remediation_plan";
110
+ verification: "verification";
111
+ judge_decision: "judge_decision";
112
+ planning_agreement: "planning_agreement";
113
+ implementation_agreement: "implementation_agreement";
114
+ verification_agreement: "verification_agreement";
115
+ release_summary: "release_summary";
116
+ release_agreement: "release_agreement";
117
+ escalation_context: "escalation_context";
118
+ run_manifest: "run_manifest";
119
+ codebase_context: "codebase_context";
120
+ test_suite: "test_suite";
121
+ acceptance_validation: "acceptance_validation";
122
+ review_findings: "review_findings";
123
+ task_breakdown: "task_breakdown";
124
+ decomposition_review: "decomposition_review";
125
+ task_specifications: "task_specifications";
126
+ pr_diff_context: "pr_diff_context";
127
+ }>>>;
128
+ }, z.core.$strip>;
129
+ export type ReviewerSpec = z.infer<typeof reviewerSpecSchema>;
130
+ export declare const iterationContractSchema: z.ZodObject<{
131
+ id: z.ZodString;
132
+ name: z.ZodString;
133
+ description: z.ZodString;
134
+ producer: z.ZodString;
135
+ reviewers: z.ZodReadonly<z.ZodArray<z.ZodObject<{
136
+ role: z.ZodString;
137
+ output: z.ZodEnum<{
138
+ intake_requirements: "intake_requirements";
139
+ canonical_specification: "canonical_specification";
140
+ clarification_questions: "clarification_questions";
141
+ clarification_answers: "clarification_answers";
142
+ plan: "plan";
143
+ plan_review: "plan_review";
144
+ test_plan: "test_plan";
145
+ implementation: "implementation";
146
+ static_review: "static_review";
147
+ security_review: "security_review";
148
+ performance_review: "performance_review";
149
+ adversarial_review: "adversarial_review";
150
+ design_review: "design_review";
151
+ docs_review: "docs_review";
152
+ ux_review: "ux_review";
153
+ review_report: "review_report";
154
+ remediation_plan: "remediation_plan";
155
+ verification: "verification";
156
+ judge_decision: "judge_decision";
157
+ planning_agreement: "planning_agreement";
158
+ implementation_agreement: "implementation_agreement";
159
+ verification_agreement: "verification_agreement";
160
+ release_summary: "release_summary";
161
+ release_agreement: "release_agreement";
162
+ escalation_context: "escalation_context";
163
+ run_manifest: "run_manifest";
164
+ codebase_context: "codebase_context";
165
+ test_suite: "test_suite";
166
+ acceptance_validation: "acceptance_validation";
167
+ review_findings: "review_findings";
168
+ task_breakdown: "task_breakdown";
169
+ decomposition_review: "decomposition_review";
170
+ task_specifications: "task_specifications";
171
+ pr_diff_context: "pr_diff_context";
172
+ }>;
173
+ inputs: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
174
+ intake_requirements: "intake_requirements";
175
+ canonical_specification: "canonical_specification";
176
+ clarification_questions: "clarification_questions";
177
+ clarification_answers: "clarification_answers";
178
+ plan: "plan";
179
+ plan_review: "plan_review";
180
+ test_plan: "test_plan";
181
+ implementation: "implementation";
182
+ static_review: "static_review";
183
+ security_review: "security_review";
184
+ performance_review: "performance_review";
185
+ adversarial_review: "adversarial_review";
186
+ design_review: "design_review";
187
+ docs_review: "docs_review";
188
+ ux_review: "ux_review";
189
+ review_report: "review_report";
190
+ remediation_plan: "remediation_plan";
191
+ verification: "verification";
192
+ judge_decision: "judge_decision";
193
+ planning_agreement: "planning_agreement";
194
+ implementation_agreement: "implementation_agreement";
195
+ verification_agreement: "verification_agreement";
196
+ release_summary: "release_summary";
197
+ release_agreement: "release_agreement";
198
+ escalation_context: "escalation_context";
199
+ run_manifest: "run_manifest";
200
+ codebase_context: "codebase_context";
201
+ test_suite: "test_suite";
202
+ acceptance_validation: "acceptance_validation";
203
+ review_findings: "review_findings";
204
+ task_breakdown: "task_breakdown";
205
+ decomposition_review: "decomposition_review";
206
+ task_specifications: "task_specifications";
207
+ pr_diff_context: "pr_diff_context";
208
+ }>>>;
209
+ }, z.core.$strip>>>;
210
+ aggregation: z.ZodEnum<{
211
+ any: "any";
212
+ all_must_pass: "all_must_pass";
213
+ majority: "majority";
214
+ }>;
215
+ judge: z.ZodOptional<z.ZodString>;
216
+ producerInputs: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
217
+ intake_requirements: "intake_requirements";
218
+ canonical_specification: "canonical_specification";
219
+ clarification_questions: "clarification_questions";
220
+ clarification_answers: "clarification_answers";
221
+ plan: "plan";
222
+ plan_review: "plan_review";
223
+ test_plan: "test_plan";
224
+ implementation: "implementation";
225
+ static_review: "static_review";
226
+ security_review: "security_review";
227
+ performance_review: "performance_review";
228
+ adversarial_review: "adversarial_review";
229
+ design_review: "design_review";
230
+ docs_review: "docs_review";
231
+ ux_review: "ux_review";
232
+ review_report: "review_report";
233
+ remediation_plan: "remediation_plan";
234
+ verification: "verification";
235
+ judge_decision: "judge_decision";
236
+ planning_agreement: "planning_agreement";
237
+ implementation_agreement: "implementation_agreement";
238
+ verification_agreement: "verification_agreement";
239
+ release_summary: "release_summary";
240
+ release_agreement: "release_agreement";
241
+ escalation_context: "escalation_context";
242
+ run_manifest: "run_manifest";
243
+ codebase_context: "codebase_context";
244
+ test_suite: "test_suite";
245
+ acceptance_validation: "acceptance_validation";
246
+ review_findings: "review_findings";
247
+ task_breakdown: "task_breakdown";
248
+ decomposition_review: "decomposition_review";
249
+ task_specifications: "task_specifications";
250
+ pr_diff_context: "pr_diff_context";
251
+ }>>>;
252
+ producerOutput: z.ZodEnum<{
253
+ intake_requirements: "intake_requirements";
254
+ canonical_specification: "canonical_specification";
255
+ clarification_questions: "clarification_questions";
256
+ clarification_answers: "clarification_answers";
257
+ plan: "plan";
258
+ plan_review: "plan_review";
259
+ test_plan: "test_plan";
260
+ implementation: "implementation";
261
+ static_review: "static_review";
262
+ security_review: "security_review";
263
+ performance_review: "performance_review";
264
+ adversarial_review: "adversarial_review";
265
+ design_review: "design_review";
266
+ docs_review: "docs_review";
267
+ ux_review: "ux_review";
268
+ review_report: "review_report";
269
+ remediation_plan: "remediation_plan";
270
+ verification: "verification";
271
+ judge_decision: "judge_decision";
272
+ planning_agreement: "planning_agreement";
273
+ implementation_agreement: "implementation_agreement";
274
+ verification_agreement: "verification_agreement";
275
+ release_summary: "release_summary";
276
+ release_agreement: "release_agreement";
277
+ escalation_context: "escalation_context";
278
+ run_manifest: "run_manifest";
279
+ codebase_context: "codebase_context";
280
+ test_suite: "test_suite";
281
+ acceptance_validation: "acceptance_validation";
282
+ review_findings: "review_findings";
283
+ task_breakdown: "task_breakdown";
284
+ decomposition_review: "decomposition_review";
285
+ task_specifications: "task_specifications";
286
+ pr_diff_context: "pr_diff_context";
287
+ }>;
288
+ successCondition: z.ZodObject<{
289
+ type: z.ZodEnum<{
290
+ custom: "custom";
291
+ no_blocking_findings: "no_blocking_findings";
292
+ all_findings_addressed: "all_findings_addressed";
293
+ }>;
294
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
295
+ }, z.core.$strip>;
296
+ failureCondition: z.ZodObject<{
297
+ type: z.ZodEnum<{
298
+ custom: "custom";
299
+ max_iterations_exceeded: "max_iterations_exceeded";
300
+ judge_arbitration_failed: "judge_arbitration_failed";
301
+ }>;
302
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
303
+ }, z.core.$strip>;
304
+ maxIterations: z.ZodNumber;
305
+ maxJudgeArbitrations: z.ZodNumber;
306
+ escalationPolicy: z.ZodObject<{
307
+ action: z.ZodEnum<{
308
+ abort: "abort";
309
+ escalate_to_human: "escalate_to_human";
310
+ force_approve: "force_approve";
311
+ }>;
312
+ produceEscalationArtifact: z.ZodBoolean;
313
+ includeFullHistory: z.ZodBoolean;
314
+ }, z.core.$strip>;
315
+ completionAgreement: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>;
317
+ export type IterationContract = z.infer<typeof iterationContractSchema>;
318
+ export declare const iterationStatusSchema: z.ZodEnum<{
319
+ escalated: "escalated";
320
+ failed: "failed";
321
+ in_progress: "in_progress";
322
+ succeeded: "succeeded";
323
+ }>;
324
+ export type IterationStatus = z.infer<typeof iterationStatusSchema>;
325
+ export declare const iterationStateSchema: z.ZodObject<{
326
+ contractId: z.ZodString;
327
+ currentIteration: z.ZodNumber;
328
+ judgeArbitrations: z.ZodNumber;
329
+ producerArtifactVersions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
330
+ type: z.ZodEnum<{
331
+ intake_requirements: "intake_requirements";
332
+ canonical_specification: "canonical_specification";
333
+ clarification_questions: "clarification_questions";
334
+ clarification_answers: "clarification_answers";
335
+ plan: "plan";
336
+ plan_review: "plan_review";
337
+ test_plan: "test_plan";
338
+ implementation: "implementation";
339
+ static_review: "static_review";
340
+ security_review: "security_review";
341
+ performance_review: "performance_review";
342
+ adversarial_review: "adversarial_review";
343
+ design_review: "design_review";
344
+ docs_review: "docs_review";
345
+ ux_review: "ux_review";
346
+ review_report: "review_report";
347
+ remediation_plan: "remediation_plan";
348
+ verification: "verification";
349
+ judge_decision: "judge_decision";
350
+ planning_agreement: "planning_agreement";
351
+ implementation_agreement: "implementation_agreement";
352
+ verification_agreement: "verification_agreement";
353
+ release_summary: "release_summary";
354
+ release_agreement: "release_agreement";
355
+ escalation_context: "escalation_context";
356
+ run_manifest: "run_manifest";
357
+ codebase_context: "codebase_context";
358
+ test_suite: "test_suite";
359
+ acceptance_validation: "acceptance_validation";
360
+ review_findings: "review_findings";
361
+ task_breakdown: "task_breakdown";
362
+ decomposition_review: "decomposition_review";
363
+ task_specifications: "task_specifications";
364
+ pr_diff_context: "pr_diff_context";
365
+ }>;
366
+ name: z.ZodString;
367
+ version: z.ZodNumber;
368
+ checksum: z.ZodString;
369
+ }, z.core.$strip>>>;
370
+ reviewerArtifactVersions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
371
+ type: z.ZodEnum<{
372
+ intake_requirements: "intake_requirements";
373
+ canonical_specification: "canonical_specification";
374
+ clarification_questions: "clarification_questions";
375
+ clarification_answers: "clarification_answers";
376
+ plan: "plan";
377
+ plan_review: "plan_review";
378
+ test_plan: "test_plan";
379
+ implementation: "implementation";
380
+ static_review: "static_review";
381
+ security_review: "security_review";
382
+ performance_review: "performance_review";
383
+ adversarial_review: "adversarial_review";
384
+ design_review: "design_review";
385
+ docs_review: "docs_review";
386
+ ux_review: "ux_review";
387
+ review_report: "review_report";
388
+ remediation_plan: "remediation_plan";
389
+ verification: "verification";
390
+ judge_decision: "judge_decision";
391
+ planning_agreement: "planning_agreement";
392
+ implementation_agreement: "implementation_agreement";
393
+ verification_agreement: "verification_agreement";
394
+ release_summary: "release_summary";
395
+ release_agreement: "release_agreement";
396
+ escalation_context: "escalation_context";
397
+ run_manifest: "run_manifest";
398
+ codebase_context: "codebase_context";
399
+ test_suite: "test_suite";
400
+ acceptance_validation: "acceptance_validation";
401
+ review_findings: "review_findings";
402
+ task_breakdown: "task_breakdown";
403
+ decomposition_review: "decomposition_review";
404
+ task_specifications: "task_specifications";
405
+ pr_diff_context: "pr_diff_context";
406
+ }>;
407
+ name: z.ZodString;
408
+ version: z.ZodNumber;
409
+ checksum: z.ZodString;
410
+ }, z.core.$strip>>>;
411
+ findingsTotal: z.ZodNumber;
412
+ findingsResolved: z.ZodNumber;
413
+ findingsOpen: z.ZodNumber;
414
+ status: z.ZodEnum<{
415
+ escalated: "escalated";
416
+ failed: "failed";
417
+ in_progress: "in_progress";
418
+ succeeded: "succeeded";
419
+ }>;
420
+ }, z.core.$strip>;
421
+ export type IterationState = z.infer<typeof iterationStateSchema>;
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod/v4';
2
+ import { artifactRefSchema, artifactTypeSchema } from '../artifacts/artifact-system';
3
+ export const aggregationStrategySchema = z.enum(['all_must_pass', 'majority', 'any']);
4
+ export const successConditionTypeSchema = z.enum([
5
+ 'no_blocking_findings',
6
+ 'all_findings_addressed',
7
+ 'custom',
8
+ ]);
9
+ export const successConditionSchema = z.object({
10
+ type: successConditionTypeSchema,
11
+ params: z.record(z.string(), z.unknown()).optional(),
12
+ });
13
+ export const failureConditionTypeSchema = z.enum([
14
+ 'max_iterations_exceeded',
15
+ 'judge_arbitration_failed',
16
+ 'custom',
17
+ ]);
18
+ export const failureConditionSchema = z.object({
19
+ type: failureConditionTypeSchema,
20
+ params: z.record(z.string(), z.unknown()).optional(),
21
+ });
22
+ export const escalationActionSchema = z.enum(['escalate_to_human', 'force_approve', 'abort']);
23
+ export const escalationPolicySchema = z.object({
24
+ action: escalationActionSchema,
25
+ produceEscalationArtifact: z.boolean(),
26
+ includeFullHistory: z.boolean(),
27
+ });
28
+ export const reviewerSpecSchema = z.object({
29
+ role: z.string(),
30
+ output: artifactTypeSchema,
31
+ inputs: z.array(artifactTypeSchema).readonly(),
32
+ });
33
+ export const iterationContractSchema = z.object({
34
+ id: z.string(),
35
+ name: z.string(),
36
+ description: z.string(),
37
+ producer: z.string(),
38
+ reviewers: z.array(reviewerSpecSchema).readonly(),
39
+ aggregation: aggregationStrategySchema,
40
+ judge: z.string().optional(),
41
+ producerInputs: z.array(artifactTypeSchema).readonly(),
42
+ producerOutput: artifactTypeSchema,
43
+ successCondition: successConditionSchema,
44
+ failureCondition: failureConditionSchema,
45
+ maxIterations: z.number(),
46
+ maxJudgeArbitrations: z.number(),
47
+ escalationPolicy: escalationPolicySchema,
48
+ completionAgreement: z.string().optional(),
49
+ });
50
+ export const iterationStatusSchema = z.enum(['in_progress', 'succeeded', 'failed', 'escalated']);
51
+ export const iterationStateSchema = z.object({
52
+ contractId: z.string(),
53
+ currentIteration: z.number(),
54
+ judgeArbitrations: z.number(),
55
+ producerArtifactVersions: z.array(artifactRefSchema).readonly(),
56
+ reviewerArtifactVersions: z.array(artifactRefSchema).readonly(),
57
+ findingsTotal: z.number(),
58
+ findingsResolved: z.number(),
59
+ findingsOpen: z.number(),
60
+ status: iterationStatusSchema,
61
+ });
@@ -0,0 +1,4 @@
1
+ export * from './workflow-dsl';
2
+ export * from './workflow-engine';
3
+ export * from './workflow-file';
4
+ export * from './workflow-journal';
@@ -0,0 +1,4 @@
1
+ export * from './workflow-dsl';
2
+ export * from './workflow-engine';
3
+ export * from './workflow-file';
4
+ export * from './workflow-journal';
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const VALIDATION_RULES: readonly ["reachability", "completeness", "terminal_convergence", "determinism", "no_orphans", "valid_targets", "valid_triggers", "valid_guards", "valid_actions", "initial_state_exists", "terminal_states_exist", "terminal_no_transitions", "parallel_well_formed", "no_infinite_loops"];
3
+ export declare const validationRuleSchema: z.ZodEnum<{
4
+ reachability: "reachability";
5
+ completeness: "completeness";
6
+ terminal_convergence: "terminal_convergence";
7
+ determinism: "determinism";
8
+ no_orphans: "no_orphans";
9
+ valid_targets: "valid_targets";
10
+ valid_triggers: "valid_triggers";
11
+ valid_guards: "valid_guards";
12
+ valid_actions: "valid_actions";
13
+ initial_state_exists: "initial_state_exists";
14
+ terminal_states_exist: "terminal_states_exist";
15
+ terminal_no_transitions: "terminal_no_transitions";
16
+ parallel_well_formed: "parallel_well_formed";
17
+ no_infinite_loops: "no_infinite_loops";
18
+ }>;
19
+ export type ValidationRule = z.infer<typeof validationRuleSchema>;
20
+ export declare const workflowValidationErrorSchema: z.ZodObject<{
21
+ rule: z.ZodEnum<{
22
+ reachability: "reachability";
23
+ completeness: "completeness";
24
+ terminal_convergence: "terminal_convergence";
25
+ determinism: "determinism";
26
+ no_orphans: "no_orphans";
27
+ valid_targets: "valid_targets";
28
+ valid_triggers: "valid_triggers";
29
+ valid_guards: "valid_guards";
30
+ valid_actions: "valid_actions";
31
+ initial_state_exists: "initial_state_exists";
32
+ terminal_states_exist: "terminal_states_exist";
33
+ terminal_no_transitions: "terminal_no_transitions";
34
+ parallel_well_formed: "parallel_well_formed";
35
+ no_infinite_loops: "no_infinite_loops";
36
+ }>;
37
+ message: z.ZodString;
38
+ location: z.ZodOptional<z.ZodObject<{
39
+ state: z.ZodOptional<z.ZodString>;
40
+ transition: z.ZodOptional<z.ZodNumber>;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$strip>;
43
+ export type WorkflowValidationError = z.infer<typeof workflowValidationErrorSchema>;
44
+ export declare const workflowValidationWarningSchema: z.ZodObject<{
45
+ rule: z.ZodString;
46
+ message: z.ZodString;
47
+ suggestion: z.ZodString;
48
+ }, z.core.$strip>;
49
+ export type WorkflowValidationWarning = z.infer<typeof workflowValidationWarningSchema>;
50
+ export declare const workflowValidationResultSchema: z.ZodObject<{
51
+ valid: z.ZodBoolean;
52
+ errors: z.ZodReadonly<z.ZodArray<z.ZodObject<{
53
+ rule: z.ZodEnum<{
54
+ reachability: "reachability";
55
+ completeness: "completeness";
56
+ terminal_convergence: "terminal_convergence";
57
+ determinism: "determinism";
58
+ no_orphans: "no_orphans";
59
+ valid_targets: "valid_targets";
60
+ valid_triggers: "valid_triggers";
61
+ valid_guards: "valid_guards";
62
+ valid_actions: "valid_actions";
63
+ initial_state_exists: "initial_state_exists";
64
+ terminal_states_exist: "terminal_states_exist";
65
+ terminal_no_transitions: "terminal_no_transitions";
66
+ parallel_well_formed: "parallel_well_formed";
67
+ no_infinite_loops: "no_infinite_loops";
68
+ }>;
69
+ message: z.ZodString;
70
+ location: z.ZodOptional<z.ZodObject<{
71
+ state: z.ZodOptional<z.ZodString>;
72
+ transition: z.ZodOptional<z.ZodNumber>;
73
+ }, z.core.$strip>>;
74
+ }, z.core.$strip>>>;
75
+ warnings: z.ZodReadonly<z.ZodArray<z.ZodObject<{
76
+ rule: z.ZodString;
77
+ message: z.ZodString;
78
+ suggestion: z.ZodString;
79
+ }, z.core.$strip>>>;
80
+ }, z.core.$strip>;
81
+ export type WorkflowValidationResult = z.infer<typeof workflowValidationResultSchema>;
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod/v4';
2
+ export const VALIDATION_RULES = [
3
+ 'reachability',
4
+ 'completeness',
5
+ 'terminal_convergence',
6
+ 'determinism',
7
+ 'no_orphans',
8
+ 'valid_targets',
9
+ 'valid_triggers',
10
+ 'valid_guards',
11
+ 'valid_actions',
12
+ 'initial_state_exists',
13
+ 'terminal_states_exist',
14
+ 'terminal_no_transitions',
15
+ 'parallel_well_formed',
16
+ 'no_infinite_loops',
17
+ ];
18
+ export const validationRuleSchema = z.enum(VALIDATION_RULES);
19
+ export const workflowValidationErrorSchema = z.object({
20
+ rule: validationRuleSchema,
21
+ message: z.string(),
22
+ location: z
23
+ .object({
24
+ state: z.string().optional(),
25
+ transition: z.number().optional(),
26
+ })
27
+ .optional(),
28
+ });
29
+ export const workflowValidationWarningSchema = z.object({
30
+ rule: z.string(),
31
+ message: z.string(),
32
+ suggestion: z.string(),
33
+ });
34
+ export const workflowValidationResultSchema = z.object({
35
+ valid: z.boolean(),
36
+ errors: z.array(workflowValidationErrorSchema).readonly(),
37
+ warnings: z.array(workflowValidationWarningSchema).readonly(),
38
+ });