@tangle-network/agent-eval 0.119.0 → 0.120.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 (55) hide show
  1. package/CHANGELOG.md +25 -3
  2. package/README.md +0 -26
  3. package/dist/analyst/index.d.ts +30 -39
  4. package/dist/analyst/index.js +9 -5
  5. package/dist/analyst/index.js.map +1 -1
  6. package/dist/benchmarks/index.d.ts +11 -5
  7. package/dist/benchmarks/index.js +7 -7
  8. package/dist/campaign/index.d.ts +121 -66
  9. package/dist/campaign/index.js +26 -10
  10. package/dist/{chunk-RLCJQ6VZ.js → chunk-32BZXMSO.js} +385 -120
  11. package/dist/chunk-32BZXMSO.js.map +1 -0
  12. package/dist/{chunk-XJ7JVCHB.js → chunk-3A246TSA.js} +2 -2
  13. package/dist/{chunk-LMJ2TGWJ.js → chunk-JM2SKQMS.js} +2 -2
  14. package/dist/{chunk-F6YUH3L4.js → chunk-JN2FCO5W.js} +14 -168
  15. package/dist/chunk-JN2FCO5W.js.map +1 -0
  16. package/dist/{chunk-D7AEXSM5.js → chunk-PICTDURQ.js} +2 -2
  17. package/dist/{chunk-6QIM2EAP.js → chunk-PXD6ZFNY.js} +99 -1
  18. package/dist/chunk-PXD6ZFNY.js.map +1 -0
  19. package/dist/{chunk-GERDAIAL.js → chunk-QWMPPZ3X.js} +3 -3
  20. package/dist/{chunk-7A4LIMMY.js → chunk-S5TT5R3L.js} +229 -97
  21. package/dist/chunk-S5TT5R3L.js.map +1 -0
  22. package/dist/{chunk-ZYHJNKI3.js → chunk-ULOKLHIQ.js} +42 -5
  23. package/dist/chunk-ULOKLHIQ.js.map +1 -0
  24. package/dist/{chunk-FIUFRXP3.js → chunk-WW2A73HW.js} +49 -91
  25. package/dist/chunk-WW2A73HW.js.map +1 -0
  26. package/dist/{chunk-PAHNGS65.js → chunk-XDIRG3TO.js} +175 -11
  27. package/dist/chunk-XDIRG3TO.js.map +1 -0
  28. package/dist/contract/index.d.ts +76 -43
  29. package/dist/contract/index.js +596 -32
  30. package/dist/contract/index.js.map +1 -1
  31. package/dist/index.d.ts +92 -75
  32. package/dist/index.js +38 -35
  33. package/dist/index.js.map +1 -1
  34. package/dist/openapi.json +1 -1
  35. package/dist/rl.d.ts +11 -5
  36. package/dist/{run-campaign-OBXSN5WK.js → run-campaign-HNFPJET4.js} +2 -2
  37. package/dist/traces.d.ts +39 -25
  38. package/dist/traces.js +3 -5
  39. package/docs/trace-analysis.md +6 -2
  40. package/package.json +2 -7
  41. package/dist/chunk-6QIM2EAP.js.map +0 -1
  42. package/dist/chunk-7A4LIMMY.js.map +0 -1
  43. package/dist/chunk-F6YUH3L4.js.map +0 -1
  44. package/dist/chunk-FIUFRXP3.js.map +0 -1
  45. package/dist/chunk-PAHNGS65.js.map +0 -1
  46. package/dist/chunk-RLCJQ6VZ.js.map +0 -1
  47. package/dist/chunk-ZYHJNKI3.js.map +0 -1
  48. package/dist/primeintellect/index.d.ts +0 -311
  49. package/dist/primeintellect/index.js +0 -348
  50. package/dist/primeintellect/index.js.map +0 -1
  51. /package/dist/{chunk-XJ7JVCHB.js.map → chunk-3A246TSA.js.map} +0 -0
  52. /package/dist/{chunk-LMJ2TGWJ.js.map → chunk-JM2SKQMS.js.map} +0 -0
  53. /package/dist/{chunk-D7AEXSM5.js.map → chunk-PICTDURQ.js.map} +0 -0
  54. /package/dist/{chunk-GERDAIAL.js.map → chunk-QWMPPZ3X.js.map} +0 -0
  55. /package/dist/{run-campaign-OBXSN5WK.js.map → run-campaign-HNFPJET4.js.map} +0 -0
package/dist/index.js CHANGED
@@ -9,12 +9,12 @@ import {
9
9
  checkBehavioralCanary,
10
10
  checkCanaries,
11
11
  runBehavioralCanaries
12
- } from "./chunk-XJ7JVCHB.js";
12
+ } from "./chunk-3A246TSA.js";
13
13
  import {
14
14
  BENCHMARK_SPLIT_SEED,
15
15
  benchmarks_exports,
16
16
  deterministicSplit
17
- } from "./chunk-D7AEXSM5.js";
17
+ } from "./chunk-PICTDURQ.js";
18
18
  import {
19
19
  DEFAULT_RULES,
20
20
  buildTrajectory,
@@ -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-JN2FCO5W.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,17 +91,19 @@ import {
91
91
  scoreRedTeamOutput,
92
92
  surfaceContentHash,
93
93
  toolNamesForRun
94
- } from "./chunk-RLCJQ6VZ.js";
94
+ } from "./chunk-32BZXMSO.js";
95
95
  import {
96
96
  BackendIntegrityError,
97
+ assertRealAgentReceipts,
97
98
  assertRealBackend,
98
99
  cachedJudge,
99
100
  canonicalJson,
100
101
  contentHash,
101
102
  fileVerdictCache,
102
103
  inMemoryVerdictCache,
104
+ summarizeAgentReceiptIntegrity,
103
105
  summarizeBackendIntegrity
104
- } from "./chunk-PAHNGS65.js";
106
+ } from "./chunk-XDIRG3TO.js";
105
107
  import {
106
108
  DEFAULT_COMPLEXITY_WEIGHTS,
107
109
  FindingsStore,
@@ -114,12 +116,12 @@ import {
114
116
  defaultIsMaterial,
115
117
  diffFindings,
116
118
  runSemanticConceptJudge
117
- } from "./chunk-LMJ2TGWJ.js";
119
+ } from "./chunk-JM2SKQMS.js";
118
120
  import {
119
121
  buildDefaultAnalystRegistry,
120
122
  computeTraceMetrics,
121
123
  createChatClient
122
- } from "./chunk-GERDAIAL.js";
124
+ } from "./chunk-QWMPPZ3X.js";
123
125
  import "./chunk-HHWE3POT.js";
124
126
  import {
125
127
  Mutex
@@ -155,7 +157,7 @@ import {
155
157
  scorePolicyEditReadiness,
156
158
  validatePolicyEdit,
157
159
  validatePolicyEditCandidateRecord
158
- } from "./chunk-7A4LIMMY.js";
160
+ } from "./chunk-S5TT5R3L.js";
159
161
  import {
160
162
  allCriticalPassed,
161
163
  controlFailureClassFromVerification,
@@ -304,7 +306,7 @@ import {
304
306
  scoreTraceInsightReadiness,
305
307
  tokenizeDomainWords,
306
308
  traceAnalystOnRunComplete
307
- } from "./chunk-ZYHJNKI3.js";
309
+ } from "./chunk-ULOKLHIQ.js";
308
310
  import "./chunk-H5UD2323.js";
309
311
  import {
310
312
  extractUsage,
@@ -325,9 +327,8 @@ import {
325
327
  import {
326
328
  TRACE_ANALYST_ACTOR_DESCRIPTION,
327
329
  TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION,
328
- TRACE_ANALYST_SUBAGENT_DESCRIPTION,
329
330
  analyzeTraces
330
- } from "./chunk-FIUFRXP3.js";
331
+ } from "./chunk-WW2A73HW.js";
331
332
  import {
332
333
  DEFAULT_REDACTION_RULES,
333
334
  REDACTION_VERSION,
@@ -352,7 +353,7 @@ import {
352
353
  stringField,
353
354
  traceAnalystFunctionGroup,
354
355
  traceSpanKindToOpenInferenceKind
355
- } from "./chunk-6QIM2EAP.js";
356
+ } from "./chunk-PXD6ZFNY.js";
356
357
  import {
357
358
  RunIntegrityError,
358
359
  assertRunCaptured,
@@ -4338,7 +4339,7 @@ function renderSteeringText(bundle) {
4338
4339
  }
4339
4340
 
4340
4341
  // src/steering-optimizer.ts
4341
- import { AxGEPA, ai, ax } from "@ax-llm/ax";
4342
+ import { AxGEPA, AxSignature, ax } from "@ax-llm/ax";
4342
4343
  var PairwiseSteeringOptimizer = class {
4343
4344
  optimize(rows, config = {}) {
4344
4345
  const ranked = rankRows(rows, config.weights);
@@ -4370,7 +4371,8 @@ var AxGepaSteeringOptimizer = class {
4370
4371
  };
4371
4372
  }
4372
4373
  const signature = `task:string, split:string, seedPreview:string -> variantId:class "${variantIds.join(", ")}", rationale:string`;
4373
- const selector = ax(signature, {
4374
+ const selectorSignature = AxSignature.from(signature);
4375
+ const selector = ax(selectorSignature, {
4374
4376
  description: "Choose the best steering bundle variant for an autopilot task."
4375
4377
  });
4376
4378
  const shuffled = seededShuffle(byScenario, signature);
@@ -4399,15 +4401,11 @@ var AxGepaSteeringOptimizer = class {
4399
4401
  earlyStoppingTrials: 3,
4400
4402
  sampleCount: 1
4401
4403
  });
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
- );
4404
+ const metric = ({ prediction, example }) => stringField2(prediction, "variantId") === stringField2(example, "variantId") ? 1 : 0;
4405
+ const compiled = await optimizer.compile(selector, train, metric, {
4406
+ validationExamples: validation,
4407
+ maxMetricCalls: 64
4408
+ });
4411
4409
  if (compiled.optimizedProgram !== void 0) {
4412
4410
  selector.applyOptimization(compiled.optimizedProgram);
4413
4411
  }
@@ -4463,12 +4461,17 @@ function collapseScenarioWinners(rows, weights) {
4463
4461
  });
4464
4462
  }
4465
4463
  function createAxService(provider, apiKey, model) {
4466
- return ai({
4467
- name: provider,
4464
+ return createAnalystAi({
4465
+ provider,
4468
4466
  apiKey,
4469
- config: { model }
4467
+ model
4470
4468
  });
4471
4469
  }
4470
+ function stringField2(value, field) {
4471
+ if (!value || typeof value !== "object") return void 0;
4472
+ const candidate = value[field];
4473
+ return typeof candidate === "string" ? candidate : void 0;
4474
+ }
4472
4475
  function seededShuffle(items, seed) {
4473
4476
  const rng = mulberry322(hashString(seed));
4474
4477
  const out = [...items];
@@ -5972,9 +5975,9 @@ function statusAdvanced(key, progression) {
5972
5975
  description: `"${key}" progressed along ${progression.join("\u2192")}`,
5973
5976
  score: ({ before, after }) => {
5974
5977
  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;
5978
+ const ai = progression.indexOf(String(after[key]));
5979
+ if (bi === -1 || ai === -1) return 0;
5980
+ return ai >= bi ? 1 : 0;
5978
5981
  }
5979
5982
  };
5980
5983
  }
@@ -10036,12 +10039,11 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
10036
10039
  attributes: {
10037
10040
  "analyst.question_length": input.question.length,
10038
10041
  "analyst.max_turns": options.maxTurns ?? 12,
10039
- "analyst.max_depth": options.maxDepth ?? 1,
10042
+ "analyst.max_subqueries": options.maxSubqueries ?? 4,
10040
10043
  "eval.phase": "analyst"
10041
10044
  }
10042
10045
  });
10043
10046
  const originalOnTurn = options.onTurn;
10044
- const turnSpanIds = [];
10045
10047
  const wrappedOptions = {
10046
10048
  ...options,
10047
10049
  onTurn: async (turn) => {
@@ -10050,6 +10052,7 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
10050
10052
  name: `analyst:turn-${turn.turn}`,
10051
10053
  parentSpanId: parentSpan.span.spanId,
10052
10054
  attributes: {
10055
+ "analyst.stage": turn.stage,
10053
10056
  "analyst.turn": turn.turn,
10054
10057
  "analyst.is_error": turn.isError,
10055
10058
  "analyst.code_length": turn.code.length,
@@ -10057,7 +10060,6 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
10057
10060
  "eval.phase": "analyst"
10058
10061
  }
10059
10062
  });
10060
- turnSpanIds.push(turnSpan.span.spanId);
10061
10063
  if (turn.isError) {
10062
10064
  await turnSpan.fail("Turn produced an error");
10063
10065
  } else {
@@ -11664,7 +11666,6 @@ export {
11664
11666
  TOOL_NAME_ATTR_KEYS,
11665
11667
  TRACE_ANALYST_ACTOR_DESCRIPTION,
11666
11668
  TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION,
11667
- TRACE_ANALYST_SUBAGENT_DESCRIPTION,
11668
11669
  TRACE_ANALYST_TRUNCATION_MARKER_PREFIX,
11669
11670
  TRACE_SCHEMA_VERSION,
11670
11671
  TokenCounter,
@@ -11707,6 +11708,7 @@ export {
11707
11708
  assertModelsServed,
11708
11709
  assertNoHiddenLeak,
11709
11710
  assertProductBenchmarkRun,
11711
+ assertRealAgentReceipts,
11710
11712
  assertRealBackend,
11711
11713
  assertReleaseConfidence,
11712
11714
  assertRunAgentProfileCell,
@@ -12109,6 +12111,7 @@ export {
12109
12111
  stringField,
12110
12112
  stripFencedJson,
12111
12113
  subjectiveEval,
12114
+ summarizeAgentReceiptIntegrity,
12112
12115
  summarizeBackendIntegrity,
12113
12116
  summarizeHarnessResults,
12114
12117
  summarizePrReviewBenchmark,