@plumloom/cli 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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +71 -0
- package/dist/actions/configured-runs.d.ts +25 -0
- package/dist/actions/configured-runs.d.ts.map +1 -0
- package/dist/actions/configured-runs.js +35 -0
- package/dist/actions/configured-runs.js.map +1 -0
- package/dist/actions/context.d.ts +5 -0
- package/dist/actions/context.d.ts.map +1 -0
- package/dist/actions/context.js +2 -0
- package/dist/actions/context.js.map +1 -0
- package/dist/actions/doctor.d.ts +46 -0
- package/dist/actions/doctor.d.ts.map +1 -0
- package/dist/actions/doctor.js +130 -0
- package/dist/actions/doctor.js.map +1 -0
- package/dist/actions/evaluations.d.ts +87 -0
- package/dist/actions/evaluations.d.ts.map +1 -0
- package/dist/actions/evaluations.js +307 -0
- package/dist/actions/evaluations.js.map +1 -0
- package/dist/actions/gate.d.ts +63 -0
- package/dist/actions/gate.d.ts.map +1 -0
- package/dist/actions/gate.js +272 -0
- package/dist/actions/gate.js.map +1 -0
- package/dist/actions/identity.d.ts +4 -0
- package/dist/actions/identity.d.ts.map +1 -0
- package/dist/actions/identity.js +4 -0
- package/dist/actions/identity.js.map +1 -0
- package/dist/actions/models.d.ts +4 -0
- package/dist/actions/models.d.ts.map +1 -0
- package/dist/actions/models.js +4 -0
- package/dist/actions/models.js.map +1 -0
- package/dist/actions/quality-standards.d.ts +30 -0
- package/dist/actions/quality-standards.d.ts.map +1 -0
- package/dist/actions/quality-standards.js +86 -0
- package/dist/actions/quality-standards.js.map +1 -0
- package/dist/actions/results.d.ts +12 -0
- package/dist/actions/results.d.ts.map +1 -0
- package/dist/actions/results.js +65 -0
- package/dist/actions/results.js.map +1 -0
- package/dist/actions/runs.d.ts +22 -0
- package/dist/actions/runs.d.ts.map +1 -0
- package/dist/actions/runs.js +59 -0
- package/dist/actions/runs.js.map +1 -0
- package/dist/actions/suite-gate.d.ts +24 -0
- package/dist/actions/suite-gate.d.ts.map +1 -0
- package/dist/actions/suite-gate.js +40 -0
- package/dist/actions/suite-gate.js.map +1 -0
- package/dist/actions/suite.d.ts +49 -0
- package/dist/actions/suite.d.ts.map +1 -0
- package/dist/actions/suite.js +68 -0
- package/dist/actions/suite.js.map +1 -0
- package/dist/actions/validation.d.ts +3 -0
- package/dist/actions/validation.d.ts.map +1 -0
- package/dist/actions/validation.js +26 -0
- package/dist/actions/validation.js.map +1 -0
- package/dist/actions/workspaces.d.ts +13 -0
- package/dist/actions/workspaces.d.ts.map +1 -0
- package/dist/actions/workspaces.js +18 -0
- package/dist/actions/workspaces.js.map +1 -0
- package/dist/api/api.d.ts +237 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +396 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/client.d.ts +38 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +295 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/endpoints.d.ts +31 -0
- package/dist/api/endpoints.d.ts.map +1 -0
- package/dist/api/endpoints.js +32 -0
- package/dist/api/endpoints.js.map +1 -0
- package/dist/api/errors.d.ts +22 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +84 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/schemas.d.ts +169 -0
- package/dist/api/schemas.d.ts.map +1 -0
- package/dist/api/schemas.js +194 -0
- package/dist/api/schemas.js.map +1 -0
- package/dist/auth/credential-store.d.ts +9 -0
- package/dist/auth/credential-store.d.ts.map +1 -0
- package/dist/auth/credential-store.js +2 -0
- package/dist/auth/credential-store.js.map +1 -0
- package/dist/auth/credentials.d.ts +27 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +81 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/keyring-store.d.ts +9 -0
- package/dist/auth/keyring-store.d.ts.map +1 -0
- package/dist/auth/keyring-store.js +57 -0
- package/dist/auth/keyring-store.js.map +1 -0
- package/dist/auth/login.d.ts +28 -0
- package/dist/auth/login.d.ts.map +1 -0
- package/dist/auth/login.js +27 -0
- package/dist/auth/login.js.map +1 -0
- package/dist/auth/password-prompt.d.ts +5 -0
- package/dist/auth/password-prompt.d.ts.map +1 -0
- package/dist/auth/password-prompt.js +10 -0
- package/dist/auth/password-prompt.js.map +1 -0
- package/dist/auth/redact.d.ts +3 -0
- package/dist/auth/redact.d.ts.map +1 -0
- package/dist/auth/redact.js +69 -0
- package/dist/auth/redact.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/executor.d.ts +36 -0
- package/dist/commands/executor.d.ts.map +1 -0
- package/dist/commands/executor.js +1218 -0
- package/dist/commands/executor.js.map +1 -0
- package/dist/commands/program.d.ts +21 -0
- package/dist/commands/program.d.ts.map +1 -0
- package/dist/commands/program.js +588 -0
- package/dist/commands/program.js.map +1 -0
- package/dist/commands/types.d.ts +139 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +2 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/configured-run/file-inputs.d.ts +8 -0
- package/dist/configured-run/file-inputs.d.ts.map +1 -0
- package/dist/configured-run/file-inputs.js +160 -0
- package/dist/configured-run/file-inputs.js.map +1 -0
- package/dist/configured-run/validation.d.ts +103 -0
- package/dist/configured-run/validation.d.ts.map +1 -0
- package/dist/configured-run/validation.js +327 -0
- package/dist/configured-run/validation.js.map +1 -0
- package/dist/domain/common.d.ts +6 -0
- package/dist/domain/common.d.ts.map +1 -0
- package/dist/domain/common.js +10 -0
- package/dist/domain/common.js.map +1 -0
- package/dist/domain/types.d.ts +117 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +2 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/errors/autoeval-error.d.ts +13 -0
- package/dist/errors/autoeval-error.d.ts.map +1 -0
- package/dist/errors/autoeval-error.js +36 -0
- package/dist/errors/autoeval-error.js.map +1 -0
- package/dist/errors/hints.d.ts +3 -0
- package/dist/errors/hints.d.ts.map +1 -0
- package/dist/errors/hints.js +43 -0
- package/dist/errors/hints.js.map +1 -0
- package/dist/gate/decision.d.ts +97 -0
- package/dist/gate/decision.d.ts.map +1 -0
- package/dist/gate/decision.js +436 -0
- package/dist/gate/decision.js.map +1 -0
- package/dist/gate/policy.d.ts +31 -0
- package/dist/gate/policy.d.ts.map +1 -0
- package/dist/gate/policy.js +26 -0
- package/dist/gate/policy.js.map +1 -0
- package/dist/guide/eval-creation-backend.d.ts +20 -0
- package/dist/guide/eval-creation-backend.d.ts.map +1 -0
- package/dist/guide/eval-creation-backend.js +16 -0
- package/dist/guide/eval-creation-backend.js.map +1 -0
- package/dist/guide/eval-guide.d.ts +24 -0
- package/dist/guide/eval-guide.d.ts.map +1 -0
- package/dist/guide/eval-guide.js +219 -0
- package/dist/guide/eval-guide.js.map +1 -0
- package/dist/mcp/context.d.ts +21 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/context.js +19 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/schemas.d.ts +206 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +80 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +10 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +42 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +287 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp.d.ts +3 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +32 -0
- package/dist/mcp.js.map +1 -0
- package/dist/output/big-digits.d.ts +7 -0
- package/dist/output/big-digits.d.ts.map +1 -0
- package/dist/output/big-digits.js +43 -0
- package/dist/output/big-digits.js.map +1 -0
- package/dist/output/clipboard.d.ts +29 -0
- package/dist/output/clipboard.d.ts.map +1 -0
- package/dist/output/clipboard.js +82 -0
- package/dist/output/clipboard.js.map +1 -0
- package/dist/output/colors.d.ts +21 -0
- package/dist/output/colors.d.ts.map +1 -0
- package/dist/output/colors.js +21 -0
- package/dist/output/colors.js.map +1 -0
- package/dist/output/digest.d.ts +165 -0
- package/dist/output/digest.d.ts.map +1 -0
- package/dist/output/digest.js +771 -0
- package/dist/output/digest.js.map +1 -0
- package/dist/output/human.d.ts +95 -0
- package/dist/output/human.d.ts.map +1 -0
- package/dist/output/human.js +643 -0
- package/dist/output/human.js.map +1 -0
- package/dist/output/json.d.ts +2 -0
- package/dist/output/json.d.ts.map +1 -0
- package/dist/output/json.js +5 -0
- package/dist/output/json.js.map +1 -0
- package/dist/output/layout.d.ts +18 -0
- package/dist/output/layout.d.ts.map +1 -0
- package/dist/output/layout.js +64 -0
- package/dist/output/layout.js.map +1 -0
- package/dist/output/markdown.d.ts +16 -0
- package/dist/output/markdown.d.ts.map +1 -0
- package/dist/output/markdown.js +38 -0
- package/dist/output/markdown.js.map +1 -0
- package/dist/output/progress.d.ts +29 -0
- package/dist/output/progress.d.ts.map +1 -0
- package/dist/output/progress.js +136 -0
- package/dist/output/progress.js.map +1 -0
- package/dist/output/safe-text.d.ts +11 -0
- package/dist/output/safe-text.d.ts.map +1 -0
- package/dist/output/safe-text.js +44 -0
- package/dist/output/safe-text.js.map +1 -0
- package/dist/output/scorecard.d.ts +23 -0
- package/dist/output/scorecard.d.ts.map +1 -0
- package/dist/output/scorecard.js +506 -0
- package/dist/output/scorecard.js.map +1 -0
- package/dist/output/section.d.ts +15 -0
- package/dist/output/section.d.ts.map +1 -0
- package/dist/output/section.js +44 -0
- package/dist/output/section.js.map +1 -0
- package/dist/output/spinner.d.ts +24 -0
- package/dist/output/spinner.d.ts.map +1 -0
- package/dist/output/spinner.js +34 -0
- package/dist/output/spinner.js.map +1 -0
- package/dist/output/splash.d.ts +37 -0
- package/dist/output/splash.d.ts.map +1 -0
- package/dist/output/splash.js +169 -0
- package/dist/output/splash.js.map +1 -0
- package/dist/output/table.d.ts +33 -0
- package/dist/output/table.d.ts.map +1 -0
- package/dist/output/table.js +105 -0
- package/dist/output/table.js.map +1 -0
- package/dist/output/trend.d.ts +19 -0
- package/dist/output/trend.d.ts.map +1 -0
- package/dist/output/trend.js +38 -0
- package/dist/output/trend.js.map +1 -0
- package/dist/output/writer.d.ts +14 -0
- package/dist/output/writer.d.ts.map +1 -0
- package/dist/output/writer.js +33 -0
- package/dist/output/writer.js.map +1 -0
- package/dist/polling/clock.d.ts +9 -0
- package/dist/polling/clock.d.ts.map +1 -0
- package/dist/polling/clock.js +23 -0
- package/dist/polling/clock.js.map +1 -0
- package/dist/polling/wait-for-result.d.ts +16 -0
- package/dist/polling/wait-for-result.d.ts.map +1 -0
- package/dist/polling/wait-for-result.js +29 -0
- package/dist/polling/wait-for-result.js.map +1 -0
- package/dist/polling/wait-for-run.d.ts +14 -0
- package/dist/polling/wait-for-run.d.ts.map +1 -0
- package/dist/polling/wait-for-run.js +36 -0
- package/dist/polling/wait-for-run.js.map +1 -0
- package/dist/quickstart/prompt.d.ts +18 -0
- package/dist/quickstart/prompt.d.ts.map +1 -0
- package/dist/quickstart/prompt.js +37 -0
- package/dist/quickstart/prompt.js.map +1 -0
- package/dist/quickstart/sample.d.ts +28 -0
- package/dist/quickstart/sample.d.ts.map +1 -0
- package/dist/quickstart/sample.js +235 -0
- package/dist/quickstart/sample.js.map +1 -0
- package/dist/quickstart/selection.d.ts +53 -0
- package/dist/quickstart/selection.d.ts.map +1 -0
- package/dist/quickstart/selection.js +97 -0
- package/dist/quickstart/selection.js.map +1 -0
- package/dist/run.d.ts +28 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +134 -0
- package/dist/run.js.map +1 -0
- package/dist/runtime/action-context.d.ts +19 -0
- package/dist/runtime/action-context.d.ts.map +1 -0
- package/dist/runtime/action-context.js +40 -0
- package/dist/runtime/action-context.js.map +1 -0
- package/dist/suite/execution.d.ts +46 -0
- package/dist/suite/execution.d.ts.map +1 -0
- package/dist/suite/execution.js +97 -0
- package/dist/suite/execution.js.map +1 -0
- package/dist/suite/manifest.d.ts +16 -0
- package/dist/suite/manifest.d.ts.map +1 -0
- package/dist/suite/manifest.js +92 -0
- package/dist/suite/manifest.js.map +1 -0
- package/dist/suite/reporting.d.ts +35 -0
- package/dist/suite/reporting.d.ts.map +1 -0
- package/dist/suite/reporting.js +131 -0
- package/dist/suite/reporting.js.map +1 -0
- package/dist/trace/deepseek-harness.d.ts +31 -0
- package/dist/trace/deepseek-harness.d.ts.map +1 -0
- package/dist/trace/deepseek-harness.js +412 -0
- package/dist/trace/deepseek-harness.js.map +1 -0
- package/dist/trace/import.d.ts +9 -0
- package/dist/trace/import.d.ts.map +1 -0
- package/dist/trace/import.js +45 -0
- package/dist/trace/import.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +82 -0
package/dist/run.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { CommanderError } from 'commander';
|
|
2
|
+
import { validateCliKey } from './auth/credentials.js';
|
|
3
|
+
import { KeyringCredentialStore } from './auth/keyring-store.js';
|
|
4
|
+
import { redactText } from './auth/redact.js';
|
|
5
|
+
import { RuntimeCommandExecutor } from './commands/executor.js';
|
|
6
|
+
import { configureSafeProgramOutput, createProgram, normalizeGlobalCliFlags, } from './commands/program.js';
|
|
7
|
+
import { loadConfiguration } from './config.js';
|
|
8
|
+
import { asAutoevalError } from './errors/autoeval-error.js';
|
|
9
|
+
import { hintForError } from './errors/hints.js';
|
|
10
|
+
import { OutputWriter } from './output/writer.js';
|
|
11
|
+
import { renderSplash, renderWelcome, resolveColorMode, resolveBoltSize, shouldShowSplash, supportsUnicode, } from './output/splash.js';
|
|
12
|
+
import { CLI_VERSION } from './version.js';
|
|
13
|
+
function hasPrimaryCommand(userArgs) {
|
|
14
|
+
for (const token of userArgs) {
|
|
15
|
+
if (token === '--')
|
|
16
|
+
return false;
|
|
17
|
+
if (token.startsWith('-'))
|
|
18
|
+
continue;
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
function hasRootHelpFlag(userArgs) {
|
|
24
|
+
for (const token of userArgs) {
|
|
25
|
+
if (token === '--')
|
|
26
|
+
return false;
|
|
27
|
+
if (token === '--help' || token === '-h')
|
|
28
|
+
return true;
|
|
29
|
+
if (!token.startsWith('-'))
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
function hasJsonFlag(userArgs) {
|
|
35
|
+
return userArgs.includes('--json');
|
|
36
|
+
}
|
|
37
|
+
export function shouldRenderCliSplash(argv, io, environment) {
|
|
38
|
+
const userArgs = argv.slice(2);
|
|
39
|
+
const rootInteractive = !hasPrimaryCommand(userArgs) && (userArgs.length === 0 || hasRootHelpFlag(userArgs));
|
|
40
|
+
return shouldShowSplash({
|
|
41
|
+
interactive: rootInteractive,
|
|
42
|
+
json: hasJsonFlag(userArgs),
|
|
43
|
+
stdinIsTTY: io.stdinIsTTY,
|
|
44
|
+
stdoutIsTTY: io.stdoutIsTTY,
|
|
45
|
+
stderrIsTTY: io.stderrIsTTY,
|
|
46
|
+
environment,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async function resolveSplashSignedIn(environment, apiOrigin) {
|
|
50
|
+
const environmentKey = environment.AUTOEVAL_API_KEY;
|
|
51
|
+
if (environmentKey !== undefined && environmentKey.trim() !== '') {
|
|
52
|
+
try {
|
|
53
|
+
validateCliKey(environmentKey);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
const storedKey = await new KeyringCredentialStore(apiOrigin).read();
|
|
62
|
+
if (storedKey === undefined || storedKey.trim() === '')
|
|
63
|
+
return false;
|
|
64
|
+
validateCliKey(storedKey);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Builds and runs the CLI program, translating thrown errors into redacted
|
|
73
|
+
* output and process exit codes.
|
|
74
|
+
*/
|
|
75
|
+
export async function runCli(options = {}) {
|
|
76
|
+
const abortController = new AbortController();
|
|
77
|
+
const onInterrupt = () => abortController.abort(new Error('interrupted'));
|
|
78
|
+
const onTerminate = () => abortController.abort(new Error('terminated'));
|
|
79
|
+
process.once('SIGINT', onInterrupt);
|
|
80
|
+
process.once('SIGTERM', onTerminate);
|
|
81
|
+
const writer = new OutputWriter(process.stdout, process.stderr);
|
|
82
|
+
const sourceArgv = [...(options.argv ?? process.argv)];
|
|
83
|
+
const argv = [...sourceArgv.slice(0, 2), ...normalizeGlobalCliFlags(sourceArgv.slice(2))];
|
|
84
|
+
const environment = process.env;
|
|
85
|
+
try {
|
|
86
|
+
const configuration = loadConfiguration();
|
|
87
|
+
const commandExecutor = new RuntimeCommandExecutor({
|
|
88
|
+
configuration,
|
|
89
|
+
signal: abortController.signal,
|
|
90
|
+
});
|
|
91
|
+
const extensions = options.extend
|
|
92
|
+
? await options.extend({
|
|
93
|
+
configuration,
|
|
94
|
+
commandExecutor,
|
|
95
|
+
signal: abortController.signal,
|
|
96
|
+
})
|
|
97
|
+
: [];
|
|
98
|
+
const program = createProgram(commandExecutor, extensions);
|
|
99
|
+
configureSafeProgramOutput(program, process.stdout, process.stderr);
|
|
100
|
+
if (shouldRenderCliSplash(argv, {
|
|
101
|
+
stdinIsTTY: process.stdin.isTTY,
|
|
102
|
+
stdoutIsTTY: process.stdout.isTTY,
|
|
103
|
+
stderrIsTTY: process.stderr.isTTY,
|
|
104
|
+
}, environment)) {
|
|
105
|
+
const signedIn = await resolveSplashSignedIn(environment, configuration.apiBaseUrl.origin);
|
|
106
|
+
const unicode = supportsUnicode(environment);
|
|
107
|
+
const splashContext = {
|
|
108
|
+
version: CLI_VERSION,
|
|
109
|
+
signedIn,
|
|
110
|
+
colorMode: resolveColorMode(environment),
|
|
111
|
+
unicode,
|
|
112
|
+
boltSize: resolveBoltSize(environment, unicode),
|
|
113
|
+
};
|
|
114
|
+
process.stderr.write(renderSplash(splashContext));
|
|
115
|
+
if (argv.slice(2).length === 0) {
|
|
116
|
+
process.stderr.write(`${renderWelcome(splashContext)}\n`);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
await program.parseAsync(argv);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
if (error instanceof CommanderError) {
|
|
124
|
+
if (error.code === 'commander.helpDisplayed' || error.code === 'commander.version')
|
|
125
|
+
return;
|
|
126
|
+
process.exitCode = error.exitCode;
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const normalized = asAutoevalError(error);
|
|
130
|
+
writer.writeError(redactText(normalized.message), hasJsonFlag(argv.slice(2)), normalized.code, hintForError(normalized));
|
|
131
|
+
process.exitCode = normalized.exitCode;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,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C,QAAQ,CAAC;YAClC,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,UAAU,CACf,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAC9B,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC1B,UAAU,CAAC,IAAI,EACf,YAAY,CAAC,UAAU,CAAC,CACzB,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IACzC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ActionContext } from '../actions/context.js';
|
|
2
|
+
import type { CredentialStore } from '../auth/credential-store.js';
|
|
3
|
+
import type { AutoevalConfiguration } from '../config.js';
|
|
4
|
+
import { type FetchImplementation, type ApiDiagnostic } from '../api/client.js';
|
|
5
|
+
export type ApiActionContextInput = {
|
|
6
|
+
configuration: AutoevalConfiguration;
|
|
7
|
+
apiKey: string;
|
|
8
|
+
fetchImplementation?: FetchImplementation;
|
|
9
|
+
onDiagnostic?: (diagnostic: ApiDiagnostic) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function createApiActionContext(input: ApiActionContextInput): ActionContext;
|
|
12
|
+
export declare function createAuthenticatedActionContext(input: {
|
|
13
|
+
configuration: AutoevalConfiguration;
|
|
14
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
15
|
+
store?: CredentialStore;
|
|
16
|
+
fetchImplementation?: FetchImplementation;
|
|
17
|
+
onDiagnostic?: (diagnostic: ApiDiagnostic) => void;
|
|
18
|
+
}): Promise<ActionContext>;
|
|
19
|
+
//# sourceMappingURL=action-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-context.d.ts","sourceRoot":"","sources":["../../src/runtime/action-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,6BAA6B,CAAC;AAGjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAa,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAY3F,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,qBAAqB,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,aAAa,CAalF;AAED,wBAAsB,gCAAgC,CAAC,KAAK,EAAE;IAC5D,aAAa,EAAE,qBAAqB,CAAC;IACrC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,IAAI,CAAC;CACpD,GAAG,OAAO,CAAC,aAAa,CAAC,CAgBzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { resolveCredential } from '../auth/credentials.js';
|
|
2
|
+
import { KeyringCredentialStore } from '../auth/keyring-store.js';
|
|
3
|
+
import { AutoevalError } from '../errors/autoeval-error.js';
|
|
4
|
+
import { AutoevalApiClient } from '../api/api.js';
|
|
5
|
+
import { ApiClient } from '../api/client.js';
|
|
6
|
+
const nonInteractivePrompt = {
|
|
7
|
+
request: () => Promise.reject(new AutoevalError('Interactive credential prompts are unavailable in this runtime.', {
|
|
8
|
+
kind: 'authentication',
|
|
9
|
+
code: 'CREDENTIAL_REQUIRED',
|
|
10
|
+
})),
|
|
11
|
+
};
|
|
12
|
+
export function createApiActionContext(input) {
|
|
13
|
+
return {
|
|
14
|
+
api: new AutoevalApiClient(new ApiClient({
|
|
15
|
+
baseUrl: input.configuration.apiBaseUrl,
|
|
16
|
+
apiKey: input.apiKey,
|
|
17
|
+
requestTimeoutMs: input.configuration.requestTimeoutMs,
|
|
18
|
+
maxResponseBytes: input.configuration.maxResponseBytes,
|
|
19
|
+
...(input.fetchImplementation ? { fetchImplementation: input.fetchImplementation } : {}),
|
|
20
|
+
...(input.onDiagnostic ? { onDiagnostic: input.onDiagnostic } : {}),
|
|
21
|
+
})),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export async function createAuthenticatedActionContext(input) {
|
|
25
|
+
const environment = input.environment ?? process.env;
|
|
26
|
+
const store = input.store ?? new KeyringCredentialStore(input.configuration.apiBaseUrl.origin);
|
|
27
|
+
const credential = await resolveCredential({
|
|
28
|
+
environment,
|
|
29
|
+
store,
|
|
30
|
+
prompt: nonInteractivePrompt,
|
|
31
|
+
allowPrompt: false,
|
|
32
|
+
});
|
|
33
|
+
return createApiActionContext({
|
|
34
|
+
configuration: input.configuration,
|
|
35
|
+
apiKey: credential.apiKey,
|
|
36
|
+
...(input.fetchImplementation ? { fetchImplementation: input.fetchImplementation } : {}),
|
|
37
|
+
...(input.onDiagnostic ? { onDiagnostic: input.onDiagnostic } : {}),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=action-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-context.js","sourceRoot":"","sources":["../../src/runtime/action-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAA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AC;IAEH,OAAO,sBAAsB,CAAC;QAC5B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PollClock } from '../polling/clock.js';
|
|
2
|
+
/**
|
|
3
|
+
* Two-plane suite execution.
|
|
4
|
+
*
|
|
5
|
+
* Plane 1 (execution) runs evals with bounded concurrency and an optional
|
|
6
|
+
* start stagger. A slot is occupied only while an eval is executing: the moment
|
|
7
|
+
* an eval reaches a terminal execution state the slot is released and the next
|
|
8
|
+
* queued eval starts.
|
|
9
|
+
*
|
|
10
|
+
* Plane 2 (results) fetches and normalizes results for evals that already
|
|
11
|
+
* finished, concurrently with evals that are still executing. It has its own
|
|
12
|
+
* concurrency budget and never occupies an execution slot.
|
|
13
|
+
*
|
|
14
|
+
* A failure in either plane is recorded against that eval only; the remaining
|
|
15
|
+
* evals keep going.
|
|
16
|
+
*/
|
|
17
|
+
export type SuiteEvalStatus = 'completed' | 'execution_failed' | 'result_failed';
|
|
18
|
+
export type SuiteItem = {
|
|
19
|
+
index: number;
|
|
20
|
+
inputFile: string;
|
|
21
|
+
};
|
|
22
|
+
export type SuiteEvalRecord<TExecution, TResults> = {
|
|
23
|
+
index: number;
|
|
24
|
+
inputFile: string;
|
|
25
|
+
status: SuiteEvalStatus;
|
|
26
|
+
execution?: TExecution;
|
|
27
|
+
results?: TResults;
|
|
28
|
+
error?: string;
|
|
29
|
+
};
|
|
30
|
+
export type TwoPlaneSuiteInput<TExecution, TResults> = {
|
|
31
|
+
inputFiles: readonly string[];
|
|
32
|
+
/** Maximum evals executing at the same time. */
|
|
33
|
+
executionConcurrency: number;
|
|
34
|
+
/** Maximum result fetches at the same time. Defaults to the execution budget. */
|
|
35
|
+
resultConcurrency?: number;
|
|
36
|
+
/** Delay applied between successive execution starts. */
|
|
37
|
+
staggerMs: number;
|
|
38
|
+
clock: PollClock;
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
/** Create + run + poll one eval to a terminal execution state. */
|
|
41
|
+
execute: (item: SuiteItem) => Promise<TExecution>;
|
|
42
|
+
/** Fetch and normalize results for a terminal eval. */
|
|
43
|
+
fetchResults: (execution: TExecution, item: SuiteItem) => Promise<TResults>;
|
|
44
|
+
};
|
|
45
|
+
export declare function runTwoPlaneSuite<TExecution, TResults>(input: TwoPlaneSuiteInput<TExecution, TResults>): Promise<SuiteEvalRecord<TExecution, TResults>[]>;
|
|
46
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/suite/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEjF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,UAAU,EAAE,QAAQ,IAAI;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,UAAU,EAAE,QAAQ,IAAI;IACrD,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,gDAAgD;IAChD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kEAAkE;IAClE,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,uDAAuD;IACvD,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC7E,CAAC;AAqBF,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,QAAQ,EACzD,KAAK,EAAE,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,GAC9C,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAgFlD"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function describeError(error) {
|
|
2
|
+
if (error instanceof Error && error.message.trim() !== '')
|
|
3
|
+
return error.message;
|
|
4
|
+
return String(error);
|
|
5
|
+
}
|
|
6
|
+
/** Bounded worker pool over a shared queue of tasks. */
|
|
7
|
+
async function drain(taskCount, workers, run) {
|
|
8
|
+
let next = 0;
|
|
9
|
+
const worker = async () => {
|
|
10
|
+
while (true) {
|
|
11
|
+
const index = next;
|
|
12
|
+
if (index >= taskCount)
|
|
13
|
+
return;
|
|
14
|
+
next += 1;
|
|
15
|
+
await run(index);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
await Promise.all(Array.from({ length: Math.max(1, Math.min(workers, taskCount)) }, worker));
|
|
19
|
+
}
|
|
20
|
+
export async function runTwoPlaneSuite(input) {
|
|
21
|
+
const items = input.inputFiles.map((inputFile, index) => ({ index, inputFile }));
|
|
22
|
+
const records = items.map((item) => ({
|
|
23
|
+
index: item.index,
|
|
24
|
+
inputFile: item.inputFile,
|
|
25
|
+
status: 'execution_failed',
|
|
26
|
+
error: 'Eval did not start.',
|
|
27
|
+
}));
|
|
28
|
+
// Results plane: its own bounded pool, fed as evals reach terminal state.
|
|
29
|
+
const resultBudget = Math.max(1, input.resultConcurrency ?? input.executionConcurrency);
|
|
30
|
+
let activeResultFetches = 0;
|
|
31
|
+
const resultWaiters = [];
|
|
32
|
+
const resultFetches = [];
|
|
33
|
+
const acquireResultSlot = async () => {
|
|
34
|
+
if (activeResultFetches < resultBudget) {
|
|
35
|
+
activeResultFetches += 1;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
await new Promise((resolveWaiter) => resultWaiters.push(resolveWaiter));
|
|
39
|
+
activeResultFetches += 1;
|
|
40
|
+
};
|
|
41
|
+
const releaseResultSlot = () => {
|
|
42
|
+
activeResultFetches -= 1;
|
|
43
|
+
resultWaiters.shift()?.();
|
|
44
|
+
};
|
|
45
|
+
const enqueueResultFetch = (item, execution) => {
|
|
46
|
+
const record = records[item.index];
|
|
47
|
+
if (record === undefined)
|
|
48
|
+
return;
|
|
49
|
+
resultFetches.push((async () => {
|
|
50
|
+
await acquireResultSlot();
|
|
51
|
+
try {
|
|
52
|
+
record.results = await input.fetchResults(execution, item);
|
|
53
|
+
record.status = 'completed';
|
|
54
|
+
delete record.error;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
record.status = 'result_failed';
|
|
58
|
+
record.error = describeError(error);
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
releaseResultSlot();
|
|
62
|
+
}
|
|
63
|
+
})());
|
|
64
|
+
};
|
|
65
|
+
// Execution plane.
|
|
66
|
+
let nextStartAtMs = input.clock.now();
|
|
67
|
+
const executionWorkers = Math.max(1, input.executionConcurrency);
|
|
68
|
+
await drain(items.length, executionWorkers, async (index) => {
|
|
69
|
+
const item = items[index];
|
|
70
|
+
if (item === undefined)
|
|
71
|
+
return;
|
|
72
|
+
const record = records[index];
|
|
73
|
+
if (record === undefined)
|
|
74
|
+
return;
|
|
75
|
+
const scheduledStartMs = nextStartAtMs;
|
|
76
|
+
nextStartAtMs += input.staggerMs;
|
|
77
|
+
const delayMs = Math.max(0, scheduledStartMs - input.clock.now());
|
|
78
|
+
if (delayMs > 0) {
|
|
79
|
+
await input.clock.sleep(delayMs, input.signal);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const execution = await input.execute(item);
|
|
83
|
+
record.execution = execution;
|
|
84
|
+
record.status = 'result_failed';
|
|
85
|
+
record.error = 'Results were not fetched.';
|
|
86
|
+
// Slot is released as soon as this returns; result fetching runs off-plane.
|
|
87
|
+
enqueueResultFetch(item, execution);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
record.status = 'execution_failed';
|
|
91
|
+
record.error = describeError(error);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
await Promise.all(resultFetches);
|
|
95
|
+
return records;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/suite/execution.ts"],"names":[],"mappings":"AAkDA,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAChF,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,wDAAwD;AACxD,KAAK,UAAU,KAAK,CAAC,SAAiB,EAAE,OAAe,EAAE,GAAqC;IAC5F,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,MAAM,MAAM,GAAG,KAAK,IAAmB,EAAE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+
import { type SuiteGatePolicy } from '../gate/policy.js';
|
|
2
|
+
export type SuiteManifestEntry = {
|
|
3
|
+
/** Eval file path, resolved against the manifest's directory. */
|
|
4
|
+
file: string;
|
|
5
|
+
/** Suite default merged with the per-eval override. */
|
|
6
|
+
gate: SuiteGatePolicy;
|
|
7
|
+
};
|
|
8
|
+
export type SuiteManifest = {
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
entries: readonly SuiteManifestEntry[];
|
|
11
|
+
/** Eval file paths in manifest order. */
|
|
12
|
+
evalFiles: readonly string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function parseSuiteManifest(source: string, manifestPath: string): SuiteManifest;
|
|
15
|
+
export declare function readSuiteManifest(manifestPath: string): Promise<SuiteManifest>;
|
|
16
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/suite/manifest.ts"],"names":[],"mappings":"AAOA,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAyC/F,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvC,yCAAyC;IACzC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAwCtF;AAED,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAYpF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { AutoevalError } from '../errors/autoeval-error.js';
|
|
6
|
+
import { mergePolicies, suiteGatePolicySchema } from '../gate/policy.js';
|
|
7
|
+
/**
|
|
8
|
+
* A suite manifest is the CI unit of work: one file listing the eval files a
|
|
9
|
+
* release is gated on. It carries no eval configuration of its own — artifact
|
|
10
|
+
* and reference-document paths live inside each eval file — so the manifest
|
|
11
|
+
* stays reviewable and stable across runs.
|
|
12
|
+
*
|
|
13
|
+
* workspace: 4c1c8a3e-...
|
|
14
|
+
* gate:
|
|
15
|
+
* minOverall: 4.0
|
|
16
|
+
* evals:
|
|
17
|
+
* - ./evals/refund-policy.autoeval.json
|
|
18
|
+
* - file: ./evals/support-conversation.autoeval.json
|
|
19
|
+
* gate:
|
|
20
|
+
* metrics:
|
|
21
|
+
* factuality: 4.0
|
|
22
|
+
*
|
|
23
|
+
* YAML and JSON are both accepted; paths resolve relative to the manifest.
|
|
24
|
+
* The optional `gate` blocks configure the release gate only; they are never
|
|
25
|
+
* sent to the backend.
|
|
26
|
+
*/
|
|
27
|
+
const evalEntrySchema = z.union([
|
|
28
|
+
z.string().trim().min(1),
|
|
29
|
+
z
|
|
30
|
+
.object({
|
|
31
|
+
file: z.string().trim().min(1),
|
|
32
|
+
gate: suiteGatePolicySchema.optional(),
|
|
33
|
+
})
|
|
34
|
+
.strict(),
|
|
35
|
+
]);
|
|
36
|
+
const manifestSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
workspace: z.string().trim().min(1),
|
|
39
|
+
gate: suiteGatePolicySchema.optional(),
|
|
40
|
+
evals: z.array(evalEntrySchema).min(1),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
43
|
+
export function parseSuiteManifest(source, manifestPath) {
|
|
44
|
+
let document;
|
|
45
|
+
try {
|
|
46
|
+
document = parseYaml(source);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
throw new AutoevalError(`${manifestPath} is not valid YAML or JSON.`, {
|
|
50
|
+
kind: 'usage',
|
|
51
|
+
code: 'INVALID_SUITE_MANIFEST',
|
|
52
|
+
cause: error,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const parsed = manifestSchema.safeParse(document);
|
|
56
|
+
if (!parsed.success) {
|
|
57
|
+
const details = parsed.error.issues
|
|
58
|
+
.slice(0, 5)
|
|
59
|
+
.map((issue) => `${issue.path.map(String).join('.') || 'manifest'}: ${issue.message}`)
|
|
60
|
+
.join('; ');
|
|
61
|
+
throw new AutoevalError(`${manifestPath} is not a valid suite manifest: ${details}.`, {
|
|
62
|
+
kind: 'validation',
|
|
63
|
+
code: 'INVALID_SUITE_MANIFEST_SCHEMA',
|
|
64
|
+
cause: parsed.error,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const baseDirectory = dirname(resolve(manifestPath));
|
|
68
|
+
const toPath = (entry) => isAbsolute(entry) ? entry : resolve(baseDirectory, entry);
|
|
69
|
+
const entries = parsed.data.evals.map((entry) => typeof entry === 'string'
|
|
70
|
+
? { file: toPath(entry), gate: mergePolicies(parsed.data.gate, undefined) }
|
|
71
|
+
: { file: toPath(entry.file), gate: mergePolicies(parsed.data.gate, entry.gate) });
|
|
72
|
+
return {
|
|
73
|
+
workspaceId: parsed.data.workspace,
|
|
74
|
+
entries,
|
|
75
|
+
evalFiles: entries.map((entry) => entry.file),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export async function readSuiteManifest(manifestPath) {
|
|
79
|
+
let source;
|
|
80
|
+
try {
|
|
81
|
+
source = await readFile(manifestPath, 'utf8');
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw new AutoevalError(`Suite manifest was not found or could not be read: ${manifestPath}`, {
|
|
85
|
+
kind: 'usage',
|
|
86
|
+
code: 'SUITE_MANIFEST_READ_FAILED',
|
|
87
|
+
cause: error,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return parseSuiteManifest(source, manifestPath);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/suite/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAwB,MAAM,mBAAmB,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC;IAC9B,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9B,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE;KACvC,CAAC;SACD,MAAM,EAAE;CACZ,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,IAAI,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACvC,CAAC;KACD,MAAM,EAAE,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IAAI,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC,KAAK,EAAE,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;QAC3E,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CACpF,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;QAClC,OAAO;QACP,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,YAAoB;IAC1D,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,aAAa,CAAC,sDAAsD,YAAY,EAAE,EAAE;YAC5F,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,4BAA4B;YAClC,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;IACD,OAAO,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SuiteSummary } from '../actions/suite.js';
|
|
2
|
+
import type { SuiteGateReport } from '../gate/decision.js';
|
|
3
|
+
/**
|
|
4
|
+
* Failure clustering.
|
|
5
|
+
*
|
|
6
|
+
* A blocked suite usually reports the same root cause many times: one upstream
|
|
7
|
+
* outage, one malformed artifact, one metric that regressed across every eval.
|
|
8
|
+
* Reading the per-eval list to rediscover that is noise, so this module groups
|
|
9
|
+
* failures by a normalized signature and reports each distinct cause once, with
|
|
10
|
+
* its count and one exemplar. It is pure: it reads only what the execution,
|
|
11
|
+
* results, and gate planes already produced.
|
|
12
|
+
*/
|
|
13
|
+
export type FailureClusterCategory = 'execution' | 'threshold' | 'inconclusive';
|
|
14
|
+
export type FailureCluster = {
|
|
15
|
+
/** Stable machine identifier for the normalized cause. */
|
|
16
|
+
id: string;
|
|
17
|
+
category: FailureClusterCategory;
|
|
18
|
+
label: string;
|
|
19
|
+
count: number;
|
|
20
|
+
/** Eval labels (name or file) contributing to the cluster, in suite order. */
|
|
21
|
+
evals: string[];
|
|
22
|
+
/** One representative raw message, kept verbatim for debugging. */
|
|
23
|
+
exemplar: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Clusters everything that blocked a release: execution and result errors, and
|
|
27
|
+
* every failing or inconclusive gate check.
|
|
28
|
+
*/
|
|
29
|
+
export declare function clusterSuiteFailures(report: SuiteGateReport): FailureCluster[];
|
|
30
|
+
/**
|
|
31
|
+
* Clusters execution and result-plane errors from a suite run, for the ungated
|
|
32
|
+
* `suite run` command where no thresholds are configured.
|
|
33
|
+
*/
|
|
34
|
+
export declare function clusterExecutionFailures(summary: SuiteSummary): FailureCluster[];
|
|
35
|
+
//# sourceMappingURL=reporting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporting.d.ts","sourceRoot":"","sources":["../../src/suite/reporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE7E;;;;;;;;;GASG;AAEH,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,CAAC;AAEhF,MAAM,MAAM,cAAc,GAAG;IAC3B,0DAA0D;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,sBAAsB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAwFF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,EAAE,CAmC9E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,YAAY,GAAG,cAAc,EAAE,CAehF"}
|