openmerit 0.1.4 → 0.1.6-preview.0
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/CHANGELOG.md +40 -0
- package/README.md +121 -386
- package/dist/core/src/index.d.ts +101 -0
- package/dist/core/src/index.js +1649 -0
- package/dist/core/src/store.d.ts +35 -0
- package/dist/core/src/store.js +102 -0
- package/dist/pi/src/index.d.ts +32 -0
- package/dist/pi/src/index.js +794 -0
- package/dist/pi/src/scheduler.d.ts +11 -0
- package/dist/pi/src/scheduler.js +137 -0
- package/dist/pi/src/wakeup.d.ts +2 -0
- package/dist/pi/src/wakeup.js +108 -0
- package/dist/protocol/src/index.d.ts +484 -0
- package/dist/protocol/src/index.js +47 -0
- package/dist/protocol/src/schemas.d.ts +576 -0
- package/dist/protocol/src/schemas.js +280 -0
- package/dist/terminal/public/app.js +297 -0
- package/dist/terminal/public/brands/anthropic.png +0 -0
- package/dist/terminal/public/brands/baai.png +0 -0
- package/dist/terminal/public/brands/baseten.png +0 -0
- package/dist/terminal/public/brands/cerebras.png +0 -0
- package/dist/terminal/public/brands/cohere.png +0 -0
- package/dist/terminal/public/brands/deepseek.ico +0 -0
- package/dist/terminal/public/brands/google.png +0 -0
- package/dist/terminal/public/brands/groq.ico +0 -0
- package/dist/terminal/public/brands/lm-studio.png +0 -0
- package/dist/terminal/public/brands/meta.ico +0 -0
- package/dist/terminal/public/brands/mistral.png +0 -0
- package/dist/terminal/public/brands/nomic.png +0 -0
- package/dist/terminal/public/brands/ollama.png +0 -0
- package/dist/terminal/public/brands/openai.png +0 -0
- package/dist/terminal/public/brands/openrouter.png +0 -0
- package/dist/terminal/public/brands/qwen.png +0 -0
- package/dist/terminal/public/brands/vllm.ico +0 -0
- package/dist/terminal/public/brands/vllm.png +0 -0
- package/dist/terminal/public/favicon.svg +1 -0
- package/dist/terminal/public/flow.css +1 -0
- package/dist/terminal/public/flow.js +770 -0
- package/dist/terminal/public/index.html +21 -0
- package/dist/terminal/public/styles.css +779 -0
- package/dist/terminal/src/activity-merge.mjs +64 -0
- package/dist/terminal/src/browser.mjs +29 -0
- package/dist/terminal/src/cli.mjs +60 -0
- package/dist/terminal/src/collect.mjs +311 -0
- package/dist/terminal/src/discovery.mjs +93 -0
- package/dist/terminal/src/hardware.mjs +57 -0
- package/dist/terminal/src/project-activity.mjs +156 -0
- package/dist/terminal/src/sample.mjs +171 -0
- package/dist/terminal/src/server.mjs +56 -0
- package/dist/terminal/src/services.mjs +62 -0
- package/dist/terminal/src/topology.mjs +30 -0
- package/docs/adapter-guide.md +189 -0
- package/docs/architecture.md +59 -0
- package/docs/automation.md +74 -0
- package/docs/budgets.md +37 -0
- package/docs/commands.md +85 -0
- package/docs/demo-backfill.md +29 -0
- package/docs/demo-fieldkit.md +47 -0
- package/docs/demo-placement.md +30 -0
- package/docs/demo-spam.md +15 -0
- package/docs/demo-support.md +42 -0
- package/docs/demo.md +57 -0
- package/docs/first-trial.md +60 -0
- package/docs/getting-started.md +65 -0
- package/docs/index.md +40 -0
- package/docs/inference-terminal.md +439 -0
- package/docs/lifecycle.md +30 -0
- package/docs/memo.md +126 -0
- package/docs/metrics-and-evidence.md +48 -0
- package/docs/operations.md +40 -0
- package/docs/pareto-spec.md +76 -0
- package/docs/pi-extension.md +54 -0
- package/docs/roadmap.md +28 -0
- package/docs/security.md +37 -0
- package/docs/site-artwork-linocut.md +23 -0
- package/docs/site-artwork-miniature-diverse.md +28 -0
- package/docs/site-artwork-miniature.md +26 -0
- package/docs/site-demo.md +177 -0
- package/docs/site-design.md +94 -0
- package/docs/site-documentation.md +83 -0
- package/docs/site-dynamic-og.md +35 -0
- package/docs/site-faq-maintenance.md +115 -0
- package/docs/site-hero-resolution.md +60 -0
- package/docs/site-illustration-sequences.md +227 -0
- package/docs/site-inference-terminal.md +203 -0
- package/docs/site-memo.md +39 -0
- package/docs/site-og-image.md +38 -0
- package/docs/site-og-workshop.md +21 -0
- package/docs/site-section-artwork.md +56 -0
- package/docs/site-skill-review.md +57 -0
- package/docs/site-terminal-preview.md +85 -0
- package/docs/testing.md +118 -0
- package/docs/troubleshooting.md +55 -0
- package/docs/ux-reference.md +32 -0
- package/package.json +74 -42
- package/benchmark/invoice_ocr/data/invoice_01_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_01_row_2.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_02_ground_truth.json +0 -32
- package/benchmark/invoice_ocr/data/invoice_02_row_5.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_03_ground_truth.json +0 -26
- package/benchmark/invoice_ocr/data/invoice_03_row_6.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_04_ground_truth.json +0 -26
- package/benchmark/invoice_ocr/data/invoice_04_row_7.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_05_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_05_row_947.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_06_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_06_row_948.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_07_ground_truth.json +0 -20
- package/benchmark/invoice_ocr/data/invoice_07_row_949.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_08_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_08_row_1888.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_09_ground_truth.json +0 -26
- package/benchmark/invoice_ocr/data/invoice_09_row_1890.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_10_ground_truth.json +0 -20
- package/benchmark/invoice_ocr/data/invoice_10_row_1892.jpg +0 -0
- package/benchmark/invoice_ocr/data/manifest.json +0 -97
- package/dist/benchmarks.js +0 -98
- package/dist/catalog.js +0 -61
- package/dist/cli.js +0 -188
- package/dist/daemon.js +0 -407
- package/dist/diagnostics.js +0 -227
- package/dist/frontier.js +0 -56
- package/dist/harness.js +0 -1
- package/dist/integrations.js +0 -19
- package/dist/invoice-eval.js +0 -33
- package/dist/invoice-score.js +0 -124
- package/dist/judge.js +0 -43
- package/dist/llm.js +0 -207
- package/dist/pi-config.js +0 -46
- package/dist/pi-trials.js +0 -373
- package/dist/policy.js +0 -185
- package/dist/providers.js +0 -1
- package/dist/recommend.js +0 -76
- package/dist/routes.js +0 -74
- package/dist/standalone.js +0 -224
- package/dist/store.js +0 -89
- package/dist/strategist.js +0 -68
- package/dist/task-input.js +0 -54
- package/dist/traces.js +0 -127
- package/dist/trials.js +0 -140
- package/dist/types.js +0 -2
- package/examples/invoice-prompt.txt +0 -19
- package/examples/task.example.json +0 -7
- package/extension/openmerit.ts +0 -947
- package/instructions/OPENMERIT.md +0 -63
- package/instructions/openmerit.policy.json +0 -37
- package/rules.md +0 -43
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { Check, Errors } from "typebox/value";
|
|
3
|
+
export const OPENMERIT_SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
|
|
4
|
+
export const OPENMERIT_RESULT_SCHEMA_VERSION = "0.2";
|
|
5
|
+
const strictObject = (properties, options = {}) => Type.Object(properties, { additionalProperties: false, ...options });
|
|
6
|
+
const metricIds = [
|
|
7
|
+
"task_quality", "task_success", "consistency", "instruction_following",
|
|
8
|
+
"tool_use_performance", "structured_output_reliability", "hallucination_rate",
|
|
9
|
+
"reasoning_efficiency", "input_token_consumption", "output_token_consumption",
|
|
10
|
+
"total_task_cost", "cost_per_successful_task", "time_to_first_useful_output",
|
|
11
|
+
"end_to_end_task_latency", "throughput", "retry_rate", "agent_steps",
|
|
12
|
+
"recovery_ability", "context_handling", "retrieval_use_quality",
|
|
13
|
+
"long_horizon_performance", "human_intervention_rate", "preference_fit",
|
|
14
|
+
];
|
|
15
|
+
const evidenceSources = [
|
|
16
|
+
"harness_trace", "evaluation_artifact", "observability_record", "external_source", "user_feedback",
|
|
17
|
+
];
|
|
18
|
+
const stringEnum = (values) => Type.Union(values.map((value) => Type.Literal(value)));
|
|
19
|
+
const cadenceSchema = () => strictObject({
|
|
20
|
+
afterCompletedTasks: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
21
|
+
afterElapsedSeconds: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
22
|
+
});
|
|
23
|
+
export const EvidenceReferenceSchema = strictObject({
|
|
24
|
+
id: Type.String({ minLength: 1 }),
|
|
25
|
+
source: stringEnum(evidenceSources),
|
|
26
|
+
uri: Type.String({ minLength: 1 }),
|
|
27
|
+
mediaType: Type.Optional(Type.String({ minLength: 1 })),
|
|
28
|
+
digest: Type.Optional(Type.String({ minLength: 1 })),
|
|
29
|
+
});
|
|
30
|
+
export const MetricObjectiveSchema = strictObject({
|
|
31
|
+
metricId: stringEnum(metricIds),
|
|
32
|
+
required: Type.Boolean(),
|
|
33
|
+
minimumSamples: Type.Integer({ minimum: 1 }),
|
|
34
|
+
tolerance: Type.Number({ minimum: 0 }),
|
|
35
|
+
samplingPlan: strictObject({
|
|
36
|
+
strategy: stringEnum([
|
|
37
|
+
"single_run", "repeated_same_input", "representative_task_set",
|
|
38
|
+
"repeated_representative_task_set", "load_test",
|
|
39
|
+
]),
|
|
40
|
+
representativeCaseCount: Type.Integer({ minimum: 1 }),
|
|
41
|
+
repetitionsPerCase: Type.Integer({ minimum: 1 }),
|
|
42
|
+
aggregation: stringEnum(["single_value", "mean", "rate", "distribution", "percentile"]),
|
|
43
|
+
rationale: Type.String({ minLength: 1 }),
|
|
44
|
+
}),
|
|
45
|
+
constraint: Type.Optional(strictObject({
|
|
46
|
+
operator: stringEnum(["at_least", "at_most"]),
|
|
47
|
+
value: Type.Number(),
|
|
48
|
+
})),
|
|
49
|
+
});
|
|
50
|
+
export const ApplicationLlmTargetSchema = strictObject({
|
|
51
|
+
id: Type.String({ minLength: 1 }),
|
|
52
|
+
kind: Type.Literal("application_llm_call"),
|
|
53
|
+
name: Type.String({ minLength: 1 }),
|
|
54
|
+
applicationId: Type.String({ minLength: 1 }),
|
|
55
|
+
callSites: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
|
|
56
|
+
routeKey: Type.String({ minLength: 1 }),
|
|
57
|
+
confirmedAt: Type.String({ minLength: 1 }),
|
|
58
|
+
});
|
|
59
|
+
export const TaskProfileSchema = strictObject({
|
|
60
|
+
id: Type.String({ minLength: 1 }),
|
|
61
|
+
revision: Type.Integer({ minimum: 1 }),
|
|
62
|
+
name: Type.String({ minLength: 1 }),
|
|
63
|
+
goal: Type.String({ minLength: 1 }),
|
|
64
|
+
applicationTarget: ApplicationLlmTargetSchema,
|
|
65
|
+
objectives: Type.Array(MetricObjectiveSchema, { minItems: 1 }),
|
|
66
|
+
createdAt: Type.String({ minLength: 1 }),
|
|
67
|
+
confirmedAt: Type.Optional(Type.String({ minLength: 1 })),
|
|
68
|
+
});
|
|
69
|
+
export const ObservabilityCoverageSchema = strictObject({
|
|
70
|
+
targetId: Type.String({ minLength: 1 }),
|
|
71
|
+
status: stringEnum(["ready", "incomplete"]),
|
|
72
|
+
requiredMetricIds: Type.Array(stringEnum(metricIds)),
|
|
73
|
+
coveredMetricIds: Type.Array(stringEnum(metricIds)),
|
|
74
|
+
missingMetricIds: Type.Array(stringEnum(metricIds)),
|
|
75
|
+
checkedAt: Type.String({ minLength: 1 }),
|
|
76
|
+
});
|
|
77
|
+
const ConfirmedTaskProfileSchema = strictObject({
|
|
78
|
+
...TaskProfileSchema.properties,
|
|
79
|
+
confirmedAt: Type.String({ minLength: 1 }),
|
|
80
|
+
});
|
|
81
|
+
export const SupervisedGraduationPolicySchema = strictObject({
|
|
82
|
+
mode: Type.Literal("supervised_graduation"),
|
|
83
|
+
evaluationBudget: strictObject({
|
|
84
|
+
currency: Type.String({ minLength: 1 }),
|
|
85
|
+
maximumSpend: Type.Number({ minimum: 0 }),
|
|
86
|
+
maximumCandidateCount: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
87
|
+
maximumRunsPerCandidate: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
88
|
+
expiresAt: Type.Optional(Type.String({ minLength: 1 })),
|
|
89
|
+
}),
|
|
90
|
+
automaticSwapsEnabled: Type.Boolean(),
|
|
91
|
+
confirmationRequiredUntilVerifiedSwaps: Type.Integer({ minimum: 0 }),
|
|
92
|
+
requirePostSwapVerification: Type.Literal(true),
|
|
93
|
+
rollbackOnRegression: Type.Boolean(),
|
|
94
|
+
checkPolicy: strictObject({
|
|
95
|
+
baselineAssessment: cadenceSchema(),
|
|
96
|
+
frontierReassessment: strictObject({
|
|
97
|
+
afterCompletedTasks: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
98
|
+
afterElapsedSeconds: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
99
|
+
onModelCatalogChange: Type.Boolean(),
|
|
100
|
+
}),
|
|
101
|
+
regressionCheck: strictObject({
|
|
102
|
+
afterCompletedTasks: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
103
|
+
afterElapsedSeconds: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
104
|
+
thresholds: Type.Array(strictObject({
|
|
105
|
+
metricId: stringEnum(metricIds),
|
|
106
|
+
relativeChangeAtLeast: Type.Number({ exclusiveMinimum: 0 }),
|
|
107
|
+
})),
|
|
108
|
+
}),
|
|
109
|
+
postSwapVerification: cadenceSchema(),
|
|
110
|
+
cooldownSeconds: Type.Integer({ minimum: 0 }),
|
|
111
|
+
execution: strictObject({
|
|
112
|
+
mode: stringEnum(["active_session_only", "persistent"]),
|
|
113
|
+
infrastructureChangesAllowed: Type.Boolean(),
|
|
114
|
+
}),
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
117
|
+
export const MetricRecordSchema = strictObject({
|
|
118
|
+
targetId: Type.String({ minLength: 1 }),
|
|
119
|
+
metricId: stringEnum(metricIds),
|
|
120
|
+
state: stringEnum(["measured", "not_applicable", "not_configured", "insufficient_evidence"]),
|
|
121
|
+
scope: stringEnum(["single_run", "sample_window"]),
|
|
122
|
+
direction: stringEnum(["maximize", "minimize"]),
|
|
123
|
+
method: stringEnum(["observed", "derived", "evaluator", "human", "external"]),
|
|
124
|
+
aggregation: stringEnum(["single_value", "sum", "mean", "rate", "distribution", "percentile"]),
|
|
125
|
+
value: Type.Optional(Type.Number()),
|
|
126
|
+
unit: Type.String({ minLength: 1 }),
|
|
127
|
+
sampleCount: Type.Integer({ minimum: 0 }),
|
|
128
|
+
interval: Type.Optional(strictObject({
|
|
129
|
+
lower: Type.Number(),
|
|
130
|
+
upper: Type.Number(),
|
|
131
|
+
confidenceLevel: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })),
|
|
132
|
+
})),
|
|
133
|
+
window: Type.Optional(strictObject({
|
|
134
|
+
startedAt: Type.String({ minLength: 1 }),
|
|
135
|
+
endedAt: Type.String({ minLength: 1 }),
|
|
136
|
+
})),
|
|
137
|
+
evidence: Type.Array(EvidenceReferenceSchema),
|
|
138
|
+
note: Type.Optional(Type.String()),
|
|
139
|
+
});
|
|
140
|
+
export const CandidateDescriptorSchema = strictObject({
|
|
141
|
+
targetId: Type.String({ minLength: 1 }),
|
|
142
|
+
candidateId: Type.String({ minLength: 1 }),
|
|
143
|
+
modelId: Type.String({ minLength: 1 }),
|
|
144
|
+
modelVersion: Type.Optional(Type.String({ minLength: 1 })),
|
|
145
|
+
reasons: Type.Array(Type.String()),
|
|
146
|
+
});
|
|
147
|
+
export const PreliminaryModelLeadSchema = strictObject({
|
|
148
|
+
targetId: Type.String({ minLength: 1 }),
|
|
149
|
+
modelId: Type.String({ minLength: 1 }),
|
|
150
|
+
modelVersion: Type.Optional(Type.String({ minLength: 1 })),
|
|
151
|
+
estimatedPrice: strictObject({
|
|
152
|
+
currency: Type.String({ minLength: 1 }),
|
|
153
|
+
inputPerMillionTokens: Type.Number({ minimum: 0 }),
|
|
154
|
+
outputPerMillionTokens: Type.Number({ minimum: 0 }),
|
|
155
|
+
sourceUri: Type.String({ minLength: 1 }),
|
|
156
|
+
checkedAt: Type.String({ minLength: 1 }),
|
|
157
|
+
}),
|
|
158
|
+
reputation: strictObject({
|
|
159
|
+
summary: Type.String({ minLength: 1 }),
|
|
160
|
+
sourceUri: Type.String({ minLength: 1 }),
|
|
161
|
+
checkedAt: Type.String({ minLength: 1 }),
|
|
162
|
+
}),
|
|
163
|
+
});
|
|
164
|
+
export const CandidateAssessmentSchema = strictObject({
|
|
165
|
+
id: Type.String({ minLength: 1 }),
|
|
166
|
+
targetId: Type.String({ minLength: 1 }),
|
|
167
|
+
taskProfileId: Type.String({ minLength: 1 }),
|
|
168
|
+
taskProfileRevision: Type.Integer({ minimum: 1 }),
|
|
169
|
+
candidateId: Type.String({ minLength: 1 }),
|
|
170
|
+
modelId: Type.String({ minLength: 1 }),
|
|
171
|
+
modelVersion: Type.Optional(Type.String({ minLength: 1 })),
|
|
172
|
+
productRevision: Type.String({ minLength: 1 }),
|
|
173
|
+
harnessId: Type.String({ minLength: 1 }),
|
|
174
|
+
startedAt: Type.String({ minLength: 1 }),
|
|
175
|
+
completedAt: Type.String({ minLength: 1 }),
|
|
176
|
+
metrics: Type.Array(MetricRecordSchema),
|
|
177
|
+
});
|
|
178
|
+
export const FrontierSnapshotSchema = strictObject({
|
|
179
|
+
id: Type.String({ minLength: 1 }),
|
|
180
|
+
targetId: Type.String({ minLength: 1 }),
|
|
181
|
+
taskProfileId: Type.String({ minLength: 1 }),
|
|
182
|
+
taskProfileRevision: Type.Integer({ minimum: 1 }),
|
|
183
|
+
productRevision: Type.String({ minLength: 1 }),
|
|
184
|
+
createdAt: Type.String({ minLength: 1 }),
|
|
185
|
+
frontierCandidateIds: Type.Array(Type.String()),
|
|
186
|
+
dominatedCandidateIds: Type.Array(Type.String()),
|
|
187
|
+
ineligibleCandidateIds: Type.Array(Type.String()),
|
|
188
|
+
unresolvedCandidateIds: Type.Array(Type.String()),
|
|
189
|
+
comparisons: Type.Array(strictObject({
|
|
190
|
+
candidateId: Type.String({ minLength: 1 }),
|
|
191
|
+
otherCandidateId: Type.String({ minLength: 1 }),
|
|
192
|
+
state: stringEnum(["dominates", "does_not_dominate", "unresolved"]),
|
|
193
|
+
reasons: Type.Array(Type.String()),
|
|
194
|
+
})),
|
|
195
|
+
assessmentIds: Type.Array(Type.String()),
|
|
196
|
+
calculationEvidence: Type.Array(EvidenceReferenceSchema, { minItems: 1 }),
|
|
197
|
+
});
|
|
198
|
+
export const FrontierRecommendationSchema = strictObject({
|
|
199
|
+
targetId: Type.String({ minLength: 1 }),
|
|
200
|
+
frontierSnapshotId: Type.String({ minLength: 1 }),
|
|
201
|
+
selectedCandidateId: Type.String({ minLength: 1 }),
|
|
202
|
+
currentCandidateId: Type.String({ minLength: 1 }),
|
|
203
|
+
reasons: Type.Array(Type.String()),
|
|
204
|
+
preferenceEvidence: Type.Array(EvidenceReferenceSchema),
|
|
205
|
+
});
|
|
206
|
+
export const INTENT_OUTPUT_SCHEMAS = {
|
|
207
|
+
establish_evals: strictObject({
|
|
208
|
+
taskProfile: ConfirmedTaskProfileSchema,
|
|
209
|
+
incumbent: CandidateDescriptorSchema,
|
|
210
|
+
policy: SupervisedGraduationPolicySchema,
|
|
211
|
+
observability: ObservabilityCoverageSchema,
|
|
212
|
+
preliminaryModelLeads: Type.Optional(Type.Array(PreliminaryModelLeadSchema)),
|
|
213
|
+
}),
|
|
214
|
+
instrument_observability: strictObject({
|
|
215
|
+
targetId: Type.String({ minLength: 1 }),
|
|
216
|
+
coveredMetricIds: Type.Array(stringEnum(metricIds)),
|
|
217
|
+
missingMetricIds: Type.Array(stringEnum(metricIds)),
|
|
218
|
+
}),
|
|
219
|
+
run_assessment: strictObject({
|
|
220
|
+
targetId: Type.String({ minLength: 1 }),
|
|
221
|
+
baselineEvidenceSufficient: Type.Boolean(),
|
|
222
|
+
metrics: Type.Array(MetricRecordSchema),
|
|
223
|
+
}),
|
|
224
|
+
discover_candidates: strictObject({
|
|
225
|
+
targetId: Type.String({ minLength: 1 }),
|
|
226
|
+
candidates: Type.Array(CandidateDescriptorSchema),
|
|
227
|
+
}),
|
|
228
|
+
run_challenger_trials: strictObject({
|
|
229
|
+
targetId: Type.String({ minLength: 1 }),
|
|
230
|
+
assessments: Type.Array(CandidateAssessmentSchema),
|
|
231
|
+
experimentManifest: EvidenceReferenceSchema,
|
|
232
|
+
}),
|
|
233
|
+
calculate_frontier: strictObject({
|
|
234
|
+
targetId: Type.String({ minLength: 1 }),
|
|
235
|
+
assessments: Type.Array(CandidateAssessmentSchema),
|
|
236
|
+
frontierSnapshot: FrontierSnapshotSchema,
|
|
237
|
+
recommendation: Type.Optional(FrontierRecommendationSchema),
|
|
238
|
+
}),
|
|
239
|
+
investigate_regression: strictObject({
|
|
240
|
+
targetId: Type.String({ minLength: 1 }),
|
|
241
|
+
regressionDetected: Type.Boolean(),
|
|
242
|
+
affectedMetricIds: Type.Array(stringEnum(metricIds)),
|
|
243
|
+
likelyCause: Type.Optional(Type.String()),
|
|
244
|
+
}),
|
|
245
|
+
apply_model_swap: strictObject({
|
|
246
|
+
targetId: Type.String({ minLength: 1 }),
|
|
247
|
+
appliedCandidateId: Type.String({ minLength: 1 }),
|
|
248
|
+
previousCandidateId: Type.Optional(Type.String({ minLength: 1 })),
|
|
249
|
+
}),
|
|
250
|
+
verify_model_swap: strictObject({
|
|
251
|
+
targetId: Type.String({ minLength: 1 }),
|
|
252
|
+
verified: Type.Boolean(),
|
|
253
|
+
regressionDetected: Type.Boolean(),
|
|
254
|
+
}),
|
|
255
|
+
rollback_model_swap: strictObject({
|
|
256
|
+
targetId: Type.String({ minLength: 1 }),
|
|
257
|
+
restoredCandidateId: Type.String({ minLength: 1 }),
|
|
258
|
+
}),
|
|
259
|
+
};
|
|
260
|
+
export function intentOutputSchemaFor(kind) {
|
|
261
|
+
return INTENT_OUTPUT_SCHEMAS[kind];
|
|
262
|
+
}
|
|
263
|
+
export function validateIntentOutputSchema(kind, output) {
|
|
264
|
+
const schema = intentOutputSchemaFor(kind);
|
|
265
|
+
if (Check(schema, output))
|
|
266
|
+
return [];
|
|
267
|
+
return [...Errors(schema, output)].map((error) => `${error.instancePath || "/"} ${error.message}`);
|
|
268
|
+
}
|
|
269
|
+
export function completionToolSchemaFor(kind) {
|
|
270
|
+
return strictObject({
|
|
271
|
+
intentId: Type.String({ minLength: 1 }),
|
|
272
|
+
status: stringEnum(["succeeded", "failed", "cancelled"]),
|
|
273
|
+
summary: Type.String({ minLength: 1 }),
|
|
274
|
+
evidence: Type.Array(EvidenceReferenceSchema),
|
|
275
|
+
outputs: Type.Optional(intentOutputSchemaFor(kind)),
|
|
276
|
+
errorCode: Type.Optional(Type.String({ minLength: 1 })),
|
|
277
|
+
errorMessage: Type.Optional(Type.String({ minLength: 1 })),
|
|
278
|
+
retryable: Type.Optional(Type.Boolean()),
|
|
279
|
+
});
|
|
280
|
+
}
|