@tangle-network/agent-eval 0.106.0 → 0.106.1

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.
@@ -5,7 +5,7 @@ import { S as Scenario, M as MutableSurface, b as DispatchContext, a as JudgeCon
5
5
  export { i as CampaignAggregates, j as CampaignArtifactWriter, k as CampaignCellResult, l as CampaignCostMeter, z as CampaignTokenUsage, d as CampaignTraceWriter, D as DispatchFn, n as GateContext, h as GateDecision, G as GateResult, o as GenerationCandidate, A as JudgeAggregate, c as JudgeDimension, p as Mutator, O as OptimizationProposer, q as OptimizerConfig, P as ParetoParent, R as RedactionStatus, B as ScenarioAggregate, r as SessionScript, T as TraceSpan, E as isProposedCandidate, F as labelTrustRank } from '../types-Ctf7XIAL.js';
6
6
  import { e as CampaignRunPlan, P as PlanCampaignRunOptions, C as CampaignStorage, b as RunCampaignOptions, c as RunImprovementLoopOptions } from '../gepa-DQ3ruj18.js';
7
7
  export { h as CampaignRunPlanCell, j as GepaProposerConstraints, G as GepaProposerOptions, O as OpenAutoPrOptions, k as OpenAutoPrResult, a as RunImprovementLoopResult, R as RunOptimizationOptions, l as RunOptimizationResult, m as countSentenceEdits, n as defaultRenderDiff, o as extractH2Sections, f as fsCampaignStorage, g as gepaProposer, i as inMemoryCampaignStorage, p as openAutoPr, q as planCampaignRun, r as runCampaign, d as runImprovementLoop, s as runOptimization, t as surfaceHash } from '../gepa-DQ3ruj18.js';
8
- export { A as AxisEvidence, a as AxisVerdict, B as BuildEvidenceVectorOptions, l as BuildLoopProvenanceArgs, D as DefaultProductionGateOptions, m as EmitLoopProvenanceArgs, n as EmitLoopProvenanceResult, E as EvidenceVector, b as EvolutionaryProposerOptions, H as HeldOutGateOptions, o as LoopProvenanceBackend, q as LoopProvenanceCandidate, L as LoopProvenanceRecord, O as ObjectiveSource, c as ParetoSignificanceGateOptions, P as PowerPreflight, s as PowerPreflightOptions, d as PromotionObjective, e as PromotionPolicy, R as RunEvalOptions, f as buildEvidenceVector, t as buildLoopProvenanceRecord, g as composeGate, h as defaultProductionGate, u as emitLoopProvenance, i as evolutionaryProposer, j as heldOutGate, v as loopProvenanceSpans, p as paretoPolicy, k as paretoSignificanceGate, w as powerPreflight, x as provenanceRecordPath, y as provenanceSpansPath, r as runEval, z as surfaceContentHash } from '../provenance-HDy5TtOY.js';
8
+ export { A as AxisEvidence, a as AxisVerdict, B as BuildEvidenceVectorOptions, l as BuildLoopProvenanceArgs, D as DefaultProductionGateOptions, m as EmitLoopProvenanceArgs, n as EmitLoopProvenanceResult, E as EvidenceVector, b as EvolutionaryProposerOptions, H as HeldOutGateOptions, o as LoopProvenanceBackend, q as LoopProvenanceCandidate, L as LoopProvenanceRecord, O as ObjectiveSource, c as ParetoSignificanceGateOptions, P as PowerPreflight, s as PowerPreflightOptions, d as PromotionObjective, e as PromotionPolicy, R as RunEvalOptions, f as buildEvidenceVector, t as buildLoopProvenanceRecord, g as composeGate, h as defaultProductionGate, u as emitLoopProvenance, i as evolutionaryProposer, j as heldOutGate, v as loopProvenanceSpans, p as paretoPolicy, k as paretoSignificanceGate, w as powerPreflight, x as provenanceRecordPath, y as provenanceSpansPath, r as runEval, z as surfaceContentHash } from '../provenance-BGPBEFoV.js';
9
9
  import { E as EProcessState, a as PairedBootstrapResult } from '../statistics-D88peojY.js';
10
10
  import { L as LlmClientOptions } from '../llm-client-DyqEH4jH.js';
11
11
  import { AgentProfile } from '@tangle-network/agent-interface';
@@ -391,7 +391,17 @@ interface PairedHoldout {
391
391
  declare function pairHoldout(candidate: Map<string, Record<string, JudgeScore>>, baseline: Map<string, Record<string, JudgeScore>>, scenarioIds: Set<string>, select: (s: JudgeScore) => number | undefined): PairedHoldout;
392
392
  interface HeldoutSignificance {
393
393
  paired: PairedHoldout;
394
+ /** The bootstrap the ship decision keys on — of the MEAN paired delta by
395
+ * default (see the tie note on `heldoutSignificance`). */
394
396
  bootstrap: PairedBootstrapResult;
397
+ /** The MEDIAN paired-delta bootstrap, reported as a diagnostic. When many
398
+ * scenarios are tied (both sides solve them), the median is pinned near 0
399
+ * regardless of the mean lift — comparing the two exposes tie-domination. */
400
+ medianBootstrap: PairedBootstrapResult;
401
+ /** Fraction of paired observations that are exact ties (|delta| < 1e-9). A
402
+ * high tie fraction is WHY a median-based gate would have missed a real lift;
403
+ * it is the observability the tie fix adds. */
404
+ tieFraction: number;
395
405
  /** n paired observations. */
396
406
  n: number;
397
407
  /** True iff n >= minProductiveRuns AND the CI lower bound clears the threshold. */
@@ -7,7 +7,7 @@ import {
7
7
  paretoSignificanceGate,
8
8
  powerPreflight,
9
9
  runEval
10
- } from "../chunk-JTSA52OJ.js";
10
+ } from "../chunk-IA3X6CSF.js";
11
11
  import {
12
12
  HARNESS_NATIVE_MODEL,
13
13
  agentProfileHash,
@@ -17,7 +17,7 @@ import {
17
17
  harnessAxisOf,
18
18
  llmJudge,
19
19
  verifyCompletion
20
- } from "../chunk-W7AJBSNO.js";
20
+ } from "../chunk-2HLM4SJJ.js";
21
21
  import {
22
22
  buildLoopProvenanceRecord,
23
23
  campaignBreakdown,
@@ -43,7 +43,7 @@ import {
43
43
  runOptimization,
44
44
  surfaceContentHash,
45
45
  surfaceHash
46
- } from "../chunk-Y7RY553D.js";
46
+ } from "../chunk-3E5KUXYZ.js";
47
47
  import {
48
48
  assertRealBackend,
49
49
  contentHash,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recoverTruncatedJson
3
- } from "./chunk-Y7RY553D.js";
3
+ } from "./chunk-3E5KUXYZ.js";
4
4
  import {
5
5
  clamp01
6
6
  } from "./chunk-LOJ2QVCE.js";
@@ -858,4 +858,4 @@ export {
858
858
  agentProfileModelId,
859
859
  agentProfileHash
860
860
  };
861
- //# sourceMappingURL=chunk-W7AJBSNO.js.map
861
+ //# sourceMappingURL=chunk-2HLM4SJJ.js.map
@@ -1055,6 +1055,7 @@ function parseReflectionResponse(raw, maxProposals) {
1055
1055
  }
1056
1056
 
1057
1057
  // src/campaign/gates/statistical-heldout.ts
1058
+ var TIE_WARN_FRACTION = 0.4;
1058
1059
  function pairHoldout(candidate, baseline, scenarioIds, select) {
1059
1060
  const cellValue = (byCell, cellId) => {
1060
1061
  const scores = byCell.get(cellId);
@@ -1091,16 +1092,33 @@ function pairHoldout(candidate, baseline, scenarioIds, select) {
1091
1092
  function heldoutSignificance(paired, opts = {}) {
1092
1093
  const deltaThreshold = opts.deltaThreshold ?? 0;
1093
1094
  const minProductiveRuns = opts.minProductiveRuns ?? 3;
1095
+ const confidence = opts.confidence ?? 0.95;
1096
+ const resamples = opts.resamples ?? 2e3;
1097
+ const seed = opts.seed ?? 1337;
1098
+ const statistic = opts.statistic ?? "mean";
1094
1099
  const bootstrap = pairedBootstrap(paired.before, paired.after, {
1095
- confidence: opts.confidence ?? 0.95,
1096
- resamples: opts.resamples ?? 2e3,
1097
- statistic: opts.statistic ?? "median",
1098
- seed: opts.seed ?? 1337
1100
+ confidence,
1101
+ resamples,
1102
+ statistic,
1103
+ seed
1104
+ });
1105
+ const medianBootstrap = statistic === "median" ? bootstrap : pairedBootstrap(paired.before, paired.after, {
1106
+ confidence,
1107
+ resamples,
1108
+ statistic: "median",
1109
+ seed
1099
1110
  });
1100
1111
  const n = paired.before.length;
1112
+ let ties = 0;
1113
+ for (let i = 0; i < n; i += 1) {
1114
+ const after = paired.after[i] ?? 0;
1115
+ const before = paired.before[i] ?? 0;
1116
+ if (Math.abs(after - before) < 1e-9) ties += 1;
1117
+ }
1118
+ const tieFraction = n === 0 ? 0 : ties / n;
1101
1119
  const fewRuns = n < minProductiveRuns;
1102
1120
  const significant = !fewRuns && bootstrap.low > deltaThreshold;
1103
- return { paired, bootstrap, n, significant, fewRuns };
1121
+ return { paired, bootstrap, medianBootstrap, tieFraction, n, significant, fewRuns };
1104
1122
  }
1105
1123
  function detectScale(values) {
1106
1124
  return values.some((v) => Math.abs(v) > 1.5) ? 100 : 1;
@@ -1154,22 +1172,25 @@ function heldOutGate(options) {
1154
1172
  seed
1155
1173
  }
1156
1174
  );
1157
- const delta = sig.bootstrap.median;
1175
+ const delta = sig.bootstrap.mean;
1158
1176
  const passed = sig.significant;
1177
+ const tieNote = sig.tieFraction >= TIE_WARN_FRACTION ? `, ${(sig.tieFraction * 100).toFixed(0)}% tied` : "";
1159
1178
  const ci = `${(sig.bootstrap.confidence * 100).toFixed(0)}% CI [${sig.bootstrap.low.toFixed(3)}, ${sig.bootstrap.high.toFixed(3)}]`;
1160
1179
  return {
1161
1180
  decision: passed ? "ship" : "hold",
1162
1181
  reasons: passed ? [
1163
- `held-out paired \u0394 median ${delta.toFixed(3)}, CI.low ${sig.bootstrap.low.toFixed(3)} > ${deltaThreshold} (${ci}, n=${sig.n})`
1182
+ `held-out mean \u0394 ${delta.toFixed(3)}, CI.low ${sig.bootstrap.low.toFixed(3)} > ${deltaThreshold} (${ci}, n=${sig.n}${tieNote})`
1164
1183
  ] : [
1165
- sig.fewRuns ? `held-out: only ${sig.n} paired runs \u2014 too few to claim significance` : `held-out paired \u0394 median ${delta.toFixed(3)}, CI.low ${sig.bootstrap.low.toFixed(3)} \u2264 ${deltaThreshold} (${ci}, n=${sig.n})`
1184
+ sig.fewRuns ? `held-out: only ${sig.n} paired runs \u2014 too few to claim significance` : `held-out mean \u0394 ${delta.toFixed(3)}, CI.low ${sig.bootstrap.low.toFixed(3)} \u2264 ${deltaThreshold} (${ci}, n=${sig.n}${tieNote})`
1166
1185
  ],
1167
1186
  contributingGates: [
1168
1187
  {
1169
1188
  name: "heldOutGate",
1170
1189
  passed,
1171
1190
  detail: {
1172
- deltaMedian: delta,
1191
+ deltaMean: delta,
1192
+ deltaMedianDiagnostic: sig.medianBootstrap.median,
1193
+ tieFraction: sig.tieFraction,
1173
1194
  ciLow: sig.bootstrap.low,
1174
1195
  ciHigh: sig.bootstrap.high,
1175
1196
  confidence: sig.bootstrap.confidence,
@@ -2111,6 +2132,7 @@ export {
2111
2132
  buildReflectionPrompt,
2112
2133
  renderAnalystEvidence,
2113
2134
  parseReflectionResponse,
2135
+ TIE_WARN_FRACTION,
2114
2136
  pairHoldout,
2115
2137
  heldoutSignificance,
2116
2138
  detectScale,
@@ -2135,4 +2157,4 @@ export {
2135
2157
  provenanceSpansPath,
2136
2158
  emitLoopProvenance
2137
2159
  };
2138
- //# sourceMappingURL=chunk-Y7RY553D.js.map
2160
+ //# sourceMappingURL=chunk-3E5KUXYZ.js.map