@tangle-network/agent-eval 0.117.1 → 0.118.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 +30 -0
- package/dist/analyst/index.d.ts +2772 -21
- package/dist/analyst/index.js +7 -6
- package/dist/analyst/index.js.map +1 -1
- package/dist/belief-state/index.d.ts +706 -10
- package/dist/belief-state/index.js +2 -1
- package/dist/belief-state/index.js.map +1 -1
- package/dist/benchmarks/index.d.ts +958 -14
- package/dist/benchmarks/index.js +12 -10
- package/dist/builder-eval/index.d.ts +449 -4
- package/dist/builder-eval/index.js +4 -3
- package/dist/builder-eval/index.js.map +1 -1
- package/dist/campaign/index.d.ts +4275 -73
- package/dist/campaign/index.js +12 -10
- package/dist/{chunk-VF3XSYTI.js → chunk-33JA4TFA.js} +6 -6
- package/dist/{chunk-4JLWXDYA.js → chunk-3EHHMC6E.js} +2 -2
- package/dist/{chunk-CCZIVI3F.js → chunk-BFW56GTT.js} +2 -2
- package/dist/{chunk-YZPO4UHR.js → chunk-FTUMG2U7.js} +124 -149
- package/dist/chunk-FTUMG2U7.js.map +1 -0
- package/dist/{chunk-E4BUPP7Z.js → chunk-HKUCJ437.js} +38 -66
- package/dist/chunk-HKUCJ437.js.map +1 -0
- package/dist/{chunk-HZHNRYHK.js → chunk-K6N6XJJX.js} +2 -2
- package/dist/chunk-KSDQVPLR.js +286 -0
- package/dist/chunk-KSDQVPLR.js.map +1 -0
- package/dist/chunk-MA6HLL3S.js +65 -0
- package/dist/chunk-MA6HLL3S.js.map +1 -0
- package/dist/{chunk-MGEHEHSN.js → chunk-OIIMMLRB.js} +11 -11
- package/dist/{chunk-DXZRATT5.js → chunk-OYZAPX5G.js} +3 -3
- package/dist/chunk-PXE2VKMX.js +140 -0
- package/dist/chunk-PXE2VKMX.js.map +1 -0
- package/dist/{chunk-JSJZ4PJ6.js → chunk-Q442S5AS.js} +17 -17
- package/dist/{chunk-ODVOOEWQ.js → chunk-QBRSJK47.js} +2 -2
- package/dist/{chunk-S2F4J57L.js → chunk-QKEGNI5B.js} +77 -32
- package/dist/chunk-QKEGNI5B.js.map +1 -0
- package/dist/{chunk-5UF54T55.js → chunk-S3UZOQ5Y.js} +34 -7
- package/dist/chunk-S3UZOQ5Y.js.map +1 -0
- package/dist/{chunk-FQNLDL4D.js → chunk-SVH2ANFD.js} +136 -4
- package/dist/chunk-SVH2ANFD.js.map +1 -0
- package/dist/{chunk-GQCZRZ7L.js → chunk-U5CHZ5M3.js} +9 -9
- package/dist/{chunk-TVVP3ZZQ.js → chunk-VQMK5FMP.js} +2 -1
- package/dist/{chunk-TVVP3ZZQ.js.map → chunk-VQMK5FMP.js.map} +1 -1
- package/dist/chunk-WDHBCA3M.js +31 -0
- package/dist/chunk-WDHBCA3M.js.map +1 -0
- package/dist/{chunk-HQPHZGL6.js → chunk-YLMUS4MM.js} +9 -9
- package/dist/{chunk-LQUTGLOZ.js → chunk-ZET2UAYW.js} +15 -65
- package/dist/chunk-ZET2UAYW.js.map +1 -0
- package/dist/contract/index.d.ts +4012 -38
- package/dist/contract/index.js +56 -29
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +1013 -9
- package/dist/control.js +4 -3
- package/dist/fuzz.d.ts +194 -4
- package/dist/fuzz.js +3 -3
- package/dist/hosted/index.d.ts +498 -17
- package/dist/index.d.ts +10992 -1288
- package/dist/index.js +101 -80
- package/dist/index.js.map +1 -1
- package/dist/matrix/index.d.ts +139 -4
- package/dist/meta-eval/index.d.ts +862 -15
- package/dist/meta-eval/index.js +2 -1
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/multishot/index.d.ts +214 -14
- package/dist/openapi.json +1 -1
- package/dist/pipelines/index.d.ts +392 -7
- package/dist/pipelines/index.js +5 -3
- package/dist/pipelines/index.js.map +1 -1
- package/dist/reporting.d.ts +1277 -17
- package/dist/rl.d.ts +2359 -28
- package/dist/rl.js +6 -5
- package/dist/rl.js.map +1 -1
- package/dist/storyboard/index.d.ts +86 -1
- package/dist/trace-attributes.d.ts +16 -0
- package/dist/trace-attributes.js +32 -0
- package/dist/trace-attributes.js.map +1 -0
- package/dist/traces.d.ts +1978 -697
- package/dist/traces.js +53 -32
- package/dist/wire/index.d.ts +655 -9
- package/docs/insight-report.md +44 -0
- package/package.json +9 -3
- package/dist/adversarial-B7loGVVX.d.ts +0 -19
- package/dist/analyst-C8HHvfJp.d.ts +0 -88
- package/dist/analyze-runs--2x39HZ7.d.ts +0 -81
- package/dist/baseline-DKq3gJpP.d.ts +0 -141
- package/dist/calibration-C8MTS7cw.d.ts +0 -101
- package/dist/chunk-5UF54T55.js.map +0 -1
- package/dist/chunk-E4BUPP7Z.js.map +0 -1
- package/dist/chunk-FQNLDL4D.js.map +0 -1
- package/dist/chunk-LQUTGLOZ.js.map +0 -1
- package/dist/chunk-S2F4J57L.js.map +0 -1
- package/dist/chunk-YZPO4UHR.js.map +0 -1
- package/dist/code-agent-session-CjZsVd19.d.ts +0 -87
- package/dist/control-6vuGfmDH.d.ts +0 -258
- package/dist/cost-ledger-DWy3XdJc.d.ts +0 -183
- package/dist/dataset-NENEzRgk.d.ts +0 -115
- package/dist/default-registry-DaK8b3fv.d.ts +0 -155
- package/dist/emitter-CjD7vUwv.d.ts +0 -122
- package/dist/errors-oeQrLqXC.d.ts +0 -74
- package/dist/failure-cluster-DOAcSJ87.d.ts +0 -76
- package/dist/feedback-trajectory-BUnM58xL.d.ts +0 -348
- package/dist/gepa-eESocoDi.d.ts +0 -642
- package/dist/index-PdX4VnPA.d.ts +0 -423
- package/dist/insight-report-DY4nDW9Q.d.ts +0 -310
- package/dist/integrity-DqlBiLyK.d.ts +0 -81
- package/dist/judge-calibration-7C-IDmKr.d.ts +0 -145
- package/dist/kind-factory-ClZmO25A.d.ts +0 -171
- package/dist/llm-client-qoDd18Qz.d.ts +0 -289
- package/dist/multi-layer-verifier-BsqKuLyN.d.ts +0 -150
- package/dist/off-policy-DiwuKKg7.d.ts +0 -132
- package/dist/outcome-store-rnXLEqSn.d.ts +0 -63
- package/dist/policy-edit-wG9uFEFm.d.ts +0 -455
- package/dist/pre-registration-BWQhJ3vz.d.ts +0 -761
- package/dist/provenance-DpjwyseI.d.ts +0 -541
- package/dist/query-CF7PG61p.d.ts +0 -35
- package/dist/raw-provider-sink-C46HDghv.d.ts +0 -132
- package/dist/release-report-C8G2i5Xi.d.ts +0 -236
- package/dist/researcher-C8XyxQsu.d.ts +0 -387
- package/dist/rubric-predictive-validity-p49lLVrE.d.ts +0 -105
- package/dist/run-record-BDH49H2E.d.ts +0 -360
- package/dist/runtime-trajectory-DGBIUt4B.d.ts +0 -49
- package/dist/schema-B3Q3l9Z_.d.ts +0 -201
- package/dist/semantic-concept-judge-CXnPEJbf.d.ts +0 -723
- package/dist/sequential-5iSVfzl2.d.ts +0 -139
- package/dist/series-convergence-D5OWMBg6.d.ts +0 -33
- package/dist/statistics-KUnG73jH.d.ts +0 -494
- package/dist/storage-DrX3v_5B.d.ts +0 -50
- package/dist/store-C1YxJDEK.d.ts +0 -248
- package/dist/store-DGqD0Pyo.d.ts +0 -116
- package/dist/summary-report-C5bKFfm-.d.ts +0 -445
- package/dist/test-graded-scenario-B0ybnPY7.d.ts +0 -166
- package/dist/types-BSw1rOUB.d.ts +0 -634
- package/dist/types-BUxNaJ8c.d.ts +0 -108
- package/dist/types-BkfcQnxV.d.ts +0 -313
- package/dist/verdict-C9MlYujm.d.ts +0 -35
- /package/dist/{chunk-VF3XSYTI.js.map → chunk-33JA4TFA.js.map} +0 -0
- /package/dist/{chunk-4JLWXDYA.js.map → chunk-3EHHMC6E.js.map} +0 -0
- /package/dist/{chunk-CCZIVI3F.js.map → chunk-BFW56GTT.js.map} +0 -0
- /package/dist/{chunk-HZHNRYHK.js.map → chunk-K6N6XJJX.js.map} +0 -0
- /package/dist/{chunk-MGEHEHSN.js.map → chunk-OIIMMLRB.js.map} +0 -0
- /package/dist/{chunk-DXZRATT5.js.map → chunk-OYZAPX5G.js.map} +0 -0
- /package/dist/{chunk-JSJZ4PJ6.js.map → chunk-Q442S5AS.js.map} +0 -0
- /package/dist/{chunk-ODVOOEWQ.js.map → chunk-QBRSJK47.js.map} +0 -0
- /package/dist/{chunk-GQCZRZ7L.js.map → chunk-U5CHZ5M3.js.map} +0 -0
- /package/dist/{chunk-HQPHZGL6.js.map → chunk-YLMUS4MM.js.map} +0 -0
package/dist/control.js
CHANGED
|
@@ -10,9 +10,10 @@ import {
|
|
|
10
10
|
stopOnNoProgress,
|
|
11
11
|
stopOnRepeatedAction,
|
|
12
12
|
subjectiveEval
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-OYZAPX5G.js";
|
|
14
|
+
import "./chunk-VQMK5FMP.js";
|
|
15
|
+
import "./chunk-S3UZOQ5Y.js";
|
|
16
|
+
import "./chunk-MA6HLL3S.js";
|
|
16
17
|
import "./chunk-XJYR7XFV.js";
|
|
17
18
|
import "./chunk-VSMTAMNK.js";
|
|
18
19
|
import "./chunk-ONWEPEDO.js";
|
package/dist/fuzz.d.ts
CHANGED
|
@@ -1,7 +1,197 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type CostChannel = 'agent' | 'judge' | 'verifier' | 'analyst' | 'driver' | (string & {});
|
|
2
|
+
interface CostUsage {
|
|
3
|
+
inputTokens: number;
|
|
4
|
+
outputTokens: number;
|
|
5
|
+
cachedTokens?: number;
|
|
6
|
+
}
|
|
7
|
+
interface CostCallBase {
|
|
8
|
+
callId: string;
|
|
9
|
+
channel: CostChannel;
|
|
10
|
+
phase: string;
|
|
11
|
+
actor: string;
|
|
12
|
+
model: string;
|
|
13
|
+
maximumCostUsd?: number;
|
|
14
|
+
tags?: Record<string, string>;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
}
|
|
17
|
+
interface CostReceipt extends CostCallBase, CostUsage {
|
|
18
|
+
status: 'settled';
|
|
19
|
+
costUsd: number;
|
|
20
|
+
costUnknown: boolean;
|
|
21
|
+
usageUnknown?: boolean;
|
|
22
|
+
pricing?: {
|
|
23
|
+
inputUsdPerThousand: number;
|
|
24
|
+
outputUsdPerThousand: number;
|
|
25
|
+
};
|
|
26
|
+
actualCostUsd?: number;
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
interface CostReceiptInput extends CostUsage {
|
|
30
|
+
model: string;
|
|
31
|
+
actualCostUsd?: number;
|
|
32
|
+
costUnknown?: boolean;
|
|
33
|
+
usageUnknown?: boolean;
|
|
34
|
+
}
|
|
35
|
+
type MaximumCharge = {
|
|
36
|
+
externallyEnforcedMaximumUsd: number;
|
|
37
|
+
} | ({
|
|
38
|
+
model: string;
|
|
39
|
+
} & CostUsage);
|
|
40
|
+
interface RunPaidCallInput<T> {
|
|
41
|
+
callId?: string;
|
|
42
|
+
channel: CostChannel;
|
|
43
|
+
phase: string;
|
|
44
|
+
actor: string;
|
|
45
|
+
/** Used before a provider receipt exists and on failures without one. */
|
|
46
|
+
model?: string;
|
|
47
|
+
tags?: Record<string, string>;
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
/** Provider-enforced dollar maximum, or maximum priced token usage. Required when capped. */
|
|
50
|
+
maximumCharge?: MaximumCharge;
|
|
51
|
+
/** `callId` can be forwarded as the provider's idempotency key. */
|
|
52
|
+
execute(signal: AbortSignal, callId: string): Promise<T>;
|
|
53
|
+
receipt(value: T): CostReceiptInput;
|
|
54
|
+
receiptFromError?(error: Error): CostReceiptInput | undefined;
|
|
55
|
+
}
|
|
56
|
+
type PaidCallResult<T> = {
|
|
57
|
+
succeeded: true;
|
|
58
|
+
callId: string;
|
|
59
|
+
value: T;
|
|
60
|
+
receipt: CostReceipt;
|
|
61
|
+
} | {
|
|
62
|
+
succeeded: false;
|
|
63
|
+
callId?: string;
|
|
64
|
+
error: Error;
|
|
65
|
+
receipt?: CostReceipt;
|
|
66
|
+
};
|
|
67
|
+
interface ChannelRollup {
|
|
68
|
+
channel: CostChannel;
|
|
69
|
+
calls: number;
|
|
70
|
+
inputTokens: number;
|
|
71
|
+
outputTokens: number;
|
|
72
|
+
cachedTokens: number;
|
|
73
|
+
costUsd: number;
|
|
74
|
+
unpricedCalls: number;
|
|
75
|
+
unknownUsageCalls: number;
|
|
76
|
+
}
|
|
77
|
+
interface CostLedgerSummary {
|
|
78
|
+
totalCalls: number;
|
|
79
|
+
pendingCalls: number;
|
|
80
|
+
unresolvedCalls: number;
|
|
81
|
+
reservedCostUsd: number;
|
|
82
|
+
inputTokens: number;
|
|
83
|
+
outputTokens: number;
|
|
84
|
+
cachedTokens: number;
|
|
85
|
+
totalCostUsd: number;
|
|
86
|
+
byChannel: ChannelRollup[];
|
|
87
|
+
unpricedModels: string[];
|
|
88
|
+
fullyPriced: boolean;
|
|
89
|
+
usageComplete: boolean;
|
|
90
|
+
accountingComplete: boolean;
|
|
91
|
+
incompleteReasons: string[];
|
|
92
|
+
}
|
|
93
|
+
interface CostLedgerFilter {
|
|
94
|
+
channel?: CostChannel;
|
|
95
|
+
phase?: string;
|
|
96
|
+
tags?: Record<string, string>;
|
|
97
|
+
}
|
|
98
|
+
/** Append-only storage. `append` must atomically reject stale revisions. */
|
|
99
|
+
interface CostLedgerPersistence {
|
|
100
|
+
read(): {
|
|
101
|
+
revision: string;
|
|
102
|
+
events: string;
|
|
103
|
+
};
|
|
104
|
+
append(expectedRevision: string, event: string): string | undefined;
|
|
105
|
+
}
|
|
106
|
+
interface CostLedgerOptions {
|
|
107
|
+
costCeilingUsd?: number;
|
|
108
|
+
persistence?: CostLedgerPersistence;
|
|
109
|
+
/** Import already-settled receipts without admitting new paid work. */
|
|
110
|
+
receipts?: readonly CostReceipt[];
|
|
111
|
+
}
|
|
112
|
+
/** Run-wide paid-call admission, durable call state, receipts, and summaries. */
|
|
113
|
+
declare class CostLedger {
|
|
114
|
+
private readonly records;
|
|
115
|
+
private readonly activeCallIds;
|
|
116
|
+
private readonly lateCallIds;
|
|
117
|
+
private completedTasks;
|
|
118
|
+
private revision;
|
|
119
|
+
private costLimitPersisted;
|
|
120
|
+
readonly costCeilingUsd?: number;
|
|
121
|
+
private readonly persistence?;
|
|
122
|
+
constructor(input?: number | CostLedgerOptions);
|
|
123
|
+
runPaidCall<T>(input: RunPaidCallInput<T>): Promise<PaidCallResult<T>>;
|
|
124
|
+
/** Settle a call left pending by a crashed process after reconciling with the provider. */
|
|
125
|
+
reconcile(callId: string, observed: CostReceiptInput, options?: {
|
|
126
|
+
error?: string;
|
|
127
|
+
}): CostReceipt;
|
|
128
|
+
list(filter?: CostLedgerFilter): CostReceipt[];
|
|
129
|
+
summary(filter?: CostLedgerFilter): CostLedgerSummary;
|
|
130
|
+
markCompleted(count?: number): void;
|
|
131
|
+
costPerCompletedTask(): number | null;
|
|
132
|
+
private execute;
|
|
133
|
+
private captureLateOutcome;
|
|
134
|
+
private commitOutcome;
|
|
135
|
+
private captureFailure;
|
|
136
|
+
private commitReceipt;
|
|
137
|
+
private resolveMaximum;
|
|
138
|
+
private hasIncompleteSettledCall;
|
|
139
|
+
private appendRecord;
|
|
140
|
+
private ensureCostLimitPersisted;
|
|
141
|
+
private appendEvent;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Adversarial mutation contract.
|
|
146
|
+
*
|
|
147
|
+
* `AdversarialMutation<S>` is the scenario-mutation strategy the fuzz harness
|
|
148
|
+
* (`fuzzAgent`, src/fuzz) drives: paraphrase, edge-case substitution, or
|
|
149
|
+
* compositional combination of a scenario the policy currently passes, looking
|
|
150
|
+
* for the tail inputs that break it. The harness supplies the loop; consumers
|
|
151
|
+
* supply the mutations and the failure detector.
|
|
152
|
+
*/
|
|
153
|
+
interface AdversarialMutation<S> {
|
|
154
|
+
id: string;
|
|
155
|
+
/**
|
|
156
|
+
* Mutate one scenario. Return null to skip; return one or more new
|
|
157
|
+
* scenarios. The harness deduplicates by `mutateScenarioId(scenario)`.
|
|
158
|
+
*/
|
|
159
|
+
mutate(parent: S, rng: () => number): Promise<S[]> | S[];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Validator-output verdict — substrate primitive for "did this output pass,
|
|
164
|
+
* and how well?"
|
|
165
|
+
*
|
|
166
|
+
* Used by:
|
|
167
|
+
* - `@tangle-network/agent-eval/matrix` — verdict per cell in the cartesian.
|
|
168
|
+
* - `@tangle-network/agent-runtime` — Validator<Output, Verdict = DefaultVerdict>.
|
|
169
|
+
* Runtime keeps `Validator` because it's coupled to runtime-shaped
|
|
170
|
+
* `ValidationCtx` (iteration, signal, traceEmitter); the verdict TYPE
|
|
171
|
+
* itself is a substrate concept and lives here.
|
|
172
|
+
*
|
|
173
|
+
* Repo layering: agent-eval is the substrate (no upward deps). Both
|
|
174
|
+
* agent-runtime and agent-knowledge consume this type FROM agent-eval —
|
|
175
|
+
* never the other way around. See CLAUDE.md "Repo layering" for the rule.
|
|
176
|
+
*/
|
|
177
|
+
/**
|
|
178
|
+
* Minimal verdict shape — `valid` + `score` are required; `scores` +
|
|
179
|
+
* `notes` are optional surface. Validators that need richer shapes
|
|
180
|
+
* parameterise `Validator<Output, MyVerdict>` with their own type.
|
|
181
|
+
*
|
|
182
|
+
* Need structured extras? Extend DefaultVerdict with typed fields — never
|
|
183
|
+
* serialize extras into `notes`.
|
|
184
|
+
*/
|
|
185
|
+
interface DefaultVerdict {
|
|
186
|
+
/** Whether the output meets the validator's pass criteria. */
|
|
187
|
+
valid: boolean;
|
|
188
|
+
/** Aggregate score in [0, 1]. Drivers use this for winner selection. */
|
|
189
|
+
score: number;
|
|
190
|
+
/** Per-dimension scores. Free-form; weighted into `score` by the validator. */
|
|
191
|
+
scores?: Record<string, number>;
|
|
192
|
+
/** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
|
|
193
|
+
notes?: string;
|
|
194
|
+
}
|
|
5
195
|
|
|
6
196
|
/**
|
|
7
197
|
* Behavior-space exploration — types.
|
package/dist/fuzz.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
varianceBasedCurriculum
|
|
3
|
-
} from "./chunk-VZSRQ272.js";
|
|
4
1
|
import {
|
|
5
2
|
CostLedger,
|
|
6
3
|
CostReceiptCaptureError
|
|
7
4
|
} from "./chunk-VCTY3W6J.js";
|
|
8
5
|
import "./chunk-VI2UW6B6.js";
|
|
6
|
+
import {
|
|
7
|
+
varianceBasedCurriculum
|
|
8
|
+
} from "./chunk-VZSRQ272.js";
|
|
9
9
|
import {
|
|
10
10
|
ValidationError
|
|
11
11
|
} from "./chunk-ONWEPEDO.js";
|