@tangle-network/agent-eval 0.113.0 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/dist/analyst/index.js +2 -2
- package/dist/belief-state/index.js +1 -1
- package/dist/benchmarks/index.js +7 -7
- package/dist/builder-eval/index.js +1 -1
- package/dist/campaign/index.d.ts +612 -8
- package/dist/campaign/index.js +22 -6
- package/dist/{chunk-VLNGPUJJ.js → chunk-3LXTCTWL.js} +2 -2
- package/dist/{chunk-HJWNHCD5.js → chunk-AN5UYSVD.js} +43 -1
- package/dist/chunk-AN5UYSVD.js.map +1 -0
- package/dist/{chunk-7QPK6W7R.js → chunk-ARU2PZFM.js} +2 -2
- package/dist/{chunk-EMKORATZ.js → chunk-DPZAEKA6.js} +2 -2
- package/dist/{chunk-XNCF3JU3.js → chunk-FAOEFFRT.js} +2 -2
- package/dist/{chunk-4FRTXH2M.js → chunk-I2HNIE6N.js} +3 -44
- package/dist/chunk-I2HNIE6N.js.map +1 -0
- package/dist/{chunk-WZOIFFG2.js → chunk-LOBMT6SB.js} +2 -2
- package/dist/{chunk-CX5RBMPW.js → chunk-MNR6ZW4P.js} +4833 -2483
- package/dist/chunk-MNR6ZW4P.js.map +1 -0
- package/dist/{chunk-RT2AFUXM.js → chunk-MOXWMGPC.js} +2 -2
- package/dist/{chunk-F2NV5PQ6.js → chunk-N6MTC3GK.js} +5 -5
- package/dist/{chunk-YWGKQARF.js → chunk-NYFUT3B3.js} +2 -2
- package/dist/{chunk-VC43KQCK.js → chunk-PJQFMIOX.js} +62 -9
- package/dist/chunk-PJQFMIOX.js.map +1 -0
- package/dist/{chunk-BOLYPSAE.js → chunk-WBOGKYM4.js} +4 -4
- package/dist/{chunk-3LDPUYAC.js → chunk-X4UCIOTZ.js} +2 -2
- package/dist/contract/index.d.ts +3 -3
- package/dist/contract/index.js +6 -6
- package/dist/index.d.ts +4 -158
- package/dist/index.js +18 -163
- package/dist/index.js.map +1 -1
- package/dist/meta-eval/index.d.ts +1 -1
- package/dist/meta-eval/index.js +2 -2
- package/dist/openapi.json +1 -1
- package/dist/pipelines/index.js +2 -2
- package/dist/{pre-registration-CTQbZbpX.d.ts → pre-registration-oNItiRBb.d.ts} +155 -1
- package/dist/{provenance-DChJ2oZ4.d.ts → provenance-BZmpWmn4.d.ts} +1 -1
- package/dist/reporting.d.ts +1 -1
- package/dist/reporting.js +4 -4
- package/dist/rl.js +5 -5
- package/dist/{run-campaign-HJQEDCJQ.js → run-campaign-UADIM77S.js} +3 -3
- package/dist/{statistics-CDfpwIdX.d.ts → statistics-oUbOJe-S.d.ts} +34 -1
- package/package.json +1 -1
- package/dist/chunk-4FRTXH2M.js.map +0 -1
- package/dist/chunk-CX5RBMPW.js.map +0 -1
- package/dist/chunk-HJWNHCD5.js.map +0 -1
- package/dist/chunk-VC43KQCK.js.map +0 -1
- /package/dist/{chunk-VLNGPUJJ.js.map → chunk-3LXTCTWL.js.map} +0 -0
- /package/dist/{chunk-7QPK6W7R.js.map → chunk-ARU2PZFM.js.map} +0 -0
- /package/dist/{chunk-EMKORATZ.js.map → chunk-DPZAEKA6.js.map} +0 -0
- /package/dist/{chunk-XNCF3JU3.js.map → chunk-FAOEFFRT.js.map} +0 -0
- /package/dist/{chunk-WZOIFFG2.js.map → chunk-LOBMT6SB.js.map} +0 -0
- /package/dist/{chunk-RT2AFUXM.js.map → chunk-MOXWMGPC.js.map} +0 -0
- /package/dist/{chunk-F2NV5PQ6.js.map → chunk-N6MTC3GK.js.map} +0 -0
- /package/dist/{chunk-YWGKQARF.js.map → chunk-NYFUT3B3.js.map} +0 -0
- /package/dist/{chunk-BOLYPSAE.js.map → chunk-WBOGKYM4.js.map} +0 -0
- /package/dist/{chunk-3LDPUYAC.js.map → chunk-X4UCIOTZ.js.map} +0 -0
- /package/dist/{run-campaign-HJQEDCJQ.js.map → run-campaign-UADIM77S.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -16,14 +16,13 @@ import { F as FailureClass, T as ToolSpan, h as BudgetSpec, B as BudgetLedgerEnt
|
|
|
16
16
|
export { A as Artifact, E as EventKind, i as FAILURE_CLASSES, G as GenericSpan, J as JudgeSpan, M as Message, c as RetrievalSpan, g as RunLayer, f as RunStatus, d as SandboxSpan, j as SpanBase, b as SpanKind, k as SpanStatus, l as TRACE_SCHEMA_VERSION, e as TraceEvent, m as isJudgeSpan, n as isLlmSpan, o as isRetrievalSpan, p as isSandboxSpan, q as isToolSpan } from './schema-SGWcK9wa.js';
|
|
17
17
|
import { A as AgentEvalError, J as JudgeError, a as ConfigError } from './errors-oeQrLqXC.js';
|
|
18
18
|
export { b as AgentEvalErrorCode, C as CaptureIntegrityError, N as NotFoundError, R as ReplayError, V as ValidationError, c as VerificationError } from './errors-oeQrLqXC.js';
|
|
19
|
-
import {
|
|
20
|
-
export { A as ArtifactCheckArtifact,
|
|
19
|
+
import { c as CorrectnessChecker } from './pre-registration-oNItiRBb.js';
|
|
20
|
+
export { A as ArtifactCheckArtifact, e as ArtifactEventLike, f as ArtifactValidator, g as BackendIntegrityError, B as BackendIntegrityReport, h as ComparePairedArmsOptions, C as CompletionRequirement, a as CompletionVerdict, H as HypothesisManifest, i as HypothesisResult, j as LlmCorrectnessCheckerOpts, L as LlmJudgeDimension, d as LlmJudgeOptions, M as MatchedPair, k as PairArmsOptions, m as PairArmsResult, n as PairedArmRow, P as PairedArmsComparison, o as PairedCorrectness, p as PairedMetricDelta, q as ProducedProposal, b as ProducedState, r as ProposalEventLike, s as RequirementCheck, R as RuntimeEventLike, t as SatisfiedBy, S as SignedManifest, u as SignedManifestAlgo, T as TaskGold, v as ToolCallEventLike, V as ValidationContext, w as ValidationIssue, x as ValidationResult, y as assertRealBackend, z as byteLengthRange, D as canonicalize, E as comparePairedArms, F as completionVerdict, G as composeValidators, I as containsAll, J as createLlmCorrectnessChecker, K as createTokenRecallChecker, N as evaluateHypothesis, O as extractProducedState, Q as hashJson, U as jsonHasKeys, l as llmJudge, W as pairArms, X as parseCorrectnessResponse, Y as regexMatch, Z as signManifest, _ as summarizeBackendIntegrity, $ as verifyCompletion, a0 as verifyManifest } from './pre-registration-oNItiRBb.js';
|
|
21
21
|
import { T as TraceEmitter } from './emitter-BRchAAAx.js';
|
|
22
22
|
export { R as RunCompleteHook, a as RunCompleteHookContext, S as SpanHandle, b as TraceEmitterOptions, l as llmSpanFromProvider } from './emitter-BRchAAAx.js';
|
|
23
23
|
import { h as ReleaseConfidenceThresholds, f as ReleaseConfidenceScorecard } from './release-report-oBfOz8ku.js';
|
|
24
24
|
export { A as ActionableSideInfo, o as AsiSeverity, B as BootstrapOptions, a as BootstrapResult, J as JudgeReplayGateArgs, R as ReleaseConfidenceAxis, b as ReleaseConfidenceAxisName, c as ReleaseConfidenceInput, d as ReleaseConfidenceIssue, e as ReleaseConfidenceMetrics, g as ReleaseConfidenceStatus, i as ReleaseTraceEvidence, j as RenderReleaseReportOptions, V as Verdict, k as assertReleaseConfidence, l as bootstrapCi, m as evaluateReleaseConfidence, n as judgeReplayGate, r as renderReleaseReport } from './release-report-oBfOz8ku.js';
|
|
25
|
-
|
|
26
|
-
export { c as CliffsMagnitude, d as CorpusAgreementOptions, e as CorpusAgreementPerDimension, C as CorpusAgreementReport, f as CorpusScoreRecord, g as EProcess, h as EProcessOptions, E as EProcessState, i as EProcessStep, j as ProportionInterval, W as WeightedCompositeInput, k as WeightedCompositeResult, b as benjaminiHochberg, l as bonferroni, m as cliffsDelta, n as cohensD, o as confidenceInterval, q as corpusInterRaterAgreement, r as corpusInterRaterAgreementFromJudgeScores, s as eProcess, t as holm, u as interRaterReliability, v as interpretCliffs, x as mannWhitneyU, y as mcnemar, z as mcnemarPower, A as mcnemarRequiredN, B as mulberry32, D as normalizeScores, p as pairedBootstrap, F as pairedMde, G as pairedRiskDifference, H as pairedTTest, I as partialCredit, J as passAtK, K as pearsonR, L as ranks, N as requiredSampleSize, O as spearmanR, Q as weightedComposite, S as weightedMean, w as wilcoxonSignedRank, T as wilson } from './statistics-CDfpwIdX.js';
|
|
25
|
+
export { c as CliffsMagnitude, d as CorpusAgreementOptions, e as CorpusAgreementPerDimension, C as CorpusAgreementReport, f as CorpusScoreRecord, g as EProcess, h as EProcessOptions, E as EProcessState, i as EProcessStep, M as McNemarResult, P as PairedBootstrapOptions, a as PairedBootstrapResult, j as PairedSignTestResult, k as ProportionInterval, R as RiskDifferenceResult, S as SignTestAlternative, W as WeightedCompositeInput, l as WeightedCompositeResult, b as benjaminiHochberg, m as bonferroni, n as cliffsDelta, o as cohensD, q as confidenceInterval, r as corpusInterRaterAgreement, s as corpusInterRaterAgreementFromJudgeScores, t as eProcess, u as holm, v as interRaterReliability, x as interpretCliffs, y as mannWhitneyU, z as mcnemar, A as mcnemarPower, B as mcnemarRequiredN, D as mulberry32, F as normalizeScores, p as pairedBootstrap, G as pairedMde, H as pairedRiskDifference, I as pairedSignTest, J as pairedTTest, K as partialCredit, L as passAtK, N as pearsonR, O as ranks, Q as requiredSampleSize, T as spearmanR, U as weightedComposite, V as weightedMean, w as wilcoxonSignedRank, X as wilson } from './statistics-oUbOJe-S.js';
|
|
27
26
|
import { OtelExporter, OtelExportConfig } from './traces.js';
|
|
28
27
|
export { CaptureFetchContext, CaptureFetchOptions, DEFAULT_REDACTION_RULES, ExportableSpan, ExtractedUsage, FlattenOtlpOptions, LLM_CACHED_TOKENS, LLM_CACHED_TOKEN_ATTR_KEYS, LLM_COST_ATTR_KEYS, LLM_COST_USD, LLM_INPUT_TOKENS, LLM_INPUT_TOKEN_ATTR_KEYS, LLM_MODEL_ATTR_KEYS, LLM_MODEL_NAME, LLM_OUTPUT_TOKENS, LLM_OUTPUT_TOKEN_ATTR_KEYS, OPENINFERENCE_SPAN_KIND, OTEL_AGENT_EVAL_SCOPE, OtlpExport, OtlpFileTraceStore, OtlpFileTraceStoreOptions, OtlpFlatLine, OtlpResourceSpans, OtlpSpan, OtlpToRunRecordsOptions, OtlpTraceRunRecord, ProjectedOtlpSpan, REDACTION_VERSION, RedactionReport, RedactionRule, ReplayCache, ReplayCacheEntry, ReplayCacheMissError, ReplayCacheStats, ReplayFetchOptions, SPAN_KIND_ATTR_KEYS, SpanNotFoundError, TOOL_NAME, TOOL_NAME_ATTR_KEYS, TRACE_ANALYST_ACTOR_DESCRIPTION, TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION, TRACE_ANALYST_SUBAGENT_DESCRIPTION, TraceAggregate, TraceAnalystHookOptions, TraceFileMissingError, TraceInsightContext, TraceInsightFinding, TraceInsightPanelRole, TraceInsightPromptInput, TraceInsightQualityGate, TraceInsightQuestion, TraceInsightReadiness, TraceInsightSuite, TraceInsightTask, TraceNotFoundError, TraceStoreSource, TraceStoreToOtlpOptions, TracesToOtlpResult, asNumber, asString, buildTraceAnalystTools, buildTraceInsightContext, buildTraceInsightPrompt, captureFetchToRawSink, convertTraceStoresToOtlp, createOtelExporter, createOtelTracingStore, createReplayFetch, defaultTraceInsightPanel, describeTraceInsightScope, domainEvidencePattern, exportRunAsOtlp, extractOtlpAttributes, extractUsage, extractUsageFromResponse, extractUsageFromSse, firstNumberAttr, firstStringAttr, flattenOtlpExportToNdjson, inferDomainKeywords, inferOtlpKind, iterateRawCalls, otelRunCompleteHook, otlpToRunRecords, otlpToTraceRunRecords, planTraceInsightQuestions, projectOtlpFlatLine, readOtlpStatus, redactString, redactValue, scoreTraceInsightReadiness, stringField, tokenizeDomainWords, traceAnalystFunctionGroup, traceAnalystOnRunComplete, traceSpanKindToOpenInferenceKind } from './traces.js';
|
|
29
28
|
import { a as AnalyzeTracesInput, A as AnalyzeTracesOptions, b as AnalyzeTracesResult } from './analyst-C8HHvfJp.js';
|
|
@@ -1154,159 +1153,6 @@ declare class MetricsCollector {
|
|
|
1154
1153
|
getConvergenceCurve(): number[];
|
|
1155
1154
|
}
|
|
1156
1155
|
|
|
1157
|
-
/**
|
|
1158
|
-
* Matched-pair arm comparison — "did the treatment arm beat the baseline arm
|
|
1159
|
-
* on the SAME work items?"
|
|
1160
|
-
*
|
|
1161
|
-
* An arm A/B over run records is only trustworthy when it is PAIRED: the same
|
|
1162
|
-
* task/scenario/seed evaluated under both arms, compared item-by-item, so
|
|
1163
|
-
* inter-item difficulty variance cancels instead of masquerading as an arm
|
|
1164
|
-
* effect. This module owns the two error-prone steps every consumer otherwise
|
|
1165
|
-
* hand-rolls:
|
|
1166
|
-
*
|
|
1167
|
-
* 1. Pairing — matching rows across arms by `pairKey` (and by `repKey`
|
|
1168
|
-
* within multi-rep items), with leftovers REPORTED rather than silently
|
|
1169
|
-
* dropped (a silently unbalanced pairing biases every paired statistic
|
|
1170
|
-
* downstream). Pairing never keys on outcome content: matching reps by
|
|
1171
|
-
* their outcomes deflates discordant-pair counts and makes McNemar
|
|
1172
|
-
* anti-conservative, so reps pair only by (`pairKey`, `repKey`) identity.
|
|
1173
|
-
* 2. Composition — feeding the matched pairs to the correct paired
|
|
1174
|
-
* estimators that already live in `statistics`: `mcnemar` +
|
|
1175
|
-
* `pairedRiskDifference` for pass/fail, `pairedBootstrap` +
|
|
1176
|
-
* `wilcoxonSignedRank` for continuous metrics. No statistic is
|
|
1177
|
-
* re-implemented here.
|
|
1178
|
-
*
|
|
1179
|
-
* The row shape is deliberately structural — callers project a `RunRecord`
|
|
1180
|
-
* (or any record) into `{ pairKey, arm, pass?, metrics? }`. Arm names are
|
|
1181
|
-
* caller-supplied parameters; the module ships no domain literal.
|
|
1182
|
-
*/
|
|
1183
|
-
|
|
1184
|
-
/** One arm observation of one work item. Structural on purpose: callers
|
|
1185
|
-
* project their own record type (e.g. a `RunRecord`) into this shape. */
|
|
1186
|
-
interface PairedArmRow {
|
|
1187
|
-
/** Matching key — rows sharing a `pairKey` across both arms form pairs
|
|
1188
|
-
* (typically the task/scenario/seed identity). */
|
|
1189
|
-
pairKey: string;
|
|
1190
|
-
/** Rep identity within a `pairKey` (e.g. a seed or rep number). Required on
|
|
1191
|
-
* every row of a `pairKey` that has more than one rep in either arm; reps
|
|
1192
|
-
* then pair only on exact (`pairKey`, `repKey`) match, never on outcome
|
|
1193
|
-
* content. Optional when each arm has at most one rep of the item. */
|
|
1194
|
-
repKey?: string;
|
|
1195
|
-
/** Arm label this row was produced under. */
|
|
1196
|
-
arm: string;
|
|
1197
|
-
/** Binary outcome; omit when the comparison has no pass/fail notion. */
|
|
1198
|
-
pass?: boolean;
|
|
1199
|
-
/** Named numeric measurements (score, cost, latency, …). */
|
|
1200
|
-
metrics?: Record<string, number>;
|
|
1201
|
-
}
|
|
1202
|
-
interface PairArmsOptions {
|
|
1203
|
-
/** Arm treated as the control side of every pair. */
|
|
1204
|
-
baselineArm: string;
|
|
1205
|
-
/** Arm treated as the treatment side of every pair. */
|
|
1206
|
-
treatmentArm: string;
|
|
1207
|
-
}
|
|
1208
|
-
/** One matched (baseline, treatment) observation of the same work item. */
|
|
1209
|
-
interface MatchedPair {
|
|
1210
|
-
pairKey: string;
|
|
1211
|
-
/** 0-based position of this pair within its `pairKey`, ordered by sorted
|
|
1212
|
-
* `repKey` (always 0 for a single-rep item). The rep identity itself is on
|
|
1213
|
-
* the rows (`baseline.repKey` / `treatment.repKey`). */
|
|
1214
|
-
repIndex: number;
|
|
1215
|
-
baseline: PairedArmRow;
|
|
1216
|
-
treatment: PairedArmRow;
|
|
1217
|
-
}
|
|
1218
|
-
interface PairArmsResult {
|
|
1219
|
-
/** Matched pairs, ordered by (`pairKey`, `repIndex`). */
|
|
1220
|
-
pairs: MatchedPair[];
|
|
1221
|
-
/** Baseline rows left without a treatment counterpart — reported, never
|
|
1222
|
-
* silently dropped. */
|
|
1223
|
-
unpairedBaseline: PairedArmRow[];
|
|
1224
|
-
/** Treatment rows left without a baseline counterpart. */
|
|
1225
|
-
unpairedTreatment: PairedArmRow[];
|
|
1226
|
-
}
|
|
1227
|
-
/**
|
|
1228
|
-
* Match rows across two arms into (baseline, treatment) pairs by `pairKey`.
|
|
1229
|
-
*
|
|
1230
|
-
* A `pairKey` with at most one row per arm pairs directly, no `repKey`
|
|
1231
|
-
* needed. A `pairKey` with multiple reps in either arm requires `repKey` on
|
|
1232
|
-
* every one of its rows, and reps pair only on exact (`pairKey`, `repKey`)
|
|
1233
|
-
* match — pairing is keyed purely on row identity, never on outcome content
|
|
1234
|
-
* (outcome-keyed matching deflates discordant counts and biases McNemar), and
|
|
1235
|
-
* is therefore independent of input order. Reps whose `repKey` has no
|
|
1236
|
-
* counterpart in the other arm, and items present in only one arm, land in
|
|
1237
|
-
* the unpaired lists — reported, never truncated.
|
|
1238
|
-
*
|
|
1239
|
-
* Fail-loud: throws when either named arm has zero rows (an unknown arm
|
|
1240
|
-
* name would otherwise read as "everything unpaired"), when the two arm
|
|
1241
|
-
* names are equal, when a multi-rep `pairKey` has a row without `repKey`, or
|
|
1242
|
-
* when a (`pairKey`, arm) group repeats a `repKey` (the match would be
|
|
1243
|
-
* ambiguous).
|
|
1244
|
-
*/
|
|
1245
|
-
declare function pairArms(rows: readonly PairedArmRow[], opts: PairArmsOptions): PairArmsResult;
|
|
1246
|
-
/** Paired pass/fail comparison over the pairs where BOTH sides carry `pass`. */
|
|
1247
|
-
interface PairedCorrectness {
|
|
1248
|
-
/** Discordant pairs where the treatment passed and the baseline failed. */
|
|
1249
|
-
b10: number;
|
|
1250
|
-
/** Discordant pairs where the baseline passed and the treatment failed. */
|
|
1251
|
-
b01: number;
|
|
1252
|
-
/** Exact McNemar significance over the paired outcomes (`b === b10`, `c === b01`). */
|
|
1253
|
-
mcnemar: McNemarResult;
|
|
1254
|
-
/** Paired effect size: p(treatment) − p(baseline) with a paired-variance CI. */
|
|
1255
|
-
riskDifference: RiskDifferenceResult;
|
|
1256
|
-
}
|
|
1257
|
-
/** Paired delta summary for one named metric (delta = treatment − baseline). */
|
|
1258
|
-
interface PairedMetricDelta {
|
|
1259
|
-
name: string;
|
|
1260
|
-
/** Pairs where BOTH sides carry a finite value for this metric. */
|
|
1261
|
-
n: number;
|
|
1262
|
-
/** Pairs where at least one side does not carry the metric. */
|
|
1263
|
-
nMissing: number;
|
|
1264
|
-
/** Median paired delta; NaN when `n === 0` (no data ≠ measured zero). */
|
|
1265
|
-
medianDelta: number;
|
|
1266
|
-
/** Mean paired delta; NaN when `n === 0`. */
|
|
1267
|
-
meanDelta: number;
|
|
1268
|
-
/** Bootstrap CI on the paired delta (`pairedBootstrap`); null when
|
|
1269
|
-
* `n === 0` — a zero-width [0, 0] interval on no data would read as a
|
|
1270
|
-
* measured tight null. */
|
|
1271
|
-
bootstrapCi: PairedBootstrapResult | null;
|
|
1272
|
-
/** Wilcoxon signed-rank test on the paired deltas; null when `n === 0`. */
|
|
1273
|
-
wilcoxon: {
|
|
1274
|
-
w: number;
|
|
1275
|
-
p: number;
|
|
1276
|
-
} | null;
|
|
1277
|
-
}
|
|
1278
|
-
interface ComparePairedArmsOptions extends PairArmsOptions {
|
|
1279
|
-
/** Metrics to compare. Default: every metric name observed on any matched
|
|
1280
|
-
* pair, sorted. A name that appears on no pair is still reported (with
|
|
1281
|
-
* `n = 0`) so a misspelled metric is visible instead of vanishing. */
|
|
1282
|
-
metricNames?: string[];
|
|
1283
|
-
/** Passed through to `pairedBootstrap` — set `seed` for reproducible CIs. */
|
|
1284
|
-
bootstrap?: PairedBootstrapOptions;
|
|
1285
|
-
}
|
|
1286
|
-
interface PairedArmsComparison {
|
|
1287
|
-
nPairs: number;
|
|
1288
|
-
nUnpairedBaseline: number;
|
|
1289
|
-
nUnpairedTreatment: number;
|
|
1290
|
-
/** null when no matched pair carries `pass` on both sides — a pass/fail
|
|
1291
|
-
* verdict over rows that never measured pass/fail would be fabricated. */
|
|
1292
|
-
correctness: PairedCorrectness | null;
|
|
1293
|
-
metricDeltas: PairedMetricDelta[];
|
|
1294
|
-
}
|
|
1295
|
-
/**
|
|
1296
|
-
* Full matched-pair arm comparison: pair via {@link pairArms}, then compose
|
|
1297
|
-
* the paired estimators from `statistics` over the matched pairs.
|
|
1298
|
-
*
|
|
1299
|
-
* Correctness uses only the pairs where both sides carry `pass` (`mcnemar.n`
|
|
1300
|
-
* is that subset's size); each metric uses only the pairs where both sides
|
|
1301
|
-
* carry a finite value for it, with the remainder counted in `nMissing`.
|
|
1302
|
-
* Deltas are treatment − baseline throughout.
|
|
1303
|
-
*
|
|
1304
|
-
* Fail-loud: inherits {@link pairArms}'s unknown-arm throw, and throws on a
|
|
1305
|
-
* non-finite metric value — silently treating corrupt telemetry as "metric
|
|
1306
|
-
* absent" would misreport it as missing coverage.
|
|
1307
|
-
*/
|
|
1308
|
-
declare function comparePairedArms(rows: readonly PairedArmRow[], opts: ComparePairedArmsOptions): PairedArmsComparison;
|
|
1309
|
-
|
|
1310
1156
|
type PrReviewSource = 'drew' | 'donovan' | 'shady' | 'codex' | 'claude-code' | 'gpt-5.5-high' | 'claude-opus-4.7-high' | 'kimi' | 'opencode' | (string & {});
|
|
1311
1157
|
type PrReviewSeverity = 'critical' | 'high' | 'medium' | 'low' | 'nit';
|
|
1312
1158
|
type PrReviewOutcome = 'accepted' | 'fixed' | 'rejected' | 'duplicate' | 'noise' | 'unknown';
|
|
@@ -7035,4 +6881,4 @@ type CachedJudge<TArtifact, TScenario extends Scenario$1 = Scenario$1> = JudgeCo
|
|
|
7035
6881
|
*/
|
|
7036
6882
|
declare function cachedJudge<TArtifact, TScenario extends Scenario$1 = Scenario$1>(judge: JudgeConfig<TArtifact, TScenario>, store: VerdictCacheStore, options: CachedJudgeOptions): CachedJudge<TArtifact, TScenario>;
|
|
7037
6883
|
|
|
7038
|
-
export { ATTESTATION_ALGORITHM, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AgentProfileRuntimeReceipt, type AgreementResult, type AlignmentOp, AnalyzeTracesInput, AnalyzeTracesOptions, AnalyzeTracesResult, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, type AssertCapabilityHeadroomOptions, type AssertCrossFamilyOptions, type AssertSingleBackendOptions, type AttestationProvenance, type AttestationVerification, type AttestedReport, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, type BackendDescriptor, BaselineReport, BehaviorAssertion, BehavioralMetrics, BenchmarkReport, BenchmarkRunner, BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, type BlendWeights, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, BudgetSpec, type BuildAgreementJudgeOptions, CODING_HARNESSES, type CachedJudge, type CachedJudgeOptions, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateComparison, type CandidateScenario, type CapabilityHeadroomOptions, type CapabilityHeadroomResult, type CausalAttributionReport, type CellVerdict, ChannelRollup, ChatRequest, CheckResult, type ClusterBootstrapInterval, type ClusterSignFlipAlternative, type ClusterSignFlipResult, type ClusteredBinaryCluster, type ClusteredMatchedPair, type ClusteredPairedBinaryOptions, type ClusteredPairedBinaryResult, type ClusteredPairedBinaryStatistics, CollectedArtifacts, type CommandRunner, type CompareLabels, type ComparePairedArmsOptions, CompletionCriterion, ConfigError, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractCheckResult, type ContractJudgeOptions, type ContractMetric, type ContractReport, type ContractRule, type ContractRuleKind, type ContractSpan, type ContractVerdict, type ContractViolation, ControlEvalResult, ControlSeverity, ConvergenceTracker, CorrectnessChecker, type CostEntry, CostLedger, type CostReport, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, CreateChatClientOpts, type CreateDefaultReviewerOptions, type CreateExperimentInput, type CreateSandboxPoolOpts, CrossFamilyError, type CrossTraceDiff, type CrossTraceDiffOptions, DEFAULT_AGENT_SLOS, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATION_PRIMITIVES, DEFAULT_MUTATORS, DEFAULT_PR_REVIEW_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, type DataAcquisitionPlan, Dataset, DatasetScenario, type DecideNextUserTurnOpts, DefaultVerdict, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DescriptionLengthCandidate, type DescriptionLengthConfig, type DescriptionLengthDecision, type DescriptionLengthEvidence, DescriptionLengthGate, type DescriptionLengthRejectionCode, type DetectorEvent, type DetectorSeverity, type DetectorSignal, type DiffScorecardOptions, type DirEntry, type DiscoverPersonasOptions, type DiscoveredPersona, DriverResult, DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type EnsembleAggregate, type EnsembleJudgeOptions, type ErrorCountPattern, type ErrorStreakOptions, type EvalToolDef, EvalTraceStore, type EvolutionRound, type ExecutorConfig, type Expectation, type Experiment, type ExperimentProvenance, type ExperimentRep, type ExperimentStats, type ExperimentStore, ExperimentTracker, type ExperimentTrackerOptions, type ExperimentVerdict, type ExportedRewardModel, type ExtractOptions, type ExtractResult, type FactorContribution, type FactorialCell, FailureClass, FeedbackLabel, FeedbackTrajectory, FeedbackTrajectoryStore, type FieldAgreementSpec, type FieldDestination, type FileChange, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, type GhCliClientOptions, type GoldScenario, type GoldSplit, type GoldenSeverity, type GoldenSpec, HARNESS_NATIVE_MODEL, type HarnessAdapter, HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, type HeadroomClass, type HeadroomInput, type HeldOutPartition, type HiddenCriteriaGrader, type HiddenGradeResult, type HiddenLeak, HoldoutAuditor, type HttpGithubClientOptions, INTENT_MATCH_JUDGE_VERSION, type ImageData, type ImprovementThresholds, type ImprovementVerdictResult, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JudgeError, type JudgeFamily, type JudgeFleetOptions, JudgeFn, JudgeParseError, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, JudgeRunner, type JudgeScoreInput, type JudgeVerdict, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type KnowledgeAcquisitionMode, type KnowledgeBundle, type KnowledgeFallbackPolicy, type KnowledgeFreshness, type KnowledgeImportance, type KnowledgeReadinessReport, type KnowledgeRecommendedAction, type KnowledgeRequirement, type KnowledgeRequirementCategory, type KnowledgeResponsibleSurface, type KnowledgeSensitivity, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LeaderboardOptions, type LeaderboardRow, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmClientOptions, LlmSpan, LockedJsonlAppender, MODEL_PRICING, type MakeEvalToolsConfig, type MatchResult, type MatchedPair, type MatcherResult, McNemarResult, type MeasurementPolicy, type MergeOptions, MetricsCollector, type ModelCostRollup, type ModelPreflight, type ModelSeats, ModelsUnreachableError, type MuffledFinder, type MuffledFinding, type MultiToolchainLayerConfig, type Mutator, Mutex, type NoLeakOptions, type NoProgressOptions, Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, OtelExportConfig, OtelExporter, type OtelPipelineHandle, type OtelPipelineOptions, type PairArmsOptions, type PairArmsResult, type PairedArmRow, type PairedArmsComparison, PairedBootstrapOptions, PairedBootstrapResult, type PairedCorrectness, type PairedMetricDelta, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, ParetoResult, type ParseStudentLabel, type PartitionHeldOutOptions, PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, type PrReviewAuditCase, type PrReviewBenchmarkSummary, type PrReviewComment, type PrReviewMatchedFinding, type PrReviewOutcome, type PrReviewReferenceFinding, type PrReviewScore, type PrReviewScoreWeights, type PrReviewSeverity, type PrReviewSource, type PreflightModelsOptions, type PreflightOutcome, type ProductBenchmarkArm, type ProductBenchmarkArtifactPaths, type ProductBenchmarkBudgets, type ProductBenchmarkExportOptions, type ProductBenchmarkExportResult, type ProductBenchmarkManifest, type ProductBenchmarkProfileRef, type ProductBenchmarkRecord, type ProductBenchmarkRepoRef, type ProductBenchmarkRunInput, type ProductBenchmarkScenario, type ProductBenchmarkSingleRunExportOptions, type ProductBenchmarkSplit, type ProductBenchmarkSubstrateVersions, type ProductBenchmarkValidationReport, ProductClient, ProductClientConfig, type ProfileAxisSpec, type PromptHandle, PromptRegistry, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, type ProvenanceReader, type RecordRunsOptions, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type ReflectionContext, type ReflectionProposal, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RenderStudentPrompt, type RepeatedActionOptions, type RepoRef, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, RiskDifferenceResult, type RobustnessResult, type RoutedField, Run, type RunCommandInput, type RunCommandResult, type RunDistillationOptions, type RunDistillationResult, RunFilter, RunRecord, type RunRecordBackend, type RunRecordFilter, RunScore, RunScoreWeights, RunSplitTag, RunTrace, type RuntimeResolution, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type ScanOptions, Scenario, type ScenarioCost, ScenarioFile, ScenarioRegistry, ScenarioResult, type ScoreKnowledgeReadinessOptions, type Scorecard, type ScorecardCell, type ScorecardCellDiff, type ScorecardDiff, type ScorecardEntry, type ScorecardLogLine, type ScoredTarget, type SeatName, type SeatPresetName, SeatUnsetError, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SerializedRegex, Severity, type SingleBackendDivergence, SingleBackendError, type SingleBackendField, type SingleBackendReport, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, Span, type SpanPredicate, type SplitGoldOptions, type SteeringBundle, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type StreamingDetector, type SynthesisReason, type SynthesisTarget, type TaskHeadroom, TestResult, type TextMatcher, type ThresholdContract, TokenCounter, type TokenSpec, type ToolMatcher, ToolSpan, TraceAnalystSpan, type TraceContract, TraceContractBuilder, TraceEmitter, TraceStore, type TracedAnalystOptions, type TracedJudgeOptions, Trajectory, TrajectoryStep, type TreatmentClass, type TreatmentGate, type TreatmentGateInput, type TreatmentGateOptions, type TrialTrace, TurnMetrics, UI_FINDING_SEVERITIES, UI_LENSES, UNIVERSAL_FINDERS, type UiFinding, type UiFindingScreenshot, type UiFindingSeverity, type UiLens, type UserQuestion, type VerdictCacheStats, type VerdictCacheStore, VerifyContext, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkerDriverContext, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, acquisitionPlansForKnowledgeGaps, adversarialJudge, agentProfileHash, agentProfileId, agentProfileModelId, agentVisibleFields, aggregateJudgeVerdicts, aggregatePrReviewScore, analyzeAntiSlop, appendScorecard, assertCapabilityHeadroom, assertCrossFamily, assertModelsServed, assertNoHiddenLeak, assertProductBenchmarkRun, assertSingleBackend, assignHeldOutTag, attachCostToReport, attest, attributeCounterfactuals, bisect, blendHeldout, blockingKnowledgeEval, buildAgreementJudge, buildDriverSystemPrompt, buildProductBenchmarkManifest, buildReflectionPrompt, buildReviewerPrompt, buildWorkerDriverSystemPrompt, cachedJudge, canaryLeakView, canonicalJson, capabilityHeadroom, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, checkTraceContracts, classifyTreatment, clusteredPairedBinary, codeExecutionJudge, coherenceJudge, collectionPreserved, commentsForSource, commitBisect, comparePairedArms, compareReferenceReplay, compilerJudge, computeExperimentStats, contentHash, contractJudge, costReport, createAntiSlopJudge, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createSandboxPool, crossTraceDiff, dataDescriptionBits, decideNextUserTurn, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultBlendWeights, defaultJudges, defaultParseStudentLabel, defaultReferenceReplayMatcher, defaultRenderStudentPrompt, deployGateLayer, diffScorecard, discoverPersonas, distillPlaybook, ensembleJudge, errorStreakDetector, estimateCost, estimateTokens, evaluateContract, evaluateOracles, evaluateTraceContract, executeScenario, expandProfileAxes, expectAgent, exportProductBenchmark, exportProductBenchmarkRuns, exportRewardModel, extractAssetUrls, extractErrorCount, fieldAgreement, fileContains, fileExists, fileExperimentStore, fileVerdictCache, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findProductBenchmarkArtifacts, findSkipCountsAsPass, flowLayer, fnv1a32, formatBenchmarkReport, formatDriverReport, formatFindings, formatScorecardDiff, gateTreatmentApplied, gateTreatmentFromMetrics, gateTreatmentFromSpans, gateTreatmentFromToolSpans, ghCliClient, gitProvenanceReader, precision as goldenPrecision, gradeOnHidden, harnessAxisOf, hashContent, hashToUnit, hiddenGrade, htmlContainsElement, httpGithubClient, improvementVerdict, inMemoryExperimentStore, inMemoryReferenceReplayStore, inMemoryRunRecordBackend, inMemoryVerdictCache, isHiddenDestination, isModelPriced, isOtelConfigured, jsonShape, jsonlReferenceReplayStore, jsonlRunRecordBackend, judgeFamily, keyPreserved, knowledgeReadinessTracePayload, leaderboard, linterJudge, loadGoldScenarios, loadScorecard, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeEvalTools, matchGoldens, matchSpan, mergeLayerResults, mergeSteeringBundle, modelDescriptionBits, multiToolchainLayer, noProgressDetector, notBlocked, observeAll, pairArms, paraphraseRobustness, paraphraseRobustnessScenarios, parseGoldJsonl, parseReflectionResponse, partitionHeldOut, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, preflightModels, printDriverSummary, productBenchmarkIntegrityFailures, productBenchmarkMutableSurfaces, productBenchmarkRepoIdentity, productBenchmarkSplits, index as profile, promptBisect, proposeSynthesisTargets, readProductBenchmarkManifest, readProductBenchmarkRecords, recordRuns, recordRunsToScorecard, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatches, renderMarkdownReport, renderPlaybookMarkdown, renderSteeringText, repeatedActionDetector, replayScorerOverCorpus, replayTraceThroughJudge, resolveModelPricing, resolveSeat, routeFields, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runCounterfactual, runDistillation, runE2EWorkflow, runExpectations, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runRecordToProductBenchmarkRecord, runReferenceReplay, runScore, runSelfPlay, scanForMuffledGates, scoreContinuity, scoreKnowledgeReadiness, scorePrReviewComments, scorePrReviewSource, scoreReferenceReplay, seatPresets, securityJudge, selectHarnessVariant, sentenceReorderMutator, splitGold, statusAdvanced, summarizeHarnessResults, summarizePrReviewBenchmark, testJudge, textInSnapshot, toLangfuseEnvelope, toOpenAiTool, toPrometheusText, traceContract, traceJudge, traceJudgeEnsemble, tracedAnalyzeTraces, typoMutator, urlContains, userQuestionsForKnowledgeGaps, validateProductBenchmarkManifest, validateProductBenchmarkRecord, validateProductBenchmarkRun, verifyAttestation, visualDiff, viteDeployRunner, weightedRecall, whitespaceCollapseMutator, withHeldoutBlend, withJudgeRetry, withOtelPipeline, wranglerDeployRunner };
|
|
6884
|
+
export { ATTESTATION_ALGORITHM, type ActiveLearningOptions, type AdapterRun, AgentDriver, type AgentDriverConfig, AgentEvalError, type AgentProfileRuntimeReceipt, type AgreementResult, type AlignmentOp, AnalyzeTracesInput, AnalyzeTracesOptions, AnalyzeTracesResult, type AntiSlopConfig, type AntiSlopIssue, type AntiSlopReport, type AssertCapabilityHeadroomOptions, type AssertCrossFamilyOptions, type AssertSingleBackendOptions, type AttestationProvenance, type AttestationVerification, type AttestedReport, type AutoPrClient, AxGepaSteeringOptimizer, type AxSteeringOptimizerConfig, type BackendDescriptor, BaselineReport, BehaviorAssertion, BehavioralMetrics, BenchmarkReport, BenchmarkRunner, BenchmarkRunnerConfig, type BisectOptions, type BisectResult, type BisectStep, type BlendWeights, BudgetBreachError, BudgetGuard, BudgetLedgerEntry, BudgetSpec, type BuildAgreementJudgeOptions, CODING_HARNESSES, type CachedJudge, type CachedJudgeOptions, CallExpectation, type CanaryAlert, type CanaryKind, type CanaryLeak, type CanaryOptions, type CanaryReport, type CanarySeverity, type CandidateComparison, type CandidateScenario, type CapabilityHeadroomOptions, type CapabilityHeadroomResult, type CausalAttributionReport, type CellVerdict, ChannelRollup, ChatRequest, CheckResult, type ClusterBootstrapInterval, type ClusterSignFlipAlternative, type ClusterSignFlipResult, type ClusteredBinaryCluster, type ClusteredMatchedPair, type ClusteredPairedBinaryOptions, type ClusteredPairedBinaryResult, type ClusteredPairedBinaryStatistics, CollectedArtifacts, type CommandRunner, type CompareLabels, CompletionCriterion, ConfigError, type ContinuityCheck, type ContinuityCheckResult, type ContinuityReport, type ContinuitySnapshotPair, type ContractCheckResult, type ContractJudgeOptions, type ContractMetric, type ContractReport, type ContractRule, type ContractRuleKind, type ContractSpan, type ContractVerdict, type ContractViolation, ControlEvalResult, ControlSeverity, ConvergenceTracker, CorrectnessChecker, type CostEntry, CostLedger, type CostReport, type CostSummary, CostTracker, type CounterfactualContext, type CounterfactualMutation, type CounterfactualResult, type CounterfactualRunner, CreateChatClientOpts, type CreateDefaultReviewerOptions, type CreateExperimentInput, type CreateSandboxPoolOpts, CrossFamilyError, type CrossTraceDiff, type CrossTraceDiffOptions, DEFAULT_AGENT_SLOS, DEFAULT_FINDERS, DEFAULT_HARNESS_OBJECTIVES, DEFAULT_MUTATION_PRIMITIVES, DEFAULT_MUTATORS, DEFAULT_PR_REVIEW_SCORE_WEIGHTS, DEFAULT_SEVERITY_WEIGHTS, type DataAcquisitionPlan, Dataset, DatasetScenario, type DecideNextUserTurnOpts, DefaultVerdict, type DeployFamily, type DeployGateLayerInput, type DeployRunResult, type DeployRunner, type DescriptionLengthCandidate, type DescriptionLengthConfig, type DescriptionLengthDecision, type DescriptionLengthEvidence, DescriptionLengthGate, type DescriptionLengthRejectionCode, type DetectorEvent, type DetectorSeverity, type DetectorSignal, type DiffScorecardOptions, type DirEntry, type DiscoverPersonasOptions, type DiscoveredPersona, DriverResult, DriverState, DualAgentBench, type DualAgentBenchConfig, type DualAgentReport, type DualAgentRound, type DualAgentScenario, type DualAgentScenarioResult, ERROR_COUNT_PATTERNS, type EnsembleAggregate, type EnsembleJudgeOptions, type ErrorCountPattern, type ErrorStreakOptions, type EvalToolDef, EvalTraceStore, type EvolutionRound, type ExecutorConfig, type Expectation, type Experiment, type ExperimentProvenance, type ExperimentRep, type ExperimentStats, type ExperimentStore, ExperimentTracker, type ExperimentTrackerOptions, type ExperimentVerdict, type ExportedRewardModel, type ExtractOptions, type ExtractResult, type FactorContribution, type FactorialCell, FailureClass, FeedbackLabel, FeedbackTrajectory, FeedbackTrajectoryStore, type FieldAgreementSpec, type FieldDestination, type FileChange, type FlowAction, type FlowLayerEnv, type FlowLayerFactoryInput, type FlowRunner, type FlowRunnerStepResult, type FlowSpec, type FlowStep, type GhCliClientOptions, type GoldScenario, type GoldSplit, type GoldenSeverity, type GoldenSpec, HARNESS_NATIVE_MODEL, type HarnessAdapter, HarnessConfig, type HarnessExperimentConfig, type HarnessExperimentResult, type HarnessIntervention, type HarnessRunRequest, type HarnessRunResult, type HarnessScenario, type HarnessSelection, type HarnessVariant, type HarnessVariantReport, type HeadroomClass, type HeadroomInput, type HeldOutPartition, type HiddenCriteriaGrader, type HiddenGradeResult, type HiddenLeak, HoldoutAuditor, type HttpGithubClientOptions, INTENT_MATCH_JUDGE_VERSION, type ImageData, type ImprovementThresholds, type ImprovementVerdictResult, InMemoryWorkspaceInspector, type InferenceScorer, type InspectorContext, type IntentMatchInput, type IntentMatchOptions, type IntentMatchResult, type InteractionContribution, JudgeError, type JudgeFamily, type JudgeFleetOptions, JudgeFn, JudgeParseError, type JudgeReplayResult, type JudgeRetryOutcome, type JudgeRetryPolicy, JudgeRunner, type JudgeScoreInput, type JudgeVerdict, type KeywordConceptSpec, type KeywordCoverageFinding, type KeywordCoverageOptions, type KeywordCoverageResult, type KnowledgeAcquisitionMode, type KnowledgeBundle, type KnowledgeFallbackPolicy, type KnowledgeFreshness, type KnowledgeImportance, type KnowledgeReadinessReport, type KnowledgeRecommendedAction, type KnowledgeRequirement, type KnowledgeRequirementCategory, type KnowledgeResponsibleSurface, type KnowledgeSensitivity, type LangfuseEnvelope, type LangfuseGeneration, type LangfuseScore, Layer, LayerResult, type LeaderboardOptions, type LeaderboardRow, type LiveProofArtifact, type LiveProofConfig, type LiveProofContext, type LiveProofResult, LlmClientOptions, LlmSpan, LockedJsonlAppender, MODEL_PRICING, type MakeEvalToolsConfig, type MatchResult, type MatcherResult, type MeasurementPolicy, type MergeOptions, MetricsCollector, type ModelCostRollup, type ModelPreflight, type ModelSeats, ModelsUnreachableError, type MuffledFinder, type MuffledFinding, type MultiToolchainLayerConfig, type Mutator, Mutex, type NoLeakOptions, type NoProgressOptions, Objective, type Oracle, type OracleObservation, type OracleReport, type OracleResult, type OrthogonalityInput, type OrthogonalityResult, OtelExportConfig, OtelExporter, type OtelPipelineHandle, type OtelPipelineOptions, PairwiseSteeringOptimizer, type ParaphraseRobustnessScenarioInput, type ParaphraseRobustnessScenarioResult, ParetoResult, type ParseStudentLabel, type PartitionHeldOutOptions, PersonaConfig, type Playbook, type PlaybookEntry, type PoolSlot, type PrReviewAuditCase, type PrReviewBenchmarkSummary, type PrReviewComment, type PrReviewMatchedFinding, type PrReviewOutcome, type PrReviewReferenceFinding, type PrReviewScore, type PrReviewScoreWeights, type PrReviewSeverity, type PrReviewSource, type PreflightModelsOptions, type PreflightOutcome, type ProductBenchmarkArm, type ProductBenchmarkArtifactPaths, type ProductBenchmarkBudgets, type ProductBenchmarkExportOptions, type ProductBenchmarkExportResult, type ProductBenchmarkManifest, type ProductBenchmarkProfileRef, type ProductBenchmarkRecord, type ProductBenchmarkRepoRef, type ProductBenchmarkRunInput, type ProductBenchmarkScenario, type ProductBenchmarkSingleRunExportOptions, type ProductBenchmarkSplit, type ProductBenchmarkSubstrateVersions, type ProductBenchmarkValidationReport, ProductClient, ProductClientConfig, type ProfileAxisSpec, type PromptHandle, PromptRegistry, type ProposeAutomatedPullRequestInput, type ProposeAutomatedPullRequestResult, type ProvenanceReader, type RecordRunsOptions, type ReferenceMatchResult, type ReferenceReplayAdapter, type ReferenceReplayAdapterFn, type ReferenceReplayAdapterLike, type ReferenceReplayAggregate, type ReferenceReplayCandidate, type ReferenceReplayCase, type ReferenceReplayCaseRun, type ReferenceReplayExecutionScenario, type ReferenceReplayItem, type ReferenceReplayMatch, type ReferenceReplayMatchStrategy, type ReferenceReplayMatcher, type ReferenceReplayPromotionDecision, type ReferenceReplayPromotionPolicy, type ReferenceReplayRun, type ReferenceReplayRunContext, type ReferenceReplayRunOptions, type ReferenceReplayRunStore, type ReferenceReplayScenario, type ReferenceReplayScenarioScore, type ReferenceReplayScore, type ReferenceReplayScoreOptions, type ReferenceReplaySplit, type ReferenceReplaySplitComparison, type ReferenceReplaySteeringRowsOptions, type ReflectionContext, type ReflectionProposal, ReleaseConfidenceScorecard, ReleaseConfidenceThresholds, type RenderStudentPrompt, type RepeatedActionOptions, type RepoRef, type ReviewerMemoryEntry, type ReviewerOutput, type ReviewerPromptInput, type ReviewerSoftFailDefaults, type ReviewerVerificationSummary, type RobustnessResult, type RoutedField, Run, type RunCommandInput, type RunCommandResult, type RunDistillationOptions, type RunDistillationResult, RunFilter, RunRecord, type RunRecordBackend, type RunRecordFilter, RunScore, RunScoreWeights, RunSplitTag, RunTrace, type RuntimeResolution, SandboxDriver, SandboxHarnessResult, type SandboxJudgeKind, type SandboxJudgeResult, type SandboxJudgeSpec, type SandboxPool, type ScanOptions, Scenario, type ScenarioCost, ScenarioFile, ScenarioRegistry, ScenarioResult, type ScoreKnowledgeReadinessOptions, type Scorecard, type ScorecardCell, type ScorecardCellDiff, type ScorecardDiff, type ScorecardEntry, type ScorecardLogLine, type ScoredTarget, type SeatName, type SeatPresetName, SeatUnsetError, type SelfPlayOptions, type SelfPlayProposer, type SelfPlayScorer, type SerializedRegex, Severity, type SingleBackendDivergence, SingleBackendError, type SingleBackendField, type SingleBackendReport, type Slo, type SloCheckResult, type SloComparator, type SloReport, type SloSeverity, type SlopCategory, type SlotFactory, Span, type SpanPredicate, type SplitGoldOptions, type SteeringBundle, type SteeringDelta, type SteeringOptimizationResult, type SteeringOptimizationRow, type SteeringOptimizationSelector, type SteeringOptimizerBackend, type SteeringOptimizerConfig, type SteeringRolePrompt, type StepAttribution, type StreamingDetector, type SynthesisReason, type SynthesisTarget, type TaskHeadroom, TestResult, type TextMatcher, type ThresholdContract, TokenCounter, type TokenSpec, type ToolMatcher, ToolSpan, TraceAnalystSpan, type TraceContract, TraceContractBuilder, TraceEmitter, TraceStore, type TracedAnalystOptions, type TracedJudgeOptions, Trajectory, TrajectoryStep, type TreatmentClass, type TreatmentGate, type TreatmentGateInput, type TreatmentGateOptions, type TrialTrace, TurnMetrics, UI_FINDING_SEVERITIES, UI_LENSES, UNIVERSAL_FINDERS, type UiFinding, type UiFindingScreenshot, type UiFindingSeverity, type UiLens, type UserQuestion, type VerdictCacheStats, type VerdictCacheStore, VerifyContext, type VisualDiffOptions, type VisualDiffResult, type ViteDeployRunnerInput, type WorkerDriverContext, type WorkflowTopology, type WorkspaceAssertion, type WorkspaceAssertionResult, type WorkspaceInspector, type WorkspaceSnapshot, type WranglerDeployRunnerInput, acquisitionPlansForKnowledgeGaps, adversarialJudge, agentProfileHash, agentProfileId, agentProfileModelId, agentVisibleFields, aggregateJudgeVerdicts, aggregatePrReviewScore, analyzeAntiSlop, appendScorecard, assertCapabilityHeadroom, assertCrossFamily, assertModelsServed, assertNoHiddenLeak, assertProductBenchmarkRun, assertSingleBackend, assignHeldOutTag, attachCostToReport, attest, attributeCounterfactuals, bisect, blendHeldout, blockingKnowledgeEval, buildAgreementJudge, buildDriverSystemPrompt, buildProductBenchmarkManifest, buildReflectionPrompt, buildReviewerPrompt, buildWorkerDriverSystemPrompt, cachedJudge, canaryLeakView, canonicalJson, capabilityHeadroom, causalAttribution, checkBehavioralCanary, checkCanaries, checkSlos, checkTraceContracts, classifyTreatment, clusteredPairedBinary, codeExecutionJudge, coherenceJudge, collectionPreserved, commentsForSource, commitBisect, compareReferenceReplay, compilerJudge, computeExperimentStats, contentHash, contractJudge, costReport, createAntiSlopJudge, createCustomJudge, createDefaultReviewer, createDomainExpertJudge, createIntentMatchJudge, createSandboxPool, crossTraceDiff, dataDescriptionBits, decideNextUserTurn, decideReferenceReplayPromotion, decideReferenceReplayRunPromotion, defaultBlendWeights, defaultJudges, defaultParseStudentLabel, defaultReferenceReplayMatcher, defaultRenderStudentPrompt, deployGateLayer, diffScorecard, discoverPersonas, distillPlaybook, ensembleJudge, errorStreakDetector, estimateCost, estimateTokens, evaluateContract, evaluateOracles, evaluateTraceContract, executeScenario, expandProfileAxes, expectAgent, exportProductBenchmark, exportProductBenchmarkRuns, exportRewardModel, extractAssetUrls, extractErrorCount, fieldAgreement, fileContains, fileExists, fileExperimentStore, fileVerdictCache, findAutoMatchNoExpectation, findConstructorCwdDropped, findFallbackToPass, findLiteralTruePass, findProductBenchmarkArtifacts, findSkipCountsAsPass, flowLayer, fnv1a32, formatBenchmarkReport, formatDriverReport, formatFindings, formatScorecardDiff, gateTreatmentApplied, gateTreatmentFromMetrics, gateTreatmentFromSpans, gateTreatmentFromToolSpans, ghCliClient, gitProvenanceReader, precision as goldenPrecision, gradeOnHidden, harnessAxisOf, hashContent, hashToUnit, hiddenGrade, htmlContainsElement, httpGithubClient, improvementVerdict, inMemoryExperimentStore, inMemoryReferenceReplayStore, inMemoryRunRecordBackend, inMemoryVerdictCache, isHiddenDestination, isModelPriced, isOtelConfigured, jsonShape, jsonlReferenceReplayStore, jsonlRunRecordBackend, judgeFamily, keyPreserved, knowledgeReadinessTracePayload, leaderboard, linterJudge, loadGoldScenarios, loadScorecard, loadScorerFromGrader, localCommandRunner, lowercaseMutator, makeEvalTools, matchGoldens, matchSpan, mergeLayerResults, mergeSteeringBundle, modelDescriptionBits, multiToolchainLayer, noProgressDetector, notBlocked, observeAll, paraphraseRobustness, paraphraseRobustnessScenarios, parseGoldJsonl, parseReflectionResponse, partitionHeldOut, passOrthogonality, pixelDeltaRatio, politenessPrefixMutator, preflightModels, printDriverSummary, productBenchmarkIntegrityFailures, productBenchmarkMutableSurfaces, productBenchmarkRepoIdentity, productBenchmarkSplits, index as profile, promptBisect, proposeSynthesisTargets, readProductBenchmarkManifest, readProductBenchmarkRecords, recordRuns, recordRunsToScorecard, referenceReplayRunsToSteeringRows, referenceReplayScenarioToRunScore, regexMatches, renderMarkdownReport, renderPlaybookMarkdown, renderSteeringText, repeatedActionDetector, replayScorerOverCorpus, replayTraceThroughJudge, resolveModelPricing, resolveSeat, routeFields, rowCount, rowWhere, runAssertions, runBehavioralCanaries, runCanaries, runCounterfactual, runDistillation, runE2EWorkflow, runExpectations, runHarnessExperiment, runIntentMatchJudge, runJudgeFleet, runKeywordCoverageJudge, runKeywordCoverageJudgeUrl, runLiveProof, runRecordToProductBenchmarkRecord, runReferenceReplay, runScore, runSelfPlay, scanForMuffledGates, scoreContinuity, scoreKnowledgeReadiness, scorePrReviewComments, scorePrReviewSource, scoreReferenceReplay, seatPresets, securityJudge, selectHarnessVariant, sentenceReorderMutator, splitGold, statusAdvanced, summarizeHarnessResults, summarizePrReviewBenchmark, testJudge, textInSnapshot, toLangfuseEnvelope, toOpenAiTool, toPrometheusText, traceContract, traceJudge, traceJudgeEnsemble, tracedAnalyzeTraces, typoMutator, urlContains, userQuestionsForKnowledgeGaps, validateProductBenchmarkManifest, validateProductBenchmarkRecord, validateProductBenchmarkRun, verifyAttestation, visualDiff, viteDeployRunner, weightedRecall, whitespaceCollapseMutator, withHeldoutBlend, withJudgeRetry, withOtelPipeline, wranglerDeployRunner };
|
package/dist/index.js
CHANGED
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
checkBehavioralCanary,
|
|
10
10
|
checkCanaries,
|
|
11
11
|
runBehavioralCanaries
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WBOGKYM4.js";
|
|
13
13
|
import {
|
|
14
14
|
BENCHMARK_SPLIT_SEED,
|
|
15
15
|
benchmarks_exports,
|
|
16
16
|
deterministicSplit
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3LXTCTWL.js";
|
|
18
18
|
import {
|
|
19
19
|
DEFAULT_RULES,
|
|
20
20
|
buildTrajectory,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
computeToolUseMetrics,
|
|
24
24
|
iqr,
|
|
25
25
|
welchsTTest
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NYFUT3B3.js";
|
|
27
27
|
import {
|
|
28
28
|
analyzeSeries
|
|
29
29
|
} from "./chunk-BOD4O7OF.js";
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
agentProfileModelId,
|
|
48
48
|
codeExecutionJudge,
|
|
49
49
|
coherenceJudge,
|
|
50
|
+
comparePairedArms,
|
|
50
51
|
completionVerdict,
|
|
51
52
|
createCustomJudge,
|
|
52
53
|
createDomainExpertJudge,
|
|
@@ -57,9 +58,10 @@ import {
|
|
|
57
58
|
extractProducedState,
|
|
58
59
|
harnessAxisOf,
|
|
59
60
|
llmJudge,
|
|
61
|
+
pairArms,
|
|
60
62
|
parseCorrectnessResponse,
|
|
61
63
|
verifyCompletion
|
|
62
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-MNR6ZW4P.js";
|
|
63
65
|
import {
|
|
64
66
|
DEFAULT_MUTATION_PRIMITIVES,
|
|
65
67
|
DEFAULT_RED_TEAM_CORPUS,
|
|
@@ -83,7 +85,7 @@ import {
|
|
|
83
85
|
scoreRedTeamOutput,
|
|
84
86
|
surfaceContentHash,
|
|
85
87
|
toolNamesForRun
|
|
86
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-N6MTC3GK.js";
|
|
87
89
|
import {
|
|
88
90
|
MODEL_PRICING,
|
|
89
91
|
MetricsCollector,
|
|
@@ -102,12 +104,11 @@ import {
|
|
|
102
104
|
fileVerdictCache,
|
|
103
105
|
inMemoryVerdictCache,
|
|
104
106
|
summarizeBackendIntegrity
|
|
105
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-FAOEFFRT.js";
|
|
106
108
|
import {
|
|
107
109
|
DEFAULT_COMPLEXITY_WEIGHTS,
|
|
108
110
|
FindingsStore,
|
|
109
111
|
LockedJsonlAppender,
|
|
110
|
-
Mutex,
|
|
111
112
|
RunCritic,
|
|
112
113
|
SEMANTIC_CONCEPT_JUDGE_VERSION,
|
|
113
114
|
SKILL_USAGE_ANALYST,
|
|
@@ -118,13 +119,14 @@ import {
|
|
|
118
119
|
defaultIsMaterial,
|
|
119
120
|
diffFindings,
|
|
120
121
|
runSemanticConceptJudge
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-I2HNIE6N.js";
|
|
122
123
|
import {
|
|
123
124
|
buildDefaultAnalystRegistry,
|
|
124
125
|
computeTraceMetrics
|
|
125
126
|
} from "./chunk-LVTGFSHF.js";
|
|
126
127
|
import {
|
|
127
128
|
DEFAULT_RUN_SCORE_WEIGHTS,
|
|
129
|
+
Mutex,
|
|
128
130
|
POLICY_EDIT_AXES,
|
|
129
131
|
POLICY_EDIT_TARGET_SURFACES,
|
|
130
132
|
PolicyEditValidationError,
|
|
@@ -139,7 +141,7 @@ import {
|
|
|
139
141
|
policyEditsFromFindings,
|
|
140
142
|
scorePolicyEditReadiness,
|
|
141
143
|
validatePolicyEdit
|
|
142
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-AN5UYSVD.js";
|
|
143
145
|
import {
|
|
144
146
|
AnalystRegistry,
|
|
145
147
|
DEFAULT_TRACE_ANALYST_KINDS,
|
|
@@ -179,11 +181,11 @@ import {
|
|
|
179
181
|
evaluateReleaseConfidence,
|
|
180
182
|
judgeReplayGate,
|
|
181
183
|
renderReleaseReport
|
|
182
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-MOXWMGPC.js";
|
|
183
185
|
import {
|
|
184
186
|
runEvalCampaign
|
|
185
|
-
} from "./chunk-
|
|
186
|
-
import "./chunk-
|
|
187
|
+
} from "./chunk-LOBMT6SB.js";
|
|
188
|
+
import "./chunk-ARU2PZFM.js";
|
|
187
189
|
import {
|
|
188
190
|
evaluateInterimReleaseConfidence,
|
|
189
191
|
pairedEvalueSequence
|
|
@@ -194,7 +196,7 @@ import {
|
|
|
194
196
|
paretoChart,
|
|
195
197
|
researchReport,
|
|
196
198
|
summaryTable
|
|
197
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-DPZAEKA6.js";
|
|
198
200
|
import {
|
|
199
201
|
benjaminiHochberg,
|
|
200
202
|
bonferroni,
|
|
@@ -219,6 +221,7 @@ import {
|
|
|
219
221
|
pairedBootstrap,
|
|
220
222
|
pairedMde,
|
|
221
223
|
pairedRiskDifference,
|
|
224
|
+
pairedSignTest,
|
|
222
225
|
pairedTTest,
|
|
223
226
|
partialCredit,
|
|
224
227
|
passAtK,
|
|
@@ -233,7 +236,7 @@ import {
|
|
|
233
236
|
weightedMean,
|
|
234
237
|
wilcoxonSignedRank,
|
|
235
238
|
wilson
|
|
236
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-PJQFMIOX.js";
|
|
237
240
|
import {
|
|
238
241
|
FileSystemTraceStore,
|
|
239
242
|
InMemoryTraceStore,
|
|
@@ -1301,155 +1304,6 @@ async function runE2EWorkflow(client, name, workflow) {
|
|
|
1301
1304
|
};
|
|
1302
1305
|
}
|
|
1303
1306
|
|
|
1304
|
-
// src/paired-arms.ts
|
|
1305
|
-
function pairArms(rows, opts) {
|
|
1306
|
-
const { baselineArm, treatmentArm } = opts;
|
|
1307
|
-
if (baselineArm === treatmentArm) {
|
|
1308
|
-
throw new ValidationError(
|
|
1309
|
-
`pairArms: baselineArm and treatmentArm are both '${baselineArm}' \u2014 an arm cannot be compared to itself`
|
|
1310
|
-
);
|
|
1311
|
-
}
|
|
1312
|
-
const byArm = /* @__PURE__ */ new Map();
|
|
1313
|
-
const armsSeen = /* @__PURE__ */ new Set();
|
|
1314
|
-
for (const row of rows) {
|
|
1315
|
-
armsSeen.add(row.arm);
|
|
1316
|
-
if (row.arm !== baselineArm && row.arm !== treatmentArm) continue;
|
|
1317
|
-
const byKey = byArm.get(row.arm) ?? /* @__PURE__ */ new Map();
|
|
1318
|
-
const group = byKey.get(row.pairKey) ?? [];
|
|
1319
|
-
group.push(row);
|
|
1320
|
-
byKey.set(row.pairKey, group);
|
|
1321
|
-
byArm.set(row.arm, byKey);
|
|
1322
|
-
}
|
|
1323
|
-
for (const arm of [baselineArm, treatmentArm]) {
|
|
1324
|
-
if (!byArm.has(arm)) {
|
|
1325
|
-
const seen = [...armsSeen].sort().join(", ") || "<none>";
|
|
1326
|
-
throw new ValidationError(`pairArms: no rows for arm '${arm}' (arms present: ${seen})`);
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
const baselineByKey = byArm.get(baselineArm);
|
|
1330
|
-
const treatmentByKey = byArm.get(treatmentArm);
|
|
1331
|
-
const allKeys = [.../* @__PURE__ */ new Set([...baselineByKey.keys(), ...treatmentByKey.keys()])].sort();
|
|
1332
|
-
const pairs = [];
|
|
1333
|
-
const unpairedBaseline = [];
|
|
1334
|
-
const unpairedTreatment = [];
|
|
1335
|
-
for (const pairKey2 of allKeys) {
|
|
1336
|
-
const b = baselineByKey.get(pairKey2) ?? [];
|
|
1337
|
-
const t = treatmentByKey.get(pairKey2) ?? [];
|
|
1338
|
-
if (b.length <= 1 && t.length <= 1) {
|
|
1339
|
-
if (b.length === 1 && t.length === 1) {
|
|
1340
|
-
pairs.push({ pairKey: pairKey2, repIndex: 0, baseline: b[0], treatment: t[0] });
|
|
1341
|
-
} else {
|
|
1342
|
-
unpairedBaseline.push(...b);
|
|
1343
|
-
unpairedTreatment.push(...t);
|
|
1344
|
-
}
|
|
1345
|
-
continue;
|
|
1346
|
-
}
|
|
1347
|
-
const bByRep = indexByRepKey(b, pairKey2, baselineArm);
|
|
1348
|
-
const tByRep = indexByRepKey(t, pairKey2, treatmentArm);
|
|
1349
|
-
const repKeys = [.../* @__PURE__ */ new Set([...bByRep.keys(), ...tByRep.keys()])].sort();
|
|
1350
|
-
let repIndex = 0;
|
|
1351
|
-
for (const repKey of repKeys) {
|
|
1352
|
-
const baseline = bByRep.get(repKey);
|
|
1353
|
-
const treatment = tByRep.get(repKey);
|
|
1354
|
-
if (baseline !== void 0 && treatment !== void 0) {
|
|
1355
|
-
pairs.push({ pairKey: pairKey2, repIndex: repIndex++, baseline, treatment });
|
|
1356
|
-
} else if (baseline !== void 0) {
|
|
1357
|
-
unpairedBaseline.push(baseline);
|
|
1358
|
-
} else if (treatment !== void 0) {
|
|
1359
|
-
unpairedTreatment.push(treatment);
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
return { pairs, unpairedBaseline, unpairedTreatment };
|
|
1364
|
-
}
|
|
1365
|
-
function indexByRepKey(group, pairKey2, arm) {
|
|
1366
|
-
const byRep = /* @__PURE__ */ new Map();
|
|
1367
|
-
for (const row of group) {
|
|
1368
|
-
if (row.repKey === void 0) {
|
|
1369
|
-
throw new ValidationError(
|
|
1370
|
-
`pairArms: pairKey '${pairKey2}' has multiple reps in an arm, but a row in arm '${arm}' is missing repKey \u2014 multi-rep items require an explicit repKey on every row so reps pair by identity (pairing reps by outcome or by index would bias the paired statistics)`
|
|
1371
|
-
);
|
|
1372
|
-
}
|
|
1373
|
-
if (byRep.has(row.repKey)) {
|
|
1374
|
-
throw new ValidationError(
|
|
1375
|
-
`pairArms: duplicate repKey '${row.repKey}' for pairKey '${pairKey2}' in arm '${arm}' \u2014 (pairKey, repKey) must uniquely identify a rep within an arm`
|
|
1376
|
-
);
|
|
1377
|
-
}
|
|
1378
|
-
byRep.set(row.repKey, row);
|
|
1379
|
-
}
|
|
1380
|
-
return byRep;
|
|
1381
|
-
}
|
|
1382
|
-
function comparePairedArms(rows, opts) {
|
|
1383
|
-
const { pairs, unpairedBaseline, unpairedTreatment } = pairArms(rows, opts);
|
|
1384
|
-
let correctness = null;
|
|
1385
|
-
const baselinePass = [];
|
|
1386
|
-
const treatmentPass = [];
|
|
1387
|
-
for (const pair of pairs) {
|
|
1388
|
-
if (pair.baseline.pass === void 0 || pair.treatment.pass === void 0) continue;
|
|
1389
|
-
baselinePass.push(pair.baseline.pass ? 1 : 0);
|
|
1390
|
-
treatmentPass.push(pair.treatment.pass ? 1 : 0);
|
|
1391
|
-
}
|
|
1392
|
-
if (baselinePass.length > 0) {
|
|
1393
|
-
const mc = mcnemar(baselinePass, treatmentPass);
|
|
1394
|
-
correctness = {
|
|
1395
|
-
b10: mc.b,
|
|
1396
|
-
b01: mc.c,
|
|
1397
|
-
mcnemar: mc,
|
|
1398
|
-
riskDifference: pairedRiskDifference(baselinePass, treatmentPass)
|
|
1399
|
-
};
|
|
1400
|
-
}
|
|
1401
|
-
const metricNames = opts.metricNames ?? [
|
|
1402
|
-
...new Set(
|
|
1403
|
-
pairs.flatMap((p) => [
|
|
1404
|
-
...Object.keys(p.baseline.metrics ?? {}),
|
|
1405
|
-
...Object.keys(p.treatment.metrics ?? {})
|
|
1406
|
-
])
|
|
1407
|
-
)
|
|
1408
|
-
].sort();
|
|
1409
|
-
const metricDeltas = metricNames.map((name) => {
|
|
1410
|
-
const before = [];
|
|
1411
|
-
const after = [];
|
|
1412
|
-
let nMissing = 0;
|
|
1413
|
-
for (const pair of pairs) {
|
|
1414
|
-
const b = metricValue(pair.baseline, name);
|
|
1415
|
-
const t = metricValue(pair.treatment, name);
|
|
1416
|
-
if (b === void 0 || t === void 0) {
|
|
1417
|
-
nMissing++;
|
|
1418
|
-
continue;
|
|
1419
|
-
}
|
|
1420
|
-
before.push(b);
|
|
1421
|
-
after.push(t);
|
|
1422
|
-
}
|
|
1423
|
-
const bootstrapCi2 = before.length === 0 ? null : pairedBootstrap(before, after, opts.bootstrap);
|
|
1424
|
-
return {
|
|
1425
|
-
name,
|
|
1426
|
-
n: before.length,
|
|
1427
|
-
nMissing,
|
|
1428
|
-
medianDelta: bootstrapCi2 === null ? Number.NaN : bootstrapCi2.median,
|
|
1429
|
-
meanDelta: bootstrapCi2 === null ? Number.NaN : bootstrapCi2.mean,
|
|
1430
|
-
bootstrapCi: bootstrapCi2,
|
|
1431
|
-
wilcoxon: before.length === 0 ? null : wilcoxonSignedRank(before, after)
|
|
1432
|
-
};
|
|
1433
|
-
});
|
|
1434
|
-
return {
|
|
1435
|
-
nPairs: pairs.length,
|
|
1436
|
-
nUnpairedBaseline: unpairedBaseline.length,
|
|
1437
|
-
nUnpairedTreatment: unpairedTreatment.length,
|
|
1438
|
-
correctness,
|
|
1439
|
-
metricDeltas
|
|
1440
|
-
};
|
|
1441
|
-
}
|
|
1442
|
-
function metricValue(row, name) {
|
|
1443
|
-
const v = row.metrics?.[name];
|
|
1444
|
-
if (v === void 0) return void 0;
|
|
1445
|
-
if (!Number.isFinite(v)) {
|
|
1446
|
-
throw new ValidationError(
|
|
1447
|
-
`comparePairedArms: non-finite value for metric '${name}' on pairKey '${row.pairKey}' (arm '${row.arm}'): ${v}`
|
|
1448
|
-
);
|
|
1449
|
-
}
|
|
1450
|
-
return v;
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
1307
|
// src/clustered-paired-binary.ts
|
|
1454
1308
|
var DEFAULT_BOOTSTRAP_RESAMPLES = 1e4;
|
|
1455
1309
|
var DEFAULT_SIGN_FLIP_RESAMPLES = 1e5;
|
|
@@ -12003,6 +11857,7 @@ export {
|
|
|
12003
11857
|
pairedEvalueSequence,
|
|
12004
11858
|
pairedMde,
|
|
12005
11859
|
pairedRiskDifference,
|
|
11860
|
+
pairedSignTest,
|
|
12006
11861
|
pairedTTest,
|
|
12007
11862
|
paraphraseRobustness,
|
|
12008
11863
|
paraphraseRobustnessScenarios,
|