@proofhound/db 0.1.7 → 0.1.9
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/dist/fixtures/dev/releases.d.ts +154 -0
- package/dist/fixtures/dev/releases.d.ts.map +1 -0
- package/dist/fixtures/dev/releases.js +1041 -0
- package/dist/fixtures/dev/releases.js.map +1 -0
- package/dist/migrations/0006_run_results_partitioning.sql +167 -0
- package/dist/migrations/0007_run_result_id_registry.sql +8 -0
- package/dist/migrations/0008_white_rachel_grey.sql +7 -0
- package/dist/migrations/0009_flat_wilson_fisk.sql +5 -0
- package/dist/migrations/0010_overjoyed_namora.sql +71 -0
- package/dist/migrations/0011_release_version_candidate_number.sql +1 -0
- package/dist/migrations/0012_prompt_label_canary.sql +5 -0
- package/dist/migrations/0013_annotation_all_scope.sql +6 -0
- package/dist/migrations/0014_release_record_categories.sql +20 -0
- package/dist/migrations/0015_release_line_running_status.sql +8 -0
- package/dist/migrations/0016_release_line_unarchive_operation.sql +17 -0
- package/dist/migrations/0017_release_line_history_restore_operations.sql +19 -0
- package/dist/schema/ph_assets/index.d.ts +68 -0
- package/dist/schema/ph_assets/index.d.ts.map +1 -1
- package/dist/schema/ph_assets/index.js +6 -0
- package/dist/schema/ph_assets/index.js.map +1 -1
- package/dist/schema/ph_releases/annotation-tasks.d.ts +19 -2
- package/dist/schema/ph_releases/annotation-tasks.d.ts.map +1 -1
- package/dist/schema/ph_releases/annotation-tasks.js +10 -7
- package/dist/schema/ph_releases/annotation-tasks.js.map +1 -1
- package/dist/schema/ph_releases/canary-releases.d.ts +43 -0
- package/dist/schema/ph_releases/canary-releases.d.ts.map +1 -1
- package/dist/schema/ph_releases/canary-releases.js +5 -1
- package/dist/schema/ph_releases/canary-releases.js.map +1 -1
- package/dist/schema/ph_releases/production-release-events.d.ts +43 -0
- package/dist/schema/ph_releases/production-release-events.d.ts.map +1 -1
- package/dist/schema/ph_releases/production-release-events.js +5 -2
- package/dist/schema/ph_releases/production-release-events.js.map +1 -1
- package/dist/schema/ph_releases/release-lines.d.ts +132 -21
- package/dist/schema/ph_releases/release-lines.d.ts.map +1 -1
- package/dist/schema/ph_releases/release-lines.js +43 -14
- package/dist/schema/ph_releases/release-lines.js.map +1 -1
- package/dist/schema/ph_runs/index.d.ts +43 -2
- package/dist/schema/ph_runs/index.d.ts.map +1 -1
- package/dist/schema/ph_runs/index.js +18 -10
- package/dist/schema/ph_runs/index.js.map +1 -1
- package/dist/seed-dev.js +281 -0
- package/dist/seed-dev.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEV_RELEASE_ANNOTATIONS = exports.DEV_RELEASE_ANNOTATION_TASKS = exports.DEV_RELEASE_RUN_RESULTS = exports.DEV_RELEASE_EVENTS = exports.DEV_RELEASE_VERSIONS = exports.DEV_RELEASE_LINES = void 0;
|
|
4
|
+
const connectors_1 = require("./connectors");
|
|
5
|
+
const experiments_1 = require("./experiments");
|
|
6
|
+
const models_1 = require("./models");
|
|
7
|
+
const prompts_1 = require("./prompts");
|
|
8
|
+
const LOCAL_ACTOR_ID = '00000000-0000-4000-8000-000000000001';
|
|
9
|
+
function fixtureId(sequence) {
|
|
10
|
+
return `bbbbbbbb-bbbb-4bbb-8bbb-${String(sequence).padStart(12, '0')}`;
|
|
11
|
+
}
|
|
12
|
+
const RELEASE_LINE_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000001';
|
|
13
|
+
const VERSION_CANDIDATE_01_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000011';
|
|
14
|
+
const VERSION_CANDIDATE_02_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000012';
|
|
15
|
+
const VERSION_PRODUCTION_1_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000013';
|
|
16
|
+
const VERSION_CANDIDATE_11_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000014';
|
|
17
|
+
const EVENT_CANDIDATE_01_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000021';
|
|
18
|
+
const EVENT_CANDIDATE_02_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000022';
|
|
19
|
+
const EVENT_PRODUCTION_1_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000023';
|
|
20
|
+
const EVENT_CANDIDATE_11_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000024';
|
|
21
|
+
const EVENT_PRODUCTION_1_CONFIG_ID = fixtureId(25);
|
|
22
|
+
const ANNOTATION_TASK_ID = 'bbbbbbbb-bbbb-4bbb-8bbb-000000000041';
|
|
23
|
+
const GENERATED_PRODUCTION_NUMBERS = [3, 4, 5, 6, 7, 8, 9, 10];
|
|
24
|
+
const ACTIVE_CANDIDATE_TARGET_PRODUCTION_NUMBER = 11;
|
|
25
|
+
function requireFixture(value, label) {
|
|
26
|
+
if (!value)
|
|
27
|
+
throw new Error(`Missing dev release fixture dependency: ${label}`);
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
const prompt = requireFixture(prompts_1.DEV_PROMPTS.find((item) => item.id === '246bc6d3-8ac9-43d5-a055-f9098884e227'), 'emotion category prompt');
|
|
31
|
+
const promptV2 = requireFixture(prompt.versions.find((version) => version.id === 'c77ce1bc-160c-5a51-84ed-0334233803fd'), 'emotion category prompt v2');
|
|
32
|
+
const promptV3 = requireFixture(prompt.versions.find((version) => version.id === '8eab5ca8-08f2-5bdc-b69e-bedf4c6f188e'), 'emotion category prompt v3');
|
|
33
|
+
const ernie5 = requireFixture(models_1.DEV_MODELS.find((model) => model.id === '826d092f-0afa-4e01-b223-d608d1db519d'), 'ERNIE 5.0 model');
|
|
34
|
+
const sonnet = requireFixture(models_1.DEV_MODELS.find((model) => model.id === '45be9255-88d5-4e32-b650-ba624f33c8f0'), 'Claude Sonnet model');
|
|
35
|
+
const inputConnector = requireFixture(connectors_1.DEV_CONNECTORS.find((connector) => connector.id === 'aaaaaaaa-aaaa-4aaa-8aaa-000000000005'), 'sync webhook input connector');
|
|
36
|
+
const outputConnectors = [
|
|
37
|
+
requireFixture(connectors_1.DEV_CONNECTORS.find((connector) => connector.id === 'aaaaaaaa-aaaa-4aaa-8aaa-000000000002'), 'Redis output connector'),
|
|
38
|
+
requireFixture(connectors_1.DEV_CONNECTORS.find((connector) => connector.id === 'aaaaaaaa-aaaa-4aaa-8aaa-000000000004'), 'Kafka output connector'),
|
|
39
|
+
];
|
|
40
|
+
const yelpDataset = requireFixture(experiments_1.DEV_EXPERIMENT_DATASETS.find((dataset) => dataset.id === 'db945aa9-fe6e-4591-9b99-42f0b4dd567e'), 'Yelp polarity dataset');
|
|
41
|
+
const promptSnapshot = {
|
|
42
|
+
id: prompt.id,
|
|
43
|
+
name: prompt.name,
|
|
44
|
+
defaultDatasetId: prompt.defaultDatasetId,
|
|
45
|
+
};
|
|
46
|
+
function promptVersionSnapshot(version) {
|
|
47
|
+
return {
|
|
48
|
+
id: version.id,
|
|
49
|
+
promptId: prompt.id,
|
|
50
|
+
versionNumber: version.versionNumber,
|
|
51
|
+
body: version.body,
|
|
52
|
+
variables: version.variables,
|
|
53
|
+
outputSchema: version.outputSchema,
|
|
54
|
+
judgmentRules: version.judgmentRules,
|
|
55
|
+
promptLanguage: version.promptLanguage,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function modelSnapshot(model) {
|
|
59
|
+
return {
|
|
60
|
+
id: model.id,
|
|
61
|
+
name: model.name,
|
|
62
|
+
providerType: model.providerType,
|
|
63
|
+
providerModelId: model.providerModelId,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function connectorType(connector) {
|
|
67
|
+
if (connector.kind.startsWith('redis-'))
|
|
68
|
+
return 'redis';
|
|
69
|
+
if (connector.kind.startsWith('kafka-'))
|
|
70
|
+
return 'kafka';
|
|
71
|
+
return 'webhook';
|
|
72
|
+
}
|
|
73
|
+
function connectorSnapshot(connector) {
|
|
74
|
+
return {
|
|
75
|
+
id: connector.id,
|
|
76
|
+
name: connector.name,
|
|
77
|
+
type: connectorType(connector),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const inputConnectorSnapshot = connectorSnapshot(inputConnector);
|
|
81
|
+
const outputConnectorIds = outputConnectors.map((connector) => connector.id);
|
|
82
|
+
const outputConnectorSnapshots = outputConnectors.map(connectorSnapshot);
|
|
83
|
+
const defaultRunConfig = {
|
|
84
|
+
retries: 2,
|
|
85
|
+
rpmLimit: 30,
|
|
86
|
+
tpmLimit: 150000,
|
|
87
|
+
concurrency: 12,
|
|
88
|
+
temperature: 0,
|
|
89
|
+
sampleTimeoutSeconds: 20,
|
|
90
|
+
};
|
|
91
|
+
const variableMapping = { id: 'sample_id', text: 'text' };
|
|
92
|
+
const outputMapping = [{ from: 'expected_output', to: 'decision' }];
|
|
93
|
+
function qualityScore(value) {
|
|
94
|
+
return Number(Math.max(0, Math.min(0.995, value)).toFixed(3));
|
|
95
|
+
}
|
|
96
|
+
function qualityF1(recall, precision) {
|
|
97
|
+
if (recall <= 0 || precision <= 0)
|
|
98
|
+
return 0;
|
|
99
|
+
return qualityScore((2 * recall * precision) / (recall + precision));
|
|
100
|
+
}
|
|
101
|
+
function qualityMetricSet(input) {
|
|
102
|
+
const recall = qualityScore(input.recall);
|
|
103
|
+
const precision = qualityScore(input.precision);
|
|
104
|
+
return {
|
|
105
|
+
recall,
|
|
106
|
+
precision,
|
|
107
|
+
f1: qualityF1(recall, precision),
|
|
108
|
+
accuracy: qualityScore(input.accuracy),
|
|
109
|
+
sampleCount: Math.max(0, Math.round(input.sampleCount)),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function releaseQuality(base, sampleCount) {
|
|
113
|
+
const positiveSampleCount = Math.round(sampleCount * 0.58);
|
|
114
|
+
const negativeSampleCount = Math.max(0, sampleCount - positiveSampleCount);
|
|
115
|
+
return {
|
|
116
|
+
overall: qualityMetricSet({
|
|
117
|
+
recall: base - 0.012,
|
|
118
|
+
precision: base + 0.008,
|
|
119
|
+
accuracy: base + 0.004,
|
|
120
|
+
sampleCount,
|
|
121
|
+
}),
|
|
122
|
+
scopes: [
|
|
123
|
+
{
|
|
124
|
+
key: 'positive',
|
|
125
|
+
label: 'positive',
|
|
126
|
+
metrics: qualityMetricSet({
|
|
127
|
+
recall: base + 0.026,
|
|
128
|
+
precision: base - 0.006,
|
|
129
|
+
accuracy: base + 0.018,
|
|
130
|
+
sampleCount: positiveSampleCount,
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: 'negative',
|
|
135
|
+
label: 'negative',
|
|
136
|
+
metrics: qualityMetricSet({
|
|
137
|
+
recall: base - 0.046,
|
|
138
|
+
precision: base + 0.026,
|
|
139
|
+
accuracy: base - 0.014,
|
|
140
|
+
sampleCount: negativeSampleCount,
|
|
141
|
+
}),
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function releaseTime(minutesAfterEight) {
|
|
147
|
+
return new Date(Date.UTC(2026, 4, 23, 8, minutesAfterEight, 0, 0)).toISOString();
|
|
148
|
+
}
|
|
149
|
+
function generatedCandidateVersionId(targetProductionNumber) {
|
|
150
|
+
return fixtureId(300 + targetProductionNumber);
|
|
151
|
+
}
|
|
152
|
+
function generatedProductionVersionId(productionNumber) {
|
|
153
|
+
return fixtureId(400 + productionNumber);
|
|
154
|
+
}
|
|
155
|
+
function generatedCandidateEventId(targetProductionNumber) {
|
|
156
|
+
return fixtureId(600 + targetProductionNumber * 10 + 1);
|
|
157
|
+
}
|
|
158
|
+
function generatedProductionEventId(productionNumber) {
|
|
159
|
+
return fixtureId(600 + productionNumber * 10 + 2);
|
|
160
|
+
}
|
|
161
|
+
function generatedConfigEventId(productionNumber) {
|
|
162
|
+
return fixtureId(600 + productionNumber * 10 + 3);
|
|
163
|
+
}
|
|
164
|
+
function tunedProductionRunConfig(productionNumber) {
|
|
165
|
+
return {
|
|
166
|
+
...defaultRunConfig,
|
|
167
|
+
rpmLimit: 30 + productionNumber * 4,
|
|
168
|
+
tpmLimit: 150000 + productionNumber * 6000,
|
|
169
|
+
concurrency: 10 + (productionNumber % 5),
|
|
170
|
+
temperature: Number((0.04 + (productionNumber % 4) * 0.03).toFixed(2)),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function candidateRunConfig(targetProductionNumber) {
|
|
174
|
+
return {
|
|
175
|
+
...defaultRunConfig,
|
|
176
|
+
rpmLimit: 18 + targetProductionNumber * 3,
|
|
177
|
+
tpmLimit: 90000 + targetProductionNumber * 5000,
|
|
178
|
+
concurrency: 6 + (targetProductionNumber % 4),
|
|
179
|
+
temperature: Number((0.12 + (targetProductionNumber % 3) * 0.04).toFixed(2)),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function releaseVersionFixture(input) {
|
|
183
|
+
return {
|
|
184
|
+
id: input.id,
|
|
185
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
186
|
+
kind: input.kind,
|
|
187
|
+
productionVersionNumber: input.productionVersionNumber,
|
|
188
|
+
targetProductionVersionNumber: input.targetProductionVersionNumber,
|
|
189
|
+
candidateNumber: input.candidateNumber,
|
|
190
|
+
promotedFromReleaseVersionId: input.promotedFromReleaseVersionId,
|
|
191
|
+
promptId: prompt.id,
|
|
192
|
+
promptName: prompt.name,
|
|
193
|
+
promptVersionId: input.promptVersion.id,
|
|
194
|
+
promptVersionNumber: input.promptVersion.versionNumber,
|
|
195
|
+
promptSnapshot,
|
|
196
|
+
promptVersionSnapshot: promptVersionSnapshot(input.promptVersion),
|
|
197
|
+
modelId: input.model.id,
|
|
198
|
+
modelSnapshot: modelSnapshot(input.model),
|
|
199
|
+
createdAt: input.createdAt,
|
|
200
|
+
updatedAt: input.updatedAt,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const production2Plan = {
|
|
204
|
+
productionNumber: 2,
|
|
205
|
+
candidateVersionId: VERSION_CANDIDATE_11_ID,
|
|
206
|
+
productionVersionId: generatedProductionVersionId(2),
|
|
207
|
+
candidateEventId: EVENT_CANDIDATE_11_ID,
|
|
208
|
+
productionEventId: generatedProductionEventId(2),
|
|
209
|
+
configEventId: generatedConfigEventId(2),
|
|
210
|
+
previousProductionEventId: EVENT_PRODUCTION_1_CONFIG_ID,
|
|
211
|
+
promptVersion: promptV3,
|
|
212
|
+
model: sonnet,
|
|
213
|
+
candidateCreatedAt: '2026-05-23T08:30:00.000Z',
|
|
214
|
+
candidateUpdatedAt: '2026-05-23T08:44:00.000Z',
|
|
215
|
+
productionCreatedAt: '2026-05-23T08:50:00.000Z',
|
|
216
|
+
productionUpdatedAt: '2026-05-23T08:50:00.000Z',
|
|
217
|
+
configCreatedAt: '2026-05-23T08:56:00.000Z',
|
|
218
|
+
configUpdatedAt: '2026-05-23T09:04:00.000Z',
|
|
219
|
+
};
|
|
220
|
+
const generatedProductionPlans = [
|
|
221
|
+
production2Plan,
|
|
222
|
+
...GENERATED_PRODUCTION_NUMBERS.map((productionNumber, index) => {
|
|
223
|
+
const baseMinute = 70 + index * 18;
|
|
224
|
+
const promptVersion = productionNumber % 2 === 0 ? promptV3 : promptV2;
|
|
225
|
+
const model = productionNumber % 3 === 0 ? sonnet : ernie5;
|
|
226
|
+
return {
|
|
227
|
+
productionNumber,
|
|
228
|
+
candidateVersionId: generatedCandidateVersionId(productionNumber),
|
|
229
|
+
productionVersionId: generatedProductionVersionId(productionNumber),
|
|
230
|
+
candidateEventId: generatedCandidateEventId(productionNumber),
|
|
231
|
+
productionEventId: generatedProductionEventId(productionNumber),
|
|
232
|
+
configEventId: generatedConfigEventId(productionNumber),
|
|
233
|
+
previousProductionEventId: generatedConfigEventId(productionNumber - 1),
|
|
234
|
+
promptVersion,
|
|
235
|
+
model,
|
|
236
|
+
candidateCreatedAt: releaseTime(baseMinute),
|
|
237
|
+
candidateUpdatedAt: releaseTime(baseMinute + 8),
|
|
238
|
+
productionCreatedAt: releaseTime(baseMinute + 12),
|
|
239
|
+
productionUpdatedAt: releaseTime(baseMinute + 12),
|
|
240
|
+
configCreatedAt: releaseTime(baseMinute + 15),
|
|
241
|
+
configUpdatedAt: releaseTime(baseMinute + 17),
|
|
242
|
+
};
|
|
243
|
+
}),
|
|
244
|
+
];
|
|
245
|
+
const activeCandidatePlan = {
|
|
246
|
+
targetProductionNumber: ACTIVE_CANDIDATE_TARGET_PRODUCTION_NUMBER,
|
|
247
|
+
candidateVersionId: generatedCandidateVersionId(ACTIVE_CANDIDATE_TARGET_PRODUCTION_NUMBER),
|
|
248
|
+
candidateEventId: generatedCandidateEventId(ACTIVE_CANDIDATE_TARGET_PRODUCTION_NUMBER),
|
|
249
|
+
configEventId: generatedConfigEventId(ACTIVE_CANDIDATE_TARGET_PRODUCTION_NUMBER),
|
|
250
|
+
previousProductionEventId: generatedConfigEventId(10),
|
|
251
|
+
promptVersion: promptV3,
|
|
252
|
+
model: sonnet,
|
|
253
|
+
candidateCreatedAt: releaseTime(220),
|
|
254
|
+
candidateUpdatedAt: releaseTime(228),
|
|
255
|
+
configCreatedAt: releaseTime(234),
|
|
256
|
+
configUpdatedAt: releaseTime(238),
|
|
257
|
+
};
|
|
258
|
+
exports.DEV_RELEASE_LINES = [
|
|
259
|
+
{
|
|
260
|
+
id: RELEASE_LINE_ID,
|
|
261
|
+
name: 'sentiment-classifier-live',
|
|
262
|
+
description: 'Dev release line showing enough production versions, canaries, and config changes to exercise history loading.',
|
|
263
|
+
promptId: prompt.id,
|
|
264
|
+
promptName: prompt.name,
|
|
265
|
+
promptSnapshot,
|
|
266
|
+
inputConnectorId: inputConnector.id,
|
|
267
|
+
inputConnectorName: inputConnector.name,
|
|
268
|
+
inputConnectorType: connectorType(inputConnector),
|
|
269
|
+
inputConnectorSnapshot,
|
|
270
|
+
status: 'running',
|
|
271
|
+
currentProductionEventId: generatedConfigEventId(10),
|
|
272
|
+
activeCanaryEventId: activeCandidatePlan.configEventId,
|
|
273
|
+
createdAt: '2026-05-23T07:20:00.000Z',
|
|
274
|
+
updatedAt: activeCandidatePlan.configUpdatedAt,
|
|
275
|
+
},
|
|
276
|
+
];
|
|
277
|
+
exports.DEV_RELEASE_VERSIONS = [
|
|
278
|
+
{
|
|
279
|
+
id: VERSION_CANDIDATE_01_ID,
|
|
280
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
281
|
+
kind: 'candidate',
|
|
282
|
+
productionVersionNumber: null,
|
|
283
|
+
targetProductionVersionNumber: 1,
|
|
284
|
+
candidateNumber: 1,
|
|
285
|
+
promotedFromReleaseVersionId: null,
|
|
286
|
+
promptId: prompt.id,
|
|
287
|
+
promptName: prompt.name,
|
|
288
|
+
promptVersionId: promptV2.id,
|
|
289
|
+
promptVersionNumber: promptV2.versionNumber,
|
|
290
|
+
promptSnapshot,
|
|
291
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV2),
|
|
292
|
+
modelId: ernie5.id,
|
|
293
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
294
|
+
createdAt: '2026-05-23T07:20:00.000Z',
|
|
295
|
+
updatedAt: '2026-05-23T07:28:00.000Z',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: VERSION_CANDIDATE_02_ID,
|
|
299
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
300
|
+
kind: 'candidate',
|
|
301
|
+
productionVersionNumber: null,
|
|
302
|
+
targetProductionVersionNumber: 1,
|
|
303
|
+
candidateNumber: 2,
|
|
304
|
+
promotedFromReleaseVersionId: null,
|
|
305
|
+
promptId: prompt.id,
|
|
306
|
+
promptName: prompt.name,
|
|
307
|
+
promptVersionId: promptV3.id,
|
|
308
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
309
|
+
promptSnapshot,
|
|
310
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
311
|
+
modelId: ernie5.id,
|
|
312
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
313
|
+
createdAt: '2026-05-23T07:35:00.000Z',
|
|
314
|
+
updatedAt: '2026-05-23T07:48:00.000Z',
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: VERSION_PRODUCTION_1_ID,
|
|
318
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
319
|
+
kind: 'production',
|
|
320
|
+
productionVersionNumber: 1,
|
|
321
|
+
targetProductionVersionNumber: 1,
|
|
322
|
+
candidateNumber: null,
|
|
323
|
+
promotedFromReleaseVersionId: VERSION_CANDIDATE_02_ID,
|
|
324
|
+
promptId: prompt.id,
|
|
325
|
+
promptName: prompt.name,
|
|
326
|
+
promptVersionId: promptV3.id,
|
|
327
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
328
|
+
promptSnapshot,
|
|
329
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
330
|
+
modelId: ernie5.id,
|
|
331
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
332
|
+
createdAt: '2026-05-23T08:00:00.000Z',
|
|
333
|
+
updatedAt: '2026-05-23T08:00:00.000Z',
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
id: VERSION_CANDIDATE_11_ID,
|
|
337
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
338
|
+
kind: 'candidate',
|
|
339
|
+
productionVersionNumber: null,
|
|
340
|
+
targetProductionVersionNumber: 2,
|
|
341
|
+
candidateNumber: 1,
|
|
342
|
+
promotedFromReleaseVersionId: null,
|
|
343
|
+
promptId: prompt.id,
|
|
344
|
+
promptName: prompt.name,
|
|
345
|
+
promptVersionId: promptV3.id,
|
|
346
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
347
|
+
promptSnapshot,
|
|
348
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
349
|
+
modelId: sonnet.id,
|
|
350
|
+
modelSnapshot: modelSnapshot(sonnet),
|
|
351
|
+
createdAt: '2026-05-23T08:30:00.000Z',
|
|
352
|
+
updatedAt: production2Plan.candidateUpdatedAt,
|
|
353
|
+
},
|
|
354
|
+
releaseVersionFixture({
|
|
355
|
+
id: production2Plan.productionVersionId,
|
|
356
|
+
kind: 'production',
|
|
357
|
+
productionVersionNumber: 2,
|
|
358
|
+
targetProductionVersionNumber: 2,
|
|
359
|
+
candidateNumber: null,
|
|
360
|
+
promotedFromReleaseVersionId: VERSION_CANDIDATE_11_ID,
|
|
361
|
+
promptVersion: promptV3,
|
|
362
|
+
model: sonnet,
|
|
363
|
+
createdAt: production2Plan.productionCreatedAt,
|
|
364
|
+
updatedAt: production2Plan.configUpdatedAt,
|
|
365
|
+
}),
|
|
366
|
+
...generatedProductionPlans.slice(1).flatMap((plan) => [
|
|
367
|
+
releaseVersionFixture({
|
|
368
|
+
id: plan.candidateVersionId,
|
|
369
|
+
kind: 'candidate',
|
|
370
|
+
productionVersionNumber: null,
|
|
371
|
+
targetProductionVersionNumber: plan.productionNumber,
|
|
372
|
+
candidateNumber: 1,
|
|
373
|
+
promotedFromReleaseVersionId: null,
|
|
374
|
+
promptVersion: plan.promptVersion,
|
|
375
|
+
model: plan.model,
|
|
376
|
+
createdAt: plan.candidateCreatedAt,
|
|
377
|
+
updatedAt: plan.candidateUpdatedAt,
|
|
378
|
+
}),
|
|
379
|
+
releaseVersionFixture({
|
|
380
|
+
id: plan.productionVersionId,
|
|
381
|
+
kind: 'production',
|
|
382
|
+
productionVersionNumber: plan.productionNumber,
|
|
383
|
+
targetProductionVersionNumber: plan.productionNumber,
|
|
384
|
+
candidateNumber: null,
|
|
385
|
+
promotedFromReleaseVersionId: plan.candidateVersionId,
|
|
386
|
+
promptVersion: plan.promptVersion,
|
|
387
|
+
model: plan.model,
|
|
388
|
+
createdAt: plan.productionCreatedAt,
|
|
389
|
+
updatedAt: plan.configUpdatedAt,
|
|
390
|
+
}),
|
|
391
|
+
]),
|
|
392
|
+
releaseVersionFixture({
|
|
393
|
+
id: activeCandidatePlan.candidateVersionId,
|
|
394
|
+
kind: 'candidate',
|
|
395
|
+
productionVersionNumber: null,
|
|
396
|
+
targetProductionVersionNumber: activeCandidatePlan.targetProductionNumber,
|
|
397
|
+
candidateNumber: 1,
|
|
398
|
+
promotedFromReleaseVersionId: null,
|
|
399
|
+
promptVersion: activeCandidatePlan.promptVersion,
|
|
400
|
+
model: activeCandidatePlan.model,
|
|
401
|
+
createdAt: activeCandidatePlan.candidateCreatedAt,
|
|
402
|
+
updatedAt: activeCandidatePlan.configUpdatedAt,
|
|
403
|
+
}),
|
|
404
|
+
];
|
|
405
|
+
function releaseEvent(input) {
|
|
406
|
+
return {
|
|
407
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
408
|
+
promptId: prompt.id,
|
|
409
|
+
promptName: prompt.name,
|
|
410
|
+
promptSnapshot,
|
|
411
|
+
inputConnectorId: inputConnector.id,
|
|
412
|
+
inputConnectorSnapshot,
|
|
413
|
+
outputConnectorIds,
|
|
414
|
+
outputConnectorSnapshots,
|
|
415
|
+
runConfig: defaultRunConfig,
|
|
416
|
+
variableMapping,
|
|
417
|
+
outputMapping,
|
|
418
|
+
filterRules: null,
|
|
419
|
+
recordMode: 'all',
|
|
420
|
+
recordCategories: [],
|
|
421
|
+
externalIdField: 'sample_id',
|
|
422
|
+
retentionDays: 30,
|
|
423
|
+
controlState: null,
|
|
424
|
+
controlStatePayload: null,
|
|
425
|
+
...input,
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
exports.DEV_RELEASE_EVENTS = [
|
|
429
|
+
releaseEvent({
|
|
430
|
+
id: EVENT_CANDIDATE_01_ID,
|
|
431
|
+
laneType: 'canary',
|
|
432
|
+
operation: 'create_canary',
|
|
433
|
+
status: 'completed',
|
|
434
|
+
terminalReason: 'promoted',
|
|
435
|
+
sourceEventId: null,
|
|
436
|
+
supersedesEventId: null,
|
|
437
|
+
rollbackTargetEventId: null,
|
|
438
|
+
releaseVersionId: VERSION_CANDIDATE_01_ID,
|
|
439
|
+
promptVersionId: promptV2.id,
|
|
440
|
+
promptVersionNumber: promptV2.versionNumber,
|
|
441
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV2),
|
|
442
|
+
modelId: ernie5.id,
|
|
443
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
444
|
+
trafficMode: 'split',
|
|
445
|
+
trafficRatio: '0.1000',
|
|
446
|
+
sourceExperimentId: 'ef6c9622-7fe1-455b-a4fd-85176f80bce5',
|
|
447
|
+
submitReason: 'First candidate before v1; validate live traffic behavior at 10%.',
|
|
448
|
+
metrics: { accuracy: 0.93, p50LatencyMs: 3100, quality: releaseQuality(0.765, 32) },
|
|
449
|
+
totalReceived: 32,
|
|
450
|
+
totalProcessed: 31,
|
|
451
|
+
totalFiltered: 1,
|
|
452
|
+
totalCorrect: 29,
|
|
453
|
+
totalErrors: 1,
|
|
454
|
+
startedAt: '2026-05-23T07:20:05.000Z',
|
|
455
|
+
finishedAt: '2026-05-23T07:28:00.000Z',
|
|
456
|
+
createdAt: '2026-05-23T07:20:00.000Z',
|
|
457
|
+
updatedAt: '2026-05-23T07:28:00.000Z',
|
|
458
|
+
}),
|
|
459
|
+
releaseEvent({
|
|
460
|
+
id: EVENT_CANDIDATE_02_ID,
|
|
461
|
+
laneType: 'canary',
|
|
462
|
+
operation: 'traffic_updated',
|
|
463
|
+
status: 'completed',
|
|
464
|
+
terminalReason: 'promoted',
|
|
465
|
+
sourceEventId: EVENT_CANDIDATE_01_ID,
|
|
466
|
+
supersedesEventId: EVENT_CANDIDATE_01_ID,
|
|
467
|
+
rollbackTargetEventId: null,
|
|
468
|
+
releaseVersionId: VERSION_CANDIDATE_02_ID,
|
|
469
|
+
promptVersionId: promptV3.id,
|
|
470
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
471
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
472
|
+
modelId: ernie5.id,
|
|
473
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
474
|
+
trafficMode: 'split',
|
|
475
|
+
trafficRatio: '0.2500',
|
|
476
|
+
sourceExperimentId: '7c54873b-8d0a-5003-8cfb-26f8b8ba7096',
|
|
477
|
+
submitReason: 'Second v1 candidate after optimization; widened traffic to 25%.',
|
|
478
|
+
metrics: { accuracy: 0.96, p50LatencyMs: 2850, quality: releaseQuality(0.812, 64) },
|
|
479
|
+
totalReceived: 64,
|
|
480
|
+
totalProcessed: 63,
|
|
481
|
+
totalFiltered: 1,
|
|
482
|
+
totalCorrect: 60,
|
|
483
|
+
totalErrors: 1,
|
|
484
|
+
startedAt: '2026-05-23T07:35:05.000Z',
|
|
485
|
+
finishedAt: '2026-05-23T07:48:00.000Z',
|
|
486
|
+
createdAt: '2026-05-23T07:35:00.000Z',
|
|
487
|
+
updatedAt: '2026-05-23T07:48:00.000Z',
|
|
488
|
+
}),
|
|
489
|
+
releaseEvent({
|
|
490
|
+
id: EVENT_PRODUCTION_1_ID,
|
|
491
|
+
laneType: 'production',
|
|
492
|
+
operation: 'promote_canary',
|
|
493
|
+
status: 'completed',
|
|
494
|
+
terminalReason: 'replaced',
|
|
495
|
+
sourceEventId: EVENT_CANDIDATE_02_ID,
|
|
496
|
+
supersedesEventId: null,
|
|
497
|
+
rollbackTargetEventId: null,
|
|
498
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
499
|
+
promptVersionId: promptV3.id,
|
|
500
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
501
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
502
|
+
modelId: ernie5.id,
|
|
503
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
504
|
+
trafficMode: null,
|
|
505
|
+
trafficRatio: null,
|
|
506
|
+
sourceExperimentId: '7c54873b-8d0a-5003-8cfb-26f8b8ba7096',
|
|
507
|
+
submitReason: 'Promote v0.2 candidate as production v1.',
|
|
508
|
+
metrics: { accuracy: 0.96, p50LatencyMs: 2920, errorRate: 0.01, quality: releaseQuality(0.806, 128) },
|
|
509
|
+
totalReceived: 128,
|
|
510
|
+
totalProcessed: 126,
|
|
511
|
+
totalFiltered: 0,
|
|
512
|
+
totalCorrect: 121,
|
|
513
|
+
totalErrors: 2,
|
|
514
|
+
startedAt: '2026-05-23T08:00:00.000Z',
|
|
515
|
+
finishedAt: '2026-05-23T08:12:00.000Z',
|
|
516
|
+
createdAt: '2026-05-23T08:00:00.000Z',
|
|
517
|
+
updatedAt: '2026-05-23T08:12:00.000Z',
|
|
518
|
+
}),
|
|
519
|
+
releaseEvent({
|
|
520
|
+
id: EVENT_PRODUCTION_1_CONFIG_ID,
|
|
521
|
+
laneType: 'production',
|
|
522
|
+
operation: 'config_changed',
|
|
523
|
+
status: 'completed',
|
|
524
|
+
terminalReason: 'replaced',
|
|
525
|
+
sourceEventId: EVENT_PRODUCTION_1_ID,
|
|
526
|
+
supersedesEventId: EVENT_PRODUCTION_1_ID,
|
|
527
|
+
rollbackTargetEventId: null,
|
|
528
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
529
|
+
promptVersionId: promptV3.id,
|
|
530
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
531
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
532
|
+
modelId: ernie5.id,
|
|
533
|
+
modelSnapshot: modelSnapshot(ernie5),
|
|
534
|
+
trafficMode: null,
|
|
535
|
+
trafficRatio: null,
|
|
536
|
+
runConfig: { ...defaultRunConfig, rpmLimit: 36, tpmLimit: 168000, concurrency: 14, temperature: 0.05 },
|
|
537
|
+
sourceExperimentId: '7c54873b-8d0a-5003-8cfb-26f8b8ba7096',
|
|
538
|
+
submitReason: 'Tighten v1 runtime limits after initial production traffic.',
|
|
539
|
+
metrics: { accuracy: 0.962, p50LatencyMs: 2860, errorRate: 0.008, quality: releaseQuality(0.818, 184) },
|
|
540
|
+
totalReceived: 184,
|
|
541
|
+
totalProcessed: 182,
|
|
542
|
+
totalFiltered: 0,
|
|
543
|
+
totalCorrect: 176,
|
|
544
|
+
totalErrors: 2,
|
|
545
|
+
startedAt: '2026-05-23T08:12:00.000Z',
|
|
546
|
+
finishedAt: '2026-05-23T08:42:00.000Z',
|
|
547
|
+
createdAt: '2026-05-23T08:12:00.000Z',
|
|
548
|
+
updatedAt: '2026-05-23T08:42:00.000Z',
|
|
549
|
+
}),
|
|
550
|
+
releaseEvent({
|
|
551
|
+
id: EVENT_CANDIDATE_11_ID,
|
|
552
|
+
laneType: 'canary',
|
|
553
|
+
operation: 'create_canary',
|
|
554
|
+
status: 'completed',
|
|
555
|
+
terminalReason: 'promoted',
|
|
556
|
+
sourceEventId: EVENT_PRODUCTION_1_CONFIG_ID,
|
|
557
|
+
supersedesEventId: null,
|
|
558
|
+
rollbackTargetEventId: null,
|
|
559
|
+
releaseVersionId: VERSION_CANDIDATE_11_ID,
|
|
560
|
+
promptVersionId: promptV3.id,
|
|
561
|
+
promptVersionNumber: promptV3.versionNumber,
|
|
562
|
+
promptVersionSnapshot: promptVersionSnapshot(promptV3),
|
|
563
|
+
modelId: sonnet.id,
|
|
564
|
+
modelSnapshot: modelSnapshot(sonnet),
|
|
565
|
+
trafficMode: 'dual_run',
|
|
566
|
+
trafficRatio: '0.0500',
|
|
567
|
+
sourceExperimentId: null,
|
|
568
|
+
submitReason: 'Canary for production v2 with a different model.',
|
|
569
|
+
metrics: { accuracy: 0.95, p50LatencyMs: 3450, errorRate: 0, quality: releaseQuality(0.832, 27) },
|
|
570
|
+
totalReceived: 27,
|
|
571
|
+
totalProcessed: 27,
|
|
572
|
+
totalFiltered: 0,
|
|
573
|
+
totalCorrect: 25,
|
|
574
|
+
totalErrors: 0,
|
|
575
|
+
startedAt: '2026-05-23T08:30:00.000Z',
|
|
576
|
+
finishedAt: production2Plan.candidateUpdatedAt,
|
|
577
|
+
createdAt: '2026-05-23T08:30:00.000Z',
|
|
578
|
+
updatedAt: production2Plan.candidateUpdatedAt,
|
|
579
|
+
}),
|
|
580
|
+
...generatedProductionPlans.flatMap((plan) => {
|
|
581
|
+
const isLatestProduction = plan.productionNumber === 10;
|
|
582
|
+
const candidateEvents = plan.productionNumber === 2
|
|
583
|
+
? []
|
|
584
|
+
: [
|
|
585
|
+
releaseEvent({
|
|
586
|
+
id: plan.candidateEventId,
|
|
587
|
+
laneType: 'canary',
|
|
588
|
+
operation: 'create_canary',
|
|
589
|
+
status: 'completed',
|
|
590
|
+
terminalReason: 'promoted',
|
|
591
|
+
sourceEventId: plan.previousProductionEventId,
|
|
592
|
+
supersedesEventId: null,
|
|
593
|
+
rollbackTargetEventId: null,
|
|
594
|
+
releaseVersionId: plan.candidateVersionId,
|
|
595
|
+
promptVersionId: plan.promptVersion.id,
|
|
596
|
+
promptVersionNumber: plan.promptVersion.versionNumber,
|
|
597
|
+
promptVersionSnapshot: promptVersionSnapshot(plan.promptVersion),
|
|
598
|
+
modelId: plan.model.id,
|
|
599
|
+
modelSnapshot: modelSnapshot(plan.model),
|
|
600
|
+
trafficMode: plan.productionNumber % 2 === 0 ? 'split' : 'dual_run',
|
|
601
|
+
trafficRatio: plan.productionNumber % 2 === 0 ? '0.1800' : '0.0600',
|
|
602
|
+
runConfig: candidateRunConfig(plan.productionNumber),
|
|
603
|
+
sourceExperimentId: null,
|
|
604
|
+
submitReason: `Canary for production v${plan.productionNumber}; verify release history density and candidate grouping.`,
|
|
605
|
+
metrics: {
|
|
606
|
+
accuracy: Number((0.94 + plan.productionNumber * 0.002).toFixed(3)),
|
|
607
|
+
p50LatencyMs: 3000 + plan.productionNumber * 35,
|
|
608
|
+
errorRate: 0.01,
|
|
609
|
+
quality: releaseQuality(0.79 + plan.productionNumber * 0.007, 40 + plan.productionNumber * 7),
|
|
610
|
+
},
|
|
611
|
+
totalReceived: 40 + plan.productionNumber * 7,
|
|
612
|
+
totalProcessed: 39 + plan.productionNumber * 7,
|
|
613
|
+
totalFiltered: 1,
|
|
614
|
+
totalCorrect: 36 + plan.productionNumber * 7,
|
|
615
|
+
totalErrors: 1,
|
|
616
|
+
startedAt: plan.candidateCreatedAt,
|
|
617
|
+
finishedAt: plan.candidateUpdatedAt,
|
|
618
|
+
createdAt: plan.candidateCreatedAt,
|
|
619
|
+
updatedAt: plan.candidateUpdatedAt,
|
|
620
|
+
}),
|
|
621
|
+
];
|
|
622
|
+
return [
|
|
623
|
+
...candidateEvents,
|
|
624
|
+
releaseEvent({
|
|
625
|
+
id: plan.productionEventId,
|
|
626
|
+
laneType: 'production',
|
|
627
|
+
operation: 'promote_canary',
|
|
628
|
+
status: 'completed',
|
|
629
|
+
terminalReason: 'replaced',
|
|
630
|
+
sourceEventId: plan.candidateEventId,
|
|
631
|
+
supersedesEventId: plan.previousProductionEventId,
|
|
632
|
+
rollbackTargetEventId: null,
|
|
633
|
+
releaseVersionId: plan.productionVersionId,
|
|
634
|
+
promptVersionId: plan.promptVersion.id,
|
|
635
|
+
promptVersionNumber: plan.promptVersion.versionNumber,
|
|
636
|
+
promptVersionSnapshot: promptVersionSnapshot(plan.promptVersion),
|
|
637
|
+
modelId: plan.model.id,
|
|
638
|
+
modelSnapshot: modelSnapshot(plan.model),
|
|
639
|
+
trafficMode: null,
|
|
640
|
+
trafficRatio: null,
|
|
641
|
+
sourceExperimentId: null,
|
|
642
|
+
submitReason: `Promote candidate as production v${plan.productionNumber}.`,
|
|
643
|
+
metrics: {
|
|
644
|
+
accuracy: Number((0.945 + plan.productionNumber * 0.002).toFixed(3)),
|
|
645
|
+
p50LatencyMs: 2920 + plan.productionNumber * 28,
|
|
646
|
+
errorRate: 0.009,
|
|
647
|
+
quality: releaseQuality(0.805 + plan.productionNumber * 0.007, 120 + plan.productionNumber * 24),
|
|
648
|
+
},
|
|
649
|
+
totalReceived: 120 + plan.productionNumber * 24,
|
|
650
|
+
totalProcessed: 118 + plan.productionNumber * 24,
|
|
651
|
+
totalFiltered: 0,
|
|
652
|
+
totalCorrect: 112 + plan.productionNumber * 23,
|
|
653
|
+
totalErrors: 2,
|
|
654
|
+
startedAt: plan.productionCreatedAt,
|
|
655
|
+
finishedAt: plan.configCreatedAt,
|
|
656
|
+
createdAt: plan.productionCreatedAt,
|
|
657
|
+
updatedAt: plan.productionUpdatedAt,
|
|
658
|
+
}),
|
|
659
|
+
releaseEvent({
|
|
660
|
+
id: plan.configEventId,
|
|
661
|
+
laneType: 'production',
|
|
662
|
+
operation: 'config_changed',
|
|
663
|
+
status: isLatestProduction ? 'running' : 'completed',
|
|
664
|
+
terminalReason: isLatestProduction ? null : 'replaced',
|
|
665
|
+
sourceEventId: plan.productionEventId,
|
|
666
|
+
supersedesEventId: plan.productionEventId,
|
|
667
|
+
rollbackTargetEventId: null,
|
|
668
|
+
releaseVersionId: plan.productionVersionId,
|
|
669
|
+
promptVersionId: plan.promptVersion.id,
|
|
670
|
+
promptVersionNumber: plan.promptVersion.versionNumber,
|
|
671
|
+
promptVersionSnapshot: promptVersionSnapshot(plan.promptVersion),
|
|
672
|
+
modelId: plan.model.id,
|
|
673
|
+
modelSnapshot: modelSnapshot(plan.model),
|
|
674
|
+
trafficMode: null,
|
|
675
|
+
trafficRatio: null,
|
|
676
|
+
runConfig: tunedProductionRunConfig(plan.productionNumber),
|
|
677
|
+
outputMapping: plan.productionNumber % 2 === 0
|
|
678
|
+
? outputMapping
|
|
679
|
+
: [...outputMapping, { from: 'raw_response', to: `debug_raw_v${plan.productionNumber}` }],
|
|
680
|
+
sourceExperimentId: null,
|
|
681
|
+
submitReason: `Adjust runtime and output mapping for production v${plan.productionNumber}.`,
|
|
682
|
+
metrics: {
|
|
683
|
+
accuracy: Number((0.948 + plan.productionNumber * 0.002).toFixed(3)),
|
|
684
|
+
p50LatencyMs: 2860 + plan.productionNumber * 24,
|
|
685
|
+
errorRate: 0.008,
|
|
686
|
+
quality: releaseQuality(0.812 + plan.productionNumber * 0.007, 150 + plan.productionNumber * 28),
|
|
687
|
+
},
|
|
688
|
+
totalReceived: 150 + plan.productionNumber * 28,
|
|
689
|
+
totalProcessed: 148 + plan.productionNumber * 28,
|
|
690
|
+
totalFiltered: 0,
|
|
691
|
+
totalCorrect: 142 + plan.productionNumber * 27,
|
|
692
|
+
totalErrors: 2,
|
|
693
|
+
startedAt: plan.configCreatedAt,
|
|
694
|
+
finishedAt: isLatestProduction ? null : plan.configUpdatedAt,
|
|
695
|
+
createdAt: plan.configCreatedAt,
|
|
696
|
+
updatedAt: plan.configUpdatedAt,
|
|
697
|
+
}),
|
|
698
|
+
];
|
|
699
|
+
}),
|
|
700
|
+
releaseEvent({
|
|
701
|
+
id: activeCandidatePlan.candidateEventId,
|
|
702
|
+
laneType: 'canary',
|
|
703
|
+
operation: 'create_canary',
|
|
704
|
+
status: 'completed',
|
|
705
|
+
terminalReason: 'replaced',
|
|
706
|
+
sourceEventId: activeCandidatePlan.previousProductionEventId,
|
|
707
|
+
supersedesEventId: null,
|
|
708
|
+
rollbackTargetEventId: null,
|
|
709
|
+
releaseVersionId: activeCandidatePlan.candidateVersionId,
|
|
710
|
+
promptVersionId: activeCandidatePlan.promptVersion.id,
|
|
711
|
+
promptVersionNumber: activeCandidatePlan.promptVersion.versionNumber,
|
|
712
|
+
promptVersionSnapshot: promptVersionSnapshot(activeCandidatePlan.promptVersion),
|
|
713
|
+
modelId: activeCandidatePlan.model.id,
|
|
714
|
+
modelSnapshot: modelSnapshot(activeCandidatePlan.model),
|
|
715
|
+
trafficMode: 'dual_run',
|
|
716
|
+
trafficRatio: '0.0500',
|
|
717
|
+
runConfig: candidateRunConfig(activeCandidatePlan.targetProductionNumber),
|
|
718
|
+
sourceExperimentId: null,
|
|
719
|
+
submitReason: 'Active canary for production v11; keeps the history tab showing the live next-version group.',
|
|
720
|
+
metrics: { accuracy: 0.967, p50LatencyMs: 3360, errorRate: 0, quality: releaseQuality(0.873, 46) },
|
|
721
|
+
totalReceived: 46,
|
|
722
|
+
totalProcessed: 46,
|
|
723
|
+
totalFiltered: 0,
|
|
724
|
+
totalCorrect: 44,
|
|
725
|
+
totalErrors: 0,
|
|
726
|
+
startedAt: activeCandidatePlan.candidateCreatedAt,
|
|
727
|
+
finishedAt: activeCandidatePlan.configCreatedAt,
|
|
728
|
+
createdAt: activeCandidatePlan.candidateCreatedAt,
|
|
729
|
+
updatedAt: activeCandidatePlan.configCreatedAt,
|
|
730
|
+
}),
|
|
731
|
+
releaseEvent({
|
|
732
|
+
id: activeCandidatePlan.configEventId,
|
|
733
|
+
laneType: 'canary',
|
|
734
|
+
operation: 'config_changed',
|
|
735
|
+
status: 'running',
|
|
736
|
+
terminalReason: null,
|
|
737
|
+
sourceEventId: activeCandidatePlan.candidateEventId,
|
|
738
|
+
supersedesEventId: activeCandidatePlan.candidateEventId,
|
|
739
|
+
rollbackTargetEventId: null,
|
|
740
|
+
releaseVersionId: activeCandidatePlan.candidateVersionId,
|
|
741
|
+
promptVersionId: activeCandidatePlan.promptVersion.id,
|
|
742
|
+
promptVersionNumber: activeCandidatePlan.promptVersion.versionNumber,
|
|
743
|
+
promptVersionSnapshot: promptVersionSnapshot(activeCandidatePlan.promptVersion),
|
|
744
|
+
modelId: activeCandidatePlan.model.id,
|
|
745
|
+
modelSnapshot: modelSnapshot(activeCandidatePlan.model),
|
|
746
|
+
trafficMode: 'dual_run',
|
|
747
|
+
trafficRatio: '0.0800',
|
|
748
|
+
runConfig: {
|
|
749
|
+
...candidateRunConfig(activeCandidatePlan.targetProductionNumber),
|
|
750
|
+
concurrency: 8,
|
|
751
|
+
temperature: 0.16,
|
|
752
|
+
},
|
|
753
|
+
sourceExperimentId: null,
|
|
754
|
+
submitReason: 'Raise v11 canary mirror traffic and lower concurrency after the first smoke window.',
|
|
755
|
+
metrics: { accuracy: 0.969, p50LatencyMs: 3290, errorRate: 0, quality: releaseQuality(0.884, 68) },
|
|
756
|
+
totalReceived: 68,
|
|
757
|
+
totalProcessed: 68,
|
|
758
|
+
totalFiltered: 0,
|
|
759
|
+
totalCorrect: 66,
|
|
760
|
+
totalErrors: 0,
|
|
761
|
+
startedAt: activeCandidatePlan.configCreatedAt,
|
|
762
|
+
finishedAt: null,
|
|
763
|
+
createdAt: activeCandidatePlan.configCreatedAt,
|
|
764
|
+
updatedAt: activeCandidatePlan.configUpdatedAt,
|
|
765
|
+
}),
|
|
766
|
+
];
|
|
767
|
+
function datasetSample(index) {
|
|
768
|
+
return requireFixture(yelpDataset.samples[index], `Yelp sample ${index}`);
|
|
769
|
+
}
|
|
770
|
+
function sampleText(index) {
|
|
771
|
+
return String(datasetSample(index).data['text'] ?? '');
|
|
772
|
+
}
|
|
773
|
+
function expectedOutput(index) {
|
|
774
|
+
return String(datasetSample(index).data['expected_output'] ?? 'positive');
|
|
775
|
+
}
|
|
776
|
+
function releaseRunResult(input) {
|
|
777
|
+
const sample = datasetSample(input.sampleIndex);
|
|
778
|
+
const expected = expectedOutput(input.sampleIndex);
|
|
779
|
+
const decision = input.decisionOutput ?? expected;
|
|
780
|
+
const isCorrect = decision === expected;
|
|
781
|
+
return {
|
|
782
|
+
id: input.id,
|
|
783
|
+
sourceId: input.sourceId,
|
|
784
|
+
releaseVersionId: input.releaseVersionId,
|
|
785
|
+
promptVersionId: input.promptVersionId,
|
|
786
|
+
modelId: input.modelId,
|
|
787
|
+
sampleId: sample.id,
|
|
788
|
+
externalId: sample.externalId,
|
|
789
|
+
renderedPrompt: {
|
|
790
|
+
messages: [{ role: 'user', content: sampleText(input.sampleIndex) }],
|
|
791
|
+
},
|
|
792
|
+
inputVariables: { text: sampleText(input.sampleIndex) },
|
|
793
|
+
rawResponse: decision,
|
|
794
|
+
parsedOutput: { expected_output: decision },
|
|
795
|
+
decisionOutput: decision,
|
|
796
|
+
expectedOutput: expected,
|
|
797
|
+
isCorrect,
|
|
798
|
+
judgmentStatus: isCorrect ? 'correct' : 'incorrect',
|
|
799
|
+
status: 'success',
|
|
800
|
+
errorClass: null,
|
|
801
|
+
errorMessage: null,
|
|
802
|
+
latencyMs: input.latencyMs,
|
|
803
|
+
inputTokens: input.inputTokens,
|
|
804
|
+
outputTokens: input.outputTokens,
|
|
805
|
+
costEstimate: input.costEstimate,
|
|
806
|
+
createdAt: input.createdAt,
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
exports.DEV_RELEASE_RUN_RESULTS = [
|
|
810
|
+
releaseRunResult({
|
|
811
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000101',
|
|
812
|
+
sourceId: EVENT_CANDIDATE_01_ID,
|
|
813
|
+
releaseVersionId: VERSION_CANDIDATE_01_ID,
|
|
814
|
+
promptVersionId: promptV2.id,
|
|
815
|
+
modelId: ernie5.id,
|
|
816
|
+
sampleIndex: 0,
|
|
817
|
+
createdAt: '2026-05-23T07:21:00.000Z',
|
|
818
|
+
latencyMs: 3180,
|
|
819
|
+
inputTokens: 510,
|
|
820
|
+
outputTokens: 3,
|
|
821
|
+
costEstimate: '0.000058',
|
|
822
|
+
}),
|
|
823
|
+
releaseRunResult({
|
|
824
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000102',
|
|
825
|
+
sourceId: EVENT_CANDIDATE_01_ID,
|
|
826
|
+
releaseVersionId: VERSION_CANDIDATE_01_ID,
|
|
827
|
+
promptVersionId: promptV2.id,
|
|
828
|
+
modelId: ernie5.id,
|
|
829
|
+
sampleIndex: 1,
|
|
830
|
+
decisionOutput: 'positive',
|
|
831
|
+
createdAt: '2026-05-23T07:22:00.000Z',
|
|
832
|
+
latencyMs: 4210,
|
|
833
|
+
inputTokens: 402,
|
|
834
|
+
outputTokens: 3,
|
|
835
|
+
costEstimate: '0.000047',
|
|
836
|
+
}),
|
|
837
|
+
releaseRunResult({
|
|
838
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000111',
|
|
839
|
+
sourceId: EVENT_CANDIDATE_02_ID,
|
|
840
|
+
releaseVersionId: VERSION_CANDIDATE_02_ID,
|
|
841
|
+
promptVersionId: promptV3.id,
|
|
842
|
+
modelId: ernie5.id,
|
|
843
|
+
sampleIndex: 2,
|
|
844
|
+
createdAt: '2026-05-23T07:36:00.000Z',
|
|
845
|
+
latencyMs: 2860,
|
|
846
|
+
inputTokens: 730,
|
|
847
|
+
outputTokens: 3,
|
|
848
|
+
costEstimate: '0.000081',
|
|
849
|
+
}),
|
|
850
|
+
releaseRunResult({
|
|
851
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000112',
|
|
852
|
+
sourceId: EVENT_CANDIDATE_02_ID,
|
|
853
|
+
releaseVersionId: VERSION_CANDIDATE_02_ID,
|
|
854
|
+
promptVersionId: promptV3.id,
|
|
855
|
+
modelId: ernie5.id,
|
|
856
|
+
sampleIndex: 3,
|
|
857
|
+
createdAt: '2026-05-23T07:37:00.000Z',
|
|
858
|
+
latencyMs: 2990,
|
|
859
|
+
inputTokens: 820,
|
|
860
|
+
outputTokens: 3,
|
|
861
|
+
costEstimate: '0.000091',
|
|
862
|
+
}),
|
|
863
|
+
releaseRunResult({
|
|
864
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000121',
|
|
865
|
+
sourceId: EVENT_PRODUCTION_1_ID,
|
|
866
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
867
|
+
promptVersionId: promptV3.id,
|
|
868
|
+
modelId: ernie5.id,
|
|
869
|
+
sampleIndex: 4,
|
|
870
|
+
createdAt: '2026-05-23T08:01:00.000Z',
|
|
871
|
+
latencyMs: 2710,
|
|
872
|
+
inputTokens: 690,
|
|
873
|
+
outputTokens: 3,
|
|
874
|
+
costEstimate: '0.000077',
|
|
875
|
+
}),
|
|
876
|
+
releaseRunResult({
|
|
877
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000122',
|
|
878
|
+
sourceId: EVENT_PRODUCTION_1_ID,
|
|
879
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
880
|
+
promptVersionId: promptV3.id,
|
|
881
|
+
modelId: ernie5.id,
|
|
882
|
+
sampleIndex: 5,
|
|
883
|
+
createdAt: '2026-05-23T08:02:00.000Z',
|
|
884
|
+
latencyMs: 2880,
|
|
885
|
+
inputTokens: 612,
|
|
886
|
+
outputTokens: 3,
|
|
887
|
+
costEstimate: '0.000068',
|
|
888
|
+
}),
|
|
889
|
+
releaseRunResult({
|
|
890
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000123',
|
|
891
|
+
sourceId: EVENT_PRODUCTION_1_ID,
|
|
892
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
893
|
+
promptVersionId: promptV3.id,
|
|
894
|
+
modelId: ernie5.id,
|
|
895
|
+
sampleIndex: 6,
|
|
896
|
+
decisionOutput: 'positive',
|
|
897
|
+
createdAt: '2026-05-23T08:03:00.000Z',
|
|
898
|
+
latencyMs: 3340,
|
|
899
|
+
inputTokens: 640,
|
|
900
|
+
outputTokens: 3,
|
|
901
|
+
costEstimate: '0.000071',
|
|
902
|
+
}),
|
|
903
|
+
releaseRunResult({
|
|
904
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000124',
|
|
905
|
+
sourceId: EVENT_PRODUCTION_1_ID,
|
|
906
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
907
|
+
promptVersionId: promptV3.id,
|
|
908
|
+
modelId: ernie5.id,
|
|
909
|
+
sampleIndex: 7,
|
|
910
|
+
createdAt: '2026-05-23T08:04:00.000Z',
|
|
911
|
+
latencyMs: 2590,
|
|
912
|
+
inputTokens: 530,
|
|
913
|
+
outputTokens: 3,
|
|
914
|
+
costEstimate: '0.000060',
|
|
915
|
+
}),
|
|
916
|
+
releaseRunResult({
|
|
917
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000131',
|
|
918
|
+
sourceId: EVENT_CANDIDATE_11_ID,
|
|
919
|
+
releaseVersionId: VERSION_CANDIDATE_11_ID,
|
|
920
|
+
promptVersionId: promptV3.id,
|
|
921
|
+
modelId: sonnet.id,
|
|
922
|
+
sampleIndex: 8,
|
|
923
|
+
createdAt: '2026-05-23T08:31:00.000Z',
|
|
924
|
+
latencyMs: 3540,
|
|
925
|
+
inputTokens: 720,
|
|
926
|
+
outputTokens: 3,
|
|
927
|
+
costEstimate: '0.002205',
|
|
928
|
+
}),
|
|
929
|
+
releaseRunResult({
|
|
930
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000132',
|
|
931
|
+
sourceId: EVENT_CANDIDATE_11_ID,
|
|
932
|
+
releaseVersionId: VERSION_CANDIDATE_11_ID,
|
|
933
|
+
promptVersionId: promptV3.id,
|
|
934
|
+
modelId: sonnet.id,
|
|
935
|
+
sampleIndex: 9,
|
|
936
|
+
createdAt: '2026-05-23T08:32:00.000Z',
|
|
937
|
+
latencyMs: 3710,
|
|
938
|
+
inputTokens: 680,
|
|
939
|
+
outputTokens: 3,
|
|
940
|
+
costEstimate: '0.002085',
|
|
941
|
+
}),
|
|
942
|
+
];
|
|
943
|
+
const annotationOptions = ['positive', 'negative'];
|
|
944
|
+
exports.DEV_RELEASE_ANNOTATION_TASKS = [
|
|
945
|
+
{
|
|
946
|
+
id: ANNOTATION_TASK_ID,
|
|
947
|
+
scope: 'online',
|
|
948
|
+
releaseLineEventId: EVENT_PRODUCTION_1_ID,
|
|
949
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
950
|
+
releaseVersionScope: 'exact',
|
|
951
|
+
name: 'sentiment-classifier-live · v1 spot check',
|
|
952
|
+
annotationSchema: [
|
|
953
|
+
{
|
|
954
|
+
name: 'expected_output',
|
|
955
|
+
type: 'single_select',
|
|
956
|
+
required: true,
|
|
957
|
+
options: annotationOptions,
|
|
958
|
+
},
|
|
959
|
+
],
|
|
960
|
+
samplingConfig: {
|
|
961
|
+
releaseLineId: RELEASE_LINE_ID,
|
|
962
|
+
releaseVersionId: VERSION_PRODUCTION_1_ID,
|
|
963
|
+
releaseVersionScope: 'exact',
|
|
964
|
+
scope: 'online',
|
|
965
|
+
availableCount: 4,
|
|
966
|
+
sampleSize: 4,
|
|
967
|
+
},
|
|
968
|
+
totalSampled: 4,
|
|
969
|
+
totalAnnotated: 3,
|
|
970
|
+
status: 'active',
|
|
971
|
+
createdAt: '2026-05-23T08:10:00.000Z',
|
|
972
|
+
updatedAt: '2026-05-23T08:18:00.000Z',
|
|
973
|
+
},
|
|
974
|
+
];
|
|
975
|
+
exports.DEV_RELEASE_ANNOTATIONS = [
|
|
976
|
+
{
|
|
977
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000201',
|
|
978
|
+
runResultId: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000121',
|
|
979
|
+
runResultCreatedAt: '2026-05-23T08:01:00.000Z',
|
|
980
|
+
taskId: ANNOTATION_TASK_ID,
|
|
981
|
+
isCorrect: true,
|
|
982
|
+
fields: { expected_output: expectedOutput(4) },
|
|
983
|
+
notes: 'Matches human review.',
|
|
984
|
+
lockedBy: null,
|
|
985
|
+
lockedAt: null,
|
|
986
|
+
lockHeartbeatAt: null,
|
|
987
|
+
submittedAt: '2026-05-23T08:12:00.000Z',
|
|
988
|
+
submittedBy: LOCAL_ACTOR_ID,
|
|
989
|
+
createdAt: '2026-05-23T08:10:00.000Z',
|
|
990
|
+
updatedAt: '2026-05-23T08:12:00.000Z',
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000202',
|
|
994
|
+
runResultId: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000122',
|
|
995
|
+
runResultCreatedAt: '2026-05-23T08:02:00.000Z',
|
|
996
|
+
taskId: ANNOTATION_TASK_ID,
|
|
997
|
+
isCorrect: true,
|
|
998
|
+
fields: { expected_output: expectedOutput(5) },
|
|
999
|
+
notes: null,
|
|
1000
|
+
lockedBy: null,
|
|
1001
|
+
lockedAt: null,
|
|
1002
|
+
lockHeartbeatAt: null,
|
|
1003
|
+
submittedAt: '2026-05-23T08:14:00.000Z',
|
|
1004
|
+
submittedBy: LOCAL_ACTOR_ID,
|
|
1005
|
+
createdAt: '2026-05-23T08:10:00.000Z',
|
|
1006
|
+
updatedAt: '2026-05-23T08:14:00.000Z',
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000203',
|
|
1010
|
+
runResultId: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000123',
|
|
1011
|
+
runResultCreatedAt: '2026-05-23T08:03:00.000Z',
|
|
1012
|
+
taskId: ANNOTATION_TASK_ID,
|
|
1013
|
+
isCorrect: false,
|
|
1014
|
+
fields: { expected_output: expectedOutput(6) },
|
|
1015
|
+
notes: 'Surface-level positive output misses the complaint.',
|
|
1016
|
+
lockedBy: null,
|
|
1017
|
+
lockedAt: null,
|
|
1018
|
+
lockHeartbeatAt: null,
|
|
1019
|
+
submittedAt: '2026-05-23T08:18:00.000Z',
|
|
1020
|
+
submittedBy: LOCAL_ACTOR_ID,
|
|
1021
|
+
createdAt: '2026-05-23T08:10:00.000Z',
|
|
1022
|
+
updatedAt: '2026-05-23T08:18:00.000Z',
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
id: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000204',
|
|
1026
|
+
runResultId: 'bbbbbbbb-bbbb-4bbb-8bbb-000000000124',
|
|
1027
|
+
runResultCreatedAt: '2026-05-23T08:04:00.000Z',
|
|
1028
|
+
taskId: ANNOTATION_TASK_ID,
|
|
1029
|
+
isCorrect: null,
|
|
1030
|
+
fields: {},
|
|
1031
|
+
notes: null,
|
|
1032
|
+
lockedBy: null,
|
|
1033
|
+
lockedAt: null,
|
|
1034
|
+
lockHeartbeatAt: null,
|
|
1035
|
+
submittedAt: null,
|
|
1036
|
+
submittedBy: null,
|
|
1037
|
+
createdAt: '2026-05-23T08:10:00.000Z',
|
|
1038
|
+
updatedAt: '2026-05-23T08:10:00.000Z',
|
|
1039
|
+
},
|
|
1040
|
+
];
|
|
1041
|
+
//# sourceMappingURL=releases.js.map
|