@tangle-network/agent-eval 0.104.0 → 0.106.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/dist/adapters/http.d.ts +1 -1
- package/dist/adapters/langchain.d.ts +1 -1
- package/dist/adapters/otel.d.ts +1 -1
- package/dist/campaign/index.d.ts +7 -7
- package/dist/campaign/index.js +9 -7
- package/dist/campaign/index.js.map +1 -1
- package/dist/{chunk-Z7FK73R5.js → chunk-JTSA52OJ.js} +50 -80
- package/dist/chunk-JTSA52OJ.js.map +1 -0
- package/dist/{chunk-BBQILVBH.js → chunk-W7AJBSNO.js} +2 -2
- package/dist/{chunk-ZKIL3VOD.js → chunk-Y7RY553D.js} +123 -17
- package/dist/chunk-Y7RY553D.js.map +1 -0
- package/dist/contract/index.d.ts +18 -7
- package/dist/contract/index.js +30 -9
- package/dist/contract/index.js.map +1 -1
- package/dist/{gepa-Dn0gtj9n.d.ts → gepa-DQ3ruj18.d.ts} +2 -2
- package/dist/hosted/index.d.ts +1 -1
- package/dist/index.d.ts +252 -6
- package/dist/index.js +226 -2
- package/dist/index.js.map +1 -1
- package/dist/multishot/index.d.ts +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{pre-registration-D8Zr8-rr.d.ts → pre-registration-BkkTmtQG.d.ts} +1 -1
- package/dist/{provenance-phkRBl4h.d.ts → provenance-HDy5TtOY.d.ts} +93 -7
- package/dist/rl.d.ts +1 -1
- package/dist/{types-Mh6I44ub.d.ts → types-Ctf7XIAL.d.ts} +1 -1
- package/docs/improvement-glossary.md +199 -0
- package/package.json +1 -1
- package/dist/chunk-Z7FK73R5.js.map +0 -1
- package/dist/chunk-ZKIL3VOD.js.map +0 -1
- /package/dist/{chunk-BBQILVBH.js.map → chunk-W7AJBSNO.js.map} +0 -0
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as Scenario, M as MutableSurface, b as DispatchContext, a as JudgeConfig, f as SurfaceProposer, g as Gate, L as LabeledScenarioStore, C as CampaignResult,
|
|
2
|
-
export {
|
|
3
|
-
import { L as LoopProvenanceRecord, R as RunEvalOptions } from '../provenance-
|
|
4
|
-
export { A as AxisEvidence, a as AxisVerdict, B as BuildEvidenceVectorOptions, D as DefaultProductionGateOptions, E as EvidenceVector, b as EvolutionaryProposerOptions, H as HeldOutGateOptions, O as ObjectiveSource,
|
|
5
|
-
import { C as CampaignStorage,
|
|
6
|
-
export { G as GepaProposerOptions,
|
|
1
|
+
import { S as Scenario, M as MutableSurface, b as DispatchContext, a as JudgeConfig, f as SurfaceProposer, g as Gate, L as LabeledScenarioStore, C as CampaignResult, h as GateDecision } from '../types-Ctf7XIAL.js';
|
|
2
|
+
export { i as CampaignAggregates, j as CampaignArtifactWriter, k as CampaignCellResult, l as CampaignCostMeter, d as CampaignTraceWriter, m as CodeSurface, D as Dispatch, n as GateContext, G as GateResult, o as GenerationCandidate, e as GenerationRecord, c as JudgeDimension, J as JudgeScore, p as Mutator, O as OptimizationProposer, q as OptimizerConfig, r as SessionScript } from '../types-Ctf7XIAL.js';
|
|
3
|
+
import { L as LoopProvenanceRecord, P as PowerPreflight, R as RunEvalOptions } from '../provenance-HDy5TtOY.js';
|
|
4
|
+
export { A as AxisEvidence, a as AxisVerdict, B as BuildEvidenceVectorOptions, D as DefaultProductionGateOptions, E as EvidenceVector, b as EvolutionaryProposerOptions, H as HeldOutGateOptions, O as ObjectiveSource, c as ParetoSignificanceGateOptions, d as PromotionObjective, e as PromotionPolicy, f as buildEvidenceVector, g as composeGate, h as defaultProductionGate, i as evolutionaryProposer, j as heldOutGate, p as paretoPolicy, k as paretoSignificanceGate, r as runEval } from '../provenance-HDy5TtOY.js';
|
|
5
|
+
import { C as CampaignStorage, R as RunOptimizationOptions, a as RunImprovementLoopResult } from '../gepa-DQ3ruj18.js';
|
|
6
|
+
export { G as GepaProposerOptions, b as RunCampaignOptions, c as RunImprovementLoopOptions, f as fsCampaignStorage, g as gepaProposer, i as inMemoryCampaignStorage, r as runCampaign, d as runImprovementLoop } from '../gepa-DQ3ruj18.js';
|
|
7
7
|
export { D as DeploymentOutcome, F as FileSystemOutcomeStore, a as FileSystemOutcomeStoreOptions, I as InMemoryOutcomeStore, b as OutcomeStore } from '../outcome-store-rnXLEqSn.js';
|
|
8
8
|
import { HostedTenant, EvalRunCellScore, EvalRunGenerationSnapshot, EvalRunEvent, TraceSpanEvent } from '../hosted/index.js';
|
|
9
9
|
import { R as RunRecord, b as RunSplitTag } from '../run-record-I-Z3JNvO.js';
|
|
@@ -45,7 +45,7 @@ import 'zod';
|
|
|
45
45
|
*
|
|
46
46
|
* Defaults:
|
|
47
47
|
* - In-memory storage (no filesystem touch).
|
|
48
|
-
* - `gepaProposer` reflective mutation with
|
|
48
|
+
* - `gepaProposer` reflective mutation with domain-neutral engineering primitives
|
|
49
49
|
* (override `proposer` or `mutationPrimitives` for any domain).
|
|
50
50
|
* - `defaultProductionGate` with `deltaThreshold: 0.05`.
|
|
51
51
|
* - Held-out split = 25% of scenarios, deterministic by id hash.
|
|
@@ -108,6 +108,12 @@ type SelfImproveProgressEvent = {
|
|
|
108
108
|
kind: 'gate.decided';
|
|
109
109
|
decision: string;
|
|
110
110
|
lift: number;
|
|
111
|
+
} | {
|
|
112
|
+
kind: 'power.estimated';
|
|
113
|
+
n: number;
|
|
114
|
+
sd: number;
|
|
115
|
+
mde: number;
|
|
116
|
+
underpowered: boolean;
|
|
111
117
|
};
|
|
112
118
|
interface SelfImproveOptions<TScenario extends Scenario, TArtifact> {
|
|
113
119
|
/**
|
|
@@ -277,6 +283,11 @@ interface SelfImproveResult<TScenario extends Scenario, TArtifact> {
|
|
|
277
283
|
* Hosted-tier dashboards render this as the v3-vs-v4 decision view.
|
|
278
284
|
*/
|
|
279
285
|
insight: InsightReport;
|
|
286
|
+
/** Minimum-detectable-lift analysis from the baseline holdout cells: could this
|
|
287
|
+
* budget have shipped ANY plausible effect? Absent when the baseline produced
|
|
288
|
+
* fewer than 3 scored holdout cells. See `powerPreflight` for the standalone
|
|
289
|
+
* pre-run version (run `gate: 'none'` first, budget the real search after). */
|
|
290
|
+
power?: PowerPreflight;
|
|
280
291
|
/**
|
|
281
292
|
* Raw substrate result for advanced inspection — full per-generation
|
|
282
293
|
* candidates, full campaign artifacts, all judge scores. Useful for
|
package/dist/contract/index.js
CHANGED
|
@@ -17,8 +17,9 @@ import {
|
|
|
17
17
|
evolutionaryProposer,
|
|
18
18
|
paretoPolicy,
|
|
19
19
|
paretoSignificanceGate,
|
|
20
|
+
powerPreflight,
|
|
20
21
|
runEval
|
|
21
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-JTSA52OJ.js";
|
|
22
23
|
import {
|
|
23
24
|
analyzeRuns
|
|
24
25
|
} from "../chunk-GDZAWO2I.js";
|
|
@@ -28,7 +29,7 @@ import {
|
|
|
28
29
|
heldOutGate,
|
|
29
30
|
runImprovementLoop,
|
|
30
31
|
surfaceContentHash
|
|
31
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-Y7RY553D.js";
|
|
32
33
|
import {
|
|
33
34
|
fsCampaignStorage,
|
|
34
35
|
inMemoryCampaignStorage,
|
|
@@ -95,12 +96,6 @@ function meanComposite(byScenario) {
|
|
|
95
96
|
perScenario
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
|
-
var DEFAULT_MUTATION_PRIMITIVES = [
|
|
99
|
-
"Tighten the hook: lead with the specific user outcome.",
|
|
100
|
-
"Replace generic adjectives with specific verbs or proof numbers.",
|
|
101
|
-
"Anchor every claim in something the scenario's brief literally supports.",
|
|
102
|
-
"Honor the surface-shape constraint (length, register, audience vocabulary)."
|
|
103
|
-
];
|
|
104
99
|
async function selfImprove(opts) {
|
|
105
100
|
const startedAt = Date.now();
|
|
106
101
|
const budget = opts.budget ?? {};
|
|
@@ -130,7 +125,9 @@ async function selfImprove(opts) {
|
|
|
130
125
|
},
|
|
131
126
|
model: opts.llm?.model ?? "anthropic/claude-sonnet-4.6",
|
|
132
127
|
target: opts.proposerTarget ?? "agent surface (system prompt or config) being optimized by selfImprove",
|
|
133
|
-
|
|
128
|
+
// Pass-through: when unset, gepaProposer falls back to its own
|
|
129
|
+
// domain-neutral engineering primitives.
|
|
130
|
+
mutationPrimitives: opts.mutationPrimitives
|
|
134
131
|
});
|
|
135
132
|
const gate = opts.gate ?? defaultProductionGate({
|
|
136
133
|
holdoutScenarios: holdout,
|
|
@@ -170,6 +167,29 @@ async function selfImprove(opts) {
|
|
|
170
167
|
});
|
|
171
168
|
const baseline = meanComposite(result.baselineOnHoldout.aggregates.byScenario);
|
|
172
169
|
const winnerStats = meanComposite(result.winnerOnHoldout.aggregates.byScenario);
|
|
170
|
+
let power;
|
|
171
|
+
const baselineHoldoutComposites = result.baselineOnHoldout.cells.filter((cell) => !cell.error).map((cell) => {
|
|
172
|
+
const scores = Object.values(cell.judgeScores);
|
|
173
|
+
return scores.length === 0 ? Number.NaN : scores.reduce((sum, s) => sum + s.composite, 0) / scores.length;
|
|
174
|
+
}).filter((v) => Number.isFinite(v));
|
|
175
|
+
if (baselineHoldoutComposites.length >= 3) {
|
|
176
|
+
power = powerPreflight({
|
|
177
|
+
baselineComposites: baselineHoldoutComposites,
|
|
178
|
+
sharedScorerChannel: true
|
|
179
|
+
});
|
|
180
|
+
if (opts.onProgress) {
|
|
181
|
+
opts.onProgress({
|
|
182
|
+
kind: "power.estimated",
|
|
183
|
+
n: power.n,
|
|
184
|
+
sd: power.sd,
|
|
185
|
+
mde: power.mde,
|
|
186
|
+
underpowered: power.underpowered
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (power.underpowered && generations > 0) {
|
|
190
|
+
console.warn(`[selfImprove] ${power.recommendation}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
173
193
|
if (opts.onProgress) {
|
|
174
194
|
opts.onProgress({
|
|
175
195
|
kind: "baseline.completed",
|
|
@@ -237,6 +257,7 @@ async function selfImprove(opts) {
|
|
|
237
257
|
durationMs,
|
|
238
258
|
totalCostUsd: totalCost,
|
|
239
259
|
insight,
|
|
260
|
+
...power ? { power } : {},
|
|
240
261
|
raw: result
|
|
241
262
|
};
|
|
242
263
|
if (opts.hostedTenant) {
|