@tangle-network/agent-eval 1.0.38 → 1.0.39

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.
@@ -5,18 +5,18 @@ import { r as summarizeExecution, t as analyzeRuns } from "../analyze-runs-DqHx3
5
5
  import { t as decidePairedPromotion } from "../paired-promotion-decision-BoWHWL1i.js";
6
6
  import { a as heldoutSignificance } from "../statistical-heldout-BvcAVtof.js";
7
7
  import { o as mapConcurrentRange } from "../journal-DQsbHGjX.js";
8
- import { $ as runEval, Q as withFinalEvidenceSources, a as clamp01, et as runCampaign, f as runImprovementLoop, r as transientDispatchFailure, t as llmJudge, z as defaultProductionGate } from "../llm-judge-BBHrAlcE.js";
8
+ import { $ as runEval, Q as withFinalEvidenceSources, a as clamp01, et as runCampaign, f as runImprovementLoop, r as transientDispatchFailure, t as llmJudge, z as defaultProductionGate } from "../llm-judge-lUQCBY1e.js";
9
9
  import { d as estimateCost, p as isModelPriced, t as CostLedger } from "../cost-ledger-1CwUnVOd.js";
10
10
  import { A as campaignSplitDigest } from "../campaign-evidence-BX8OveG5.js";
11
11
  import { M as fsCampaignStorage, N as inMemoryCampaignStorage } from "../external-optimizer-subprocess-BspZ0bZb.js";
12
12
  import { a as makeProposalFinding } from "../types-C8AyaiFi.js";
13
13
  import { n as isRecord } from "../json-DtvZNAU9.js";
14
- import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-BeLMK-OM.js";
15
- import { t as buildDefaultAnalystRegistry } from "../default-registry-CpGvgSYQ.js";
14
+ import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-C6zFzxp7.js";
15
+ import { t as buildDefaultAnalystRegistry } from "../default-registry-DSo3tnsW.js";
16
16
  import { t as extractUsage } from "../extract-usage-ISFqhfDz.js";
17
17
  import { n as createChatClient } from "../chat-client-DmPB31_2.js";
18
18
  import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "../outcome-store-TarrcfHG.js";
19
- import { c as composeGate, l as externalTextOptimizationMethod, n as compareOptimizationMethods, r as gepaOptimizationMethod, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-BmfnAzG4.js";
19
+ import { c as composeGate, l as externalTextOptimizationMethod, n as compareOptimizationMethods, r as gepaOptimizationMethod, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-Dch9LiNR.js";
20
20
  import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-CfgRPGx0.js";
21
21
  import { t as fromOtelSpans } from "../otel-spans-BsGzTWIK.js";
22
22
  import { createHash } from "node:crypto";
@@ -1 +1 @@
1
- {"version":3,"file":"default-registry-C5x2jyD6.d.ts","names":[],"sources":["../src/trace-analyst/behavioral-metrics.ts","../src/analyst/behavioral-trace-questions.ts","../src/analyst/behavioral-analyst.ts","../src/analyst/kind-factory.ts","../src/analyst/default-registry.ts"],"mappings":";;;;;;;;KAoBY;cCRC;;cAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6FD,yCAAyC;KACzC;KACA;UACK;EACf;EACA;;EAEA,SAAS;;;UAIM;EACf;EACA,SAAS;EACT,cAAc;;UAEC;EACf;EACA;EACA,QAAQ;IAAQ;IAAY;IAAuB,cAAc;;;;UAGlD;EACf;EACA;EACA;EACA;EACA;EACA,KAAK;EACL,eAAe;;UAGA;EACf;EACA;EACA;EACA,OAAO;EACP;EACA;;EAEA,OAAO;;EAEP,QAAQ;;EAER;IAAW;IAAmB;;EAC9B,cAAc;;EAEd;IACE;IACA,UAAU;MAAQ;MAAY;MAAiB;MAAc;;;;UAIhD,sCAAsC;EACrD;;EAEA;EACA,cAAc;;EAEd;EACA,IAAI;;UAGW;;EAEf;EACA;EACA,WAAW;;EAEX,mBAAmB;EACnB,QAAQ;;EAER,kBAAkB;EAClB,cAAc;EACd,eAAe,QACb,OACE,sBACA,QAAQ,OAAO,2BAA2B;EAG9C;EACA;;EAEA;EACA;EACA;;;iBAiBc,8BAA8B;EAC5C,YAAY;EACZ,OAAO;EACP,cAAc;EACd;EACA;EACA,mBAAmB;;;;;;;cCpLR,0BAA0B,SAAS,OAAO,gBAAgB;;iBAQvD,qBAAqB,KAAK,SAAS;;;;;;iBAkBnC,0BAA0B,SAAS;UAUlC;;EAEf;;EAEA;;EAEA,iBAAiB;;;iBAoGH,kBACd,UAAS,2BACR,oBAAoB;;UChKN;EACf;EACA;EACA;EACA;;EAEA,sBAAsB,SAAS;;EAE/B;;EAEA,WAAW;;EAEX,kBACE,OAAO,oBACP,SAAS,wCACe;EAC1B,SAAS,QAAQ;EACjB,eAAe,KAAK,mBAAmB,SAAS,mBAAmB;EACnE;EACA;;UAGe;EACf,QAAQ;;EAER;EACA;;;iBAIoB,gBAAgB;EACpC,YAAY;EACZ,QAAQ;EACR,OAAO;EACP,SAAS;EACT;IACE,QAAQ;;iBAgHI,mBACd,YAAY,wBACZ,SAAS,4BACR,oBAAoB;UCrKN;;;;;;EAMf,SAAS;EACT,uBAAuB;;EAEvB;EACA,aAAa;EACb,WAAW;;iBAGG,4BACd,UAAS,gCACR"}
1
+ {"version":3,"file":"default-registry-C5x2jyD6.d.ts","names":[],"sources":["../src/trace-analyst/behavioral-metrics.ts","../src/analyst/behavioral-trace-questions.ts","../src/analyst/behavioral-analyst.ts","../src/analyst/kind-factory.ts","../src/analyst/default-registry.ts"],"mappings":";;;;;;;;KAoBY;cCRC;;cAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6FD,yCAAyC;KACzC;KACA;UACK;EACf;EACA;;EAEA,SAAS;;;UAIM;EACf;EACA,SAAS;EACT,cAAc;;UAEC;EACf;EACA;EACA,QAAQ;IAAQ;IAAY;IAAuB,cAAc;;;;UAGlD;EACf;EACA;EACA;EACA;EACA;EACA,KAAK;EACL,eAAe;;UAGA;EACf;EACA;EACA;EACA,OAAO;EACP;EACA;;EAEA,OAAO;;EAEP,QAAQ;;EAER;IAAW;IAAmB;;EAC9B,cAAc;;EAEd;IACE;IACA,UAAU;MAAQ;MAAY;MAAiB;MAAc;;;;UAIhD,sCAAsC;EACrD;;EAEA;EACA,cAAc;;EAEd;EACA,IAAI;;UAGW;;EAEf;EACA;EACA,WAAW;;EAEX,mBAAmB;EACnB,QAAQ;;EAER,kBAAkB;EAClB,cAAc;EACd,eAAe,QACb,OACE,sBACA,QAAQ,OAAO,2BAA2B;EAG9C;EACA;;EAEA;EACA;EACA;;;iBAiBc,8BAA8B;EAC5C,YAAY;EACZ,OAAO;EACP,cAAc;EACd;EACA;EACA,mBAAmB;;;;;;;cC/KR,0BAA0B,SAAS,OAAO,gBAAgB;;iBAQvD,qBAAqB,KAAK,SAAS;;;;;;iBAkBnC,0BAA0B,SAAS;UAUlC;;EAEf;;EAEA;;EAEA,iBAAiB;;;iBAwGH,kBACd,UAAS,2BACR,oBAAoB;;UCzKN;EACf;EACA;EACA;EACA;;EAEA,sBAAsB,SAAS;;EAE/B;;EAEA,WAAW;;EAEX,kBACE,OAAO,oBACP,SAAS,wCACe;EAC1B,SAAS,QAAQ;EACjB,eAAe,KAAK,mBAAmB,SAAS,mBAAmB;EACnE;EACA;;UAGe;EACf,QAAQ;;EAER;EACA;;;iBAIoB,gBAAgB;EACpC,YAAY;EACZ,QAAQ;EACR,OAAO;EACP,SAAS;EACT;IACE,QAAQ;;iBAgHI,mBACd,YAAY,wBACZ,SAAS,4BACR,oBAAoB;UCrKN;;;;;;EAMf,SAAS;EACT,uBAAuB;;EAEvB;EACA,aAAa;EACb,WAAW;;iBAGG,4BACd,UAAS,gCACR"}
@@ -487,31 +487,6 @@ function canonicalTimestamp(value, name) {
487
487
  function isAnalystReviewSource(value) {
488
488
  return value === "user" || value === "judge" || value === "environment" || value === "metric" || value === "policy";
489
489
  }
490
- // src/trace-analyst/behavioral-metrics.ts
491
- /**
492
- * Deterministic behavioral metrics over OTLP spans — pure arithmetic, no LLM.
493
- *
494
- * It computes token growth, output decay, tool monoculture, and missing
495
- * self-verification once in TypeScript with no model judgment.
496
- *
497
- * General, not trace-specific: the detectors key off token trajectories and
498
- * tool usage present in any agentic OTLP trace, not any one benchmark.
499
- */
500
- /** ≥ this input-token growth ratio across a run, with no compression, fires. */
501
- const INPUT_GROWTH_FACTOR = 3;
502
- /** Tool-usage signals need at least this many calls to be meaningful. */
503
- const MIN_TOOL_CALLS = 3;
504
- /**
505
- * Serial calls required before a strictly-decreasing output run counts as decay.
506
- *
507
- * A run of n independent lengths is strictly decreasing by chance with
508
- * probability 1/n!, so the old minimum of 3 fired on roughly one sequence in
509
- * six. The paired `inputIsMonotonic && inputGrew` guard does not offset that:
510
- * context accumulates by construction in a serial agent loop, so input growth
511
- * is very nearly free evidence. At 5 calls chance alone accounts for under 1%,
512
- * which is the bar a signal reported at full confidence has to clear.
513
- */
514
- const OUTPUT_DECAY_MINIMUM_CALLS = 5;
515
490
  /**
516
491
  * The last output must fall to at most this fraction of the first.
517
492
  *
@@ -596,7 +571,7 @@ function computeTraceMetrics(spans) {
596
571
  seenTokenSignals.add(signal.code);
597
572
  signals.push(signal);
598
573
  }
599
- if (totalToolCalls >= MIN_TOOL_CALLS && distinctTools === 1) {
574
+ if (totalToolCalls >= 3 && distinctTools === 1) {
600
575
  const only = Object.keys(toolHistogram)[0];
601
576
  signals.push({
602
577
  code: "single-tool-dependency",
@@ -609,7 +584,7 @@ function computeTraceMetrics(spans) {
609
584
  }
610
585
  });
611
586
  }
612
- if (totalToolCalls >= MIN_TOOL_CALLS && !hasSelfVerification) signals.push({
587
+ if (totalToolCalls >= 3 && !hasSelfVerification) signals.push({
613
588
  code: "no-self-verification",
614
589
  severity: "medium",
615
590
  detail: `${totalToolCalls} tool calls were observed without a verification-named tool call.`,
@@ -801,7 +776,7 @@ function tokenSignals(sequence) {
801
776
  const isMonotonic = everyAdjacent(inputs, (previous, current) => current >= previous);
802
777
  const growthFromZero = first === 0 && last > 0;
803
778
  const growth = growthFromZero ? Infinity : first > 0 ? last / first : 0;
804
- if (isMonotonic && last > first && growth >= INPUT_GROWTH_FACTOR) {
779
+ if (isMonotonic && last > first && growth >= 3) {
805
780
  const growthLabel = growthFromZero ? "0→nonzero (unbounded)" : `${growth.toFixed(1)}x`;
806
781
  signals.push({
807
782
  code: "monotonic-input-growth",
@@ -819,7 +794,7 @@ function tokenSignals(sequence) {
819
794
  });
820
795
  }
821
796
  }
822
- if (inputs.length >= OUTPUT_DECAY_MINIMUM_CALLS && inputs.length === outputs.length && inputs.every((value) => value !== null) && outputs.every((value) => value !== null)) {
797
+ if (inputs.length >= 5 && inputs.length === outputs.length && inputs.every((value) => value !== null) && outputs.every((value) => value !== null)) {
823
798
  const first = outputs[0];
824
799
  const last = outputs[outputs.length - 1];
825
800
  const inputIsMonotonic = everyAdjacent(inputs, (previous, current) => current >= previous);
@@ -1471,9 +1446,10 @@ function pinBehavioralFailureClass(finding) {
1471
1446
  const DEFAULT_MAX_TRACES = 1e3;
1472
1447
  const DEFAULT_MAX_EVIDENCE_REFS = 20;
1473
1448
  const TRACE_PAGE_SIZE = 200;
1449
+ const OUTPUT_DECAY_MAXIMUM_RETAINED_PERCENT = Math.round(OUTPUT_DECAY_MAXIMUM_RETAINED_FRACTION * 100);
1474
1450
  const AGGREGATE_CLAIM = {
1475
1451
  "monotonic-input-growth": (observed, analyzed) => `${observed}/${analyzed} analyzed traces showed input tokens grow from zero to nonzero or to at least 3x their initial value across at least 3 serial model calls without a decrease.`,
1476
- "output-length-decay": (observed, analyzed) => `${observed}/${analyzed} analyzed traces showed output tokens decrease while input tokens increased monotonically across at least 3 serial model calls.`,
1452
+ "output-length-decay": (observed, analyzed) => `${observed}/${analyzed} analyzed traces showed output tokens fall without rising to at most ${OUTPUT_DECAY_MAXIMUM_RETAINED_PERCENT}% of the first call's while input tokens grew without a decrease, across at least 5 serial model calls.`,
1477
1453
  "single-tool-dependency": (observed, analyzed) => `${observed}/${analyzed} analyzed traces used only one named tool across at least 3 tool calls.`,
1478
1454
  "no-self-verification": (observed, analyzed) => `${observed}/${analyzed} analyzed traces had at least 3 tool calls without a verification-named tool call.`
1479
1455
  };
@@ -2988,4 +2964,4 @@ function buildDefaultAnalystRegistry(options = {}) {
2988
2964
  }
2989
2965
  export { assertUniqueFindingIds as C, validateAnalystReviewDecisions as D, snapshotAnalystRun as E, analystRunDigest as S, readAnalystReview as T, behavioralTraceSupportSchema as _, KNOWLEDGE_POISONING_KIND_SPEC as a, behavioralTraceQuestionDigest as b, FAILURE_MODE_KIND_SPEC as c, emitControlIntegrityFindings as d, BEHAVIORAL_FAILURE_CLASS as f, validBehavioralCalibration as g, pinBehavioralFailureClass as h, DEFAULT_TRACE_ANALYST_KINDS as i, CONTROL_INTEGRITY_ANALYST as l, behavioralAnalyst as m, AnalystRegistry as n, KNOWLEDGE_GAP_KIND_SPEC as o, assertFailureClasses as p, ExactAnalystRunExecutionError as r, IMPROVEMENT_KIND_SPEC as s, buildDefaultAnalystRegistry as t, ControlIntegrityAnalyst as u, BEHAVIORAL_TRACE_QUESTIONS as v, completedAnalystReviewQuality as w, analystFindingDigest as x, BEHAVIORAL_TRACE_QUESTIONS_VERSION as y };
2990
2966
 
2991
- //# sourceMappingURL=default-registry-CpGvgSYQ.js.map
2967
+ //# sourceMappingURL=default-registry-DSo3tnsW.js.map