@cef-ai/eval 0.0.0-stage → 0.1.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.
- package/README.md +202 -2
- package/dist/capture.d.ts +37 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +70 -0
- package/dist/capture.js.map +1 -0
- package/dist/conformance.d.ts +6 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +257 -0
- package/dist/conformance.js.map +1 -0
- package/dist/contract.d.ts +18 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +176 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +112 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +222 -0
- package/dist/layout.js.map +1 -0
- package/dist/migrate.d.ts +30 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +113 -0
- package/dist/migrate.js.map +1 -0
- package/dist/pool.d.ts +13 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +34 -0
- package/dist/pool.js.map +1 -0
- package/dist/result.d.ts +11 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +72 -0
- package/dist/result.js.map +1 -0
- package/dist/run.d.ts +86 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +240 -0
- package/dist/run.js.map +1 -0
- package/dist/score.d.ts +102 -0
- package/dist/score.d.ts.map +1 -0
- package/dist/score.js +433 -0
- package/dist/score.js.map +1 -0
- package/dist/storage.d.ts +218 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +577 -0
- package/dist/storage.js.map +1 -0
- package/dist/summary.d.ts +105 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/summary.js +219 -0
- package/dist/summary.js.map +1 -0
- package/dist/types.d.ts +265 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +14 -0
- package/dist/types.js.map +1 -0
- package/package.json +27 -3
package/dist/score.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic scoring of a run's Result against a case's expectations.
|
|
3
|
+
*
|
|
4
|
+
* One score per expected field (`eval/field@1`). Field access is by dot path
|
|
5
|
+
* (`"forecast.amount"`, `"items.0.id"`). An expected field the output does not
|
|
6
|
+
* have FAILS — silently skipping a missing field is how a broken run goes green.
|
|
7
|
+
*
|
|
8
|
+
* Per field, the expectation is:
|
|
9
|
+
* - a matcher object (`{ $oneOf: [...] }`, see {@link Matcher});
|
|
10
|
+
* - a numeric band string (`">= 0.8"`) when the actual value is a number;
|
|
11
|
+
* - a plain object: SUBSET match — every key it names must match (leaves
|
|
12
|
+
* recursively by these same rules), keys it does not name are ignored;
|
|
13
|
+
* - anything else: deep equality (arrays ordered and length-sensitive).
|
|
14
|
+
*
|
|
15
|
+
* Limits (`eval/limit@1`) are scored too, and only WARN: a breach is counted
|
|
16
|
+
* and shown, and never flips a case's pass.
|
|
17
|
+
*
|
|
18
|
+
* AGAINST A DECLARED RESULT. When the experiment knows the Result the workflow
|
|
19
|
+
* version declares (`Experiment.resultFields`), an expectation that version
|
|
20
|
+
* cannot meet by construction is not a failure of the run: a field it does
|
|
21
|
+
* not declare, or declares with a type the expectation cannot match, is scored
|
|
22
|
+
* `pass: null` (n/a) with the reason. The dataset is older than the version;
|
|
23
|
+
* that is a finding about the dataset, shown as one, not a regression.
|
|
24
|
+
*/
|
|
25
|
+
import type { Case, Header, Json, Limits, Matcher, Metrics, ResultField, Score } from "./types.js";
|
|
26
|
+
export declare const FIELD_SCORER = "eval/field@1";
|
|
27
|
+
export declare const LIMIT_SCORER = "eval/limit@1";
|
|
28
|
+
declare const MISSING: unique symbol;
|
|
29
|
+
type Actual = Json | typeof MISSING;
|
|
30
|
+
/** Read a dot path out of a value. `MISSING` when any segment is absent. */
|
|
31
|
+
export declare function readField(value: Json | null | undefined, path: string): Json | undefined;
|
|
32
|
+
export declare function deepEqual(a: Json, b: Json): boolean;
|
|
33
|
+
export type BandOp = ">=" | "<=" | ">" | "<";
|
|
34
|
+
export declare function parseBand(expr: string): {
|
|
35
|
+
op: BandOp;
|
|
36
|
+
threshold: number;
|
|
37
|
+
} | null;
|
|
38
|
+
/** Whether an expectation is a matcher object (every key starts with `$`). */
|
|
39
|
+
export declare function isMatcher(v: unknown): v is Matcher;
|
|
40
|
+
/** Longest `$regex` pattern scoring will compile. */
|
|
41
|
+
export declare const MAX_REGEX_LENGTH = 256;
|
|
42
|
+
/**
|
|
43
|
+
* Why a `$regex` pattern is refused before it is compiled, or null.
|
|
44
|
+
*
|
|
45
|
+
* TRUST MODEL. Cases come from a shared bucket, and JavaScript's regex engine
|
|
46
|
+
* backtracks: a pattern like `(a+)+$` runs for exponential time on a short
|
|
47
|
+
* non-matching string, synchronously, inside scoring — no timeout can
|
|
48
|
+
* interrupt it, and the CLI or the ROC tab freezes. So a pattern is refused
|
|
49
|
+
* when it is longer than {@link MAX_REGEX_LENGTH} or quantifies a group that
|
|
50
|
+
* itself contains a quantifier (`(a+)+`, `(a*)*`, `((ab)+){2,}`; a fixed
|
|
51
|
+
* `{n}` does not count). This is a heuristic, not a proof: overlapping
|
|
52
|
+
* alternations (`(a|a)*`) still pass it.
|
|
53
|
+
* Anyone who can write cases can make scoring slow; datasets are trusted the
|
|
54
|
+
* way the workflow code they test is.
|
|
55
|
+
*/
|
|
56
|
+
export declare function unsafeRegex(pattern: string): string | null;
|
|
57
|
+
/** null when `actual` satisfies `expected`, otherwise why not. */
|
|
58
|
+
export declare function matchValue(expected: Json | Matcher, actual: Actual | Json): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* The value types an expectation can match: `["number"]` for `{ $gte: 1 }`,
|
|
61
|
+
* `["number", "string"]` for a band string such as `">= 0.8"` (a band against
|
|
62
|
+
* a number, plain equality against a string), null when it can match any
|
|
63
|
+
* (`null`, `{ $exists }`, an empty or unknown matcher).
|
|
64
|
+
*/
|
|
65
|
+
export declare function expectedTypesOf(want: Json | Matcher): string[] | null;
|
|
66
|
+
/**
|
|
67
|
+
* One `eval/field@1` score per expected field. With `resultFields` (the
|
|
68
|
+
* version's declared Result), an expectation the declaration rules out is
|
|
69
|
+
* n/a (`pass: null`) rather than a failure — see the file comment.
|
|
70
|
+
*/
|
|
71
|
+
export declare function scoreFields(expected: Case["expected"], output: Json | null | undefined, resultFields?: readonly ResultField[]): Score[];
|
|
72
|
+
/** The limits in force for a case: the header's, each overridden by the case's own. */
|
|
73
|
+
export declare function effectiveLimits(header: Pick<Header, "limits"> | undefined, c: Pick<Case, "limits">): Limits;
|
|
74
|
+
/** One `eval/limit@1` score per limit in force. A metric that was not measured is not judged. */
|
|
75
|
+
export declare function scoreLimits(limits: Limits, metrics: Metrics): Score[];
|
|
76
|
+
/** A case passes when every field score passes; null when there were none. Limits never count. */
|
|
77
|
+
export declare function casePass(scores: Score[]): boolean | null;
|
|
78
|
+
export interface ResultCompatibility {
|
|
79
|
+
/** Expected fields the Result does not declare, with the cases expecting each. */
|
|
80
|
+
missing: Array<{
|
|
81
|
+
field: string;
|
|
82
|
+
caseIds: string[];
|
|
83
|
+
}>;
|
|
84
|
+
/** Expected fields whose expectation cannot match the declared type. */
|
|
85
|
+
typeChanged: Array<{
|
|
86
|
+
field: string;
|
|
87
|
+
expectedType: string;
|
|
88
|
+
declaredType: string;
|
|
89
|
+
caseIds: string[];
|
|
90
|
+
}>;
|
|
91
|
+
/** Declared fields no case states an expectation for. */
|
|
92
|
+
unexpectedNew: string[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Whether a dataset's expectations fit a workflow version's declared Result —
|
|
96
|
+
* the check behind "2 dataset cases expect `priority`, which this version no
|
|
97
|
+
* longer returns". Fields are reported by their top-level name; each list is
|
|
98
|
+
* sorted.
|
|
99
|
+
*/
|
|
100
|
+
export declare function checkResultCompatibility(resultFields: readonly ResultField[], cases: ReadonlyArray<Pick<Case, "id" | "expected">>): ResultCompatibility;
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=score.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../src/score.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnG,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,QAAA,MAAM,OAAO,eAAoB,CAAC;AAClC,KAAK,MAAM,GAAG,IAAI,GAAG,OAAO,OAAO,CAAC;AAKpC,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAGxF;AAqBD,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAYnD;AAID,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAGhF;AAQD,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,OAAO,CAIlD;AAWD,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8B1D;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;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,SAAS,WAAW,EAAE,EACpC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC,GAClD,mBAAmB,CA8BrB"}
|
package/dist/score.js
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
export const FIELD_SCORER = "eval/field@1";
|
|
2
|
+
export const LIMIT_SCORER = "eval/limit@1";
|
|
3
|
+
const MISSING = Symbol("missing");
|
|
4
|
+
const isPlainObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
5
|
+
/** Read a dot path out of a value. `MISSING` when any segment is absent. */
|
|
6
|
+
export function readField(value, path) {
|
|
7
|
+
const got = readPathRaw(value, path);
|
|
8
|
+
return got === MISSING ? undefined : got;
|
|
9
|
+
}
|
|
10
|
+
function readPathRaw(value, path) {
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return MISSING;
|
|
13
|
+
if (path === "")
|
|
14
|
+
return value;
|
|
15
|
+
let cur = value;
|
|
16
|
+
for (const seg of path.split(".")) {
|
|
17
|
+
if (Array.isArray(cur)) {
|
|
18
|
+
const i = /^\d+$/.test(seg) ? Number(seg) : NaN;
|
|
19
|
+
if (!(i >= 0 && i < cur.length))
|
|
20
|
+
return MISSING;
|
|
21
|
+
cur = cur[i];
|
|
22
|
+
}
|
|
23
|
+
else if (isPlainObject(cur)) {
|
|
24
|
+
if (!Object.prototype.hasOwnProperty.call(cur, seg))
|
|
25
|
+
return MISSING;
|
|
26
|
+
cur = cur[seg];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return MISSING;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return cur;
|
|
33
|
+
}
|
|
34
|
+
export function deepEqual(a, b) {
|
|
35
|
+
if (a === b)
|
|
36
|
+
return true;
|
|
37
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
38
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length)
|
|
39
|
+
return false;
|
|
40
|
+
return a.every((x, i) => deepEqual(x, b[i]));
|
|
41
|
+
}
|
|
42
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
43
|
+
const ka = Object.keys(a);
|
|
44
|
+
if (ka.length !== Object.keys(b).length)
|
|
45
|
+
return false;
|
|
46
|
+
return ka.every((k) => Object.prototype.hasOwnProperty.call(b, k) && deepEqual(a[k], b[k]));
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
/** Band grammar kept from the first eval harness: `>= 0.8`, `< 100`. */
|
|
51
|
+
const BAND_RE = /^\s*(>=|<=|>|<)\s*(-?\d*\.?\d+)\s*$/;
|
|
52
|
+
export function parseBand(expr) {
|
|
53
|
+
const m = BAND_RE.exec(expr);
|
|
54
|
+
return m ? { op: m[1], threshold: Number.parseFloat(m[2]) } : null;
|
|
55
|
+
}
|
|
56
|
+
function bandHolds(op, t, x) {
|
|
57
|
+
return op === ">" ? x > t : op === "<" ? x < t : op === ">=" ? x >= t : x <= t;
|
|
58
|
+
}
|
|
59
|
+
const MATCHER_KEYS = new Set(["$eq", "$oneOf", "$contains", "$regex", "$between", "$gte", "$lte", "$exists", "$approx", "$tol"]);
|
|
60
|
+
/** Whether an expectation is a matcher object (every key starts with `$`). */
|
|
61
|
+
export function isMatcher(v) {
|
|
62
|
+
if (!isPlainObject(v))
|
|
63
|
+
return false;
|
|
64
|
+
const keys = Object.keys(v);
|
|
65
|
+
return keys.length > 0 && keys.every((k) => k.startsWith("$"));
|
|
66
|
+
}
|
|
67
|
+
/** JSON for a detail line; a non-finite number reads as itself ("NaN"), not as JSON's `null`. */
|
|
68
|
+
const json = (v) => typeof v === "number" && !Number.isFinite(v)
|
|
69
|
+
? String(v)
|
|
70
|
+
: JSON.stringify(v, (_k, x) => (typeof x === "number" && !Number.isFinite(x) ? String(x) : x));
|
|
71
|
+
const show = (v) => (v === MISSING ? "nothing" : truncate(json(v)));
|
|
72
|
+
const truncate = (s, n = 120) => (s.length > n ? `${s.slice(0, n - 1)}…` : s);
|
|
73
|
+
const isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
74
|
+
/** Longest `$regex` pattern scoring will compile. */
|
|
75
|
+
export const MAX_REGEX_LENGTH = 256;
|
|
76
|
+
/**
|
|
77
|
+
* Why a `$regex` pattern is refused before it is compiled, or null.
|
|
78
|
+
*
|
|
79
|
+
* TRUST MODEL. Cases come from a shared bucket, and JavaScript's regex engine
|
|
80
|
+
* backtracks: a pattern like `(a+)+$` runs for exponential time on a short
|
|
81
|
+
* non-matching string, synchronously, inside scoring — no timeout can
|
|
82
|
+
* interrupt it, and the CLI or the ROC tab freezes. So a pattern is refused
|
|
83
|
+
* when it is longer than {@link MAX_REGEX_LENGTH} or quantifies a group that
|
|
84
|
+
* itself contains a quantifier (`(a+)+`, `(a*)*`, `((ab)+){2,}`; a fixed
|
|
85
|
+
* `{n}` does not count). This is a heuristic, not a proof: overlapping
|
|
86
|
+
* alternations (`(a|a)*`) still pass it.
|
|
87
|
+
* Anyone who can write cases can make scoring slow; datasets are trusted the
|
|
88
|
+
* way the workflow code they test is.
|
|
89
|
+
*/
|
|
90
|
+
export function unsafeRegex(pattern) {
|
|
91
|
+
if (pattern.length > MAX_REGEX_LENGTH)
|
|
92
|
+
return `longer than ${MAX_REGEX_LENGTH} characters`;
|
|
93
|
+
// One frame per open group: whether anything inside it (nested groups included) is quantified.
|
|
94
|
+
const groups = [];
|
|
95
|
+
let inClass = false;
|
|
96
|
+
const quantifierAt = (i) => {
|
|
97
|
+
const c = pattern[i];
|
|
98
|
+
return c === "*" || c === "+" || (c === "{" && /^\{\d+,\d*\}/.test(pattern.slice(i)));
|
|
99
|
+
};
|
|
100
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
101
|
+
const c = pattern[i];
|
|
102
|
+
if (c === "\\") {
|
|
103
|
+
i++;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (inClass) {
|
|
107
|
+
if (c === "]")
|
|
108
|
+
inClass = false;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (c === "[")
|
|
112
|
+
inClass = true;
|
|
113
|
+
else if (c === "(")
|
|
114
|
+
groups.push(false);
|
|
115
|
+
else if (c === ")") {
|
|
116
|
+
const quantifiedInside = groups.pop() ?? false;
|
|
117
|
+
if (quantifiedInside && quantifierAt(i + 1))
|
|
118
|
+
return "a quantified group contains a quantifier (nested quantifiers backtrack exponentially)";
|
|
119
|
+
if (groups.length && (quantifiedInside || quantifierAt(i + 1)))
|
|
120
|
+
groups[groups.length - 1] = true;
|
|
121
|
+
}
|
|
122
|
+
else if (quantifierAt(i) && groups.length) {
|
|
123
|
+
groups[groups.length - 1] = true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
/** The operators a matcher applies, in the order they are checked. `$tol` belongs to `$approx`. */
|
|
129
|
+
const OPERATORS = ["$eq", "$oneOf", "$contains", "$regex", "$between", "$approx", "$gte", "$lte"];
|
|
130
|
+
/**
|
|
131
|
+
* null when it matches, otherwise why not. Every operator the matcher names
|
|
132
|
+
* must hold (AND): `{ $exists: true, $gte: 1 }` needs a value and that it be
|
|
133
|
+
* ≥ 1. The first that fails is the reason given.
|
|
134
|
+
*/
|
|
135
|
+
function applyMatcher(m, actual) {
|
|
136
|
+
const unknown = Object.keys(m).filter((k) => !MATCHER_KEYS.has(k));
|
|
137
|
+
if (unknown.length)
|
|
138
|
+
return `unknown matcher ${unknown.join(", ")}`;
|
|
139
|
+
const ops = OPERATORS.filter((k) => k in m);
|
|
140
|
+
if ("$tol" in m && !("$approx" in m))
|
|
141
|
+
return "$tol needs $approx";
|
|
142
|
+
if ("$exists" in m) {
|
|
143
|
+
const exists = actual !== MISSING && actual !== null;
|
|
144
|
+
if (exists !== Boolean(m.$exists)) {
|
|
145
|
+
return m.$exists ? "expected a value, got nothing" : `expected nothing, got ${show(actual)}`;
|
|
146
|
+
}
|
|
147
|
+
if (!ops.length)
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
if (!ops.length)
|
|
151
|
+
return "empty matcher";
|
|
152
|
+
if (actual === MISSING)
|
|
153
|
+
return "missing";
|
|
154
|
+
for (const op of ops) {
|
|
155
|
+
const why = applyOperator(op, m, actual);
|
|
156
|
+
if (why !== null)
|
|
157
|
+
return why;
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
function applyOperator(op, m, actual) {
|
|
162
|
+
switch (op) {
|
|
163
|
+
case "$eq":
|
|
164
|
+
return deepEqual(m.$eq, actual) ? null : `expected ${show(m.$eq)}, got ${show(actual)}`;
|
|
165
|
+
case "$oneOf": {
|
|
166
|
+
const options = Array.isArray(m.$oneOf) ? m.$oneOf : [];
|
|
167
|
+
return options.some((o) => deepEqual(o, actual)) ? null : `expected one of ${show(options)}, got ${show(actual)}`;
|
|
168
|
+
}
|
|
169
|
+
case "$contains": {
|
|
170
|
+
const want = m.$contains;
|
|
171
|
+
let ok = false;
|
|
172
|
+
if (typeof actual === "string" && typeof want === "string")
|
|
173
|
+
ok = actual.includes(want);
|
|
174
|
+
else if (Array.isArray(actual))
|
|
175
|
+
ok = actual.some((x) => matchValue(want, x) === null);
|
|
176
|
+
else if (isPlainObject(actual) && isPlainObject(want))
|
|
177
|
+
ok = matchValue(want, actual) === null;
|
|
178
|
+
return ok ? null : `expected to contain ${show(want)}, got ${show(actual)}`;
|
|
179
|
+
}
|
|
180
|
+
case "$regex": {
|
|
181
|
+
if (typeof m.$regex !== "string")
|
|
182
|
+
return "$regex must be a string";
|
|
183
|
+
const unsafe = unsafeRegex(m.$regex);
|
|
184
|
+
if (unsafe)
|
|
185
|
+
return `unsafe $regex refused: ${unsafe}`;
|
|
186
|
+
if (typeof actual !== "string")
|
|
187
|
+
return `expected a string matching /${m.$regex}/, got ${show(actual)}`;
|
|
188
|
+
let re;
|
|
189
|
+
try {
|
|
190
|
+
re = new RegExp(m.$regex);
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
return `invalid $regex ${m.$regex}`;
|
|
194
|
+
}
|
|
195
|
+
return re.test(actual) ? null : `expected /${m.$regex}/, got ${show(actual)}`;
|
|
196
|
+
}
|
|
197
|
+
case "$between": {
|
|
198
|
+
const b = m.$between;
|
|
199
|
+
if (!Array.isArray(b) || b.length !== 2 || !isNum(b[0]) || !isNum(b[1]))
|
|
200
|
+
return "$between must be [min, max]";
|
|
201
|
+
const [min, max] = b;
|
|
202
|
+
if (min > max)
|
|
203
|
+
return `$between must be [min, max] with min ≤ max, got [${min}, ${max}]`;
|
|
204
|
+
return isNum(actual) && actual >= min && actual <= max ? null : `expected between ${min} and ${max}, got ${show(actual)}`;
|
|
205
|
+
}
|
|
206
|
+
case "$approx": {
|
|
207
|
+
const want = m.$approx;
|
|
208
|
+
const tol = m.$tol ?? 0;
|
|
209
|
+
if (!isNum(want) || !isNum(tol))
|
|
210
|
+
return "$approx and $tol must be numbers";
|
|
211
|
+
return isNum(actual) && Math.abs(actual - want) <= tol
|
|
212
|
+
? null
|
|
213
|
+
: `expected ${want} ± ${tol}, got ${show(actual)}`;
|
|
214
|
+
}
|
|
215
|
+
case "$gte":
|
|
216
|
+
if (!isNum(actual))
|
|
217
|
+
return `expected a number, got ${show(actual)}`;
|
|
218
|
+
return isNum(m.$gte) && actual >= m.$gte ? null : `expected ≥ ${show(m.$gte)}, got ${show(actual)}`;
|
|
219
|
+
case "$lte":
|
|
220
|
+
if (!isNum(actual))
|
|
221
|
+
return `expected a number, got ${show(actual)}`;
|
|
222
|
+
return isNum(m.$lte) && actual <= m.$lte ? null : `expected ≤ ${show(m.$lte)}, got ${show(actual)}`;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/** null when `actual` satisfies `expected`, otherwise why not. */
|
|
226
|
+
export function matchValue(expected, actual) {
|
|
227
|
+
const a = actual;
|
|
228
|
+
if (isMatcher(expected))
|
|
229
|
+
return applyMatcher(expected, a);
|
|
230
|
+
if (a === MISSING)
|
|
231
|
+
return "missing";
|
|
232
|
+
if (typeof expected === "string" && isNum(a)) {
|
|
233
|
+
const band = parseBand(expected);
|
|
234
|
+
if (band)
|
|
235
|
+
return bandHolds(band.op, band.threshold, a) ? null : `expected ${expected}, got ${a}`;
|
|
236
|
+
}
|
|
237
|
+
if (isPlainObject(expected)) {
|
|
238
|
+
if (!isPlainObject(a))
|
|
239
|
+
return `expected an object, got ${show(a)}`;
|
|
240
|
+
for (const [k, v] of Object.entries(expected)) {
|
|
241
|
+
const child = Object.prototype.hasOwnProperty.call(a, k) ? a[k] : MISSING;
|
|
242
|
+
const why = matchValue(v, child);
|
|
243
|
+
if (why !== null)
|
|
244
|
+
return `${k}: ${why}`;
|
|
245
|
+
}
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
return deepEqual(expected, a) ? null : `expected ${show(expected)}, got ${show(a)}`;
|
|
249
|
+
}
|
|
250
|
+
/** The value a score carries: the actual primitive, or its JSON (truncated) for an object/array. */
|
|
251
|
+
function scoreValue(v) {
|
|
252
|
+
if (v === MISSING || v === null)
|
|
253
|
+
return null;
|
|
254
|
+
if (typeof v === "number" && !Number.isFinite(v))
|
|
255
|
+
return String(v);
|
|
256
|
+
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean")
|
|
257
|
+
return v;
|
|
258
|
+
return truncate(json(v), 500);
|
|
259
|
+
}
|
|
260
|
+
const RESULT_FIELD_TYPES = new Set(["string", "number", "boolean", "object", "array"]);
|
|
261
|
+
/**
|
|
262
|
+
* The value types an expectation can match: `["number"]` for `{ $gte: 1 }`,
|
|
263
|
+
* `["number", "string"]` for a band string such as `">= 0.8"` (a band against
|
|
264
|
+
* a number, plain equality against a string), null when it can match any
|
|
265
|
+
* (`null`, `{ $exists }`, an empty or unknown matcher).
|
|
266
|
+
*/
|
|
267
|
+
export function expectedTypesOf(want) {
|
|
268
|
+
const typeOf = (v) => v === null ? null : Array.isArray(v) ? "array" : typeof v === "object" ? "object" : typeof v;
|
|
269
|
+
if (isMatcher(want)) {
|
|
270
|
+
const m = want;
|
|
271
|
+
const typesOf = (op) => {
|
|
272
|
+
if (op === "$eq")
|
|
273
|
+
return m.$eq === null ? null : [typeOf(m.$eq)];
|
|
274
|
+
if (op === "$oneOf") {
|
|
275
|
+
const opts = Array.isArray(m.$oneOf) ? m.$oneOf : [];
|
|
276
|
+
const types = opts.map(typeOf);
|
|
277
|
+
return types.length === 0 || types.includes(null) ? null : [...new Set(types)].sort();
|
|
278
|
+
}
|
|
279
|
+
if (op === "$contains")
|
|
280
|
+
return ["array", "object", "string"];
|
|
281
|
+
if (op === "$regex")
|
|
282
|
+
return ["string"];
|
|
283
|
+
return ["number"];
|
|
284
|
+
};
|
|
285
|
+
// Every operator must hold, so the types it can match are those all of them allow.
|
|
286
|
+
let out = null;
|
|
287
|
+
for (const op of OPERATORS.filter((k) => k in m)) {
|
|
288
|
+
const t = typesOf(op);
|
|
289
|
+
if (t !== null)
|
|
290
|
+
out = out === null ? t : out.filter((x) => t.includes(x));
|
|
291
|
+
}
|
|
292
|
+
return out !== null && out.length > 0 ? out : null;
|
|
293
|
+
}
|
|
294
|
+
if (typeof want === "string")
|
|
295
|
+
return parseBand(want) ? ["number", "string"] : ["string"];
|
|
296
|
+
const t = typeOf(want);
|
|
297
|
+
return t === null ? null : [t];
|
|
298
|
+
}
|
|
299
|
+
/** The declared field an expectation's dot path falls under, and the path below it. */
|
|
300
|
+
function declaredFieldOf(path, fields) {
|
|
301
|
+
const exact = fields.find((f) => f.name === path);
|
|
302
|
+
if (exact)
|
|
303
|
+
return { field: exact, nested: false };
|
|
304
|
+
const top = path.split(".")[0];
|
|
305
|
+
const field = fields.find((f) => f.name === top);
|
|
306
|
+
return field ? { field, nested: true } : undefined;
|
|
307
|
+
}
|
|
308
|
+
function applicability(path, want, fields) {
|
|
309
|
+
const found = declaredFieldOf(path, fields);
|
|
310
|
+
if (!found)
|
|
311
|
+
return { ok: false, kind: "missing", field: path.split(".")[0] };
|
|
312
|
+
const declared = found.field.type;
|
|
313
|
+
// An untyped (or unknown-typed) field can hold anything.
|
|
314
|
+
if (!declared || !RESULT_FIELD_TYPES.has(declared))
|
|
315
|
+
return { ok: true };
|
|
316
|
+
const expected = found.nested ? ["array", "object"] : expectedTypesOf(want);
|
|
317
|
+
if (expected === null || expected.includes(declared))
|
|
318
|
+
return { ok: true };
|
|
319
|
+
return {
|
|
320
|
+
ok: false, kind: "typeChanged", field: found.field.name,
|
|
321
|
+
expectedType: found.nested ? "object" : expected.join(" or "), declaredType: declared,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* One `eval/field@1` score per expected field. With `resultFields` (the
|
|
326
|
+
* version's declared Result), an expectation the declaration rules out is
|
|
327
|
+
* n/a (`pass: null`) rather than a failure — see the file comment.
|
|
328
|
+
*/
|
|
329
|
+
export function scoreFields(expected, output, resultFields) {
|
|
330
|
+
if (!expected)
|
|
331
|
+
return [];
|
|
332
|
+
return Object.entries(expected).map(([field, want]) => {
|
|
333
|
+
const actual = readPathRaw(output ?? undefined, field);
|
|
334
|
+
const fit = resultFields ? applicability(field, want, resultFields) : { ok: true };
|
|
335
|
+
if (!fit.ok) {
|
|
336
|
+
return {
|
|
337
|
+
name: field,
|
|
338
|
+
value: scoreValue(actual),
|
|
339
|
+
pass: null,
|
|
340
|
+
scorer: FIELD_SCORER,
|
|
341
|
+
source: "eval",
|
|
342
|
+
detail: fit.kind === "missing"
|
|
343
|
+
? "not in this version's Result"
|
|
344
|
+
: `type changed: expected ${fit.expectedType}, Result declares ${fit.declaredType}`,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
const why = matchValue(want, actual);
|
|
348
|
+
return {
|
|
349
|
+
name: field,
|
|
350
|
+
value: scoreValue(actual),
|
|
351
|
+
pass: why === null,
|
|
352
|
+
scorer: FIELD_SCORER,
|
|
353
|
+
source: "eval",
|
|
354
|
+
...(why !== null ? { detail: why } : {}),
|
|
355
|
+
};
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
const LIMIT_METRIC = {
|
|
359
|
+
maxDurationMs: (m) => m.durationMs,
|
|
360
|
+
maxTokens: (m) => m.totalTokens,
|
|
361
|
+
maxSteps: (m) => m.steps,
|
|
362
|
+
maxCost: (m) => m.cost,
|
|
363
|
+
};
|
|
364
|
+
/** The limits in force for a case: the header's, each overridden by the case's own. */
|
|
365
|
+
export function effectiveLimits(header, c) {
|
|
366
|
+
return { ...(header?.limits ?? {}), ...(c.limits ?? {}) };
|
|
367
|
+
}
|
|
368
|
+
/** One `eval/limit@1` score per limit in force. A metric that was not measured is not judged. */
|
|
369
|
+
export function scoreLimits(limits, metrics) {
|
|
370
|
+
const out = [];
|
|
371
|
+
for (const [name, max] of Object.entries(limits)) {
|
|
372
|
+
if (max === undefined)
|
|
373
|
+
continue;
|
|
374
|
+
const value = LIMIT_METRIC[name](metrics);
|
|
375
|
+
out.push({
|
|
376
|
+
name: `limit.${name}`,
|
|
377
|
+
value,
|
|
378
|
+
pass: value === null ? null : value <= max,
|
|
379
|
+
scorer: LIMIT_SCORER,
|
|
380
|
+
source: "eval",
|
|
381
|
+
...(value !== null && value > max ? { detail: `${value} > ${max}` } : {}),
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
return out;
|
|
385
|
+
}
|
|
386
|
+
/** A case passes when every field score passes; null when there were none. Limits never count. */
|
|
387
|
+
export function casePass(scores) {
|
|
388
|
+
const fields = scores.filter((s) => s.scorer !== LIMIT_SCORER && s.pass !== null);
|
|
389
|
+
if (fields.length === 0)
|
|
390
|
+
return null;
|
|
391
|
+
return fields.every((s) => s.pass === true);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Whether a dataset's expectations fit a workflow version's declared Result —
|
|
395
|
+
* the check behind "2 dataset cases expect `priority`, which this version no
|
|
396
|
+
* longer returns". Fields are reported by their top-level name; each list is
|
|
397
|
+
* sorted.
|
|
398
|
+
*/
|
|
399
|
+
export function checkResultCompatibility(resultFields, cases) {
|
|
400
|
+
const missing = new Map();
|
|
401
|
+
const typeChanged = new Map();
|
|
402
|
+
const expectedTops = new Set();
|
|
403
|
+
for (const c of cases) {
|
|
404
|
+
for (const [path, want] of Object.entries(c.expected ?? {})) {
|
|
405
|
+
const found = declaredFieldOf(path, resultFields);
|
|
406
|
+
expectedTops.add(found?.field.name ?? path.split(".")[0]);
|
|
407
|
+
const fit = applicability(path, want, resultFields);
|
|
408
|
+
if (fit.ok)
|
|
409
|
+
continue;
|
|
410
|
+
if (fit.kind === "missing") {
|
|
411
|
+
if (!missing.has(fit.field))
|
|
412
|
+
missing.set(fit.field, new Set());
|
|
413
|
+
missing.get(fit.field).add(c.id);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
const k = `${fit.field}\u0000${fit.expectedType}`;
|
|
417
|
+
if (!typeChanged.has(k)) {
|
|
418
|
+
typeChanged.set(k, { expectedType: fit.expectedType, declaredType: fit.declaredType, caseIds: new Set() });
|
|
419
|
+
}
|
|
420
|
+
typeChanged.get(k).caseIds.add(c.id);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return {
|
|
425
|
+
missing: [...missing].map(([field, ids]) => ({ field, caseIds: [...ids].sort() }))
|
|
426
|
+
.sort((a, b) => a.field.localeCompare(b.field)),
|
|
427
|
+
typeChanged: [...typeChanged].map(([k, v]) => ({
|
|
428
|
+
field: k.split("\u0000")[0], expectedType: v.expectedType, declaredType: v.declaredType, caseIds: [...v.caseIds].sort(),
|
|
429
|
+
})).sort((a, b) => a.field.localeCompare(b.field) || a.expectedType.localeCompare(b.expectedType)),
|
|
430
|
+
unexpectedNew: resultFields.map((f) => f.name).filter((n) => !expectedTops.has(n)).sort(),
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
//# sourceMappingURL=score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score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