@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,214 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { artifactRefSchema } from '../artifacts/artifact-system';
|
|
3
|
+
import { escalationTriggerSchema, humanApprovalSchema, policyTokenUsageSchema } from './governance';
|
|
4
|
+
export const policyLayerSchema = z.enum([
|
|
5
|
+
'builtin',
|
|
6
|
+
'organization',
|
|
7
|
+
'project',
|
|
8
|
+
'workflow_variant',
|
|
9
|
+
'stage',
|
|
10
|
+
'role',
|
|
11
|
+
]);
|
|
12
|
+
export const policySourceSchema = z.object({
|
|
13
|
+
layer: policyLayerSchema,
|
|
14
|
+
filePath: z.string().optional(),
|
|
15
|
+
fieldPath: z.string().optional(),
|
|
16
|
+
});
|
|
17
|
+
export const policyTypeSchema = z.enum([
|
|
18
|
+
'iteration_limit',
|
|
19
|
+
'quality_gate',
|
|
20
|
+
'specification_readiness',
|
|
21
|
+
'stage_skip',
|
|
22
|
+
'retry_limit',
|
|
23
|
+
'token_budget',
|
|
24
|
+
'model_constraint',
|
|
25
|
+
'ownership',
|
|
26
|
+
'confidence_gate',
|
|
27
|
+
'custom',
|
|
28
|
+
]);
|
|
29
|
+
export const policyCompositionSchema = z.enum(['conjunctive', 'disjunctive']);
|
|
30
|
+
export const policyScopeSchema = z.object({
|
|
31
|
+
organization: z.string().optional(),
|
|
32
|
+
project: z.string().optional(),
|
|
33
|
+
workflowVariant: z.string().optional(),
|
|
34
|
+
stages: z.array(z.string()).readonly().optional(),
|
|
35
|
+
roles: z.array(z.string()).readonly().optional(),
|
|
36
|
+
});
|
|
37
|
+
export const policyIterationLimitConfigSchema = z.object({
|
|
38
|
+
maxReviewIterations: z.number(),
|
|
39
|
+
maxJudgeArbitrations: z.number(),
|
|
40
|
+
maxClarificationRounds: z.number(),
|
|
41
|
+
maxAcceptanceIterations: z.number(),
|
|
42
|
+
});
|
|
43
|
+
export const policyQualityGateConfigSchema = z.object({
|
|
44
|
+
maxHighSeverityFindings: z.number(),
|
|
45
|
+
maxMediumSeverityFindings: z.number(),
|
|
46
|
+
requireDesignReview: z.boolean().optional(),
|
|
47
|
+
requireAdversarialReview: z.boolean().optional(),
|
|
48
|
+
});
|
|
49
|
+
export const policySpecReadinessConfigSchema = z.object({
|
|
50
|
+
minCompletenessScore: z.number(),
|
|
51
|
+
});
|
|
52
|
+
export const policyStageSkipConditionSchema = z.object({
|
|
53
|
+
field: z.string(),
|
|
54
|
+
key: z.string().optional(),
|
|
55
|
+
equals: z.unknown().optional(),
|
|
56
|
+
reason: z.string().optional(),
|
|
57
|
+
});
|
|
58
|
+
export const policyStageSkipConfigSchema = z.object({
|
|
59
|
+
skipWhen: z.array(policyStageSkipConditionSchema).readonly(),
|
|
60
|
+
});
|
|
61
|
+
export const policyRetryLimitConfigSchema = z.object({
|
|
62
|
+
maxRetries: z.number(),
|
|
63
|
+
});
|
|
64
|
+
export const policyTokenBudgetConfigSchema = z.object({
|
|
65
|
+
maxTokens: z.number(),
|
|
66
|
+
});
|
|
67
|
+
export const policyModelConstraintConfigSchema = z.object({
|
|
68
|
+
allowedModels: z.array(z.string()).readonly(),
|
|
69
|
+
});
|
|
70
|
+
export const policyOwnershipConfigSchema = z.object({
|
|
71
|
+
ownershipMap: z.record(z.string(), z.array(z.string()).readonly()),
|
|
72
|
+
strict: z.boolean(),
|
|
73
|
+
});
|
|
74
|
+
export const policyConfidenceGateConfigSchema = z.object({
|
|
75
|
+
modelEscalationThreshold: z.number().min(0).max(1),
|
|
76
|
+
humanEscalationThreshold: z.number().min(0).max(1),
|
|
77
|
+
heuristicWeight: z.number().min(0).max(1),
|
|
78
|
+
heuristicSignals: z.object({
|
|
79
|
+
penalizeHedgingLanguage: z.boolean(),
|
|
80
|
+
penalizeHighRetryCount: z.boolean(),
|
|
81
|
+
penalizeUnresolvedFindings: z.boolean(),
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
export const policyCustomConfigSchema = z.record(z.string(), z.unknown());
|
|
85
|
+
const policyDefinitionCommon = {
|
|
86
|
+
id: z.string(),
|
|
87
|
+
scope: policyScopeSchema,
|
|
88
|
+
composition: policyCompositionSchema.optional(),
|
|
89
|
+
enabled: z.boolean(),
|
|
90
|
+
locked: z.boolean().optional(),
|
|
91
|
+
};
|
|
92
|
+
export const policyDefinitionSchema = z.discriminatedUnion('type', [
|
|
93
|
+
z.object({
|
|
94
|
+
...policyDefinitionCommon,
|
|
95
|
+
type: z.literal('iteration_limit'),
|
|
96
|
+
config: policyIterationLimitConfigSchema,
|
|
97
|
+
}),
|
|
98
|
+
z.object({
|
|
99
|
+
...policyDefinitionCommon,
|
|
100
|
+
type: z.literal('quality_gate'),
|
|
101
|
+
config: policyQualityGateConfigSchema,
|
|
102
|
+
}),
|
|
103
|
+
z.object({
|
|
104
|
+
...policyDefinitionCommon,
|
|
105
|
+
type: z.literal('specification_readiness'),
|
|
106
|
+
config: policySpecReadinessConfigSchema,
|
|
107
|
+
}),
|
|
108
|
+
z.object({
|
|
109
|
+
...policyDefinitionCommon,
|
|
110
|
+
type: z.literal('stage_skip'),
|
|
111
|
+
config: policyStageSkipConfigSchema,
|
|
112
|
+
}),
|
|
113
|
+
z.object({
|
|
114
|
+
...policyDefinitionCommon,
|
|
115
|
+
type: z.literal('retry_limit'),
|
|
116
|
+
config: policyRetryLimitConfigSchema,
|
|
117
|
+
}),
|
|
118
|
+
z.object({
|
|
119
|
+
...policyDefinitionCommon,
|
|
120
|
+
type: z.literal('token_budget'),
|
|
121
|
+
config: policyTokenBudgetConfigSchema,
|
|
122
|
+
}),
|
|
123
|
+
z.object({
|
|
124
|
+
...policyDefinitionCommon,
|
|
125
|
+
type: z.literal('model_constraint'),
|
|
126
|
+
config: policyModelConstraintConfigSchema,
|
|
127
|
+
}),
|
|
128
|
+
z.object({
|
|
129
|
+
...policyDefinitionCommon,
|
|
130
|
+
type: z.literal('ownership'),
|
|
131
|
+
config: policyOwnershipConfigSchema,
|
|
132
|
+
}),
|
|
133
|
+
z.object({
|
|
134
|
+
...policyDefinitionCommon,
|
|
135
|
+
type: z.literal('confidence_gate'),
|
|
136
|
+
config: policyConfidenceGateConfigSchema,
|
|
137
|
+
}),
|
|
138
|
+
z.object({
|
|
139
|
+
...policyDefinitionCommon,
|
|
140
|
+
type: z.literal('custom'),
|
|
141
|
+
config: policyCustomConfigSchema,
|
|
142
|
+
}),
|
|
143
|
+
]);
|
|
144
|
+
export const policyOutcomeSchema = z.enum(['allow', 'deny', 'escalate']);
|
|
145
|
+
export const policyResultOutcomeSchema = z.enum(['pass', 'fail', 'skip', 'warn']);
|
|
146
|
+
export const policyResultSchema = z.object({
|
|
147
|
+
policyId: z.string(),
|
|
148
|
+
policyType: policyTypeSchema,
|
|
149
|
+
outcome: policyResultOutcomeSchema,
|
|
150
|
+
reason: z.string(),
|
|
151
|
+
source: policySourceSchema,
|
|
152
|
+
detail: z.string().optional(),
|
|
153
|
+
escalationTrigger: escalationTriggerSchema.optional(),
|
|
154
|
+
});
|
|
155
|
+
export const policyFindingRefSchema = z.object({
|
|
156
|
+
id: z.string(),
|
|
157
|
+
severity: z.string(),
|
|
158
|
+
blocking: z.string(),
|
|
159
|
+
status: z.string(),
|
|
160
|
+
});
|
|
161
|
+
export const policyContextSchema = z.object({
|
|
162
|
+
runId: z.string(),
|
|
163
|
+
currentState: z.string(),
|
|
164
|
+
requestedTransition: z
|
|
165
|
+
.object({
|
|
166
|
+
from: z.string(),
|
|
167
|
+
to: z.string(),
|
|
168
|
+
})
|
|
169
|
+
.optional(),
|
|
170
|
+
artifacts: z.array(artifactRefSchema).readonly(),
|
|
171
|
+
findings: z.array(policyFindingRefSchema).readonly().optional(),
|
|
172
|
+
iterationCount: z.number().optional(),
|
|
173
|
+
role: z.string().optional(),
|
|
174
|
+
workflowVariant: z.string().optional(),
|
|
175
|
+
humanApproval: humanApprovalSchema.optional(),
|
|
176
|
+
tokenUsage: policyTokenUsageSchema.optional(),
|
|
177
|
+
metadata: z
|
|
178
|
+
.object({
|
|
179
|
+
completenessScore: z.number().optional(),
|
|
180
|
+
ambiguityCount: z.number().optional(),
|
|
181
|
+
model: z.string().optional(),
|
|
182
|
+
retryCount: z.number().optional(),
|
|
183
|
+
skipStage: z.boolean().optional(),
|
|
184
|
+
})
|
|
185
|
+
.catchall(z.unknown())
|
|
186
|
+
.optional(),
|
|
187
|
+
});
|
|
188
|
+
export const policyDecisionSchema = z.object({
|
|
189
|
+
outcome: policyOutcomeSchema,
|
|
190
|
+
results: z.array(policyResultSchema).readonly(),
|
|
191
|
+
reason: z.string(),
|
|
192
|
+
remediations: z.array(z.string()).readonly().optional(),
|
|
193
|
+
escalationTrigger: escalationTriggerSchema.optional(),
|
|
194
|
+
});
|
|
195
|
+
export const mergeLogEntrySchema = z.object({
|
|
196
|
+
policyId: z.string(),
|
|
197
|
+
field: z.string(),
|
|
198
|
+
fromLayer: policyLayerSchema,
|
|
199
|
+
toLayer: policyLayerSchema,
|
|
200
|
+
action: z.enum(['override', 'merge', 'append', 'blocked_by_lock']),
|
|
201
|
+
fromValue: z.unknown(),
|
|
202
|
+
toValue: z.unknown(),
|
|
203
|
+
});
|
|
204
|
+
export const policyTypeInfoSchema = z.object({
|
|
205
|
+
type: policyTypeSchema,
|
|
206
|
+
description: z.string(),
|
|
207
|
+
configSchema: z.record(z.string(), z.unknown()),
|
|
208
|
+
builtIn: z.boolean(),
|
|
209
|
+
});
|
|
210
|
+
export const policyValidationResultSchema = z.object({
|
|
211
|
+
valid: z.boolean(),
|
|
212
|
+
errors: z.array(z.string()).readonly(),
|
|
213
|
+
warnings: z.array(z.string()).readonly(),
|
|
214
|
+
});
|