peeksafe 0.0.0-stage → 0.2.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 (66) hide show
  1. package/CHANGELOG.md +325 -0
  2. package/LICENSE +190 -0
  3. package/NOTICE +78 -0
  4. package/README.md +490 -2
  5. package/RESEARCH-NOTES.md +274 -0
  6. package/dist/baseline.d.ts +45 -0
  7. package/dist/baseline.d.ts.map +1 -0
  8. package/dist/baseline.js +49 -0
  9. package/dist/baseline.js.map +1 -0
  10. package/dist/check.d.ts +64 -0
  11. package/dist/check.d.ts.map +1 -0
  12. package/dist/check.js +172 -0
  13. package/dist/check.js.map +1 -0
  14. package/dist/cluster.d.ts +328 -0
  15. package/dist/cluster.d.ts.map +1 -0
  16. package/dist/cluster.js +606 -0
  17. package/dist/cluster.js.map +1 -0
  18. package/dist/errors.d.ts +108 -0
  19. package/dist/errors.d.ts.map +1 -0
  20. package/dist/errors.js +192 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/evidence.d.ts +15 -0
  23. package/dist/evidence.d.ts.map +1 -0
  24. package/dist/evidence.js +30 -0
  25. package/dist/evidence.js.map +1 -0
  26. package/dist/frontier.d.ts +271 -0
  27. package/dist/frontier.d.ts.map +1 -0
  28. package/dist/frontier.js +505 -0
  29. package/dist/frontier.js.map +1 -0
  30. package/dist/gate.d.ts +175 -0
  31. package/dist/gate.d.ts.map +1 -0
  32. package/dist/gate.js +200 -0
  33. package/dist/gate.js.map +1 -0
  34. package/dist/index.d.ts +60 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +79 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/plan.d.ts +280 -0
  39. package/dist/plan.d.ts.map +1 -0
  40. package/dist/plan.js +626 -0
  41. package/dist/plan.js.map +1 -0
  42. package/dist/rand.d.ts +17 -0
  43. package/dist/rand.d.ts.map +1 -0
  44. package/dist/rand.js +104 -0
  45. package/dist/rand.js.map +1 -0
  46. package/dist/stats.d.ts +401 -0
  47. package/dist/stats.d.ts.map +1 -0
  48. package/dist/stats.js +1304 -0
  49. package/dist/stats.js.map +1 -0
  50. package/dist/stop.d.ts +164 -0
  51. package/dist/stop.d.ts.map +1 -0
  52. package/dist/stop.js +270 -0
  53. package/dist/stop.js.map +1 -0
  54. package/package.json +62 -3
  55. package/src/baseline.ts +72 -0
  56. package/src/check.ts +238 -0
  57. package/src/cluster.ts +842 -0
  58. package/src/errors.ts +275 -0
  59. package/src/evidence.ts +62 -0
  60. package/src/frontier.ts +837 -0
  61. package/src/gate.ts +363 -0
  62. package/src/index.ts +206 -0
  63. package/src/plan.ts +968 -0
  64. package/src/rand.ts +137 -0
  65. package/src/stats.ts +1663 -0
  66. package/src/stop.ts +464 -0
@@ -0,0 +1,505 @@
1
+ /**
2
+ * frontier.ts: what *is* certifiable at coding-agent prices, and how.
3
+ *
4
+ * ## Why this module exists
5
+ *
6
+ * At $1 a run a 200-case suite at a 15-point MDE is $1,320 a pull request, so
7
+ * peeksafe is not a per-PR gate for a coding-agent benchmark at that size. That
8
+ * is true and it is half an answer. The other half, the one a
9
+ * buyer actually needs, is **which configurations *are* affordable**, and
10
+ * nobody had drawn it.
11
+ *
12
+ * A configuration is a point in five dimensions:
13
+ *
14
+ * suite size m × MDE δ × design × screening × baseline runs n_b
15
+ *
16
+ * and it is usable only if it is *both* affordable and **certifiable**. Those
17
+ * are different constraints, and a plan that conflates them quotes the wrong
18
+ * numbers. Cheap is easy: run fewer cases. Cheap *and able to decide anything* is
19
+ * the hard part, because `evidenceCeilingLogE` says a case whose unpaired
20
+ * ceiling sits under the e-BH bar cannot be certified at any budget, and the
21
+ * bar `m/q` moves with the suite size, so shrinking the suite raises the
22
+ * ceiling's odds *and* lowers the bar at the same time. That interaction is not
23
+ * something you can eyeball.
24
+ *
25
+ * ## The cost model, and the term the plan was missing
26
+ *
27
+ * `plan.ts` prices an observation at one number, `costPerRunUsd`. That is wrong
28
+ * in two ways at coding-agent prices, and both matter:
29
+ *
30
+ * 1. **Grading is not free.** An LLM judge is a model call; a coding-agent
31
+ * grader is a test suite in a container. So
32
+ *
33
+ * cost(observation) = costPerRunUsd + costPerGradeUsd
34
+ *
35
+ * and the second term is the *only* one a cheap proxy grader can reduce.
36
+ * When `costPerGradeUsd` is 0, which is the default,
37
+ * matching this package's own free graders, a proxy screen saves exactly
38
+ * nothing, and this module says so instead of offering it as an economy.
39
+ *
40
+ * 2. **The baseline is not free either, and it is not amortised over
41
+ * infinity.** The README calls the baseline "amortised, you pay it once on
42
+ * main". At $0.002 a run that is a rounding error. At $1 a run, a 200-case
43
+ * suite with a 240-run baseline is 48,000 runs, **$48,000**, and spread
44
+ * over a hundred pull requests it is still $480 each, which is larger than
45
+ * everything else in the bill put together. The unpaired design's evidence
46
+ * ceiling is bought with baseline runs, so *the amortised baseline is the
47
+ * dominant cost of the unpaired design at coding-agent prices*, and the
48
+ * paired design's headline advantage is not variance reduction. It is that
49
+ * it does not need to buy a ceiling.
50
+ *
51
+ * ## What this module will not do
52
+ *
53
+ * It will not recommend a screened configuration whose **recall cost has not
54
+ * been measured**. Screening is the largest cost lever available and it is paid
55
+ * for in missed regressions, which the caller supplies as `screenRecall`
56
+ * against planted ground truth, and until someone has, the honest price of a
57
+ * screened plan is unknown rather than low.
58
+ */
59
+ import { PeeksafeError, requireErrorRates, requireOpenProbability, requireProbability, requireRunCeiling, requireTrialGrid, } from "./errors.js";
60
+ import { DEFAULT_PLAN, expectedSettlePairs, requireSettleConfidence } from "./plan.js";
61
+ import { betaQuantile, ebhSoloThreshold, evidenceCeilingLogE, mcnemarSamplesForEvidence, samplesForEvidence, sprtExpectedN, } from "./stats.js";
62
+ export const DEFAULT_AXES = {
63
+ cases: [10, 20, 50, 100, 200],
64
+ mdes: [0.1, 0.15, 0.25, 0.35],
65
+ baselineRuns: [30, 60, 120, 240, 480],
66
+ designs: ["unpaired", "paired"],
67
+ screens: ["none", "expensive", "proxy"],
68
+ screenRuns: [4, 8],
69
+ };
70
+ export const DEFAULT_FRONTIER = {
71
+ budgetUsd: 100,
72
+ basis: "typical",
73
+ costPerRunUsd: 1,
74
+ costPerGradeUsd: 0,
75
+ baselineRate: 0.85,
76
+ fdr: 0.05,
77
+ pairCoupling: DEFAULT_PLAN.pairCoupling,
78
+ amortisePrs: 100,
79
+ pairedBaselineRuns: 20,
80
+ screenKeepFraction: 0.15,
81
+ runsPerCaseCeiling: DEFAULT_PLAN.runsPerCaseCeiling,
82
+ screenRecall: { expensive: null, proxy: null },
83
+ screenRecallSource: "not measured",
84
+ alpha: DEFAULT_PLAN.alpha,
85
+ beta: DEFAULT_PLAN.beta,
86
+ minTrials: DEFAULT_PLAN.minTrials,
87
+ maxTrials: DEFAULT_PLAN.maxTrials,
88
+ batchSize: DEFAULT_PLAN.batchSize,
89
+ nullQuantile: DEFAULT_PLAN.nullQuantile,
90
+ };
91
+ const RUNS_PER_OBS = { unpaired: 1, paired: 2 };
92
+ const SCREENS = ["none", "expensive", "proxy"];
93
+ /** $1.00, but $0.0021 rather than $0.00, a per-run price rounds to nothing. */
94
+ export const fmtRate = (x) => !Number.isFinite(x)
95
+ ? Number.isNaN(x)
96
+ ? "$?"
97
+ : "$∞"
98
+ : x >= 0.01 || x === 0
99
+ ? `$${x.toFixed(2)}`
100
+ : `$${x.toPrecision(2)}`;
101
+ /** Cost of `runs` runs, all of them graded by the real grader. */
102
+ const graded = (runs, cfg) => runs * (cfg.costPerRunUsd + cfg.costPerGradeUsd);
103
+ function requireBaselineRuns(v, name, where) {
104
+ if (!Number.isInteger(v) || v < 1) {
105
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `${where}: ${name} must be a positive integer, got ${v}`, {
106
+ detail: { [name]: v, where },
107
+ });
108
+ }
109
+ }
110
+ /**
111
+ * The budget, the prices, the screen's keep fraction and `amortisePrs`.
112
+ * `enumerateFrontier` checked these and `evaluatePoint` did not, so a direct
113
+ * call recommended a point at a negative bill and priced a screen that kept
114
+ * twice the suite.
115
+ */
116
+ function requirePricing(cfg, where) {
117
+ const finiteCost = (v) => Number.isFinite(v) && v >= 0;
118
+ if (!(cfg.budgetUsd >= 0) || !finiteCost(cfg.costPerRunUsd) || !finiteCost(cfg.costPerGradeUsd)) {
119
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `${where}: budget must be ≥ 0 and costs finite and ≥ 0`, {
120
+ detail: {
121
+ budgetUsd: cfg.budgetUsd,
122
+ costPerRunUsd: cfg.costPerRunUsd,
123
+ costPerGradeUsd: cfg.costPerGradeUsd,
124
+ where,
125
+ },
126
+ hint: "an infinite cost fits an infinite budget, so the frontier recommended a point on an infinite bill",
127
+ });
128
+ }
129
+ if (!(cfg.screenKeepFraction > 0) || !(cfg.screenKeepFraction <= 1)) {
130
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `${where}: screenKeepFraction must be in (0,1], got ${cfg.screenKeepFraction}`, {
131
+ detail: { screenKeepFraction: cfg.screenKeepFraction, where },
132
+ });
133
+ }
134
+ if (!Number.isInteger(cfg.amortisePrs) || cfg.amortisePrs < 1) {
135
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `${where}: amortisePrs must be a positive integer, got ${cfg.amortisePrs}`, {
136
+ detail: { amortisePrs: cfg.amortisePrs, where },
137
+ hint: 'a baseline spread over "infinity" pull requests is how the baseline cost disappears from a plan',
138
+ });
139
+ }
140
+ }
141
+ /**
142
+ * Observations per case on a pull request where nothing moved, clamped onto the
143
+ * gate's own batch grid.
144
+ */
145
+ export function typicalObservationsPerCase(rate, mde, cfg, baselineRuns) {
146
+ // `makePlan` reaches this quantile through `baselineNullRate`, which refuses
147
+ // one outside (0,1). This handed it to `betaQuantile` directly, which answers
148
+ // 0 for a quantile at or below 0, 1 at or above 1, and about 0 for NaN, so the
149
+ // frontier priced the typical bill against a null rate nobody chose.
150
+ requireOpenProbability(cfg.nullQuantile, "nullQuantile", "typicalObservationsPerCase");
151
+ requireTrialGrid(cfg, "typicalObservationsPerCase");
152
+ // Unchecked, an mde of 0 or below priced a bill for an effect nobody can detect, and a bad rate or run count was refused under betaQuantile's name.
153
+ requireOpenProbability(rate, "rate", "typicalObservationsPerCase");
154
+ requireOpenProbability(mde, "mde", "typicalObservationsPerCase");
155
+ requireBaselineRuns(baselineRuns, "baselineRuns", "typicalObservationsPerCase");
156
+ const s = Math.round(rate * baselineRuns);
157
+ const p0 = betaQuantile(1 + s, 1 + baselineRuns - s, cfg.nullQuantile);
158
+ const p1 = Math.max(0.005, p0 - mde);
159
+ const raw = sprtExpectedN(rate, p0, p1, cfg.alpha, cfg.beta);
160
+ const n = Number.isFinite(raw) && raw > 0
161
+ ? Math.min(cfg.maxTrials, Math.max(cfg.minTrials, Math.ceil(raw)))
162
+ : cfg.maxTrials;
163
+ const batched = cfg.minTrials + Math.ceil(Math.max(0, n - cfg.minTrials) / cfg.batchSize) * cfg.batchSize;
164
+ return Math.min(cfg.maxTrials, batched);
165
+ }
166
+ export function evaluatePoint(cases, mde, baselineRuns, design, screen, screenRunsPerCase, cfg) {
167
+ // Strictly open: an MDE of 0 means "detect a zero-point drop", which every
168
+ // design correctly refuses, but it refuses with a message about the evidence
169
+ // ceiling, which sends the reader looking for a baseline problem that is not
170
+ // there. Same for a baseline rate of 0 or 1.
171
+ requireOpenProbability(mde, "mde", "evaluatePoint");
172
+ requireOpenProbability(cfg.baselineRate, "baselineRate", "evaluatePoint");
173
+ // `makePlan` refuses these two and this did not, so one options object was a
174
+ // refusal through the planner and a priced frontier through here. Both end up
175
+ // in `sprtExpectedN`, which answers NaN or Infinity outside (0,1), and
176
+ // `typicalObservationsPerCase` reads either as "cannot price this" and falls
177
+ // back to the run ceiling.
178
+ requireErrorRates(cfg.alpha, cfg.beta, "evaluatePoint");
179
+ requireProbability(cfg.pairCoupling, "pairCoupling", "evaluatePoint");
180
+ requireOpenProbability(cfg.nullQuantile, "nullQuantile", "evaluatePoint");
181
+ requireSettleConfidence(cfg, "evaluatePoint");
182
+ // makePlan refuses it; unchecked, an fdr of 2 cut the bar and 0 was blamed on the ceiling.
183
+ requireOpenProbability(cfg.fdr, "fdr", "evaluatePoint");
184
+ requireRunCeiling(cfg.runsPerCaseCeiling, "evaluatePoint");
185
+ requirePricing(cfg, "evaluatePoint");
186
+ if (!Number.isInteger(cases) || cases < 1) {
187
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `frontier: cases must be a positive integer, got ${cases}`, {
188
+ detail: { cases },
189
+ });
190
+ }
191
+ // The paired design prices its baseline from this one, and 0 or 2.5 runs priced a cheaper frontier than any real baseline.
192
+ requireBaselineRuns(cfg.pairedBaselineRuns, "pairedBaselineRuns", "evaluatePoint");
193
+ requireBaselineRuns(baselineRuns, "baselineRuns", "evaluatePoint");
194
+ requireTrialGrid(cfg, "evaluatePoint");
195
+ // An unknown design fell through to the paired branch with no runs per observation and came back feasible on an infinite bill.
196
+ if (!Object.hasOwn(RUNS_PER_OBS, design)) {
197
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `frontier: design must be one of ${Object.keys(RUNS_PER_OBS).join(", ")}, got "${String(design)}"`, {
198
+ detail: { design },
199
+ });
200
+ }
201
+ // An unknown screen was priced and recommended as the expensive one.
202
+ if (!SCREENS.includes(screen)) {
203
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `frontier: screen must be one of ${SCREENS.join(", ")}, got "${String(screen)}"`, {
204
+ detail: { screen },
205
+ });
206
+ }
207
+ // Only null withholds a recommendation, so a NaN recall (0 of 0 regressions caught) recommended the screen.
208
+ for (const kind of ["expensive", "proxy"]) {
209
+ const recall = cfg.screenRecall[kind];
210
+ if (recall !== null)
211
+ requireProbability(recall, `screenRecall.${kind}`, "evaluatePoint");
212
+ }
213
+ if (screen !== "none" && (!Number.isInteger(screenRunsPerCase) || screenRunsPerCase < 1)) {
214
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `frontier: a ${screen} screen needs at least one run per case, got ${screenRunsPerCase}`, {
215
+ detail: { screen, screenRunsPerCase },
216
+ });
217
+ }
218
+ const rate = cfg.baselineRate;
219
+ const barLogE = Math.log(ebhSoloThreshold(cases, cfg.fdr));
220
+ // The baseline this design actually needs. The paired design's null is exact,
221
+ // so its stored baseline only tunes the stopping rule: a short one suffices,
222
+ // and pretending it needs the same n_b as the unpaired design would price a
223
+ // ceiling it never buys.
224
+ const effectiveBaselineRuns = design === "paired" ? cfg.pairedBaselineRuns : baselineRuns;
225
+ const s = Math.round(rate * effectiveBaselineRuns);
226
+ let ceilingLogE = null;
227
+ let certifyObservations;
228
+ let infeasibleBecause = null;
229
+ if (rate <= mde) {
230
+ infeasibleBecause =
231
+ `a case at ${(rate * 100).toFixed(0)}% cannot lose ${(mde * 100).toFixed(0)} points, ` +
232
+ "the effect is arithmetically impossible, not merely expensive";
233
+ certifyObservations = Infinity;
234
+ }
235
+ else if (design === "unpaired") {
236
+ const pTrue = Math.max(1e-6, Math.min(1 - 1e-6, rate - mde));
237
+ ceilingLogE = evidenceCeilingLogE(pTrue, s, effectiveBaselineRuns, mde);
238
+ certifyObservations = samplesForEvidence(pTrue, s, effectiveBaselineRuns, mde, barLogE, cfg.runsPerCaseCeiling * 8);
239
+ if (!Number.isFinite(certifyObservations)) {
240
+ infeasibleBecause =
241
+ `unpaired evidence ceiling e^${ceilingLogE.toFixed(1)} is below the bar e^${barLogE.toFixed(1)} ` +
242
+ `at a ${effectiveBaselineRuns}-run baseline, no candidate budget certifies it`;
243
+ }
244
+ }
245
+ else {
246
+ const pairs = mcnemarSamplesForEvidence(rate, mde, cfg.pairCoupling, barLogE, cfg.runsPerCaseCeiling * 8);
247
+ certifyObservations = pairs;
248
+ if (!Number.isFinite(pairs)) {
249
+ infeasibleBecause = `paired: no number of pairs reaches the bar at ρ = ${cfg.pairCoupling.toFixed(2)}`;
250
+ }
251
+ }
252
+ const runsPerObs = RUNS_PER_OBS[design];
253
+ if (infeasibleBecause === null && certifyObservations * runsPerObs > cfg.runsPerCaseCeiling) {
254
+ infeasibleBecause =
255
+ `${Math.ceil(certifyObservations * runsPerObs)} runs for one case, past the ` +
256
+ `${cfg.runsPerCaseCeiling}-run per-case ceiling`;
257
+ }
258
+ const feasible = infeasibleBecause === null;
259
+ // A paired case counts the pairs `shouldStopPaired` takes to settle, as `makePlan` does; the SPRT figure ignores the coupling.
260
+ const typicalObservations = design === "paired"
261
+ ? expectedSettlePairs(rate, cfg.pairCoupling, mde, cfg)
262
+ : typicalObservationsPerCase(rate, mde, cfg, effectiveBaselineRuns);
263
+ const keep = screen === "none" ? cases : Math.max(1, Math.ceil(cases * cfg.screenKeepFraction));
264
+ // Screening runs are graded by whichever grader the screen uses. A proxy
265
+ // screen still *executes* the agent, it only skips the grade, so it saves
266
+ // `costPerGradeUsd` per screening run and not one cent more.
267
+ //
268
+ // And a screening *observation* costs `runsPerObs` runs, exactly as a test
269
+ // observation does, since a paired screen runs both arms too. Charging it one
270
+ // run an observation would understate it by 2×, in the direction that makes
271
+ // pairing look cheaper.
272
+ const screenRuns = screen === "none" ? 0 : cases * screenRunsPerCase * runsPerObs;
273
+ const screenUsd = screen === "none"
274
+ ? 0
275
+ : screen === "proxy"
276
+ ? screenRuns * cfg.costPerRunUsd
277
+ : graded(screenRuns, cfg);
278
+ // The baseline. Unpaired buys its ceiling here; paired does not.
279
+ const baselineRunsTotal = cases * effectiveBaselineRuns;
280
+ const baselineRunsAmortised = baselineRunsTotal / cfg.amortisePrs;
281
+ const baselineUsd = graded(baselineRunsAmortised, cfg);
282
+ const costFor = (obsPerCase) => {
283
+ const testRuns = Number.isFinite(obsPerCase) ? keep * obsPerCase * runsPerObs : Infinity;
284
+ const testUsd = Number.isFinite(testRuns) ? graded(testRuns, cfg) : Infinity;
285
+ return {
286
+ screenRuns,
287
+ screenUsd,
288
+ testRuns,
289
+ testUsd,
290
+ baselineRunsAmortised,
291
+ baselineUsd,
292
+ totalUsd: screenUsd + testUsd + baselineUsd,
293
+ };
294
+ };
295
+ const typical = costFor(typicalObservations);
296
+ const certifyAll = costFor(certifyObservations);
297
+ // The per-case cap this configuration would have to run under.
298
+ //
299
+ // `samplesForEvidence` can answer more runs than `cfg.maxTrials`, and a plan
300
+ // quoting those prices a design the configured cap never executes. So the cap
301
+ // is whatever this configuration *needs*, and `requiresMaxRuns` says so.
302
+ const capObservations = Number.isFinite(certifyObservations)
303
+ ? Math.max(cfg.maxTrials, Math.ceil(certifyObservations))
304
+ : cfg.maxTrials;
305
+ // The gate stops paying for a case at that cap, so this is a real upper
306
+ // bound rather than a scenario, and scenarios do not bound anything.
307
+ const ceiling = costFor(capObservations);
308
+ const screenRecall = screen === "none"
309
+ ? 1
310
+ : screen === "proxy"
311
+ ? cfg.screenRecall.proxy
312
+ : cfg.screenRecall.expensive;
313
+ // A lookup, not a `?:` chain with `typical` on the else branch. A typo'd
314
+ // basis silently selecting the cheapest bill is precisely the
315
+ // malformed-input-becomes-the-most-permissive-result failure this codebase
316
+ // keeps finding in itself.
317
+ const BILLS = {
318
+ typical,
319
+ "certify-all": certifyAll,
320
+ ceiling,
321
+ };
322
+ // `hasOwn`, as in `costShares`: `BILLS.toString` is inherited, so "toString" passed an `undefined` check.
323
+ if (!Object.hasOwn(BILLS, cfg.basis)) {
324
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `frontier: basis must be one of ${Object.keys(BILLS).join(", ")}, got "${String(cfg.basis)}"`, {
325
+ detail: { basis: cfg.basis },
326
+ hint: "an unrecognised basis silently defaulting to the cheaper bill is how a budget becomes fiction",
327
+ });
328
+ }
329
+ const basisCost = BILLS[cfg.basis];
330
+ const withinBudget = feasible && basisCost.totalUsd <= cfg.budgetUsd;
331
+ // Reportable and recommendable are different. A screen whose recall nobody
332
+ // measured is cheap in a way we cannot price, and a proxy screen at zero
333
+ // grading cost is cheaper than nothing at all, which is to say, it is not.
334
+ let caveat = null;
335
+ if (screen !== "none" && screenRecall === null) {
336
+ caveat = `the ${screen} screen's recall cost is unmeasured, it drops regressions at an unknown rate`;
337
+ }
338
+ else if (screen === "proxy" && cfg.costPerGradeUsd <= 0) {
339
+ caveat =
340
+ "a proxy screen saves only grading cost, and grading here is free, it buys nothing and costs recall";
341
+ }
342
+ return {
343
+ cases,
344
+ mde,
345
+ baselineRuns,
346
+ design,
347
+ screen,
348
+ screenRunsPerCase: screen === "none" ? 0 : screenRunsPerCase,
349
+ keep,
350
+ barLogE,
351
+ ceilingLogE,
352
+ feasible,
353
+ infeasibleBecause,
354
+ certifyObservations,
355
+ typicalObservations,
356
+ requiresMaxRuns: capObservations,
357
+ exceedsGateCap: capObservations > cfg.maxTrials,
358
+ typical,
359
+ certifyAll,
360
+ ceiling,
361
+ basisCostUsd: basisCost.totalUsd,
362
+ withinBudget,
363
+ screenRecall,
364
+ recommendable: withinBudget && caveat === null,
365
+ caveat,
366
+ };
367
+ }
368
+ /** Every point in the swept space, feasible or not. */
369
+ export function enumerateFrontier(cfg, axes = DEFAULT_AXES) {
370
+ requirePricing(cfg, "frontier");
371
+ for (const [name, xs] of Object.entries(axes)) {
372
+ if (!Array.isArray(xs) || xs.length === 0) {
373
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `frontier: axis "${name}" is empty, nothing to sweep`, {
374
+ detail: { axis: name },
375
+ });
376
+ }
377
+ }
378
+ const out = [];
379
+ for (const m of axes.cases) {
380
+ for (const mde of axes.mdes) {
381
+ for (const design of axes.designs) {
382
+ // The baseline axis is real for the unpaired design and a fiction for
383
+ // the paired one, which uses `pairedBaselineRuns` whatever this says.
384
+ // Sweeping it anyway would emit five identical paired rows and make the
385
+ // frontier look like it had five times the evidence it has.
386
+ const baselines = design === "paired" ? [cfg.pairedBaselineRuns] : axes.baselineRuns;
387
+ for (const nb of baselines) {
388
+ for (const screen of axes.screens) {
389
+ const ks = screen === "none" ? [0] : axes.screenRuns;
390
+ for (const k of ks)
391
+ out.push(evaluatePoint(m, mde, nb, design, screen, k, cfg));
392
+ }
393
+ }
394
+ }
395
+ }
396
+ }
397
+ return out;
398
+ }
399
+ /**
400
+ * A cell (m, δ) dominates (m', δ') when it covers at least as many cases and
401
+ * detects at least as small a drop, and is strictly better on one of them. The
402
+ * frontier is what survives.
403
+ */
404
+ function paretoCells(cells) {
405
+ return cells.filter((a) => !cells.some((b) => b !== a && b.cases >= a.cases && b.mde <= a.mde && (b.cases > a.cases || b.mde < a.mde)));
406
+ }
407
+ export function computeFrontier(cfg, axes = DEFAULT_AXES) {
408
+ const points = enumerateFrontier(cfg, axes);
409
+ const feasible = points.filter((p) => p.feasible);
410
+ const affordable = points.filter((p) => p.recommendable);
411
+ const cheaper = (a, b) => a.basisCostUsd <= b.basisCostUsd ? a : b;
412
+ const byCell = new Map();
413
+ for (const p of affordable) {
414
+ const key = `${p.cases}|${p.mde}`;
415
+ const cur = byCell.get(key);
416
+ if (!cur)
417
+ byCell.set(key, { cases: p.cases, mde: p.mde, best: p, cheapestReported: null });
418
+ else
419
+ cur.best = cheaper(cur.best, p);
420
+ }
421
+ // For each cell on the frontier, also name the cheapest *reported* option, so
422
+ // an operator can see what the "unmeasured recall" rule cost them.
423
+ for (const cell of byCell.values()) {
424
+ const reported = points
425
+ .filter((p) => p.cases === cell.cases && p.mde === cell.mde && p.withinBudget)
426
+ .reduce((best, p) => (best === null ? p : cheaper(best, p)), null);
427
+ cell.cheapestReported =
428
+ reported && reported.basisCostUsd < cell.best.basisCostUsd ? reported : null;
429
+ }
430
+ const frontier = paretoCells([...byCell.values()]).sort((a, b) => b.cases - a.cases || a.mde - b.mde);
431
+ const cheapestFeasible = feasible.reduce((best, p) => (best === null || p.basisCostUsd < best.basisCostUsd ? p : best), null);
432
+ // The smallest budget at which *something* becomes recommendable. `caveat`
433
+ // is exactly the recommendable rule minus the budget test, so reusing it here
434
+ // means the headline and the recommendation cannot disagree about what counts.
435
+ const cleanFeasible = feasible.filter((p) => p.caveat === null);
436
+ const minimumViableBudgetUsd = cleanFeasible.length === 0 ? null : Math.min(...cleanFeasible.map((p) => p.basisCostUsd));
437
+ const headline = frontier.length === 0
438
+ ? minimumViableBudgetUsd === null
439
+ ? `nothing in the swept space is certifiable at ${(cfg.baselineRate * 100).toFixed(0)}% baseline rate, ` +
440
+ "every configuration is either arithmetically impossible or past the per-case run ceiling"
441
+ : `nothing fits $${cfg.budgetUsd.toFixed(2)} at ${fmtRate(cfg.costPerRunUsd)}/run on the ${cfg.basis} bill. ` +
442
+ `The cheapest certifiable configuration is $${minimumViableBudgetUsd.toFixed(2)} per pull request` +
443
+ (cheapestFeasible
444
+ ? `, ${cheapestFeasible.cases} cases at ${(cheapestFeasible.mde * 100).toFixed(0)} points, ${cheapestFeasible.design}.`
445
+ : ".")
446
+ : (() => {
447
+ const widest = frontier[0];
448
+ const tightest = [...frontier].sort((a, b) => a.mde - b.mde)[0];
449
+ return (`at ${fmtRate(cfg.costPerRunUsd)}/run and $${cfg.budgetUsd.toFixed(2)} a pull request (${cfg.basis} bill) you can certify ` +
450
+ `${widest.cases} cases at ${(widest.mde * 100).toFixed(0)} points ` +
451
+ `($${widest.best.basisCostUsd.toFixed(2)}, ${widest.best.design})` +
452
+ (tightest !== widest
453
+ ? `, or ${tightest.cases} cases at ${(tightest.mde * 100).toFixed(0)} points ` +
454
+ `($${tightest.best.basisCostUsd.toFixed(2)}, ${tightest.best.design})`
455
+ : "") +
456
+ ".");
457
+ })();
458
+ return {
459
+ config: cfg,
460
+ axes,
461
+ points,
462
+ affordable,
463
+ frontier,
464
+ cheapestFeasible,
465
+ minimumViableBudgetUsd,
466
+ headline,
467
+ };
468
+ }
469
+ /**
470
+ * Where the money goes, for one configuration. Printed under the frontier
471
+ * because the shares are the actual finding: at coding-agent prices the
472
+ * unpaired design's amortised baseline is usually the largest line, and it is
473
+ * the one the README used to call free.
474
+ */
475
+ export function costShares(p, basis = "typical") {
476
+ // A lookup and a refusal, for the same reason `evaluatePoint` uses one: this
477
+ // was a `?:` chain with `p.typical` on the else branch, so any basis it did
478
+ // not recognise was reported as the typical bill. `FrontierPoint` names the
479
+ // field `certifyAll` and the basis `certify-all`, so reaching for the field
480
+ // name is the obvious slip, and it put the baseline at 6.6% of the money
481
+ // where the certify-all bill puts it at 1.1%.
482
+ const BILLS = {
483
+ typical: p.typical,
484
+ "certify-all": p.certifyAll,
485
+ ceiling: p.ceiling,
486
+ };
487
+ // `hasOwn` rather than an `undefined` check: `BILLS['toString']` is inherited
488
+ // from Object.prototype, so it is not undefined and would slip through one.
489
+ if (!Object.hasOwn(BILLS, basis)) {
490
+ throw new PeeksafeError("PEEKSAFE_E_CONFIG", `costShares: basis must be one of ${Object.keys(BILLS).join(", ")}, got "${String(basis)}"`, {
491
+ detail: { basis },
492
+ hint: "an unrecognised basis silently reporting the typical bill is how a cost breakdown describes a different plan than the one you asked about",
493
+ });
494
+ }
495
+ const cost = BILLS[basis];
496
+ const t = cost.totalUsd;
497
+ if (!(t > 0) || !Number.isFinite(t))
498
+ return { screen: 0, test: 0, baseline: 0 };
499
+ return {
500
+ screen: cost.screenUsd / t,
501
+ test: cost.testUsd / t,
502
+ baseline: cost.baselineUsd / t,
503
+ };
504
+ }
505
+ //# sourceMappingURL=frontier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontier.js","sourceRoot":"","sources":["../src/frontier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACvF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAC;AAqDpB,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,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