@open-qa/qa 0.1.0-alpha.3 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/THIRD_PARTY.md +5 -0
  2. package/drizzle/0017_provider_notifications.sql +13 -0
  3. package/drizzle/0018_classification_registry.sql +39 -0
  4. package/drizzle/0019_trial_audit.sql +44 -0
  5. package/drizzle/meta/0017_snapshot.json +2092 -0
  6. package/drizzle/meta/0018_snapshot.json +2102 -0
  7. package/drizzle/meta/0019_snapshot.json +2451 -0
  8. package/drizzle/meta/_journal.json +21 -0
  9. package/package.json +12 -7
  10. package/src/access-binding.d.ts +8 -0
  11. package/src/access-binding.js +26 -0
  12. package/src/adapters/classification-write.d.ts +87 -0
  13. package/src/adapters/classification-write.js +64 -0
  14. package/src/adapters/e2b-executor.js +4 -0
  15. package/src/adapters/file-run-store.d.ts +186 -41
  16. package/src/adapters/file-run-store.js +87 -19
  17. package/src/adapters/file-trial-audit.d.ts +280 -0
  18. package/src/adapters/file-trial-audit.js +105 -0
  19. package/src/adapters/pg-classification-store.d.ts +98 -20
  20. package/src/adapters/pg-classification-store.js +84 -44
  21. package/src/adapters/pg-run-store.d.ts +1 -0
  22. package/src/adapters/pg-run-store.js +70 -9
  23. package/src/adapters/run-metadata.d.ts +2 -0
  24. package/src/adapters/run-metadata.js +10 -0
  25. package/src/adapters/secret-manager-credential-resolver.d.ts +1 -1
  26. package/src/attempt-audit.d.ts +363 -0
  27. package/src/attempt-audit.js +253 -0
  28. package/src/audit-command.d.ts +13 -0
  29. package/src/audit-command.js +77 -0
  30. package/src/classification-command.d.ts +14 -9
  31. package/src/classification-command.js +119 -26
  32. package/src/classification-model.d.ts +10 -3
  33. package/src/classification-model.js +40 -24
  34. package/src/classification-notifier.d.ts +4 -3
  35. package/src/classification-notifier.js +26 -6
  36. package/src/classify-runs.d.ts +2 -1
  37. package/src/classify-runs.js +39 -3
  38. package/src/cli-program.js +54 -8
  39. package/src/commands.d.ts +1 -0
  40. package/src/commands.js +2 -0
  41. package/src/db/database.d.ts +7 -0
  42. package/src/db/database.js +15 -0
  43. package/src/db/event-chunks.d.ts +38 -29
  44. package/src/db/flow-status.d.ts +7 -3
  45. package/src/db/flow-status.js +240 -16
  46. package/src/db/queries.d.ts +24 -1
  47. package/src/db/queries.js +22 -0
  48. package/src/db/schema.d.ts +333 -4
  49. package/src/db/schema.js +83 -11
  50. package/src/db/trial-audit.d.ts +526 -0
  51. package/src/db/trial-audit.js +84 -0
  52. package/src/doctor-command.js +2 -1
  53. package/src/draft-api.d.ts +25 -421
  54. package/src/draft-api.js +10 -3
  55. package/src/engine.d.ts +47 -4
  56. package/src/engine.js +97 -8
  57. package/src/execution-snapshot.d.ts +1 -1
  58. package/src/execution-snapshot.js +24 -18
  59. package/src/export-command.d.ts +6 -0
  60. package/src/export-command.js +106 -0
  61. package/src/flow-check.js +1 -1
  62. package/src/flow-loader.d.ts +72 -6
  63. package/src/flow-loader.js +76 -12
  64. package/src/http-stage-client.d.ts +98 -1
  65. package/src/independent-model.js +53 -6
  66. package/src/judge-review-store.d.ts +13 -0
  67. package/src/judge-review-store.js +58 -0
  68. package/src/local-host-executor.d.ts +3 -1
  69. package/src/local-host-executor.js +2 -0
  70. package/src/quarantine-command.d.ts +5 -1
  71. package/src/quarantine-command.js +56 -13
  72. package/src/remote-command.js +2 -0
  73. package/src/report/browser.css +1 -1
  74. package/src/report/browser.js +41 -41
  75. package/src/report/ctrf.d.ts +983 -0
  76. package/src/report/ctrf.js +306 -0
  77. package/src/report/generate.d.ts +1 -1
  78. package/src/report/generate.js +29 -6
  79. package/src/report/load.d.ts +738 -42
  80. package/src/report/load.js +78 -6
  81. package/src/result-notifier.js +1 -1
  82. package/src/result-trace.d.ts +62 -0
  83. package/src/result-trace.js +81 -0
  84. package/src/run-command.d.ts +9 -0
  85. package/src/run-command.js +300 -63
  86. package/src/run-setup-error.d.ts +11 -0
  87. package/src/run-setup-error.js +18 -0
  88. package/src/server/app.js +5 -4
  89. package/src/server/index.d.ts +2 -0
  90. package/src/server/index.js +11 -2
  91. package/src/server/repository.d.ts +166 -29
  92. package/src/server/repository.js +14 -2
  93. package/src/studio-command.d.ts +1 -0
  94. package/src/studio-command.js +11 -0
  95. package/src/studio-control.d.ts +5 -0
  96. package/src/studio-control.js +207 -0
  97. package/src/studio-review.d.ts +24 -0
  98. package/src/studio-review.js +64 -0
  99. package/src/studio-worker.d.ts +1 -0
  100. package/src/studio-worker.js +48 -0
  101. package/src/system-config.d.ts +2 -2
  102. package/src/system-config.js +5 -4
  103. package/src/trial-audit.d.ts +630 -0
  104. package/src/trial-audit.js +272 -0
  105. package/src/visual-baseline.d.ts +4 -0
  106. package/src/visual-baseline.js +42 -0
  107. package/src/webhook-notification.d.ts +15 -0
  108. package/src/webhook-notification.js +61 -0
  109. package/src/worker/execution.d.ts +2 -1
  110. package/src/worker/execution.js +122 -3
  111. package/src/worker/index.d.ts +4 -0
  112. package/src/worker/index.js +10 -1
  113. package/src/worker/quarantine-notifications.js +2 -2
  114. package/src/worker/queue.d.ts +6 -2
  115. package/src/worker/queue.js +80 -19
  116. package/src/worker/result-notifications.d.ts +10 -2
  117. package/src/worker/result-notifications.js +120 -23
  118. package/src/worker/store.js +6 -3
@@ -0,0 +1,630 @@
1
+ import { z } from "zod";
2
+ export declare const trialGroupSchema: z.ZodObject<{
3
+ schemaVersion: z.ZodLiteral<1>;
4
+ groupId: z.ZodString;
5
+ projectId: z.ZodString;
6
+ batchId: z.ZodString;
7
+ caseId: z.ZodString;
8
+ flow: z.ZodString;
9
+ caseRevision: z.ZodString;
10
+ target: z.ZodString;
11
+ targetRevision: z.ZodNullable<z.ZodString>;
12
+ generation: z.ZodNullable<z.ZodNumber>;
13
+ planned: z.ZodNumber;
14
+ startedAt: z.ZodNumber;
15
+ environment: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
16
+ independent: z.ZodOptional<z.ZodBoolean>;
17
+ quarantinePolicy: z.ZodOptional<z.ZodObject<{
18
+ expiresAfterHours: z.ZodNumber;
19
+ evidenceMaxAgeHours: z.ZodNumber;
20
+ minimumPassedTrials: z.ZodNumber;
21
+ flakyStreak: z.ZodNumber;
22
+ }, z.core.$strict>>;
23
+ }, z.core.$strict>;
24
+ export declare const trialReceiptSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
25
+ kind: z.ZodLiteral<"attempt-started">;
26
+ trace: z.ZodObject<{
27
+ schemaVersion: z.ZodLiteral<1>;
28
+ projectId: z.ZodString;
29
+ caseId: z.ZodString;
30
+ caseRevision: z.ZodNullable<z.ZodString>;
31
+ executionId: z.ZodString;
32
+ attemptId: z.ZodString;
33
+ attempt: z.ZodNumber;
34
+ started: z.ZodBoolean;
35
+ retryOf: z.ZodNullable<z.ZodString>;
36
+ batchId: z.ZodNullable<z.ZodString>;
37
+ trial: z.ZodNullable<z.ZodObject<{
38
+ groupId: z.ZodString;
39
+ index: z.ZodNumber;
40
+ count: z.ZodNumber;
41
+ }, z.core.$strict>>;
42
+ target: z.ZodNullable<z.ZodString>;
43
+ acceptance: z.ZodOptional<z.ZodObject<{
44
+ source: z.ZodString;
45
+ revision: z.ZodString;
46
+ criteria: z.ZodArray<z.ZodObject<{
47
+ id: z.ZodString;
48
+ text: z.ZodString;
49
+ source: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strict>>;
51
+ flows: z.ZodArray<z.ZodObject<{
52
+ flow: z.ZodString;
53
+ covers: z.ZodArray<z.ZodString>;
54
+ }, z.core.$strict>>;
55
+ }, z.core.$strict>>;
56
+ covers: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
+ traceability: z.ZodOptional<z.ZodObject<{
58
+ caseId: z.ZodOptional<z.ZodString>;
59
+ risk: z.ZodOptional<z.ZodString>;
60
+ owner: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strict>>;
62
+ context: z.ZodOptional<z.ZodObject<{
63
+ device: z.ZodOptional<z.ZodString>;
64
+ ci: z.ZodOptional<z.ZodObject<{
65
+ pipeline: z.ZodOptional<z.ZodString>;
66
+ task: z.ZodOptional<z.ZodString>;
67
+ runId: z.ZodOptional<z.ZodString>;
68
+ runUrl: z.ZodOptional<z.ZodURL>;
69
+ }, z.core.$strict>>;
70
+ build: z.ZodOptional<z.ZodObject<{
71
+ id: z.ZodOptional<z.ZodString>;
72
+ url: z.ZodOptional<z.ZodURL>;
73
+ }, z.core.$strict>>;
74
+ correlation: z.ZodOptional<z.ZodObject<{
75
+ traceId: z.ZodOptional<z.ZodString>;
76
+ spanId: z.ZodOptional<z.ZodString>;
77
+ requestId: z.ZodOptional<z.ZodString>;
78
+ }, z.core.$strict>>;
79
+ productPr: z.ZodOptional<z.ZodObject<{
80
+ url: z.ZodURL;
81
+ base: z.ZodOptional<z.ZodString>;
82
+ head: z.ZodOptional<z.ZodString>;
83
+ revision: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strict>>;
85
+ qa: z.ZodOptional<z.ZodObject<{
86
+ issue: z.ZodOptional<z.ZodURL>;
87
+ pr: z.ZodOptional<z.ZodURL>;
88
+ }, z.core.$strict>>;
89
+ defects: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ url: z.ZodURL;
91
+ acceptance: z.ZodArray<z.ZodString>;
92
+ }, z.core.$strict>>>;
93
+ }, z.core.$strict>>;
94
+ targetRevision: z.ZodNullable<z.ZodString>;
95
+ commit: z.ZodNullable<z.ZodString>;
96
+ parameters: z.ZodObject<{
97
+ runtime: z.ZodNullable<z.ZodEnum<{
98
+ "claude-code": "claude-code";
99
+ codex: "codex";
100
+ scripted: "scripted";
101
+ pi: "pi";
102
+ }>>;
103
+ modelAccess: z.ZodNullable<z.ZodEnum<{
104
+ env: "env";
105
+ login: "login";
106
+ personal: "personal";
107
+ team: "team";
108
+ }>>;
109
+ placement: z.ZodNullable<z.ZodEnum<{
110
+ "local-host": "local-host";
111
+ e2b: "e2b";
112
+ }>>;
113
+ agentAt: z.ZodNullable<z.ZodEnum<{
114
+ host: "host";
115
+ stage: "stage";
116
+ }>>;
117
+ headed: z.ZodNullable<z.ZodBoolean>;
118
+ level: z.ZodNullable<z.ZodEnum<{
119
+ semantic: "semantic";
120
+ pixel: "pixel";
121
+ hybrid: "hybrid";
122
+ }>>;
123
+ device: z.ZodNullable<z.ZodString>;
124
+ persona: z.ZodNullable<z.ZodString>;
125
+ replay: z.ZodNullable<z.ZodEnum<{
126
+ off: "off";
127
+ enabled: "enabled";
128
+ }>>;
129
+ }, z.core.$strict>;
130
+ parameterFingerprint: z.ZodString;
131
+ environmentFingerprint: z.ZodString;
132
+ outcome: z.ZodOptional<z.ZodEnum<{
133
+ skipped: "skipped";
134
+ blocked: "blocked";
135
+ "not-run": "not-run";
136
+ "expected-failure": "expected-failure";
137
+ }>>;
138
+ engineResult: z.ZodOptional<z.ZodObject<{
139
+ verdict: z.ZodEnum<{
140
+ error: "error";
141
+ passed: "passed";
142
+ failed: "failed";
143
+ inconclusive: "inconclusive";
144
+ canceled: "canceled";
145
+ }>;
146
+ reason: z.ZodNullable<z.ZodString>;
147
+ finishedAt: z.ZodNumber;
148
+ }, z.core.$strict>>;
149
+ evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
150
+ path: z.ZodString;
151
+ actor: z.ZodNullable<z.ZodString>;
152
+ view: z.ZodNullable<z.ZodString>;
153
+ step: z.ZodNullable<z.ZodString>;
154
+ eventSeq: z.ZodNumber;
155
+ }, z.core.$strict>>>;
156
+ }, z.core.$strict>;
157
+ }, z.core.$strict>, z.ZodObject<{
158
+ kind: z.ZodLiteral<"attempt-finished">;
159
+ attemptId: z.ZodString;
160
+ at: z.ZodNumber;
161
+ verdict: z.ZodEnum<{
162
+ error: "error";
163
+ passed: "passed";
164
+ failed: "failed";
165
+ inconclusive: "inconclusive";
166
+ canceled: "canceled";
167
+ }>;
168
+ outcome: z.ZodOptional<z.ZodEnum<{
169
+ skipped: "skipped";
170
+ blocked: "blocked";
171
+ "not-run": "not-run";
172
+ "expected-failure": "expected-failure";
173
+ }>>;
174
+ usage: z.ZodOptional<z.ZodObject<{
175
+ inputTokens: z.ZodNumber;
176
+ outputTokens: z.ZodNumber;
177
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
178
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
179
+ costUsd: z.ZodOptional<z.ZodNumber>;
180
+ costUnknown: z.ZodOptional<z.ZodLiteral<true>>;
181
+ actions: z.ZodNumber;
182
+ minutes: z.ZodNumber;
183
+ e2bMinutes: z.ZodOptional<z.ZodNumber>;
184
+ }, z.core.$strict>>;
185
+ audit: z.ZodOptional<z.ZodObject<{
186
+ schemaVersion: z.ZodLiteral<1>;
187
+ environment: z.ZodOptional<z.ZodObject<{
188
+ image: z.ZodObject<{
189
+ template: z.ZodNullable<z.ZodString>;
190
+ digest: z.ZodNullable<z.ZodString>;
191
+ }, z.core.$strict>;
192
+ runtime: z.ZodNullable<z.ZodString>;
193
+ views: z.ZodArray<z.ZodObject<{
194
+ view: z.ZodString;
195
+ browser: z.ZodNullable<z.ZodString>;
196
+ viewport: z.ZodNullable<z.ZodObject<{
197
+ width: z.ZodNumber;
198
+ height: z.ZodNumber;
199
+ }, z.core.$strict>>;
200
+ device: z.ZodNullable<z.ZodString>;
201
+ }, z.core.$strict>>;
202
+ }, z.core.$strict>>;
203
+ usage: z.ZodArray<z.ZodObject<{
204
+ inputTokens: z.ZodNumber;
205
+ outputTokens: z.ZodNumber;
206
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
207
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
208
+ costUsd: z.ZodOptional<z.ZodNumber>;
209
+ costUnknown: z.ZodOptional<z.ZodLiteral<true>>;
210
+ model: z.ZodOptional<z.ZodObject<{
211
+ provider: z.ZodNullable<z.ZodString>;
212
+ model: z.ZodNullable<z.ZodString>;
213
+ deployment: z.ZodOptional<z.ZodString>;
214
+ promptVersion: z.ZodOptional<z.ZodString>;
215
+ promptHash: z.ZodOptional<z.ZodString>;
216
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
217
+ seed: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
218
+ unknown: "unknown";
219
+ unsupported: "unsupported";
220
+ }>]>;
221
+ billingVersion: z.ZodNullable<z.ZodString>;
222
+ }, z.core.$strict>>;
223
+ billingMode: z.ZodOptional<z.ZodEnum<{
224
+ subscription: "subscription";
225
+ metered: "metered";
226
+ }>>;
227
+ costUnknownReason: z.ZodOptional<z.ZodEnum<{
228
+ subscription: "subscription";
229
+ unpriced: "unpriced";
230
+ "usage-unavailable": "usage-unavailable";
231
+ "billing-unrecorded": "billing-unrecorded";
232
+ }>>;
233
+ role: z.ZodEnum<{
234
+ heal: "heal";
235
+ main: "main";
236
+ judge: "judge";
237
+ reviewer: "reviewer";
238
+ classifier: "classifier";
239
+ }>;
240
+ actor: z.ZodOptional<z.ZodString>;
241
+ step: z.ZodOptional<z.ZodString>;
242
+ billing: z.ZodNullable<z.ZodEnum<{
243
+ subscription: "subscription";
244
+ metered: "metered";
245
+ }>>;
246
+ }, z.core.$strict>>;
247
+ judges: z.ZodArray<z.ZodObject<{
248
+ eventSeq: z.ZodNumber;
249
+ actor: z.ZodNullable<z.ZodString>;
250
+ step: z.ZodNullable<z.ZodString>;
251
+ verdict: z.ZodEnum<{
252
+ passed: "passed";
253
+ failed: "failed";
254
+ inconclusive: "inconclusive";
255
+ }>;
256
+ confidence: z.ZodNullable<z.ZodNumber>;
257
+ reason: z.ZodString;
258
+ rubricVersion: z.ZodNullable<z.ZodString>;
259
+ rubricHash: z.ZodNullable<z.ZodString>;
260
+ outcome: z.ZodArray<z.ZodObject<{
261
+ eventSeq: z.ZodNumber;
262
+ type: z.ZodString;
263
+ passed: z.ZodBoolean;
264
+ }, z.core.$strict>>;
265
+ reviewStatus: z.ZodEnum<{
266
+ recorded: "recorded";
267
+ pending: "pending";
268
+ deterministic: "deterministic";
269
+ }>;
270
+ }, z.core.$strict>>;
271
+ reviewer: z.ZodArray<z.ZodObject<{
272
+ eventSeq: z.ZodNumber;
273
+ status: z.ZodEnum<{
274
+ completed: "completed";
275
+ incomplete: "incomplete";
276
+ skipped: "skipped";
277
+ }>;
278
+ reason: z.ZodString;
279
+ failureType: z.ZodNullable<z.ZodString>;
280
+ rubricVersion: z.ZodNullable<z.ZodString>;
281
+ rubricHash: z.ZodNullable<z.ZodString>;
282
+ }, z.core.$strict>>;
283
+ }, z.core.$strict>>;
284
+ observation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
285
+ evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
286
+ path: z.ZodString;
287
+ actor: z.ZodNullable<z.ZodString>;
288
+ view: z.ZodNullable<z.ZodString>;
289
+ step: z.ZodNullable<z.ZodString>;
290
+ eventSeq: z.ZodNumber;
291
+ }, z.core.$strict>>>;
292
+ }, z.core.$strict>, z.ZodObject<{
293
+ kind: z.ZodLiteral<"classifier-usage">;
294
+ attemptId: z.ZodString;
295
+ usage: z.ZodArray<z.ZodObject<{
296
+ inputTokens: z.ZodNumber;
297
+ outputTokens: z.ZodNumber;
298
+ cacheReadTokens: z.ZodOptional<z.ZodNumber>;
299
+ cacheWriteTokens: z.ZodOptional<z.ZodNumber>;
300
+ costUsd: z.ZodOptional<z.ZodNumber>;
301
+ costUnknown: z.ZodOptional<z.ZodLiteral<true>>;
302
+ model: z.ZodOptional<z.ZodObject<{
303
+ provider: z.ZodNullable<z.ZodString>;
304
+ model: z.ZodNullable<z.ZodString>;
305
+ deployment: z.ZodOptional<z.ZodString>;
306
+ promptVersion: z.ZodOptional<z.ZodString>;
307
+ promptHash: z.ZodOptional<z.ZodString>;
308
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
309
+ seed: z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
310
+ unknown: "unknown";
311
+ unsupported: "unsupported";
312
+ }>]>;
313
+ billingVersion: z.ZodNullable<z.ZodString>;
314
+ }, z.core.$strict>>;
315
+ billingMode: z.ZodOptional<z.ZodEnum<{
316
+ subscription: "subscription";
317
+ metered: "metered";
318
+ }>>;
319
+ costUnknownReason: z.ZodOptional<z.ZodEnum<{
320
+ subscription: "subscription";
321
+ unpriced: "unpriced";
322
+ "usage-unavailable": "usage-unavailable";
323
+ "billing-unrecorded": "billing-unrecorded";
324
+ }>>;
325
+ }, z.core.$strict>>;
326
+ }, z.core.$strict>, z.ZodObject<{
327
+ kind: z.ZodLiteral<"trial-finished">;
328
+ index: z.ZodNumber;
329
+ attemptId: z.ZodString;
330
+ quarantined: z.ZodBoolean;
331
+ }, z.core.$strict>, z.ZodObject<{
332
+ kind: z.ZodLiteral<"group-finished">;
333
+ at: z.ZodNumber;
334
+ }, z.core.$strict>], "kind">;
335
+ export type TrialGroup = z.infer<typeof trialGroupSchema>;
336
+ export type TrialReceipt = z.infer<typeof trialReceiptSchema>;
337
+ export interface TrialHistory {
338
+ group: TrialGroup;
339
+ receipts: TrialReceipt[];
340
+ }
341
+ export interface TrialAuditStore {
342
+ create(group: TrialGroup): Promise<void>;
343
+ append(groupId: string, receipt: TrialReceipt): Promise<void>;
344
+ list(flow?: string): Promise<TrialGroup[]>;
345
+ get(groupId: string): Promise<TrialHistory | undefined>;
346
+ }
347
+ export declare function trialReceiptKey(group: TrialGroup, receipt: TrialReceipt): string;
348
+ export declare function summarizeTrial({ group, receipts }: TrialHistory): {
349
+ group: {
350
+ schemaVersion: 1;
351
+ groupId: string;
352
+ projectId: string;
353
+ batchId: string;
354
+ caseId: string;
355
+ flow: string;
356
+ caseRevision: string;
357
+ target: string;
358
+ targetRevision: string | null;
359
+ generation: number | null;
360
+ planned: number;
361
+ startedAt: number;
362
+ environment: Record<string, z.core.util.JSONType>;
363
+ independent?: boolean | undefined;
364
+ quarantinePolicy?: {
365
+ expiresAfterHours: number;
366
+ evidenceMaxAgeHours: number;
367
+ minimumPassedTrials: number;
368
+ flakyStreak: number;
369
+ } | undefined;
370
+ };
371
+ finishedAt: number | null;
372
+ counts: {
373
+ passed: number;
374
+ failed: number;
375
+ blocked: number;
376
+ error: number;
377
+ inconclusive: number;
378
+ canceled: number;
379
+ skipped: number;
380
+ pending: number;
381
+ notRun: number;
382
+ };
383
+ completed: number;
384
+ confidence: {
385
+ method: string;
386
+ level: number;
387
+ comparable: boolean;
388
+ mixed: boolean;
389
+ assumptions: string;
390
+ };
391
+ first: {
392
+ passed: number;
393
+ n: number;
394
+ fraction: number | null;
395
+ interval: {
396
+ lower: number;
397
+ upper: number;
398
+ } | null;
399
+ };
400
+ final: {
401
+ passed: number;
402
+ n: number;
403
+ fraction: number | null;
404
+ interval: {
405
+ lower: number;
406
+ upper: number;
407
+ } | null;
408
+ };
409
+ trials: {
410
+ index: number;
411
+ executionId: string;
412
+ firstOutcome: string;
413
+ outcome: string;
414
+ quarantined: boolean | null;
415
+ attempts: {
416
+ trace: {
417
+ schemaVersion: 1;
418
+ projectId: string;
419
+ caseId: string;
420
+ caseRevision: string | null;
421
+ executionId: string;
422
+ attemptId: string;
423
+ attempt: number;
424
+ started: boolean;
425
+ retryOf: string | null;
426
+ batchId: string | null;
427
+ trial: {
428
+ groupId: string;
429
+ index: number;
430
+ count: number;
431
+ } | null;
432
+ target: string | null;
433
+ targetRevision: string | null;
434
+ commit: string | null;
435
+ parameters: {
436
+ runtime: "claude-code" | "codex" | "scripted" | "pi" | null;
437
+ modelAccess: "env" | "login" | "personal" | "team" | null;
438
+ placement: "local-host" | "e2b" | null;
439
+ agentAt: "host" | "stage" | null;
440
+ headed: boolean | null;
441
+ level: "semantic" | "pixel" | "hybrid" | null;
442
+ device: string | null;
443
+ persona: string | null;
444
+ replay: "off" | "enabled" | null;
445
+ };
446
+ parameterFingerprint: string;
447
+ environmentFingerprint: string;
448
+ acceptance?: {
449
+ source: string;
450
+ revision: string;
451
+ criteria: {
452
+ id: string;
453
+ text: string;
454
+ source?: string | undefined;
455
+ }[];
456
+ flows: {
457
+ flow: string;
458
+ covers: string[];
459
+ }[];
460
+ } | undefined;
461
+ covers?: string[] | undefined;
462
+ traceability?: {
463
+ caseId?: string | undefined;
464
+ risk?: string | undefined;
465
+ owner?: string | undefined;
466
+ } | undefined;
467
+ context?: {
468
+ device?: string | undefined;
469
+ ci?: {
470
+ pipeline?: string | undefined;
471
+ task?: string | undefined;
472
+ runId?: string | undefined;
473
+ runUrl?: string | undefined;
474
+ } | undefined;
475
+ build?: {
476
+ id?: string | undefined;
477
+ url?: string | undefined;
478
+ } | undefined;
479
+ correlation?: {
480
+ traceId?: string | undefined;
481
+ spanId?: string | undefined;
482
+ requestId?: string | undefined;
483
+ } | undefined;
484
+ productPr?: {
485
+ url: string;
486
+ base?: string | undefined;
487
+ head?: string | undefined;
488
+ revision?: string | undefined;
489
+ } | undefined;
490
+ qa?: {
491
+ issue?: string | undefined;
492
+ pr?: string | undefined;
493
+ } | undefined;
494
+ defects?: {
495
+ url: string;
496
+ acceptance: string[];
497
+ }[] | undefined;
498
+ } | undefined;
499
+ outcome?: "skipped" | "blocked" | "not-run" | "expected-failure" | undefined;
500
+ engineResult?: {
501
+ verdict: "error" | "passed" | "failed" | "inconclusive" | "canceled";
502
+ reason: string | null;
503
+ finishedAt: number;
504
+ } | undefined;
505
+ evidence?: {
506
+ path: string;
507
+ actor: string | null;
508
+ view: string | null;
509
+ step: string | null;
510
+ eventSeq: number;
511
+ }[] | undefined;
512
+ };
513
+ result: {
514
+ kind: "attempt-finished";
515
+ attemptId: string;
516
+ at: number;
517
+ verdict: "error" | "passed" | "failed" | "inconclusive" | "canceled";
518
+ outcome?: "skipped" | "blocked" | "not-run" | "expected-failure" | undefined;
519
+ usage?: {
520
+ inputTokens: number;
521
+ outputTokens: number;
522
+ actions: number;
523
+ minutes: number;
524
+ cacheReadTokens?: number | undefined;
525
+ cacheWriteTokens?: number | undefined;
526
+ costUsd?: number | undefined;
527
+ costUnknown?: true | undefined;
528
+ e2bMinutes?: number | undefined;
529
+ } | undefined;
530
+ audit?: {
531
+ schemaVersion: 1;
532
+ usage: {
533
+ inputTokens: number;
534
+ outputTokens: number;
535
+ role: "heal" | "main" | "judge" | "reviewer" | "classifier";
536
+ billing: "subscription" | "metered" | null;
537
+ cacheReadTokens?: number | undefined;
538
+ cacheWriteTokens?: number | undefined;
539
+ costUsd?: number | undefined;
540
+ costUnknown?: true | undefined;
541
+ model?: {
542
+ provider: string | null;
543
+ model: string | null;
544
+ seed: number | "unknown" | "unsupported";
545
+ billingVersion: string | null;
546
+ deployment?: string | undefined;
547
+ promptVersion?: string | undefined;
548
+ promptHash?: string | undefined;
549
+ parameters?: Record<string, z.core.util.JSONType> | undefined;
550
+ } | undefined;
551
+ billingMode?: "subscription" | "metered" | undefined;
552
+ costUnknownReason?: "subscription" | "unpriced" | "usage-unavailable" | "billing-unrecorded" | undefined;
553
+ actor?: string | undefined;
554
+ step?: string | undefined;
555
+ }[];
556
+ judges: {
557
+ eventSeq: number;
558
+ actor: string | null;
559
+ step: string | null;
560
+ verdict: "passed" | "failed" | "inconclusive";
561
+ confidence: number | null;
562
+ reason: string;
563
+ rubricVersion: string | null;
564
+ rubricHash: string | null;
565
+ outcome: {
566
+ eventSeq: number;
567
+ type: string;
568
+ passed: boolean;
569
+ }[];
570
+ reviewStatus: "recorded" | "pending" | "deterministic";
571
+ }[];
572
+ reviewer: {
573
+ eventSeq: number;
574
+ status: "completed" | "incomplete" | "skipped";
575
+ reason: string;
576
+ failureType: string | null;
577
+ rubricVersion: string | null;
578
+ rubricHash: string | null;
579
+ }[];
580
+ environment?: {
581
+ image: {
582
+ template: string | null;
583
+ digest: string | null;
584
+ };
585
+ runtime: string | null;
586
+ views: {
587
+ view: string;
588
+ browser: string | null;
589
+ viewport: {
590
+ width: number;
591
+ height: number;
592
+ } | null;
593
+ device: string | null;
594
+ }[];
595
+ } | undefined;
596
+ } | undefined;
597
+ observation?: Record<string, z.core.util.JSONType> | undefined;
598
+ evidence?: {
599
+ path: string;
600
+ actor: string | null;
601
+ view: string | null;
602
+ step: string | null;
603
+ eventSeq: number;
604
+ }[] | undefined;
605
+ } | null;
606
+ classifierUsage: {
607
+ inputTokens: number;
608
+ outputTokens: number;
609
+ cacheReadTokens?: number | undefined;
610
+ cacheWriteTokens?: number | undefined;
611
+ costUsd?: number | undefined;
612
+ costUnknown?: true | undefined;
613
+ model?: {
614
+ provider: string | null;
615
+ model: string | null;
616
+ seed: number | "unknown" | "unsupported";
617
+ billingVersion: string | null;
618
+ deployment?: string | undefined;
619
+ promptVersion?: string | undefined;
620
+ promptHash?: string | undefined;
621
+ parameters?: Record<string, z.core.util.JSONType> | undefined;
622
+ } | undefined;
623
+ billingMode?: "subscription" | "metered" | undefined;
624
+ costUnknownReason?: "subscription" | "unpriced" | "usage-unavailable" | "billing-unrecorded" | undefined;
625
+ }[];
626
+ outcome: string;
627
+ }[];
628
+ }[];
629
+ };
630
+ export declare function printTrial(summary: ReturnType<typeof summarizeTrial>, output: (line: string) => void): void;