skillfit 0.10.0 → 0.11.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 +27 -7
- package/README.zh-CN.md +27 -7
- package/benches/README.md +2 -2
- package/dist/cli.js +146 -36
- package/dist/cli.test.js +94 -0
- package/dist/commands/bench-calibration.js +197 -0
- package/dist/commands/bench-calibration.test.js +237 -0
- package/dist/commands/bench-check-json.test.js +24 -3
- package/dist/commands/bench.js +69 -141
- package/dist/commands/calibration-cli.test.js +145 -0
- package/dist/commands/eval-agent-preflight.test.js +245 -0
- package/dist/commands/eval-cli.js +31 -0
- package/dist/commands/eval-component.js +59 -28
- package/dist/commands/eval-export-modes.test.js +350 -0
- package/dist/commands/eval-export.js +44 -10
- package/dist/commands/eval-export.test.js +165 -8
- package/dist/commands/eval-interruption.test.js +238 -0
- package/dist/commands/eval-plan.js +37 -0
- package/dist/commands/eval-preflight.js +61 -0
- package/dist/commands/eval-preflight.test.js +382 -0
- package/dist/commands/eval-report.js +60 -14
- package/dist/commands/eval-report.test.js +2 -2
- package/dist/commands/eval-single-arm-replay.js +21 -0
- package/dist/commands/eval-single-arm-report.js +223 -0
- package/dist/commands/eval.js +184 -112
- package/dist/commands/evaluation-report.js +5 -0
- package/dist/commands/evaluation-report.test.js +243 -0
- package/dist/commands/replay-cancellation.test.js +105 -0
- package/dist/commands/workflow-entrypoints.test.js +137 -0
- package/dist/harness/agent-preflight.js +180 -0
- package/dist/harness/bench.js +2 -1
- package/dist/harness/command.js +49 -0
- package/dist/harness/eval-audit.js +164 -17
- package/dist/harness/eval-budget.js +46 -2
- package/dist/harness/eval-budget.test.js +30 -3
- package/dist/harness/eval-component.test.js +169 -6
- package/dist/harness/eval-contract.js +11 -5
- package/dist/harness/executors/api.js +14 -4
- package/dist/harness/executors/api.test.js +61 -0
- package/dist/harness/executors/cli.js +24 -3
- package/dist/harness/experiment-session.js +77 -18
- package/dist/harness/experiment-session.test.js +51 -1
- package/dist/harness/input-snapshot.js +150 -0
- package/dist/harness/interruption.js +48 -0
- package/dist/harness/interruption.test.js +31 -0
- package/dist/harness/invocation-costs.js +72 -0
- package/dist/harness/judge-accounting.test.js +216 -0
- package/dist/harness/judge-audit.js +56 -0
- package/dist/harness/judge.js +86 -21
- package/dist/harness/replay-package.js +71 -5
- package/dist/harness/runner.js +92 -44
- package/dist/harness/runner.test.js +23 -0
- package/dist/harness/single-arm-audit.js +436 -0
- package/dist/harness/trigger.js +41 -7
- package/dist/harness/trigger.test.js +12 -0
- package/dist/harness/verifier-error.js +65 -0
- package/dist/harness/verifier.test.js +128 -0
- package/docs/bench-authoring.md +34 -9
- package/docs/bench-check-json.md +36 -6
- package/docs/eval-agent-preflight.md +101 -0
- package/docs/eval-case-preflight.md +115 -0
- package/docs/eval-component.md +65 -9
- package/docs/eval-costs.md +53 -0
- package/docs/eval-planning.md +153 -0
- package/docs/evaluation-input-snapshots.md +125 -0
- package/docs/evaluation-interruption.md +101 -0
- package/docs/evaluation-reports.md +143 -0
- package/docs/experiment-workflow.md +16 -2
- package/docs/first-real-eval.md +55 -5
- package/docs/growth-roadmap-2026-10.md +48 -11
- package/docs/metrics.md +71 -3
- package/docs/plans/2026-10-16-case-workflow-and-release.md +19 -0
- package/docs/plans/2026-10-17-workflow-foundations.md +64 -0
- package/docs/releases/0.10.0-ci-registry-install.json +140 -0
- package/docs/releases/0.10.0-feature-smoke.json +22 -0
- package/docs/releases/0.10.0-feature-smoke.mjs +62 -0
- package/docs/releases/0.10.0-signatures.txt +7 -0
- package/docs/releases/0.10.0-verification.json +76 -0
- package/docs/releases/0.10.0.md +44 -8
- package/docs/releases/0.10.1-ci-registry-install.json +70 -0
- package/docs/releases/0.10.1-feature-smoke.json +28 -0
- package/docs/releases/0.10.1-feature-smoke.mjs +95 -0
- package/docs/releases/0.10.1-local-registry-install.json +60 -0
- package/docs/releases/0.10.1-registry-metadata.json +33 -0
- package/docs/releases/0.10.1-signatures.txt +7 -0
- package/docs/releases/0.10.1-verification.json +90 -0
- package/docs/releases/0.10.1.md +71 -0
- package/docs/releases/0.11.0-feature-smoke.mjs +224 -0
- package/docs/releases/0.11.0.md +47 -0
- package/docs/replay-packages.md +52 -11
- package/docs/schemas/agent-preflight.schema.json +31 -0
- package/docs/schemas/calibration-plan.schema.json +22 -0
- package/docs/schemas/calibration-result.schema.json +17 -0
- package/docs/schemas/eval-preflight.schema.json +57 -0
- package/docs/schemas/eval-request.schema.json +1 -1
- package/docs/schemas/eval-result.schema.json +14 -1
- package/docs/schemas/invocation-costs.schema.json +31 -0
- package/docs/schemas/judge-call.schema.json +22 -0
- package/docs/schemas/single-arm-report.schema.json +20 -0
- package/docs/schemas/verifier-error.schema.json +11 -0
- package/docs/sharing-results.md +8 -2
- package/docs/verifier-contract.md +99 -0
- package/package.json +1 -1
- package/skills/skillfit/SKILL.md +41 -8
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
5
|
+
import { pathToFileURL } from 'node:url';
|
|
6
|
+
|
|
7
|
+
// Usage: node 0.11.0-feature-smoke.mjs <installed-or-extracted-package> <fresh-output-parent>
|
|
8
|
+
// No real agent, model API or login probe is used. The package path is supplied
|
|
9
|
+
// by the caller; this check alone does not establish registry publication.
|
|
10
|
+
assert.equal(process.argv.length, 4, 'Provide a package directory and a fresh output parent.');
|
|
11
|
+
const installed = resolve(process.argv[2]), parent = resolve(process.argv[3]);
|
|
12
|
+
const insidePackage = relative(installed, parent);
|
|
13
|
+
assert.ok(isAbsolute(insidePackage) || insidePackage.startsWith(`..${sep}`) || insidePackage === '..', 'Keep smoke output outside the installed package.');
|
|
14
|
+
assert.equal(existsSync(parent), false, 'The output parent must be fresh; prior smoke receipts are never overwritten.');
|
|
15
|
+
assert.equal(JSON.parse(readFileSync(join(installed, 'package.json'), 'utf8')).version, '0.11.0');
|
|
16
|
+
mkdirSync(parent, { recursive: true });
|
|
17
|
+
const root = mkdtempSync(join(parent, 'offline-foundations-'));
|
|
18
|
+
const home = join(root, 'home'), runsRoot = join(root, 'runs');
|
|
19
|
+
mkdirSync(home);
|
|
20
|
+
const load = file => import(pathToFileURL(join(installed, 'dist', file)).href);
|
|
21
|
+
const { runBenchInit, runBenchCalibration } = await load('commands/bench.js');
|
|
22
|
+
const { runEval } = await load('commands/eval.js');
|
|
23
|
+
const { runEvalCli } = await load('commands/eval-cli.js');
|
|
24
|
+
const { readEvaluationReport } = await load('commands/evaluation-report.js');
|
|
25
|
+
const { exportEvaluation } = await load('commands/eval-export.js');
|
|
26
|
+
const { packageFiles } = await load('harness/replay-package.js');
|
|
27
|
+
const { sha256File, hashFileSet, listFilesRecursive } = await load('harness/hash.js');
|
|
28
|
+
|
|
29
|
+
// Public CLI previews have an empty PATH. Fake-executor runs and replay need
|
|
30
|
+
// only Node's directory to execute the package's trusted fixture programs.
|
|
31
|
+
// Every child receives isolated homes and no API/judge credentials.
|
|
32
|
+
const originalEnvironment = { ...process.env }, originalFetch = globalThis.fetch;
|
|
33
|
+
for (const key of Object.keys(process.env)) {
|
|
34
|
+
if (key.toUpperCase() === 'PATH' || /^(SKILLFIT_|OPENAI_|ANTHROPIC_)/.test(key)) delete process.env[key];
|
|
35
|
+
}
|
|
36
|
+
Object.assign(process.env, { PATH: dirname(process.execPath), HOME: home, USERPROFILE: home, CODEX_HOME: join(home, 'codex'), SKILLFIT_JUDGE: '0' });
|
|
37
|
+
const env = { ...process.env, PATH: '' }, replayEnv = { ...process.env };
|
|
38
|
+
let networkAttempts = 0, skillfitCliCalls = 0;
|
|
39
|
+
globalThis.fetch = async () => { networkAttempts++; throw new Error('Network calls are forbidden in this offline smoke.'); };
|
|
40
|
+
const counts = { calibrationHardFailure: 0, calibration: 0, pairedAgent: 0, judge: 0, triggerLine: 0, triggerPartial: 0, triggerUnknown: 0 };
|
|
41
|
+
const checks = {}, tests = {};
|
|
42
|
+
const final = { output: 'skillfit-ok', tokens: { input: 10, cachedInput: 2, output: 3 }, usageStatus: 'final' };
|
|
43
|
+
const limits = { input: 1000, cachedInput: 1000, uncachedInput: 1000, output: 1000, durationSeconds: 1000 };
|
|
44
|
+
const json = file => JSON.parse(readFileSync(file, 'utf8'));
|
|
45
|
+
const quiet = () => {};
|
|
46
|
+
const fake = (name, response) => ({
|
|
47
|
+
describe: () => ({ kind: 'stub', model: `offline-smoke-${name}` }),
|
|
48
|
+
run: async () => { counts[name]++; return typeof response === 'function' ? response() : structuredClone(response); },
|
|
49
|
+
});
|
|
50
|
+
const cli = (args, expected = 0) => {
|
|
51
|
+
skillfitCliCalls++;
|
|
52
|
+
const child = spawnSync(process.execPath, [join(installed, 'dist/cli.js'), ...args],
|
|
53
|
+
{ cwd: root, env, encoding: 'utf8', timeout: 60_000, maxBuffer: 16 * 1024 * 1024 });
|
|
54
|
+
assert.equal(child.status, expected, child.stderr || child.stdout);
|
|
55
|
+
return child;
|
|
56
|
+
};
|
|
57
|
+
const noAdoption = report => {
|
|
58
|
+
assert.notEqual(report.acceptance.decision, 'accept');
|
|
59
|
+
assert.equal(report.acceptance.eligibleForUpgrade, false);
|
|
60
|
+
assert.equal(report.acceptance.automaticUpgrade, false);
|
|
61
|
+
};
|
|
62
|
+
const snapshotCosts = report => JSON.parse(JSON.stringify({
|
|
63
|
+
costs: report.costs ?? null, invocationCosts: report.invocationCosts ?? null,
|
|
64
|
+
usage: report.usage ?? null, spendingBudget: report.spendingBudget ?? null,
|
|
65
|
+
}));
|
|
66
|
+
const ledger = run => readFileSync(join(run, '_calls.jsonl'), 'utf8').trim().split('\n').map(line => JSON.parse(line));
|
|
67
|
+
const files = run => packageFiles(run).map(file => [file, sha256File(join(run, file))]);
|
|
68
|
+
const fixture = async (name, kind = 'output', sentinel = null) => {
|
|
69
|
+
const bench = join(root, name);
|
|
70
|
+
await runBenchInit({ dir: bench, kind, yes: true, log: quiet });
|
|
71
|
+
const file = join(bench, 'bench.json'), definition = json(file);
|
|
72
|
+
definition.tasks[0].shouldTrigger = true;
|
|
73
|
+
definition.tasks[0].triggerClass = 'explicit';
|
|
74
|
+
definition.tasks.push({ ...definition.tasks[0], id: 'negative-task', shouldTrigger: false, triggerClass: undefined });
|
|
75
|
+
if (sentinel) for (const script of ['verifiers/example-task.mjs', 'ground-truth/oracle-example-task.mjs']) {
|
|
76
|
+
writeFileSync(join(bench, script), `import{writeFileSync as markProbe}from'node:fs';markProbe(${JSON.stringify(sentinel)},'unexpected');\n` + readFileSync(join(bench, script), 'utf8'));
|
|
77
|
+
}
|
|
78
|
+
writeFileSync(file, JSON.stringify(definition));
|
|
79
|
+
return bench;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
assert.equal(cli(['--version']).stdout.trim(), '0.11.0');
|
|
84
|
+
const help = cli(['--help']).stdout;
|
|
85
|
+
for (const flag of ['--plan-sha', '--task', '--spending-budget', '--executor-timeout-seconds', '--runs-root', '--export']) assert.ok(help.includes(flag));
|
|
86
|
+
checks.versionAndPublicFlags = true;
|
|
87
|
+
|
|
88
|
+
const skill = join(root, 'skill'); mkdirSync(skill);
|
|
89
|
+
writeFileSync(join(skill, 'SKILL.md'), '---\nname: smoke-skill\ndescription: Synthetic offline release workflow check.\n---\nInspect the task and return the answer.\n');
|
|
90
|
+
const sentinel = join(root, 'unexpected-preview-probe'), previewBench = await fixture('preview-bench', 'output', sentinel);
|
|
91
|
+
const settings = ['--agent', 'codex', '--trials', '1', '--executor-timeout-seconds', '17', '--runs-root', join(root, 'preview-runs'), '--json', '--dry-run'];
|
|
92
|
+
const previewRows = [
|
|
93
|
+
['paired', ['eval', skill, '--mode', 'installed', '--bench', previewBench, '--task', 'example-task', '--max-calls', '2', '--run-group', 'preview-paired']],
|
|
94
|
+
['calibration', ['bench', 'check', previewBench, '--calibrate', '--task', 'example-task', '--max-calls', '1', '--input', 'workspace', '--run-group', 'preview-calibration']],
|
|
95
|
+
['trigger', ['eval', skill, '--mode', 'trigger', '--bench', previewBench, '--task', 'example-task', '--task', 'negative-task', '--max-calls', '2', '--run-group', 'preview-trigger']],
|
|
96
|
+
];
|
|
97
|
+
for (const [mode, args] of previewRows) {
|
|
98
|
+
const child = cli([...args, ...settings]);
|
|
99
|
+
const report = JSON.parse(child.stdout), plan = report.plan, evaluation = plan.evaluation ?? plan;
|
|
100
|
+
assert.equal(report.status, 'planned'); noAdoption(report);
|
|
101
|
+
assert.equal(evaluation.agentPreflight.status, 'blocked');
|
|
102
|
+
assert.ok(evaluation.agentPreflight.checks.some(check => check.code === 'CLI_AVAILABLE' && check.status === 'FAIL'));
|
|
103
|
+
assert.ok(evaluation.agentPreflight.checks.some(check => check.code === 'AUTHENTICATION' && check.status === 'UNKNOWN'));
|
|
104
|
+
assert.deepEqual(evaluation.agentPreflight.cost, { modelCalls: 0, cliInvocations: 0 });
|
|
105
|
+
assert.equal(evaluation.executorTimeoutSeconds, 17);
|
|
106
|
+
assert.equal(evaluation.plannedCalls, mode === 'calibration' ? 1 : 2);
|
|
107
|
+
tests[`${mode}PublicPreview`] = { status: report.status, plannedCalls: evaluation.plannedCalls, environment: 'blocked', authentication: 'UNKNOWN', modelCalls: 0, agentCliCalls: 0 };
|
|
108
|
+
}
|
|
109
|
+
assert.equal(existsSync(sentinel), false); assert.equal(existsSync(join(root, 'preview-runs')), false);
|
|
110
|
+
assert.equal(Object.values(counts).reduce((sum, value) => sum + value, 0), 0);
|
|
111
|
+
checks.publicPreviewsArePureWithoutAgentCli = true;
|
|
112
|
+
|
|
113
|
+
const broken = await fixture('broken-command-bench', 'command');
|
|
114
|
+
writeFileSync(join(broken, 'verifiers/example-task.mjs'), 'process.exit(0);\n');
|
|
115
|
+
await assert.rejects(runBenchCalibration({ dir: broken, taskIds: ['example-task'], log: quiet,
|
|
116
|
+
calibrate: { executor: fake('calibrationHardFailure', final), trials: 1, maxCalls: 1, runsRoot, runGroup: 'blocked-calibration' } }),
|
|
117
|
+
error => error.name === 'CasePreflightFailed' && error.preflight.checks.some(check => check.code === 'UNTOUCHED_FIXTURE' && check.status === 'FAIL'));
|
|
118
|
+
assert.equal(counts.calibrationHardFailure, 0); assert.equal(existsSync(join(runsRoot, 'blocked-calibration')), false);
|
|
119
|
+
tests.calibrationHardFailure = { gate: 'UNTOUCHED_FIXTURE', fakeCalls: 0, nativeRunCreated: false, modelCalls: 0 };
|
|
120
|
+
checks.calibrationHardFailurePreventsSpending = true;
|
|
121
|
+
|
|
122
|
+
const bench = await fixture('bench'), originals = [];
|
|
123
|
+
await runBenchCalibration({ dir: bench, taskIds: ['example-task'], log: quiet,
|
|
124
|
+
calibrate: { executor: fake('calibration', final), trials: 1, maxCalls: 1, spendingBudget: limits, runsRoot, runGroup: 'calibration' } });
|
|
125
|
+
assert.equal(counts.calibration, 1);
|
|
126
|
+
originals.push({ name: 'calibration', mode: 'calibration', run: join(runsRoot, 'calibration'), calls: 1 });
|
|
127
|
+
|
|
128
|
+
const checklist = JSON.stringify({ A: { correct: true, complete: true, grounded: true }, B: { correct: true, complete: true, grounded: true } });
|
|
129
|
+
await runEval({ skillPath: skill, bench, taskIds: ['example-task'], trials: 1, maxCalls: 4,
|
|
130
|
+
executor: fake('pairedAgent', final), judgeExecutor: fake('judge', { output: checklist, rawOutput: 'offline judge transcript', tokens: { input: 5, cachedInput: 1, output: 2 }, usageStatus: 'final' }),
|
|
131
|
+
spendingBudget: limits, yes: true, dryRun: false, runsRoot, runGroup: 'paired-judge', log: quiet });
|
|
132
|
+
assert.equal(counts.pairedAgent, 2); assert.equal(counts.judge, 2);
|
|
133
|
+
const pairedRun = join(runsRoot, 'paired-judge'), paired = await readEvaluationReport(pairedRun);
|
|
134
|
+
assert.equal(paired.invocationCosts.agent.runs, 2); assert.equal(paired.invocationCosts.judge.runs, 2); assert.equal(paired.invocationCosts.total.runs, 4);
|
|
135
|
+
assert.equal(paired.invocationCosts.agent.metrics.input.knownTotal, 20); assert.equal(paired.invocationCosts.judge.metrics.input.knownTotal, 10);
|
|
136
|
+
assert.equal(paired.invocationCosts.total.metrics.input.knownTotal, 30); assert.equal(paired.invocationCosts.total.metrics.cachedInput.knownTotal, 6);
|
|
137
|
+
assert.equal(paired.invocationCosts.total.metrics.uncachedInput.knownTotal, 24); assert.equal(paired.invocationCosts.total.metrics.output.knownTotal, 10);
|
|
138
|
+
for (const metric of ['input', 'cachedInput', 'uncachedInput', 'output', 'durationSeconds']) assert.equal(paired.invocationCosts.total.metrics[metric].coverage.final, 4);
|
|
139
|
+
assert.equal(ledger(pairedRun).filter(event => event.event === 'started').length, 4);
|
|
140
|
+
for (const index of [1, 2]) assert.equal(json(join(pairedRun, `example-task/judge-trial-1/call-${index}.json`)).usageStatus, 'final');
|
|
141
|
+
tests.pairedJudge = { fakeAgentCalls: 2, fakeJudgeCalls: 2, totalCalls: 4, invocationCosts: paired.invocationCosts, modelCalls: 0 };
|
|
142
|
+
checks.judgeBothOrdersRetainCompleteRoleAndTotalCosts = true;
|
|
143
|
+
originals.push({ name: 'paired-judge', mode: 'paired', run: pairedRun, calls: 4 });
|
|
144
|
+
|
|
145
|
+
for (const [name, counter, response, expected] of [
|
|
146
|
+
['trigger-line', 'triggerLine', { ...final, skillTriggered: true }, 'SPENDING_BUDGET_REACHED'],
|
|
147
|
+
['trigger-partial', 'triggerPartial', { output: final.output, skillTriggered: true, tokens: { input: 7, output: 2 }, usageStatus: 'partial' }, 'FINAL_USAGE_MISSING'],
|
|
148
|
+
['trigger-unknown', 'triggerUnknown', { output: final.output, skillTriggered: true, usageStatus: 'unknown' }, 'FINAL_USAGE_MISSING'],
|
|
149
|
+
]) {
|
|
150
|
+
const options = { skillPath: skill, bench, taskIds: ['example-task'], mode: 'trigger', skillInstallDir: '.offline-skills',
|
|
151
|
+
executor: fake(counter, response), judgeExecutor: null, trials: 3, maxCalls: 3, spendingBudget: { ...limits, input: name === 'trigger-line' ? 10 : 1000 },
|
|
152
|
+
yes: true, runsRoot, runGroup: name, log: quiet };
|
|
153
|
+
const preview = await runEvalCli({ ...options, dryRun: true });
|
|
154
|
+
assert.equal(counts[counter], 0);
|
|
155
|
+
const report = await runEvalCli({ ...options, dryRun: false }, preview.plan.sha256);
|
|
156
|
+
assert.equal(report.status, 'stopped'); assert.equal(report.evaluationType, 'trigger'); assert.equal(counts[counter], 1); noAdoption(report);
|
|
157
|
+
const run = join(runsRoot, name), session = json(join(run, '_session.json'));
|
|
158
|
+
assert.equal(session.callsStarted, 1); assert.equal(session.stopCode, expected);
|
|
159
|
+
assert.equal(ledger(run).filter(event => event.event === 'started').length, 1);
|
|
160
|
+
assert.equal(existsSync(join(run, 'example-task/installed/trial-2')), false);
|
|
161
|
+
assert.equal(report.usage.runs, 1);
|
|
162
|
+
if (name === 'trigger-line') assert.equal(report.usage.metrics.input.knownTotal, 10);
|
|
163
|
+
else {
|
|
164
|
+
assert.equal(report.usage.metrics.cachedInput.coverage.unknown, 1);
|
|
165
|
+
assert.equal(report.usage.metrics.input.coverage[name === 'trigger-partial' ? 'partial' : 'unknown'], 1);
|
|
166
|
+
}
|
|
167
|
+
tests[name] = { status: report.status, stopCode: session.stopCode, fakeCalls: 1, usage: report.usage, modelCalls: 0 };
|
|
168
|
+
originals.push({ name, mode: 'trigger', run, calls: 1 });
|
|
169
|
+
}
|
|
170
|
+
checks.triggerBudgetAndIncompleteUsageStopWithoutRetries = true;
|
|
171
|
+
|
|
172
|
+
for (const item of originals) {
|
|
173
|
+
item.report = await readEvaluationReport(item.run); noAdoption(item.report);
|
|
174
|
+
assert.equal(item.report.evidence.verified, true, JSON.stringify(item.report.evidence));
|
|
175
|
+
item.costs = snapshotCosts(item.report); item.nativeFiles = files(item.run);
|
|
176
|
+
}
|
|
177
|
+
const frozenCounts = structuredClone(counts);
|
|
178
|
+
rmSync(bench, { recursive: true }); rmSync(skill, { recursive: true });
|
|
179
|
+
for (const item of originals) {
|
|
180
|
+
const output = join(root, `export-${item.name}`), moved = join(root, `moved ${item.name}`);
|
|
181
|
+
const plan = await exportEvaluation(item.run, output, { log: quiet });
|
|
182
|
+
assert.equal(plan.status, 'planned'); assert.equal(plan.inputSource, 'sealed-snapshot'); assert.equal(existsSync(output), false);
|
|
183
|
+
await exportEvaluation(item.run, output, { yes: true, log: quiet });
|
|
184
|
+
assert.deepEqual(files(item.run), item.nativeFiles, 'Export must preserve original native evidence.');
|
|
185
|
+
renameSync(output, moved); rmSync(item.run, { recursive: true });
|
|
186
|
+
const reproduce = args => {
|
|
187
|
+
const child = spawnSync(process.execPath, [join(moved, 'reproduce.mjs'), ...args], { cwd: root, env: replayEnv, encoding: 'utf8', timeout: 60_000, maxBuffer: 16 * 1024 * 1024 });
|
|
188
|
+
assert.equal(child.status, 0, child.stderr || child.stdout); return JSON.parse(child.stdout);
|
|
189
|
+
};
|
|
190
|
+
assert.equal(reproduce(['--verify-only']).modelCalls, 0);
|
|
191
|
+
const replayed = reproduce([]);
|
|
192
|
+
assert.equal(replayed.evidence.verified, true, JSON.stringify(replayed.evidence)); assert.equal(replayed.status, item.report.status);
|
|
193
|
+
assert.deepEqual(snapshotCosts(replayed), item.costs); noAdoption(replayed);
|
|
194
|
+
assert.equal(replayed.portableReplay.modelCalls, 0); assert.deepEqual(counts, frozenCounts);
|
|
195
|
+
// The public report also regrades trusted Node verifiers, so it receives
|
|
196
|
+
// the replay environment rather than the empty-PATH preview environment.
|
|
197
|
+
const inspectedChild = spawnSync(process.execPath, [join(installed, 'dist/cli.js'), 'report', 'eval', moved, '--json', '--replay'],
|
|
198
|
+
{ cwd: root, env: replayEnv, encoding: 'utf8', timeout: 60_000, maxBuffer: 16 * 1024 * 1024 });
|
|
199
|
+
skillfitCliCalls++; assert.equal(inspectedChild.status, 0, inspectedChild.stderr || inspectedChild.stdout);
|
|
200
|
+
const inspected = JSON.parse(inspectedChild.stdout);
|
|
201
|
+
assert.equal(inspected.portablePackage.integrityVerified, true); assert.deepEqual(snapshotCosts(inspected), item.costs); noAdoption(inspected);
|
|
202
|
+
tests[`${item.name}PortableReplay`] = { evaluationType: item.mode, status: replayed.status,
|
|
203
|
+
deletedOriginalInputs: true, deletedOriginalRun: true, movedPackage: true, exactCostsRetained: true,
|
|
204
|
+
retainedCosts: item.costs,
|
|
205
|
+
fakeCallsBeforeReplay: item.calls, additionalFakeCalls: 0, modelCalls: 0, eligibleForUpgrade: false, automaticUpgrade: false };
|
|
206
|
+
}
|
|
207
|
+
checks.allModesMoveDeleteOriginalReplayWithExactCosts = true;
|
|
208
|
+
checks.noAdoptionFromSyntheticOrStoppedEvidence = true;
|
|
209
|
+
assert.equal(networkAttempts, 0); assert.deepEqual(counts, frozenCounts);
|
|
210
|
+
assert.equal(Object.values(counts).reduce((sum, value) => sum + value, 0), 8);
|
|
211
|
+
const receipt = { schemaVersion: 1, kind: 'skillfit.release-foundations-smoke', version: '0.11.0',
|
|
212
|
+
verifiedAt: new Date().toISOString(), nodeVersion: process.version,
|
|
213
|
+
packagePath: installed, implementationSha256: hashFileSet(join(installed, 'dist'), listFilesRecursive(join(installed, 'dist'))),
|
|
214
|
+
scope: 'Offline check of the caller-supplied package; no registry/publication claim or Skill efficacy evidence.',
|
|
215
|
+
modelCalls: 0, agentCliCalls: 0, networkAttempts, skillfitCliCalls,
|
|
216
|
+
syntheticExecutorCalls: Object.values(counts).reduce((sum, value) => sum + value, 0), fakeCallCounts: counts, checks, tests };
|
|
217
|
+
writeFileSync(join(parent, 'feature-smoke.json'), JSON.stringify(receipt, null, 2) + '\n', { flag: 'wx' });
|
|
218
|
+
rmSync(root, { recursive: true, force: true });
|
|
219
|
+
console.log(JSON.stringify(receipt));
|
|
220
|
+
} finally {
|
|
221
|
+
globalThis.fetch = originalFetch;
|
|
222
|
+
for (const key of Object.keys(process.env)) delete process.env[key];
|
|
223
|
+
Object.assign(process.env, originalEnvironment);
|
|
224
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# skillfit 0.11.0
|
|
2
|
+
|
|
3
|
+
This version completes the basic case → plan → run/stop → report → portable
|
|
4
|
+
replay workflow. Registry publication and isolated-install verification are
|
|
5
|
+
pending; this source record alone does not establish package availability.
|
|
6
|
+
|
|
7
|
+
## Included behavior
|
|
8
|
+
|
|
9
|
+
- Hard case/environment failures stop calibration before any Agent invocation.
|
|
10
|
+
Warnings and offline unknowns remain explicit.
|
|
11
|
+
- Paired, trigger and calibration runs expose bounded machine-readable previews,
|
|
12
|
+
reviewed confirmation, task selection, deadlines and spending stop lines.
|
|
13
|
+
- Standalone checks and offline native/portable replay clean up verifier/oracle
|
|
14
|
+
process trees on SIGINT/SIGTERM. Original saved runs remain unchanged.
|
|
15
|
+
- Independent judge receipts preserve successful, failed and interrupted usage;
|
|
16
|
+
reports separate primary/judge/combined costs. Shared budgets count all roles.
|
|
17
|
+
- Native and portable single-arm evidence is audited without claiming paired
|
|
18
|
+
efficacy. Historical missing costs/runtime support stay unknown or explicitly
|
|
19
|
+
unsupported; no old receipts are rewritten.
|
|
20
|
+
|
|
21
|
+
The release also includes the shared planning, quoted-command/verifier-error,
|
|
22
|
+
single-arm report and offline Agent preflight work merged after npm 0.10.1.
|
|
23
|
+
See the [changelog](../../CHANGELOG.md), [planning guide](../eval-planning.md),
|
|
24
|
+
[cost contract](../eval-costs.md) and [portable package contract](../replay-packages.md).
|
|
25
|
+
|
|
26
|
+
## Verification and boundaries
|
|
27
|
+
|
|
28
|
+
- `npm test`: 794 offline tests passed, with no failures or skipped tests.
|
|
29
|
+
- Bundled code-review/debugging and contributed bench checks passed offline.
|
|
30
|
+
- README code blocks match in both languages; local documentation/schema links
|
|
31
|
+
and the bundled driver Skill were checked.
|
|
32
|
+
- The [offline installed-feature recipe](0.11.0-feature-smoke.mjs) passed on the
|
|
33
|
+
extracted local archive, with seven feature groups, five moved replay packages,
|
|
34
|
+
eight synthetic invocations and zero network/model/Agent CLI calls. This does
|
|
35
|
+
not yet verify a registry installation.
|
|
36
|
+
- Three-platform remote CI, exact release archive, registry integrity/provenance
|
|
37
|
+
and an isolated installed-feature check remain delivery gates.
|
|
38
|
+
|
|
39
|
+
All implementation validation uses injected executors, fake HTTP and local
|
|
40
|
+
fixtures. Real model/Agent evaluation calls added: **0**. The statistical and
|
|
41
|
+
adoption policy is unchanged; evidence cannot automatically install or upgrade a
|
|
42
|
+
Skill. Offline environment checks cannot establish working authentication or
|
|
43
|
+
installed-version CLI flag compatibility.
|
|
44
|
+
|
|
45
|
+
Follow the existing [manual trusted-publishing procedure](trusted-publishing.md).
|
|
46
|
+
Publish once after its preview passes. An accepted upload followed by a registry
|
|
47
|
+
scan timeout is preserved and checked read-only, never uploaded again.
|
package/docs/replay-packages.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Portable offline evaluation packages
|
|
2
2
|
|
|
3
|
-
skillfit 0.10.0
|
|
3
|
+
skillfit 0.10.0 introduced paired native exports without a judge. Source after
|
|
4
|
+
npm 0.10.1 also exports native calibration, trigger and paired runs with a judge
|
|
5
|
+
to a fresh directory.
|
|
4
6
|
The package contains unchanged receipts, original pinned inputs, the compiled
|
|
5
7
|
implementation used by the experiment and a dependency-free replay entry point.
|
|
6
8
|
Export and replay make zero model calls. Replay executes trusted local verifiers.
|
|
@@ -28,12 +30,20 @@ the package does not install system dependencies. `--verify-only` checks invento
|
|
|
28
30
|
hashes and source-plan binding without executing verifiers. Default replay uses
|
|
29
31
|
the copied compiled CLI, grades temporary delivery copies and returns JSON. The
|
|
30
32
|
last command above uses the currently installed CLI and the packaged bench.
|
|
33
|
+
`reproduce.mjs` forwards Ctrl+C/SIGINT and SIGTERM to the pinned CLI, waits for
|
|
34
|
+
its local verifier processes to stop, then exits 130 or 143. Saved evidence is
|
|
35
|
+
read-only during both successful and interrupted replay. The launcher uses the
|
|
36
|
+
original implementation's cancellation context, including for older paired report
|
|
37
|
+
dispatchers; runtimes predating that cancellation module cannot be exported by
|
|
38
|
+
this source version.
|
|
31
39
|
|
|
32
40
|
The source must have sealed native evidence. A completed manifest must pass the
|
|
33
|
-
native evidence audit. Missing, changed or linked artifacts
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
native evidence audit. Missing, changed or linked native artifacts reject export.
|
|
42
|
+
Version 0.10.1 [seals inputs before dispatch](evaluation-input-snapshots.md)
|
|
43
|
+
and exports those copies even after original bench/Skill/request directories change
|
|
44
|
+
or disappear. A declared but damaged snapshot is an error, never a silent fallback.
|
|
45
|
+
Older runs without snapshots still need matching original or recovered bench,
|
|
46
|
+
complete candidate/baseline resources, compiled implementation and original request.
|
|
37
47
|
|
|
38
48
|
Recover original files elsewhere and provide matching paths when necessary:
|
|
39
49
|
|
|
@@ -44,11 +54,13 @@ skillfit report eval ./runs/my-run --export ./exports/my-run --input-root bench=
|
|
|
44
54
|
Only labels present in that run may be supplied; fingerprints must match exactly.
|
|
45
55
|
`request` names a file, all other labels name directories. `--bench <path>` is a
|
|
46
56
|
shortcut for the export's bench root; do not combine it with `--input-root bench`.
|
|
47
|
-
This recovers paths, not missing evidence or permission to change a cohort.
|
|
57
|
+
This recovers paths, not missing evidence or permission to change a cohort. Explicit
|
|
58
|
+
overrides do not bypass validation of a new run's declared input archive.
|
|
48
59
|
|
|
49
60
|
## Contents and machine contract
|
|
50
61
|
|
|
51
|
-
- `run/`: original native receipts, indices, plan, session and optional manifest
|
|
62
|
+
- `run/`: original native receipts, indices, plan, session and optional manifest
|
|
63
|
+
or `_calibration.json`; judge runs also retain both review-call receipts.
|
|
52
64
|
- `inputs/bench`, `inputs/target`, optional `inputs/baseline-skill` and
|
|
53
65
|
`inputs/request.json`: matching frozen inputs.
|
|
54
66
|
- `runtime/dist/`: unchanged compiled implementation. Minimal ESM package metadata
|
|
@@ -58,6 +70,9 @@ This recovers paths, not missing evidence or permission to change a cohort.
|
|
|
58
70
|
The descriptor uses `schemaVersion: 1`, `kind: "skillfit.replay-package"`,
|
|
59
71
|
`sourcePlanSha256`, `nativeStatus`, `hasManifest` and a relative-path-to-SHA-256
|
|
60
72
|
`files` map. It inventories every payload file except itself and Git internals.
|
|
73
|
+
New exports add `evaluationType: "paired" | "calibration" | "trigger"`, checked
|
|
74
|
+
against the frozen native plan. Older v1 descriptors without that field remain
|
|
75
|
+
readable.
|
|
61
76
|
Extra, changed, missing and unsafe paths fail verification. Checksums establish
|
|
62
77
|
consistency with this index, not publisher identity; retain a trusted external
|
|
63
78
|
copy of the descriptor or its hash for provenance.
|
|
@@ -69,6 +84,12 @@ count (excluding generated metadata), `modelCalls: 0` and
|
|
|
69
84
|
evaluation error envelope and exit 2. Export cannot be mixed with `--replay`,
|
|
70
85
|
`--records` or `--policy`.
|
|
71
86
|
|
|
87
|
+
Current source also returns `inputSource: "sealed-snapshot"` for archived inputs
|
|
88
|
+
or `"original-or-recovered"` for historical runs. Native archives remain unchanged
|
|
89
|
+
inside `run/`; portable layout inputs/runtime are extra copies counted by the
|
|
90
|
+
export preview. Per-run snapshot copy time and storage are recorded separately
|
|
91
|
+
in the native plan and JSON assessment's `inputSnapshot.cost`.
|
|
92
|
+
|
|
72
93
|
## Evidence and sharing boundaries
|
|
73
94
|
|
|
74
95
|
Stopped or incomplete native runs can be exported with their partial/unknown
|
|
@@ -76,10 +97,30 @@ spending and remain stopped/incomplete and ineligible. An offline replay reprodu
|
|
|
76
97
|
saved outcomes and accounting; it creates no new observations, independent holdout
|
|
77
98
|
or upgrade authorization. Statistical and acceptance policies are unchanged.
|
|
78
99
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
Calibration and trigger exports verify the single-arm plan, session, ledger,
|
|
101
|
+
receipts, task summaries and available usage. Replay regrades saved deliveries in
|
|
102
|
+
temporary directories with the pinned local verifier. Trigger observations remain
|
|
103
|
+
the recorded `triggered` values: replay starts no Agent and does not attempt new
|
|
104
|
+
discovery detection. The report uses `evidence.scope: "single-arm-native"`;
|
|
105
|
+
`verified` establishes consistency of retained observations, never a paired
|
|
106
|
+
improvement or adoption decision. Standalone historical summaries without a
|
|
107
|
+
sealed native run cannot be replayed or promoted into native exports.
|
|
108
|
+
An older single-arm run whose pinned implementation predates replay support
|
|
109
|
+
cannot produce an executable replay package; export explains that limitation
|
|
110
|
+
instead of replacing the original implementation with newer code.
|
|
111
|
+
|
|
112
|
+
Paired judge exports require separately sealed review-call receipts and full
|
|
113
|
+
invocation accounting. Replay audits retained judge outputs, scores and costs;
|
|
114
|
+
it does not call the judge again. Primary Agent costs and additional judge costs
|
|
115
|
+
remain separate, with a combined invocation population. Historical judge runs
|
|
116
|
+
without those receipts retain unknown judge/combined costs in reports and cannot
|
|
117
|
+
claim a complete portable export.
|
|
118
|
+
|
|
119
|
+
Missing invocation receipts in stopped single-arm runs remain unknown usage;
|
|
120
|
+
available final and partial counters are retained as recorded. Replay cannot
|
|
121
|
+
turn partial usage into a complete total or invent unfinished task metrics.
|
|
122
|
+
Legacy/redacted public archives retain their dated replay recipes and cannot be
|
|
123
|
+
relabeled as complete native exports.
|
|
83
124
|
|
|
84
125
|
Export only writes locally. It includes project files, prompts, outputs and paths;
|
|
85
126
|
review those contents before sharing. Global configuration/Skill trees are not
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Skillfit offline Agent environment preflight version 1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "kind", "scope", "status", "matrix", "checks", "summary", "cost"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"schemaVersion": { "const": 1 }, "kind": { "const": "skillfit.agent-preflight" },
|
|
8
|
+
"scope": { "const": "offline-agent-environment" }, "status": { "enum": ["ready", "blocked"] },
|
|
9
|
+
"matrix": { "type": "object", "required": ["schemaVersion", "verifiedAt"], "properties": {
|
|
10
|
+
"schemaVersion": { "type": "integer", "minimum": 1 }, "verifiedAt": { "type": "string" }
|
|
11
|
+
} },
|
|
12
|
+
"checks": { "type": "array", "minItems": 1, "items": {
|
|
13
|
+
"type": "object", "required": ["code", "role", "agent", "status", "message", "remediation", "paths"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"code": { "enum": ["CLI_AVAILABLE", "MATRIX_CAPABILITY", "EXECUTOR_INJECTED", "AUTHENTICATION", "GLOBAL_SKILL_CONFLICT", "GLOBAL_SKILL_SCAN", "ENVIRONMENT_CHANGED"] },
|
|
16
|
+
"role": { "enum": ["agent", "judge"] }, "agent": { "type": ["string", "null"] },
|
|
17
|
+
"status": { "enum": ["PASS", "FAIL", "UNKNOWN", "INFO"] }, "message": { "type": "string" },
|
|
18
|
+
"remediation": { "type": ["string", "null"] }, "paths": { "type": "array", "items": { "type": "string" } }
|
|
19
|
+
},
|
|
20
|
+
"allOf": [{ "if": { "properties": { "code": { "const": "AUTHENTICATION" } } },
|
|
21
|
+
"then": { "properties": { "status": { "const": "UNKNOWN" }, "paths": { "maxItems": 0 } } } }]
|
|
22
|
+
} },
|
|
23
|
+
"summary": { "type": "object", "required": ["failures", "passed", "unknown", "info"], "properties": {
|
|
24
|
+
"failures": { "type": "integer", "minimum": 0 }, "passed": { "type": "integer", "minimum": 0 },
|
|
25
|
+
"unknown": { "type": "integer", "minimum": 0 }, "info": { "type": "integer", "minimum": 0 }
|
|
26
|
+
} },
|
|
27
|
+
"cost": { "type": "object", "required": ["modelCalls", "cliInvocations"], "properties": {
|
|
28
|
+
"modelCalls": { "const": 0 }, "cliInvocations": { "const": 0 }
|
|
29
|
+
} }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Skillfit offline calibration plan version 1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "kind", "planSha256", "implementationSha256", "bench", "agent", "executor", "inputMode", "trials", "plannedCalls", "maxCalls", "executorTimeoutSeconds", "runGroup", "runsRoot", "outputDir", "guardFiles", "agentPreflight", "casePreflight"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"schemaVersion": { "const": 1 }, "kind": { "const": "skillfit.calibration-plan" },
|
|
8
|
+
"planSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
9
|
+
"implementationSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
10
|
+
"bench": { "type": "object", "required": ["dir", "name", "sha256", "taskIds"] },
|
|
11
|
+
"agent": { "type": ["string", "null"] }, "executor": { "type": ["object", "null"] },
|
|
12
|
+
"inputMode": { "enum": ["snapshot", "workspace"] },
|
|
13
|
+
"trials": { "type": "integer", "minimum": 1, "maximum": 20 },
|
|
14
|
+
"plannedCalls": { "type": "integer", "minimum": 1 }, "maxCalls": { "type": "integer", "minimum": 1 },
|
|
15
|
+
"executorTimeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 3600 },
|
|
16
|
+
"spendingBudget": { "type": "object", "required": ["input", "cachedInput", "uncachedInput", "output", "durationSeconds"] },
|
|
17
|
+
"runGroup": { "type": "string", "minLength": 1 }, "runsRoot": { "type": "string", "minLength": 1 }, "outputDir": { "type": "string", "minLength": 1 },
|
|
18
|
+
"guardFiles": { "type": "array" }, "agentPreflight": { "$ref": "agent-preflight.schema.json" },
|
|
19
|
+
"casePreflight": { "type": "object", "required": ["schemaVersion", "scope", "required", "status"],
|
|
20
|
+
"properties": { "schemaVersion": { "const": 1 }, "scope": { "const": "offline-case-integrity" }, "required": { "const": true }, "status": { "const": "pending" } } }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Skillfit calibration command response version 1",
|
|
4
|
+
"anyOf": [
|
|
5
|
+
{
|
|
6
|
+
"type": "object", "required": ["schemaVersion", "kind", "status", "plan", "acceptance"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": 1 }, "kind": { "const": "skillfit.calibration-result" }, "status": { "const": "planned" },
|
|
9
|
+
"plan": { "$ref": "calibration-plan.schema.json" },
|
|
10
|
+
"acceptance": { "type": "object", "required": ["decision", "eligibleForUpgrade", "automaticUpgrade"],
|
|
11
|
+
"properties": { "decision": { "const": "inconclusive" }, "eligibleForUpgrade": { "const": false }, "automaticUpgrade": { "const": false } } }
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{ "$ref": "single-arm-report.schema.json" },
|
|
15
|
+
{ "allOf": [{ "$ref": "eval-result.schema.json" }, { "properties": { "kind": { "const": "skillfit.eval-error" } } }] }
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Skillfit offline evaluation case preflight version 1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["schemaVersion", "kind", "scope", "status", "bench", "checks", "summary", "cost"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": 1 },
|
|
9
|
+
"kind": { "const": "skillfit.eval-preflight" },
|
|
10
|
+
"scope": { "const": "offline-case-integrity" },
|
|
11
|
+
"status": { "enum": ["ready", "blocked"] },
|
|
12
|
+
"bench": {
|
|
13
|
+
"type": "object", "additionalProperties": false,
|
|
14
|
+
"required": ["dir", "sha256", "taskIds"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"dir": { "type": "string" },
|
|
17
|
+
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
18
|
+
"taskIds": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"checks": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "object", "additionalProperties": false,
|
|
25
|
+
"required": ["code", "status", "message", "taskId", "location", "remediation", "evidence"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"code": { "enum": ["BENCH_LOAD", "UNTOUCHED_FIXTURE", "MISSING_OUTPUT", "EMPTY_OUTPUT", "FACET_COUNT", "ORACLE", "MOCK_COVERAGE", "MOCK_MARKER", "MOCK_BASELINE", "MOCK_TREATMENT", "FIXTURE_SIZE", "TRIGGER_LABEL", "NEGATIVE_CONTROLS", "LIVE_DIFFICULTY", "INPUT_CHANGED", "CHECK_ERROR"] },
|
|
28
|
+
"status": { "enum": ["PASS", "FAIL", "WARN", "UNKNOWN", "INFO"] },
|
|
29
|
+
"message": { "type": "string" },
|
|
30
|
+
"taskId": { "type": ["string", "null"] },
|
|
31
|
+
"location": { "$ref": "bench-check.schema.json#/properties/checks/items/properties/location" },
|
|
32
|
+
"remediation": { "type": ["string", "null"] },
|
|
33
|
+
"evidence": { "$ref": "bench-check.schema.json#/properties/checks/items/properties/evidence" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"summary": {
|
|
38
|
+
"type": "object", "additionalProperties": false,
|
|
39
|
+
"required": ["failures", "warnings", "unknown", "passed", "info"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"failures": { "type": "integer", "minimum": 0 },
|
|
42
|
+
"warnings": { "type": "integer", "minimum": 0 },
|
|
43
|
+
"unknown": { "type": "integer", "minimum": 0 },
|
|
44
|
+
"passed": { "type": "integer", "minimum": 0 },
|
|
45
|
+
"info": { "type": "integer", "minimum": 0 }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"cost": {
|
|
49
|
+
"type": "object", "additionalProperties": false,
|
|
50
|
+
"required": ["modelCalls", "durationMs"],
|
|
51
|
+
"properties": { "modelCalls": { "const": 0 }, "durationMs": { "type": "integer", "minimum": 0 } }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"allOf": [
|
|
55
|
+
{ "if": { "properties": { "status": { "const": "ready" } } }, "then": { "properties": { "summary": { "properties": { "failures": { "const": 0 } } } } }, "else": { "properties": { "summary": { "properties": { "failures": { "minimum": 1 } } } } } }
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"required": ["schemaVersion", "baselineSkill", "candidateSkill", "bench", "agent", "purpose", "trials", "maxCalls", "runsRoot", "runGroup"],
|
|
7
7
|
"properties": {
|
|
8
8
|
"schemaVersion": { "const": 1 },
|
|
9
|
-
"baselineSkill": { "$ref": "#/$defs/path" },
|
|
9
|
+
"baselineSkill": { "anyOf": [{ "$ref": "#/$defs/path" }, { "type": "null" }], "description": "Previous complete Skill directory, or explicit null for no Skill installed by the harness in baseline." },
|
|
10
10
|
"candidateSkill": { "$ref": "#/$defs/path" },
|
|
11
11
|
"bench": { "$ref": "#/$defs/path" },
|
|
12
12
|
"agent": { "enum": ["codex", "claude-code", "kimi-code"] },
|
|
@@ -7,8 +7,20 @@
|
|
|
7
7
|
"schemaVersion": { "const": 1 },
|
|
8
8
|
"kind": { "enum": ["skillfit.eval-result", "skillfit.eval-error"] },
|
|
9
9
|
"status": { "enum": ["planned", "completed", "stopped", "incomplete", "reported", "error"] },
|
|
10
|
-
"plan": { "type": "object", "required": ["sha256", "
|
|
10
|
+
"plan": { "type": "object", "required": ["sha256", "evaluation"] },
|
|
11
11
|
"manifest": { "type": ["object", "null"] },
|
|
12
|
+
"casePreflight": { "anyOf": [{ "$ref": "eval-preflight.schema.json" }, { "type": "null" }] },
|
|
13
|
+
"agentPreflight": { "anyOf": [{ "$ref": "agent-preflight.schema.json" }, { "type": "null" }] },
|
|
14
|
+
"inputSnapshot": {
|
|
15
|
+
"type": ["object", "null"],
|
|
16
|
+
"required": ["schemaVersion", "indexPath", "sha256", "cost"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"schemaVersion": { "const": 1 }, "indexPath": { "const": "_inputs.json" },
|
|
19
|
+
"sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
20
|
+
"cost": { "type": "object", "required": ["modelCalls", "durationMs", "bytes", "files"],
|
|
21
|
+
"properties": { "modelCalls": { "const": 0 }, "durationMs": { "type": "integer", "minimum": 0 }, "bytes": { "type": "integer", "minimum": 0 }, "files": { "type": "integer", "minimum": 0 } } }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
12
24
|
"identity": { "type": "object" },
|
|
13
25
|
"quality": { "type": "object", "required": ["statisticalVerdict", "improvedPairs", "regressedPairs", "tasks"] },
|
|
14
26
|
"costs": {
|
|
@@ -25,6 +37,7 @@
|
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
39
|
},
|
|
40
|
+
"invocationCosts": { "anyOf": [{ "$ref": "invocation-costs.schema.json" }, { "type": "null" }] },
|
|
28
41
|
"evidence": { "type": "object", "required": ["verified"] },
|
|
29
42
|
"acceptance": {
|
|
30
43
|
"type": "object", "required": ["decision", "eligibleForUpgrade", "automaticUpgrade"],
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Skillfit complete executor invocation costs version 1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "agent", "judge", "total", "judgeUsage"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"schemaVersion": { "const": 1 },
|
|
8
|
+
"agent": { "$ref": "#/$defs/population" },
|
|
9
|
+
"judge": { "anyOf": [{ "$ref": "#/$defs/population" }, { "type": "null" }] },
|
|
10
|
+
"total": { "anyOf": [{ "$ref": "#/$defs/population" }, { "type": "null" }] },
|
|
11
|
+
"judgeUsage": { "enum": ["recorded", "unknown", "not-requested"] }
|
|
12
|
+
},
|
|
13
|
+
"$defs": {
|
|
14
|
+
"measure": {
|
|
15
|
+
"type": "object", "required": ["knownTotal", "coverage"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"knownTotal": { "type": "number", "minimum": 0 },
|
|
18
|
+
"coverage": { "type": "object", "required": ["final", "partial", "unknown"],
|
|
19
|
+
"properties": { "final": { "type": "integer", "minimum": 0 }, "partial": { "type": "integer", "minimum": 0 }, "unknown": { "type": "integer", "minimum": 0 } } }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"population": {
|
|
23
|
+
"type": "object", "required": ["runs", "passes", "metrics"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"runs": { "type": "integer", "minimum": 0 }, "passes": { "type": "integer", "minimum": 0 },
|
|
26
|
+
"metrics": { "type": "object", "required": ["input", "cachedInput", "uncachedInput", "output", "durationSeconds"],
|
|
27
|
+
"properties": { "input": { "$ref": "#/$defs/measure" }, "cachedInput": { "$ref": "#/$defs/measure" }, "uncachedInput": { "$ref": "#/$defs/measure" }, "output": { "$ref": "#/$defs/measure" }, "durationSeconds": { "$ref": "#/$defs/measure" } } }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Skillfit independent judge call receipt version 1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "kind", "taskId", "trial", "callIndex", "seed", "firstCondition", "prompt", "promptSha256", "output", "rawOutput", "executor", "startedAt", "finishedAt", "timing", "scores", "error", "executorInvoked", "tokens", "usageStatus", "durationSeconds", "passed"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"schemaVersion": { "const": 1 }, "kind": { "const": "skillfit.judge-call" },
|
|
8
|
+
"taskId": { "type": "string" }, "trial": { "type": "integer", "minimum": 1, "maximum": 20 },
|
|
9
|
+
"callIndex": { "enum": [1, 2] }, "firstCondition": { "enum": ["baseline", "treatment"] },
|
|
10
|
+
"seed": { "type": "string" }, "executor": { "type": "object", "required": ["kind", "model"] },
|
|
11
|
+
"startedAt": { "type": "string", "format": "date-time" }, "finishedAt": { "type": "string", "format": "date-time" },
|
|
12
|
+
"timing": { "type": "object", "required": ["clock", "wallDurationSeconds", "execution"],
|
|
13
|
+
"properties": { "clock": { "const": "performance.now" }, "wallDurationSeconds": { "type": "number" }, "execution": { "type": ["object", "null"] } } },
|
|
14
|
+
"scores": { "type": ["object", "null"], "required": ["baseline", "treatment"],
|
|
15
|
+
"properties": { "baseline": { "type": "integer", "minimum": 0, "maximum": 3 }, "treatment": { "type": "integer", "minimum": 0, "maximum": 3 } } },
|
|
16
|
+
"prompt": { "type": "string" }, "promptSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
17
|
+
"output": { "type": "string" }, "rawOutput": { "type": ["string", "null"] },
|
|
18
|
+
"error": { "type": ["string", "null"] }, "executorInvoked": { "type": "boolean" },
|
|
19
|
+
"tokens": { "type": ["object", "null"] }, "usageStatus": { "enum": ["final", "partial", "unknown"] },
|
|
20
|
+
"durationSeconds": { "type": "number", "minimum": 0 }, "passed": { "type": "boolean" }
|
|
21
|
+
}
|
|
22
|
+
}
|