@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.
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/artifacts/agreement-artifacts.d.ts +311 -0
- package/dist/artifacts/agreement-artifacts.js +48 -0
- package/dist/artifacts/artifact-dependency-graph.d.ts +775 -0
- package/dist/artifacts/artifact-dependency-graph.js +57 -0
- package/dist/artifacts/artifact-system.d.ts +657 -0
- package/dist/artifacts/artifact-system.js +124 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +3 -0
- package/dist/config/configuration.d.ts +324 -0
- package/dist/config/configuration.js +93 -0
- package/dist/config/event-bus-config.d.ts +153 -0
- package/dist/config/event-bus-config.js +27 -0
- package/dist/config/event-payloads.d.ts +919 -0
- package/dist/config/event-payloads.js +304 -0
- package/dist/config/event-system.d.ts +3231 -0
- package/dist/config/event-system.js +428 -0
- package/dist/config/event-types.d.ts +62 -0
- package/dist/config/event-types.js +66 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.js +5 -0
- package/dist/dashboard/dashboard-api.d.ts +149 -0
- package/dist/dashboard/dashboard-api.js +80 -0
- package/dist/dashboard/dashboard-domain.d.ts +1076 -0
- package/dist/dashboard/dashboard-domain.js +305 -0
- package/dist/dashboard/index.d.ts +3 -0
- package/dist/dashboard/index.js +3 -0
- package/dist/dashboard/run-creation-params.d.ts +111 -0
- package/dist/dashboard/run-creation-params.js +14 -0
- package/dist/governance/governance.d.ts +1119 -0
- package/dist/governance/governance.js +111 -0
- package/dist/governance/index.d.ts +3 -0
- package/dist/governance/index.js +3 -0
- package/dist/governance/policy-engine.d.ts +634 -0
- package/dist/governance/policy-engine.js +214 -0
- package/dist/governance/review-resolution.d.ts +1053 -0
- package/dist/governance/review-resolution.js +67 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/observability/diagnostics.d.ts +185 -0
- package/dist/observability/diagnostics.js +63 -0
- package/dist/observability/index.d.ts +2 -0
- package/dist/observability/index.js +2 -0
- package/dist/observability/metrics.d.ts +187 -0
- package/dist/observability/metrics.js +67 -0
- package/dist/persistence/execution-analytics.d.ts +173 -0
- package/dist/persistence/execution-analytics.js +71 -0
- package/dist/persistence/index.d.ts +5 -0
- package/dist/persistence/index.js +5 -0
- package/dist/persistence/project-context.d.ts +164 -0
- package/dist/persistence/project-context.js +88 -0
- package/dist/persistence/repository-model.d.ts +27 -0
- package/dist/persistence/repository-model.js +16 -0
- package/dist/persistence/run-manifest.d.ts +422 -0
- package/dist/persistence/run-manifest.js +118 -0
- package/dist/persistence/state-persistence.d.ts +276 -0
- package/dist/persistence/state-persistence.js +83 -0
- package/dist/runner/built-in-runner-ids.d.ts +8 -0
- package/dist/runner/built-in-runner-ids.js +11 -0
- package/dist/runner/collaboration-model.d.ts +100 -0
- package/dist/runner/collaboration-model.js +19 -0
- package/dist/runner/confidence.d.ts +17 -0
- package/dist/runner/confidence.js +11 -0
- package/dist/runner/index.d.ts +8 -0
- package/dist/runner/index.js +8 -0
- package/dist/runner/permission-approval.d.ts +38 -0
- package/dist/runner/permission-approval.js +14 -0
- package/dist/runner/prompt-engine.d.ts +1467 -0
- package/dist/runner/prompt-engine.js +193 -0
- package/dist/runner/role-system.d.ts +458 -0
- package/dist/runner/role-system.js +94 -0
- package/dist/runner/runner-system.d.ts +1721 -0
- package/dist/runner/runner-system.js +268 -0
- package/dist/runner/task-brief.d.ts +18 -0
- package/dist/runner/task-brief.js +12 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/shared.d.ts +30 -0
- package/dist/shared/shared.js +27 -0
- package/dist/shared/string-enums.d.ts +59 -0
- package/dist/shared/string-enums.js +24 -0
- package/dist/shared/utils.d.ts +25 -0
- package/dist/shared/utils.js +22 -0
- package/dist/specification/canonical-specification.d.ts +475 -0
- package/dist/specification/canonical-specification.js +151 -0
- package/dist/specification/index.d.ts +3 -0
- package/dist/specification/index.js +3 -0
- package/dist/specification/intake.d.ts +419 -0
- package/dist/specification/intake.js +70 -0
- package/dist/specification/iteration-contracts.d.ts +421 -0
- package/dist/specification/iteration-contracts.js +61 -0
- package/dist/workflow/index.d.ts +4 -0
- package/dist/workflow/index.js +4 -0
- package/dist/workflow/workflow-dsl.d.ts +81 -0
- package/dist/workflow/workflow-dsl.js +38 -0
- package/dist/workflow/workflow-engine.d.ts +5788 -0
- package/dist/workflow/workflow-engine.js +414 -0
- package/dist/workflow/workflow-file.d.ts +331 -0
- package/dist/workflow/workflow-file.js +41 -0
- package/dist/workflow/workflow-journal.d.ts +520 -0
- package/dist/workflow/workflow-journal.js +151 -0
- package/package.json +39 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
export declare const workflowSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
version: z.ZodString;
|
|
5
|
+
initialState: z.ZodString;
|
|
6
|
+
terminalStates: z.ZodArray<z.ZodString>;
|
|
7
|
+
states: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8
|
+
type: z.ZodEnum<{
|
|
9
|
+
judge: "judge";
|
|
10
|
+
action: "action";
|
|
11
|
+
review: "review";
|
|
12
|
+
gate: "gate";
|
|
13
|
+
wait: "wait";
|
|
14
|
+
terminal: "terminal";
|
|
15
|
+
}>;
|
|
16
|
+
label: z.ZodOptional<z.ZodString>;
|
|
17
|
+
description: z.ZodCatch<z.ZodString>;
|
|
18
|
+
entryActions: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
19
|
+
type: z.ZodEnum<{
|
|
20
|
+
dispatch_worker: "dispatch_worker";
|
|
21
|
+
dispatch_parallel_workers: "dispatch_parallel_workers";
|
|
22
|
+
dispatch_dynamic_workers: "dispatch_dynamic_workers";
|
|
23
|
+
run_script: "run_script";
|
|
24
|
+
store_artifact: "store_artifact";
|
|
25
|
+
record_journal: "record_journal";
|
|
26
|
+
generate_agreement: "generate_agreement";
|
|
27
|
+
produce_manifest: "produce_manifest";
|
|
28
|
+
notify_human: "notify_human";
|
|
29
|
+
}>;
|
|
30
|
+
params: z.ZodCatch<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
32
|
+
type: "dispatch_worker";
|
|
33
|
+
params: {
|
|
34
|
+
role: "judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer";
|
|
35
|
+
parallel?: boolean | undefined;
|
|
36
|
+
branchId?: string | undefined;
|
|
37
|
+
stateId?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
type: "dispatch_parallel_workers";
|
|
41
|
+
params: {
|
|
42
|
+
roles: readonly ("judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer")[];
|
|
43
|
+
docsOnlyRoles?: readonly ("judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer")[] | undefined;
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
type: "dispatch_dynamic_workers";
|
|
47
|
+
params: {
|
|
48
|
+
role: "judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer";
|
|
49
|
+
sourceArtifact: "intake_requirements" | "canonical_specification" | "clarification_questions" | "clarification_answers" | "plan" | "plan_review" | "test_plan" | "implementation" | "static_review" | "security_review" | "performance_review" | "adversarial_review" | "design_review" | "docs_review" | "ux_review" | "review_report" | "remediation_plan" | "verification" | "judge_decision" | "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_summary" | "release_agreement" | "escalation_context" | "run_manifest" | "codebase_context" | "test_suite" | "acceptance_validation" | "review_findings" | "task_breakdown" | "decomposition_review" | "task_specifications" | "pr_diff_context";
|
|
50
|
+
itemsPath: string;
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
type: "store_artifact";
|
|
54
|
+
params: {
|
|
55
|
+
type: "intake_requirements" | "canonical_specification" | "clarification_questions" | "clarification_answers" | "plan" | "plan_review" | "test_plan" | "implementation" | "static_review" | "security_review" | "performance_review" | "adversarial_review" | "design_review" | "docs_review" | "ux_review" | "review_report" | "remediation_plan" | "verification" | "judge_decision" | "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_summary" | "release_agreement" | "escalation_context" | "run_manifest" | "codebase_context" | "test_suite" | "acceptance_validation" | "review_findings" | "task_breakdown" | "decomposition_review" | "task_specifications" | "pr_diff_context";
|
|
56
|
+
content: string;
|
|
57
|
+
name?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
type: "record_journal";
|
|
61
|
+
params: {
|
|
62
|
+
event: "run_started" | "run_completed" | "run_failed" | "run_aborted";
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
type: "generate_agreement";
|
|
66
|
+
params: {
|
|
67
|
+
type: "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_agreement";
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
type: "notify_human";
|
|
71
|
+
params: {
|
|
72
|
+
reason?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
type: "run_script";
|
|
76
|
+
params: {
|
|
77
|
+
script: string;
|
|
78
|
+
timeout?: number | undefined;
|
|
79
|
+
env?: Record<string, string> | undefined;
|
|
80
|
+
storeOutput?: {
|
|
81
|
+
artifactType: string;
|
|
82
|
+
producedBy: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
type: "produce_manifest";
|
|
87
|
+
params: Record<string, never>;
|
|
88
|
+
}, {
|
|
89
|
+
type: "dispatch_worker" | "dispatch_parallel_workers" | "dispatch_dynamic_workers" | "run_script" | "store_artifact" | "record_journal" | "generate_agreement" | "produce_manifest" | "notify_human";
|
|
90
|
+
params: Record<string, unknown>;
|
|
91
|
+
}>>>>;
|
|
92
|
+
exitActions: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
93
|
+
type: z.ZodEnum<{
|
|
94
|
+
dispatch_worker: "dispatch_worker";
|
|
95
|
+
dispatch_parallel_workers: "dispatch_parallel_workers";
|
|
96
|
+
dispatch_dynamic_workers: "dispatch_dynamic_workers";
|
|
97
|
+
run_script: "run_script";
|
|
98
|
+
store_artifact: "store_artifact";
|
|
99
|
+
record_journal: "record_journal";
|
|
100
|
+
generate_agreement: "generate_agreement";
|
|
101
|
+
produce_manifest: "produce_manifest";
|
|
102
|
+
notify_human: "notify_human";
|
|
103
|
+
}>;
|
|
104
|
+
params: z.ZodCatch<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
105
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
106
|
+
type: "dispatch_worker";
|
|
107
|
+
params: {
|
|
108
|
+
role: "judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer";
|
|
109
|
+
parallel?: boolean | undefined;
|
|
110
|
+
branchId?: string | undefined;
|
|
111
|
+
stateId?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
} | {
|
|
114
|
+
type: "dispatch_parallel_workers";
|
|
115
|
+
params: {
|
|
116
|
+
roles: readonly ("judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer")[];
|
|
117
|
+
docsOnlyRoles?: readonly ("judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer")[] | undefined;
|
|
118
|
+
};
|
|
119
|
+
} | {
|
|
120
|
+
type: "dispatch_dynamic_workers";
|
|
121
|
+
params: {
|
|
122
|
+
role: "judge" | "requirements_analyst" | "context_analyst" | "codebase_analyst" | "planner" | "plan_reviewer" | "implementer" | "test_engineer" | "static_reviewer" | "security_reviewer" | "performance_reviewer" | "adversarial_reviewer" | "design_reviewer" | "docs_reviewer" | "ux_reviewer" | "report_synthesizer" | "remediation_triage" | "verifier" | "summary_writer" | "review_findings_writer" | "acceptance_validator" | "breakdown_analyst" | "decomposer" | "decomposition_reviewer" | "task_spec_writer";
|
|
123
|
+
sourceArtifact: "intake_requirements" | "canonical_specification" | "clarification_questions" | "clarification_answers" | "plan" | "plan_review" | "test_plan" | "implementation" | "static_review" | "security_review" | "performance_review" | "adversarial_review" | "design_review" | "docs_review" | "ux_review" | "review_report" | "remediation_plan" | "verification" | "judge_decision" | "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_summary" | "release_agreement" | "escalation_context" | "run_manifest" | "codebase_context" | "test_suite" | "acceptance_validation" | "review_findings" | "task_breakdown" | "decomposition_review" | "task_specifications" | "pr_diff_context";
|
|
124
|
+
itemsPath: string;
|
|
125
|
+
};
|
|
126
|
+
} | {
|
|
127
|
+
type: "store_artifact";
|
|
128
|
+
params: {
|
|
129
|
+
type: "intake_requirements" | "canonical_specification" | "clarification_questions" | "clarification_answers" | "plan" | "plan_review" | "test_plan" | "implementation" | "static_review" | "security_review" | "performance_review" | "adversarial_review" | "design_review" | "docs_review" | "ux_review" | "review_report" | "remediation_plan" | "verification" | "judge_decision" | "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_summary" | "release_agreement" | "escalation_context" | "run_manifest" | "codebase_context" | "test_suite" | "acceptance_validation" | "review_findings" | "task_breakdown" | "decomposition_review" | "task_specifications" | "pr_diff_context";
|
|
130
|
+
content: string;
|
|
131
|
+
name?: string | undefined;
|
|
132
|
+
};
|
|
133
|
+
} | {
|
|
134
|
+
type: "record_journal";
|
|
135
|
+
params: {
|
|
136
|
+
event: "run_started" | "run_completed" | "run_failed" | "run_aborted";
|
|
137
|
+
};
|
|
138
|
+
} | {
|
|
139
|
+
type: "generate_agreement";
|
|
140
|
+
params: {
|
|
141
|
+
type: "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_agreement";
|
|
142
|
+
};
|
|
143
|
+
} | {
|
|
144
|
+
type: "notify_human";
|
|
145
|
+
params: {
|
|
146
|
+
reason?: string | undefined;
|
|
147
|
+
};
|
|
148
|
+
} | {
|
|
149
|
+
type: "run_script";
|
|
150
|
+
params: {
|
|
151
|
+
script: string;
|
|
152
|
+
timeout?: number | undefined;
|
|
153
|
+
env?: Record<string, string> | undefined;
|
|
154
|
+
storeOutput?: {
|
|
155
|
+
artifactType: string;
|
|
156
|
+
producedBy: string;
|
|
157
|
+
} | undefined;
|
|
158
|
+
};
|
|
159
|
+
} | {
|
|
160
|
+
type: "produce_manifest";
|
|
161
|
+
params: Record<string, never>;
|
|
162
|
+
}, {
|
|
163
|
+
type: "dispatch_worker" | "dispatch_parallel_workers" | "dispatch_dynamic_workers" | "run_script" | "store_artifact" | "record_journal" | "generate_agreement" | "produce_manifest" | "notify_human";
|
|
164
|
+
params: Record<string, unknown>;
|
|
165
|
+
}>>>>;
|
|
166
|
+
transitions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
167
|
+
target: z.ZodString;
|
|
168
|
+
trigger: z.ZodEnum<{
|
|
169
|
+
timeout: "timeout";
|
|
170
|
+
failure: "failure";
|
|
171
|
+
completion: "completion";
|
|
172
|
+
review_approved: "review_approved";
|
|
173
|
+
review_rejected: "review_rejected";
|
|
174
|
+
iteration_exhausted: "iteration_exhausted";
|
|
175
|
+
judge_approved: "judge_approved";
|
|
176
|
+
judge_rejected: "judge_rejected";
|
|
177
|
+
escalation: "escalation";
|
|
178
|
+
human_input: "human_input";
|
|
179
|
+
human_approved: "human_approved";
|
|
180
|
+
human_rejected: "human_rejected";
|
|
181
|
+
}>;
|
|
182
|
+
guards: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
183
|
+
type: z.ZodEnum<{
|
|
184
|
+
artifact_exists: "artifact_exists";
|
|
185
|
+
artifact_version_min: "artifact_version_min";
|
|
186
|
+
agreement_exists: "agreement_exists";
|
|
187
|
+
state_visited: "state_visited";
|
|
188
|
+
iteration_below_limit: "iteration_below_limit";
|
|
189
|
+
findings_indicate_plan_issue: "findings_indicate_plan_issue";
|
|
190
|
+
known_failure_pattern: "known_failure_pattern";
|
|
191
|
+
verification_failures_are_fixable: "verification_failures_are_fixable";
|
|
192
|
+
verification_passed: "verification_passed";
|
|
193
|
+
waiting_context_matches: "waiting_context_matches";
|
|
194
|
+
plan_structure_valid: "plan_structure_valid";
|
|
195
|
+
previous_run_pattern: "previous_run_pattern";
|
|
196
|
+
specification_feasible: "specification_feasible";
|
|
197
|
+
has_clarification_needs: "has_clarification_needs";
|
|
198
|
+
synthesis_approved: "synthesis_approved";
|
|
199
|
+
acceptance_passed: "acceptance_passed";
|
|
200
|
+
triage_indicates_plan_issue: "triage_indicates_plan_issue";
|
|
201
|
+
triage_needs_human: "triage_needs_human";
|
|
202
|
+
confidence_threshold: "confidence_threshold";
|
|
203
|
+
project_context_available: "project_context_available";
|
|
204
|
+
}>;
|
|
205
|
+
params: z.ZodCatch<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
206
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
207
|
+
type: "artifact_exists";
|
|
208
|
+
params: {
|
|
209
|
+
artifactType: "intake_requirements" | "canonical_specification" | "clarification_questions" | "clarification_answers" | "plan" | "plan_review" | "test_plan" | "implementation" | "static_review" | "security_review" | "performance_review" | "adversarial_review" | "design_review" | "docs_review" | "ux_review" | "review_report" | "remediation_plan" | "verification" | "judge_decision" | "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_summary" | "release_agreement" | "escalation_context" | "run_manifest" | "codebase_context" | "test_suite" | "acceptance_validation" | "review_findings" | "task_breakdown" | "decomposition_review" | "task_specifications" | "pr_diff_context";
|
|
210
|
+
waitForAll?: boolean | undefined;
|
|
211
|
+
};
|
|
212
|
+
} | {
|
|
213
|
+
type: "artifact_version_min";
|
|
214
|
+
params: {
|
|
215
|
+
artifactType: "intake_requirements" | "canonical_specification" | "clarification_questions" | "clarification_answers" | "plan" | "plan_review" | "test_plan" | "implementation" | "static_review" | "security_review" | "performance_review" | "adversarial_review" | "design_review" | "docs_review" | "ux_review" | "review_report" | "remediation_plan" | "verification" | "judge_decision" | "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_summary" | "release_agreement" | "escalation_context" | "run_manifest" | "codebase_context" | "test_suite" | "acceptance_validation" | "review_findings" | "task_breakdown" | "decomposition_review" | "task_specifications" | "pr_diff_context";
|
|
216
|
+
minVersion: number;
|
|
217
|
+
waitForAll?: boolean | undefined;
|
|
218
|
+
};
|
|
219
|
+
} | {
|
|
220
|
+
type: "agreement_exists";
|
|
221
|
+
params: {
|
|
222
|
+
agreementType: "planning_agreement" | "implementation_agreement" | "verification_agreement" | "release_agreement";
|
|
223
|
+
waitForAll?: boolean | undefined;
|
|
224
|
+
};
|
|
225
|
+
} | {
|
|
226
|
+
type: "state_visited";
|
|
227
|
+
params: {
|
|
228
|
+
stateId: string;
|
|
229
|
+
waitForAll?: boolean | undefined;
|
|
230
|
+
};
|
|
231
|
+
} | {
|
|
232
|
+
type: "iteration_below_limit";
|
|
233
|
+
params: {
|
|
234
|
+
contract: string;
|
|
235
|
+
waitForAll?: boolean | undefined;
|
|
236
|
+
};
|
|
237
|
+
} | {
|
|
238
|
+
type: "waiting_context_matches";
|
|
239
|
+
params: {
|
|
240
|
+
requestingState: string;
|
|
241
|
+
waitForAll?: boolean | undefined;
|
|
242
|
+
};
|
|
243
|
+
} | {
|
|
244
|
+
type: "findings_indicate_plan_issue";
|
|
245
|
+
params: {
|
|
246
|
+
waitForAll?: boolean | undefined;
|
|
247
|
+
};
|
|
248
|
+
} | {
|
|
249
|
+
type: "verification_failures_are_fixable";
|
|
250
|
+
params: {
|
|
251
|
+
waitForAll?: boolean | undefined;
|
|
252
|
+
};
|
|
253
|
+
} | {
|
|
254
|
+
type: "verification_passed";
|
|
255
|
+
params: {
|
|
256
|
+
waitForAll?: boolean | undefined;
|
|
257
|
+
};
|
|
258
|
+
} | {
|
|
259
|
+
type: "plan_structure_valid";
|
|
260
|
+
params: {
|
|
261
|
+
waitForAll?: boolean | undefined;
|
|
262
|
+
};
|
|
263
|
+
} | {
|
|
264
|
+
type: "specification_feasible";
|
|
265
|
+
params: {
|
|
266
|
+
waitForAll?: boolean | undefined;
|
|
267
|
+
};
|
|
268
|
+
} | {
|
|
269
|
+
type: "has_clarification_needs";
|
|
270
|
+
params: {
|
|
271
|
+
waitForAll?: boolean | undefined;
|
|
272
|
+
};
|
|
273
|
+
} | {
|
|
274
|
+
type: "synthesis_approved";
|
|
275
|
+
params: {
|
|
276
|
+
waitForAll?: boolean | undefined;
|
|
277
|
+
};
|
|
278
|
+
} | {
|
|
279
|
+
type: "acceptance_passed";
|
|
280
|
+
params: {
|
|
281
|
+
waitForAll?: boolean | undefined;
|
|
282
|
+
};
|
|
283
|
+
} | {
|
|
284
|
+
type: "known_failure_pattern";
|
|
285
|
+
params: {
|
|
286
|
+
patternSubstring: string;
|
|
287
|
+
waitForAll?: boolean | undefined;
|
|
288
|
+
};
|
|
289
|
+
} | {
|
|
290
|
+
type: "previous_run_pattern";
|
|
291
|
+
params: {
|
|
292
|
+
outcome: "escalated" | "completed" | "failed" | "aborted";
|
|
293
|
+
waitForAll?: boolean | undefined;
|
|
294
|
+
workflowVariant?: string | undefined;
|
|
295
|
+
minOccurrences?: number | undefined;
|
|
296
|
+
};
|
|
297
|
+
} | {
|
|
298
|
+
type: "triage_indicates_plan_issue";
|
|
299
|
+
params: {
|
|
300
|
+
waitForAll?: boolean | undefined;
|
|
301
|
+
};
|
|
302
|
+
} | {
|
|
303
|
+
type: "triage_needs_human";
|
|
304
|
+
params: {
|
|
305
|
+
waitForAll?: boolean | undefined;
|
|
306
|
+
};
|
|
307
|
+
} | {
|
|
308
|
+
type: "confidence_threshold";
|
|
309
|
+
params: {
|
|
310
|
+
minConfidence: number;
|
|
311
|
+
waitForAll?: boolean | undefined;
|
|
312
|
+
};
|
|
313
|
+
} | {
|
|
314
|
+
type: "project_context_available";
|
|
315
|
+
params: {
|
|
316
|
+
waitForAll?: boolean | undefined;
|
|
317
|
+
category?: "codebase" | "run_history" | "preferences" | undefined;
|
|
318
|
+
};
|
|
319
|
+
}, {
|
|
320
|
+
type: "artifact_exists" | "artifact_version_min" | "agreement_exists" | "state_visited" | "iteration_below_limit" | "findings_indicate_plan_issue" | "known_failure_pattern" | "verification_failures_are_fixable" | "verification_passed" | "waiting_context_matches" | "plan_structure_valid" | "previous_run_pattern" | "specification_feasible" | "has_clarification_needs" | "synthesis_approved" | "acceptance_passed" | "triage_indicates_plan_issue" | "triage_needs_human" | "confidence_threshold" | "project_context_available";
|
|
321
|
+
params: Record<string, unknown>;
|
|
322
|
+
}>>>>>;
|
|
323
|
+
governanceRequired: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
324
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
325
|
+
}, z.core.$strip>>>>;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
maxTokensPerRun: z.ZodOptional<z.ZodNumber>;
|
|
329
|
+
}, z.core.$strip>>;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
export type WorkflowFile = z.infer<typeof workflowSchema>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { ACTION_TYPES, GUARD_TYPES, STATE_TYPES, TRANSITION_TRIGGERS, workflowBudgetSchema, } from './workflow-engine';
|
|
3
|
+
/**
|
|
4
|
+
* Loose Zod schema for camelCase workflow definition files (JSON/YAML after
|
|
5
|
+
* key normalization). Stricter domain shape is {@link workflowDefinitionSchema}.
|
|
6
|
+
*/
|
|
7
|
+
const workflowFileGuardSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
type: z.enum(GUARD_TYPES),
|
|
10
|
+
params: z.record(z.string(), z.unknown()).catch({}),
|
|
11
|
+
})
|
|
12
|
+
.transform((v) => v);
|
|
13
|
+
const workflowFileActionSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
type: z.enum(ACTION_TYPES),
|
|
16
|
+
params: z.record(z.string(), z.unknown()).catch({}),
|
|
17
|
+
})
|
|
18
|
+
.transform((v) => v);
|
|
19
|
+
const workflowFileTransitionSchema = z.object({
|
|
20
|
+
target: z.string(),
|
|
21
|
+
trigger: z.enum(TRANSITION_TRIGGERS),
|
|
22
|
+
guards: z.array(workflowFileGuardSchema).optional().default([]),
|
|
23
|
+
governanceRequired: z.boolean().optional().default(false),
|
|
24
|
+
priority: z.number().optional().default(0),
|
|
25
|
+
});
|
|
26
|
+
const workflowFileStateSchema = z.object({
|
|
27
|
+
type: z.enum(STATE_TYPES),
|
|
28
|
+
label: z.string().optional(),
|
|
29
|
+
description: z.string().catch(''),
|
|
30
|
+
entryActions: z.array(workflowFileActionSchema).optional(),
|
|
31
|
+
exitActions: z.array(workflowFileActionSchema).optional(),
|
|
32
|
+
transitions: z.array(workflowFileTransitionSchema).optional().default([]),
|
|
33
|
+
});
|
|
34
|
+
export const workflowSchema = z.object({
|
|
35
|
+
name: z.string().min(1),
|
|
36
|
+
version: z.string().min(1),
|
|
37
|
+
initialState: z.string().min(1),
|
|
38
|
+
terminalStates: z.array(z.string()).min(1),
|
|
39
|
+
states: z.record(z.string(), workflowFileStateSchema),
|
|
40
|
+
budget: workflowBudgetSchema.optional(),
|
|
41
|
+
});
|