bridgebench 3.1.0-alpha.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.
Files changed (86) hide show
  1. package/CITATION.cff +15 -0
  2. package/LICENSE +21 -0
  3. package/README.md +249 -0
  4. package/dist/chunk-4TWPCPRP.cjs +1097 -0
  5. package/dist/chunk-4TWPCPRP.cjs.map +1 -0
  6. package/dist/chunk-7YCJSOK7.cjs +398 -0
  7. package/dist/chunk-7YCJSOK7.cjs.map +1 -0
  8. package/dist/chunk-CIXITJW6.cjs +249 -0
  9. package/dist/chunk-CIXITJW6.cjs.map +1 -0
  10. package/dist/chunk-EQHRUV2I.js +1466 -0
  11. package/dist/chunk-EQHRUV2I.js.map +1 -0
  12. package/dist/chunk-JTVNKSMO.js +1096 -0
  13. package/dist/chunk-JTVNKSMO.js.map +1 -0
  14. package/dist/chunk-LFKEV2YL.js +398 -0
  15. package/dist/chunk-LFKEV2YL.js.map +1 -0
  16. package/dist/chunk-NJTYVNP4.cjs +1467 -0
  17. package/dist/chunk-NJTYVNP4.cjs.map +1 -0
  18. package/dist/chunk-UECBSKTD.js +244 -0
  19. package/dist/chunk-UECBSKTD.js.map +1 -0
  20. package/dist/cli.cjs +409 -0
  21. package/dist/cli.cjs.map +1 -0
  22. package/dist/cli.d.cts +1 -0
  23. package/dist/cli.d.ts +1 -0
  24. package/dist/cli.js +408 -0
  25. package/dist/cli.js.map +1 -0
  26. package/dist/client.cjs +42 -0
  27. package/dist/client.cjs.map +1 -0
  28. package/dist/client.d.cts +93 -0
  29. package/dist/client.d.ts +93 -0
  30. package/dist/client.js +42 -0
  31. package/dist/client.js.map +1 -0
  32. package/dist/contracts/index.cjs +47 -0
  33. package/dist/contracts/index.cjs.map +1 -0
  34. package/dist/contracts/index.d.cts +14 -0
  35. package/dist/contracts/index.d.ts +14 -0
  36. package/dist/contracts/index.js +47 -0
  37. package/dist/contracts/index.js.map +1 -0
  38. package/dist/index.cjs +171 -0
  39. package/dist/index.cjs.map +1 -0
  40. package/dist/index.d.cts +214 -0
  41. package/dist/index.d.ts +214 -0
  42. package/dist/index.js +171 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/logger-CCR9Mg1c.d.cts +319 -0
  45. package/dist/logger-QJU7SBDz.d.ts +319 -0
  46. package/dist/reports-4CejmOHf.d.cts +454 -0
  47. package/dist/reports-s2CTnGN8.d.ts +454 -0
  48. package/dist/tasks-CpaCJ6JE.d.cts +151 -0
  49. package/dist/tasks-CpaCJ6JE.d.ts +151 -0
  50. package/dist/tasks.cjs +22 -0
  51. package/dist/tasks.cjs.map +1 -0
  52. package/dist/tasks.d.cts +39 -0
  53. package/dist/tasks.d.ts +39 -0
  54. package/dist/tasks.js +22 -0
  55. package/dist/tasks.js.map +1 -0
  56. package/docs/README.md +25 -0
  57. package/docs/glossary.md +49 -0
  58. package/docs/methodology.md +58 -0
  59. package/docs/private-packs.md +74 -0
  60. package/docs/replay-elo.md +79 -0
  61. package/docs/task-authoring.md +80 -0
  62. package/package.json +137 -0
  63. package/tasks/hallucination/public/boundary-coverage-audit.yaml +274 -0
  64. package/tasks/hallucination/public/boundary-migration-audit.yaml +284 -0
  65. package/tasks/hallucination/public/conflict-dependency-versions.yaml +324 -0
  66. package/tasks/hallucination/public/conflict-runbook-versions.yaml +229 -0
  67. package/tasks/hallucination/public/fabrication-agent-tools.yaml +224 -0
  68. package/tasks/hallucination/public/fabrication-api-surface.yaml +239 -0
  69. package/tasks/hallucination/public/fidelity-commit-attribution.yaml +304 -0
  70. package/tasks/hallucination/public/fidelity-config-drift.yaml +307 -0
  71. package/tasks/hallucination/public/missing-deploy-window.yaml +204 -0
  72. package/tasks/hallucination/public/missing-latency-baseline.yaml +239 -0
  73. package/tasks/hallucination/public/premise-quota-breach.yaml +202 -0
  74. package/tasks/hallucination/public/premise-rollback-cause.yaml +235 -0
  75. package/tasks/reasoning/public/constraint-capacity-allocation.yaml +196 -0
  76. package/tasks/reasoning/public/constraint-deployment-policy.yaml +203 -0
  77. package/tasks/reasoning/public/counterexample-authorization-rule.yaml +278 -0
  78. package/tasks/reasoning/public/counterexample-scheduler-starvation.yaml +290 -0
  79. package/tasks/reasoning/public/root-cache-tenant-leak.yaml +225 -0
  80. package/tasks/reasoning/public/root-event-ordering.yaml +184 -0
  81. package/tasks/reasoning/public/stateful-lease-handoff.yaml +213 -0
  82. package/tasks/reasoning/public/stateful-retry-budget.yaml +222 -0
  83. package/tasks/reasoning/public/synthesis-api-contract.yaml +214 -0
  84. package/tasks/reasoning/public/synthesis-permission-migration.yaml +190 -0
  85. package/tasks/reasoning/public/uncertainty-conflicting-telemetry.yaml +242 -0
  86. package/tasks/reasoning/public/uncertainty-incomplete-incident.yaml +223 -0
@@ -0,0 +1,454 @@
1
+ import { B as BenchmarkCategory } from './tasks-CpaCJ6JE.cjs';
2
+ import { z } from 'zod';
3
+
4
+ interface ResponseSummary {
5
+ success: boolean;
6
+ latencyMs: number;
7
+ costUsd: number;
8
+ outputTokens: number;
9
+ reasoningTokens: number | null;
10
+ }
11
+ interface ArenaEventDataMap {
12
+ 'run.started': {
13
+ runId: string;
14
+ category: BenchmarkCategory;
15
+ seed: string;
16
+ matches: number;
17
+ maxCostUsd: number;
18
+ competitorIds: string[];
19
+ };
20
+ 'match.started': {
21
+ matchId: string;
22
+ index: number;
23
+ total: number;
24
+ category: BenchmarkCategory;
25
+ taskId: string;
26
+ taskTitle: string;
27
+ modelA: string;
28
+ modelB: string;
29
+ };
30
+ 'competitor.delta': {
31
+ matchId: string;
32
+ modelId: string;
33
+ side: 'A' | 'B';
34
+ text: string;
35
+ done: boolean;
36
+ success: boolean;
37
+ };
38
+ 'competitors.completed': {
39
+ matchId: string;
40
+ modelA: ResponseSummary;
41
+ modelB: ResponseSummary;
42
+ };
43
+ 'judging.started': {
44
+ matchId: string;
45
+ judges: string[];
46
+ };
47
+ 'judge.completed': {
48
+ matchId: string;
49
+ judgeModelId: string;
50
+ anonymousWinner: 'MODEL_A' | 'MODEL_B' | null;
51
+ votedFor: string | null;
52
+ confidence: number | null;
53
+ valid: boolean;
54
+ error: string | null;
55
+ };
56
+ 'match.completed': {
57
+ matchId: string;
58
+ taskId: string;
59
+ winnerModelId: string | null;
60
+ outcome: 'judged' | 'forfeit' | 'no-contest';
61
+ costUsd: number;
62
+ eloAfter: Record<string, number>;
63
+ completed: number;
64
+ total: number;
65
+ };
66
+ 'run.budget-stopped': {
67
+ runId: string;
68
+ completed: number;
69
+ costUsd: number;
70
+ maxCostUsd: number;
71
+ };
72
+ 'run.cancellation-requested': {
73
+ runId: string;
74
+ completed: number;
75
+ costUsd: number;
76
+ };
77
+ 'run.cancelled': {
78
+ runId: string;
79
+ completed: number;
80
+ costUsd: number;
81
+ };
82
+ 'run.completed': {
83
+ runId: string;
84
+ completed: number;
85
+ costUsd: number;
86
+ stoppedForBudget: boolean;
87
+ };
88
+ 'run.failed': {
89
+ error: string;
90
+ };
91
+ }
92
+ type ArenaEventType = keyof ArenaEventDataMap;
93
+ type ArenaEvent = {
94
+ [Type in ArenaEventType]: {
95
+ id: string;
96
+ type: Type;
97
+ timestamp: string;
98
+ data: ArenaEventDataMap[Type];
99
+ };
100
+ }[ArenaEventType];
101
+ type ArenaEventInput = {
102
+ [Type in ArenaEventType]: Omit<Extract<ArenaEvent, {
103
+ type: Type;
104
+ }>, 'timestamp'>;
105
+ }[ArenaEventType];
106
+ type ArenaEventSink = (event: ArenaEvent) => void;
107
+
108
+ declare const ModelRoleSchema: z.ZodEnum<["competitor", "judge"]>;
109
+ type ModelRole = z.infer<typeof ModelRoleSchema>;
110
+ interface ModelRequestPolicy {
111
+ maxTokens: number;
112
+ temperature: number;
113
+ reasoningEffort: 'high' | 'medium' | 'low';
114
+ excludeReasoning: boolean;
115
+ timeoutMs: number;
116
+ }
117
+ interface ModelRegistryEntry {
118
+ id: string;
119
+ canonicalSlug: string;
120
+ displayName: string;
121
+ vendor: string;
122
+ role: ModelRole;
123
+ enabled: boolean;
124
+ request: ModelRequestPolicy;
125
+ }
126
+ declare const ModelCompletionSchema: z.ZodObject<{
127
+ generationId: z.ZodString;
128
+ content: z.ZodString;
129
+ inputTokens: z.ZodNumber;
130
+ outputTokens: z.ZodNumber;
131
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
132
+ costUsd: z.ZodNumber;
133
+ latencyMs: z.ZodNumber;
134
+ finishReason: z.ZodString;
135
+ attempts: z.ZodOptional<z.ZodNumber>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ generationId: string;
138
+ content: string;
139
+ inputTokens: number;
140
+ outputTokens: number;
141
+ costUsd: number;
142
+ latencyMs: number;
143
+ finishReason: string;
144
+ reasoningTokens?: number | undefined;
145
+ attempts?: number | undefined;
146
+ }, {
147
+ generationId: string;
148
+ content: string;
149
+ inputTokens: number;
150
+ outputTokens: number;
151
+ costUsd: number;
152
+ latencyMs: number;
153
+ finishReason: string;
154
+ reasoningTokens?: number | undefined;
155
+ attempts?: number | undefined;
156
+ }>;
157
+ type ModelCompletion = z.infer<typeof ModelCompletionSchema>;
158
+ interface ChatRequest {
159
+ model: ModelRegistryEntry;
160
+ system: string;
161
+ user: string;
162
+ structured?: boolean;
163
+ /** Execution-only cancellation; never serialized into a run manifest or provider payload. */
164
+ signal?: AbortSignal;
165
+ /** Called with the accumulated visible text as it streams in (throttled). */
166
+ onDelta?: (text: string) => void;
167
+ }
168
+ interface OpenRouterGateway {
169
+ complete(request: ChatRequest): Promise<ModelCompletion>;
170
+ validateModel(model: ModelRegistryEntry, signal?: AbortSignal): Promise<void>;
171
+ }
172
+
173
+ interface ArenaRunConfig {
174
+ category: BenchmarkCategory;
175
+ seed: string;
176
+ matches: number;
177
+ maxCostUsd: number;
178
+ resume: boolean;
179
+ /** Omit to use every enabled competitor in the registry. */
180
+ competitorIds?: readonly string[];
181
+ /** Abort early when most matches contain a failed response. */
182
+ healthStop?: boolean;
183
+ }
184
+ interface ArenaExecutionOptions {
185
+ /** Execution-only cancellation; deliberately excluded from the canonical manifest. */
186
+ signal?: AbortSignal;
187
+ /**
188
+ * Invoked after each match result is journaled, before the next match
189
+ * starts. Used to publish results incrementally instead of only at run end.
190
+ * Must not throw; handle and log failures internally.
191
+ */
192
+ onMatchResult?: (result: MatchResult) => Promise<void> | void;
193
+ }
194
+ interface ArenaRunResult {
195
+ runId: string;
196
+ completed: number;
197
+ costUsd: number;
198
+ stoppedForBudget: boolean;
199
+ cancelled: boolean;
200
+ }
201
+ interface ScheduledMatch {
202
+ id: string;
203
+ runId: string;
204
+ index: number;
205
+ seed: string;
206
+ category: BenchmarkCategory;
207
+ taskId: string;
208
+ modelA: string;
209
+ modelB: string;
210
+ }
211
+ declare const CompetitorSuccessSchema: z.ZodObject<{
212
+ generationId: z.ZodString;
213
+ content: z.ZodString;
214
+ inputTokens: z.ZodNumber;
215
+ outputTokens: z.ZodNumber;
216
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
217
+ costUsd: z.ZodNumber;
218
+ latencyMs: z.ZodNumber;
219
+ finishReason: z.ZodString;
220
+ attempts: z.ZodOptional<z.ZodNumber>;
221
+ } & {
222
+ modelId: z.ZodString;
223
+ success: z.ZodLiteral<true>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ generationId: string;
226
+ content: string;
227
+ inputTokens: number;
228
+ outputTokens: number;
229
+ costUsd: number;
230
+ latencyMs: number;
231
+ finishReason: string;
232
+ modelId: string;
233
+ success: true;
234
+ reasoningTokens?: number | undefined;
235
+ attempts?: number | undefined;
236
+ }, {
237
+ generationId: string;
238
+ content: string;
239
+ inputTokens: number;
240
+ outputTokens: number;
241
+ costUsd: number;
242
+ latencyMs: number;
243
+ finishReason: string;
244
+ modelId: string;
245
+ success: true;
246
+ reasoningTokens?: number | undefined;
247
+ attempts?: number | undefined;
248
+ }>;
249
+ type CompetitorSuccess = z.infer<typeof CompetitorSuccessSchema>;
250
+ declare const CompetitorFailureSchema: z.ZodObject<{
251
+ modelId: z.ZodString;
252
+ success: z.ZodLiteral<false>;
253
+ error: z.ZodString;
254
+ latencyMs: z.ZodNumber;
255
+ attempts: z.ZodOptional<z.ZodNumber>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ latencyMs: number;
258
+ modelId: string;
259
+ success: false;
260
+ error: string;
261
+ attempts?: number | undefined;
262
+ }, {
263
+ latencyMs: number;
264
+ modelId: string;
265
+ success: false;
266
+ error: string;
267
+ attempts?: number | undefined;
268
+ }>;
269
+ type CompetitorFailure = z.infer<typeof CompetitorFailureSchema>;
270
+ type CompetitorResponse = CompetitorSuccess | CompetitorFailure;
271
+ declare const CompetitorResponseSchema: z.ZodType<CompetitorResponse>;
272
+ declare const JudgeVerdictSchema: z.ZodObject<{
273
+ winner: z.ZodEnum<["MODEL_A", "MODEL_B"]>;
274
+ confidence: z.ZodNumber;
275
+ rationale: z.ZodString;
276
+ criteria: z.ZodObject<{
277
+ correctness: z.ZodString;
278
+ grounding: z.ZodString;
279
+ constraintHandling: z.ZodString;
280
+ completeness: z.ZodString;
281
+ }, "strip", z.ZodTypeAny, {
282
+ correctness: string;
283
+ grounding: string;
284
+ constraintHandling: string;
285
+ completeness: string;
286
+ }, {
287
+ correctness: string;
288
+ grounding: string;
289
+ constraintHandling: string;
290
+ completeness: string;
291
+ }>;
292
+ violations: z.ZodArray<z.ZodString, "many">;
293
+ }, "strip", z.ZodTypeAny, {
294
+ winner: "MODEL_A" | "MODEL_B";
295
+ confidence: number;
296
+ rationale: string;
297
+ criteria: {
298
+ correctness: string;
299
+ grounding: string;
300
+ constraintHandling: string;
301
+ completeness: string;
302
+ };
303
+ violations: string[];
304
+ }, {
305
+ winner: "MODEL_A" | "MODEL_B";
306
+ confidence: number;
307
+ rationale: string;
308
+ criteria: {
309
+ correctness: string;
310
+ grounding: string;
311
+ constraintHandling: string;
312
+ completeness: string;
313
+ };
314
+ violations: string[];
315
+ }>;
316
+ type JudgeVerdict = z.infer<typeof JudgeVerdictSchema>;
317
+ /**
318
+ * Provider-safe JSON Schema subset generated from the same verdict shape.
319
+ * Runtime Zod parsing above enforces the local string and array limits.
320
+ */
321
+ declare const JUDGE_VERDICT_TRANSPORT_SCHEMA: {
322
+ readonly type: "object";
323
+ readonly additionalProperties: false;
324
+ readonly required: readonly ["winner", "confidence", "rationale", "criteria", "violations"];
325
+ readonly properties: {
326
+ readonly winner: {
327
+ readonly type: "string";
328
+ readonly enum: readonly ["MODEL_A", "MODEL_B"];
329
+ };
330
+ readonly confidence: {
331
+ readonly type: "number";
332
+ readonly minimum: 0;
333
+ readonly maximum: 1;
334
+ };
335
+ readonly rationale: {
336
+ readonly type: "string";
337
+ };
338
+ readonly criteria: {
339
+ readonly type: "object";
340
+ readonly additionalProperties: false;
341
+ readonly required: readonly ["correctness", "grounding", "constraintHandling", "completeness"];
342
+ readonly properties: {
343
+ readonly correctness: {
344
+ readonly type: "string";
345
+ };
346
+ readonly grounding: {
347
+ readonly type: "string";
348
+ };
349
+ readonly constraintHandling: {
350
+ readonly type: "string";
351
+ };
352
+ readonly completeness: {
353
+ readonly type: "string";
354
+ };
355
+ };
356
+ };
357
+ readonly violations: {
358
+ readonly type: "array";
359
+ readonly items: {
360
+ readonly type: "string";
361
+ };
362
+ };
363
+ };
364
+ };
365
+ interface JudgeVote {
366
+ judgeModelId: string;
367
+ modelAIdentity: string;
368
+ modelBIdentity: string;
369
+ verdict: JudgeVerdict | null;
370
+ winnerModelId: string | null;
371
+ completion: ModelCompletion | null;
372
+ error?: string;
373
+ }
374
+ interface PanelDecision {
375
+ winnerModelId: string | null;
376
+ validVotes: number;
377
+ votesByModel: Record<string, number>;
378
+ agreement: 'unanimous' | 'split' | 'insufficient';
379
+ votes: JudgeVote[];
380
+ }
381
+ interface EloState {
382
+ ratings: Record<string, number>;
383
+ points: Record<string, number>;
384
+ }
385
+ interface MatchResult {
386
+ methodologyVersion: string;
387
+ runId: string;
388
+ /** Absent on legacy journal lines written before run manifests. */
389
+ runManifestHash?: string;
390
+ matchId: string;
391
+ scheduleIndex: number;
392
+ seed: string;
393
+ timestamp: string;
394
+ task: {
395
+ id: string;
396
+ version: string;
397
+ /** Absent on reasoning-only legacy lines. */
398
+ category?: BenchmarkCategory;
399
+ cluster: string;
400
+ publicHash: string;
401
+ privateHash: string;
402
+ };
403
+ competitors: {
404
+ modelA: string;
405
+ modelB: string;
406
+ responseA: CompetitorResponse;
407
+ responseB: CompetitorResponse;
408
+ };
409
+ outcome: 'judged' | 'forfeit' | 'no-contest';
410
+ winnerModelId: string | null;
411
+ panel: PanelDecision | null;
412
+ eloBefore: Record<string, number>;
413
+ eloAfter: Record<string, number>;
414
+ pointAwarded: boolean;
415
+ matchCostUsd: number;
416
+ }
417
+ declare const JudgeVoteSchema: z.ZodType<JudgeVote>;
418
+ declare const PanelDecisionSchema: z.ZodType<PanelDecision>;
419
+ declare const MatchResultSchema: z.ZodType<MatchResult>;
420
+ declare function competitorCost(response: CompetitorResponse): number;
421
+ declare function competitorOutputTokens(response: CompetitorResponse): number;
422
+ declare function competitorReasoningTokens(response: CompetitorResponse): number | undefined;
423
+ declare function competitorContent(response: CompetitorResponse): string;
424
+
425
+ interface LeaderboardEntry {
426
+ rank: number;
427
+ modelId: string;
428
+ displayName: string;
429
+ elo: number;
430
+ points: number;
431
+ wins: number;
432
+ losses: number;
433
+ forfeits: number;
434
+ matches: number;
435
+ winRate: number;
436
+ unanimousWins: number;
437
+ totalCostUsd: number;
438
+ byCluster: Partial<Record<string, {
439
+ wins: number;
440
+ losses: number;
441
+ }>>;
442
+ }
443
+ interface ArenaSnapshot {
444
+ version: '0.2.0';
445
+ methodologyVersion: string;
446
+ category: BenchmarkCategory;
447
+ generatedAt: string;
448
+ initialElo: number;
449
+ kFactor: number;
450
+ leaderboard: LeaderboardEntry[];
451
+ matches: MatchResult[];
452
+ }
453
+
454
+ export { type ArenaEvent as A, competitorOutputTokens as B, type ChatRequest as C, competitorReasoningTokens as D, type EloState as E, JUDGE_VERDICT_TRANSPORT_SCHEMA as J, type LeaderboardEntry as L, type MatchResult as M, type OpenRouterGateway as O, type PanelDecision as P, type ScheduledMatch as S, type ArenaEventDataMap as a, type ArenaEventInput as b, type ArenaEventSink as c, type ArenaEventType as d, type ArenaExecutionOptions as e, type ArenaRunConfig as f, type ArenaRunResult as g, type ArenaSnapshot as h, type CompetitorFailure as i, type CompetitorResponse as j, CompetitorResponseSchema as k, type CompetitorSuccess as l, type JudgeVerdict as m, JudgeVerdictSchema as n, type JudgeVote as o, JudgeVoteSchema as p, MatchResultSchema as q, type ModelCompletion as r, ModelCompletionSchema as s, type ModelRegistryEntry as t, type ModelRequestPolicy as u, type ModelRole as v, ModelRoleSchema as w, PanelDecisionSchema as x, competitorContent as y, competitorCost as z };