@tangle-network/agent-eval 0.143.0 → 0.144.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +21 -8
  3. package/dist/analyst/index.d.ts +82 -17
  4. package/dist/analyst/index.d.ts.map +1 -1
  5. package/dist/analyst/index.js +4 -4
  6. package/dist/{benchmark-command-CSddvlq7.js → benchmark-command-95Zqd1e8.js} +333 -111
  7. package/dist/benchmark-command-95Zqd1e8.js.map +1 -0
  8. package/dist/benchmarks/index.d.ts +1 -1
  9. package/dist/benchmarks/index.js +1 -1
  10. package/dist/{benchmarks-Dg0B56tK.js → benchmarks-CRT4ScEA.js} +4 -4
  11. package/dist/{benchmarks-Dg0B56tK.js.map → benchmarks-CRT4ScEA.js.map} +1 -1
  12. package/dist/campaign/index.d.ts +4 -3
  13. package/dist/campaign/index.js +4 -4
  14. package/dist/{campaign-C7ZGiZYG.js → campaign-CefP3fPS.js} +12 -10
  15. package/dist/campaign-CefP3fPS.js.map +1 -0
  16. package/dist/cli.js +2 -2
  17. package/dist/contract/index.d.ts +1 -1
  18. package/dist/contract/index.js +3 -3
  19. package/dist/{default-registry-BupFSXSN.js → default-registry-SOyHB6qG.js} +3 -3
  20. package/dist/{default-registry-BupFSXSN.js.map → default-registry-SOyHB6qG.js.map} +1 -1
  21. package/dist/{dspy-rlm-engine-CJ4sN8Wx.js → dspy-rlm-engine-BR7TtB0o.js} +69 -31
  22. package/dist/dspy-rlm-engine-BR7TtB0o.js.map +1 -0
  23. package/dist/{eval-campaign-YdkpWWoT.js → eval-campaign-lI7wB9DH.js} +2 -2
  24. package/dist/{eval-campaign-YdkpWWoT.js.map → eval-campaign-lI7wB9DH.js.map} +1 -1
  25. package/dist/external-optimizer-contracts-CdmX2K2S.d.ts +165 -0
  26. package/dist/external-optimizer-contracts-CdmX2K2S.d.ts.map +1 -0
  27. package/dist/{index-BKjcUH13.d.ts → index-BZUe-ODI.d.ts} +41 -5
  28. package/dist/index-BZUe-ODI.d.ts.map +1 -0
  29. package/dist/{index-DY83M1WL.d.ts → index-BrpxwELi.d.ts} +9 -8
  30. package/dist/{index-DY83M1WL.d.ts.map → index-BrpxwELi.d.ts.map} +1 -1
  31. package/dist/{index-CaOjqCli.d.ts → index-DRI1DU5z.d.ts} +3 -3
  32. package/dist/{index-CaOjqCli.d.ts.map → index-DRI1DU5z.d.ts.map} +1 -1
  33. package/dist/index.d.ts +7 -7
  34. package/dist/index.js +12 -11
  35. package/dist/index.js.map +1 -1
  36. package/dist/{integrity-hruKe6oe.js → integrity-DY6tIbl0.js} +48 -18
  37. package/dist/integrity-DY6tIbl0.js.map +1 -0
  38. package/dist/{llm-client-B3WXSH5Y.js → llm-client-D3EoChAU.js} +7 -7
  39. package/dist/llm-client-D3EoChAU.js.map +1 -0
  40. package/dist/openapi.json +1 -1
  41. package/dist/rl.js +1 -1
  42. package/dist/{semantic-concept-judge-DJQtFr95.js → semantic-concept-judge-l8Lb3Kqz.js} +2 -2
  43. package/dist/{semantic-concept-judge-DJQtFr95.js.map → semantic-concept-judge-l8Lb3Kqz.js.map} +1 -1
  44. package/dist/{server-Cu4M3NSO.js → server-Df00sdwz.js} +3 -3
  45. package/dist/{server-Cu4M3NSO.js.map → server-Df00sdwz.js.map} +1 -1
  46. package/dist/single-run-lock-B-cFnnNn.js +1799 -0
  47. package/dist/single-run-lock-B-cFnnNn.js.map +1 -0
  48. package/dist/{skill-usage-CRqaHi0R.d.ts → skill-usage-3vUWdZ9n.d.ts} +24 -5
  49. package/dist/skill-usage-3vUWdZ9n.d.ts.map +1 -0
  50. package/dist/{skillopt-optimization-method-Di8Xkalt.js → skillopt-optimization-method-DA5mJmFE.js} +225 -347
  51. package/dist/skillopt-optimization-method-DA5mJmFE.js.map +1 -0
  52. package/dist/{skillopt-optimization-method-CwRvi-rL.d.ts → skillopt-optimization-method-DNniakI5.d.ts} +47 -9
  53. package/dist/skillopt-optimization-method-DNniakI5.d.ts.map +1 -0
  54. package/dist/supervisor-run/index.d.ts +3 -3
  55. package/dist/supervisor-run/index.js +3 -3
  56. package/dist/{supervisor-run-BEns49Nx.js → supervisor-run-DiyQVczd.js} +301 -25
  57. package/dist/supervisor-run-DiyQVczd.js.map +1 -0
  58. package/dist/types-BjMFz88h.d.ts.map +1 -1
  59. package/dist/{types-Dea6tiVI.d.ts → types-yLK8gXE9.d.ts} +15 -2
  60. package/dist/types-yLK8gXE9.d.ts.map +1 -0
  61. package/dist/wire/index.js +1 -1
  62. package/docs/campaign-proposers.md +11 -7
  63. package/docs/trace-analysis.md +43 -32
  64. package/package.json +1 -1
  65. package/dist/benchmark-command-CSddvlq7.js.map +0 -1
  66. package/dist/campaign-C7ZGiZYG.js.map +0 -1
  67. package/dist/dspy-rlm-engine-CJ4sN8Wx.js.map +0 -1
  68. package/dist/external-optimizer-contracts-nb7c_WAR.d.ts +0 -42
  69. package/dist/external-optimizer-contracts-nb7c_WAR.d.ts.map +0 -1
  70. package/dist/index-BKjcUH13.d.ts.map +0 -1
  71. package/dist/integrity-hruKe6oe.js.map +0 -1
  72. package/dist/llm-client-B3WXSH5Y.js.map +0 -1
  73. package/dist/single-run-lock-Do-8vBIJ.js +0 -1049
  74. package/dist/single-run-lock-Do-8vBIJ.js.map +0 -1
  75. package/dist/skill-usage-CRqaHi0R.d.ts.map +0 -1
  76. package/dist/skillopt-optimization-method-CwRvi-rL.d.ts.map +0 -1
  77. package/dist/skillopt-optimization-method-Di8Xkalt.js.map +0 -1
  78. package/dist/supervisor-run-BEns49Nx.js.map +0 -1
  79. package/dist/types-Dea6tiVI.d.ts.map +0 -1
@@ -15,7 +15,8 @@ Agent Eval separates five concerns:
15
15
 
16
16
  The built-in model-backed analysts use the official DSPy `RLM`.
17
17
  DSPy runs the research loop and a sandboxed Python interpreter.
18
- Agent Eval owns trace access, credentials, cancellation, cost accounting, and output validation.
18
+ Agent Eval owns trace access, cancellation, cost accounting, and output validation.
19
+ The calling application owns model execution, credentials, retries, and provider policy.
19
20
 
20
21
  `callLlmJson()` and `createPublicBenchmarkDirectRunner()` are direct-call baselines.
21
22
  They are not trace analysts.
@@ -37,46 +38,54 @@ The Python extra pins the tested stable DSPy and Deno versions.
37
38
  ```ts
38
39
  import {
39
40
  createDspyRlmTraceEngine,
41
+ type DspyRlmTraceEngineOptions,
40
42
  } from '@tangle-network/agent-eval/analyst'
41
43
  import {
42
44
  analyzeTraces,
43
45
  } from '@tangle-network/agent-eval/traces'
44
46
 
45
- const engine = createDspyRlmTraceEngine({
46
- baseUrl: process.env.LLM_BASE_URL!,
47
- apiKey: process.env.LLM_API_KEY!,
48
- model: process.env.LLM_MODEL!,
49
- pricing: {
50
- inputUsdPerMillion: 3,
51
- outputUsdPerMillion: 15,
52
- },
53
- maxCostUsd: 0.50,
54
- runner: { command: '.venv/bin/python' },
55
- })
56
-
57
- const result = await analyzeTraces(
58
- { question: 'What first caused this run to fail?' },
59
- {
60
- source: 'run.otlp.jsonl',
61
- engine,
62
- toolGroup: 'singleTrace',
63
- limits: {
64
- maxIterations: 8,
65
- maxLlmCalls: 4,
66
- maxToolCalls: 32,
47
+ type ModelOwner = Pick<
48
+ DspyRlmTraceEngineOptions,
49
+ 'call' | 'callRef' | 'recordExecution'
50
+ >
51
+
52
+ export async function answerOneQuestion(modelOwner: ModelOwner) {
53
+ const engine = createDspyRlmTraceEngine({
54
+ ...modelOwner,
55
+ model: 'deepseek-v4-flash',
56
+ pricing: {
57
+ inputUsdPerMillion: 3,
58
+ outputUsdPerMillion: 15,
67
59
  },
68
- },
69
- )
60
+ maxCostUsd: 0.50,
61
+ runner: { command: '.venv/bin/python' },
62
+ })
63
+
64
+ const result = await analyzeTraces(
65
+ { question: 'What first caused this run to fail?' },
66
+ {
67
+ source: 'run.otlp.jsonl',
68
+ engine,
69
+ toolGroup: 'singleTrace',
70
+ limits: {
71
+ maxIterations: 8,
72
+ maxLlmCalls: 4,
73
+ maxToolCalls: 32,
74
+ },
75
+ },
76
+ )
70
77
 
71
- console.log(result.answer)
72
- console.log(result.findings)
73
- console.log(result.trajectory)
78
+ console.log(result.answer)
79
+ console.log(result.findings)
80
+ console.log(result.trajectory)
81
+ }
74
82
  ```
75
83
 
76
84
  Omit `pricing` only when Agent Eval already recognizes the exact model or model family.
77
85
  Unknown pricing fails before the first model call.
78
86
 
79
- The provider key remains in the Node process.
87
+ Agent Eval never receives the provider key.
88
+ The caller-supplied model owner runs the exact Runtime path and returns one typed outcome, measured usage receipt, and finite execution record per admitted request.
80
89
  The Python process receives an authenticated loopback model endpoint with an ephemeral credential.
81
90
  Each trace read also crosses an authenticated loopback callback and counts against `maxToolCalls`.
82
91
 
@@ -229,9 +238,8 @@ agent-eval analyst-benchmark \
229
238
  --out .artifacts/analyst-run \
230
239
  --revision aa213b84ffb6690fc37ca15766d6ca174ec36d4d \
231
240
  --split verified \
232
- --base-url http://127.0.0.1:3355/v1 \
233
- --api-key-env CLI_BRIDGE_BEARER \
234
- --model claude-code/sonnet \
241
+ --model-owner-module ./dist/runtime-model-owner.mjs \
242
+ --model deepseek-v4-flash \
235
243
  --python .venv/bin/python \
236
244
  --limit 20 \
237
245
  --seed 7 \
@@ -239,6 +247,9 @@ agent-eval analyst-benchmark \
239
247
  --max-cost-usd 5
240
248
  ```
241
249
 
250
+ The model-owner module exports `createModelExecutionOwner({ model, environment })` and returns `call`, `callRef`, `recordExecution`, plus exact pricing when the model is not in Agent Eval's catalog.
251
+ Runtime-backed products use that module to materialize one exact agent profile; the benchmark command never receives provider credentials or adds provider retries.
252
+
242
253
  `--rlm-samples <k>` (CodeTraceBench, `dspy-rlm` only) runs the recursive engine `k` times per case and scores the step-level majority: a step survives when at least `ceil(k/2)` samples flag it, surviving steps reassemble into blocks, and the abstention fallback fires once, only when no step reaches the threshold.
243
254
  Per-sample blocks, the full voting record, and per-sample cost land in the observation's runner metadata; `k` is recorded in the run identity and `result.json`.
244
255
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-eval",
3
- "version": "0.143.0",
3
+ "version": "0.144.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": {