@tangle-network/agent-eval 0.118.3 → 0.119.1
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.
- package/CHANGELOG.md +27 -0
- package/README.md +26 -0
- package/dist/analyst/index.d.ts +172 -59
- package/dist/analyst/index.js +50 -12
- package/dist/analyst/index.js.map +1 -1
- package/dist/benchmarks/index.d.ts +50 -40
- package/dist/benchmarks/index.js +8 -8
- package/dist/campaign/index.d.ts +258 -184
- package/dist/campaign/index.js +7 -7
- package/dist/{chunk-JTMFT5QZ.js → chunk-4I2E3LLO.js} +2 -2
- package/dist/{chunk-KK2O4VWA.js → chunk-D7AEXSM5.js} +2 -2
- package/dist/{chunk-MLHRFWQK.js → chunk-JHOJHHU7.js} +85 -16
- package/dist/chunk-JHOJHHU7.js.map +1 -0
- package/dist/{chunk-F5A4GDQW.js → chunk-JM2SKQMS.js} +3 -15
- package/dist/chunk-JM2SKQMS.js.map +1 -0
- package/dist/{chunk-EGNRE7VA.js → chunk-PAHNGS65.js} +2 -2
- package/dist/{chunk-QWRLW4CT.js → chunk-PSXJ32SR.js} +160 -6
- package/dist/chunk-PSXJ32SR.js.map +1 -0
- package/dist/{chunk-6QIM2EAP.js → chunk-PXD6ZFNY.js} +99 -1
- package/dist/chunk-PXD6ZFNY.js.map +1 -0
- package/dist/{chunk-267UCQWI.js → chunk-QWMPPZ3X.js} +3 -3
- package/dist/{chunk-267UCQWI.js.map → chunk-QWMPPZ3X.js.map} +1 -1
- package/dist/{chunk-VNLWDTDA.js → chunk-S5TT5R3L.js} +1010 -285
- package/dist/chunk-S5TT5R3L.js.map +1 -0
- package/dist/{chunk-ZYHJNKI3.js → chunk-ULOKLHIQ.js} +42 -5
- package/dist/chunk-ULOKLHIQ.js.map +1 -0
- package/dist/{chunk-FIUFRXP3.js → chunk-WW2A73HW.js} +49 -91
- package/dist/chunk-WW2A73HW.js.map +1 -0
- package/dist/{chunk-7V3QDWNL.js → chunk-XJ7JVCHB.js} +2 -2
- package/dist/{chunk-EKHHBKS6.js → chunk-XMBOU5W7.js} +48 -190
- package/dist/chunk-XMBOU5W7.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/contract/index.d.ts +281 -175
- package/dist/contract/index.js +284 -8
- package/dist/contract/index.js.map +1 -1
- package/dist/fuzz.d.ts +19 -1
- package/dist/fuzz.js +1 -1
- package/dist/index.d.ts +223 -114
- package/dist/index.js +38 -37
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/primeintellect/index.d.ts +311 -0
- package/dist/primeintellect/index.js +348 -0
- package/dist/primeintellect/index.js.map +1 -0
- package/dist/rl.d.ts +4 -0
- package/dist/{run-campaign-DWC67KJP.js → run-campaign-OBXSN5WK.js} +3 -3
- package/dist/traces.d.ts +39 -25
- package/dist/traces.js +3 -5
- package/dist/wire/index.d.ts +19 -1
- package/dist/wire/index.js +2 -2
- package/docs/trace-analysis.md +6 -2
- package/package.json +7 -2
- package/dist/chunk-6QIM2EAP.js.map +0 -1
- package/dist/chunk-EKHHBKS6.js.map +0 -1
- package/dist/chunk-F5A4GDQW.js.map +0 -1
- package/dist/chunk-FIUFRXP3.js.map +0 -1
- package/dist/chunk-MLHRFWQK.js.map +0 -1
- package/dist/chunk-QWRLW4CT.js.map +0 -1
- package/dist/chunk-VNLWDTDA.js.map +0 -1
- package/dist/chunk-ZYHJNKI3.js.map +0 -1
- /package/dist/{chunk-JTMFT5QZ.js.map → chunk-4I2E3LLO.js.map} +0 -0
- /package/dist/{chunk-KK2O4VWA.js.map → chunk-D7AEXSM5.js.map} +0 -0
- /package/dist/{chunk-EGNRE7VA.js.map → chunk-PAHNGS65.js.map} +0 -0
- /package/dist/{chunk-7V3QDWNL.js.map → chunk-XJ7JVCHB.js.map} +0 -0
- /package/dist/{run-campaign-DWC67KJP.js.map → run-campaign-OBXSN5WK.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-
|
|
12
|
+
} from "./chunk-XJ7JVCHB.js";
|
|
13
13
|
import {
|
|
14
14
|
BENCHMARK_SPLIT_SEED,
|
|
15
15
|
benchmarks_exports,
|
|
16
16
|
deterministicSplit
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-D7AEXSM5.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-
|
|
54
|
+
} from "./chunk-XMBOU5W7.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,7 +91,7 @@ import {
|
|
|
91
91
|
scoreRedTeamOutput,
|
|
92
92
|
surfaceContentHash,
|
|
93
93
|
toolNamesForRun
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-PSXJ32SR.js";
|
|
95
95
|
import {
|
|
96
96
|
BackendIntegrityError,
|
|
97
97
|
assertRealBackend,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
fileVerdictCache,
|
|
102
102
|
inMemoryVerdictCache,
|
|
103
103
|
summarizeBackendIntegrity
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-PAHNGS65.js";
|
|
105
105
|
import {
|
|
106
106
|
DEFAULT_COMPLEXITY_WEIGHTS,
|
|
107
107
|
FindingsStore,
|
|
@@ -110,17 +110,16 @@ import {
|
|
|
110
110
|
SEMANTIC_CONCEPT_JUDGE_VERSION,
|
|
111
111
|
SKILL_USAGE_ANALYST,
|
|
112
112
|
SkillUsageAnalyst,
|
|
113
|
-
createAnalystAi,
|
|
114
113
|
createSemanticConceptJudge,
|
|
115
114
|
defaultIsMaterial,
|
|
116
115
|
diffFindings,
|
|
117
116
|
runSemanticConceptJudge
|
|
118
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-JM2SKQMS.js";
|
|
119
118
|
import {
|
|
120
119
|
buildDefaultAnalystRegistry,
|
|
121
120
|
computeTraceMetrics,
|
|
122
121
|
createChatClient
|
|
123
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-QWMPPZ3X.js";
|
|
124
123
|
import "./chunk-HHWE3POT.js";
|
|
125
124
|
import {
|
|
126
125
|
Mutex
|
|
@@ -143,6 +142,7 @@ import {
|
|
|
143
142
|
clamp01,
|
|
144
143
|
computeFindingId,
|
|
145
144
|
computePolicyEditId,
|
|
145
|
+
createAnalystAi,
|
|
146
146
|
createTraceAnalystKind,
|
|
147
147
|
isPolicyEdit,
|
|
148
148
|
makeFinding,
|
|
@@ -151,10 +151,11 @@ import {
|
|
|
151
151
|
policyEditFromFinding,
|
|
152
152
|
policyEditsFromFindings,
|
|
153
153
|
renderPriorFindings,
|
|
154
|
+
renderUpstreamFindings,
|
|
154
155
|
scorePolicyEditReadiness,
|
|
155
156
|
validatePolicyEdit,
|
|
156
157
|
validatePolicyEditCandidateRecord
|
|
157
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-S5TT5R3L.js";
|
|
158
159
|
import {
|
|
159
160
|
allCriticalPassed,
|
|
160
161
|
controlFailureClassFromVerification,
|
|
@@ -264,7 +265,7 @@ import {
|
|
|
264
265
|
CostReservationExceededError,
|
|
265
266
|
costForUsage,
|
|
266
267
|
modelPriceKey
|
|
267
|
-
} from "./chunk-
|
|
268
|
+
} from "./chunk-JHOJHHU7.js";
|
|
268
269
|
import {
|
|
269
270
|
MODEL_PRICING,
|
|
270
271
|
MetricsCollector,
|
|
@@ -303,7 +304,7 @@ import {
|
|
|
303
304
|
scoreTraceInsightReadiness,
|
|
304
305
|
tokenizeDomainWords,
|
|
305
306
|
traceAnalystOnRunComplete
|
|
306
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-ULOKLHIQ.js";
|
|
307
308
|
import "./chunk-H5UD2323.js";
|
|
308
309
|
import {
|
|
309
310
|
extractUsage,
|
|
@@ -324,9 +325,8 @@ import {
|
|
|
324
325
|
import {
|
|
325
326
|
TRACE_ANALYST_ACTOR_DESCRIPTION,
|
|
326
327
|
TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION,
|
|
327
|
-
TRACE_ANALYST_SUBAGENT_DESCRIPTION,
|
|
328
328
|
analyzeTraces
|
|
329
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-WW2A73HW.js";
|
|
330
330
|
import {
|
|
331
331
|
DEFAULT_REDACTION_RULES,
|
|
332
332
|
REDACTION_VERSION,
|
|
@@ -351,7 +351,7 @@ import {
|
|
|
351
351
|
stringField,
|
|
352
352
|
traceAnalystFunctionGroup,
|
|
353
353
|
traceSpanKindToOpenInferenceKind
|
|
354
|
-
} from "./chunk-
|
|
354
|
+
} from "./chunk-PXD6ZFNY.js";
|
|
355
355
|
import {
|
|
356
356
|
RunIntegrityError,
|
|
357
357
|
assertRunCaptured,
|
|
@@ -4337,7 +4337,7 @@ function renderSteeringText(bundle) {
|
|
|
4337
4337
|
}
|
|
4338
4338
|
|
|
4339
4339
|
// src/steering-optimizer.ts
|
|
4340
|
-
import { AxGEPA,
|
|
4340
|
+
import { AxGEPA, AxSignature, ax } from "@ax-llm/ax";
|
|
4341
4341
|
var PairwiseSteeringOptimizer = class {
|
|
4342
4342
|
optimize(rows, config = {}) {
|
|
4343
4343
|
const ranked = rankRows(rows, config.weights);
|
|
@@ -4369,7 +4369,8 @@ var AxGepaSteeringOptimizer = class {
|
|
|
4369
4369
|
};
|
|
4370
4370
|
}
|
|
4371
4371
|
const signature = `task:string, split:string, seedPreview:string -> variantId:class "${variantIds.join(", ")}", rationale:string`;
|
|
4372
|
-
const
|
|
4372
|
+
const selectorSignature = AxSignature.from(signature);
|
|
4373
|
+
const selector = ax(selectorSignature, {
|
|
4373
4374
|
description: "Choose the best steering bundle variant for an autopilot task."
|
|
4374
4375
|
});
|
|
4375
4376
|
const shuffled = seededShuffle(byScenario, signature);
|
|
@@ -4398,15 +4399,11 @@ var AxGepaSteeringOptimizer = class {
|
|
|
4398
4399
|
earlyStoppingTrials: 3,
|
|
4399
4400
|
sampleCount: 1
|
|
4400
4401
|
});
|
|
4401
|
-
const
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
validationExamples: validation,
|
|
4407
|
-
maxMetricCalls: 64
|
|
4408
|
-
}
|
|
4409
|
-
);
|
|
4402
|
+
const metric = ({ prediction, example }) => stringField2(prediction, "variantId") === stringField2(example, "variantId") ? 1 : 0;
|
|
4403
|
+
const compiled = await optimizer.compile(selector, train, metric, {
|
|
4404
|
+
validationExamples: validation,
|
|
4405
|
+
maxMetricCalls: 64
|
|
4406
|
+
});
|
|
4410
4407
|
if (compiled.optimizedProgram !== void 0) {
|
|
4411
4408
|
selector.applyOptimization(compiled.optimizedProgram);
|
|
4412
4409
|
}
|
|
@@ -4462,12 +4459,17 @@ function collapseScenarioWinners(rows, weights) {
|
|
|
4462
4459
|
});
|
|
4463
4460
|
}
|
|
4464
4461
|
function createAxService(provider, apiKey, model) {
|
|
4465
|
-
return
|
|
4466
|
-
|
|
4462
|
+
return createAnalystAi({
|
|
4463
|
+
provider,
|
|
4467
4464
|
apiKey,
|
|
4468
|
-
|
|
4465
|
+
model
|
|
4469
4466
|
});
|
|
4470
4467
|
}
|
|
4468
|
+
function stringField2(value, field) {
|
|
4469
|
+
if (!value || typeof value !== "object") return void 0;
|
|
4470
|
+
const candidate = value[field];
|
|
4471
|
+
return typeof candidate === "string" ? candidate : void 0;
|
|
4472
|
+
}
|
|
4471
4473
|
function seededShuffle(items, seed) {
|
|
4472
4474
|
const rng = mulberry322(hashString(seed));
|
|
4473
4475
|
const out = [...items];
|
|
@@ -5971,9 +5973,9 @@ function statusAdvanced(key, progression) {
|
|
|
5971
5973
|
description: `"${key}" progressed along ${progression.join("\u2192")}`,
|
|
5972
5974
|
score: ({ before, after }) => {
|
|
5973
5975
|
const bi = progression.indexOf(String(before[key]));
|
|
5974
|
-
const
|
|
5975
|
-
if (bi === -1 ||
|
|
5976
|
-
return
|
|
5976
|
+
const ai = progression.indexOf(String(after[key]));
|
|
5977
|
+
if (bi === -1 || ai === -1) return 0;
|
|
5978
|
+
return ai >= bi ? 1 : 0;
|
|
5977
5979
|
}
|
|
5978
5980
|
};
|
|
5979
5981
|
}
|
|
@@ -10035,12 +10037,11 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
|
|
|
10035
10037
|
attributes: {
|
|
10036
10038
|
"analyst.question_length": input.question.length,
|
|
10037
10039
|
"analyst.max_turns": options.maxTurns ?? 12,
|
|
10038
|
-
"analyst.
|
|
10040
|
+
"analyst.max_subqueries": options.maxSubqueries ?? 4,
|
|
10039
10041
|
"eval.phase": "analyst"
|
|
10040
10042
|
}
|
|
10041
10043
|
});
|
|
10042
10044
|
const originalOnTurn = options.onTurn;
|
|
10043
|
-
const turnSpanIds = [];
|
|
10044
10045
|
const wrappedOptions = {
|
|
10045
10046
|
...options,
|
|
10046
10047
|
onTurn: async (turn) => {
|
|
@@ -10049,6 +10050,7 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
|
|
|
10049
10050
|
name: `analyst:turn-${turn.turn}`,
|
|
10050
10051
|
parentSpanId: parentSpan.span.spanId,
|
|
10051
10052
|
attributes: {
|
|
10053
|
+
"analyst.stage": turn.stage,
|
|
10052
10054
|
"analyst.turn": turn.turn,
|
|
10053
10055
|
"analyst.is_error": turn.isError,
|
|
10054
10056
|
"analyst.code_length": turn.code.length,
|
|
@@ -10056,7 +10058,6 @@ async function tracedAnalyzeTraces(input, options, traceOpts) {
|
|
|
10056
10058
|
"eval.phase": "analyst"
|
|
10057
10059
|
}
|
|
10058
10060
|
});
|
|
10059
|
-
turnSpanIds.push(turnSpan.span.spanId);
|
|
10060
10061
|
if (turn.isError) {
|
|
10061
10062
|
await turnSpan.fail("Turn produced an error");
|
|
10062
10063
|
} else {
|
|
@@ -11663,7 +11664,6 @@ export {
|
|
|
11663
11664
|
TOOL_NAME_ATTR_KEYS,
|
|
11664
11665
|
TRACE_ANALYST_ACTOR_DESCRIPTION,
|
|
11665
11666
|
TRACE_ANALYST_ACTOR_DESCRIPTION_VERSION,
|
|
11666
|
-
TRACE_ANALYST_SUBAGENT_DESCRIPTION,
|
|
11667
11667
|
TRACE_ANALYST_TRUNCATION_MARKER_PREFIX,
|
|
11668
11668
|
TRACE_SCHEMA_VERSION,
|
|
11669
11669
|
TokenCounter,
|
|
@@ -12040,6 +12040,7 @@ export {
|
|
|
12040
12040
|
renderPriorFindings,
|
|
12041
12041
|
renderReleaseReport,
|
|
12042
12042
|
renderSteeringText,
|
|
12043
|
+
renderUpstreamFindings,
|
|
12043
12044
|
repeatedActionDetector,
|
|
12044
12045
|
replayFeedbackTrajectories,
|
|
12045
12046
|
replayFeedbackTrajectory,
|