@tangle-network/agent-eval 0.126.0 → 0.126.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.
- package/CHANGELOG.md +14 -0
- package/dist/analyst/index.js +3 -3
- package/dist/benchmarks/index.js +3 -3
- package/dist/campaign/index.d.ts +4 -5
- package/dist/campaign/index.js +3 -3
- package/dist/{chunk-4B7ZZHPX.js → chunk-KE2VWPZX.js} +3 -3
- package/dist/{chunk-CM4OILD2.js → chunk-LUNF2SEL.js} +4 -6
- package/dist/{chunk-CM4OILD2.js.map → chunk-LUNF2SEL.js.map} +1 -1
- package/dist/{chunk-KO2PZOGP.js → chunk-NGUYT5CI.js} +3 -3
- package/dist/{chunk-NTOV7RU5.js → chunk-VMUENW6F.js} +177 -55
- package/dist/chunk-VMUENW6F.js.map +1 -0
- package/dist/{chunk-UI4YMIN2.js → chunk-WGXIEX7P.js} +12 -1
- package/dist/chunk-WGXIEX7P.js.map +1 -0
- package/dist/contract/index.d.ts +4 -5
- package/dist/contract/index.js +3 -3
- package/dist/index.js +5 -5
- package/dist/openapi.json +1 -1
- package/docs/campaign-proposers.md +3 -3
- package/package.json +1 -1
- package/dist/chunk-NTOV7RU5.js.map +0 -1
- package/dist/chunk-UI4YMIN2.js.map +0 -1
- /package/dist/{chunk-4B7ZZHPX.js.map → chunk-KE2VWPZX.js.map} +0 -0
- /package/dist/{chunk-KO2PZOGP.js.map → chunk-NGUYT5CI.js.map} +0 -0
|
@@ -95,11 +95,22 @@ function finiteOrZero(value) {
|
|
|
95
95
|
return Number.isFinite(value) ? value : 0;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
// src/abort-signal.ts
|
|
99
|
+
function combineAbortSignals(...signals) {
|
|
100
|
+
const active = [
|
|
101
|
+
...new Set(signals.filter((signal) => signal !== void 0))
|
|
102
|
+
];
|
|
103
|
+
if (active.length === 0) return void 0;
|
|
104
|
+
if (active.length === 1) return active[0];
|
|
105
|
+
return AbortSignal.any(active);
|
|
106
|
+
}
|
|
107
|
+
|
|
98
108
|
export {
|
|
109
|
+
combineAbortSignals,
|
|
99
110
|
Mutex,
|
|
100
111
|
mapConcurrent,
|
|
101
112
|
DEFAULT_RUN_SCORE_WEIGHTS,
|
|
102
113
|
aggregateRunScore,
|
|
103
114
|
clamp01
|
|
104
115
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-WGXIEX7P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/concurrency.ts","../src/run-score.ts","../src/abort-signal.ts"],"sourcesContent":["/**\n * concurrency — small primitives the evolution loop needs.\n *\n * `Mutex` is a zero-dep async lock with FIFO fairness. The evolution loop\n * uses it to serialise checkout/build/commit sequences inside a single\n * pool slot, and to gate concurrent JSONL writers (see\n * `lockedJsonlReferenceReplayStore`).\n *\n * Deliberately minimal — no priority queue, no timeouts. If you need\n * those, swap to `async-mutex` at the call site.\n */\n\nexport class Mutex {\n private locked = false\n private readonly waiters: Array<() => void> = []\n\n async acquire(): Promise<() => void> {\n if (!this.locked) {\n this.locked = true\n return () => this.release()\n }\n return new Promise<() => void>((resolve) => {\n this.waiters.push(() => {\n resolve(() => this.release())\n })\n })\n }\n\n private release(): void {\n const next = this.waiters.shift()\n if (next) {\n next()\n } else {\n this.locked = false\n }\n }\n\n async runExclusive<T>(fn: () => Promise<T> | T): Promise<T> {\n const release = await this.acquire()\n try {\n return await fn()\n } finally {\n release()\n }\n }\n\n /** True iff someone holds the lock right now. Diagnostics only. */\n get isLocked(): boolean {\n return this.locked\n }\n\n /** Pending waiter count. Diagnostics only. */\n get pending(): number {\n return this.waiters.length\n }\n}\n\n/**\n * Map independent work with a fixed worker count while preserving input order.\n * After the first rejection, no new items start; already-running work is allowed\n * to settle before the returned promise rejects. Partial results are discarded.\n */\nexport async function mapConcurrent<T, R>(\n items: readonly T[],\n concurrency: number,\n map: (item: T, index: number) => Promise<R>,\n): Promise<R[]> {\n if (!Number.isInteger(concurrency) || concurrency < 1) {\n throw new Error(`mapConcurrent: concurrency must be a positive integer, got ${concurrency}`)\n }\n if (items.length === 0) return []\n\n const results = new Array<R>(items.length)\n let nextIndex = 0\n let stopped = false\n let failed = false\n let failure: unknown\n\n const worker = async (): Promise<void> => {\n while (!stopped) {\n const index = nextIndex\n nextIndex += 1\n if (index >= items.length) return\n\n try {\n results[index] = await map(items[index]!, index)\n } catch (error) {\n stopped = true\n if (!failed) {\n failed = true\n failure = error\n }\n }\n }\n }\n\n await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, () => worker()))\n if (failed) throw failure\n return results\n}\n","export interface RunScore {\n success: number\n goalProgress: number\n repoGroundedness: number\n driftPenalty: number\n toolUseQuality: number\n patchQuality: number\n testReality: number\n finalGate: number\n reviewerBlockers: number\n costUsd: number\n wallSeconds: number\n notes?: string[]\n}\n\nexport interface RunScoreWeights {\n success: number\n goalProgress: number\n repoGroundedness: number\n driftPenalty: number\n toolUseQuality: number\n patchQuality: number\n testReality: number\n finalGate: number\n reviewerBlockers: number\n costUsd: number\n wallSeconds: number\n}\n\nexport const DEFAULT_RUN_SCORE_WEIGHTS: RunScoreWeights = {\n success: 4,\n goalProgress: 2,\n repoGroundedness: 1.5,\n driftPenalty: -1.5,\n toolUseQuality: 1,\n patchQuality: 1.25,\n testReality: 1.5,\n finalGate: 3,\n reviewerBlockers: -2,\n costUsd: -0.2,\n wallSeconds: -0.1,\n}\n\nexport function aggregateRunScore(score: RunScore, weights: Partial<RunScoreWeights> = {}): number {\n const w = { ...DEFAULT_RUN_SCORE_WEIGHTS, ...weights }\n return (\n w.success * clamp01(score.success) +\n w.goalProgress * clamp01(score.goalProgress) +\n w.repoGroundedness * clamp01(score.repoGroundedness) +\n w.driftPenalty * clamp01(score.driftPenalty) +\n w.toolUseQuality * clamp01(score.toolUseQuality) +\n w.patchQuality * clamp01(score.patchQuality) +\n w.testReality * clamp01(score.testReality) +\n w.finalGate * clamp01(score.finalGate) +\n w.reviewerBlockers * clamp01(score.reviewerBlockers) +\n w.costUsd * Math.max(0, finiteOrZero(score.costUsd)) +\n w.wallSeconds * Math.max(0, finiteOrZero(score.wallSeconds) / 60)\n )\n}\n\nexport function clamp01(value: number): number {\n if (!Number.isFinite(value)) return 0\n return Math.max(0, Math.min(1, value))\n}\n\nfunction finiteOrZero(value: number): number {\n return Number.isFinite(value) ? value : 0\n}\n","/** Combine active cancellation sources without wrapping a single source. */\nexport function combineAbortSignals(\n ...signals: Array<AbortSignal | undefined>\n): AbortSignal | undefined {\n const active = [\n ...new Set(signals.filter((signal): signal is AbortSignal => signal !== undefined)),\n ]\n if (active.length === 0) return undefined\n if (active.length === 1) return active[0]\n return AbortSignal.any(active)\n}\n"],"mappings":";AAYO,IAAM,QAAN,MAAY;AAAA,EACT,SAAS;AAAA,EACA,UAA6B,CAAC;AAAA,EAE/C,MAAM,UAA+B;AACnC,QAAI,CAAC,KAAK,QAAQ;AAChB,WAAK,SAAS;AACd,aAAO,MAAM,KAAK,QAAQ;AAAA,IAC5B;AACA,WAAO,IAAI,QAAoB,CAAC,YAAY;AAC1C,WAAK,QAAQ,KAAK,MAAM;AACtB,gBAAQ,MAAM,KAAK,QAAQ,CAAC;AAAA,MAC9B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA,EAEQ,UAAgB;AACtB,UAAM,OAAO,KAAK,QAAQ,MAAM;AAChC,QAAI,MAAM;AACR,WAAK;AAAA,IACP,OAAO;AACL,WAAK,SAAS;AAAA,IAChB;AAAA,EACF;AAAA,EAEA,MAAM,aAAgB,IAAsC;AAC1D,UAAM,UAAU,MAAM,KAAK,QAAQ;AACnC,QAAI;AACF,aAAO,MAAM,GAAG;AAAA,IAClB,UAAE;AACA,cAAQ;AAAA,IACV;AAAA,EACF;AAAA;AAAA,EAGA,IAAI,WAAoB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA,EAGA,IAAI,UAAkB;AACpB,WAAO,KAAK,QAAQ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IACnD,EAAE,eAAe,QAAQ,MAAM,YAAY,IAC3C,EAAE,iBAAiB,QAAQ,MAAM,cAAc,IAC/C,EAAE,eAAe,QAAQ,MAAM,YAAY,IAC3C,EAAE,cAAc,QAAQ,MAAM,WAAW,IACzC,EAAE,YAAY,QAAQ,MAAM,SAAS,IACrC,EAAE,mBAAmB,QAAQ,MAAM,gBAAgB,IACnD,EAAE,UAAU,KAAK,IAAI,GAAG,aAAa,MAAM,OAAO,CAAC,IACnD,EAAE,cAAc,KAAK,IAAI,GAAG,aAAa,MAAM,WAAW,IAAI,EAAE;AAEpE;AAEO,SAAS,QAAQ,OAAuB;AAC7C,MAAI,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACpC,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC;AACvC;AAEA,SAAS,aAAa,OAAuB;AAC3C,SAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;AAC1C;;;AClEO,SAAS,uBACX,SACsB;AACzB,QAAM,SAAS;AAAA,IACb,GAAG,IAAI,IAAI,QAAQ,OAAO,CAAC,WAAkC,WAAW,MAAS,CAAC;AAAA,EACpF;AACA,MAAI,OAAO,WAAW,EAAG,QAAO;AAChC,MAAI,OAAO,WAAW,EAAG,QAAO,OAAO,CAAC;AACxC,SAAO,YAAY,IAAI,MAAM;AAC/B;","names":[]}
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1816,8 +1816,8 @@ interface ExternalOptimizerModelBudget {
|
|
|
1816
1816
|
* data and compared with paired confidence intervals.
|
|
1817
1817
|
*/
|
|
1818
1818
|
|
|
1819
|
-
/**
|
|
1820
|
-
type OptimizationMethodRunOptions<TScenario extends Scenario$1, TArtifact> = Omit<RunCampaignOptions<TScenario, TArtifact>, 'costLedger' | 'dispatch' | 'judges' | 'runDir' | 'scenarios' | 'seed'>;
|
|
1819
|
+
/** Shared campaign settings applied to every optimization method. */
|
|
1820
|
+
type OptimizationMethodRunOptions<TScenario extends Scenario$1, TArtifact> = Omit<RunCampaignOptions<TScenario, TArtifact>, 'costCeiling' | 'costLedger' | 'dispatch' | 'judges' | 'runDir' | 'scenarios' | 'seed'>;
|
|
1821
1821
|
/** Cost reported by a method or by final test scoring. */
|
|
1822
1822
|
interface ComparisonCost {
|
|
1823
1823
|
totalCostUsd: number;
|
|
@@ -1890,7 +1890,7 @@ interface OptimizationMethodInput<TScenario extends Scenario$1, TArtifact> {
|
|
|
1890
1890
|
readonly seed: number;
|
|
1891
1891
|
/** Shared defaults for every method. A method may override them explicitly. */
|
|
1892
1892
|
readonly runOptions: Readonly<OptimizationMethodRunOptions<TScenario, TArtifact>>;
|
|
1893
|
-
/** Durable spend account shared by
|
|
1893
|
+
/** Durable spend account shared by every method and final scoring. */
|
|
1894
1894
|
readonly costLedger: CostLedgerHandle;
|
|
1895
1895
|
}
|
|
1896
1896
|
interface OptimizationMethodResult {
|
|
@@ -1999,8 +1999,7 @@ interface CompareOptimizationMethodsOptions<TScenario extends Scenario$1, TArtif
|
|
|
1999
1999
|
/** Simultaneous confidence across method-vs-baseline and method-vs-method contrasts.
|
|
2000
2000
|
* Each bootstrap interval is Bonferroni-adjusted. Default 0.95. */
|
|
2001
2001
|
confidence?: number;
|
|
2002
|
-
/** Shared spend limit across
|
|
2003
|
-
* Each method owns its optimization budget through `optimizationRunOptions.costCeiling`. */
|
|
2002
|
+
/** Shared spend limit across every method's optimizer and evaluation calls plus final scoring. */
|
|
2004
2003
|
costCeiling?: number;
|
|
2005
2004
|
}
|
|
2006
2005
|
/**
|
package/dist/contract/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
skillOptOptimizationMethod,
|
|
41
41
|
surfaceContentHash,
|
|
42
42
|
surfaceHash
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-VMUENW6F.js";
|
|
44
44
|
import {
|
|
45
45
|
campaignSplitDigest,
|
|
46
46
|
createRunCostLedger,
|
|
@@ -52,9 +52,9 @@ import {
|
|
|
52
52
|
import {
|
|
53
53
|
buildDefaultAnalystRegistry,
|
|
54
54
|
createChatClient
|
|
55
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-LUNF2SEL.js";
|
|
56
56
|
import "../chunk-HHWE3POT.js";
|
|
57
|
-
import "../chunk-
|
|
57
|
+
import "../chunk-WGXIEX7P.js";
|
|
58
58
|
import {
|
|
59
59
|
FileSystemOutcomeStore,
|
|
60
60
|
InMemoryOutcomeStore
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
pairArms,
|
|
88
88
|
parseCorrectnessResponse,
|
|
89
89
|
verifyCompletion
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-NGUYT5CI.js";
|
|
91
91
|
import {
|
|
92
92
|
DEFAULT_MUTATION_PRIMITIVES,
|
|
93
93
|
DEFAULT_RED_TEAM_CORPUS,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
scoreRedTeamOutput,
|
|
122
122
|
surfaceContentHash,
|
|
123
123
|
toolNamesForRun
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-VMUENW6F.js";
|
|
125
125
|
import {
|
|
126
126
|
BackendIntegrityError,
|
|
127
127
|
assertRealAgentReceipts,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
defaultIsMaterial,
|
|
147
147
|
diffFindings,
|
|
148
148
|
runSemanticConceptJudge
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-KE2VWPZX.js";
|
|
150
150
|
import {
|
|
151
151
|
AnalystRegistry,
|
|
152
152
|
DEFAULT_TRACE_ANALYST_KINDS,
|
|
@@ -163,7 +163,7 @@ import {
|
|
|
163
163
|
makeFinding,
|
|
164
164
|
renderPriorFindings,
|
|
165
165
|
renderUpstreamFindings
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-LUNF2SEL.js";
|
|
167
167
|
import "./chunk-HHWE3POT.js";
|
|
168
168
|
import {
|
|
169
169
|
DEFAULT_RUN_SCORE_WEIGHTS,
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
aggregateRunScore,
|
|
172
172
|
clamp01,
|
|
173
173
|
mapConcurrent
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-WGXIEX7P.js";
|
|
175
175
|
import {
|
|
176
176
|
allCriticalPassed,
|
|
177
177
|
controlFailureClassFromVerification,
|
package/dist/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "@tangle-network/agent-eval — wire protocol",
|
|
5
|
-
"version": "0.126.
|
|
5
|
+
"version": "0.126.1",
|
|
6
6
|
"description": "HTTP and stdio RPC interface to agent-eval. The TypeScript runtime is the source of truth; this spec is the contract that cross-language clients (Python, Rust, Go) generate from.\n\nWire-protocol version: 1.0.0. Bumps on breaking changes to request/response schemas.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "Tangle Network",
|
|
@@ -183,13 +183,13 @@ const comparison = await compareOptimizationMethods({
|
|
|
183
183
|
runDir: '.agent-eval/optimizer-comparison',
|
|
184
184
|
optimizationRunOptions: {
|
|
185
185
|
maxConcurrency: 4,
|
|
186
|
-
costCeiling: 10,
|
|
187
186
|
},
|
|
188
|
-
costCeiling:
|
|
187
|
+
costCeiling: 23,
|
|
189
188
|
confidence: 0.95,
|
|
190
189
|
})
|
|
191
190
|
```
|
|
192
191
|
|
|
192
|
+
`costCeiling` is one limit shared by optimizer-model calls, train and selection evaluations, and final test scoring.
|
|
193
193
|
`comparison.scores` contains the final-case baseline score, selected score, lift, simultaneous interval, cost status, duration, and selected surface for each method.
|
|
194
194
|
Official method scores contain optimizer and bridge package versions, source revisions and source-tree hashes, Python runtime, custom engine module hashes, compatible run ID, exact attempt ID, resume status, evaluation count, artifact directory, and available optimizer token usage.
|
|
195
195
|
`comparison.pairwise` compares the highest-ranked method with every other method.
|
|
@@ -203,7 +203,7 @@ Install the bridge and the source revision tested by this release:
|
|
|
203
203
|
|
|
204
204
|
```sh
|
|
205
205
|
python -m pip install agent-eval-rpc
|
|
206
|
-
python -m pip install "gepa @ git+https://github.com/gepa-ai/gepa.git@f919db0a622e2e9f9204779b81fe00cc1b2d808f"
|
|
206
|
+
python -m pip install "gepa[full] @ git+https://github.com/gepa-ai/gepa.git@f919db0a622e2e9f9204779b81fe00cc1b2d808f"
|
|
207
207
|
```
|
|
208
208
|
|
|
209
209
|
The published `gepa==0.1.4` wheel does not contain the required Optimize Anything API.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-eval",
|
|
3
|
-
"version": "0.126.
|
|
3
|
+
"version": "0.126.1",
|
|
4
4
|
"description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-eval#readme",
|
|
6
6
|
"repository": {
|