@tangle-network/agent-eval 0.123.7 → 0.124.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 (63) hide show
  1. package/CHANGELOG.md +23 -4
  2. package/dist/analyst/index.d.ts +7 -0
  3. package/dist/analyst/index.js +4 -4
  4. package/dist/benchmarks/index.d.ts +2 -0
  5. package/dist/benchmarks/index.js +4 -4
  6. package/dist/campaign/index.d.ts +13 -0
  7. package/dist/campaign/index.js +4 -4
  8. package/dist/chunk-4Y7AAATF.js +1151 -0
  9. package/dist/chunk-4Y7AAATF.js.map +1 -0
  10. package/dist/{chunk-VPDOSN3L.js → chunk-5PVZVCZB.js} +7 -5
  11. package/dist/chunk-5PVZVCZB.js.map +1 -0
  12. package/dist/{chunk-WP3GEXKI.js → chunk-A6GT67HT.js} +3 -3
  13. package/dist/{chunk-MHPEGJHC.js → chunk-DT7OXY3C.js} +2 -2
  14. package/dist/{chunk-MK3Q6GCL.js → chunk-EQUK3RFS.js} +14 -5
  15. package/dist/chunk-EQUK3RFS.js.map +1 -0
  16. package/dist/{chunk-N7ZS6PEF.js → chunk-GID26AN4.js} +2 -2
  17. package/dist/{chunk-4KO6D2BO.js → chunk-HM6V7F3M.js} +2 -2
  18. package/dist/chunk-IPYXE555.js +594 -0
  19. package/dist/chunk-IPYXE555.js.map +1 -0
  20. package/dist/chunk-MAX3TN3C.js +249 -0
  21. package/dist/chunk-MAX3TN3C.js.map +1 -0
  22. package/dist/chunk-MGGFVCJ7.js +288 -0
  23. package/dist/chunk-MGGFVCJ7.js.map +1 -0
  24. package/dist/{chunk-KKPPFIDS.js → chunk-PMITBABE.js} +7 -5
  25. package/dist/{chunk-KKPPFIDS.js.map → chunk-PMITBABE.js.map} +1 -1
  26. package/dist/{chunk-J3LHTAAB.js → chunk-QOTFXW5L.js} +1 -47
  27. package/dist/chunk-QOTFXW5L.js.map +1 -0
  28. package/dist/chunk-R7ZRE2KV.js +138 -0
  29. package/dist/chunk-R7ZRE2KV.js.map +1 -0
  30. package/dist/chunk-RZTMDUO7.js +49 -0
  31. package/dist/chunk-RZTMDUO7.js.map +1 -0
  32. package/dist/{chunk-QNVBALEX.js → chunk-W5B3ZGP3.js} +3 -3
  33. package/dist/cli.js +13 -2
  34. package/dist/cli.js.map +1 -1
  35. package/dist/contract/index.d.ts +9 -0
  36. package/dist/contract/index.js +4 -4
  37. package/dist/index.d.ts +701 -82
  38. package/dist/index.js +57 -121
  39. package/dist/index.js.map +1 -1
  40. package/dist/multishot/index.d.ts +2 -0
  41. package/dist/openapi.json +1 -1
  42. package/dist/pipelines/index.js +4 -2
  43. package/dist/pipelines/index.js.map +1 -1
  44. package/dist/rl.d.ts +5 -0
  45. package/dist/rl.js +2 -2
  46. package/dist/rollout/index.d.ts +1053 -0
  47. package/dist/rollout/index.js +109 -0
  48. package/dist/rollout/index.js.map +1 -0
  49. package/dist/supervisor-run/index.d.ts +705 -0
  50. package/dist/supervisor-run/index.js +52 -0
  51. package/dist/supervisor-run/index.js.map +1 -0
  52. package/dist/wire/index.d.ts +3 -0
  53. package/dist/wire/index.js +2 -2
  54. package/docs/rollout.md +48 -0
  55. package/package.json +11 -1
  56. package/dist/chunk-J3LHTAAB.js.map +0 -1
  57. package/dist/chunk-MK3Q6GCL.js.map +0 -1
  58. package/dist/chunk-VPDOSN3L.js.map +0 -1
  59. /package/dist/{chunk-WP3GEXKI.js.map → chunk-A6GT67HT.js.map} +0 -0
  60. /package/dist/{chunk-MHPEGJHC.js.map → chunk-DT7OXY3C.js.map} +0 -0
  61. /package/dist/{chunk-N7ZS6PEF.js.map → chunk-GID26AN4.js.map} +0 -0
  62. /package/dist/{chunk-4KO6D2BO.js.map → chunk-HM6V7F3M.js.map} +0 -0
  63. /package/dist/{chunk-QNVBALEX.js.map → chunk-W5B3ZGP3.js.map} +0 -0
package/dist/index.js CHANGED
@@ -10,6 +10,36 @@ import {
10
10
  checkCanaries,
11
11
  runBehavioralCanaries
12
12
  } from "./chunk-SJT4OBVL.js";
13
+ import {
14
+ mintRolloutRows,
15
+ rolloutReward
16
+ } from "./chunk-MGGFVCJ7.js";
17
+ import {
18
+ SUPERVISOR_RUN_SCHEMA,
19
+ analyzeSupervisorRun,
20
+ analyzeSupervisorRunSources,
21
+ isUnavailable,
22
+ renderSupervisorRunHeadline,
23
+ renderSupervisorRunMarkdown,
24
+ rollupSupervisorRuns,
25
+ showMeasured,
26
+ supervisorRunRolloutLines,
27
+ writeSupervisorRunReport
28
+ } from "./chunk-4Y7AAATF.js";
29
+ import "./chunk-R7ZRE2KV.js";
30
+ import {
31
+ toJsonl,
32
+ toRewardRows,
33
+ toSftRows
34
+ } from "./chunk-IPYXE555.js";
35
+ import {
36
+ ROLLOUT_FORMAT,
37
+ ROLLOUT_SCHEMA,
38
+ assertRolloutLine,
39
+ isRolloutLine,
40
+ isTrainableSplit,
41
+ validateRolloutLine
42
+ } from "./chunk-MAX3TN3C.js";
13
43
  import {
14
44
  BENCHMARK_SPLIT_SEED,
15
45
  benchmarks_exports,
@@ -17,13 +47,15 @@ import {
17
47
  } from "./chunk-JKDNAOF5.js";
18
48
  import {
19
49
  DEFAULT_RULES,
20
- buildTrajectory,
21
50
  classifyFailure,
22
51
  compareToBaseline,
23
52
  computeToolUseMetrics,
24
53
  iqr,
25
54
  welchsTTest
26
- } from "./chunk-J3LHTAAB.js";
55
+ } from "./chunk-QOTFXW5L.js";
56
+ import {
57
+ buildTrajectory
58
+ } from "./chunk-RZTMDUO7.js";
27
59
  import {
28
60
  analyzeSeries
29
61
  } from "./chunk-BOD4O7OF.js";
@@ -53,7 +85,7 @@ import {
53
85
  pairArms,
54
86
  parseCorrectnessResponse,
55
87
  verifyCompletion
56
- } from "./chunk-VPDOSN3L.js";
88
+ } from "./chunk-5PVZVCZB.js";
57
89
  import {
58
90
  DEFAULT_MUTATION_PRIMITIVES,
59
91
  DEFAULT_RED_TEAM_CORPUS,
@@ -91,7 +123,7 @@ import {
91
123
  scoreRedTeamOutput,
92
124
  surfaceContentHash,
93
125
  toolNamesForRun
94
- } from "./chunk-KKPPFIDS.js";
126
+ } from "./chunk-PMITBABE.js";
95
127
  import {
96
128
  BackendIntegrityError,
97
129
  assertRealAgentReceipts,
@@ -116,12 +148,12 @@ import {
116
148
  defaultIsMaterial,
117
149
  diffFindings,
118
150
  runSemanticConceptJudge
119
- } from "./chunk-QNVBALEX.js";
151
+ } from "./chunk-W5B3ZGP3.js";
120
152
  import {
121
153
  buildDefaultAnalystRegistry,
122
154
  computeTraceMetrics,
123
155
  createChatClient
124
- } from "./chunk-WP3GEXKI.js";
156
+ } from "./chunk-A6GT67HT.js";
125
157
  import "./chunk-HHWE3POT.js";
126
158
  import {
127
159
  AnalystRegistry,
@@ -156,7 +188,7 @@ import {
156
188
  scorePolicyEditReadiness,
157
189
  validatePolicyEdit,
158
190
  validatePolicyEditCandidateRecord
159
- } from "./chunk-MHPEGJHC.js";
191
+ } from "./chunk-DT7OXY3C.js";
160
192
  import {
161
193
  allCriticalPassed,
162
194
  controlFailureClassFromVerification,
@@ -187,7 +219,7 @@ import {
187
219
  } from "./chunk-MOXWMGPC.js";
188
220
  import {
189
221
  runEvalCampaign
190
- } from "./chunk-N7ZS6PEF.js";
222
+ } from "./chunk-GID26AN4.js";
191
223
  import "./chunk-ARU2PZFM.js";
192
224
  import {
193
225
  LlmCallError,
@@ -204,7 +236,7 @@ import {
204
236
  maximumChargeForLlmRequest,
205
237
  probeLlm,
206
238
  stripFencedJson
207
- } from "./chunk-MK3Q6GCL.js";
239
+ } from "./chunk-EQUK3RFS.js";
208
240
  import {
209
241
  evaluateInterimReleaseConfidence,
210
242
  pairedEvalueSequence
@@ -3204,117 +3236,6 @@ function printDriverSummary(results) {
3204
3236
  console.log(`${completedCount}/${results.length} personas completed`);
3205
3237
  }
3206
3238
 
3207
- // src/rollout-export.ts
3208
- var ROLLOUT_FORMAT = "tangle.rollout.v1";
3209
- var asText = (v, scrub) => {
3210
- const s = typeof v === "string" ? v : JSON.stringify(v);
3211
- return scrub(s ?? "");
3212
- };
3213
- function projectStep(span, scrub) {
3214
- const base = {
3215
- kind: span.kind,
3216
- name: scrub(span.name),
3217
- status: span.status,
3218
- durationMs: span.endedAt !== void 0 ? span.endedAt - span.startedAt : void 0
3219
- };
3220
- if (span.kind === "llm") {
3221
- const llm = span;
3222
- const last = llm.messages[llm.messages.length - 1];
3223
- if (last) base.input = scrub(last.content);
3224
- if (llm.output !== void 0) base.output = scrub(llm.output);
3225
- } else if (span.kind === "tool") {
3226
- const tool = span;
3227
- base.input = asText(tool.args, scrub);
3228
- if (tool.result !== void 0) base.output = asText(tool.result, scrub);
3229
- }
3230
- return base;
3231
- }
3232
- function scrubMessages(messages, scrub) {
3233
- return messages.map((m) => ({ ...m, content: scrub(m.content) }));
3234
- }
3235
- function finalConversation(spans, scrub) {
3236
- const llms = spans.filter((s) => s.kind === "llm");
3237
- const last = llms[llms.length - 1];
3238
- if (!last) return [];
3239
- const messages = scrubMessages(last.messages, scrub);
3240
- if (last.output !== void 0 && last.output !== "") {
3241
- messages.push({ role: "assistant", content: scrub(last.output) });
3242
- }
3243
- return messages;
3244
- }
3245
- function rolloutReward(record) {
3246
- const gated = record.outcome.realness?.gated === true;
3247
- const raw = record.outcome.holdoutScore ?? record.outcome.searchScore ?? 0;
3248
- return { reward: gated ? 0 : raw, gated };
3249
- }
3250
- async function mintRolloutRows(records, store, options = {}) {
3251
- const scrub = options.scrub ?? ((t) => t);
3252
- const rows = [];
3253
- const missingTraces = [];
3254
- for (const record of records) {
3255
- const trajectory = await buildTrajectory(store, record.runId);
3256
- if (trajectory.steps.length === 0) {
3257
- missingTraces.push(record.runId);
3258
- continue;
3259
- }
3260
- let steps = trajectory.steps.map((s) => projectStep(s.span, scrub));
3261
- if (options.maxSteps !== void 0 && steps.length > options.maxSteps) {
3262
- const head = Math.ceil(options.maxSteps / 2);
3263
- const tail = options.maxSteps - head;
3264
- steps = [...steps.slice(0, head), ...steps.slice(steps.length - tail)];
3265
- }
3266
- const { reward, gated } = rolloutReward(record);
3267
- rows.push({
3268
- format: ROLLOUT_FORMAT,
3269
- runId: record.runId,
3270
- experimentId: record.experimentId,
3271
- candidateId: record.candidateId,
3272
- scenarioId: record.scenarioId,
3273
- splitTag: record.splitTag,
3274
- model: record.model,
3275
- agentProfileCellId: record.agentProfile?.cellId,
3276
- reward,
3277
- realnessGated: gated,
3278
- costUsd: record.costUsd,
3279
- totalTokens: record.tokenUsage.input + record.tokenUsage.output,
3280
- steps,
3281
- conversation: finalConversation(
3282
- trajectory.steps.map((s) => s.span),
3283
- scrub
3284
- )
3285
- });
3286
- }
3287
- return { rows, missingTraces };
3288
- }
3289
- function toSftRows(rows, options = {}) {
3290
- const minReward = options.minReward ?? 1;
3291
- return rows.filter((r) => r.reward >= minReward && !r.realnessGated && r.conversation.length > 0).map((r) => ({
3292
- messages: r.conversation,
3293
- metadata: {
3294
- runId: r.runId,
3295
- candidateId: r.candidateId,
3296
- scenarioId: r.scenarioId,
3297
- reward: r.reward
3298
- }
3299
- }));
3300
- }
3301
- function toRewardRows(rows) {
3302
- return rows.map((r) => ({
3303
- prompt: r.conversation.find((m) => m.role === "user")?.content ?? "",
3304
- steps: r.steps,
3305
- reward: r.reward,
3306
- metadata: {
3307
- runId: r.runId,
3308
- candidateId: r.candidateId,
3309
- scenarioId: r.scenarioId,
3310
- splitTag: r.splitTag
3311
- }
3312
- }));
3313
- }
3314
- function toJsonl(rows) {
3315
- return rows.map((r) => JSON.stringify(r)).join("\n") + (rows.length ? "\n" : "");
3316
- }
3317
-
3318
3239
  // src/treatment-gate.ts
3319
3240
  function gateTreatmentApplied(input, opts = {}) {
3320
3241
  const failOpen = opts.failOpenWhenNoTelemetry ?? true;
@@ -11757,6 +11678,7 @@ export {
11757
11678
  REFERENCE_EQUIVALENCE_JUDGE_VERSION,
11758
11679
  RESEARCH_REPORT_HARD_PAIR_FLOOR,
11759
11680
  ROLLOUT_FORMAT,
11681
+ ROLLOUT_SCHEMA,
11760
11682
  RUN_COST_ATTR_KEYS,
11761
11683
  ReplayCache,
11762
11684
  ReplayCacheMissError,
@@ -11767,6 +11689,7 @@ export {
11767
11689
  SEMANTIC_CONCEPT_JUDGE_VERSION,
11768
11690
  SKILL_USAGE_ANALYST,
11769
11691
  SPAN_KIND_ATTR_KEYS,
11692
+ SUPERVISOR_RUN_SCHEMA,
11770
11693
  SandboxHarness,
11771
11694
  ScenarioRegistry,
11772
11695
  SeatUnsetError,
@@ -11808,6 +11731,8 @@ export {
11808
11731
  allCriticalPassed,
11809
11732
  analyzeAntiSlop,
11810
11733
  analyzeSeries,
11734
+ analyzeSupervisorRun,
11735
+ analyzeSupervisorRunSources,
11811
11736
  analyzeTraces,
11812
11737
  appendScorecard,
11813
11738
  applyLlmSpanOtlpAttributes,
@@ -11825,6 +11750,7 @@ export {
11825
11750
  assertRealAgentReceipts,
11826
11751
  assertRealBackend,
11827
11752
  assertReleaseConfidence,
11753
+ assertRolloutLine,
11828
11754
  assertRunAgentProfileCell,
11829
11755
  assertRunCaptured,
11830
11756
  assertSingleBackend,
@@ -12041,10 +11967,13 @@ export {
12041
11967
  isOtelConfigured,
12042
11968
  isPolicyEdit,
12043
11969
  isRetrievalSpan,
11970
+ isRolloutLine,
12044
11971
  isRunRecord,
12045
11972
  isSandboxSpan,
12046
11973
  isToolSpan,
11974
+ isTrainableSplit,
12047
11975
  isTransientLlmError,
11976
+ isUnavailable,
12048
11977
  iterateRawCalls,
12049
11978
  jestTestParser,
12050
11979
  jsonHasKeys,
@@ -12160,6 +12089,8 @@ export {
12160
12089
  renderPriorFindings,
12161
12090
  renderReleaseReport,
12162
12091
  renderSteeringText,
12092
+ renderSupervisorRunHeadline,
12093
+ renderSupervisorRunMarkdown,
12163
12094
  renderUpstreamFindings,
12164
12095
  repeatedActionDetector,
12165
12096
  replayFeedbackTrajectories,
@@ -12173,6 +12104,7 @@ export {
12173
12104
  resolveRunCostProvenance,
12174
12105
  resolveSeat,
12175
12106
  rolloutReward,
12107
+ rollupSupervisorRuns,
12176
12108
  roundTripRunRecord,
12177
12109
  routeFields,
12178
12110
  rowCount,
@@ -12220,6 +12152,7 @@ export {
12220
12152
  selfPreference,
12221
12153
  sentenceReorderMutator,
12222
12154
  serializeFeedbackTrajectoriesJsonl,
12155
+ showMeasured,
12223
12156
  signManifest,
12224
12157
  spearmanR,
12225
12158
  splitGold,
@@ -12235,6 +12168,7 @@ export {
12235
12168
  summarizePrReviewBenchmark,
12236
12169
  summarizePreferenceMemory,
12237
12170
  summaryTable,
12171
+ supervisorRunRolloutLines,
12238
12172
  testJudge,
12239
12173
  textInSnapshot,
12240
12174
  throwIfRunIncomplete,
@@ -12264,6 +12198,7 @@ export {
12264
12198
  validateProductBenchmarkManifest,
12265
12199
  validateProductBenchmarkRecord,
12266
12200
  validateProductBenchmarkRun,
12201
+ validateRolloutLine,
12267
12202
  validateRunRecord,
12268
12203
  verbosityBias,
12269
12204
  verifyAgentProfileCell,
@@ -12284,6 +12219,7 @@ export {
12284
12219
  withHeldoutBlend,
12285
12220
  withJudgeRetry,
12286
12221
  withOtelPipeline,
12287
- wranglerDeployRunner
12222
+ wranglerDeployRunner,
12223
+ writeSupervisorRunReport
12288
12224
  };
12289
12225
  //# sourceMappingURL=index.js.map