@agent-inspect/eval 6.31.39 → 6.31.41
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/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TraceReadResult } from 'agent-inspect/readers';
|
|
1
|
+
import { TraceReadResult, TraceReadWarning } from 'agent-inspect/readers';
|
|
2
2
|
|
|
3
3
|
type CircuitRuleId = "circuit.same-tool-repetition" | "circuit.same-args-repetition" | "circuit.max-loop-iterations" | "circuit.max-retries" | "circuit.tool-timeout" | "circuit.runaway-llm-loop" | "circuit.excessive-branch-width";
|
|
4
4
|
interface ThresholdRule {
|
|
@@ -188,6 +188,11 @@ interface EvalContext {
|
|
|
188
188
|
run: EvalRunTree;
|
|
189
189
|
nodes: readonly EvalNode[];
|
|
190
190
|
events: readonly TraceReadResult["events"][number][];
|
|
191
|
+
/**
|
|
192
|
+
* Reader warnings from the underlying {@link TraceReadResult}.
|
|
193
|
+
* Token budgets fail closed when evidence-discard warnings are present.
|
|
194
|
+
*/
|
|
195
|
+
readerWarnings: readonly TraceReadWarning[];
|
|
191
196
|
}
|
|
192
197
|
declare function evalRun(input: EvalRunInput, options?: EvalRunOptions): Promise<EvalRunResult>;
|
|
193
198
|
declare const checks: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TraceReadResult } from 'agent-inspect/readers';
|
|
1
|
+
import { TraceReadResult, TraceReadWarning } from 'agent-inspect/readers';
|
|
2
2
|
|
|
3
3
|
type CircuitRuleId = "circuit.same-tool-repetition" | "circuit.same-args-repetition" | "circuit.max-loop-iterations" | "circuit.max-retries" | "circuit.tool-timeout" | "circuit.runaway-llm-loop" | "circuit.excessive-branch-width";
|
|
4
4
|
interface ThresholdRule {
|
|
@@ -188,6 +188,11 @@ interface EvalContext {
|
|
|
188
188
|
run: EvalRunTree;
|
|
189
189
|
nodes: readonly EvalNode[];
|
|
190
190
|
events: readonly TraceReadResult["events"][number][];
|
|
191
|
+
/**
|
|
192
|
+
* Reader warnings from the underlying {@link TraceReadResult}.
|
|
193
|
+
* Token budgets fail closed when evidence-discard warnings are present.
|
|
194
|
+
*/
|
|
195
|
+
readerWarnings: readonly TraceReadWarning[];
|
|
191
196
|
}
|
|
192
197
|
declare function evalRun(input: EvalRunInput, options?: EvalRunOptions): Promise<EvalRunResult>;
|
|
193
198
|
declare const checks: {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import { openTrace, TraceReadError } from 'agent-inspect/readers';
|
|
2
|
+
import { openTrace, TraceReadError, isTraceEvidenceDiscardWarning } from 'agent-inspect/readers';
|
|
3
3
|
import crypto, { createHash } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// packages/eval/src/index.ts
|
|
@@ -1423,7 +1423,8 @@ async function evalRun(input, options = {}) {
|
|
|
1423
1423
|
format: resolved.read.format,
|
|
1424
1424
|
run: selected.run,
|
|
1425
1425
|
nodes: flatten(selected.run.children),
|
|
1426
|
-
events: resolved.read.events.filter((event) => event.runId === selected.run?.runId)
|
|
1426
|
+
events: resolved.read.events.filter((event) => event.runId === selected.run?.runId),
|
|
1427
|
+
readerWarnings: resolved.read.warnings
|
|
1427
1428
|
};
|
|
1428
1429
|
const diagnostics = [];
|
|
1429
1430
|
const findings = [];
|
|
@@ -1768,6 +1769,21 @@ var checks = {
|
|
|
1768
1769
|
return createRule("eval.maxTotalTokens", "llm", (context) => {
|
|
1769
1770
|
const llms = llmEventsForTokenBudget(context.events);
|
|
1770
1771
|
const findings = [];
|
|
1772
|
+
if (context.readerWarnings.some(isTraceEvidenceDiscardWarning)) {
|
|
1773
|
+
findings.push(
|
|
1774
|
+
fail2(
|
|
1775
|
+
"eval.maxTotalTokens",
|
|
1776
|
+
`Unverifiable total token budget: malformed or invalid trace evidence was discarded while reading, so the total token limit cannot be verified.`,
|
|
1777
|
+
evidenceForRun(context.run, "tokenUsage.total"),
|
|
1778
|
+
"complete measurable total token evidence with no discarded rows",
|
|
1779
|
+
{
|
|
1780
|
+
reason: "unverifiable",
|
|
1781
|
+
discardedEvidence: true,
|
|
1782
|
+
calls: llms.length
|
|
1783
|
+
}
|
|
1784
|
+
)
|
|
1785
|
+
);
|
|
1786
|
+
}
|
|
1771
1787
|
const missing = llms.filter((event) => measuredTotalTokens(event) === void 0);
|
|
1772
1788
|
if (missing.length > 0) {
|
|
1773
1789
|
const errored = missing.filter((event) => event.status === "error");
|