@tangle-network/agent-eval 0.119.0 → 0.119.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 (40) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/analyst/index.d.ts +30 -39
  3. package/dist/analyst/index.js +9 -5
  4. package/dist/analyst/index.js.map +1 -1
  5. package/dist/benchmarks/index.js +5 -5
  6. package/dist/campaign/index.d.ts +28 -29
  7. package/dist/campaign/index.js +5 -5
  8. package/dist/{chunk-LMJ2TGWJ.js → chunk-JM2SKQMS.js} +2 -2
  9. package/dist/{chunk-RLCJQ6VZ.js → chunk-PSXJ32SR.js} +157 -3
  10. package/dist/chunk-PSXJ32SR.js.map +1 -0
  11. package/dist/{chunk-6QIM2EAP.js → chunk-PXD6ZFNY.js} +99 -1
  12. package/dist/chunk-PXD6ZFNY.js.map +1 -0
  13. package/dist/{chunk-GERDAIAL.js → chunk-QWMPPZ3X.js} +3 -3
  14. package/dist/{chunk-7A4LIMMY.js → chunk-S5TT5R3L.js} +229 -97
  15. package/dist/chunk-S5TT5R3L.js.map +1 -0
  16. package/dist/{chunk-ZYHJNKI3.js → chunk-ULOKLHIQ.js} +42 -5
  17. package/dist/chunk-ULOKLHIQ.js.map +1 -0
  18. package/dist/{chunk-FIUFRXP3.js → chunk-WW2A73HW.js} +49 -91
  19. package/dist/chunk-WW2A73HW.js.map +1 -0
  20. package/dist/{chunk-F6YUH3L4.js → chunk-XMBOU5W7.js} +12 -165
  21. package/dist/chunk-XMBOU5W7.js.map +1 -0
  22. package/dist/contract/index.d.ts +25 -16
  23. package/dist/contract/index.js +281 -5
  24. package/dist/contract/index.js.map +1 -1
  25. package/dist/index.d.ts +71 -68
  26. package/dist/index.js +31 -32
  27. package/dist/index.js.map +1 -1
  28. package/dist/openapi.json +1 -1
  29. package/dist/traces.d.ts +39 -25
  30. package/dist/traces.js +3 -5
  31. package/docs/trace-analysis.md +6 -2
  32. package/package.json +2 -2
  33. package/dist/chunk-6QIM2EAP.js.map +0 -1
  34. package/dist/chunk-7A4LIMMY.js.map +0 -1
  35. package/dist/chunk-F6YUH3L4.js.map +0 -1
  36. package/dist/chunk-FIUFRXP3.js.map +0 -1
  37. package/dist/chunk-RLCJQ6VZ.js.map +0 -1
  38. package/dist/chunk-ZYHJNKI3.js.map +0 -1
  39. /package/dist/{chunk-LMJ2TGWJ.js.map → chunk-JM2SKQMS.js.map} +0 -0
  40. /package/dist/{chunk-GERDAIAL.js.map → chunk-QWMPPZ3X.js.map} +0 -0
package/dist/index.js CHANGED
@@ -43,17 +43,15 @@ import {
43
43
  agentProfileHash,
44
44
  agentProfileId,
45
45
  agentProfileModelId,
46
- comparePairedArms,
47
46
  completionVerdict,
48
47
  createLlmCorrectnessChecker,
49
48
  createTokenRecallChecker,
50
49
  expandProfileAxes,
51
50
  extractProducedState,
52
51
  harnessAxisOf,
53
- pairArms,
54
52
  parseCorrectnessResponse,
55
53
  verifyCompletion
56
- } from "./chunk-F6YUH3L4.js";
54
+ } from "./chunk-XMBOU5W7.js";
57
55
  import {
58
56
  DEFAULT_MUTATION_PRIMITIVES,
59
57
  DEFAULT_RED_TEAM_CORPUS,
@@ -67,6 +65,7 @@ import {
67
65
  campaignMeanComposite,
68
66
  codeExecutionJudge,
69
67
  coherenceJudge,
68
+ comparePairedArms,
70
69
  costReceiptFromTCloud,
71
70
  createCustomJudge,
72
71
  createDomainExpertJudge,
@@ -79,6 +78,7 @@ import {
79
78
  heldOutGate,
80
79
  llmJudge,
81
80
  maximumChargeForTCloudRequest,
81
+ pairArms,
82
82
  paretoFrontier,
83
83
  paretoFrontierWithCrowding,
84
84
  parseReflectionResponse,
@@ -91,7 +91,7 @@ import {
91
91
  scoreRedTeamOutput,
92
92
  surfaceContentHash,
93
93
  toolNamesForRun
94
- } from "./chunk-RLCJQ6VZ.js";
94
+ } from "./chunk-PSXJ32SR.js";
95
95
  import {
96
96
  BackendIntegrityError,
97
97
  assertRealBackend,
@@ -114,12 +114,12 @@ import {
114
114
  defaultIsMaterial,
115
115
  diffFindings,
116
116
  runSemanticConceptJudge
117
- } from "./chunk-LMJ2TGWJ.js";
117
+ } from "./chunk-JM2SKQMS.js";
118
118
  import {
119
119
  buildDefaultAnalystRegistry,
120
120
  computeTraceMetrics,
121
121
  createChatClient
122
- } from "./chunk-GERDAIAL.js";
122
+ } from "./chunk-QWMPPZ3X.js";
123
123
  import "./chunk-HHWE3POT.js";
124
124
  import {
125
125
  Mutex
@@ -155,7 +155,7 @@ import {
155
155
  scorePolicyEditReadiness,
156
156
  validatePolicyEdit,
157
157
  validatePolicyEditCandidateRecord
158
- } from "./chunk-7A4LIMMY.js";
158
+ } from "./chunk-S5TT5R3L.js";
159
159
  import {
160
160
  allCriticalPassed,
161
161
  controlFailureClassFromVerification,
@@ -304,7 +304,7 @@ import {
304
304
  scoreTraceInsightReadiness,
305
305
  tokenizeDomainWords,
306
306
  traceAnalystOnRunComplete
307
- } from "./chunk-ZYHJNKI3.js";
307
+ } from "./chunk-ULOKLHIQ.js";
308
308
  import "./chunk-H5UD2323.js";
309
309
  import {
310
310
  extractUsage,
@@ -325,9 +325,8 @@ import {
325
325
  import {
326
326
  TRACE_ANALYST_ACTOR_DESCRIPTION,
327
327
  TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION,
328
- TRACE_ANALYST_SUBAGENT_DESCRIPTION,
329
328
  analyzeTraces
330
- } from "./chunk-FIUFRXP3.js";
329
+ } from "./chunk-WW2A73HW.js";
331
330
  import {
332
331
  DEFAULT_REDACTION_RULES,
333
332
  REDACTION_VERSION,
@@ -352,7 +351,7 @@ import {
352
351
  stringField,
353
352
  traceAnalystFunctionGroup,
354
353
  traceSpanKindToOpenInferenceKind
355
- } from "./chunk-6QIM2EAP.js";
354
+ } from "./chunk-PXD6ZFNY.js";
356
355
  import {
357
356
  RunIntegrityError,
358
357
  assertRunCaptured,
@@ -4338,7 +4337,7 @@ function renderSteeringText(bundle) {
4338
4337
  }
4339
4338
 
4340
4339
  // src/steering-optimizer.ts
4341
- import { AxGEPA, ai, ax } from "@ax-llm/ax";
4340
+ import { AxGEPA, AxSignature, ax } from "@ax-llm/ax";
4342
4341
  var PairwiseSteeringOptimizer = class {
4343
4342
  optimize(rows, config = {}) {
4344
4343
  const ranked = rankRows(rows, config.weights);
@@ -4370,7 +4369,8 @@ var AxGepaSteeringOptimizer = class {
4370
4369
  };
4371
4370
  }
4372
4371
  const signature = `task:string, split:string, seedPreview:string -> variantId:class "${variantIds.join(", ")}", rationale:string`;
4373
- const selector = ax(signature, {
4372
+ const selectorSignature = AxSignature.from(signature);
4373
+ const selector = ax(selectorSignature, {
4374
4374
  description: "Choose the best steering bundle variant for an autopilot task."
4375
4375
  });
4376
4376
  const shuffled = seededShuffle(byScenario, signature);
@@ -4399,15 +4399,11 @@ var AxGepaSteeringOptimizer = class {
4399
4399
  earlyStoppingTrials: 3,
4400
4400
  sampleCount: 1
4401
4401
  });
4402
- const compiled = await optimizer.compile(
4403
- selector,
4404
- train,
4405
- (input) => input.prediction?.variantId === input.example?.variantId ? 1 : 0,
4406
- {
4407
- validationExamples: validation,
4408
- maxMetricCalls: 64
4409
- }
4410
- );
4402
+ const metric = ({ prediction, example }) => stringField2(prediction, "variantId") === stringField2(example, "variantId") ? 1 : 0;
4403
+ const compiled = await optimizer.compile(selector, train, metric, {
4404
+ validationExamples: validation,
4405
+ maxMetricCalls: 64
4406
+ });
4411
4407
  if (compiled.optimizedProgram !== void 0) {
4412
4408
  selector.applyOptimization(compiled.optimizedProgram);
4413
4409
  }
@@ -4463,12 +4459,17 @@ function collapseScenarioWinners(rows, weights) {
4463
4459
  });
4464
4460
  }
4465
4461
  function createAxService(provider, apiKey, model) {
4466
- return ai({
4467
- name: provider,
4462
+ return createAnalystAi({
4463
+ provider,
4468
4464
  apiKey,
4469
- config: { model }
4465
+ model
4470
4466
  });
4471
4467
  }
4468
+ function stringField2(value, field) {
4469
+ if (!value || typeof value !== "object") return void 0;
4470
+ const candidate = value[field];
4471
+ return typeof candidate === "string" ? candidate : void 0;
4472
+ }
4472
4473
  function seededShuffle(items, seed) {
4473
4474
  const rng = mulberry322(hashString(seed));
4474
4475
  const out = [...items];
@@ -5972,9 +5973,9 @@ function statusAdvanced(key, progression) {
5972
5973
  description: `"${key}" progressed along ${progression.join("\u2192")}`,
5973
5974
  score: ({ before, after }) => {
5974
5975
  const bi = progression.indexOf(String(before[key]));
5975
- const ai2 = progression.indexOf(String(after[key]));
5976
- if (bi === -1 || ai2 === -1) return 0;
5977
- return ai2 >= bi ? 1 : 0;
5976
+ const ai = progression.indexOf(String(after[key]));
5977
+ if (bi === -1 || ai === -1) return 0;
5978
+ return ai >= bi ? 1 : 0;
5978
5979
  }
5979
5980
  };
5980
5981
  }
@@ -10036,12 +10037,11 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
10036
10037
  attributes: {
10037
10038
  "analyst.question_length": input.question.length,
10038
10039
  "analyst.max_turns": options.maxTurns ?? 12,
10039
- "analyst.max_depth": options.maxDepth ?? 1,
10040
+ "analyst.max_subqueries": options.maxSubqueries ?? 4,
10040
10041
  "eval.phase": "analyst"
10041
10042
  }
10042
10043
  });
10043
10044
  const originalOnTurn = options.onTurn;
10044
- const turnSpanIds = [];
10045
10045
  const wrappedOptions = {
10046
10046
  ...options,
10047
10047
  onTurn: async (turn) => {
@@ -10050,6 +10050,7 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
10050
10050
  name: `analyst:turn-${turn.turn}`,
10051
10051
  parentSpanId: parentSpan.span.spanId,
10052
10052
  attributes: {
10053
+ "analyst.stage": turn.stage,
10053
10054
  "analyst.turn": turn.turn,
10054
10055
  "analyst.is_error": turn.isError,
10055
10056
  "analyst.code_length": turn.code.length,
@@ -10057,7 +10058,6 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
10057
10058
  "eval.phase": "analyst"
10058
10059
  }
10059
10060
  });
10060
- turnSpanIds.push(turnSpan.span.spanId);
10061
10061
  if (turn.isError) {
10062
10062
  await turnSpan.fail("Turn produced an error");
10063
10063
  } else {
@@ -11664,7 +11664,6 @@ export {
11664
11664
  TOOL_NAME_ATTR_KEYS,
11665
11665
  TRACE_ANALYST_ACTOR_DESCRIPTION,
11666
11666
  TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION,
11667
- TRACE_ANALYST_SUBAGENT_DESCRIPTION,
11668
11667
  TRACE_ANALYST_TRUNCATION_MARKER_PREFIX,
11669
11668
  TRACE_SCHEMA_VERSION,
11670
11669
  TokenCounter,