@tangle-network/agent-eval 0.89.0 → 0.90.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 +9 -1
- package/dist/chunk-STGVSCDH.js +202 -0
- package/dist/chunk-STGVSCDH.js.map +1 -0
- package/dist/contract/index.js +9 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/perf/index.d.ts +123 -0
- package/dist/perf/index.js +18 -0
- package/dist/perf/index.js.map +1 -0
- package/dist/rl.js +6 -6
- package/package.json +6 -1
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.
|
|
5
|
+
"version": "0.90.0",
|
|
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",
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Journey × axes matrix for infra performance benchmarks.
|
|
3
|
+
*
|
|
4
|
+
* A journey is one measurable user path ("provision.cold", "chat.ttft");
|
|
5
|
+
* axes are free-form scenario dimensions (driver, region, image…). The
|
|
6
|
+
* matrix expansion is pure bookkeeping — running the scenarios and
|
|
7
|
+
* recording metrics is the caller's job. This module complements the
|
|
8
|
+
* judge-panel `BenchmarkRunner` (src/benchmark.ts): that one scores
|
|
9
|
+
* QUALITY via judges, this one structures LATENCY / RELIABILITY runs
|
|
10
|
+
* over flat metric records.
|
|
11
|
+
*/
|
|
12
|
+
/** One measurable user journey (e.g. "provision.cold", "chat.ttft"). */
|
|
13
|
+
interface JourneySpec {
|
|
14
|
+
id: string;
|
|
15
|
+
description: string;
|
|
16
|
+
/** Needs a real LLM call — schedule nightly, not per-PR. */
|
|
17
|
+
requiresLLM: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Fields that MUST be non-null on a passing record of this journey.
|
|
20
|
+
* A "passing" record missing one is an integrity violation, not a pass.
|
|
21
|
+
*/
|
|
22
|
+
requiredFields: ReadonlyArray<string>;
|
|
23
|
+
/** Numeric floors, e.g. {field: 'event_count', min: 1} for streaming. */
|
|
24
|
+
minimums?: ReadonlyArray<{
|
|
25
|
+
field: string;
|
|
26
|
+
min: number;
|
|
27
|
+
}>;
|
|
28
|
+
/** Per-phase breakdown fields expected non-null (subset of requiredFields semantics, reported separately). */
|
|
29
|
+
phaseFields?: ReadonlyArray<string>;
|
|
30
|
+
}
|
|
31
|
+
interface ScenarioAxes {
|
|
32
|
+
/** e.g. driver: ['docker','firecracker'] — every key is a free-form dimension. */
|
|
33
|
+
[dimension: string]: ReadonlyArray<string>;
|
|
34
|
+
}
|
|
35
|
+
interface PerfScenario {
|
|
36
|
+
/** `${journeyId}|${dim1}=${v1}|${dim2}=${v2}` (dims sorted). */
|
|
37
|
+
key: string;
|
|
38
|
+
journey: JourneySpec;
|
|
39
|
+
axes: Record<string, string>;
|
|
40
|
+
}
|
|
41
|
+
/** Stable scenario key: journey id then `dim=value` pairs in sorted-dim order. */
|
|
42
|
+
declare function scenarioKey(journeyId: string, axes: Record<string, string>): string;
|
|
43
|
+
/** Cartesian expansion; `filter` lets callers drop invalid combos (e.g. firecracker×resume). */
|
|
44
|
+
declare function expandMatrix(journeys: ReadonlyArray<JourneySpec>, axes: ScenarioAxes, filter?: (journeyId: string, combo: Record<string, string>) => boolean): PerfScenario[];
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Record-integrity contracts for perf metric records.
|
|
48
|
+
*
|
|
49
|
+
* A record that claims `pass === true` must actually carry the journey's
|
|
50
|
+
* required measurements — a "passing" provision run with a null
|
|
51
|
+
* `total_ms` is a lying record, not a pass. Failed records are exempt:
|
|
52
|
+
* a run that errored mid-flight legitimately has nulls.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
interface IntegrityViolation {
|
|
56
|
+
recordIndex: number;
|
|
57
|
+
journeyId: string;
|
|
58
|
+
field: string;
|
|
59
|
+
reason: 'null-required-field' | 'below-minimum';
|
|
60
|
+
detail: string;
|
|
61
|
+
}
|
|
62
|
+
interface IntegrityResult {
|
|
63
|
+
succeeded: boolean;
|
|
64
|
+
violations: IntegrityViolation[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Validates flat metric records (Record<string, unknown> with a boolean
|
|
68
|
+
* `pass` field) against their journey contract. Only records with
|
|
69
|
+
* pass === true are checked — a failed record may legitimately have nulls.
|
|
70
|
+
* resolveJourney maps a record to its JourneySpec (or null to skip).
|
|
71
|
+
*/
|
|
72
|
+
declare function checkRecordIntegrity(records: ReadonlyArray<Record<string, unknown>>, resolveJourney: (record: Record<string, unknown>) => JourneySpec | null): IntegrityResult;
|
|
73
|
+
/** Throws an Error listing every violation when the result fails. */
|
|
74
|
+
declare function assertRecordIntegrity(records: ReadonlyArray<Record<string, unknown>>, resolveJourney: (record: Record<string, unknown>) => JourneySpec | null): void;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Percentile ratchet over perf metric records.
|
|
78
|
+
*
|
|
79
|
+
* `summarizeRecords` folds flat records into per-scenario p50/p90 stats;
|
|
80
|
+
* `gatePerf` compares a current summary against a committed baseline and
|
|
81
|
+
* trips on regressions beyond tolerance. Percentiles use nearest-rank on
|
|
82
|
+
* sorted values. Null / non-numeric metric values are excluded from the
|
|
83
|
+
* stat (n reflects only real samples); a field with zero samples is
|
|
84
|
+
* omitted entirely — no fake zeros.
|
|
85
|
+
*/
|
|
86
|
+
interface PerfStat {
|
|
87
|
+
p50: number;
|
|
88
|
+
p90: number;
|
|
89
|
+
n: number;
|
|
90
|
+
}
|
|
91
|
+
interface PerfBaseline {
|
|
92
|
+
version: 1;
|
|
93
|
+
/** key → metric field → stat. */
|
|
94
|
+
scenarios: Record<string, Record<string, PerfStat>>;
|
|
95
|
+
}
|
|
96
|
+
interface PerfRegression {
|
|
97
|
+
scenarioKey: string;
|
|
98
|
+
field: string;
|
|
99
|
+
baseline: PerfStat;
|
|
100
|
+
current: PerfStat;
|
|
101
|
+
/** percent over baseline p50 / p90, whichever tripped. */
|
|
102
|
+
overBy: {
|
|
103
|
+
p50Pct: number;
|
|
104
|
+
p90Pct: number;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
interface PerfGateResult {
|
|
108
|
+
succeeded: boolean;
|
|
109
|
+
regressions: PerfRegression[];
|
|
110
|
+
/** Negative overBy: strictly better than baseline on both percentiles. */
|
|
111
|
+
improvements: PerfRegression[];
|
|
112
|
+
/** In baseline but absent (or under-sampled, n < minSamples) in current. */
|
|
113
|
+
missingScenarios: string[];
|
|
114
|
+
/** In records but absent from baseline. */
|
|
115
|
+
newScenarios: string[];
|
|
116
|
+
}
|
|
117
|
+
declare function summarizeRecords(records: ReadonlyArray<Record<string, unknown>>, keyOf: (record: Record<string, unknown>) => string | null, metricFields: ReadonlyArray<string>): PerfBaseline;
|
|
118
|
+
declare function gatePerf(current: PerfBaseline, baseline: PerfBaseline, options?: {
|
|
119
|
+
tolerancePct?: number;
|
|
120
|
+
minSamples?: number;
|
|
121
|
+
}): PerfGateResult;
|
|
122
|
+
|
|
123
|
+
export { type IntegrityResult, type IntegrityViolation, type JourneySpec, type PerfBaseline, type PerfGateResult, type PerfRegression, type PerfScenario, type PerfStat, type ScenarioAxes, assertRecordIntegrity, checkRecordIntegrity, expandMatrix, gatePerf, scenarioKey, summarizeRecords };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertRecordIntegrity,
|
|
3
|
+
checkRecordIntegrity,
|
|
4
|
+
expandMatrix,
|
|
5
|
+
gatePerf,
|
|
6
|
+
scenarioKey,
|
|
7
|
+
summarizeRecords
|
|
8
|
+
} from "../chunk-STGVSCDH.js";
|
|
9
|
+
import "../chunk-PZ5AY32C.js";
|
|
10
|
+
export {
|
|
11
|
+
assertRecordIntegrity,
|
|
12
|
+
checkRecordIntegrity,
|
|
13
|
+
expandMatrix,
|
|
14
|
+
gatePerf,
|
|
15
|
+
scenarioKey,
|
|
16
|
+
summarizeRecords
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/rl.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
detectRewardHacking,
|
|
3
|
-
extractVerifiableReward,
|
|
4
|
-
extractVerifiableRewardsFromRecords,
|
|
5
|
-
filterDeterministicallyRewarded
|
|
6
|
-
} from "./chunk-5HRORJQY.js";
|
|
7
1
|
import {
|
|
8
2
|
doublyRobust,
|
|
9
3
|
inverseProbabilityWeighting,
|
|
10
4
|
offPolicyEstimateAll,
|
|
11
5
|
selfNormalizedImportanceWeighting
|
|
12
6
|
} from "./chunk-4DIJWVUT.js";
|
|
7
|
+
import {
|
|
8
|
+
detectRewardHacking,
|
|
9
|
+
extractVerifiableReward,
|
|
10
|
+
extractVerifiableRewardsFromRecords,
|
|
11
|
+
filterDeterministicallyRewarded
|
|
12
|
+
} from "./chunk-5HRORJQY.js";
|
|
13
13
|
import {
|
|
14
14
|
FileSystemOutcomeStore,
|
|
15
15
|
InMemoryOutcomeStore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-eval",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
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": {
|
|
@@ -109,6 +109,11 @@
|
|
|
109
109
|
"import": "./dist/matrix/index.js",
|
|
110
110
|
"default": "./dist/matrix/index.js"
|
|
111
111
|
},
|
|
112
|
+
"./perf": {
|
|
113
|
+
"types": "./dist/perf/index.d.ts",
|
|
114
|
+
"import": "./dist/perf/index.js",
|
|
115
|
+
"default": "./dist/perf/index.js"
|
|
116
|
+
},
|
|
112
117
|
"./multishot": {
|
|
113
118
|
"types": "./dist/multishot/index.d.ts",
|
|
114
119
|
"import": "./dist/multishot/index.js",
|