@tangle-network/agent-eval 0.117.0 → 0.118.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.
Files changed (143) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/analyst/index.d.ts +2772 -21
  3. package/dist/analyst/index.js +7 -6
  4. package/dist/analyst/index.js.map +1 -1
  5. package/dist/belief-state/index.d.ts +706 -10
  6. package/dist/belief-state/index.js +2 -1
  7. package/dist/belief-state/index.js.map +1 -1
  8. package/dist/benchmarks/index.d.ts +958 -14
  9. package/dist/benchmarks/index.js +12 -10
  10. package/dist/builder-eval/index.d.ts +449 -4
  11. package/dist/builder-eval/index.js +4 -3
  12. package/dist/builder-eval/index.js.map +1 -1
  13. package/dist/campaign/index.d.ts +4276 -74
  14. package/dist/campaign/index.js +12 -10
  15. package/dist/{chunk-VF3XSYTI.js → chunk-33JA4TFA.js} +6 -6
  16. package/dist/{chunk-4JLWXDYA.js → chunk-3EHHMC6E.js} +2 -2
  17. package/dist/{chunk-CCZIVI3F.js → chunk-BFW56GTT.js} +2 -2
  18. package/dist/{chunk-YZPO4UHR.js → chunk-DP3BBMYJ.js} +100 -143
  19. package/dist/chunk-DP3BBMYJ.js.map +1 -0
  20. package/dist/{chunk-E4BUPP7Z.js → chunk-HKUCJ437.js} +38 -66
  21. package/dist/chunk-HKUCJ437.js.map +1 -0
  22. package/dist/{chunk-HZHNRYHK.js → chunk-K6N6XJJX.js} +2 -2
  23. package/dist/chunk-KSDQVPLR.js +286 -0
  24. package/dist/chunk-KSDQVPLR.js.map +1 -0
  25. package/dist/chunk-MA6HLL3S.js +65 -0
  26. package/dist/chunk-MA6HLL3S.js.map +1 -0
  27. package/dist/{chunk-MGEHEHSN.js → chunk-OIIMMLRB.js} +11 -11
  28. package/dist/{chunk-DXZRATT5.js → chunk-OYZAPX5G.js} +3 -3
  29. package/dist/chunk-PXE2VKMX.js +140 -0
  30. package/dist/chunk-PXE2VKMX.js.map +1 -0
  31. package/dist/{chunk-ZUXV7UWZ.js → chunk-Q442S5AS.js} +73 -19
  32. package/dist/{chunk-ZUXV7UWZ.js.map → chunk-Q442S5AS.js.map} +1 -1
  33. package/dist/{chunk-ODVOOEWQ.js → chunk-QBRSJK47.js} +2 -2
  34. package/dist/{chunk-S2F4J57L.js → chunk-QKEGNI5B.js} +77 -32
  35. package/dist/chunk-QKEGNI5B.js.map +1 -0
  36. package/dist/{chunk-5UF54T55.js → chunk-S3UZOQ5Y.js} +34 -7
  37. package/dist/chunk-S3UZOQ5Y.js.map +1 -0
  38. package/dist/{chunk-FQNLDL4D.js → chunk-SVH2ANFD.js} +136 -4
  39. package/dist/chunk-SVH2ANFD.js.map +1 -0
  40. package/dist/{chunk-GQCZRZ7L.js → chunk-U5CHZ5M3.js} +9 -9
  41. package/dist/{chunk-TVVP3ZZQ.js → chunk-VQMK5FMP.js} +2 -1
  42. package/dist/{chunk-TVVP3ZZQ.js.map → chunk-VQMK5FMP.js.map} +1 -1
  43. package/dist/chunk-WDHBCA3M.js +31 -0
  44. package/dist/chunk-WDHBCA3M.js.map +1 -0
  45. package/dist/{chunk-HQPHZGL6.js → chunk-YLMUS4MM.js} +9 -9
  46. package/dist/{chunk-LQUTGLOZ.js → chunk-ZET2UAYW.js} +15 -65
  47. package/dist/chunk-ZET2UAYW.js.map +1 -0
  48. package/dist/contract/index.d.ts +4012 -38
  49. package/dist/contract/index.js +56 -29
  50. package/dist/contract/index.js.map +1 -1
  51. package/dist/control.d.ts +1013 -9
  52. package/dist/control.js +4 -3
  53. package/dist/fuzz.d.ts +194 -4
  54. package/dist/fuzz.js +3 -3
  55. package/dist/hosted/index.d.ts +498 -17
  56. package/dist/index.d.ts +10982 -1286
  57. package/dist/index.js +97 -80
  58. package/dist/index.js.map +1 -1
  59. package/dist/matrix/index.d.ts +139 -4
  60. package/dist/meta-eval/index.d.ts +862 -15
  61. package/dist/meta-eval/index.js +2 -1
  62. package/dist/meta-eval/index.js.map +1 -1
  63. package/dist/multishot/index.d.ts +214 -14
  64. package/dist/openapi.json +1 -1
  65. package/dist/pipelines/index.d.ts +392 -7
  66. package/dist/pipelines/index.js +5 -3
  67. package/dist/pipelines/index.js.map +1 -1
  68. package/dist/reporting.d.ts +1277 -17
  69. package/dist/rl.d.ts +2359 -28
  70. package/dist/rl.js +6 -5
  71. package/dist/rl.js.map +1 -1
  72. package/dist/storyboard/index.d.ts +86 -1
  73. package/dist/trace-attributes.d.ts +16 -0
  74. package/dist/trace-attributes.js +32 -0
  75. package/dist/trace-attributes.js.map +1 -0
  76. package/dist/traces.d.ts +1970 -697
  77. package/dist/traces.js +49 -32
  78. package/dist/wire/index.d.ts +655 -9
  79. package/docs/insight-report.md +44 -0
  80. package/package.json +9 -3
  81. package/dist/adversarial-B7loGVVX.d.ts +0 -19
  82. package/dist/analyst-C8HHvfJp.d.ts +0 -88
  83. package/dist/analyze-runs--2x39HZ7.d.ts +0 -81
  84. package/dist/baseline-DKq3gJpP.d.ts +0 -141
  85. package/dist/calibration-C8MTS7cw.d.ts +0 -101
  86. package/dist/chunk-5UF54T55.js.map +0 -1
  87. package/dist/chunk-E4BUPP7Z.js.map +0 -1
  88. package/dist/chunk-FQNLDL4D.js.map +0 -1
  89. package/dist/chunk-LQUTGLOZ.js.map +0 -1
  90. package/dist/chunk-S2F4J57L.js.map +0 -1
  91. package/dist/chunk-YZPO4UHR.js.map +0 -1
  92. package/dist/code-agent-session-CjZsVd19.d.ts +0 -87
  93. package/dist/control-6vuGfmDH.d.ts +0 -258
  94. package/dist/cost-ledger-DWy3XdJc.d.ts +0 -183
  95. package/dist/dataset-NENEzRgk.d.ts +0 -115
  96. package/dist/default-registry-DaK8b3fv.d.ts +0 -155
  97. package/dist/emitter-CjD7vUwv.d.ts +0 -122
  98. package/dist/errors-oeQrLqXC.d.ts +0 -74
  99. package/dist/failure-cluster-DOAcSJ87.d.ts +0 -76
  100. package/dist/feedback-trajectory-BUnM58xL.d.ts +0 -348
  101. package/dist/gepa-eESocoDi.d.ts +0 -642
  102. package/dist/index-PdX4VnPA.d.ts +0 -423
  103. package/dist/insight-report-DY4nDW9Q.d.ts +0 -310
  104. package/dist/integrity-DqlBiLyK.d.ts +0 -81
  105. package/dist/judge-calibration-7C-IDmKr.d.ts +0 -145
  106. package/dist/kind-factory-ClZmO25A.d.ts +0 -171
  107. package/dist/llm-client-qoDd18Qz.d.ts +0 -289
  108. package/dist/multi-layer-verifier-BsqKuLyN.d.ts +0 -150
  109. package/dist/off-policy-DiwuKKg7.d.ts +0 -132
  110. package/dist/outcome-store-rnXLEqSn.d.ts +0 -63
  111. package/dist/policy-edit-wG9uFEFm.d.ts +0 -455
  112. package/dist/pre-registration-BWQhJ3vz.d.ts +0 -761
  113. package/dist/provenance-DpjwyseI.d.ts +0 -541
  114. package/dist/query-CF7PG61p.d.ts +0 -35
  115. package/dist/raw-provider-sink-C46HDghv.d.ts +0 -132
  116. package/dist/release-report-C8G2i5Xi.d.ts +0 -236
  117. package/dist/researcher-C8XyxQsu.d.ts +0 -387
  118. package/dist/rubric-predictive-validity-p49lLVrE.d.ts +0 -105
  119. package/dist/run-record-BDH49H2E.d.ts +0 -360
  120. package/dist/runtime-trajectory-DGBIUt4B.d.ts +0 -49
  121. package/dist/schema-B3Q3l9Z_.d.ts +0 -201
  122. package/dist/semantic-concept-judge-CXnPEJbf.d.ts +0 -723
  123. package/dist/sequential-5iSVfzl2.d.ts +0 -139
  124. package/dist/series-convergence-D5OWMBg6.d.ts +0 -33
  125. package/dist/statistics-KUnG73jH.d.ts +0 -494
  126. package/dist/storage-DrX3v_5B.d.ts +0 -50
  127. package/dist/store-C1YxJDEK.d.ts +0 -248
  128. package/dist/store-DGqD0Pyo.d.ts +0 -116
  129. package/dist/summary-report-C5bKFfm-.d.ts +0 -445
  130. package/dist/test-graded-scenario-B0ybnPY7.d.ts +0 -166
  131. package/dist/types-BSw1rOUB.d.ts +0 -634
  132. package/dist/types-BUxNaJ8c.d.ts +0 -108
  133. package/dist/types-BkfcQnxV.d.ts +0 -313
  134. package/dist/verdict-C9MlYujm.d.ts +0 -35
  135. /package/dist/{chunk-VF3XSYTI.js.map → chunk-33JA4TFA.js.map} +0 -0
  136. /package/dist/{chunk-4JLWXDYA.js.map → chunk-3EHHMC6E.js.map} +0 -0
  137. /package/dist/{chunk-CCZIVI3F.js.map → chunk-BFW56GTT.js.map} +0 -0
  138. /package/dist/{chunk-HZHNRYHK.js.map → chunk-K6N6XJJX.js.map} +0 -0
  139. /package/dist/{chunk-MGEHEHSN.js.map → chunk-OIIMMLRB.js.map} +0 -0
  140. /package/dist/{chunk-DXZRATT5.js.map → chunk-OYZAPX5G.js.map} +0 -0
  141. /package/dist/{chunk-ODVOOEWQ.js.map → chunk-QBRSJK47.js.map} +0 -0
  142. /package/dist/{chunk-GQCZRZ7L.js.map → chunk-U5CHZ5M3.js.map} +0 -0
  143. /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-DXZRATT5.js";
14
- import "./chunk-TVVP3ZZQ.js";
15
- import "./chunk-5UF54T55.js";
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
- import { M as MaximumCharge, C as CostLedger, a as CostChannel } from './cost-ledger-DWy3XdJc.js';
2
- import { D as DefaultVerdict } from './verdict-C9MlYujm.js';
3
- import { A as AdversarialMutation } from './adversarial-B7loGVVX.js';
4
- import './errors-oeQrLqXC.js';
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";