skillfit 0.11.0 → 0.13.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 +68 -104
- package/README.zh-CN.md +68 -101
- package/benches/README.md +6 -2
- package/dist/cli.js +28 -16
- package/dist/commands/bench-calibration.js +5 -1
- package/dist/commands/bench-check-report.js +1 -34
- package/dist/commands/bench-draft.js +167 -0
- package/dist/commands/bench-draft.test.js +168 -0
- package/dist/commands/bench-manage.js +5 -4
- package/dist/commands/bench-source.js +101 -0
- package/dist/commands/bench-source.test.js +84 -0
- package/dist/commands/bench.js +157 -328
- package/dist/commands/eval-api-failure.test.js +46 -0
- package/dist/commands/eval-layout.test.js +126 -0
- package/dist/commands/eval-preflight-error.js +9 -0
- package/dist/commands/eval-preflight.js +4 -11
- package/dist/commands/eval-report.js +6 -459
- package/dist/commands/eval.js +7 -32
- package/dist/commands/install.js +14 -98
- package/dist/harness/agent-preflight.js +18 -2
- package/dist/harness/bench-check.js +277 -0
- package/dist/harness/bench-diagnostics.js +34 -0
- package/dist/harness/bench-location.js +29 -0
- package/dist/harness/bench-location.test.js +33 -0
- package/dist/harness/bench.js +8 -3
- package/dist/harness/eval-acceptance.js +1 -1
- package/dist/harness/eval-audit.js +2 -2
- package/dist/harness/eval-manifest.js +456 -0
- package/dist/harness/evaluation-layout.js +30 -0
- package/dist/harness/executors/api.js +20 -7
- package/dist/harness/executors/cli.js +15 -25
- package/dist/harness/experiment-session.js +5 -15
- package/dist/harness/hash.js +3 -1
- package/dist/harness/runner.js +5 -4
- package/dist/harness/single-arm-audit.js +1 -1
- package/dist/harness/trigger.js +1 -1
- package/dist/harness/verifier-timeout.js +8 -0
- package/dist/harness/verifier-timeout.test.js +76 -0
- package/dist/install/constants.js +1 -0
- package/dist/install/transaction.js +112 -0
- package/docs/README.md +65 -0
- package/docs/architecture.md +86 -0
- package/docs/archive-delivery.md +83 -0
- package/docs/archive-inventory.md +91 -0
- package/docs/bench-authoring.md +23 -3
- package/docs/bench-drafting.md +75 -0
- package/docs/case-management.md +12 -1
- package/docs/eval-agent-preflight.md +15 -2
- package/docs/eval-costs.md +28 -2
- package/docs/eval-planning.md +14 -0
- package/docs/evaluation-input-snapshots.md +20 -4
- package/docs/evaluation-reports.md +1 -1
- package/docs/first-real-eval.md +28 -3
- package/docs/growth-roadmap-2026-10.md +23 -18
- package/docs/package-contents.md +73 -0
- package/docs/plans/2026-10-17-workflow-foundations.md +37 -2
- package/docs/plans/2026-10-20-archive-replay-verification.json +125 -0
- package/docs/plans/2026-10-20-archive-source-verification.json +256 -0
- package/docs/plans/2026-10-20-delivery-verification.json +146 -0
- package/docs/plans/2026-10-20-docs-architecture-cleanup.md +233 -0
- package/docs/plans/2026-10-20-install-transactions-and-archive-delivery.md +233 -0
- package/docs/plans/2026-10-21-npm-0.13.0-release.md +41 -0
- package/docs/releases/0.11.0-ci-registry-install.json +130 -0
- package/docs/releases/0.11.0-feature-smoke.json +1576 -0
- package/docs/releases/0.11.0-local-attempt-1.json +24 -0
- package/docs/releases/0.11.0-local-attempt-1.log +19 -0
- package/docs/releases/0.11.0-local-registry-install.json +25 -0
- package/docs/releases/0.11.0-registry-metadata.json +33 -0
- package/docs/releases/0.11.0-signatures.txt +12 -0
- package/docs/releases/0.11.0-verification.json +95 -0
- package/docs/releases/0.11.0.md +54 -11
- package/docs/releases/0.12.0-attestation-check.json +22 -0
- package/docs/releases/0.12.0-attestations.json +155 -0
- package/docs/releases/0.12.0-ci-registry-install.json +90 -0
- package/docs/releases/0.12.0-feature-smoke.json +34 -0
- package/docs/releases/0.12.0-feature-smoke.mjs +73 -0
- package/docs/releases/0.12.0-foundations-smoke.json +1576 -0
- package/docs/releases/0.12.0-local-registry-install.json +75 -0
- package/docs/releases/0.12.0-preparation-attempt-1.json +22 -0
- package/docs/releases/0.12.0-registry-metadata.json +96 -0
- package/docs/releases/0.12.0-signatures.txt +6 -0
- package/docs/releases/0.12.0-verification.json +99 -0
- package/docs/releases/0.12.0.md +82 -0
- package/docs/releases/0.13.0-feature-smoke.mjs +114 -0
- package/docs/releases/0.13.0-preparation.json +102 -0
- package/docs/releases/0.13.0.md +61 -0
- package/docs/releases/archive-delivery-smoke.mjs +37 -0
- package/docs/reproducible-offline-example.md +1 -1
- package/docs/schemas/agent-preflight.schema.json +1 -1
- package/docs/verifier-contract.md +9 -0
- package/evidence/README.md +24 -1
- package/evidence/archive-catalog.v1.json +8044 -0
- package/evidence/fetch-archives.mjs +211 -0
- package/package.json +9 -2
- package/skills/skillfit/SKILL.md +25 -5
- package/dist/cli.test.js +0 -193
- package/dist/commands/bench-calibration.test.js +0 -237
- package/dist/commands/bench-check-json.test.js +0 -242
- package/dist/commands/bench-manage.test.js +0 -87
- package/dist/commands/bench.test.js +0 -1162
- package/dist/commands/bundle.test.js +0 -142
- package/dist/commands/calibration-cli.test.js +0 -145
- package/dist/commands/doctor.test.js +0 -280
- package/dist/commands/eval-agent-preflight.test.js +0 -245
- package/dist/commands/eval-export-modes.test.js +0 -350
- package/dist/commands/eval-export.test.js +0 -279
- package/dist/commands/eval-interruption.test.js +0 -238
- package/dist/commands/eval-preflight.test.js +0 -382
- package/dist/commands/eval-report.test.js +0 -367
- package/dist/commands/eval.test.js +0 -503
- package/dist/commands/evaluation-report.test.js +0 -243
- package/dist/commands/install.test.js +0 -555
- package/dist/commands/replay-cancellation.test.js +0 -105
- package/dist/commands/report.test.js +0 -110
- package/dist/commands/setup.test.js +0 -150
- package/dist/commands/upstream.test.js +0 -139
- package/dist/commands/workflow-entrypoints.test.js +0 -137
- package/dist/docs.test.js +0 -154
- package/dist/frontmatter.test.js +0 -49
- package/dist/harness/bench.test.js +0 -109
- package/dist/harness/bundle.test.js +0 -71
- package/dist/harness/codex-usage.test.js +0 -87
- package/dist/harness/costs.test.js +0 -92
- package/dist/harness/eval-budget.test.js +0 -237
- package/dist/harness/eval-component.test.js +0 -770
- package/dist/harness/eval-efficiency.test.js +0 -56
- package/dist/harness/execution-timing.test.js +0 -61
- package/dist/harness/executors/api.test.js +0 -136
- package/dist/harness/executors/cli.test.js +0 -510
- package/dist/harness/executors/mock.test.js +0 -43
- package/dist/harness/experiment-session.test.js +0 -317
- package/dist/harness/installed-skill.test.js +0 -162
- package/dist/harness/interruption.test.js +0 -31
- package/dist/harness/judge-accounting.test.js +0 -216
- package/dist/harness/judge.test.js +0 -181
- package/dist/harness/kimi-usage.test.js +0 -62
- package/dist/harness/native-diff.test.js +0 -53
- package/dist/harness/oss-lru-cache.test.js +0 -79
- package/dist/harness/oss-normalize-url.test.js +0 -64
- package/dist/harness/oss-regression-witness.test.js +0 -89
- package/dist/harness/oss-skill-followup.test.js +0 -59
- package/dist/harness/prompt.test.js +0 -48
- package/dist/harness/receipts.test.js +0 -148
- package/dist/harness/report.test.js +0 -297
- package/dist/harness/runner.test.js +0 -635
- package/dist/harness/skill-revision.test.js +0 -148
- package/dist/harness/stats.test.js +0 -124
- package/dist/harness/target.test.js +0 -60
- package/dist/harness/trigger.test.js +0 -261
- package/dist/harness/verifier-summary.test.js +0 -99
- package/dist/harness/verifier.test.js +0 -128
- package/dist/harness/waza-behavior.test.js +0 -139
- package/dist/mcp/probe.test.js +0 -139
- package/evidence/artifacts/2026-10-12-diagnosing-revision/calibration-records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-diagnosing-revision/interrupted-records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-diagnosing-revision/validation-records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-diagnosing-v2/regression-records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-diagnosing-v2/transfer-records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-normalize-url-v2-available/readiness-records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-normalize-url-v2-comparison/records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-normalize-url-v2-recovery/records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-12-normalize-url-v2-validated/records.tar.gz +0 -0
- package/evidence/artifacts/2026-10-13-debugging-completed-development/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-13-debugging-controls-and-sleep-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-13-debugging-development-stops/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-14-debugging-followup-routing-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-14-debugging-independent-validation/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-14-debugging-reading-pilot-and-cost-review/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-14-debugging-spending-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { test } from 'node:test';
|
|
6
|
+
import { ApiExecutor } from '../harness/executors/api.js';
|
|
7
|
+
import { runBenchInit } from './bench.js';
|
|
8
|
+
import { runEval } from './eval.js';
|
|
9
|
+
import { readEvaluationReport } from './evaluation-report.js';
|
|
10
|
+
for (const role of ['agent', 'judge'])
|
|
11
|
+
test(`failed ${role} API content retains known final costs in stopped reports`, async (t) => {
|
|
12
|
+
const root = mkdtempSync(join(tmpdir(), 'skillfit-api-failure-'));
|
|
13
|
+
t.after(() => rmSync(root, { recursive: true, force: true }));
|
|
14
|
+
const skill = join(root, 'skill'), bench = join(root, 'bench'), run = join(root, 'runs', 'failed');
|
|
15
|
+
mkdirSync(skill);
|
|
16
|
+
writeFileSync(join(skill, 'SKILL.md'), '# Offline response failure regression\n');
|
|
17
|
+
await runBenchInit({ dir: bench, yes: true, log: () => { } });
|
|
18
|
+
let apiCalls = 0, primaryCalls = 0;
|
|
19
|
+
const payload = { choices: [{ message: { content: null, refusal: 'synthetic response' } }],
|
|
20
|
+
usage: { prompt_tokens: 123, completion_tokens: 17, prompt_tokens_details: { cached_tokens: 23 } } };
|
|
21
|
+
const api = new ApiExecutor({ apiKey: 'synthetic-api-key', fetchImpl: async () => { apiCalls++; return new Response(JSON.stringify(payload)); } });
|
|
22
|
+
const primary = { describe: () => ({ kind: 'mock', model: 'offline-primary' }), run: async () => {
|
|
23
|
+
primaryCalls++;
|
|
24
|
+
return { output: 'skillfit-ok', tokens: { input: 10, cachedInput: 4, output: 2 } };
|
|
25
|
+
} };
|
|
26
|
+
await assert.rejects(runEval({ skillPath: skill, bench, trials: 1, dryRun: false, yes: true, runsRoot: join(root, 'runs'), runGroup: 'failed',
|
|
27
|
+
executor: role === 'agent' ? api : primary, judgeExecutor: role === 'judge' ? api : null,
|
|
28
|
+
spendingBudget: { input: 1000, cachedInput: 1000, uncachedInput: 1000, output: 1000, durationSeconds: 1000 }, log: () => { } }), /EXECUTION_FAILED|choices\[0\]/);
|
|
29
|
+
assert.equal(apiCalls, 1);
|
|
30
|
+
assert.equal(primaryCalls, role === 'agent' ? 0 : 2);
|
|
31
|
+
const report = await readEvaluationReport(run);
|
|
32
|
+
assert.equal(report.status, 'stopped');
|
|
33
|
+
assert.ok('invocationCosts' in report);
|
|
34
|
+
const costs = report.invocationCosts?.total;
|
|
35
|
+
assert.ok(costs);
|
|
36
|
+
assert.equal(costs.metrics.input.knownTotal, role === 'agent' ? 123 : 143);
|
|
37
|
+
assert.equal(costs.metrics.cachedInput.knownTotal, role === 'agent' ? 23 : 31);
|
|
38
|
+
assert.equal(costs.metrics.output.knownTotal, role === 'agent' ? 17 : 21);
|
|
39
|
+
assert.equal(costs.metrics.input.coverage.final, role === 'agent' ? 1 : 3);
|
|
40
|
+
assert.equal(report.acceptance.eligibleForUpgrade, false);
|
|
41
|
+
assert.equal(report.acceptance.automaticUpgrade, false);
|
|
42
|
+
const evidence = role === 'agent' ? readFileSync(join(run, 'example-task/baseline/trial-1/_transcript.jsonl'), 'utf8')
|
|
43
|
+
: JSON.parse(readFileSync(join(run, 'example-task/judge-trial-1/call-1.json'), 'utf8')).rawOutput;
|
|
44
|
+
assert.deepEqual(JSON.parse(evidence), payload);
|
|
45
|
+
assert.equal(readFileSync(join(run, '_session.json'), 'utf8').includes('synthetic-api-key'), false);
|
|
46
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { test } from 'node:test';
|
|
8
|
+
import { runBenchInit, runBenchCalibration, prepareBenchCalibration } from './bench.js';
|
|
9
|
+
import { runEval } from './eval.js';
|
|
10
|
+
import { runEvalCli } from './eval-cli.js';
|
|
11
|
+
import { readEvaluationReport } from './evaluation-report.js';
|
|
12
|
+
import { exportEvaluation } from './eval-export.js';
|
|
13
|
+
import { loadBench } from '../harness/bench.js';
|
|
14
|
+
import { hashFileSet, listFilesRecursive } from '../harness/hash.js';
|
|
15
|
+
import { assertEvaluationOutputLayout } from '../harness/evaluation-layout.js';
|
|
16
|
+
async function fixture(t) {
|
|
17
|
+
const root = mkdtempSync(join(tmpdir(), 'skillfit-layout-'));
|
|
18
|
+
t.after(() => rmSync(root, { recursive: true, force: true }));
|
|
19
|
+
const bench = join(root, 'bench'), skill = join(root, 'skill'), old = join(root, 'old'), home = join(root, 'home');
|
|
20
|
+
await runBenchInit({ dir: bench, yes: true, log: () => { } });
|
|
21
|
+
for (const [dir, body] of [[skill, 'new'], [old, 'old']]) {
|
|
22
|
+
mkdirSync(dir);
|
|
23
|
+
writeFileSync(join(dir, 'SKILL.md'), `---\nname: layout-skill\ndescription: Offline layout regression.\n---\n${body}\n`);
|
|
24
|
+
}
|
|
25
|
+
mkdirSync(home);
|
|
26
|
+
const definition = JSON.parse(readFileSync(join(bench, 'bench.json'), 'utf8'));
|
|
27
|
+
definition.tasks[0].shouldTrigger = true;
|
|
28
|
+
writeFileSync(join(bench, 'bench.json'), JSON.stringify(definition));
|
|
29
|
+
let calls = 0;
|
|
30
|
+
const base = { skillPath: skill, bench, agent: 'codex', trials: 1, maxCalls: 2, dryRun: false, yes: true,
|
|
31
|
+
runsRoot: join(root, 'runs'), runGroup: 'study', judgeExecutor: null, log: () => { },
|
|
32
|
+
sessionOptions: { homeDir: home, env: {}, versionProbe: () => null },
|
|
33
|
+
executor: { describe: () => ({ kind: 'cli', model: 'offline-layout', detail: 'Injected offline test executor.' }), run: async () => {
|
|
34
|
+
calls++;
|
|
35
|
+
return { output: 'skillfit-ok', skillTriggered: true, tokens: { input: 10, cachedInput: 2, output: 3 } };
|
|
36
|
+
} } };
|
|
37
|
+
return { root, bench, skill, old, base, calls: () => calls };
|
|
38
|
+
}
|
|
39
|
+
test('bench Git directories/worktree files do not change input hashes; real task bytes still do', async (t) => {
|
|
40
|
+
const f = await fixture(t), original = loadBench(f.bench).contentSha256;
|
|
41
|
+
assert.equal(original, hashFileSet(f.bench, listFilesRecursive(f.bench)), 'Git-free fingerprints keep their previous meaning.');
|
|
42
|
+
mkdirSync(join(f.bench, '.git'));
|
|
43
|
+
writeFileSync(join(f.bench, '.git', 'HEAD'), 'ref: refs/heads/main\n');
|
|
44
|
+
const nested = join(f.bench, 'fixtures', 'example-task', '.git');
|
|
45
|
+
writeFileSync(nested, 'gitdir: /unread-worktree-metadata\n');
|
|
46
|
+
assert.equal(loadBench(f.bench).contentSha256, original);
|
|
47
|
+
writeFileSync(join(f.bench, '.git', 'HEAD'), 'ref: refs/heads/other\n');
|
|
48
|
+
assert.equal(loadBench(f.bench).contentSha256, original);
|
|
49
|
+
rmSync(join(f.bench, '.git'), { recursive: true });
|
|
50
|
+
writeFileSync(join(f.bench, '.git'), 'gitdir: /unread-worktree-metadata\n');
|
|
51
|
+
assert.equal(loadBench(f.bench).contentSha256, original);
|
|
52
|
+
writeFileSync(join(f.bench, 'prompts', 'example-task.md'), 'Changed actual task.');
|
|
53
|
+
assert.notEqual(loadBench(f.bench).contentSha256, original);
|
|
54
|
+
const definition = JSON.parse(readFileSync(join(f.bench, 'bench.json'), 'utf8'));
|
|
55
|
+
definition.tasks[0].prompt = '.git';
|
|
56
|
+
writeFileSync(join(f.bench, 'bench.json'), JSON.stringify(definition));
|
|
57
|
+
assert.throws(() => loadBench(f.bench), /cannot reference Git metadata/);
|
|
58
|
+
});
|
|
59
|
+
for (const mode of ['inject', 'installed', 'trigger', 'calibration'])
|
|
60
|
+
test(`${mode}: Git-root benches seal and audit without Git data`, async (t) => {
|
|
61
|
+
const f = await fixture(t);
|
|
62
|
+
mkdirSync(join(f.bench, '.git'));
|
|
63
|
+
writeFileSync(join(f.bench, '.git', 'HEAD'), 'metadata before preview');
|
|
64
|
+
const group = join(f.base.runsRoot, f.base.runGroup);
|
|
65
|
+
if (mode === 'calibration') {
|
|
66
|
+
const calibrate = { executor: f.base.executor, trials: 1, maxCalls: 1, runsRoot: f.base.runsRoot, runGroup: f.base.runGroup };
|
|
67
|
+
const preview = prepareBenchCalibration({ dir: f.bench, calibrate });
|
|
68
|
+
writeFileSync(join(f.bench, '.git', 'HEAD'), 'metadata after preview');
|
|
69
|
+
assert.equal(prepareBenchCalibration({ dir: f.bench, calibrate }).planSha256, preview.planSha256);
|
|
70
|
+
await runBenchCalibration({ dir: f.bench, calibrate: { ...calibrate, reviewedPlanSha256: preview.planSha256 }, log: () => { } });
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const base = { ...f.base, mode, ...(mode === 'installed' ? { baselineSkillPath: f.old } : {}) };
|
|
74
|
+
const preview = await runEvalCli({ ...base, dryRun: true });
|
|
75
|
+
writeFileSync(join(f.bench, '.git', 'HEAD'), 'metadata after preview');
|
|
76
|
+
assert.equal((await runEvalCli({ ...base, dryRun: true })).plan.sha256, preview.plan.sha256);
|
|
77
|
+
const executed = await runEvalCli(base, preview.plan.sha256);
|
|
78
|
+
assert.equal(executed.status, 'completed', 'executionError' in executed ? String(executed.executionError) : 'Expected a completed offline run.');
|
|
79
|
+
}
|
|
80
|
+
assert.equal(existsSync(join(group, '_inputs', 'bench', '.git')), false);
|
|
81
|
+
const report = await readEvaluationReport(group, { replay: true });
|
|
82
|
+
assert.equal(report.status, 'completed', readFileSync(join(group, '_session.json'), 'utf8'));
|
|
83
|
+
assert.equal(report.evidence.verified, true, report.evidence.reasons.join('; '));
|
|
84
|
+
const calls = f.calls();
|
|
85
|
+
assert.equal(calls, mode === 'calibration' || mode === 'trigger' ? 1 : 2);
|
|
86
|
+
if (mode === 'inject') {
|
|
87
|
+
const portable = join(f.root, 'portable');
|
|
88
|
+
await exportEvaluation(group, portable, { yes: true, log: () => { } });
|
|
89
|
+
const moved = join(f.root, 'moved');
|
|
90
|
+
renameSync(portable, moved);
|
|
91
|
+
rmSync(f.bench, { recursive: true });
|
|
92
|
+
rmSync(f.skill, { recursive: true });
|
|
93
|
+
rmSync(group, { recursive: true });
|
|
94
|
+
const replay = spawnSync(process.execPath, [join(moved, 'reproduce.mjs')], { encoding: 'utf8', timeout: 30_000, maxBuffer: 8 * 1024 * 1024 });
|
|
95
|
+
assert.equal(replay.status, 0, replay.stderr);
|
|
96
|
+
assert.equal(JSON.parse(replay.stdout).evidence.verified, true);
|
|
97
|
+
assert.equal(f.calls(), calls);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
test('every preview rejects output inside inputs before probes, calls or directories, including aliases', async (t) => {
|
|
101
|
+
const f = await fixture(t), marker = join(f.root, 'verifier-ran');
|
|
102
|
+
writeFileSync(join(f.bench, 'verifiers', 'example-task.mjs'), `import{writeFileSync}from'node:fs';writeFileSync(${JSON.stringify(marker)},'probed');process.exit(1);`);
|
|
103
|
+
const alias = join(f.root, 'bench-alias');
|
|
104
|
+
symlinkSync(f.bench, alias, process.platform === 'win32' ? 'junction' : 'dir');
|
|
105
|
+
const roots = [join(f.bench, 'runs'), join(f.bench, 'fixtures', 'example-task', 'runs'), join(f.skill, 'runs'), join(alias, 'new', 'runs'), join(f.root, '.git', 'runs')];
|
|
106
|
+
for (const mode of ['inject', 'installed', 'trigger']) {
|
|
107
|
+
for (const runsRoot of [...roots, ...(mode === 'installed' ? [join(f.old, 'runs')] : [])]) {
|
|
108
|
+
await assert.rejects(runEvalCli({ ...f.base, mode, runsRoot, dryRun: true,
|
|
109
|
+
...(mode === 'installed' ? { baselineSkillPath: f.old } : {}) }), /output must be outside/);
|
|
110
|
+
assert.equal(existsSync(join(runsRoot, 'study')), false);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
for (const runsRoot of [roots[0], roots[3], roots[4]])
|
|
114
|
+
assert.throws(() => prepareBenchCalibration({ dir: f.bench,
|
|
115
|
+
calibrate: { executor: f.base.executor, trials: 1, runsRoot, runGroup: 'study' } }), /output must be outside/);
|
|
116
|
+
await assert.rejects(runEval({ ...f.base, runsRoot: roots[0] }), /output must be outside/);
|
|
117
|
+
assert.equal(existsSync(marker), false);
|
|
118
|
+
assert.equal(f.calls(), 0);
|
|
119
|
+
assert.throws(() => assertEvaluationOutputLayout(fileURLToPath(new URL('../not-created', import.meta.url)), { benchDir: f.bench }), /output must be outside/);
|
|
120
|
+
const cli = spawnSync(process.execPath, [fileURLToPath(new URL('../cli.js', import.meta.url)), 'eval', f.skill,
|
|
121
|
+
'--bench', f.bench, '--agent', 'codex', '--runs-root', roots[0], '--run-group', 'study', '--dry-run', '--json'], { encoding: 'utf8', env: { PATH: '' } });
|
|
122
|
+
assert.equal(cli.status, 2);
|
|
123
|
+
assert.equal(JSON.parse(cli.stdout).kind, 'skillfit.eval-error');
|
|
124
|
+
assert.equal(existsSync(marker), false);
|
|
125
|
+
assert.equal(f.calls(), 0);
|
|
126
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class CasePreflightFailed extends Error {
|
|
2
|
+
preflight;
|
|
3
|
+
constructor(preflight) {
|
|
4
|
+
super('Offline case preflight blocked evaluation; no agent or judge calls were made.\n' +
|
|
5
|
+
preflight.checks.filter(c => c.status === 'FAIL').map(c => `[FAIL] ${c.code}${c.taskId ? ` (${c.taskId})` : ''}: ${c.message}${c.remediation ? ` Remedy: ${c.remediation}` : ''}`).join('\n'));
|
|
6
|
+
this.preflight = preflight;
|
|
7
|
+
this.name = 'CasePreflightFailed';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
+
import { CasePreflightFailed } from './eval-preflight-error.js';
|
|
2
|
+
export { CasePreflightFailed } from './eval-preflight-error.js';
|
|
1
3
|
import { loadBench } from '../harness/bench.js';
|
|
2
4
|
import { collectInstalledSkillTarget } from '../harness/installed-skill.js';
|
|
3
5
|
import { throwIfEvaluationInterrupted } from '../harness/interruption.js';
|
|
4
6
|
import { collectEvaluationTarget } from '../harness/target.js';
|
|
5
|
-
import {
|
|
7
|
+
import { runOfflineBenchCheck } from '../harness/bench-check.js';
|
|
6
8
|
export const CASE_PREFLIGHT_POLICY = { schemaVersion: 1, scope: 'offline-case-integrity', required: true };
|
|
7
|
-
export class CasePreflightFailed extends Error {
|
|
8
|
-
preflight;
|
|
9
|
-
constructor(preflight) {
|
|
10
|
-
super('Offline case preflight blocked evaluation; no agent or judge calls were made.\n' +
|
|
11
|
-
preflight.checks.filter(c => c.status === 'FAIL').map(c => `[FAIL] ${c.code}${c.taskId ? ` (${c.taskId})` : ''}: ${c.message}${c.remediation ? ` Remedy: ${c.remediation}` : ''}`).join('\n'));
|
|
12
|
-
this.preflight = preflight;
|
|
13
|
-
this.name = 'CasePreflightFailed';
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
9
|
function globalCheck(code, status, message) {
|
|
17
10
|
return { code, status, message, taskId: null, location: { path: 'bench.json', field: null },
|
|
18
11
|
remediation: status === 'FAIL' ? 'Fix the inputs or check error and run a fresh preview before executing.' : null, evidence: null };
|
|
@@ -22,7 +15,7 @@ export async function checkEvalCases(bench, targets, installed, log) {
|
|
|
22
15
|
const started = performance.now();
|
|
23
16
|
let checks;
|
|
24
17
|
try {
|
|
25
|
-
const result = await
|
|
18
|
+
const result = await runOfflineBenchCheck({ dir: bench.dir, taskIds: bench.tasks.map(t => t.id), log: () => { } });
|
|
26
19
|
checks = result.checks.map(check => {
|
|
27
20
|
const unknown = (check.code === 'ORACLE' && check.status === 'WARN') ||
|
|
28
21
|
((check.code === 'MOCK_BASELINE' || check.code === 'MOCK_TREATMENT') && check.status === 'INFO' && check.evidence === null) ||
|