skillfit 0.12.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.
Files changed (127) hide show
  1. package/README.md +60 -119
  2. package/README.zh-CN.md +60 -116
  3. package/dist/commands/bench-check-report.js +1 -34
  4. package/dist/commands/bench.js +6 -239
  5. package/dist/commands/eval-preflight-error.js +9 -0
  6. package/dist/commands/eval-preflight.js +4 -11
  7. package/dist/commands/eval-report.js +6 -459
  8. package/dist/commands/install.js +14 -98
  9. package/dist/harness/bench-check.js +277 -0
  10. package/dist/harness/bench-diagnostics.js +34 -0
  11. package/dist/harness/eval-acceptance.js +1 -1
  12. package/dist/harness/eval-audit.js +1 -1
  13. package/dist/harness/eval-manifest.js +456 -0
  14. package/dist/install/constants.js +1 -0
  15. package/dist/install/transaction.js +112 -0
  16. package/docs/README.md +65 -0
  17. package/docs/architecture.md +86 -0
  18. package/docs/archive-delivery.md +83 -0
  19. package/docs/archive-inventory.md +91 -0
  20. package/docs/evaluation-reports.md +1 -1
  21. package/docs/growth-roadmap-2026-10.md +14 -18
  22. package/docs/package-contents.md +73 -0
  23. package/docs/plans/2026-10-20-archive-replay-verification.json +125 -0
  24. package/docs/plans/2026-10-20-archive-source-verification.json +256 -0
  25. package/docs/plans/2026-10-20-delivery-verification.json +146 -0
  26. package/docs/plans/2026-10-20-docs-architecture-cleanup.md +233 -0
  27. package/docs/plans/2026-10-20-install-transactions-and-archive-delivery.md +233 -0
  28. package/docs/plans/2026-10-21-npm-0.13.0-release.md +41 -0
  29. package/docs/releases/0.12.0-attestation-check.json +22 -0
  30. package/docs/releases/0.12.0-attestations.json +155 -0
  31. package/docs/releases/0.12.0-ci-registry-install.json +90 -0
  32. package/docs/releases/0.12.0-feature-smoke.json +34 -0
  33. package/docs/releases/0.12.0-foundations-smoke.json +1576 -0
  34. package/docs/releases/0.12.0-local-registry-install.json +75 -0
  35. package/docs/releases/0.12.0-preparation-attempt-1.json +22 -0
  36. package/docs/releases/0.12.0-registry-metadata.json +96 -0
  37. package/docs/releases/0.12.0-signatures.txt +6 -0
  38. package/docs/releases/0.12.0-verification.json +99 -0
  39. package/docs/releases/0.12.0.md +14 -0
  40. package/docs/releases/0.13.0-feature-smoke.mjs +114 -0
  41. package/docs/releases/0.13.0-preparation.json +102 -0
  42. package/docs/releases/0.13.0.md +61 -0
  43. package/docs/releases/archive-delivery-smoke.mjs +37 -0
  44. package/docs/reproducible-offline-example.md +1 -1
  45. package/evidence/README.md +24 -1
  46. package/evidence/archive-catalog.v1.json +8044 -0
  47. package/evidence/fetch-archives.mjs +211 -0
  48. package/package.json +9 -2
  49. package/dist/cli.test.js +0 -193
  50. package/dist/commands/bench-calibration.test.js +0 -237
  51. package/dist/commands/bench-check-json.test.js +0 -242
  52. package/dist/commands/bench-manage.test.js +0 -87
  53. package/dist/commands/bench.test.js +0 -1166
  54. package/dist/commands/bundle.test.js +0 -142
  55. package/dist/commands/calibration-cli.test.js +0 -145
  56. package/dist/commands/doctor.test.js +0 -280
  57. package/dist/commands/eval-agent-preflight.test.js +0 -269
  58. package/dist/commands/eval-cli-usage.test.js +0 -75
  59. package/dist/commands/eval-export-modes.test.js +0 -350
  60. package/dist/commands/eval-export.test.js +0 -279
  61. package/dist/commands/eval-interruption.test.js +0 -263
  62. package/dist/commands/eval-preflight.test.js +0 -382
  63. package/dist/commands/eval-report.test.js +0 -367
  64. package/dist/commands/eval.test.js +0 -503
  65. package/dist/commands/evaluation-report.test.js +0 -243
  66. package/dist/commands/install.test.js +0 -555
  67. package/dist/commands/npm-first-run.test.js +0 -74
  68. package/dist/commands/replay-cancellation.test.js +0 -105
  69. package/dist/commands/report.test.js +0 -110
  70. package/dist/commands/setup.test.js +0 -150
  71. package/dist/commands/upstream.test.js +0 -139
  72. package/dist/commands/workflow-entrypoints.test.js +0 -137
  73. package/dist/docs.test.js +0 -154
  74. package/dist/frontmatter.test.js +0 -49
  75. package/dist/harness/bench.test.js +0 -109
  76. package/dist/harness/bundle.test.js +0 -71
  77. package/dist/harness/codex-usage.test.js +0 -87
  78. package/dist/harness/costs.test.js +0 -92
  79. package/dist/harness/eval-budget.test.js +0 -237
  80. package/dist/harness/eval-component.test.js +0 -770
  81. package/dist/harness/eval-efficiency.test.js +0 -56
  82. package/dist/harness/execution-timing.test.js +0 -61
  83. package/dist/harness/executors/api.test.js +0 -175
  84. package/dist/harness/executors/cli.test.js +0 -541
  85. package/dist/harness/executors/mock.test.js +0 -43
  86. package/dist/harness/experiment-session.test.js +0 -317
  87. package/dist/harness/installed-skill.test.js +0 -162
  88. package/dist/harness/interruption.test.js +0 -31
  89. package/dist/harness/judge-accounting.test.js +0 -216
  90. package/dist/harness/judge.test.js +0 -181
  91. package/dist/harness/kimi-usage.test.js +0 -62
  92. package/dist/harness/native-diff.test.js +0 -53
  93. package/dist/harness/oss-lru-cache.test.js +0 -79
  94. package/dist/harness/oss-normalize-url.test.js +0 -64
  95. package/dist/harness/oss-regression-witness.test.js +0 -89
  96. package/dist/harness/oss-skill-followup.test.js +0 -59
  97. package/dist/harness/prompt.test.js +0 -48
  98. package/dist/harness/receipts.test.js +0 -148
  99. package/dist/harness/report.test.js +0 -297
  100. package/dist/harness/runner.test.js +0 -635
  101. package/dist/harness/skill-revision.test.js +0 -148
  102. package/dist/harness/stats.test.js +0 -124
  103. package/dist/harness/target.test.js +0 -60
  104. package/dist/harness/trigger.test.js +0 -261
  105. package/dist/harness/verifier-summary.test.js +0 -99
  106. package/dist/harness/verifier.test.js +0 -128
  107. package/dist/harness/waza-behavior.test.js +0 -139
  108. package/dist/mcp/probe.test.js +0 -139
  109. package/evidence/artifacts/2026-10-12-diagnosing-revision/calibration-records.tar.gz +0 -0
  110. package/evidence/artifacts/2026-10-12-diagnosing-revision/interrupted-records.tar.gz +0 -0
  111. package/evidence/artifacts/2026-10-12-diagnosing-revision/validation-records.tar.gz +0 -0
  112. package/evidence/artifacts/2026-10-12-diagnosing-v2/regression-records.tar.gz +0 -0
  113. package/evidence/artifacts/2026-10-12-diagnosing-v2/transfer-records.tar.gz +0 -0
  114. package/evidence/artifacts/2026-10-12-normalize-url-v2-available/readiness-records.tar.gz +0 -0
  115. package/evidence/artifacts/2026-10-12-normalize-url-v2-comparison/records.tar.gz +0 -0
  116. package/evidence/artifacts/2026-10-12-normalize-url-v2-recovery/records.tar.gz +0 -0
  117. package/evidence/artifacts/2026-10-12-normalize-url-v2-validated/records.tar.gz +0 -0
  118. package/evidence/artifacts/2026-10-13-debugging-completed-development/package.tar.gz +0 -0
  119. package/evidence/artifacts/2026-10-13-debugging-controls-and-sleep-stop/package.tar.gz +0 -0
  120. package/evidence/artifacts/2026-10-13-debugging-development-stops/package.tar.gz +0 -0
  121. package/evidence/artifacts/2026-10-14-debugging-followup-routing-stop/package.tar.gz +0 -0
  122. package/evidence/artifacts/2026-10-14-debugging-independent-validation/package.tar.gz +0 -0
  123. package/evidence/artifacts/2026-10-14-debugging-reading-pilot-and-cost-review/package.tar.gz +0 -0
  124. package/evidence/artifacts/2026-10-14-debugging-spending-stop/package.tar.gz +0 -0
  125. package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
  126. package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
  127. package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
@@ -1,243 +0,0 @@
1
- import assert from 'node:assert/strict';
2
- import { spawnSync } from 'node:child_process';
3
- import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
4
- import { tmpdir } from 'node:os';
5
- import { basename, dirname, join } from 'node:path';
6
- import { fileURLToPath } from 'node:url';
7
- import { test } from 'node:test';
8
- import { runBenchCheck, runBenchInit } from './bench.js';
9
- import { runEval } from './eval.js';
10
- import { readEvaluationReport } from './evaluation-report.js';
11
- import { runEvalReport } from './eval-report.js';
12
- import { exportEvaluation } from './eval-export.js';
13
- import { ExperimentSession } from '../harness/experiment-session.js';
14
- import { collectEvaluationTarget } from '../harness/target.js';
15
- import { loadBench } from '../harness/bench.js';
16
- import { ExecutorFailure } from '../harness/types.js';
17
- const CLI = fileURLToPath(new URL('../cli.js', import.meta.url));
18
- async function fixture(t, ids) {
19
- const root = mkdtempSync(join(tmpdir(), 'skillfit-report-modes-'));
20
- t.after(() => rmSync(root, { recursive: true, force: true }));
21
- const bench = join(root, 'bench'), skill = join(root, 'skill'), runsRoot = join(root, 'runs');
22
- await runBenchInit({ dir: bench, yes: true, log: () => { } });
23
- const path = join(bench, 'bench.json'), body = JSON.parse(readFileSync(path, 'utf8')), original = body.tasks[0];
24
- body.tasks = ids.map(id => {
25
- const prompt = `prompts/${id}.md`;
26
- writeFileSync(join(bench, prompt), `CASE ${id}\nReply with skillfit-ok.\n`);
27
- return { ...original, id, prompt, promptTrigger: prompt, shouldTrigger: !id.startsWith('neg'),
28
- ...(id === 'pos-fired' ? { triggerClass: 'explicit' } : id === 'pos-missed' ? { triggerClass: 'implicit' } : id === 'pos-unknown' ? { triggerClass: 'contextual' } : {}) };
29
- });
30
- writeFileSync(path, JSON.stringify(body));
31
- mkdirSync(skill);
32
- writeFileSync(join(skill, 'SKILL.md'), '# Synthetic mode-report test\n');
33
- let calls = 0;
34
- const perTask = new Map();
35
- const executor = { describe: () => ({ kind: 'stub', model: 'offline-report-fixture' }), run: async (_prompt, workdir) => {
36
- calls++;
37
- const id = basename(dirname(dirname(workdir))), nth = (perTask.get(id) ?? 0) + 1;
38
- perTask.set(id, nth);
39
- if (id === 'neg-error')
40
- throw new ExecutorFailure('synthetic executor error', { output: 'partial', tokens: { input: 4, output: 1 }, usageStatus: 'partial' });
41
- return { output: id === 'hard' || (id === 'mixed' && nth === 2) ? 'wrong' : 'skillfit-ok',
42
- tokens: { input: 10, cachedInput: 0, output: 1 },
43
- ...(id === 'pos-unknown' ? {} : { skillTriggered: id === 'pos-fired' || id === 'neg-fired' }) };
44
- } };
45
- const cli = (path, flags = []) => spawnSync(process.execPath, [CLI, 'report', 'eval', path, ...flags], { encoding: 'utf8', timeout: 30_000 });
46
- return { root, bench, skill, runsRoot, executor, calls: () => calls, cli };
47
- }
48
- function observedFiles(run, final) {
49
- return [final, '_plan.json', '_session.json', '_artifacts.json'].map(path => readFileSync(join(run, path), 'utf8'));
50
- }
51
- test('completed native calibration uses its own summary, state and difficulty metrics in both formats', async (t) => {
52
- const f = await fixture(t, ['easy', 'hard', 'mixed']);
53
- await runBenchCheck({ dir: f.bench, calibrate: { executor: f.executor, trials: 2, maxCalls: 6, runsRoot: f.runsRoot, runGroup: 'calibration' }, log: () => { } });
54
- const run = join(f.runsRoot, 'calibration'), before = observedFiles(run, '_calibration.json');
55
- const report = await readEvaluationReport(run);
56
- assert.ok('evaluationType' in report && report.evaluationType === 'calibration');
57
- assert.equal(report.status, 'completed');
58
- assert.equal(report.kind, 'skillfit.calibration-report');
59
- assert.deepEqual(report.summary?.tasks.map(t => t.difficulty), ['saturated', 'floor', 'discriminative']);
60
- assert.deepEqual(report.summary?.metrics, { taskCount: 3, measuredTasks: 3, discriminativeTasks: 1, passes: 3, completed: 6, errors: 0, baselinePassRate: 0.5 });
61
- assert.equal(report.usage?.metrics.input.knownTotal, 60);
62
- assert.equal(report.usage?.metrics.cachedInput.knownTotal, 0);
63
- assert.equal(report.usage?.metrics.cachedInput.coverage.final, 6);
64
- assert.equal(report.acceptance.eligibleForUpgrade, false);
65
- assert.equal(report.acceptance.automaticUpgrade, false);
66
- assert.equal(report.evidence.verified, true);
67
- assert.equal(report.evidence.scope, 'single-arm-native');
68
- const human = f.cli(run), json = f.cli(run, ['--json']), file = f.cli(join(run, '_calibration.json'));
69
- for (const output of [human, json, file])
70
- assert.equal(output.status, 0, output.stderr);
71
- assert.equal(JSON.parse(json.stdout).status, 'completed');
72
- assert.equal(human.stdout, file.stdout);
73
- assert.match(human.stdout, /Baseline pass rate: 3\/6 \(50.0%\)/);
74
- assert.match(human.stdout, /discriminative tasks: 1\/3/);
75
- assert.match(human.stdout, /saturated/);
76
- assert.match(human.stdout, /floor/);
77
- assert.doesNotMatch(human.stdout, /Overall verdict|State: stopped|McNemar/);
78
- assert.equal((await exportEvaluation(run, join(f.root, 'export'), { log: () => { } })).status, 'planned');
79
- assert.equal(existsSync(join(f.root, 'export')), false);
80
- assert.deepEqual(observedFiles(run, '_calibration.json'), before);
81
- assert.equal(f.calls(), 6);
82
- rmSync(join(run, 'easy/baseline/trial-1/_result.json'));
83
- const missing = await readEvaluationReport(run);
84
- assert.ok('evaluationType' in missing);
85
- assert.equal(missing.usage?.invocationsWithUnknownReceipts, 1);
86
- assert.equal(missing.usage?.metrics.input.coverage.unknown, 1);
87
- assert.equal(missing.acceptance.eligibleForUpgrade, false);
88
- });
89
- test('native trigger reports retain rates, Wilson intervals, classes, unknowns and errors without paired adoption', async (t) => {
90
- const f = await fixture(t, ['pos-fired', 'pos-missed', 'pos-unknown', 'neg-fired', 'neg-quiet', 'neg-error']);
91
- await runEval({ skillPath: f.skill, bench: f.bench, agent: 'codex', mode: 'trigger', executor: f.executor,
92
- trials: 1, maxCalls: 6, runsRoot: f.runsRoot, runGroup: 'trigger', dryRun: false, yes: true, log: () => { } });
93
- const run = join(f.runsRoot, 'trigger'), before = observedFiles(run, 'manifest.json');
94
- const saved = JSON.parse(before[0]);
95
- const report = await readEvaluationReport(run);
96
- assert.ok('evaluationType' in report && report.evaluationType === 'trigger');
97
- assert.equal(report.status, 'stopped');
98
- assert.equal(report.kind, 'skillfit.trigger-report');
99
- assert.deepEqual(report.summary?.metrics, saved.metrics);
100
- assert.equal(report.summary?.metrics.recall, 0.5);
101
- assert.equal(report.summary?.metrics.falseTriggerRate, 0.5);
102
- assert.equal(report.summary?.metrics.precision, 0.5);
103
- assert.equal(report.summary?.metrics.f1, 0.5);
104
- assert.equal(report.summary?.tasks[2]?.unknown, 1);
105
- assert.equal(report.summary?.tasks[5]?.errors, 1);
106
- assert.equal(report.acceptance.eligibleForUpgrade, false);
107
- assert.equal(report.acceptance.automaticUpgrade, false);
108
- const human = f.cli(run), json = f.cli(join(run, 'manifest.json'), ['--json']);
109
- assert.equal(human.status, 0, human.stderr);
110
- assert.equal(json.status, 0, json.stderr);
111
- assert.equal(JSON.parse(json.stdout).evaluationType, 'trigger');
112
- assert.equal(JSON.parse(json.stdout).status, 'stopped');
113
- for (const label of ['Recall: 50.0%', 'False-trigger rate: 50.0%', 'Precision: 50.0%', 'F1: 0.500', 'explicit recall:', 'implicit recall:', 'contextual recall: n/a', 'SKILL.md read', 'upper bound', 'Unknown | Errors'])
114
- assert.ok(human.stdout.includes(label), label);
115
- assert.doesNotMatch(human.stdout, /McNemar|Overall verdict|Installation decision/);
116
- assert.deepEqual(observedFiles(run, 'manifest.json'), before);
117
- assert.equal(f.calls(), 6);
118
- });
119
- test('completed trigger and standalone historical summaries preserve zero denominators and unknown provenance', async (t) => {
120
- const f = await fixture(t, ['pos-missed', 'pos-unknown']);
121
- await runEval({ skillPath: f.skill, bench: f.bench, mode: 'trigger', skillInstallDir: '.test-skills', executor: f.executor,
122
- trials: 1, maxCalls: 2, runsRoot: f.runsRoot, runGroup: 'trigger', dryRun: false, yes: true, log: () => { } });
123
- const run = join(f.runsRoot, 'trigger'), native = await readEvaluationReport(run);
124
- assert.ok('evaluationType' in native && native.evaluationType === 'trigger');
125
- assert.equal(native.status, 'completed');
126
- assert.equal(native.summary?.metrics.recall, 0);
127
- assert.equal(native.summary?.metrics.falseTriggerRate, null);
128
- assert.equal(native.summary?.metrics.precision, null);
129
- assert.equal(native.summary?.metrics.f1, null);
130
- const value = JSON.parse(readFileSync(join(run, 'manifest.json'), 'utf8'));
131
- delete value.experiment;
132
- delete value.metrics.classRecall;
133
- delete value.metrics.precisionCi95;
134
- const standalone = join(f.root, 'historical.json');
135
- writeFileSync(standalone, JSON.stringify(value));
136
- const human = [];
137
- await runEvalReport(standalone, line => human.push(line));
138
- assert.match(human[0], /State: reported/);
139
- assert.match(human[0], /False-trigger rate: n\/a/);
140
- assert.match(human[0], /Precision: n\/a/);
141
- assert.match(human[0], /F1: n\/a/);
142
- assert.match(human[0], /Eligible for upgrade: no/);
143
- assert.equal(f.calls(), 2);
144
- });
145
- test('standalone calibration excludes ungraded errors and leaves zero-completion difficulty unknown', async (t) => {
146
- const root = mkdtempSync(join(tmpdir(), 'skillfit-calibration-summary-'));
147
- t.after(() => rmSync(root, { recursive: true, force: true }));
148
- const path = join(root, 'renamed.json');
149
- writeFileSync(path, JSON.stringify({ schemaVersion: 1, runGroup: 'historical', inputMode: 'snapshot', trials: 2,
150
- tasks: [{ id: 'one', passes: 1, completed: 1, errors: 1 }, { id: 'none', passes: 0, completed: 0, errors: 2 }] }));
151
- const report = await readEvaluationReport(path);
152
- assert.ok('evaluationType' in report && report.evaluationType === 'calibration');
153
- assert.equal(report.status, 'reported');
154
- assert.equal(report.summary?.metrics.baselinePassRate, 1);
155
- assert.equal(report.summary?.metrics.errors, 3);
156
- assert.equal(report.summary?.tasks[1]?.passRate, null);
157
- assert.equal(report.summary?.tasks[1]?.difficulty, 'unmeasured');
158
- });
159
- test('stopped and unfinished single-arm sessions never fabricate final metrics or completion', async (t) => {
160
- for (const mode of ['calibration', 'trigger'])
161
- await t.test(mode, async (t) => {
162
- const f = await fixture(t, ['easy']);
163
- const run = join(f.runsRoot, mode);
164
- const session = new ExperimentSession({ bench: loadBench(f.bench), target: collectEvaluationTarget(f.skill), groupDir: run,
165
- workspaces: [join(run, 'easy/baseline/trial-1')], plannedCalls: 1, maxCalls: 1, injected: true, details: { mode } });
166
- session.finish(new Error('synthetic cancellation'));
167
- const stopped = await readEvaluationReport(run);
168
- assert.ok('evaluationType' in stopped);
169
- assert.equal(stopped.status, 'stopped');
170
- assert.equal(stopped.summary, null);
171
- assert.equal(stopped.acceptance.eligibleForUpgrade, false);
172
- const human = f.cli(run);
173
- assert.equal(human.status, 0, human.stderr);
174
- assert.match(human.stdout, /Metrics are unavailable/);
175
- rmSync(join(run, '_session.json'));
176
- const unfinished = await readEvaluationReport(run);
177
- assert.equal(unfinished.status, 'incomplete');
178
- assert.equal(f.calls(), 0);
179
- });
180
- });
181
- test('single-arm reports reject contradictory counts, metrics, schemas, session states and ignored options', async (t) => {
182
- const f = await fixture(t, ['pos-fired', 'neg-quiet']);
183
- await runEval({ skillPath: f.skill, bench: f.bench, mode: 'trigger', skillInstallDir: '.test-skills', executor: f.executor,
184
- trials: 1, maxCalls: 2, runsRoot: f.runsRoot, runGroup: 'trigger', dryRun: false, yes: true, log: () => { } });
185
- const run = join(f.runsRoot, 'trigger'), path = join(run, 'manifest.json'), original = readFileSync(path, 'utf8');
186
- const scenarios = [
187
- (v) => { v.tasks[0].fired = 2; },
188
- (v) => { v.tasks[0].runs = -1; },
189
- (v) => { v.tasks[0].unknown = 0.5; },
190
- (v) => { v.tasks[1].id = v.tasks[0].id; },
191
- (v) => { v.metrics.recall = 0; },
192
- (v) => { v.metrics.recallCi95 = { lo: 0, hi: 0 }; },
193
- (v) => { v.schemaVersion = 2; },
194
- (v) => { v.experiment.status = 'incomplete'; },
195
- ];
196
- for (const change of scenarios) {
197
- const value = JSON.parse(original);
198
- change(value);
199
- writeFileSync(path, JSON.stringify(value));
200
- await assert.rejects(() => readEvaluationReport(run));
201
- }
202
- writeFileSync(path, original);
203
- for (const json of [false, true]) {
204
- const replay = f.cli(run, ['--replay', ...(json ? ['--json'] : [])]);
205
- assert.equal(replay.status, 0, replay.stderr);
206
- if (json) {
207
- const result = JSON.parse(replay.stdout);
208
- assert.equal(result.evidence.verified, true);
209
- assert.equal(result.evidence.replayedDeliveries, 2);
210
- assert.equal(result.acceptance.eligibleForUpgrade, false);
211
- }
212
- }
213
- for (const flags of [['--policy', 'missing.json'], ['--records', run], ['--bench', f.bench]]) {
214
- for (const json of [false, true]) {
215
- const result = f.cli(run, [...flags, ...(json ? ['--json'] : [])]);
216
- assert.equal(result.status, json ? 2 : 1);
217
- if (json) {
218
- const failure = JSON.parse(result.stdout);
219
- assert.equal(failure.status, 'error');
220
- assert.equal(failure.acceptance.eligibleForUpgrade, false);
221
- }
222
- else
223
- assert.match(result.stderr, /do not support paired|only used with --replay/);
224
- }
225
- }
226
- copyFileSync(path, join(run, '_calibration.json'));
227
- await assert.rejects(() => readEvaluationReport(run), /Ambiguous run/);
228
- assert.equal(f.calls(), 2);
229
- });
230
- test('invalid calibration summaries fail rather than being mislabeled stopped or interpreted as trigger data', async (t) => {
231
- const root = mkdtempSync(join(tmpdir(), 'skillfit-invalid-calibration-'));
232
- t.after(() => rmSync(root, { recursive: true, force: true }));
233
- const path = join(root, '_calibration.json'), value = { schemaVersion: 1, runGroup: 'calibration', inputMode: 'workspace', trials: 2,
234
- tasks: [{ id: 'one', completed: 1, errors: 1, passes: 1 }] };
235
- for (const change of [(v) => { v.tasks[0].passes = 2; }, (v) => { v.tasks[0].errors = 2; },
236
- (v) => { v.tasks[0].completed = null; }, (v) => { v.inputMode = 'unknown'; }, (v) => { v.tasks = []; }]) {
237
- const changed = structuredClone(value);
238
- change(changed);
239
- writeFileSync(path, JSON.stringify(changed));
240
- await assert.rejects(() => readEvaluationReport(path));
241
- }
242
- assert.ok(!existsSync(join(root, 'manifest.json')));
243
- });