@attest-ai/vitest 0.9.0 → 1.0.0-rc.2
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/fixtures.d.ts +54 -6
- package/dist/fixtures.d.ts.map +1 -1
- package/dist/fixtures.js +130 -31
- package/dist/fixtures.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +6 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +21 -5
- package/dist/plugin.js.map +1 -1
- package/dist/report.d.ts +69 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +91 -0
- package/dist/report.js.map +1 -0
- package/dist/reporter.d.ts +38 -1
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +96 -1
- package/dist/reporter.js.map +1 -1
- package/dist/test-state.d.ts +100 -0
- package/dist/test-state.d.ts.map +1 -0
- package/dist/test-state.js +187 -0
- package/dist/test-state.js.map +1 -0
- package/dist/trials.d.ts +55 -0
- package/dist/trials.d.ts.map +1 -0
- package/dist/trials.js +184 -0
- package/dist/trials.js.map +1 -0
- package/package.json +11 -6
package/dist/trials.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { AgentResult, FailureClass, STATUS_HARD_FAIL, STATUS_NOT_EVALUATED, renderDiagnostics, } from "@attest-ai/core";
|
|
2
|
+
import { attemptMeta, attemptState, costBudgetSpent, runningTest, strictFromEnv, trialScope, validateBudget, } from "./test-state.js";
|
|
3
|
+
/** How attestGlobalSetup({ minPassRate }) reaches the workers that run trials(). */
|
|
4
|
+
export const MIN_PASS_RATE_ENV = "ATTEST_MIN_PASS_RATE";
|
|
5
|
+
function trialCount(n) {
|
|
6
|
+
const raw = n ?? Number(process.env["ATTEST_TRIALS"] ?? 1);
|
|
7
|
+
if (!Number.isInteger(raw) || raw < 1) {
|
|
8
|
+
const source = n === undefined ? `ATTEST_TRIALS=${process.env["ATTEST_TRIALS"]}` : `n=${n}`;
|
|
9
|
+
throw new Error(`trials(): N must be an integer >= 1, got ${source}`);
|
|
10
|
+
}
|
|
11
|
+
return raw;
|
|
12
|
+
}
|
|
13
|
+
/** A pass rate in [0, 1]; anything else is an error naming where it came from. */
|
|
14
|
+
export function validateMinPassRate(rate, source) {
|
|
15
|
+
if (!Number.isFinite(rate) || rate < 0 || rate > 1) {
|
|
16
|
+
throw new Error(`minPassRate must be a number between 0 and 1, got ${source}`);
|
|
17
|
+
}
|
|
18
|
+
return rate;
|
|
19
|
+
}
|
|
20
|
+
/** The run's minimum pass rate: ATTEST_MIN_PASS_RATE (set by attestGlobalSetup), else 1.0. */
|
|
21
|
+
function runMinPassRate() {
|
|
22
|
+
const raw = process.env[MIN_PASS_RATE_ENV];
|
|
23
|
+
if (raw === undefined)
|
|
24
|
+
return 1;
|
|
25
|
+
return validateMinPassRate(raw.trim() === "" ? Number.NaN : Number(raw), `${MIN_PASS_RATE_ENV}=${raw}`);
|
|
26
|
+
}
|
|
27
|
+
function describeError(error) {
|
|
28
|
+
return error instanceof Error ? `${error.name}: ${error.message}` : `${typeof error}: ${String(error)}`;
|
|
29
|
+
}
|
|
30
|
+
/** A trial's own outcome: raised or any hard_fail fails; else not_evaluated (or nothing evaluated) skips. */
|
|
31
|
+
function trialOutcome(trial) {
|
|
32
|
+
if (trial.error !== undefined)
|
|
33
|
+
return "fail";
|
|
34
|
+
const rows = trial.results.flatMap((r) => r.assertionResults);
|
|
35
|
+
if (rows.some((r) => r.status === STATUS_HARD_FAIL))
|
|
36
|
+
return "fail";
|
|
37
|
+
if (rows.length === 0)
|
|
38
|
+
return "skip";
|
|
39
|
+
if (rows.some((r) => r.status === STATUS_NOT_EVALUATED))
|
|
40
|
+
return "skip";
|
|
41
|
+
return "pass";
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Replace the rows of each trial that threw with exactly one hard_fail row per
|
|
45
|
+
* assertion ID of the test, so pass rates count the trial as failed once per ID.
|
|
46
|
+
* When the trial had evaluated the ID before throwing, the explanation keeps
|
|
47
|
+
* the engine's status.
|
|
48
|
+
*/
|
|
49
|
+
function thrownTrialRows(test, trials) {
|
|
50
|
+
const meta = attemptMeta(test);
|
|
51
|
+
const ids = [...new Set(trials.flatMap((t) => t.results.flatMap((r) => r.assertionResults)).map((r) => r.assertion_id))];
|
|
52
|
+
for (const trial of trials) {
|
|
53
|
+
if (trial.error === undefined)
|
|
54
|
+
continue;
|
|
55
|
+
const before = new Map(trial.results.flatMap((r) => r.assertionResults.map((row) => [row.assertion_id, row.status])));
|
|
56
|
+
meta.results = meta.results.filter((row) => row.trial !== trial.index);
|
|
57
|
+
const raised = `trial ${trial.index} raised ${describeError(trial.error.value)}`;
|
|
58
|
+
for (const id of ids) {
|
|
59
|
+
const status = before.get(id);
|
|
60
|
+
const row = {
|
|
61
|
+
assertion_id: id,
|
|
62
|
+
status: STATUS_HARD_FAIL,
|
|
63
|
+
score: 0,
|
|
64
|
+
explanation: status === undefined ? raised : `${raised} (engine status before the error: ${status})`,
|
|
65
|
+
failure_class: FailureClass.BrokenCode,
|
|
66
|
+
trial: trial.index,
|
|
67
|
+
};
|
|
68
|
+
meta.results.push(row);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function failureMessage(summary, trials, minPassRate) {
|
|
73
|
+
const rate = summary.passed / summary.evaluated;
|
|
74
|
+
const parts = [
|
|
75
|
+
`${summary.passed}/${summary.evaluated} trials passed (pass rate ${rate.toFixed(2)}) ` +
|
|
76
|
+
`below min pass rate ${minPassRate.toFixed(2)}`,
|
|
77
|
+
];
|
|
78
|
+
for (const trial of trials) {
|
|
79
|
+
if (trialOutcome(trial) !== "fail")
|
|
80
|
+
continue;
|
|
81
|
+
if (trial.error !== undefined) {
|
|
82
|
+
parts.push(`trial ${trial.index} raised ${describeError(trial.error.value)}`);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
for (const result of trial.results) {
|
|
86
|
+
if (result.hardFailures.length === 0)
|
|
87
|
+
continue;
|
|
88
|
+
parts.push(`trial ${trial.index}:${renderDiagnostics(result)}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return parts.join("\n");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Run `body` N times inside the current test (N = `options.n`, else the
|
|
95
|
+
* ATTEST_TRIALS environment variable, else 1) and enforce only the aggregate.
|
|
96
|
+
*
|
|
97
|
+
* With N = 1 the body runs once as a plain test body: evaluate() enforces as
|
|
98
|
+
* usual. With N > 1, during trial i (1-based): evaluate() does not enforce
|
|
99
|
+
* (it behaves as inspect()), enforceOutcome() returns its argument, every
|
|
100
|
+
* result row is reported with `trial = i`, and assertion IDs restart so each
|
|
101
|
+
* assertion keeps its ID across trials. A trial that throws counts as failed:
|
|
102
|
+
* its rows are replaced by one hard_fail row (failure_class broken_code) per
|
|
103
|
+
* assertion ID the test evaluated; when no trial evaluated anything, the first
|
|
104
|
+
* error is rethrown. A trial whose own outcome is skip counts as not evaluated,
|
|
105
|
+
* also under ATTEST_STRICT. After the last trial the test is skipped when no trial was
|
|
106
|
+
* evaluated (failed under ATTEST_STRICT), fails when passed / evaluated
|
|
107
|
+
* trials is below the minimum pass rate (default 1.0: any failing trial
|
|
108
|
+
* fails; not-evaluated trials are left out of the rate), and passes otherwise. AttestReporter prints "<test_id>: <passed>/<evaluated>
|
|
109
|
+
* trials passed (<n> not evaluated)".
|
|
110
|
+
*
|
|
111
|
+
* This is a pass/fail gate on N runs, not a statistical verdict: whether the
|
|
112
|
+
* pass rate regressed (pass / regressed / inconclusive) comes from
|
|
113
|
+
* `attest policy evaluate --baseline <tag>` with a `regression` rule over the
|
|
114
|
+
* report's per-trial rows.
|
|
115
|
+
*/
|
|
116
|
+
export async function trials(body, options) {
|
|
117
|
+
const n = trialCount(options?.n);
|
|
118
|
+
const minPassRate = options?.minPassRate === undefined
|
|
119
|
+
? runMinPassRate()
|
|
120
|
+
: validateMinPassRate(options.minPassRate, `minPassRate=${options.minPassRate}`);
|
|
121
|
+
const budget = options?.budget === undefined ? undefined : validateBudget(options.budget);
|
|
122
|
+
const test = options?.context?.task ?? (await runningTest());
|
|
123
|
+
if (test === undefined)
|
|
124
|
+
throw new Error("trials() must be called inside a test");
|
|
125
|
+
if (options?.context === undefined && test.concurrent === true) {
|
|
126
|
+
throw new Error("trials() in a test.concurrent test — pass the test context: trials(body, { context })");
|
|
127
|
+
}
|
|
128
|
+
if (n === 1) {
|
|
129
|
+
await trialScope.run({ test, trial: undefined, budget, results: [] }, () => body(1));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const state = attemptState(test);
|
|
133
|
+
const records = [];
|
|
134
|
+
let stoppedByBudget = false;
|
|
135
|
+
for (let index = 1; index <= n; index++) {
|
|
136
|
+
if (index > 1 && costBudgetSpent(budget, state)) {
|
|
137
|
+
stoppedByBudget = true;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
state.ordinal = 0;
|
|
141
|
+
const record = { index, results: [], error: undefined };
|
|
142
|
+
records.push(record);
|
|
143
|
+
try {
|
|
144
|
+
await trialScope.run({ test, trial: index, budget, results: record.results }, () => body(index));
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
record.error = { value: error };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const evaluatedAny = records.some((r) => r.results.some((res) => res.assertionResults.length > 0));
|
|
151
|
+
const firstError = records.find((r) => r.error !== undefined)?.error;
|
|
152
|
+
if (!evaluatedAny && firstError !== undefined)
|
|
153
|
+
throw firstError.value;
|
|
154
|
+
thrownTrialRows(test, records);
|
|
155
|
+
const strict = strictFromEnv();
|
|
156
|
+
const outcomes = records.map((r) => trialOutcome(r));
|
|
157
|
+
const passed = outcomes.filter((o) => o === "pass").length;
|
|
158
|
+
const failed = outcomes.filter((o) => o === "fail").length;
|
|
159
|
+
const summary = {
|
|
160
|
+
requested: n,
|
|
161
|
+
run: records.length,
|
|
162
|
+
passed,
|
|
163
|
+
evaluated: passed + failed,
|
|
164
|
+
notEvaluated: outcomes.length - passed - failed,
|
|
165
|
+
stoppedByBudget,
|
|
166
|
+
};
|
|
167
|
+
attemptMeta(test).trials = summary;
|
|
168
|
+
if (summary.evaluated === 0) {
|
|
169
|
+
const all = records.flatMap((r) => r.results);
|
|
170
|
+
const rows = all.flatMap((r) => r.assertionResults);
|
|
171
|
+
const first = all[0];
|
|
172
|
+
const reason = first === undefined || rows.length === 0
|
|
173
|
+
? `not evaluated: no assertions in ${records.length} trials`
|
|
174
|
+
: new AgentResult(first.trace, rows).skipReason();
|
|
175
|
+
if (strict)
|
|
176
|
+
throw new Error(`strict: ${reason}`);
|
|
177
|
+
(options?.context ?? test.context).skip(reason);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (passed / summary.evaluated < minPassRate) {
|
|
181
|
+
throw new Error(failureMessage(summary, records, minPassRate));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=trials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trials.js","sourceRoot":"","sources":["../src/trials.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,UAAU,EACV,cAAc,GAGf,MAAM,iBAAiB,CAAC;AAEzB,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAiCxD,SAAS,UAAU,CAAC,CAAqB;IACvC,MAAM,GAAG,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CA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;IAEnC,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,MAAM,GACV,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YACtC,CAAC,CAAC,mCAAmC,OAAO,CAAC,MAAM,SAAS;YAC5D,CAAC,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;QACtD,IAAI,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC;QACjD,CAAC,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO;IACT,CAAC;IACD,IAAI,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,WAAW,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attest-ai/vitest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"description": "Attest vitest integration — global setup, fixtures, cost reporter, tier filtering",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"./setup": {
|
|
14
14
|
"import": "./dist/plugin.js",
|
|
15
15
|
"types": "./dist/plugin.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./reporter": {
|
|
18
|
+
"import": "./dist/reporter.js",
|
|
19
|
+
"types": "./dist/reporter.d.ts"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"files": [
|
|
@@ -38,14 +42,15 @@
|
|
|
38
42
|
"attest"
|
|
39
43
|
],
|
|
40
44
|
"peerDependencies": {
|
|
41
|
-
"@attest-ai/core": ">=0.
|
|
42
|
-
"vitest": ">=
|
|
45
|
+
"@attest-ai/core": ">=1.0.0-rc",
|
|
46
|
+
"vitest": ">=3.0.0"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
|
-
"@types/node": "^
|
|
49
|
+
"@types/node": "^26.1.2",
|
|
50
|
+
"ajv": "^8.20.0",
|
|
46
51
|
"typescript": "^5.9.3",
|
|
47
|
-
"vitest": "^4.1.
|
|
48
|
-
"@attest-ai/core": "0.
|
|
52
|
+
"vitest": "^4.1.10",
|
|
53
|
+
"@attest-ai/core": "1.0.0-rc.2"
|
|
49
54
|
},
|
|
50
55
|
"scripts": {
|
|
51
56
|
"build": "tsc",
|