@tangle-network/agent-eval 0.127.0 → 0.128.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 (76) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +4 -0
  3. package/dist/analyst/index.d.ts +5 -8
  4. package/dist/belief-state/index.d.ts +5 -8
  5. package/dist/benchmarks/index.js +7 -8
  6. package/dist/campaign/index.d.ts +16 -21
  7. package/dist/campaign/index.js +6 -7
  8. package/dist/{chunk-NL33OXEP.js → chunk-2JX3CFMB.js} +60 -5
  9. package/dist/chunk-2JX3CFMB.js.map +1 -0
  10. package/dist/{chunk-ZPUEEM5U.js → chunk-2MKQIFS4.js} +7 -3
  11. package/dist/chunk-2MKQIFS4.js.map +1 -0
  12. package/dist/{chunk-IN455XKS.js → chunk-7ZZMD7UK.js} +50 -2
  13. package/dist/chunk-7ZZMD7UK.js.map +1 -0
  14. package/dist/{chunk-OD5NQ2CS.js → chunk-BYT7ELPS.js} +6 -4
  15. package/dist/chunk-BYT7ELPS.js.map +1 -0
  16. package/dist/{chunk-IG35YDN3.js → chunk-DRYIUNWY.js} +11 -3
  17. package/dist/chunk-DRYIUNWY.js.map +1 -0
  18. package/dist/{chunk-X6VOPMLD.js → chunk-EOSZT7PL.js} +11 -7
  19. package/dist/chunk-EOSZT7PL.js.map +1 -0
  20. package/dist/{chunk-WED5KLZQ.js → chunk-EZJEIH2R.js} +2 -2
  21. package/dist/{chunk-UTA2TGC4.js → chunk-IHQDPH7D.js} +2 -2
  22. package/dist/{chunk-FA3MFYNA.js → chunk-NACAGYSY.js} +26 -17
  23. package/dist/chunk-NACAGYSY.js.map +1 -0
  24. package/dist/{chunk-65QETEKG.js → chunk-NKAGIDE2.js} +5 -5
  25. package/dist/{chunk-424XHVKV.js → chunk-NYLOYM6N.js} +2 -2
  26. package/dist/{chunk-CLELFRQG.js → chunk-TBL77AUT.js} +5 -7
  27. package/dist/chunk-TBL77AUT.js.map +1 -0
  28. package/dist/{chunk-PRB53E3J.js → chunk-UB2LOJ6Q.js} +6 -8
  29. package/dist/{chunk-PRB53E3J.js.map → chunk-UB2LOJ6Q.js.map} +1 -1
  30. package/dist/{chunk-IMGJZBFG.js → chunk-VLOATJQ2.js} +2 -2
  31. package/dist/{chunk-Y5CYOL42.js → chunk-XDWDC2MP.js} +43 -14
  32. package/dist/chunk-XDWDC2MP.js.map +1 -0
  33. package/dist/{chunk-ARCFIY7U.js → chunk-XPRT64IE.js} +2 -2
  34. package/dist/contract/index.d.ts +25 -22
  35. package/dist/contract/index.js +37 -18
  36. package/dist/contract/index.js.map +1 -1
  37. package/dist/control.d.ts +26 -11
  38. package/dist/control.js +2 -3
  39. package/dist/hosted/index.d.ts +13 -13
  40. package/dist/hosted/index.js +2 -1
  41. package/dist/index.d.ts +40 -27
  42. package/dist/index.js +63 -33
  43. package/dist/index.js.map +1 -1
  44. package/dist/meta-eval/index.d.ts +5 -8
  45. package/dist/openapi.json +1 -1
  46. package/dist/reporting.d.ts +8 -10
  47. package/dist/reporting.js +4 -3
  48. package/dist/rl.d.ts +25 -15
  49. package/dist/rl.js +9 -7
  50. package/dist/rl.js.map +1 -1
  51. package/dist/rollout/index.d.ts +5 -8
  52. package/dist/rollout/index.js +2 -3
  53. package/dist/{run-campaign-3A2EBYBE.js → run-campaign-ISHFZ7FJ.js} +5 -3
  54. package/dist/traces.d.ts +10 -13
  55. package/dist/traces.js +3 -4
  56. package/docs/customer-journeys.md +7 -6
  57. package/docs/insight-report.md +21 -0
  58. package/package.json +1 -1
  59. package/dist/chunk-CLELFRQG.js.map +0 -1
  60. package/dist/chunk-FA3MFYNA.js.map +0 -1
  61. package/dist/chunk-IG35YDN3.js.map +0 -1
  62. package/dist/chunk-IN455XKS.js.map +0 -1
  63. package/dist/chunk-NL33OXEP.js.map +0 -1
  64. package/dist/chunk-OD5NQ2CS.js.map +0 -1
  65. package/dist/chunk-VSMTAMNK.js +0 -53
  66. package/dist/chunk-VSMTAMNK.js.map +0 -1
  67. package/dist/chunk-X6VOPMLD.js.map +0 -1
  68. package/dist/chunk-Y5CYOL42.js.map +0 -1
  69. package/dist/chunk-ZPUEEM5U.js.map +0 -1
  70. /package/dist/{chunk-WED5KLZQ.js.map → chunk-EZJEIH2R.js.map} +0 -0
  71. /package/dist/{chunk-UTA2TGC4.js.map → chunk-IHQDPH7D.js.map} +0 -0
  72. /package/dist/{chunk-65QETEKG.js.map → chunk-NKAGIDE2.js.map} +0 -0
  73. /package/dist/{chunk-424XHVKV.js.map → chunk-NYLOYM6N.js.map} +0 -0
  74. /package/dist/{chunk-IMGJZBFG.js.map → chunk-VLOATJQ2.js.map} +0 -0
  75. /package/dist/{chunk-ARCFIY7U.js.map → chunk-XPRT64IE.js.map} +0 -0
  76. /package/dist/{run-campaign-3A2EBYBE.js.map → run-campaign-ISHFZ7FJ.js.map} +0 -0
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  checkBehavioralCanary,
10
10
  checkCanaries,
11
11
  runBehavioralCanaries
12
- } from "./chunk-FA3MFYNA.js";
12
+ } from "./chunk-NACAGYSY.js";
13
13
  import {
14
14
  mintRolloutRows,
15
15
  rolloutReward
16
- } from "./chunk-UTA2TGC4.js";
16
+ } from "./chunk-IHQDPH7D.js";
17
17
  import {
18
18
  SUPERVISOR_RUN_SCHEMA,
19
19
  analyzeSupervisorRun,
@@ -45,7 +45,7 @@ import {
45
45
  BENCHMARK_SPLIT_SEED,
46
46
  benchmarks_exports,
47
47
  deterministicSplit
48
- } from "./chunk-ARCFIY7U.js";
48
+ } from "./chunk-XPRT64IE.js";
49
49
  import {
50
50
  DEFAULT_RULES,
51
51
  classifyFailure,
@@ -84,7 +84,7 @@ import {
84
84
  harnessAxisOf,
85
85
  parseCorrectnessResponse,
86
86
  verifyCompletion
87
- } from "./chunk-PRB53E3J.js";
87
+ } from "./chunk-UB2LOJ6Q.js";
88
88
  import {
89
89
  DEFAULT_MUTATION_PRIMITIVES,
90
90
  DEFAULT_RED_TEAM_CORPUS,
@@ -118,7 +118,7 @@ import {
118
118
  scoreRedTeamOutput,
119
119
  surfaceContentHash,
120
120
  toolNamesForRun
121
- } from "./chunk-65QETEKG.js";
121
+ } from "./chunk-NKAGIDE2.js";
122
122
  import {
123
123
  BackendIntegrityError,
124
124
  assertRealAgentReceipts,
@@ -130,7 +130,7 @@ import {
130
130
  inMemoryVerdictCache,
131
131
  summarizeAgentReceiptIntegrity,
132
132
  summarizeBackendIntegrity
133
- } from "./chunk-WED5KLZQ.js";
133
+ } from "./chunk-EZJEIH2R.js";
134
134
  import {
135
135
  DEFAULT_COMPLEXITY_WEIGHTS,
136
136
  FindingsStore,
@@ -189,19 +189,19 @@ import {
189
189
  stopOnNoProgress,
190
190
  stopOnRepeatedAction,
191
191
  subjectiveEval
192
- } from "./chunk-OD5NQ2CS.js";
192
+ } from "./chunk-BYT7ELPS.js";
193
193
  import {
194
194
  assertReleaseConfidence,
195
195
  bootstrapCi,
196
196
  evaluateReleaseConfidence,
197
197
  judgeReplayGate,
198
198
  renderReleaseReport
199
- } from "./chunk-Y5CYOL42.js";
199
+ } from "./chunk-XDWDC2MP.js";
200
200
  import {
201
201
  runEvalCampaign
202
- } from "./chunk-CLELFRQG.js";
203
- import "./chunk-424XHVKV.js";
204
- import "./chunk-ZPUEEM5U.js";
202
+ } from "./chunk-TBL77AUT.js";
203
+ import "./chunk-NYLOYM6N.js";
204
+ import "./chunk-2MKQIFS4.js";
205
205
  import {
206
206
  LlmCallError,
207
207
  LlmClient,
@@ -228,7 +228,7 @@ import {
228
228
  paretoChart,
229
229
  researchReport,
230
230
  summaryTable
231
- } from "./chunk-IMGJZBFG.js";
231
+ } from "./chunk-VLOATJQ2.js";
232
232
  import {
233
233
  comparePairedArms,
234
234
  pairArms,
@@ -326,8 +326,8 @@ import {
326
326
  scoreTraceInsightReadiness,
327
327
  tokenizeDomainWords,
328
328
  traceAnalystOnRunComplete
329
- } from "./chunk-X6VOPMLD.js";
330
- import "./chunk-IN455XKS.js";
329
+ } from "./chunk-EOSZT7PL.js";
330
+ import "./chunk-7ZZMD7UK.js";
331
331
  import {
332
332
  extractUsage,
333
333
  extractUsageFromResponse,
@@ -401,18 +401,23 @@ import {
401
401
  assertRunAgentProfileCell,
402
402
  buildAgentInterfaceProfileCell,
403
403
  buildAgentProfileCell,
404
+ canonicalize,
405
+ evaluateHypothesis,
404
406
  groupRunsByAgentProfileCell,
407
+ hashJson,
405
408
  isRunRecord,
406
409
  modelHasSnapshot,
407
410
  parseRunRecordSafe,
408
411
  requireAgentProfileCell,
409
412
  roundTripRunRecord,
410
413
  runTaskScore,
414
+ signManifest,
411
415
  toAgentProfileJson,
412
416
  validateAgentProfileCell,
413
417
  validateRunRecord,
414
- verifyAgentProfileCell
415
- } from "./chunk-NL33OXEP.js";
418
+ verifyAgentProfileCell,
419
+ verifyManifest
420
+ } from "./chunk-2JX3CFMB.js";
416
421
  import {
417
422
  FAILURE_CLASSES,
418
423
  TRACE_SCHEMA_VERSION,
@@ -422,13 +427,6 @@ import {
422
427
  isSandboxSpan,
423
428
  isToolSpan
424
429
  } from "./chunk-MA6HLL3S.js";
425
- import {
426
- canonicalize,
427
- evaluateHypothesis,
428
- hashJson,
429
- signManifest,
430
- verifyManifest
431
- } from "./chunk-VSMTAMNK.js";
432
430
  import {
433
431
  AgentEvalError,
434
432
  CaptureIntegrityError,
@@ -10648,17 +10646,28 @@ function rawPassOf(record) {
10648
10646
  }
10649
10647
  function passOf(record, score, threshold) {
10650
10648
  const rawPass = rawPassOf(record);
10651
- if (rawPass !== null) return rawPass && !record.failureMode;
10652
- return score >= threshold && !record.failureMode;
10649
+ const hasTaskFailure = record.failureClass !== void 0 && record.failureClass !== "success";
10650
+ if (rawPass !== null) return rawPass && !hasTaskFailure;
10651
+ return score >= threshold && !hasTaskFailure;
10653
10652
  }
10654
- function failureModeOf(record, score, threshold) {
10655
- if (record.failureMode) return record.failureMode;
10653
+ function failureOf(record, score, threshold) {
10654
+ if (record.failureClass !== void 0 && record.failureClass !== "success") {
10655
+ return {
10656
+ failureClass: record.failureClass,
10657
+ failureDetail: record.failureMode ?? null
10658
+ };
10659
+ }
10656
10660
  const belowThreshold = `quality-below-threshold: ${Math.round(score * 100)}% < ${Math.round(threshold * 100)}%`;
10657
10661
  if (rawPassOf(record) === false) {
10658
- return score < threshold ? belowThreshold : "product-pass-failed";
10662
+ return {
10663
+ failureClass: "unknown",
10664
+ failureDetail: score < threshold ? belowThreshold : "product-pass-failed"
10665
+ };
10666
+ }
10667
+ if (passOf(record, score, threshold)) {
10668
+ return { failureClass: null, failureDetail: null };
10659
10669
  }
10660
- if (passOf(record, score, threshold)) return null;
10661
- return belowThreshold;
10670
+ return { failureClass: "unknown", failureDetail: belowThreshold };
10662
10671
  }
10663
10672
  function numericDimensions(record) {
10664
10673
  const dimensions = {};
@@ -10775,6 +10784,7 @@ function runRecordToProductBenchmarkRecord(record, runDir, artifactRoot, artifac
10775
10784
  const opts = resolveOptions(options);
10776
10785
  const runtime = runtimeResolution(record, opts);
10777
10786
  const score = scoreOf(record);
10787
+ const failure = failureOf(record, score, opts.passThreshold);
10778
10788
  const armId = armIdOf(record);
10779
10789
  const inputTokens = record.tokenUsage.input;
10780
10790
  const outputTokens = record.tokenUsage.output;
@@ -10809,7 +10819,7 @@ function runRecordToProductBenchmarkRecord(record, runDir, artifactRoot, artifac
10809
10819
  pass: passOf(record, score, opts.passThreshold),
10810
10820
  score,
10811
10821
  dimensions,
10812
- failureMode: failureModeOf(record, score, opts.passThreshold)
10822
+ ...failure
10813
10823
  },
10814
10824
  usage: {
10815
10825
  inputTokens,
@@ -11024,6 +11034,13 @@ function expectString(value, path) {
11024
11034
  fail(path, "must be a non-empty string");
11025
11035
  return value;
11026
11036
  }
11037
+ function expectFailureClass(value, path) {
11038
+ const parsed = expectString(value, path);
11039
+ if (parsed === "success" || !FAILURE_CLASSES.includes(parsed)) {
11040
+ fail(path, `expected a non-success FailureClass, received ${JSON.stringify(parsed)}`);
11041
+ }
11042
+ return parsed;
11043
+ }
11027
11044
  function expectBoolean(value, path) {
11028
11045
  if (typeof value !== "boolean") fail(path, "must be a boolean");
11029
11046
  return value;
@@ -11166,6 +11183,18 @@ function validateProductBenchmarkRecord(value) {
11166
11183
  const usage = expectObject(obj.usage, "record.usage");
11167
11184
  const integrity = expectObject(obj.integrity, "record.integrity");
11168
11185
  const artifacts = expectObject(obj.artifacts, "record.artifacts");
11186
+ const outcomePass = expectBoolean(outcome.pass, "record.outcome.pass");
11187
+ const failureClass = outcome.failureClass === null ? null : expectFailureClass(outcome.failureClass, "record.outcome.failureClass");
11188
+ const failureDetail = outcome.failureDetail === null ? null : expectString(outcome.failureDetail, "record.outcome.failureDetail");
11189
+ if (outcomePass && (failureClass !== null || failureDetail !== null)) {
11190
+ fail("record.outcome", "a passing row cannot carry failure evidence");
11191
+ }
11192
+ if (!outcomePass && failureClass === null) {
11193
+ fail("record.outcome.failureClass", "a failed row requires a failure class");
11194
+ }
11195
+ if (failureClass === null && failureDetail !== null) {
11196
+ fail("record.outcome.failureDetail", "failure detail requires a failure class");
11197
+ }
11169
11198
  const record = {
11170
11199
  schemaVersion: 1,
11171
11200
  projectId: expectString(obj.projectId, "record.projectId"),
@@ -11191,10 +11220,11 @@ function validateProductBenchmarkRecord(value) {
11191
11220
  version: expectString(backend.version, "record.backend.version")
11192
11221
  },
11193
11222
  outcome: {
11194
- pass: expectBoolean(outcome.pass, "record.outcome.pass"),
11223
+ pass: outcomePass,
11195
11224
  score: expectNumber(outcome.score, "record.outcome.score", { min: 0, max: 1 }),
11196
11225
  dimensions: expectDimensions(outcome.dimensions, "record.outcome.dimensions"),
11197
- failureMode: outcome.failureMode === null ? null : expectString(outcome.failureMode, "record.outcome.failureMode")
11226
+ failureClass,
11227
+ failureDetail
11198
11228
  },
11199
11229
  usage: {
11200
11230
  inputTokens: expectNumber(usage.inputTokens, "record.usage.inputTokens", {