@tangle-network/agent-eval 0.117.1 → 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 +23 -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 +4275 -73
  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-JSJZ4PJ6.js → chunk-Q442S5AS.js} +17 -17
  32. package/dist/{chunk-ODVOOEWQ.js → chunk-QBRSJK47.js} +2 -2
  33. package/dist/{chunk-S2F4J57L.js → chunk-QKEGNI5B.js} +77 -32
  34. package/dist/chunk-QKEGNI5B.js.map +1 -0
  35. package/dist/{chunk-5UF54T55.js → chunk-S3UZOQ5Y.js} +34 -7
  36. package/dist/chunk-S3UZOQ5Y.js.map +1 -0
  37. package/dist/{chunk-FQNLDL4D.js → chunk-SVH2ANFD.js} +136 -4
  38. package/dist/chunk-SVH2ANFD.js.map +1 -0
  39. package/dist/{chunk-GQCZRZ7L.js → chunk-U5CHZ5M3.js} +9 -9
  40. package/dist/{chunk-TVVP3ZZQ.js → chunk-VQMK5FMP.js} +2 -1
  41. package/dist/{chunk-TVVP3ZZQ.js.map → chunk-VQMK5FMP.js.map} +1 -1
  42. package/dist/chunk-WDHBCA3M.js +31 -0
  43. package/dist/chunk-WDHBCA3M.js.map +1 -0
  44. package/dist/{chunk-HQPHZGL6.js → chunk-YLMUS4MM.js} +9 -9
  45. package/dist/{chunk-LQUTGLOZ.js → chunk-ZET2UAYW.js} +15 -65
  46. package/dist/chunk-ZET2UAYW.js.map +1 -0
  47. package/dist/contract/index.d.ts +4012 -38
  48. package/dist/contract/index.js +56 -29
  49. package/dist/contract/index.js.map +1 -1
  50. package/dist/control.d.ts +1013 -9
  51. package/dist/control.js +4 -3
  52. package/dist/fuzz.d.ts +194 -4
  53. package/dist/fuzz.js +3 -3
  54. package/dist/hosted/index.d.ts +498 -17
  55. package/dist/index.d.ts +10982 -1286
  56. package/dist/index.js +97 -80
  57. package/dist/index.js.map +1 -1
  58. package/dist/matrix/index.d.ts +139 -4
  59. package/dist/meta-eval/index.d.ts +862 -15
  60. package/dist/meta-eval/index.js +2 -1
  61. package/dist/meta-eval/index.js.map +1 -1
  62. package/dist/multishot/index.d.ts +214 -14
  63. package/dist/openapi.json +1 -1
  64. package/dist/pipelines/index.d.ts +392 -7
  65. package/dist/pipelines/index.js +5 -3
  66. package/dist/pipelines/index.js.map +1 -1
  67. package/dist/reporting.d.ts +1277 -17
  68. package/dist/rl.d.ts +2359 -28
  69. package/dist/rl.js +6 -5
  70. package/dist/rl.js.map +1 -1
  71. package/dist/storyboard/index.d.ts +86 -1
  72. package/dist/trace-attributes.d.ts +16 -0
  73. package/dist/trace-attributes.js +32 -0
  74. package/dist/trace-attributes.js.map +1 -0
  75. package/dist/traces.d.ts +1970 -697
  76. package/dist/traces.js +49 -32
  77. package/dist/wire/index.d.ts +655 -9
  78. package/docs/insight-report.md +44 -0
  79. package/package.json +9 -3
  80. package/dist/adversarial-B7loGVVX.d.ts +0 -19
  81. package/dist/analyst-C8HHvfJp.d.ts +0 -88
  82. package/dist/analyze-runs--2x39HZ7.d.ts +0 -81
  83. package/dist/baseline-DKq3gJpP.d.ts +0 -141
  84. package/dist/calibration-C8MTS7cw.d.ts +0 -101
  85. package/dist/chunk-5UF54T55.js.map +0 -1
  86. package/dist/chunk-E4BUPP7Z.js.map +0 -1
  87. package/dist/chunk-FQNLDL4D.js.map +0 -1
  88. package/dist/chunk-LQUTGLOZ.js.map +0 -1
  89. package/dist/chunk-S2F4J57L.js.map +0 -1
  90. package/dist/chunk-YZPO4UHR.js.map +0 -1
  91. package/dist/code-agent-session-CjZsVd19.d.ts +0 -87
  92. package/dist/control-6vuGfmDH.d.ts +0 -258
  93. package/dist/cost-ledger-DWy3XdJc.d.ts +0 -183
  94. package/dist/dataset-NENEzRgk.d.ts +0 -115
  95. package/dist/default-registry-DaK8b3fv.d.ts +0 -155
  96. package/dist/emitter-CjD7vUwv.d.ts +0 -122
  97. package/dist/errors-oeQrLqXC.d.ts +0 -74
  98. package/dist/failure-cluster-DOAcSJ87.d.ts +0 -76
  99. package/dist/feedback-trajectory-BUnM58xL.d.ts +0 -348
  100. package/dist/gepa-eESocoDi.d.ts +0 -642
  101. package/dist/index-PdX4VnPA.d.ts +0 -423
  102. package/dist/insight-report-DY4nDW9Q.d.ts +0 -310
  103. package/dist/integrity-DqlBiLyK.d.ts +0 -81
  104. package/dist/judge-calibration-7C-IDmKr.d.ts +0 -145
  105. package/dist/kind-factory-ClZmO25A.d.ts +0 -171
  106. package/dist/llm-client-qoDd18Qz.d.ts +0 -289
  107. package/dist/multi-layer-verifier-BsqKuLyN.d.ts +0 -150
  108. package/dist/off-policy-DiwuKKg7.d.ts +0 -132
  109. package/dist/outcome-store-rnXLEqSn.d.ts +0 -63
  110. package/dist/policy-edit-wG9uFEFm.d.ts +0 -455
  111. package/dist/pre-registration-BWQhJ3vz.d.ts +0 -761
  112. package/dist/provenance-DpjwyseI.d.ts +0 -541
  113. package/dist/query-CF7PG61p.d.ts +0 -35
  114. package/dist/raw-provider-sink-C46HDghv.d.ts +0 -132
  115. package/dist/release-report-C8G2i5Xi.d.ts +0 -236
  116. package/dist/researcher-C8XyxQsu.d.ts +0 -387
  117. package/dist/rubric-predictive-validity-p49lLVrE.d.ts +0 -105
  118. package/dist/run-record-BDH49H2E.d.ts +0 -360
  119. package/dist/runtime-trajectory-DGBIUt4B.d.ts +0 -49
  120. package/dist/schema-B3Q3l9Z_.d.ts +0 -201
  121. package/dist/semantic-concept-judge-CXnPEJbf.d.ts +0 -723
  122. package/dist/sequential-5iSVfzl2.d.ts +0 -139
  123. package/dist/series-convergence-D5OWMBg6.d.ts +0 -33
  124. package/dist/statistics-KUnG73jH.d.ts +0 -494
  125. package/dist/storage-DrX3v_5B.d.ts +0 -50
  126. package/dist/store-C1YxJDEK.d.ts +0 -248
  127. package/dist/store-DGqD0Pyo.d.ts +0 -116
  128. package/dist/summary-report-C5bKFfm-.d.ts +0 -445
  129. package/dist/test-graded-scenario-B0ybnPY7.d.ts +0 -166
  130. package/dist/types-BSw1rOUB.d.ts +0 -634
  131. package/dist/types-BUxNaJ8c.d.ts +0 -108
  132. package/dist/types-BkfcQnxV.d.ts +0 -313
  133. package/dist/verdict-C9MlYujm.d.ts +0 -35
  134. /package/dist/{chunk-VF3XSYTI.js.map → chunk-33JA4TFA.js.map} +0 -0
  135. /package/dist/{chunk-4JLWXDYA.js.map → chunk-3EHHMC6E.js.map} +0 -0
  136. /package/dist/{chunk-CCZIVI3F.js.map → chunk-BFW56GTT.js.map} +0 -0
  137. /package/dist/{chunk-HZHNRYHK.js.map → chunk-K6N6XJJX.js.map} +0 -0
  138. /package/dist/{chunk-MGEHEHSN.js.map → chunk-OIIMMLRB.js.map} +0 -0
  139. /package/dist/{chunk-DXZRATT5.js.map → chunk-OYZAPX5G.js.map} +0 -0
  140. /package/dist/{chunk-JSJZ4PJ6.js.map → chunk-Q442S5AS.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
@@ -1,6 +1,141 @@
1
- import { R as RunAgentMatrixOptions, M as MatrixResult } from '../types-BUxNaJ8c.js';
2
- export { A as AxisSummary, C as CellResult, a as MatrixAxis, b as MatrixCell } from '../types-BUxNaJ8c.js';
3
- export { D as DefaultVerdict } from '../verdict-C9MlYujm.js';
1
+ /**
2
+ * Validator-output verdict substrate primitive for "did this output pass,
3
+ * and how well?"
4
+ *
5
+ * Used by:
6
+ * - `@tangle-network/agent-eval/matrix` — verdict per cell in the cartesian.
7
+ * - `@tangle-network/agent-runtime` — Validator<Output, Verdict = DefaultVerdict>.
8
+ * Runtime keeps `Validator` because it's coupled to runtime-shaped
9
+ * `ValidationCtx` (iteration, signal, traceEmitter); the verdict TYPE
10
+ * itself is a substrate concept and lives here.
11
+ *
12
+ * Repo layering: agent-eval is the substrate (no upward deps). Both
13
+ * agent-runtime and agent-knowledge consume this type FROM agent-eval —
14
+ * never the other way around. See CLAUDE.md "Repo layering" for the rule.
15
+ */
16
+ /**
17
+ * Minimal verdict shape — `valid` + `score` are required; `scores` +
18
+ * `notes` are optional surface. Validators that need richer shapes
19
+ * parameterise `Validator<Output, MyVerdict>` with their own type.
20
+ *
21
+ * Need structured extras? Extend DefaultVerdict with typed fields — never
22
+ * serialize extras into `notes`.
23
+ */
24
+ interface DefaultVerdict {
25
+ /** Whether the output meets the validator's pass criteria. */
26
+ valid: boolean;
27
+ /** Aggregate score in [0, 1]. Drivers use this for winner selection. */
28
+ score: number;
29
+ /** Per-dimension scores. Free-form; weighted into `score` by the validator. */
30
+ scores?: Record<string, number>;
31
+ /** Human-readable rationale; surfaces in trace + final-result `winner.verdict`. */
32
+ notes?: string;
33
+ }
34
+
35
+ /**
36
+ * N-axis cartesian matrix over substrate types — types module.
37
+ *
38
+ * The matrix is a runner + aggregator. It iterates the cartesian product of
39
+ * caller-provided axes (any value type — `AgentProfile` from agent-interface,
40
+ * `Driver` / `Validator` from agent-runtime, rubric records, thinking levels, anything)
41
+ * and aggregates per-axis pass/score/cost summaries. Substrate types are
42
+ * imported at the boundary by JSDoc only; the matrix never wraps them.
43
+ */
44
+
45
+ /** One axis = one dimension to iterate. `V` is the value type — pass any
46
+ * substrate type (AgentProfile, Driver, Validator, rubric record). */
47
+ interface MatrixAxis<V> {
48
+ /** Axis name. Becomes the key in `MatrixResult.byAxis`. */
49
+ name: string;
50
+ /** Stable id per value. Used as the bucket key in aggregation. */
51
+ values: Array<{
52
+ id: string;
53
+ value: V;
54
+ }>;
55
+ /** Optional bucket label override. Receives the same `(value, id)` the
56
+ * runner stored on the cell; default label is `id`. */
57
+ label?: (value: V, id: string) => string;
58
+ }
59
+ /** A cell carries one picked value from each axis, keyed by axis name. */
60
+ interface MatrixCell {
61
+ axes: Record<string, {
62
+ id: string;
63
+ value: unknown;
64
+ }>;
65
+ /** 0-based replicate index within the same axis combination. */
66
+ rep: number;
67
+ /** Stable sort key — preserves cartesian order across concurrent execution. */
68
+ ordinal: number;
69
+ }
70
+ interface CellResult<Output> {
71
+ output: Output;
72
+ verdict: DefaultVerdict;
73
+ costUsd: number;
74
+ durationMs: number;
75
+ runId?: string;
76
+ /** Populated when `runCell` threw. The cell contributes 0 to passRate AND
77
+ * meanScore regardless of `verdict`. */
78
+ error?: {
79
+ message: string;
80
+ kind: string;
81
+ };
82
+ }
83
+ interface AxisSummary {
84
+ axisName: string;
85
+ axisValue: string;
86
+ cells: number;
87
+ passRate: number;
88
+ meanScore: number;
89
+ p50Score: number;
90
+ p90Score: number;
91
+ totalCostUsd: number;
92
+ meanDurationMs: number;
93
+ }
94
+ interface MatrixResult<Output> {
95
+ cells: Array<{
96
+ cell: MatrixCell;
97
+ runs: CellResult<Output>[];
98
+ }>;
99
+ /** `byAxis[axisName][axisValueId] = summary`. Populated only for axes
100
+ * named in `aggregateBy` (default = every axis in `axes`). */
101
+ byAxis: Record<string, Record<string, AxisSummary>>;
102
+ summary: {
103
+ totalCells: number;
104
+ runsExecuted: number;
105
+ /** Cells removed by `filter` plus cells unscheduled after the cost
106
+ * ceiling or abort signal tripped. */
107
+ cellsSkipped: number;
108
+ overallPassRate: number;
109
+ overallMeanScore: number;
110
+ totalCostUsd: number;
111
+ durationMs: number;
112
+ };
113
+ /** Stable id-like string generated at the end of the run. */
114
+ matrixId: string;
115
+ }
116
+ interface RunAgentMatrixOptions<Output> {
117
+ axes: MatrixAxis<unknown>[];
118
+ /** User-supplied cell executor. May throw; the matrix captures throws as
119
+ * `CellResult.error` and continues. */
120
+ runCell: (cell: MatrixCell) => Promise<CellResult<Output>>;
121
+ /** Replicates per cell. Default 1. */
122
+ reps?: number;
123
+ /** Prune cells from the cartesian BEFORE rep expansion. */
124
+ filter?: (cell: Omit<MatrixCell, 'rep' | 'ordinal'>) => boolean;
125
+ /** Axes to aggregate into `byAxis`. Default: every axis in `axes`. */
126
+ aggregateBy?: string[];
127
+ /** Max concurrent in-flight `runCell` invocations. Default 4. */
128
+ maxConcurrency?: number;
129
+ /** Cumulative-cost abort threshold (USD). When the running sum of
130
+ * `result.costUsd` crosses this value, no new cells are scheduled.
131
+ * In-flight cells finish. Default `Infinity`. */
132
+ costCeiling?: number;
133
+ /** Fires once per executed cell, after its promise settles. */
134
+ onCellComplete?: (cell: MatrixCell, result: CellResult<Output>) => void;
135
+ /** External cancellation. Aborts in-flight cells via a forwarded signal
136
+ * and suppresses scheduling of new ones. */
137
+ signal?: AbortSignal;
138
+ }
4
139
 
5
140
  /**
6
141
  * N-axis cartesian runner.
@@ -17,4 +152,4 @@ export { D as DefaultVerdict } from '../verdict-C9MlYujm.js';
17
152
 
18
153
  declare function runAgentMatrix<Output>(opts: RunAgentMatrixOptions<Output>): Promise<MatrixResult<Output>>;
19
154
 
20
- export { MatrixResult, RunAgentMatrixOptions, runAgentMatrix };
155
+ export { type AxisSummary, type CellResult, type DefaultVerdict, type MatrixAxis, type MatrixCell, type MatrixResult, type RunAgentMatrixOptions, runAgentMatrix };