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.
- 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/growth-roadmap-2026-10.md +14 -18
- package/docs/package-contents.md +73 -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 +41 -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-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/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/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
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { verdictFor } from './report.js';
|
|
2
|
+
import { mcnemarExactP } from './stats.js';
|
|
3
|
+
import { validateSkillInstallDir } from './installed-skill.js';
|
|
4
|
+
import { assertCostTotals, COST_METRICS } from './costs.js';
|
|
5
|
+
import { parseInvocationCosts } from './invocation-costs.js';
|
|
6
|
+
function object(value, label) {
|
|
7
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
8
|
+
throw new Error(`${label} must be an object`);
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
function string(value, label) {
|
|
13
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
14
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function number(value, label, min = -Infinity, max = Infinity) {
|
|
18
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value < min || value > max) {
|
|
19
|
+
throw new Error(`${label} must be a finite number between ${min} and ${max}`);
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function integer(value, label, min = 0) {
|
|
24
|
+
const result = number(value, label, min);
|
|
25
|
+
if (!Number.isInteger(result))
|
|
26
|
+
throw new Error(`${label} must be an integer`);
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
function hash(value, label) {
|
|
30
|
+
const result = string(value, label);
|
|
31
|
+
if (!/^[0-9a-f]{64}$/i.test(result))
|
|
32
|
+
throw new Error(`${label} must be a SHA-256 hex digest`);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
function verdict(value, label) {
|
|
36
|
+
if (value !== 'effective' && value !== 'ineffective' && value !== 'inconclusive') {
|
|
37
|
+
throw new Error(`${label} must be effective, ineffective, or inconclusive`);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
function experiment(value) {
|
|
42
|
+
if (value === undefined)
|
|
43
|
+
return null;
|
|
44
|
+
const item = object(value, 'experiment');
|
|
45
|
+
if (item['schemaVersion'] !== 1)
|
|
46
|
+
throw new Error('experiment.schemaVersion must be 1');
|
|
47
|
+
const status = item['status'];
|
|
48
|
+
if (status !== 'completed' && status !== 'stopped' && status !== 'incomplete')
|
|
49
|
+
throw new Error('experiment.status must be completed, stopped, or incomplete');
|
|
50
|
+
const plannedCalls = integer(item['plannedCalls'], 'experiment.plannedCalls', 1);
|
|
51
|
+
const maxCalls = integer(item['maxCalls'], 'experiment.maxCalls', 1);
|
|
52
|
+
const callsStarted = integer(item['callsStarted'], 'experiment.callsStarted');
|
|
53
|
+
const callsFinished = integer(item['callsFinished'], 'experiment.callsFinished');
|
|
54
|
+
const stopReason = item['stopReason'] === null ? null : string(item['stopReason'], 'experiment.stopReason');
|
|
55
|
+
if (item['stopCode'] !== undefined && !['EXECUTION_FAILED', 'FINAL_USAGE_MISSING', 'SPENDING_BUDGET_REACHED'].includes(String(item['stopCode'])))
|
|
56
|
+
throw new Error('Invalid experiment.stopCode');
|
|
57
|
+
if (![plannedCalls, maxCalls, callsStarted, callsFinished].every(Number.isSafeInteger) ||
|
|
58
|
+
maxCalls < plannedCalls || callsStarted > plannedCalls || callsFinished > callsStarted ||
|
|
59
|
+
(status === 'completed' && (stopReason !== null || callsFinished !== plannedCalls)) ||
|
|
60
|
+
(status === 'stopped' && stopReason === null) ||
|
|
61
|
+
(status === 'incomplete' && (stopReason !== null || callsFinished === plannedCalls))) {
|
|
62
|
+
throw new Error('experiment status, call counts, ceiling, and stop reason contradict each other');
|
|
63
|
+
}
|
|
64
|
+
return { schemaVersion: 1, status, plannedCalls, maxCalls, callsStarted, callsFinished, stopReason,
|
|
65
|
+
planSha256: hash(item['planSha256'], 'experiment.planSha256'),
|
|
66
|
+
...(item['stopCode'] === undefined ? {} : { stopCode: item['stopCode'] }) };
|
|
67
|
+
}
|
|
68
|
+
function counts(value, label) {
|
|
69
|
+
const item = object(value, label);
|
|
70
|
+
const passes = integer(item['passes'], `${label}.passes`);
|
|
71
|
+
const trials = integer(item['trials'], `${label}.trials`);
|
|
72
|
+
const errors = integer(item['errors'], `${label}.errors`);
|
|
73
|
+
if (passes > trials)
|
|
74
|
+
throw new Error(`${label}.passes cannot exceed trials`);
|
|
75
|
+
const meanScore = item['meanScore'] === undefined || item['meanScore'] === null
|
|
76
|
+
? null : number(item['meanScore'], `${label}.meanScore`, 0, 1);
|
|
77
|
+
const rawTokens = item['tokens'] === undefined || item['tokens'] === null
|
|
78
|
+
? null : object(item['tokens'], `${label}.tokens`);
|
|
79
|
+
const tokens = rawTokens === null ? null : {
|
|
80
|
+
input: number(rawTokens['input'], `${label}.tokens.input`, 0),
|
|
81
|
+
output: number(rawTokens['output'], `${label}.tokens.output`, 0),
|
|
82
|
+
};
|
|
83
|
+
const rawCoverage = item['tokenCoverage'] === undefined
|
|
84
|
+
? null : object(item['tokenCoverage'], `${label}.tokenCoverage`);
|
|
85
|
+
const tokenCoverage = rawCoverage === null ? null : {
|
|
86
|
+
input: integer(rawCoverage['input'], `${label}.tokenCoverage.input`),
|
|
87
|
+
output: integer(rawCoverage['output'], `${label}.tokenCoverage.output`),
|
|
88
|
+
};
|
|
89
|
+
if (tokenCoverage && (tokenCoverage.input > trials || tokenCoverage.output > trials)) {
|
|
90
|
+
throw new Error(`${label}.tokenCoverage cannot exceed graded trials`);
|
|
91
|
+
}
|
|
92
|
+
if (tokenCoverage) {
|
|
93
|
+
for (const field of ['input', 'output']) {
|
|
94
|
+
if ((tokenCoverage[field] > 0 && tokens === null) ||
|
|
95
|
+
(tokenCoverage[field] === 0 && tokens !== null && tokens[field] !== 0)) {
|
|
96
|
+
throw new Error(`${label}.tokenCoverage contradicts its recorded tokens`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (meanScore !== null && trials === 0)
|
|
101
|
+
throw new Error(`${label}.meanScore requires graded trials`);
|
|
102
|
+
const rawReads = item['skillReads'] === undefined ? null : object(item['skillReads'], `${label}.skillReads`);
|
|
103
|
+
const skillReads = rawReads === null ? null : {
|
|
104
|
+
observed: integer(rawReads['observed'], `${label}.skillReads.observed`),
|
|
105
|
+
unobserved: integer(rawReads['unobserved'], `${label}.skillReads.unobserved`),
|
|
106
|
+
unknown: integer(rawReads['unknown'], `${label}.skillReads.unknown`),
|
|
107
|
+
};
|
|
108
|
+
if (skillReads && skillReads.observed + skillReads.unobserved + skillReads.unknown !== trials) {
|
|
109
|
+
throw new Error(`${label}.skillReads must total the surviving graded trials`);
|
|
110
|
+
}
|
|
111
|
+
return { passes, trials, errors, meanScore, tokens, tokenCoverage, skillReads };
|
|
112
|
+
}
|
|
113
|
+
function facets(value, label) {
|
|
114
|
+
if (value === undefined)
|
|
115
|
+
return [];
|
|
116
|
+
if (!Array.isArray(value))
|
|
117
|
+
throw new Error(`${label} must be an array`);
|
|
118
|
+
return value.map((raw, index) => {
|
|
119
|
+
const item = object(raw, `${label}[${index}]`);
|
|
120
|
+
return {
|
|
121
|
+
name: string(item['name'], `${label}[${index}].name`),
|
|
122
|
+
baselinePassRate: number(item['baselinePassRate'], `${label}[${index}].baselinePassRate`, 0, 1),
|
|
123
|
+
treatmentPassRate: number(item['treatmentPassRate'], `${label}[${index}].treatmentPassRate`, 0, 1),
|
|
124
|
+
baselineTrials: integer(item['baselineTrials'], `${label}[${index}].baselineTrials`),
|
|
125
|
+
treatmentTrials: integer(item['treatmentTrials'], `${label}[${index}].treatmentTrials`),
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function row(value, label, id) {
|
|
130
|
+
const item = object(value, label);
|
|
131
|
+
const conditions = object(item['conditions'], `${label}.conditions`);
|
|
132
|
+
return {
|
|
133
|
+
costs: item['costs'] === undefined ? null : parseCosts(item['costs'], `${label}.costs`),
|
|
134
|
+
id,
|
|
135
|
+
baseline: counts(conditions['baseline'], `${label}.conditions.baseline`),
|
|
136
|
+
treatment: counts(conditions['treatment'], `${label}.conditions.treatment`),
|
|
137
|
+
deltaPassRate: number(item['deltaPassRate'], `${label}.deltaPassRate`, -1, 1),
|
|
138
|
+
verdict: verdict(item['verdict'], `${label}.verdict`),
|
|
139
|
+
scoreDelta: item['scoreDelta'] === undefined || item['scoreDelta'] === null
|
|
140
|
+
? null : number(item['scoreDelta'], `${label}.scoreDelta`, -1, 1),
|
|
141
|
+
facets: facets(item['facets'], `${label}.facets`),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function parseCosts(value, label) {
|
|
145
|
+
const item = object(value, label);
|
|
146
|
+
if (item['schemaVersion'] !== 1)
|
|
147
|
+
throw new Error(`${label}.schemaVersion must be 1`);
|
|
148
|
+
const scope = (name) => {
|
|
149
|
+
const arms = object(item[name], `${label}.${name}`);
|
|
150
|
+
const population = (arm) => {
|
|
151
|
+
const path = `${label}.${name}.${arm}`;
|
|
152
|
+
const raw = object(arms[arm], path);
|
|
153
|
+
const runs = integer(raw['runs'], `${path}.runs`);
|
|
154
|
+
const passes = integer(raw['passes'], `${path}.passes`);
|
|
155
|
+
if (passes > runs)
|
|
156
|
+
throw new Error(`${path}.passes cannot exceed runs`);
|
|
157
|
+
const rawMetrics = object(raw['metrics'], `${path}.metrics`);
|
|
158
|
+
const metrics = Object.fromEntries(COST_METRICS.map(metric => {
|
|
159
|
+
const measure = object(rawMetrics[metric], `${path}.metrics.${metric}`);
|
|
160
|
+
const coverage = object(measure['coverage'], `${path}.metrics.${metric}.coverage`);
|
|
161
|
+
const parsed = {
|
|
162
|
+
knownTotal: number(measure['knownTotal'], `${path}.metrics.${metric}.knownTotal`, 0),
|
|
163
|
+
coverage: {
|
|
164
|
+
final: integer(coverage['final'], `${path}.metrics.${metric}.coverage.final`),
|
|
165
|
+
partial: integer(coverage['partial'], `${path}.metrics.${metric}.coverage.partial`),
|
|
166
|
+
unknown: integer(coverage['unknown'], `${path}.metrics.${metric}.coverage.unknown`),
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
const c = parsed.coverage;
|
|
170
|
+
if (c.final + c.partial + c.unknown !== runs ||
|
|
171
|
+
(c.final + c.partial === 0 && parsed.knownTotal !== 0))
|
|
172
|
+
throw new Error(`${path}.metrics.${metric} contradicts coverage`);
|
|
173
|
+
if (metric === 'durationSeconds' && (c.partial !== 0 || c.unknown !== 0))
|
|
174
|
+
throw new Error(`${path} elapsed time must cover every invocation`);
|
|
175
|
+
return [metric, parsed];
|
|
176
|
+
}));
|
|
177
|
+
const cache = metrics.cachedInput;
|
|
178
|
+
const uncached = metrics.uncachedInput;
|
|
179
|
+
if (JSON.stringify(cache.coverage) !== JSON.stringify(uncached.coverage))
|
|
180
|
+
throw new Error(`${path} cache partition coverage must match`);
|
|
181
|
+
if (cache.coverage.final + cache.coverage.partial > metrics.input.coverage.final + metrics.input.coverage.partial ||
|
|
182
|
+
cache.coverage.final > metrics.input.coverage.final ||
|
|
183
|
+
cache.knownTotal + uncached.knownTotal > metrics.input.knownTotal + 1e-6)
|
|
184
|
+
throw new Error(`${path} cache partition contradicts input`);
|
|
185
|
+
if (cache.coverage.final + cache.coverage.partial === metrics.input.coverage.final + metrics.input.coverage.partial &&
|
|
186
|
+
Math.abs(cache.knownTotal + uncached.knownTotal - metrics.input.knownTotal) > 1e-6)
|
|
187
|
+
throw new Error(`${path} cache partition disagrees with input`);
|
|
188
|
+
return { runs, passes, metrics };
|
|
189
|
+
};
|
|
190
|
+
return { baseline: population('baseline'), treatment: population('treatment') };
|
|
191
|
+
};
|
|
192
|
+
const notInvoked = object(item['notInvoked'], `${label}.notInvoked`);
|
|
193
|
+
return { schemaVersion: 1, paired: scope('paired'), attempts: scope('attempts'), notInvoked: {
|
|
194
|
+
baseline: integer(notInvoked['baseline'], `${label}.notInvoked.baseline`),
|
|
195
|
+
treatment: integer(notInvoked['treatment'], `${label}.notInvoked.treatment`),
|
|
196
|
+
} };
|
|
197
|
+
}
|
|
198
|
+
function checkCostCounts(row, declaredRuns, label) {
|
|
199
|
+
const costs = row.costs;
|
|
200
|
+
if (!costs)
|
|
201
|
+
return;
|
|
202
|
+
for (const arm of ['baseline', 'treatment']) {
|
|
203
|
+
const paired = costs.paired[arm];
|
|
204
|
+
const attempts = costs.attempts[arm];
|
|
205
|
+
if (paired.runs !== row[arm].trials || paired.passes !== row[arm].passes ||
|
|
206
|
+
attempts.runs + costs.notInvoked[arm] !== declaredRuns ||
|
|
207
|
+
paired.runs > attempts.runs || paired.passes > attempts.passes ||
|
|
208
|
+
attempts.passes - paired.passes > attempts.runs - paired.runs)
|
|
209
|
+
throw new Error(`${label}.costs disagree with declared/graded counts`);
|
|
210
|
+
for (const metric of COST_METRICS) {
|
|
211
|
+
if (paired.metrics[metric].knownTotal > attempts.metrics[metric].knownTotal + 1e-6)
|
|
212
|
+
throw new Error(`${label}.costs paired spending exceeds all invocations`);
|
|
213
|
+
for (const status of ['final', 'partial', 'unknown']) {
|
|
214
|
+
if (paired.metrics[metric].coverage[status] > attempts.metrics[metric].coverage[status])
|
|
215
|
+
throw new Error(`${label}.costs paired coverage exceeds all invocations`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function checkDelta(value, label) {
|
|
221
|
+
if (value.baseline.trials !== value.treatment.trials) {
|
|
222
|
+
throw new Error(`${label} must contain equal numbers of graded paired trials`);
|
|
223
|
+
}
|
|
224
|
+
const seen = new Set();
|
|
225
|
+
for (const facet of value.facets) {
|
|
226
|
+
if (seen.has(facet.name))
|
|
227
|
+
throw new Error(`${label}.facets contains a duplicate check name`);
|
|
228
|
+
seen.add(facet.name);
|
|
229
|
+
for (const condition of ['baseline', 'treatment']) {
|
|
230
|
+
const trials = condition === 'baseline' ? facet.baselineTrials : facet.treatmentTrials;
|
|
231
|
+
const rate = condition === 'baseline' ? facet.baselinePassRate : facet.treatmentPassRate;
|
|
232
|
+
if (trials > value[condition].trials || (trials === 0 && rate !== 0) ||
|
|
233
|
+
Math.abs(rate * trials - Math.round(rate * trials)) > 1e-9) {
|
|
234
|
+
throw new Error(`${label}.facets has an invalid ${condition} check denominator or rate`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const rate = (counts) => counts.trials === 0 ? 0 : counts.passes / counts.trials;
|
|
239
|
+
const expected = rate(value.treatment) - rate(value.baseline);
|
|
240
|
+
if (Math.abs(value.deltaPassRate - expected) > 1e-9) {
|
|
241
|
+
throw new Error(`${label}.deltaPassRate disagrees with its pass counts`);
|
|
242
|
+
}
|
|
243
|
+
if (value.baseline.meanScore !== null && value.treatment.meanScore !== null &&
|
|
244
|
+
value.scoreDelta !== null && Math.abs(value.scoreDelta -
|
|
245
|
+
(value.treatment.meanScore - value.baseline.meanScore)) > 1e-9 && label !== 'overall') {
|
|
246
|
+
throw new Error(`${label}.scoreDelta disagrees with its mean scores`);
|
|
247
|
+
}
|
|
248
|
+
if (value.scoreDelta !== null && (value.baseline.meanScore === null || value.treatment.meanScore === null)) {
|
|
249
|
+
throw new Error(`${label}.scoreDelta requires graded scores in both conditions`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/** Read only the v4 fields the Markdown report actually uses. Never reinterpret older metrics. */
|
|
253
|
+
export function parseEvalReport(value) {
|
|
254
|
+
const manifest = object(value, 'Manifest');
|
|
255
|
+
if (manifest['schemaVersion'] !== 4) {
|
|
256
|
+
throw new Error(`Only evaluation manifest schemaVersion 4 can be rendered (found ${JSON.stringify(manifest['schemaVersion'])})`);
|
|
257
|
+
}
|
|
258
|
+
const target = object(manifest['target'], 'target');
|
|
259
|
+
const kind = string(target['kind'], 'target.kind');
|
|
260
|
+
if (!['skill', 'rules', 'mcp'].includes(kind))
|
|
261
|
+
throw new Error('target.kind must be skill, rules, or mcp');
|
|
262
|
+
const bench = object(manifest['bench'], 'bench');
|
|
263
|
+
const executor = object(manifest['executor'], 'executor');
|
|
264
|
+
const inputMode = manifest['inputMode'];
|
|
265
|
+
if (inputMode !== undefined && inputMode !== 'snapshot' && inputMode !== 'workspace') {
|
|
266
|
+
throw new Error('inputMode must be snapshot or workspace');
|
|
267
|
+
}
|
|
268
|
+
let skillDelivery = null;
|
|
269
|
+
if (manifest['skillDelivery'] !== undefined) {
|
|
270
|
+
const delivery = object(manifest['skillDelivery'], 'skillDelivery');
|
|
271
|
+
if (delivery['mode'] !== 'installed' || kind !== 'skill' || inputMode !== 'workspace') {
|
|
272
|
+
throw new Error('skillDelivery requires installed mode, a Skill target and workspace input');
|
|
273
|
+
}
|
|
274
|
+
const installDir = string(delivery['installDir'], 'skillDelivery.installDir');
|
|
275
|
+
validateSkillInstallDir(installDir);
|
|
276
|
+
if (!Array.isArray(target['files']) || !target['files'].includes('SKILL.md') ||
|
|
277
|
+
target['files'].some((file) => typeof file !== 'string' || !file)) {
|
|
278
|
+
throw new Error('Installed Skill target.files must list the complete resources including SKILL.md');
|
|
279
|
+
}
|
|
280
|
+
skillDelivery = { mode: 'installed', installDir };
|
|
281
|
+
}
|
|
282
|
+
let baselineTarget = null;
|
|
283
|
+
if (manifest['baselineTarget'] !== undefined) {
|
|
284
|
+
const previous = object(manifest['baselineTarget'], 'baselineTarget');
|
|
285
|
+
if (!skillDelivery || previous['kind'] !== 'skill') {
|
|
286
|
+
throw new Error('baselineTarget requires two installed Skill versions.');
|
|
287
|
+
}
|
|
288
|
+
const name = string(previous['name'], 'baselineTarget.name');
|
|
289
|
+
if (name !== target['name'])
|
|
290
|
+
throw new Error('baselineTarget.name must match the target Skill name.');
|
|
291
|
+
const sha256 = hash(previous['bundleSha256'], 'baselineTarget.bundleSha256');
|
|
292
|
+
if (sha256.toLowerCase() === hash(target['bundleSha256'], 'target.bundleSha256').toLowerCase()) {
|
|
293
|
+
throw new Error('baselineTarget and target must have different complete-resource fingerprints.');
|
|
294
|
+
}
|
|
295
|
+
string(previous['sourceDir'], 'baselineTarget.sourceDir');
|
|
296
|
+
if (!Array.isArray(previous['files']) || !previous['files'].includes('SKILL.md') ||
|
|
297
|
+
previous['files'].some(file => typeof file !== 'string' || !file)) {
|
|
298
|
+
throw new Error('baselineTarget.files must list the complete resources including SKILL.md.');
|
|
299
|
+
}
|
|
300
|
+
baselineTarget = { name, sha256 };
|
|
301
|
+
}
|
|
302
|
+
const rawTasks = manifest['tasks'];
|
|
303
|
+
if (!Array.isArray(rawTasks))
|
|
304
|
+
throw new Error('tasks must be an array');
|
|
305
|
+
const tasks = rawTasks.map((task, index) => {
|
|
306
|
+
const item = object(task, `tasks[${index}]`);
|
|
307
|
+
return row(item, `tasks[${index}]`, string(item['id'], `tasks[${index}].id`));
|
|
308
|
+
});
|
|
309
|
+
const overall = object(manifest['overall'], 'overall');
|
|
310
|
+
const stats = object(overall['stats'], 'overall.stats');
|
|
311
|
+
const discordant = object(stats['discordant'], 'overall.stats.discordant');
|
|
312
|
+
const rawCi = stats['deltaCi'];
|
|
313
|
+
const ci = rawCi === null ? null : object(rawCi, 'overall.stats.deltaCi');
|
|
314
|
+
const warnings = manifest['warnings'];
|
|
315
|
+
if (!Array.isArray(warnings) || warnings.some((item) => typeof item !== 'string')) {
|
|
316
|
+
throw new Error('warnings must be an array of strings');
|
|
317
|
+
}
|
|
318
|
+
const createdAt = string(manifest['createdAt'], 'createdAt');
|
|
319
|
+
if (!Number.isFinite(Date.parse(createdAt)))
|
|
320
|
+
throw new Error('createdAt must be a date-time');
|
|
321
|
+
const taskCount = integer(bench['taskCount'], 'bench.taskCount');
|
|
322
|
+
if (tasks.length !== taskCount)
|
|
323
|
+
throw new Error('bench.taskCount must match tasks.length');
|
|
324
|
+
const ciValue = ci === null ? null : {
|
|
325
|
+
lo: number(ci['lo'], 'overall.stats.deltaCi.lo', -1, 1),
|
|
326
|
+
hi: number(ci['hi'], 'overall.stats.deltaCi.hi', -1, 1),
|
|
327
|
+
resamples: integer(ci['resamples'], 'overall.stats.deltaCi.resamples', 1),
|
|
328
|
+
};
|
|
329
|
+
if (ciValue && ciValue.lo > ciValue.hi)
|
|
330
|
+
throw new Error('overall.stats.deltaCi.lo cannot exceed hi');
|
|
331
|
+
const rawScoreCi = stats['scoreDeltaCi'];
|
|
332
|
+
const scoreCi = rawScoreCi === undefined || rawScoreCi === null ? null
|
|
333
|
+
: object(rawScoreCi, 'overall.stats.scoreDeltaCi');
|
|
334
|
+
const scoreDeltaCi = scoreCi === null ? null : {
|
|
335
|
+
lo: number(scoreCi['lo'], 'overall.stats.scoreDeltaCi.lo', -1, 1),
|
|
336
|
+
hi: number(scoreCi['hi'], 'overall.stats.scoreDeltaCi.hi', -1, 1),
|
|
337
|
+
resamples: integer(scoreCi['resamples'], 'overall.stats.scoreDeltaCi.resamples', 1),
|
|
338
|
+
};
|
|
339
|
+
if (scoreDeltaCi && scoreDeltaCi.lo > scoreDeltaCi.hi)
|
|
340
|
+
throw new Error('overall.stats.scoreDeltaCi.lo cannot exceed hi');
|
|
341
|
+
const overallRow = row(overall, 'overall', 'Overall');
|
|
342
|
+
const declaredTrials = integer(manifest['trials'], 'trials', 1);
|
|
343
|
+
for (const [index, task] of tasks.entries())
|
|
344
|
+
checkCostCounts(task, declaredTrials, `tasks[${index}]`);
|
|
345
|
+
checkCostCounts(overallRow, declaredTrials * tasks.length, 'overall');
|
|
346
|
+
if (overallRow.costs) {
|
|
347
|
+
if (tasks.some(t => !t.costs))
|
|
348
|
+
throw new Error('overall.costs requires costs for every task');
|
|
349
|
+
assertCostTotals(overallRow.costs, tasks.map(t => t.costs));
|
|
350
|
+
}
|
|
351
|
+
else if (tasks.some(t => t.costs))
|
|
352
|
+
throw new Error('Task costs require corresponding overall costs');
|
|
353
|
+
for (const [index, task] of tasks.entries())
|
|
354
|
+
checkDelta(task, `tasks[${index}]`);
|
|
355
|
+
checkDelta(overallRow, 'overall');
|
|
356
|
+
if (scoreDeltaCi) {
|
|
357
|
+
if (overallRow.scoreDelta === null || overallRow.baseline.meanScore === null ||
|
|
358
|
+
overallRow.treatment.meanScore === null || !tasks.some(t => t.baseline.trials > 0 && t.baseline.meanScore !== null &&
|
|
359
|
+
t.treatment.meanScore !== null && t.scoreDelta !== null)) {
|
|
360
|
+
throw new Error('overall.stats.scoreDeltaCi requires paired graded score observations and overall scoreDelta');
|
|
361
|
+
}
|
|
362
|
+
if (scoreCi['point'] !== undefined && Math.abs(number(scoreCi['point'], 'overall.stats.scoreDeltaCi.point', -1, 1) - overallRow.scoreDelta) > 1e-9) {
|
|
363
|
+
throw new Error('overall.stats.scoreDeltaCi.point disagrees with overall.scoreDelta');
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
for (const condition of ['baseline', 'treatment']) {
|
|
367
|
+
for (const field of ['passes', 'trials', 'errors']) {
|
|
368
|
+
const total = tasks.reduce((sum, task) => sum + task[condition][field], 0);
|
|
369
|
+
if (total !== overallRow[condition][field]) {
|
|
370
|
+
throw new Error(`overall.conditions.${condition}.${field} disagrees with task totals`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const aggregate = overallRow[condition];
|
|
374
|
+
if (aggregate.skillReads) {
|
|
375
|
+
if (!skillDelivery || tasks.some(t => t[condition].skillReads === null))
|
|
376
|
+
throw new Error('skillReads requires installed delivery and recorded observations for every task');
|
|
377
|
+
for (const field of ['observed', 'unobserved', 'unknown']) {
|
|
378
|
+
if (aggregate.skillReads[field] !== tasks.reduce((sum, t) => sum + t[condition].skillReads[field], 0)) {
|
|
379
|
+
throw new Error(`overall.conditions.${condition}.skillReads.${field} disagrees with task totals`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
else if (tasks.some(t => t[condition].skillReads !== null))
|
|
384
|
+
throw new Error('Task skillReads requires corresponding overall observations');
|
|
385
|
+
if (aggregate.tokenCoverage) {
|
|
386
|
+
if (tasks.some(t => t[condition].tokenCoverage === null)) {
|
|
387
|
+
throw new Error(`overall.conditions.${condition}.tokenCoverage requires recorded coverage for every task`);
|
|
388
|
+
}
|
|
389
|
+
for (const field of ['input', 'output']) {
|
|
390
|
+
const coverage = tasks.reduce((sum, t) => sum + t[condition].tokenCoverage[field], 0);
|
|
391
|
+
if (coverage !== aggregate.tokenCoverage[field]) {
|
|
392
|
+
throw new Error(`overall.conditions.${condition}.tokenCoverage.${field} disagrees with task totals`);
|
|
393
|
+
}
|
|
394
|
+
const total = tasks.reduce((sum, t) => sum + (t[condition].tokens?.[field] ?? 0), 0);
|
|
395
|
+
if (total !== (aggregate.tokens?.[field] ?? 0)) {
|
|
396
|
+
throw new Error(`overall.conditions.${condition}.tokens.${field} disagrees with task totals`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
const improved = integer(discordant['improved'], 'overall.stats.discordant.improved');
|
|
402
|
+
const regressed = integer(discordant['regressed'], 'overall.stats.discordant.regressed');
|
|
403
|
+
if (improved + regressed > overallRow.baseline.trials) {
|
|
404
|
+
throw new Error('overall.stats.discordant exceeds the number of paired trials');
|
|
405
|
+
}
|
|
406
|
+
if (improved - regressed !== overallRow.treatment.passes - overallRow.baseline.passes) {
|
|
407
|
+
throw new Error('overall.stats.discordant.improved - regressed disagrees with treatment.passes - baseline.passes');
|
|
408
|
+
}
|
|
409
|
+
const sharedSuccess = overallRow.baseline.passes - regressed;
|
|
410
|
+
if (sharedSuccess < 0) {
|
|
411
|
+
throw new Error('overall.stats.discordant implies a negative shared success count');
|
|
412
|
+
}
|
|
413
|
+
const sharedFailure = overallRow.baseline.trials - improved - regressed - sharedSuccess;
|
|
414
|
+
if (sharedFailure < 0) {
|
|
415
|
+
throw new Error('overall.stats.discordant implies a negative shared failure count');
|
|
416
|
+
}
|
|
417
|
+
const mcnemarP = number(stats['mcnemarP'], 'overall.stats.mcnemarP', 0, 1);
|
|
418
|
+
if (Math.abs(mcnemarP - mcnemarExactP(improved, regressed)) > 1e-9) {
|
|
419
|
+
throw new Error('overall.stats.mcnemarP disagrees with discordant counts');
|
|
420
|
+
}
|
|
421
|
+
const expectedVerdict = verdictFor({ improved, regressed, deltaPassRate: overallRow.deltaPassRate }).verdict;
|
|
422
|
+
if (overallRow.verdict !== expectedVerdict)
|
|
423
|
+
throw new Error('overall.verdict disagrees with the metrics protocol');
|
|
424
|
+
const managed = experiment(manifest['experiment']);
|
|
425
|
+
if (managed && managed.plannedCalls !== taskCount * integer(manifest['trials'], 'trials', 1) * (manifest['judge'] == null ? 2 : 4)) {
|
|
426
|
+
throw new Error('experiment.plannedCalls contradicts the declared tasks, trials, conditions, and judge');
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
runGroup: string(manifest['runGroup'], 'runGroup'),
|
|
430
|
+
...(manifest['invocationCosts'] === undefined ? {} : { invocationCosts: parseInvocationCosts(manifest['invocationCosts']) }),
|
|
431
|
+
createdAt,
|
|
432
|
+
target: { kind, name: string(target['name'], 'target.name'), sha256: hash(target['bundleSha256'], 'target.bundleSha256') },
|
|
433
|
+
baselineTarget,
|
|
434
|
+
bench: {
|
|
435
|
+
name: string(bench['name'], 'bench.name'),
|
|
436
|
+
sha256: hash(bench['contentSha256'], 'bench.contentSha256'),
|
|
437
|
+
taskCount,
|
|
438
|
+
},
|
|
439
|
+
executor: { kind: string(executor['kind'], 'executor.kind'), model: string(executor['model'], 'executor.model') },
|
|
440
|
+
trials: integer(manifest['trials'], 'trials', 1),
|
|
441
|
+
inputMode: inputMode ?? null,
|
|
442
|
+
skillDelivery,
|
|
443
|
+
experiment: managed,
|
|
444
|
+
tasks,
|
|
445
|
+
overall: {
|
|
446
|
+
...overallRow,
|
|
447
|
+
verdictReason: string(overall['verdictReason'], 'overall.verdictReason'),
|
|
448
|
+
improved,
|
|
449
|
+
regressed,
|
|
450
|
+
mcnemarP,
|
|
451
|
+
deltaCi: ciValue,
|
|
452
|
+
scoreDeltaCi,
|
|
453
|
+
},
|
|
454
|
+
warnings: warnings,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const BACKUP_SUFFIX = '.skillfit-bak';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { constants, existsSync, promises as fs } from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { BACKUP_SUFFIX } from './constants.js';
|
|
5
|
+
/** Stage every write before replacing any target; rollback is best effort, not crash atomicity. */
|
|
6
|
+
export async function executeTransaction(files, validate) {
|
|
7
|
+
const staged = [];
|
|
8
|
+
try {
|
|
9
|
+
for (const file of files) {
|
|
10
|
+
await fs.mkdir(path.dirname(file.path), { recursive: true });
|
|
11
|
+
const suffix = `${process.pid}.${randomUUID()}`;
|
|
12
|
+
const tmp = `${file.path}.${suffix}.skillfit-staged`;
|
|
13
|
+
const restore = existsSync(file.path) ? `${file.path}.${suffix}.skillfit-restore` : null;
|
|
14
|
+
const entry = { target: file.path, tmp, restore, backedUp: null };
|
|
15
|
+
staged.push(entry);
|
|
16
|
+
if (restore)
|
|
17
|
+
await fs.copyFile(file.path, restore);
|
|
18
|
+
if (file.backup !== 'none') {
|
|
19
|
+
// Metadata may track the previous version; user content keeps the first original.
|
|
20
|
+
if (file.backup === 'previous') {
|
|
21
|
+
await fs.copyFile(file.path, file.path + BACKUP_SUFFIX);
|
|
22
|
+
entry.backedUp = file.path + BACKUP_SUFFIX;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
entry.backedUp = await backupOnce(file.path);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
await fs.writeFile(tmp, file.content);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const cleanupFailures = await cleanupStaged(staged);
|
|
33
|
+
throw transactionFailure(error, [], cleanupFailures);
|
|
34
|
+
}
|
|
35
|
+
const applied = [];
|
|
36
|
+
try {
|
|
37
|
+
for (const entry of staged) {
|
|
38
|
+
await fs.rename(entry.tmp, entry.target);
|
|
39
|
+
applied.push(entry);
|
|
40
|
+
}
|
|
41
|
+
await validate();
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const rollbackFailures = [];
|
|
45
|
+
const preserveRestores = new Set();
|
|
46
|
+
for (const entry of applied.reverse()) {
|
|
47
|
+
try {
|
|
48
|
+
if (entry.restore)
|
|
49
|
+
await fs.copyFile(entry.restore, entry.target);
|
|
50
|
+
else
|
|
51
|
+
await fs.rm(entry.target, { force: true });
|
|
52
|
+
}
|
|
53
|
+
catch (rollbackError) {
|
|
54
|
+
const recovery = entry.restore ? `recovery copy retained at ${entry.restore}` : 'new target remains; no previous file to restore';
|
|
55
|
+
rollbackFailures.push(`${entry.target}: ${rollbackError.message} (${recovery})`);
|
|
56
|
+
preserveRestores.add(entry.target);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const cleanupFailures = await cleanupStaged(staged, preserveRestores);
|
|
60
|
+
throw transactionFailure(error, rollbackFailures, cleanupFailures);
|
|
61
|
+
}
|
|
62
|
+
const cleanupFailures = await cleanupStaged(staged);
|
|
63
|
+
if (cleanupFailures.length > 0) {
|
|
64
|
+
throw new Error(`Install files were validated, but cleanup failed for ${cleanupFailures.join('; ')}`);
|
|
65
|
+
}
|
|
66
|
+
return staged.map(({ target, backedUp }) => ({ target, backedUp }));
|
|
67
|
+
}
|
|
68
|
+
function transactionFailure(error, rollbackFailures, cleanupFailures) {
|
|
69
|
+
if (rollbackFailures.length === 0 && cleanupFailures.length === 0)
|
|
70
|
+
return error;
|
|
71
|
+
const details = [`Install failed (${error instanceof Error ? error.message : String(error)})`];
|
|
72
|
+
if (rollbackFailures.length > 0) {
|
|
73
|
+
details.push(`rollback failed for ${rollbackFailures.join('; ')}`);
|
|
74
|
+
}
|
|
75
|
+
if (cleanupFailures.length > 0)
|
|
76
|
+
details.push(`cleanup failed for ${cleanupFailures.join('; ')}`);
|
|
77
|
+
return new Error(details.join('; '), { cause: error });
|
|
78
|
+
}
|
|
79
|
+
async function cleanupStaged(staged, preserveRestores = new Set()) {
|
|
80
|
+
const failures = [];
|
|
81
|
+
for (const entry of staged) {
|
|
82
|
+
const files = [entry.tmp];
|
|
83
|
+
if (entry.restore && !preserveRestores.has(entry.target))
|
|
84
|
+
files.push(entry.restore);
|
|
85
|
+
for (const file of files) {
|
|
86
|
+
try {
|
|
87
|
+
await fs.rm(file, { force: true });
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
failures.push(`${file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return failures;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Back up a file at most once. `.skillfit-bak` is a single slot, and the copy worth keeping is the
|
|
98
|
+
* user's pre-skillfit original: overwriting it on a later update would destroy the only copy of the
|
|
99
|
+
* content the suffix exists to protect. Returns the backup path when one was created, else null.
|
|
100
|
+
*/
|
|
101
|
+
async function backupOnce(target) {
|
|
102
|
+
const backup = target + BACKUP_SUFFIX;
|
|
103
|
+
try {
|
|
104
|
+
await fs.copyFile(target, backup, constants.COPYFILE_EXCL);
|
|
105
|
+
return backup;
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
if (error.code === 'EEXIST')
|
|
109
|
+
return null;
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# skillfit documentation
|
|
2
|
+
|
|
3
|
+
Start with your own task: create a case, check it offline, preview an evaluation,
|
|
4
|
+
then read and share its saved evidence. The bundled cases teach the format.
|
|
5
|
+
|
|
6
|
+
## Start here
|
|
7
|
+
|
|
8
|
+
- [First real evaluation](first-real-eval.md): npm onboarding, prerequisites, call counts and interpreting results.
|
|
9
|
+
- [Case authoring](bench-authoring.md): turn a real failure into a fixture, verifier and reference repair.
|
|
10
|
+
- [Offline first-check example](reproducible-offline-example.md): dated checks you can reproduce without a model.
|
|
11
|
+
- [Bench format](../benches/README.md): manifests, files and self-containment requirements.
|
|
12
|
+
|
|
13
|
+
## Build and manage cases
|
|
14
|
+
|
|
15
|
+
- [Case management](case-management.md): list, inspect, select, edit and unregister tasks.
|
|
16
|
+
- [Drafting records](bench-drafting.md): one confirmed drafting call and its retained costs/failures.
|
|
17
|
+
- [Verifier contract](verifier-contract.md): quoted commands, task failures and infrastructure errors.
|
|
18
|
+
- [Bench check JSON](bench-check-json.md): offline gate codes, diagnostics and exit codes.
|
|
19
|
+
- [Real OSS tasks](oss-task-evaluation.md): workspace inputs and independent acceptance checks.
|
|
20
|
+
|
|
21
|
+
## Plan and run evaluations
|
|
22
|
+
|
|
23
|
+
- [Bounded workflow](experiment-workflow.md) and [shared planning](eval-planning.md): previews, confirmation, budgets and output groups.
|
|
24
|
+
- [Installed Skill evaluation](installed-skill-evaluation.md) and [revision comparisons](skill-revisions.md): complete Skill delivery and distinct baselines.
|
|
25
|
+
- [Rules and MCP experiments](config-experiments.md): project overlays and server discovery.
|
|
26
|
+
- [Agent environment preflight](eval-agent-preflight.md) and [case preflight](eval-case-preflight.md): failures, warnings and unknown evidence before spending.
|
|
27
|
+
- [Agent evaluation component](eval-component.md): request/result contracts and adoption policy.
|
|
28
|
+
- [Timing](eval-timing.md), [interruption](evaluation-interruption.md) and [sealed inputs](evaluation-input-snapshots.md): what a run retains and how it stops.
|
|
29
|
+
|
|
30
|
+
## Read and reproduce results
|
|
31
|
+
|
|
32
|
+
- [Report types and states](evaluation-reports.md): paired, calibration and trigger evidence.
|
|
33
|
+
- [Cost accounting](eval-costs.md): invocation populations, cache partitions and unknown usage.
|
|
34
|
+
- [Metrics protocol](metrics.md): statistical verdicts and limits of claims.
|
|
35
|
+
- [Sharing results](sharing-results.md) and [portable replay](replay-packages.md): saved evidence, integrity and offline reproduction.
|
|
36
|
+
- [Historical archive restoration](archive-delivery.md) and [exact inventory](archive-inventory.md): explicit pinned downloads and offline workspaces.
|
|
37
|
+
- [Evidence index](../evidence/README.md): all dated public reports and their limits.
|
|
38
|
+
- [Debugging Skill study](skill-evaluation-evidence.md): current study status and cumulative accounting.
|
|
39
|
+
|
|
40
|
+
## Configure agents
|
|
41
|
+
|
|
42
|
+
- [Selectable Codex setup](selectable-codex.md): choose pinned sources for particular tasks.
|
|
43
|
+
- [Portable Codex setup](portable-codex.md): move used Skills and global guidance between machines.
|
|
44
|
+
- [Codex source audit](codex-upstream-audit.md): source provenance and installation scope.
|
|
45
|
+
|
|
46
|
+
## Develop and maintain
|
|
47
|
+
|
|
48
|
+
- [Architecture](architecture.md): workflows, module ownership, dependency and evidence boundaries.
|
|
49
|
+
- [Contributing](../CONTRIBUTING.md): development checks, bench submissions and evidence requirements.
|
|
50
|
+
- [Roadmap](growth-roadmap-2026-10.md): current product work and later decisions.
|
|
51
|
+
- [Changelog](../CHANGELOG.md) and [release records](releases/): versioned behavior and publication evidence.
|
|
52
|
+
- [Package contents](package-contents.md): retained offline inputs, external archives and package checks.
|
|
53
|
+
- [Trusted publishing](releases/trusted-publishing.md): release preparation and verification.
|
|
54
|
+
- [Experiment script navigation](../scripts/README.md): active utilities and fixed historical procedures.
|
|
55
|
+
- [Installation and archive delivery plan](plans/2026-10-20-install-transactions-and-archive-delivery.md): ordered tasks, actual progress and verification.
|
|
56
|
+
- [Previous cleanup plan](plans/2026-10-20-docs-architecture-cleanup.md): the preceding documentation and architecture work.
|
|
57
|
+
|
|
58
|
+
## Historical work records
|
|
59
|
+
|
|
60
|
+
[Plans](plans/) describe the scope and observations of their dates. Publication
|
|
61
|
+
status belongs to the corresponding release record; study status belongs to its
|
|
62
|
+
maintained evidence index. Fixed evidence and replay inputs keep their original paths.
|
|
63
|
+
|
|
64
|
+
The [September 24 audit](audit-2026-09-24.md) and its [triage](audit-2026-09-24-triage.md)
|
|
65
|
+
are historical findings against their recorded commit, rather than a current issue list.
|