@tangle-network/agent-eval 0.122.2 → 0.122.4

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 (34) hide show
  1. package/dist/analyst/index.js +3 -4
  2. package/dist/analyst/index.js.map +1 -1
  3. package/dist/benchmarks/index.js +5 -6
  4. package/dist/campaign/index.d.ts +273 -252
  5. package/dist/campaign/index.js +8 -5
  6. package/dist/{chunk-N3QPYIVG.js → chunk-4R4GTZBZ.js} +10 -10
  7. package/dist/{chunk-EXMKNOP5.js → chunk-75OCWDXJ.js} +137 -43
  8. package/dist/chunk-75OCWDXJ.js.map +1 -0
  9. package/dist/{chunk-BD2OK6ZW.js → chunk-7GLJX32M.js} +2 -2
  10. package/dist/{chunk-5CVUPHJ4.js → chunk-EAWKAVID.js} +74 -1
  11. package/dist/chunk-EAWKAVID.js.map +1 -0
  12. package/dist/{chunk-OZFTLMGS.js → chunk-GTSVLG2M.js} +2 -2
  13. package/dist/{chunk-U4R2AGY5.js → chunk-MWN2X7C5.js} +42 -32
  14. package/dist/{chunk-U4R2AGY5.js.map → chunk-MWN2X7C5.js.map} +1 -1
  15. package/dist/{chunk-5BYTIDZ7.js → chunk-SFXDMFGV.js} +2 -2
  16. package/dist/{chunk-XKSDSGSC.js → chunk-ULW7AATT.js} +3 -5
  17. package/dist/{chunk-XKSDSGSC.js.map → chunk-ULW7AATT.js.map} +1 -1
  18. package/dist/contract/index.d.ts +3 -0
  19. package/dist/contract/index.js +5 -5
  20. package/dist/index.d.ts +36 -30
  21. package/dist/index.js +11 -11
  22. package/dist/index.js.map +1 -1
  23. package/dist/openapi.json +1 -1
  24. package/dist/{run-campaign-2YJ3Z6JS.js → run-campaign-J6RHX2VO.js} +2 -2
  25. package/package.json +1 -1
  26. package/dist/chunk-3YYRZDON.js +0 -45
  27. package/dist/chunk-3YYRZDON.js.map +0 -1
  28. package/dist/chunk-5CVUPHJ4.js.map +0 -1
  29. package/dist/chunk-EXMKNOP5.js.map +0 -1
  30. /package/dist/{chunk-N3QPYIVG.js.map → chunk-4R4GTZBZ.js.map} +0 -0
  31. /package/dist/{chunk-BD2OK6ZW.js.map → chunk-7GLJX32M.js.map} +0 -0
  32. /package/dist/{chunk-OZFTLMGS.js.map → chunk-GTSVLG2M.js.map} +0 -0
  33. /package/dist/{chunk-5BYTIDZ7.js.map → chunk-SFXDMFGV.js.map} +0 -0
  34. /package/dist/{run-campaign-2YJ3Z6JS.js.map → run-campaign-J6RHX2VO.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fsCampaignStorage,
3
3
  runCampaign
4
- } from "./chunk-N3QPYIVG.js";
4
+ } from "./chunk-4R4GTZBZ.js";
5
5
  import {
6
6
  __export
7
7
  } from "./chunk-PZ5AY32C.js";
@@ -763,4 +763,4 @@ export {
763
763
  retrievalMetricsAtCutoff,
764
764
  benchmarks_exports
765
765
  };
766
- //# sourceMappingURL=chunk-OZFTLMGS.js.map
766
+ //# sourceMappingURL=chunk-GTSVLG2M.js.map
@@ -10,11 +10,12 @@ import {
10
10
  resolveRunDir,
11
11
  runCampaign,
12
12
  summarizeAgentReceiptIntegrity
13
- } from "./chunk-N3QPYIVG.js";
13
+ } from "./chunk-4R4GTZBZ.js";
14
14
  import {
15
15
  clamp01,
16
+ mapConcurrent,
16
17
  validatePolicyEditCandidateRecord
17
- } from "./chunk-5CVUPHJ4.js";
18
+ } from "./chunk-EAWKAVID.js";
18
19
  import {
19
20
  detectRewardHacking
20
21
  } from "./chunk-ARU2PZFM.js";
@@ -2647,9 +2648,13 @@ function campaignBreakdown(campaign) {
2647
2648
  // src/campaign/presets/run-optimization.ts
2648
2649
  async function runOptimization(opts) {
2649
2650
  const { proposer } = opts;
2651
+ const candidateConcurrency = opts.candidateConcurrency ?? 1;
2650
2652
  if (typeof opts.runDir !== "string" || opts.runDir.trim().length === 0) {
2651
2653
  throw new Error("runOptimization: runDir is required and must be a non-empty string");
2652
2654
  }
2655
+ if (!Number.isInteger(candidateConcurrency) || candidateConcurrency < 1) {
2656
+ throw new Error("runOptimization: candidateConcurrency must be a positive integer");
2657
+ }
2653
2658
  opts.runDir = resolveRunDir(opts.runDir, opts.repo);
2654
2659
  const storage = opts.storage ?? fsCampaignStorage();
2655
2660
  const costLedger = opts.costLedger ?? createRunCostLedger({
@@ -2749,34 +2754,39 @@ async function runOptimization(opts) {
2749
2754
  const candidates = proposed.map(
2750
2755
  (p) => isProposedCandidate(p) ? p : { surface: p, label: "", rationale: "" }
2751
2756
  );
2752
- const surfaceResults = [];
2753
- for (let i = 0; i < candidates.length; i++) {
2754
- const { surface, label, rationale, candidateRecord } = candidates[i];
2755
- const hash = surfaceHash(surface);
2756
- const campaign = await runCampaign({
2757
- ...opts,
2758
- costLedger,
2759
- costPhase: "search.candidate",
2760
- dispatch: (scenario, ctx) => opts.dispatchWithSurface(surface, scenario, ctx),
2761
- runDir: `${opts.runDir}/gen-${gen}/candidate-${i}`
2762
- });
2763
- const composite = campaignMeanComposite(campaign);
2764
- const coverage = campaignCoverage(
2765
- campaign.cells,
2766
- opts.scenarios,
2767
- opts.reps ?? 1,
2768
- requireJudgeScore
2769
- );
2770
- surfaceResults.push({
2771
- surfaceHash: hash,
2772
- surface,
2773
- label,
2774
- rationale,
2775
- ...candidateRecord ? { candidateRecord } : {},
2776
- campaign,
2777
- composite,
2778
- coverage
2779
- });
2757
+ const surfaceResults = await mapConcurrent(
2758
+ candidates,
2759
+ candidateConcurrency,
2760
+ async ({ surface, label, rationale, candidateRecord }, i) => {
2761
+ const hash = surfaceHash(surface);
2762
+ const campaign = await runCampaign({
2763
+ ...opts,
2764
+ costLedger,
2765
+ costPhase: "search.candidate",
2766
+ dispatch: (scenario, ctx) => opts.dispatchWithSurface(surface, scenario, ctx),
2767
+ runDir: `${opts.runDir}/gen-${gen}/candidate-${i}`
2768
+ });
2769
+ const composite = campaignMeanComposite(campaign);
2770
+ const coverage = campaignCoverage(
2771
+ campaign.cells,
2772
+ opts.scenarios,
2773
+ opts.reps ?? 1,
2774
+ requireJudgeScore
2775
+ );
2776
+ return {
2777
+ surfaceHash: hash,
2778
+ surface,
2779
+ label,
2780
+ rationale,
2781
+ ...candidateRecord ? { candidateRecord } : {},
2782
+ campaign,
2783
+ composite,
2784
+ coverage
2785
+ };
2786
+ }
2787
+ );
2788
+ for (const result of surfaceResults) {
2789
+ const { surface, surfaceHash: hash, campaign, coverage, label, rationale } = result;
2780
2790
  if (coverage.complete) {
2781
2791
  scored.push(
2782
2792
  toParetoParent(surface, hash, campaign, gen, label || void 0, rationale || void 0)
@@ -2988,7 +2998,7 @@ async function runImprovementLoop(opts) {
2988
2998
  const dispatchTimeoutMs = opts.dispatchTimeoutMs ?? DEFAULT_DISPATCH_TIMEOUT_MS;
2989
2999
  const optimization = await runOptimization({ ...opts, dispatchTimeoutMs, costLedger });
2990
3000
  const winnerIsBaseline = optimization.winnerSurfaceHash === surfaceHash(opts.baselineSurface);
2991
- const { runCampaign: runCampaign2 } = await import("./run-campaign-2YJ3Z6JS.js");
3001
+ const { runCampaign: runCampaign2 } = await import("./run-campaign-J6RHX2VO.js");
2992
3002
  const baselineOnHoldout = await runCampaign2({
2993
3003
  ...opts,
2994
3004
  costLedger,
@@ -3780,4 +3790,4 @@ export {
3780
3790
  provenanceSpansPath,
3781
3791
  emitLoopProvenance
3782
3792
  };
3783
- //# sourceMappingURL=chunk-U4R2AGY5.js.map
3793
+ //# sourceMappingURL=chunk-MWN2X7C5.js.map