skillfit 0.12.0 → 0.13.1
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 +60 -119
- package/README.zh-CN.md +60 -116
- package/dist/commands/bench-check-report.js +1 -34
- package/dist/commands/bench.js +6 -239
- 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/install.js +14 -98
- package/dist/harness/bench-check.js +277 -0
- package/dist/harness/bench-diagnostics.js +34 -0
- package/dist/harness/eval-acceptance.js +1 -1
- package/dist/harness/eval-audit.js +1 -1
- package/dist/harness/eval-manifest.js +456 -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/evaluation-reports.md +1 -1
- package/docs/first-real-eval.md +12 -10
- package/docs/growth-roadmap-2026-10.md +17 -18
- package/docs/package-contents.md +80 -0
- 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 +74 -0
- package/docs/plans/2026-10-21-npm-0.13.1-release.md +38 -0
- 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-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 +14 -0
- package/docs/releases/0.13.0-archive-replays.json +266 -0
- package/docs/releases/0.13.0-archive-restoration.json +168 -0
- package/docs/releases/0.13.0-attestation-check.json +22 -0
- package/docs/releases/0.13.0-attestations.json +147 -0
- package/docs/releases/0.13.0-ci-registry-install.json +60 -0
- package/docs/releases/0.13.0-feature-smoke.json +41 -0
- package/docs/releases/0.13.0-feature-smoke.mjs +114 -0
- package/docs/releases/0.13.0-foundations-smoke.json +1576 -0
- package/docs/releases/0.13.0-local-registry-install.json +40 -0
- package/docs/releases/0.13.0-preparation.json +102 -0
- package/docs/releases/0.13.0-preview-review.json +16 -0
- package/docs/releases/0.13.0-registry-metadata.json +92 -0
- package/docs/releases/0.13.0-signatures.txt +12 -0
- package/docs/releases/0.13.0-verification.json +136 -0
- package/docs/releases/0.13.0.md +112 -0
- package/docs/releases/0.13.1-feature-smoke.mjs +116 -0
- package/docs/releases/0.13.1-preparation-failure-1.json +25 -0
- package/docs/releases/0.13.1-preparation.json +149 -0
- package/docs/releases/0.13.1.md +62 -0
- package/docs/releases/archive-delivery-smoke.mjs +37 -0
- package/docs/releases/release-docs-smoke.mjs +37 -0
- package/docs/reproducible-offline-example.md +1 -1
- 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 +20 -6
- 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 -1166
- 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 -269
- package/dist/commands/eval-cli-usage.test.js +0 -75
- 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 -263
- 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/npm-first-run.test.js +0 -74
- 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 -175
- package/dist/harness/executors/cli.test.js +0 -541
- 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
package/dist/commands/bench.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import {
|
|
2
|
+
import { inspectBenchIntegrity, copyFixture, runOracleGate } from '../harness/bench-check.js';
|
|
3
|
+
import { CasePreflightFailed } from './eval-preflight-error.js';
|
|
4
|
+
import { existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
5
|
import { tmpdir } from 'node:os';
|
|
4
6
|
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
5
7
|
import { BENCH_SCHEMA_VERSION, loadBench, selectBenchTasks, validateBenchTask } from '../harness/bench.js';
|
|
6
8
|
import { resolveBenchDir } from '../harness/bench-location.js';
|
|
7
|
-
import {
|
|
9
|
+
import { sha256File, sha256Text } from '../harness/hash.js';
|
|
8
10
|
import { runVerifier, verifierFailure } from '../harness/runner.js';
|
|
9
11
|
import { MOCK_MARKER_FILE } from '../harness/constants.js';
|
|
10
|
-
import { verdictFromOutput } from '../harness/verifier-summary.js';
|
|
11
12
|
import { confirm as confirmPrompt } from './confirm.js';
|
|
12
13
|
import { commandTemplateFiles } from './bench-command-template.js';
|
|
13
|
-
import { benchDiagnostic
|
|
14
|
+
import { benchDiagnostic } from '../harness/bench-diagnostics.js';
|
|
14
15
|
import { BACKUP_SUFFIX } from './install.js';
|
|
15
16
|
import { withEvaluationInterrupts, throwIfEvaluationInterrupted } from '../harness/interruption.js';
|
|
16
17
|
import { assertAgentEnvironment, renderAgentEnvironment } from '../harness/agent-preflight.js';
|
|
@@ -20,13 +21,6 @@ import { BenchDraftSession } from './bench-draft.js';
|
|
|
20
21
|
import { parseVerifierTimeoutSeconds } from '../harness/verifier-timeout.js';
|
|
21
22
|
export { captureSourceFiles } from './bench-source.js';
|
|
22
23
|
export { prepareBenchCalibration } from './bench-calibration.js';
|
|
23
|
-
const FIXTURE_SIZE_WARN_BYTES = 64 * 1024;
|
|
24
|
-
// benches/README.md: a verifier decomposes its acceptance criteria into 2–8 named checks.
|
|
25
|
-
const MIN_FACET_CHECKS = 2;
|
|
26
|
-
const MAX_FACET_CHECKS = 8;
|
|
27
|
-
// docs/metrics.md: >=30% of trigger-labelled tasks should be negative controls.
|
|
28
|
-
const NEGATIVE_CONTROL_TARGET = 0.3;
|
|
29
|
-
const NEGATIVE_CONTROL_PERCENT = 30;
|
|
30
24
|
function templateFiles(benchName) {
|
|
31
25
|
return {
|
|
32
26
|
'bench.json': `${JSON.stringify({
|
|
@@ -146,114 +140,6 @@ export async function runBenchInit(options) {
|
|
|
146
140
|
log('This is a teaching case. Replace it with your own task before measuring Skill benefit.');
|
|
147
141
|
return { dir, created };
|
|
148
142
|
}
|
|
149
|
-
async function probeVerifier(benchDir, verifier, output, timeoutSeconds) {
|
|
150
|
-
const dir = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
|
|
151
|
-
try {
|
|
152
|
-
if (output !== null) {
|
|
153
|
-
writeFileSync(join(dir, '_output.md'), output, 'utf8');
|
|
154
|
-
}
|
|
155
|
-
const result = await runVerifier(benchDir, verifier, dir, timeoutSeconds);
|
|
156
|
-
return {
|
|
157
|
-
exitCode: result.exitCode,
|
|
158
|
-
error: result.error,
|
|
159
|
-
output: result.output,
|
|
160
|
-
checks: verdictFromOutput(result.output)?.checks ?? null,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
finally {
|
|
164
|
-
rmSync(dir, { recursive: true, force: true });
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function facetCountCheck(taskId, checks) {
|
|
168
|
-
// `checks` is optional in the verifier contract; with no checks there is no graded signal to gate.
|
|
169
|
-
if (checks === null)
|
|
170
|
-
return null;
|
|
171
|
-
if (checks.length >= MIN_FACET_CHECKS && checks.length <= MAX_FACET_CHECKS) {
|
|
172
|
-
return {
|
|
173
|
-
status: 'PASS',
|
|
174
|
-
message: `${taskId}: ${checks.length} facet check(s), within the ${MIN_FACET_CHECKS}–${MAX_FACET_CHECKS} contract`,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
const why = checks.length < MIN_FACET_CHECKS
|
|
178
|
-
? 'a single check is binary pass/fail in facet costume — it carries none of the graded signal facet scores exist to provide'
|
|
179
|
-
: 'the trial score is dominated by whatever these checks happen to measure, and the per-facet table stops being readable';
|
|
180
|
-
return {
|
|
181
|
-
status: 'WARN',
|
|
182
|
-
message: `${taskId}: ${checks.length} facet check(s) — outside the ${MIN_FACET_CHECKS}–${MAX_FACET_CHECKS} range in benches/README.md (${why})`,
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function copyFixture(fixtureDir, dest) {
|
|
186
|
-
for (const rel of listFilesRecursive(fixtureDir)) {
|
|
187
|
-
const target = join(dest, rel);
|
|
188
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
189
|
-
writeFileSync(target, readFileSync(join(fixtureDir, rel)));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
async function runOracleGate(benchDir, fixtureDir, oracle, verifier, timeoutSeconds, record) {
|
|
193
|
-
const dir = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
|
|
194
|
-
try {
|
|
195
|
-
copyFixture(fixtureDir, dir);
|
|
196
|
-
const oracleRun = await runVerifier(benchDir, oracle, dir, timeoutSeconds);
|
|
197
|
-
record?.('oracle', oracleRun);
|
|
198
|
-
if (oracleRun.error !== null || oracleRun.exitCode !== 0) {
|
|
199
|
-
return {
|
|
200
|
-
kind: 'oracle-failed',
|
|
201
|
-
result: oracleRun,
|
|
202
|
-
command: oracle,
|
|
203
|
-
exitCode: oracleRun.exitCode,
|
|
204
|
-
reason: oracleRun.error !== null || oracleRun.exitCode === null ? verifierFailure('oracle', oracle, oracleRun.error) : null,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
const graded = await runVerifier(benchDir, verifier, dir, timeoutSeconds);
|
|
208
|
-
record?.('oracle-verifier', graded);
|
|
209
|
-
if (graded.error !== null || graded.exitCode !== 0) {
|
|
210
|
-
return {
|
|
211
|
-
kind: 'verifier-failed',
|
|
212
|
-
result: graded,
|
|
213
|
-
command: verifier,
|
|
214
|
-
reason: graded.error !== null || graded.exitCode === null ? verifierFailure('verifier', verifier, graded.error) : null,
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
const score = verdictFromOutput(graded.output)?.score ?? null;
|
|
218
|
-
if (score !== null && score < 1) {
|
|
219
|
-
return { kind: 'low-score', score, result: graded, command: verifier };
|
|
220
|
-
}
|
|
221
|
-
return { kind: 'pass', score, result: graded, command: verifier };
|
|
222
|
-
}
|
|
223
|
-
finally {
|
|
224
|
-
rmSync(dir, { recursive: true, force: true });
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
async function probeOracle(benchDir, fixture, oracle, verifier, timeoutSeconds) {
|
|
228
|
-
const gate = await runOracleGate(benchDir, join(benchDir, fixture), oracle, verifier, timeoutSeconds);
|
|
229
|
-
switch (gate.kind) {
|
|
230
|
-
case 'oracle-failed':
|
|
231
|
-
return {
|
|
232
|
-
status: 'FAIL',
|
|
233
|
-
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
234
|
-
message: gate.reason ??
|
|
235
|
-
`oracle command itself failed (exit ${gate.exitCode}) — the reference solution cannot run`,
|
|
236
|
-
};
|
|
237
|
-
case 'verifier-failed':
|
|
238
|
-
return {
|
|
239
|
-
status: 'FAIL',
|
|
240
|
-
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
241
|
-
message: gate.reason ?? 'oracle solution does not pass the verifier — the task is unwinnable or the oracle is stale',
|
|
242
|
-
};
|
|
243
|
-
case 'low-score':
|
|
244
|
-
return {
|
|
245
|
-
status: 'FAIL',
|
|
246
|
-
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
247
|
-
message: `oracle passes the verifier but scores ${gate.score.toFixed(2)} on its checks — the checks are stricter than the exit code`,
|
|
248
|
-
};
|
|
249
|
-
case 'pass':
|
|
250
|
-
return {
|
|
251
|
-
status: 'PASS',
|
|
252
|
-
evidence: benchCheckEvidence(gate.result, gate.command),
|
|
253
|
-
message: `oracle solution passes the verifier${gate.score !== null ? ' with full checks' : ''}`,
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
143
|
function renderCheck({ status, message }) {
|
|
258
144
|
return `[${status}] ${message}`;
|
|
259
145
|
}
|
|
@@ -304,125 +190,7 @@ async function runBenchCheckWithinInterrupts(options, strictCalibration = false)
|
|
|
304
190
|
}
|
|
305
191
|
}
|
|
306
192
|
const offlineStarted = performance.now();
|
|
307
|
-
|
|
308
|
-
let negativeTasks = 0;
|
|
309
|
-
for (const task of bench.tasks) {
|
|
310
|
-
const taskPush = (code, status, message, evidence) => push(code, status, message, task, evidence);
|
|
311
|
-
let facetChecks = null;
|
|
312
|
-
if ((task.verifierKind ?? 'output') === 'command') {
|
|
313
|
-
const fixtureCopy = mkdtempSync(join(tmpdir(), 'skillfit-check-'));
|
|
314
|
-
try {
|
|
315
|
-
copyFixture(join(bench.dir, task.fixture), fixtureCopy);
|
|
316
|
-
const pristine = await runVerifier(bench.dir, task.verifier, fixtureCopy, task.verifierTimeoutSeconds);
|
|
317
|
-
facetChecks = verdictFromOutput(pristine.output)?.checks ?? null;
|
|
318
|
-
if (pristine.error !== null || pristine.exitCode === null) {
|
|
319
|
-
// Without this branch a verifier that cannot even be spawned reads as a clean NOP gate:
|
|
320
|
-
// "fails on the untouched fixture" is exactly what `exitCode !== 0` looks like.
|
|
321
|
-
taskPush('UNTOUCHED_FIXTURE', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, pristine.error)}`, benchCheckEvidence(pristine, task.verifier));
|
|
322
|
-
}
|
|
323
|
-
else if (pristine.exitCode === 0) {
|
|
324
|
-
taskPush('UNTOUCHED_FIXTURE', 'FAIL', `${task.id}: command verifier already passes on the untouched fixture — the task is solved or the verifier is broken`, benchCheckEvidence(pristine, task.verifier));
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
taskPush('UNTOUCHED_FIXTURE', 'PASS', `${task.id}: command verifier fails on the untouched fixture (the failure reproduces)`, benchCheckEvidence(pristine, task.verifier));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
finally {
|
|
331
|
-
rmSync(fixtureCopy, { recursive: true, force: true });
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
const missing = await probeVerifier(bench.dir, task.verifier, null, task.verifierTimeoutSeconds);
|
|
336
|
-
if (missing.error !== null || missing.exitCode === null) {
|
|
337
|
-
taskPush('MISSING_OUTPUT', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, missing.error)}`, benchCheckEvidence(missing, task.verifier));
|
|
338
|
-
}
|
|
339
|
-
else if (missing.exitCode === 0) {
|
|
340
|
-
taskPush('MISSING_OUTPUT', 'FAIL', `${task.id}: verifier does not reject a missing _output.md`, benchCheckEvidence(missing, task.verifier));
|
|
341
|
-
}
|
|
342
|
-
else {
|
|
343
|
-
taskPush('MISSING_OUTPUT', 'PASS', `${task.id}: verifier rejects missing output`, benchCheckEvidence(missing, task.verifier));
|
|
344
|
-
}
|
|
345
|
-
const empty = await probeVerifier(bench.dir, task.verifier, '', task.verifierTimeoutSeconds);
|
|
346
|
-
facetChecks = empty.checks;
|
|
347
|
-
if (empty.error !== null || empty.exitCode === null) {
|
|
348
|
-
taskPush('EMPTY_OUTPUT', 'FAIL', `${task.id}: ${verifierFailure('verifier', task.verifier, empty.error)}`, benchCheckEvidence(empty, task.verifier));
|
|
349
|
-
}
|
|
350
|
-
else if (empty.exitCode === 0) {
|
|
351
|
-
taskPush('EMPTY_OUTPUT', 'FAIL', `${task.id}: verifier passes an empty output — it cannot tell success from silence`, benchCheckEvidence(empty, task.verifier));
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
taskPush('EMPTY_OUTPUT', 'PASS', `${task.id}: verifier rejects empty output`, benchCheckEvidence(empty, task.verifier));
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
const facetGate = facetCountCheck(task.id, facetChecks);
|
|
358
|
-
if (facetGate)
|
|
359
|
-
taskPush('FACET_COUNT', facetGate.status, facetGate.message);
|
|
360
|
-
if (task.oracle) {
|
|
361
|
-
const oracleResult = await probeOracle(bench.dir, task.fixture, task.oracle, task.verifier, task.verifierTimeoutSeconds);
|
|
362
|
-
taskPush('ORACLE', oracleResult.status, `${task.id}: ${oracleResult.message}`, oracleResult.evidence);
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
taskPush('ORACLE', 'WARN', `${task.id}: no oracle — task winnability is unverified (nothing proves a correct solution passes this verifier; register one with --oracle or write ground-truth/oracle-${task.id}.mjs)`);
|
|
366
|
-
}
|
|
367
|
-
const markerPath = join(bench.dir, task.fixture, MOCK_MARKER_FILE);
|
|
368
|
-
if ((task.verifierKind ?? 'output') === 'command') {
|
|
369
|
-
taskPush('MOCK_COVERAGE', 'INFO', `${task.id}: command verifier — mock-arm probes not applicable (a mock writes _output.md text, not file edits)${task.oracle
|
|
370
|
-
? '; offline coverage comes from the oracle and NOP gates above'
|
|
371
|
-
: '; with no oracle registered, nothing offline shows this task is solvable'}`);
|
|
372
|
-
}
|
|
373
|
-
else if (existsSync(markerPath)) {
|
|
374
|
-
try {
|
|
375
|
-
const marker = JSON.parse(readFileSync(markerPath, 'utf8'));
|
|
376
|
-
for (const arm of ['baseline', 'treatment']) {
|
|
377
|
-
const behavior = marker[arm];
|
|
378
|
-
if (behavior?.output === undefined) {
|
|
379
|
-
taskPush(arm === 'baseline' ? 'MOCK_BASELINE' : 'MOCK_TREATMENT', 'INFO', `${task.id}: no mock ${arm} output — this arm was not probed`);
|
|
380
|
-
continue;
|
|
381
|
-
}
|
|
382
|
-
const probe = await probeVerifier(bench.dir, task.verifier, behavior.output, task.verifierTimeoutSeconds);
|
|
383
|
-
taskPush(arm === 'baseline' ? 'MOCK_BASELINE' : 'MOCK_TREATMENT', probe.error !== null || probe.exitCode === null ? 'FAIL' : 'INFO', `${task.id}: mock ${arm} output → ${probe.error !== null || probe.exitCode === null ? verifierFailure('verifier', task.verifier, probe.error) : `verifier ${probe.exitCode === 0 ? 'pass' : 'fail'}`}`, benchCheckEvidence(probe, task.verifier));
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
catch (error) {
|
|
387
|
-
throwIfEvaluationInterrupted();
|
|
388
|
-
taskPush('MOCK_MARKER', 'FAIL', `${task.id}: ${MOCK_MARKER_FILE} is unreadable (${error.message})`);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
else {
|
|
392
|
-
taskPush('MOCK_COVERAGE', 'INFO', `${task.id}: no ${MOCK_MARKER_FILE} (offline mock runs will produce empty outputs)`);
|
|
393
|
-
}
|
|
394
|
-
const fixtureDir = join(bench.dir, task.fixture);
|
|
395
|
-
const fixtureBytes = listFilesRecursive(fixtureDir)
|
|
396
|
-
.map((rel) => statSync(join(fixtureDir, rel)).size)
|
|
397
|
-
.reduce((sum, size) => sum + size, 0);
|
|
398
|
-
if (fixtureBytes > FIXTURE_SIZE_WARN_BYTES) {
|
|
399
|
-
taskPush('FIXTURE_SIZE', 'WARN', `${task.id}: fixture is ${Math.round(fixtureBytes / 1024)} KB — inject mode inlines it into every prompt; keep it lean`);
|
|
400
|
-
}
|
|
401
|
-
else {
|
|
402
|
-
taskPush('FIXTURE_SIZE', 'PASS', `${task.id}: fixture size ${Math.round(fixtureBytes / 1024)} KB`);
|
|
403
|
-
}
|
|
404
|
-
if (task.shouldTrigger === undefined) {
|
|
405
|
-
taskPush('TRIGGER_LABEL', 'INFO', `${task.id}: no shouldTrigger label (trigger mode will skip this task)`);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
labeledTasks++;
|
|
409
|
-
if (task.shouldTrigger === false)
|
|
410
|
-
negativeTasks++;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
if (labeledTasks > 0) {
|
|
414
|
-
const fraction = negativeTasks / labeledTasks;
|
|
415
|
-
const percent = Math.round(fraction * 100);
|
|
416
|
-
if (negativeTasks === 0) {
|
|
417
|
-
push('NEGATIVE_CONTROLS', 'WARN', 'no shouldTrigger:false (negative-control) tasks — trigger mode cannot measure false-trigger rate (see docs/metrics.md)');
|
|
418
|
-
}
|
|
419
|
-
else if (fraction < NEGATIVE_CONTROL_TARGET) {
|
|
420
|
-
push('NEGATIVE_CONTROLS', 'WARN', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — below the ${NEGATIVE_CONTROL_PERCENT}% target in docs/metrics.md, so false-trigger rate rests on a thin sample`);
|
|
421
|
-
}
|
|
422
|
-
else {
|
|
423
|
-
push('NEGATIVE_CONTROLS', 'PASS', `${negativeTasks}/${labeledTasks} labeled task(s) are negative controls (${percent}%) — at or above the ${NEGATIVE_CONTROL_PERCENT}% target`);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
193
|
+
await inspectBenchIntegrity(bench, push);
|
|
426
194
|
if (calibration) {
|
|
427
195
|
const offlineReport = { dir, bench: identity, checks, failures: checks.filter(check => check.status === 'FAIL').length,
|
|
428
196
|
warnings: checks.filter(check => check.status === 'WARN').length };
|
|
@@ -432,7 +200,6 @@ async function runBenchCheckWithinInterrupts(options, strictCalibration = false)
|
|
|
432
200
|
log(`[UNKNOWN] ${check.code}: ${check.message}`);
|
|
433
201
|
if (casePreflight.status === 'blocked') {
|
|
434
202
|
if (strictCalibration) {
|
|
435
|
-
const { CasePreflightFailed } = await import('./eval-preflight.js');
|
|
436
203
|
throw new CasePreflightFailed(casePreflight);
|
|
437
204
|
}
|
|
438
205
|
push('CALIBRATION', 'FAIL', 'Offline case preflight blocked calibration; no agent calls or run directory were created. Fix every hard failure before a fresh plan.');
|
|
@@ -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) ||
|