@tangle-network/agent-eval 0.135.1 → 0.135.3
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 +28 -0
- package/dist/analyst/index.js +1 -1
- package/dist/{analyst-LsnNpSkm.js → analyst-j5je5J7c.js} +2 -2
- package/dist/{analyst-LsnNpSkm.js.map → analyst-j5je5J7c.js.map} +1 -1
- package/dist/{analyze-runs-DMo3Lb_y.d.ts → analyze-runs-Cda5Xkj1.d.ts} +3 -3
- package/dist/{analyze-runs-DMo3Lb_y.d.ts.map → analyze-runs-Cda5Xkj1.d.ts.map} +1 -1
- package/dist/{analyze-runs-qk8op0tN.js → analyze-runs-jjCmF8pU.js} +14 -7
- package/dist/analyze-runs-jjCmF8pU.js.map +1 -0
- package/dist/{baseline-BaPxoROc.js → baseline-BUeFcgrn.js} +2 -2
- package/dist/{baseline-BaPxoROc.js.map → baseline-BUeFcgrn.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-DwFrCrCS.js → benchmarks-Dfgm9ts5.js} +3 -3
- package/dist/{benchmarks-DwFrCrCS.js.map → benchmarks-Dfgm9ts5.js.map} +1 -1
- package/dist/builder-eval/index.js +1 -1
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +2 -2
- package/dist/{campaign-B0oyngTs.js → campaign-Dz8uQnhC.js} +6 -6
- package/dist/{campaign-B0oyngTs.js.map → campaign-Dz8uQnhC.js.map} +1 -1
- package/dist/{client-BIyh1RCr.d.ts → client-DcvgkaZi.d.ts} +13 -4
- package/dist/client-DcvgkaZi.d.ts.map +1 -0
- package/dist/contract/index.d.ts +3 -3
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +20 -8
- package/dist/contract/index.js.map +1 -1
- package/dist/{default-registry-BAhV-lbE.js → default-registry-CHmdy2An.js} +2 -2
- package/dist/{default-registry-BAhV-lbE.js.map → default-registry-CHmdy2An.js.map} +1 -1
- package/dist/{eval-campaign-aMG73hvX.js → eval-campaign-Cc8WZJ6b.js} +2 -2
- package/dist/{eval-campaign-aMG73hvX.js.map → eval-campaign-Cc8WZJ6b.js.map} +1 -1
- package/dist/{extract-usage-2j25whHw.js → extract-usage-DIQpN-ww.js} +2 -2
- package/dist/{extract-usage-2j25whHw.js.map → extract-usage-DIQpN-ww.js.map} +1 -1
- package/dist/hosted/index.d.ts +1 -1
- package/dist/{index-BoJNQR6n.d.ts → index-B4Fjfo5U.d.ts} +93 -15
- package/dist/index-B4Fjfo5U.d.ts.map +1 -0
- package/dist/{index-C21xKtxu.d.ts → index-CQsJcqch.d.ts} +3 -3
- package/dist/{index-C21xKtxu.d.ts.map → index-CQsJcqch.d.ts.map} +1 -1
- package/dist/{index-DSC51roc2.d.ts → index-DSC51roc.d.ts} +1 -1
- package/dist/index-DSC51roc.d.ts.map +1 -0
- package/dist/index.d.ts +42 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +136 -58
- package/dist/index.js.map +1 -1
- package/dist/matrix/index.d.ts +1 -1
- package/dist/meta-eval/index.d.ts +1 -2
- package/dist/meta-eval/index.d.ts.map +1 -1
- package/dist/meta-eval/index.js +2 -2
- package/dist/multishot/index.d.ts +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{paired-arms-CA_8pN01.js → paired-arms-BbFKrAU-.js} +2 -2
- package/dist/{paired-arms-CA_8pN01.js.map → paired-arms-BbFKrAU-.js.map} +1 -1
- package/dist/pipelines/index.js +2 -2
- package/dist/{release-report-BVZBmRZp.js → release-report-DooPguBc.js} +4 -3
- package/dist/{release-report-BVZBmRZp.js.map → release-report-DooPguBc.js.map} +1 -1
- package/dist/{release-report-CuULWKyk.d.ts → release-report-DpBxGGI1.d.ts} +2 -2
- package/dist/{release-report-CuULWKyk.d.ts.map → release-report-DpBxGGI1.d.ts.map} +1 -1
- package/dist/{replay-BI6CVKkp.d.ts → replay-BRfMIs81.d.ts} +39 -21
- package/dist/replay-BRfMIs81.d.ts.map +1 -0
- package/dist/{replay-CJfGLdx4.js → replay-C6wRg47C.js} +23 -41
- package/dist/replay-C6wRg47C.js.map +1 -0
- package/dist/reporting.d.ts +3 -3
- package/dist/reporting.js +4 -4
- package/dist/{researcher-DVtruQ9U.d.ts → researcher-Doo95b50.d.ts} +2 -2
- package/dist/{researcher-DVtruQ9U.d.ts.map → researcher-Doo95b50.d.ts.map} +1 -1
- package/dist/{reward-hacking-DCdRK9TY.js → reward-hacking-a-kYs0-i.js} +2 -2
- package/dist/{reward-hacking-DCdRK9TY.js.map → reward-hacking-a-kYs0-i.js.map} +1 -1
- package/dist/rl.d.ts +45 -3
- package/dist/rl.d.ts.map +1 -1
- package/dist/rl.js +108 -22
- package/dist/rl.js.map +1 -1
- package/dist/{rubric-predictive-validity-D6Q6n9oq.js → rubric-predictive-validity-BJf-8ejY.js} +2 -2
- package/dist/{rubric-predictive-validity-D6Q6n9oq.js.map → rubric-predictive-validity-BJf-8ejY.js.map} +1 -1
- package/dist/{skillopt-optimization-method-C9yGg-4C.js → skillopt-optimization-method-0UmPD6aP.js} +340 -54
- package/dist/skillopt-optimization-method-0UmPD6aP.js.map +1 -0
- package/dist/{skillopt-optimization-method-DJ3l4w8W.d.ts → skillopt-optimization-method-CwSYkv35.d.ts} +39 -9
- package/dist/skillopt-optimization-method-CwSYkv35.d.ts.map +1 -0
- package/dist/{statistics-D_4Snl-5.d.ts → statistics-CKOqre5S.d.ts} +329 -3
- package/dist/statistics-CKOqre5S.d.ts.map +1 -0
- package/dist/{statistics-RwRNu2__.js → statistics-CnGCLLqc.js} +315 -2
- package/dist/statistics-CnGCLLqc.js.map +1 -0
- package/dist/{summary-report-BxtossFi.js → summary-report-BEk8OFLs.js} +11 -6
- package/dist/summary-report-BEk8OFLs.js.map +1 -0
- package/dist/{summary-report-DGp0-_XO.d.ts → summary-report-CPMINBqs.d.ts} +182 -7
- package/dist/summary-report-CPMINBqs.d.ts.map +1 -0
- package/dist/{tools-BmuN627J.js → tools-D8yTtNSN.js} +132 -27
- package/dist/tools-D8yTtNSN.js.map +1 -0
- package/dist/traces.d.ts +2 -2
- package/dist/traces.js +5 -5
- package/docs/trace-analysis.md +24 -0
- package/package.json +1 -1
- package/dist/analyze-runs-qk8op0tN.js.map +0 -1
- package/dist/client-BIyh1RCr.d.ts.map +0 -1
- package/dist/index-BoJNQR6n.d.ts.map +0 -1
- package/dist/index-DSC51roc2.d.ts.map +0 -1
- package/dist/judge-calibration-DFtEMlde.d.ts +0 -146
- package/dist/judge-calibration-DFtEMlde.d.ts.map +0 -1
- package/dist/replay-BI6CVKkp.d.ts.map +0 -1
- package/dist/replay-CJfGLdx4.js.map +0 -1
- package/dist/skillopt-optimization-method-C9yGg-4C.js.map +0 -1
- package/dist/skillopt-optimization-method-DJ3l4w8W.d.ts.map +0 -1
- package/dist/statistics-D_4Snl-5.d.ts.map +0 -1
- package/dist/statistics-RwRNu2__.js.map +0 -1
- package/dist/summary-report-BxtossFi.js.map +0 -1
- package/dist/summary-report-DGp0-_XO.d.ts.map +0 -1
- package/dist/tools-BmuN627J.js.map +0 -1
package/dist/rl.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { s as ValidationError } from "./errors-8YnH8WlF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { W as wilcoxonSignedRank, s as benjaminiHochberg } from "./statistics-CnGCLLqc.js";
|
|
3
3
|
import { r as observedSplitScore, s as trainingScore } from "./reward-nw2xZGZG.js";
|
|
4
4
|
import { o as runTaskScore } from "./run-record-BIwU2wdV.js";
|
|
5
5
|
import { l as assertRewardGate } from "./schema-C6DW4ZHR.js";
|
|
6
6
|
import { t as isSplitEligible } from "./exporters-q9iL-2Jf.js";
|
|
7
7
|
import { t as mintRolloutRows } from "./mint-DyRUc9k6.js";
|
|
8
8
|
import { a as InMemoryTraceStore } from "./integrity-BzRbCHzi.js";
|
|
9
|
-
import { c as campaignCellToRunRecord, i as filterDeterministicallyRewarded, n as extractVerifiableReward, r as extractVerifiableRewardsFromRecords, t as detectRewardHacking } from "./reward-hacking-
|
|
10
|
-
import { t as runEvalCampaign } from "./eval-campaign-
|
|
9
|
+
import { c as campaignCellToRunRecord, i as filterDeterministicallyRewarded, n as extractVerifiableReward, r as extractVerifiableRewardsFromRecords, t as detectRewardHacking } from "./reward-hacking-a-kYs0-i.js";
|
|
10
|
+
import { t as runEvalCampaign } from "./eval-campaign-Cc8WZJ6b.js";
|
|
11
11
|
import { t as evaluateInterimReleaseConfidence } from "./sequential-Br0mAPHA.js";
|
|
12
|
-
import { t as rubricPredictiveValidity } from "./rubric-predictive-validity-
|
|
12
|
+
import { t as rubricPredictiveValidity } from "./rubric-predictive-validity-BJf-8ejY.js";
|
|
13
13
|
import { n as thompsonCurriculum, r as varianceBasedCurriculum, t as observationsFromRunRecords } from "./active-curriculum-C4mk67HP.js";
|
|
14
14
|
import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "./outcome-store-ChBKlTd_.js";
|
|
15
15
|
import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
@@ -1558,8 +1558,13 @@ var PredictiveValidityResearcher = class {
|
|
|
1558
1558
|
unpairedCandidateRuns: 0,
|
|
1559
1559
|
unpairedBaselineRuns: 0,
|
|
1560
1560
|
medianPairedDelta: null,
|
|
1561
|
+
deltaStatistic: "median_bootstrap",
|
|
1562
|
+
decidingDelta: null,
|
|
1561
1563
|
pairedCI: null,
|
|
1562
1564
|
pairedPValue: null,
|
|
1565
|
+
mcnemar: null,
|
|
1566
|
+
binaryScale: null,
|
|
1567
|
+
tieFraction: null,
|
|
1563
1568
|
searchScore: null,
|
|
1564
1569
|
holdoutScore: null,
|
|
1565
1570
|
overfitGap: null,
|
|
@@ -2038,11 +2043,18 @@ async function runRLCampaign(opts) {
|
|
|
2038
2043
|
split: opts.preferences?.split ?? splitTag
|
|
2039
2044
|
});
|
|
2040
2045
|
let interimConfidence = null;
|
|
2046
|
+
let deltaCoverage = [];
|
|
2047
|
+
const minDeltaCoverage = opts.sequential?.minDeltaCoverage ?? 1;
|
|
2048
|
+
if (!(Number.isFinite(minDeltaCoverage) && minDeltaCoverage >= 0 && minDeltaCoverage <= 1)) throw new Error(`runRLCampaign: sequential.minDeltaCoverage must be a finite fraction in [0, 1], got ${minDeltaCoverage}`);
|
|
2041
2049
|
if (opts.report?.comparator) {
|
|
2042
2050
|
const comparator = opts.report.comparator;
|
|
2043
|
-
const
|
|
2044
|
-
|
|
2045
|
-
|
|
2051
|
+
const series = collectPairedDeltaSeries(campaign.runs, campaign.failedRuns, comparator);
|
|
2052
|
+
deltaCoverage = series.map((s) => s.coverage);
|
|
2053
|
+
if (series.every((s) => s.coverage.coverage >= minDeltaCoverage) && series.some((s) => s.deltas.length > 0)) interimConfidence = evaluateInterimReleaseConfidence({
|
|
2054
|
+
deltaSeries: series.map(({ candidateId, deltas }) => ({
|
|
2055
|
+
candidateId,
|
|
2056
|
+
deltas
|
|
2057
|
+
})),
|
|
2046
2058
|
alpha: opts.sequential?.alpha,
|
|
2047
2059
|
bound: opts.sequential?.bound,
|
|
2048
2060
|
rope: opts.sequential?.rope ?? opts.report?.rope
|
|
@@ -2066,6 +2078,7 @@ async function runRLCampaign(opts) {
|
|
|
2066
2078
|
campaign,
|
|
2067
2079
|
preferences,
|
|
2068
2080
|
interimConfidence,
|
|
2081
|
+
deltaCoverage,
|
|
2069
2082
|
rewardHacking,
|
|
2070
2083
|
predictiveValidity
|
|
2071
2084
|
});
|
|
@@ -2074,6 +2087,7 @@ async function runRLCampaign(opts) {
|
|
|
2074
2087
|
rewardSignals,
|
|
2075
2088
|
preferences,
|
|
2076
2089
|
interimConfidence,
|
|
2090
|
+
deltaCoverage,
|
|
2077
2091
|
rewardHacking,
|
|
2078
2092
|
predictiveValidity,
|
|
2079
2093
|
trainerRows,
|
|
@@ -2081,36 +2095,108 @@ async function runRLCampaign(opts) {
|
|
|
2081
2095
|
kind: "agent-eval-rl-campaign"
|
|
2082
2096
|
};
|
|
2083
2097
|
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2098
|
+
/**
|
|
2099
|
+
* Pair on (scenarioId, seed) and count what was DEALT, not only what paired.
|
|
2100
|
+
*
|
|
2101
|
+
* Every drop below used to be silent: a comparator run with no score never
|
|
2102
|
+
* entered the map, a candidate run with no score was skipped, and a candidate
|
|
2103
|
+
* cell with no comparator at the same identity was skipped. The surviving
|
|
2104
|
+
* deltas then flowed into `evaluateInterimReleaseConfidence`, whose
|
|
2105
|
+
* `recommendation.decision` can be `promote_now` — so a candidate that scored 6
|
|
2106
|
+
* of 26 cells could be recommended for promotion off a series of length 6, with
|
|
2107
|
+
* nothing in the result saying 20 cells went dark. Same defect as the promotion
|
|
2108
|
+
* gates, one call frame up.
|
|
2109
|
+
*
|
|
2110
|
+
* The denominator is MEASURED: a cell counts as dealt because a run for it
|
|
2111
|
+
* exists on either arm. Missing scores are not imputed — the caller who knows
|
|
2112
|
+
* the failure value of its metric writes it onto the record.
|
|
2113
|
+
*/
|
|
2114
|
+
function collectPairedDeltaSeries(runs, failedRuns, comparator) {
|
|
2115
|
+
const cellKey = (r) => `${r.scenarioId}::${r.seed}`;
|
|
2116
|
+
const dealtFromFailures = /* @__PURE__ */ new Map();
|
|
2117
|
+
for (const f of failedRuns) {
|
|
2118
|
+
let set = dealtFromFailures.get(f.variantId);
|
|
2119
|
+
if (!set) {
|
|
2120
|
+
set = /* @__PURE__ */ new Set();
|
|
2121
|
+
dealtFromFailures.set(f.variantId, set);
|
|
2122
|
+
}
|
|
2123
|
+
set.add(cellKey(f));
|
|
2124
|
+
}
|
|
2125
|
+
const comparatorDealt = new Set(dealtFromFailures.get(comparator) ?? []);
|
|
2126
|
+
const comparatorScore = /* @__PURE__ */ new Map();
|
|
2086
2127
|
for (const r of runs) {
|
|
2087
2128
|
if (r.candidateId !== comparator) continue;
|
|
2088
|
-
const
|
|
2129
|
+
const key = cellKey(r);
|
|
2130
|
+
comparatorDealt.add(key);
|
|
2089
2131
|
const score = runTaskScore(r);
|
|
2090
2132
|
if (score === void 0) continue;
|
|
2091
|
-
|
|
2133
|
+
comparatorScore.set(key, score);
|
|
2134
|
+
}
|
|
2135
|
+
const dealtByCandidate = /* @__PURE__ */ new Map();
|
|
2136
|
+
const scoreByCandidate = /* @__PURE__ */ new Map();
|
|
2137
|
+
for (const [variantId, cells] of dealtFromFailures) {
|
|
2138
|
+
if (variantId === comparator) continue;
|
|
2139
|
+
dealtByCandidate.set(variantId, new Set(cells));
|
|
2092
2140
|
}
|
|
2093
|
-
const byCandidate = /* @__PURE__ */ new Map();
|
|
2094
2141
|
for (const r of runs) {
|
|
2095
2142
|
if (r.candidateId === comparator) continue;
|
|
2096
|
-
const
|
|
2143
|
+
const key = cellKey(r);
|
|
2144
|
+
let dealt = dealtByCandidate.get(r.candidateId);
|
|
2145
|
+
if (!dealt) {
|
|
2146
|
+
dealt = /* @__PURE__ */ new Set();
|
|
2147
|
+
dealtByCandidate.set(r.candidateId, dealt);
|
|
2148
|
+
}
|
|
2149
|
+
dealt.add(key);
|
|
2097
2150
|
const score = runTaskScore(r);
|
|
2098
2151
|
if (score === void 0) continue;
|
|
2099
|
-
|
|
2100
|
-
if (
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2152
|
+
let scored = scoreByCandidate.get(r.candidateId);
|
|
2153
|
+
if (!scored) {
|
|
2154
|
+
scored = /* @__PURE__ */ new Map();
|
|
2155
|
+
scoreByCandidate.set(r.candidateId, scored);
|
|
2156
|
+
}
|
|
2157
|
+
scored.set(key, score);
|
|
2104
2158
|
}
|
|
2105
|
-
return [...
|
|
2106
|
-
candidateId
|
|
2107
|
-
deltas
|
|
2108
|
-
|
|
2159
|
+
return [...dealtByCandidate.entries()].map(([candidateId, candidateDealt]) => {
|
|
2160
|
+
const scored = scoreByCandidate.get(candidateId) ?? /* @__PURE__ */ new Map();
|
|
2161
|
+
const deltas = [];
|
|
2162
|
+
let unscoredCandidate = 0;
|
|
2163
|
+
let unscoredComparator = 0;
|
|
2164
|
+
let unmatched = 0;
|
|
2165
|
+
for (const key of /* @__PURE__ */ new Set([...candidateDealt, ...comparatorDealt])) {
|
|
2166
|
+
const onCandidate = candidateDealt.has(key);
|
|
2167
|
+
const onComparator = comparatorDealt.has(key);
|
|
2168
|
+
if (!onCandidate || !onComparator) {
|
|
2169
|
+
unmatched += 1;
|
|
2170
|
+
continue;
|
|
2171
|
+
}
|
|
2172
|
+
const a = scored.get(key);
|
|
2173
|
+
const b = comparatorScore.get(key);
|
|
2174
|
+
if (a === void 0) unscoredCandidate += 1;
|
|
2175
|
+
else if (b === void 0) unscoredComparator += 1;
|
|
2176
|
+
else deltas.push(a - b);
|
|
2177
|
+
}
|
|
2178
|
+
const dealt = (/* @__PURE__ */ new Set([...candidateDealt, ...comparatorDealt])).size;
|
|
2179
|
+
return {
|
|
2180
|
+
candidateId,
|
|
2181
|
+
deltas,
|
|
2182
|
+
coverage: {
|
|
2183
|
+
candidateId,
|
|
2184
|
+
dealt,
|
|
2185
|
+
answered: deltas.length,
|
|
2186
|
+
unscoredCandidate,
|
|
2187
|
+
unscoredComparator,
|
|
2188
|
+
unmatched,
|
|
2189
|
+
coverage: dealt === 0 ? 0 : deltas.length / dealt
|
|
2190
|
+
}
|
|
2191
|
+
};
|
|
2192
|
+
});
|
|
2109
2193
|
}
|
|
2110
2194
|
function buildSummary(args) {
|
|
2111
2195
|
const c = args.campaign;
|
|
2112
2196
|
const lines = [`${c.campaignId}: ${c.runs.length} successful runs / ${c.failedRuns.length} failed (fingerprint ${c.campaignFingerprint.slice(0, 12)}…)`, `preferences: ${args.preferences.pairs.length} (${args.preferences.strategy}, ${args.preferences.pairsBelowMargin} below margin)`];
|
|
2113
2197
|
if (args.interimConfidence) lines.push(`sequential verdict: ${args.interimConfidence.recommendation.decision}` + (args.interimConfidence.recommendation.candidateId ? ` ${args.interimConfidence.recommendation.candidateId}` : ""));
|
|
2198
|
+
const shortfall = args.deltaCoverage.filter((c) => c.answered < c.dealt);
|
|
2199
|
+
if (shortfall.length > 0) lines.push(`paired-delta coverage: ${shortfall.map((c) => `${c.candidateId} ${c.answered}/${c.dealt}`).join(", ")}${args.interimConfidence ? "" : " (sequential verdict withheld)"}`);
|
|
2114
2200
|
lines.push(`reward-hacking: ${args.rewardHacking.verdict} (${args.rewardHacking.findings.length} signals checked)`);
|
|
2115
2201
|
if (args.predictiveValidity) {
|
|
2116
2202
|
const top = args.predictiveValidity.ranked[0];
|