@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,422 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const manifestWorkflowInfoSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ version: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type ManifestWorkflowInfo = z.infer<typeof manifestWorkflowInfoSchema>;
7
+ export declare const stateVisitSchema: z.ZodObject<{
8
+ stateId: z.ZodString;
9
+ enteredAt: z.ZodString;
10
+ exitedAt: z.ZodString;
11
+ durationMs: z.ZodNumber;
12
+ }, z.core.$strip>;
13
+ export type StateVisit = z.infer<typeof stateVisitSchema>;
14
+ export declare const stateTimingSchema: z.ZodObject<{
15
+ stateId: z.ZodString;
16
+ enteredAt: z.ZodString;
17
+ exitedAt: z.ZodString;
18
+ durationMs: z.ZodNumber;
19
+ visits: z.ZodNumber;
20
+ }, z.core.$strip>;
21
+ export type StateTiming = z.infer<typeof stateTimingSchema>;
22
+ export declare const manifestTimingSchema: z.ZodObject<{
23
+ startedAt: z.ZodString;
24
+ completedAt: z.ZodString;
25
+ totalDurationMs: z.ZodNumber;
26
+ stateTimings: z.ZodReadonly<z.ZodArray<z.ZodObject<{
27
+ stateId: z.ZodString;
28
+ enteredAt: z.ZodString;
29
+ exitedAt: z.ZodString;
30
+ durationMs: z.ZodNumber;
31
+ visits: z.ZodNumber;
32
+ }, z.core.$strip>>>;
33
+ stateTrace: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
34
+ stateId: z.ZodString;
35
+ enteredAt: z.ZodString;
36
+ exitedAt: z.ZodString;
37
+ durationMs: z.ZodNumber;
38
+ }, z.core.$strip>>>>;
39
+ }, z.core.$strip>;
40
+ export type ManifestTiming = z.infer<typeof manifestTimingSchema>;
41
+ export declare const roleUsageSchema: z.ZodObject<{
42
+ role: z.ZodString;
43
+ dispatches: z.ZodNumber;
44
+ inputTokens: z.ZodNumber;
45
+ outputTokens: z.ZodNumber;
46
+ totalDurationMs: z.ZodNumber;
47
+ artifactsProduced: z.ZodNumber;
48
+ }, z.core.$strip>;
49
+ export type RoleUsage = z.infer<typeof roleUsageSchema>;
50
+ export declare const manifestArtifactSummarySchema: z.ZodObject<{
51
+ ref: z.ZodObject<{
52
+ type: z.ZodEnum<{
53
+ intake_requirements: "intake_requirements";
54
+ canonical_specification: "canonical_specification";
55
+ clarification_questions: "clarification_questions";
56
+ clarification_answers: "clarification_answers";
57
+ plan: "plan";
58
+ plan_review: "plan_review";
59
+ test_plan: "test_plan";
60
+ implementation: "implementation";
61
+ static_review: "static_review";
62
+ security_review: "security_review";
63
+ performance_review: "performance_review";
64
+ adversarial_review: "adversarial_review";
65
+ design_review: "design_review";
66
+ docs_review: "docs_review";
67
+ ux_review: "ux_review";
68
+ review_report: "review_report";
69
+ remediation_plan: "remediation_plan";
70
+ verification: "verification";
71
+ judge_decision: "judge_decision";
72
+ planning_agreement: "planning_agreement";
73
+ implementation_agreement: "implementation_agreement";
74
+ verification_agreement: "verification_agreement";
75
+ release_summary: "release_summary";
76
+ release_agreement: "release_agreement";
77
+ escalation_context: "escalation_context";
78
+ run_manifest: "run_manifest";
79
+ codebase_context: "codebase_context";
80
+ test_suite: "test_suite";
81
+ acceptance_validation: "acceptance_validation";
82
+ review_findings: "review_findings";
83
+ task_breakdown: "task_breakdown";
84
+ decomposition_review: "decomposition_review";
85
+ task_specifications: "task_specifications";
86
+ pr_diff_context: "pr_diff_context";
87
+ }>;
88
+ name: z.ZodString;
89
+ version: z.ZodNumber;
90
+ checksum: z.ZodString;
91
+ }, z.core.$strip>;
92
+ producedBy: z.ZodString;
93
+ createdAt: z.ZodString;
94
+ sizeBytes: z.ZodNumber;
95
+ }, z.core.$strip>;
96
+ export type ManifestArtifactSummary = z.infer<typeof manifestArtifactSummarySchema>;
97
+ export declare const manifestIterationSummarySchema: z.ZodObject<{
98
+ contractId: z.ZodString;
99
+ totalIterations: z.ZodNumber;
100
+ judgeArbitrations: z.ZodNumber;
101
+ finalStatus: z.ZodString;
102
+ findingsTotal: z.ZodNumber;
103
+ findingsResolved: z.ZodNumber;
104
+ }, z.core.$strip>;
105
+ export type ManifestIterationSummary = z.infer<typeof manifestIterationSummarySchema>;
106
+ export declare const manifestTokenUsageSchema: z.ZodObject<{
107
+ totalInputTokens: z.ZodNumber;
108
+ totalOutputTokens: z.ZodNumber;
109
+ totalTokens: z.ZodNumber;
110
+ byRole: z.ZodRecord<z.ZodString, z.ZodObject<{
111
+ input: z.ZodNumber;
112
+ output: z.ZodNumber;
113
+ }, z.core.$strip>>;
114
+ }, z.core.$strip>;
115
+ export type ManifestTokenUsage = z.infer<typeof manifestTokenUsageSchema>;
116
+ export declare const manifestBudgetSummarySchema: z.ZodObject<{
117
+ configuredMaxTokens: z.ZodNullable<z.ZodNumber>;
118
+ budgetExceeded: z.ZodBoolean;
119
+ }, z.core.$strip>;
120
+ export type ManifestBudgetSummary = z.infer<typeof manifestBudgetSummarySchema>;
121
+ export declare const runManifestSchema: z.ZodObject<{
122
+ runId: z.ZodString;
123
+ version: z.ZodString;
124
+ repository: z.ZodString;
125
+ repoRoot: z.ZodOptional<z.ZodString>;
126
+ workflow: z.ZodObject<{
127
+ name: z.ZodString;
128
+ version: z.ZodString;
129
+ }, z.core.$strip>;
130
+ timing: z.ZodObject<{
131
+ startedAt: z.ZodString;
132
+ completedAt: z.ZodString;
133
+ totalDurationMs: z.ZodNumber;
134
+ stateTimings: z.ZodReadonly<z.ZodArray<z.ZodObject<{
135
+ stateId: z.ZodString;
136
+ enteredAt: z.ZodString;
137
+ exitedAt: z.ZodString;
138
+ durationMs: z.ZodNumber;
139
+ visits: z.ZodNumber;
140
+ }, z.core.$strip>>>;
141
+ stateTrace: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
142
+ stateId: z.ZodString;
143
+ enteredAt: z.ZodString;
144
+ exitedAt: z.ZodString;
145
+ durationMs: z.ZodNumber;
146
+ }, z.core.$strip>>>>;
147
+ }, z.core.$strip>;
148
+ status: z.ZodString;
149
+ finalState: z.ZodString;
150
+ abortReason: z.ZodOptional<z.ZodString>;
151
+ activeRoles: z.ZodReadonly<z.ZodArray<z.ZodObject<{
152
+ role: z.ZodString;
153
+ dispatches: z.ZodNumber;
154
+ inputTokens: z.ZodNumber;
155
+ outputTokens: z.ZodNumber;
156
+ totalDurationMs: z.ZodNumber;
157
+ artifactsProduced: z.ZodNumber;
158
+ }, z.core.$strip>>>;
159
+ artifactInventory: z.ZodReadonly<z.ZodArray<z.ZodObject<{
160
+ ref: z.ZodObject<{
161
+ type: z.ZodEnum<{
162
+ intake_requirements: "intake_requirements";
163
+ canonical_specification: "canonical_specification";
164
+ clarification_questions: "clarification_questions";
165
+ clarification_answers: "clarification_answers";
166
+ plan: "plan";
167
+ plan_review: "plan_review";
168
+ test_plan: "test_plan";
169
+ implementation: "implementation";
170
+ static_review: "static_review";
171
+ security_review: "security_review";
172
+ performance_review: "performance_review";
173
+ adversarial_review: "adversarial_review";
174
+ design_review: "design_review";
175
+ docs_review: "docs_review";
176
+ ux_review: "ux_review";
177
+ review_report: "review_report";
178
+ remediation_plan: "remediation_plan";
179
+ verification: "verification";
180
+ judge_decision: "judge_decision";
181
+ planning_agreement: "planning_agreement";
182
+ implementation_agreement: "implementation_agreement";
183
+ verification_agreement: "verification_agreement";
184
+ release_summary: "release_summary";
185
+ release_agreement: "release_agreement";
186
+ escalation_context: "escalation_context";
187
+ run_manifest: "run_manifest";
188
+ codebase_context: "codebase_context";
189
+ test_suite: "test_suite";
190
+ acceptance_validation: "acceptance_validation";
191
+ review_findings: "review_findings";
192
+ task_breakdown: "task_breakdown";
193
+ decomposition_review: "decomposition_review";
194
+ task_specifications: "task_specifications";
195
+ pr_diff_context: "pr_diff_context";
196
+ }>;
197
+ name: z.ZodString;
198
+ version: z.ZodNumber;
199
+ checksum: z.ZodString;
200
+ }, z.core.$strip>;
201
+ producedBy: z.ZodString;
202
+ createdAt: z.ZodString;
203
+ sizeBytes: z.ZodNumber;
204
+ }, z.core.$strip>>>;
205
+ totalArtifacts: z.ZodNumber;
206
+ totalArtifactSizeBytes: z.ZodNumber;
207
+ iterations: z.ZodReadonly<z.ZodArray<z.ZodObject<{
208
+ contractId: z.ZodString;
209
+ totalIterations: z.ZodNumber;
210
+ judgeArbitrations: z.ZodNumber;
211
+ finalStatus: z.ZodString;
212
+ findingsTotal: z.ZodNumber;
213
+ findingsResolved: z.ZodNumber;
214
+ }, z.core.$strip>>>;
215
+ governanceDecisions: z.ZodNumber;
216
+ escalations: z.ZodNumber;
217
+ humanInterventions: z.ZodNumber;
218
+ agreements: z.ZodReadonly<z.ZodArray<z.ZodObject<{
219
+ type: z.ZodEnum<{
220
+ intake_requirements: "intake_requirements";
221
+ canonical_specification: "canonical_specification";
222
+ clarification_questions: "clarification_questions";
223
+ clarification_answers: "clarification_answers";
224
+ plan: "plan";
225
+ plan_review: "plan_review";
226
+ test_plan: "test_plan";
227
+ implementation: "implementation";
228
+ static_review: "static_review";
229
+ security_review: "security_review";
230
+ performance_review: "performance_review";
231
+ adversarial_review: "adversarial_review";
232
+ design_review: "design_review";
233
+ docs_review: "docs_review";
234
+ ux_review: "ux_review";
235
+ review_report: "review_report";
236
+ remediation_plan: "remediation_plan";
237
+ verification: "verification";
238
+ judge_decision: "judge_decision";
239
+ planning_agreement: "planning_agreement";
240
+ implementation_agreement: "implementation_agreement";
241
+ verification_agreement: "verification_agreement";
242
+ release_summary: "release_summary";
243
+ release_agreement: "release_agreement";
244
+ escalation_context: "escalation_context";
245
+ run_manifest: "run_manifest";
246
+ codebase_context: "codebase_context";
247
+ test_suite: "test_suite";
248
+ acceptance_validation: "acceptance_validation";
249
+ review_findings: "review_findings";
250
+ task_breakdown: "task_breakdown";
251
+ decomposition_review: "decomposition_review";
252
+ task_specifications: "task_specifications";
253
+ pr_diff_context: "pr_diff_context";
254
+ }>;
255
+ name: z.ZodString;
256
+ version: z.ZodNumber;
257
+ checksum: z.ZodString;
258
+ }, z.core.$strip>>>;
259
+ tokenUsage: z.ZodObject<{
260
+ totalInputTokens: z.ZodNumber;
261
+ totalOutputTokens: z.ZodNumber;
262
+ totalTokens: z.ZodNumber;
263
+ byRole: z.ZodRecord<z.ZodString, z.ZodObject<{
264
+ input: z.ZodNumber;
265
+ output: z.ZodNumber;
266
+ }, z.core.$strip>>;
267
+ }, z.core.$strip>;
268
+ budgetSummary: z.ZodOptional<z.ZodObject<{
269
+ configuredMaxTokens: z.ZodNullable<z.ZodNumber>;
270
+ budgetExceeded: z.ZodBoolean;
271
+ }, z.core.$strip>>;
272
+ reportPath: z.ZodOptional<z.ZodString>;
273
+ }, z.core.$strip>;
274
+ export type RunManifest = z.infer<typeof runManifestSchema>;
275
+ export declare const manifestContextConfigSchema: z.ZodObject<{
276
+ startedAt: z.ZodString;
277
+ completedAt: z.ZodString;
278
+ governanceDecisions: z.ZodNumber;
279
+ escalations: z.ZodNumber;
280
+ iterations: z.ZodReadonly<z.ZodArray<z.ZodObject<{
281
+ contractId: z.ZodString;
282
+ totalIterations: z.ZodNumber;
283
+ judgeArbitrations: z.ZodNumber;
284
+ finalStatus: z.ZodString;
285
+ findingsTotal: z.ZodNumber;
286
+ findingsResolved: z.ZodNumber;
287
+ }, z.core.$strip>>>;
288
+ stateTimestamps: z.ZodReadonly<z.ZodArray<z.ZodObject<{
289
+ stateId: z.ZodString;
290
+ enteredAt: z.ZodString;
291
+ exitedAt: z.ZodString;
292
+ }, z.core.$strip>>>;
293
+ repoRoot: z.ZodOptional<z.ZodString>;
294
+ }, z.core.$strip>;
295
+ export type ManifestContextConfig = z.infer<typeof manifestContextConfigSchema>;
296
+ export declare const manifestContextSchema: z.ZodObject<{
297
+ runId: z.ZodString;
298
+ config: z.ZodObject<{
299
+ startedAt: z.ZodString;
300
+ completedAt: z.ZodString;
301
+ governanceDecisions: z.ZodNumber;
302
+ escalations: z.ZodNumber;
303
+ iterations: z.ZodReadonly<z.ZodArray<z.ZodObject<{
304
+ contractId: z.ZodString;
305
+ totalIterations: z.ZodNumber;
306
+ judgeArbitrations: z.ZodNumber;
307
+ finalStatus: z.ZodString;
308
+ findingsTotal: z.ZodNumber;
309
+ findingsResolved: z.ZodNumber;
310
+ }, z.core.$strip>>>;
311
+ stateTimestamps: z.ZodReadonly<z.ZodArray<z.ZodObject<{
312
+ stateId: z.ZodString;
313
+ enteredAt: z.ZodString;
314
+ exitedAt: z.ZodString;
315
+ }, z.core.$strip>>>;
316
+ repoRoot: z.ZodOptional<z.ZodString>;
317
+ }, z.core.$strip>;
318
+ stateHistory: z.ZodReadonly<z.ZodArray<z.ZodString>>;
319
+ artifactInventory: z.ZodReadonly<z.ZodArray<z.ZodObject<{
320
+ type: z.ZodEnum<{
321
+ intake_requirements: "intake_requirements";
322
+ canonical_specification: "canonical_specification";
323
+ clarification_questions: "clarification_questions";
324
+ clarification_answers: "clarification_answers";
325
+ plan: "plan";
326
+ plan_review: "plan_review";
327
+ test_plan: "test_plan";
328
+ implementation: "implementation";
329
+ static_review: "static_review";
330
+ security_review: "security_review";
331
+ performance_review: "performance_review";
332
+ adversarial_review: "adversarial_review";
333
+ design_review: "design_review";
334
+ docs_review: "docs_review";
335
+ ux_review: "ux_review";
336
+ review_report: "review_report";
337
+ remediation_plan: "remediation_plan";
338
+ verification: "verification";
339
+ judge_decision: "judge_decision";
340
+ planning_agreement: "planning_agreement";
341
+ implementation_agreement: "implementation_agreement";
342
+ verification_agreement: "verification_agreement";
343
+ release_summary: "release_summary";
344
+ release_agreement: "release_agreement";
345
+ escalation_context: "escalation_context";
346
+ run_manifest: "run_manifest";
347
+ codebase_context: "codebase_context";
348
+ test_suite: "test_suite";
349
+ acceptance_validation: "acceptance_validation";
350
+ review_findings: "review_findings";
351
+ task_breakdown: "task_breakdown";
352
+ decomposition_review: "decomposition_review";
353
+ task_specifications: "task_specifications";
354
+ pr_diff_context: "pr_diff_context";
355
+ }>;
356
+ name: z.ZodString;
357
+ version: z.ZodNumber;
358
+ checksum: z.ZodString;
359
+ }, z.core.$strip>>>;
360
+ journalPath: z.ZodString;
361
+ workerMetrics: z.ZodRecord<z.ZodString, z.ZodObject<{
362
+ inputTokens: z.ZodNumber;
363
+ outputTokens: z.ZodNumber;
364
+ dispatches: z.ZodNumber;
365
+ durationMs: z.ZodNumber;
366
+ artifactsProduced: z.ZodNumber;
367
+ }, z.core.$strip>>;
368
+ workflowName: z.ZodOptional<z.ZodString>;
369
+ workflowVersion: z.ZodOptional<z.ZodString>;
370
+ artifactSummaries: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
371
+ ref: z.ZodObject<{
372
+ type: z.ZodEnum<{
373
+ intake_requirements: "intake_requirements";
374
+ canonical_specification: "canonical_specification";
375
+ clarification_questions: "clarification_questions";
376
+ clarification_answers: "clarification_answers";
377
+ plan: "plan";
378
+ plan_review: "plan_review";
379
+ test_plan: "test_plan";
380
+ implementation: "implementation";
381
+ static_review: "static_review";
382
+ security_review: "security_review";
383
+ performance_review: "performance_review";
384
+ adversarial_review: "adversarial_review";
385
+ design_review: "design_review";
386
+ docs_review: "docs_review";
387
+ ux_review: "ux_review";
388
+ review_report: "review_report";
389
+ remediation_plan: "remediation_plan";
390
+ verification: "verification";
391
+ judge_decision: "judge_decision";
392
+ planning_agreement: "planning_agreement";
393
+ implementation_agreement: "implementation_agreement";
394
+ verification_agreement: "verification_agreement";
395
+ release_summary: "release_summary";
396
+ release_agreement: "release_agreement";
397
+ escalation_context: "escalation_context";
398
+ run_manifest: "run_manifest";
399
+ codebase_context: "codebase_context";
400
+ test_suite: "test_suite";
401
+ acceptance_validation: "acceptance_validation";
402
+ review_findings: "review_findings";
403
+ task_breakdown: "task_breakdown";
404
+ decomposition_review: "decomposition_review";
405
+ task_specifications: "task_specifications";
406
+ pr_diff_context: "pr_diff_context";
407
+ }>;
408
+ name: z.ZodString;
409
+ version: z.ZodNumber;
410
+ checksum: z.ZodString;
411
+ }, z.core.$strip>;
412
+ producedBy: z.ZodString;
413
+ createdAt: z.ZodString;
414
+ sizeBytes: z.ZodNumber;
415
+ }, z.core.$strip>>>>;
416
+ budgetSummary: z.ZodOptional<z.ZodObject<{
417
+ configuredMaxTokens: z.ZodNullable<z.ZodNumber>;
418
+ budgetExceeded: z.ZodBoolean;
419
+ }, z.core.$strip>>;
420
+ reportPath: z.ZodOptional<z.ZodString>;
421
+ }, z.core.$strip>;
422
+ export type ManifestContext = z.infer<typeof manifestContextSchema>;
@@ -0,0 +1,118 @@
1
+ import { z } from 'zod/v4';
2
+ import { artifactRefSchema } from '../artifacts/artifact-system';
3
+ export const manifestWorkflowInfoSchema = z.object({
4
+ name: z.string(),
5
+ version: z.string(),
6
+ });
7
+ export const stateVisitSchema = z.object({
8
+ stateId: z.string(),
9
+ enteredAt: z.string(),
10
+ exitedAt: z.string(),
11
+ durationMs: z.number(),
12
+ });
13
+ export const stateTimingSchema = z.object({
14
+ stateId: z.string(),
15
+ enteredAt: z.string(),
16
+ exitedAt: z.string(),
17
+ durationMs: z.number(),
18
+ visits: z.number(),
19
+ });
20
+ export const manifestTimingSchema = z.object({
21
+ startedAt: z.string(),
22
+ completedAt: z.string(),
23
+ totalDurationMs: z.number(),
24
+ stateTimings: z.array(stateTimingSchema).readonly(),
25
+ stateTrace: z.array(stateVisitSchema).readonly().optional(),
26
+ });
27
+ export const roleUsageSchema = z.object({
28
+ role: z.string(),
29
+ dispatches: z.number(),
30
+ inputTokens: z.number(),
31
+ outputTokens: z.number(),
32
+ totalDurationMs: z.number(),
33
+ artifactsProduced: z.number(),
34
+ });
35
+ export const manifestArtifactSummarySchema = z.object({
36
+ ref: artifactRefSchema,
37
+ producedBy: z.string(),
38
+ createdAt: z.string(),
39
+ sizeBytes: z.number(),
40
+ });
41
+ export const manifestIterationSummarySchema = z.object({
42
+ contractId: z.string(),
43
+ totalIterations: z.number(),
44
+ judgeArbitrations: z.number(),
45
+ finalStatus: z.string(),
46
+ findingsTotal: z.number(),
47
+ findingsResolved: z.number(),
48
+ });
49
+ export const manifestTokenUsageSchema = z.object({
50
+ totalInputTokens: z.number(),
51
+ totalOutputTokens: z.number(),
52
+ totalTokens: z.number(),
53
+ byRole: z.record(z.string(), z.object({
54
+ input: z.number(),
55
+ output: z.number(),
56
+ })),
57
+ });
58
+ export const manifestBudgetSummarySchema = z.object({
59
+ configuredMaxTokens: z.number().nullable(),
60
+ budgetExceeded: z.boolean(),
61
+ });
62
+ export const runManifestSchema = z.object({
63
+ runId: z.string(),
64
+ version: z.string(),
65
+ repository: z.string(),
66
+ repoRoot: z.string().optional(),
67
+ workflow: manifestWorkflowInfoSchema,
68
+ timing: manifestTimingSchema,
69
+ status: z.string(),
70
+ finalState: z.string(),
71
+ abortReason: z.string().optional(),
72
+ activeRoles: z.array(roleUsageSchema).readonly(),
73
+ artifactInventory: z.array(manifestArtifactSummarySchema).readonly(),
74
+ totalArtifacts: z.number(),
75
+ totalArtifactSizeBytes: z.number(),
76
+ iterations: z.array(manifestIterationSummarySchema).readonly(),
77
+ governanceDecisions: z.number(),
78
+ escalations: z.number(),
79
+ humanInterventions: z.number(),
80
+ agreements: z.array(artifactRefSchema).readonly(),
81
+ tokenUsage: manifestTokenUsageSchema,
82
+ budgetSummary: manifestBudgetSummarySchema.optional(),
83
+ reportPath: z.string().optional(),
84
+ });
85
+ export const manifestContextConfigSchema = z.object({
86
+ startedAt: z.string(),
87
+ completedAt: z.string(),
88
+ governanceDecisions: z.number(),
89
+ escalations: z.number(),
90
+ iterations: z.array(manifestIterationSummarySchema).readonly(),
91
+ stateTimestamps: z
92
+ .array(z.object({
93
+ stateId: z.string(),
94
+ enteredAt: z.string(),
95
+ exitedAt: z.string(),
96
+ }))
97
+ .readonly(),
98
+ repoRoot: z.string().optional(),
99
+ });
100
+ export const manifestContextSchema = z.object({
101
+ runId: z.string(),
102
+ config: manifestContextConfigSchema,
103
+ stateHistory: z.array(z.string()).readonly(),
104
+ artifactInventory: z.array(artifactRefSchema).readonly(),
105
+ journalPath: z.string(),
106
+ workerMetrics: z.record(z.string(), z.object({
107
+ inputTokens: z.number(),
108
+ outputTokens: z.number(),
109
+ dispatches: z.number(),
110
+ durationMs: z.number(),
111
+ artifactsProduced: z.number(),
112
+ })),
113
+ workflowName: z.string().optional(),
114
+ workflowVersion: z.string().optional(),
115
+ artifactSummaries: z.array(manifestArtifactSummarySchema).readonly().optional(),
116
+ budgetSummary: manifestBudgetSummarySchema.optional(),
117
+ reportPath: z.string().optional(),
118
+ });