skillfit 0.16.0 → 0.16.2
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/CHANGELOG.md +23 -0
- package/README.md +17 -17
- package/README.zh-CN.md +17 -17
- package/dist/agents/adapters/cli.js +4 -2
- package/dist/bench/authoring.js +101 -1
- package/dist/cli/definition.js +3 -0
- package/dist/cli/eval-report.js +204 -6
- package/dist/cli/main.js +59 -0
- package/dist/composition.js +4 -0
- package/dist/evaluation/application/preparation.js +150 -0
- package/dist/evaluation/records/audit.js +3 -2
- package/docs/README.md +4 -4
- package/docs/reference/eval-component.md +39 -0
- package/docs/reference/evaluation-reports.md +36 -1
- package/package.json +2 -2
- package/skills/skillfit/SKILL.md +28 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.16.2 — Explain Skill comparison outcomes and adoption (2026-11-27)
|
|
6
|
+
|
|
7
|
+
- Paired reports lead with observed changes, runtime errors, and the adoption decision.
|
|
8
|
+
- Find named regressions even when gains offset them in the averages, and open the
|
|
9
|
+
saved outputs, verifier logs, and receipts for both versions.
|
|
10
|
+
- Review invocation costs and coverage alongside the adoption conditions. For
|
|
11
|
+
stopped runs, the summary points to the records available for recovery.
|
|
12
|
+
|
|
13
|
+
## 0.16.1 — Prepare Skill revision comparisons and fix shell startup (2026-11-17)
|
|
14
|
+
|
|
15
|
+
- `eval --prepare` creates a fresh comparison workspace from two complete Skill
|
|
16
|
+
versions, a real fix commit and an issue-style prompt. It snapshots both Skills,
|
|
17
|
+
imports the parent fixture and hidden regression tests, records the reference
|
|
18
|
+
fix, runs local integrity gates and writes a balanced two-call development
|
|
19
|
+
request. Preview writes nothing and calls no model; execution remains separate
|
|
20
|
+
and requires its dry-run fingerprint and authorized spending.
|
|
21
|
+
- Existing outputs are refused, source drift is rechecked before creation,
|
|
22
|
+
failed writes remove the new workspace and failed integrity gates retain
|
|
23
|
+
blocked inputs. Revision adoption policy and verdict semantics are unchanged.
|
|
24
|
+
- Shell-backed agent startup passes its already quoted command line directly to
|
|
25
|
+
Node, avoiding DEP0190 while preserving literal arguments, empty values and
|
|
26
|
+
executable paths containing spaces.
|
|
27
|
+
|
|
5
28
|
## 0.16.0 — Personal agent configuration maintenance (2026-11-16)
|
|
6
29
|
|
|
7
30
|
- Add versioned `doctor --json` output and opt-in `doctor --strict` health
|
package/README.md
CHANGED
|
@@ -27,16 +27,16 @@ skillfit compares a baseline and a treatment on the same tasks and reports what
|
|
|
27
27
|
`report` and `doctor` read this machine and do not call a model.
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx skillfit@0.16.
|
|
31
|
-
npx skillfit@0.16.
|
|
32
|
-
npx skillfit@0.16.
|
|
33
|
-
npx skillfit@0.16.
|
|
30
|
+
npx skillfit@0.16.2 report
|
|
31
|
+
npx skillfit@0.16.2 doctor
|
|
32
|
+
npx skillfit@0.16.2 doctor --json
|
|
33
|
+
npx skillfit@0.16.2 doctor --strict
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
The JSON output is a `skillfit.doctor-report` [version-1 document](docs/schemas/doctor-report.schema.json) with Agent detection, Rules/Skills/MCP checks and matching summary counts. Findings remain advisory and exit 0 by default; `--strict` explicitly exits 1 when a FAIL exists, while an unknown Agent exits 2. Every doctor mode stays read-only: no model call, MCP connection or configuration write is performed.
|
|
37
37
|
|
|
38
38
|
```console
|
|
39
|
-
$ npx skillfit@0.16.
|
|
39
|
+
$ npx skillfit@0.16.2 report --agent codex
|
|
40
40
|
|
|
41
41
|
codex — 280 session(s), 280 transcript(s)
|
|
42
42
|
skill FIRES SESSIONS LAST SEEN
|
|
@@ -70,9 +70,9 @@ Captured 2026-11-04 from one Codex history. Five installed skills have no observ
|
|
|
70
70
|
No agent CLI, no login, no model calls. These read the benches shipped inside the package and take a few seconds:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
npx skillfit@0.16.
|
|
74
|
-
npx skillfit@0.16.
|
|
75
|
-
npx skillfit@0.16.
|
|
73
|
+
npx skillfit@0.16.2 bench check code-review
|
|
74
|
+
npx skillfit@0.16.2 bench self-test code-review --suite existing-mock-arms --runs-root ./runs --run-group controls-001 --yes
|
|
75
|
+
npx skillfit@0.16.2 report eval ./runs/controls-001/existing-mock-arms
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
<p align="center">
|
|
@@ -92,8 +92,8 @@ Paired eval defaults to **5 trials per condition**: 8 tasks require 80 agent exe
|
|
|
92
92
|
## Install
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
npx skillfit@0.16.
|
|
96
|
-
npx skillfit@0.16.
|
|
95
|
+
npx skillfit@0.16.2 --help
|
|
96
|
+
npx skillfit@0.16.2 doctor
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Requires Node.js 22+. Both commands above are offline and make no model calls: `--help` lists the nine commands, and `doctor` is a read-only health report that detects which supported agents you have, inspects their rules files, and flags invalid or conflicting Skills. [Choose your build](docs/README.md#choose-your-build) owns the package/source boundary, availability checks and older release documentation.
|
|
@@ -132,10 +132,10 @@ The instructions the agent should follow.
|
|
|
132
132
|
Then scaffold a case and preview an evaluation:
|
|
133
133
|
|
|
134
134
|
```bash
|
|
135
|
-
npx skillfit@0.16.
|
|
136
|
-
npx skillfit@0.16.
|
|
137
|
-
npx skillfit@0.16.
|
|
138
|
-
npx skillfit@0.16.
|
|
135
|
+
npx skillfit@0.16.2 bench init my-bench --kind command --dry-run
|
|
136
|
+
npx skillfit@0.16.2 bench init my-bench --kind command --yes
|
|
137
|
+
npx skillfit@0.16.2 bench check ./my-bench --json
|
|
138
|
+
npx skillfit@0.16.2 eval ./my-skill --bench ./my-bench --mode installed --agent codex --trials 1 --max-calls 2 --runs-root ./runs --run-group first-eval --json --dry-run
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
Replace the teaching fixture, prompt, verifier and oracle before measuring benefit. The preview declares two calls and makes none. Inspect `plan.evaluation.agentPreflight.status`; login remains unknown offline. Keep cases and runs in separate directories. Continue with [your first real evaluation](docs/guides/first-real-eval.md).
|
|
@@ -181,7 +181,7 @@ checkout once:
|
|
|
181
181
|
```bash
|
|
182
182
|
git clone https://github.com/remote-controlled-man/skillfit.git
|
|
183
183
|
cd skillfit
|
|
184
|
-
git switch --detach
|
|
184
|
+
git switch --detach 5511a67639b87a255031676e6e3703f649f25f7d
|
|
185
185
|
npm ci
|
|
186
186
|
npm run build
|
|
187
187
|
node dist/cli.js --help
|
|
@@ -192,7 +192,7 @@ node dist/cli.js eval skills/skillfit --bench code-review --agent codex --dry-ru
|
|
|
192
192
|
node dist/cli.js install --agent codex --dry-run
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
The detached commit contains the
|
|
195
|
+
The detached commit contains the comparison report improvements before the release bump. Building it prints 0.16.1.
|
|
196
196
|
For development on your own checkout, follow
|
|
197
197
|
[CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md).
|
|
198
198
|
|
|
@@ -236,7 +236,7 @@ node dist/cli.js eval <skill-dir> --bench <bench-dir> --agent codex --input work
|
|
|
236
236
|
node dist/cli.js bench check <bench-dir> --calibrate --agent codex --input workspace --trials 3 --dry-run
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
Import the issue request with `--prompt-file` so the fix message does not reveal the answer. Follow the [real OSS workflow](docs/guides/bench-authoring.md) or inspect the [pinned mcp-use example](https://github.com/remote-controlled-man/skillfit/blob/
|
|
239
|
+
Import the issue request with `--prompt-file` so the fix message does not reveal the answer. Follow the [real OSS workflow](docs/guides/bench-authoring.md) or inspect the [pinned mcp-use example](https://github.com/remote-controlled-man/skillfit/blob/17772db9b2f112a1e25d0284a76cf38860f7790b/benches/contrib/oss-mcp-use-utf8/README.md).
|
|
240
240
|
|
|
241
241
|
### Compare Skill revisions
|
|
242
242
|
|
package/README.zh-CN.md
CHANGED
|
@@ -27,16 +27,16 @@ skillfit 在同一批任务上比较基线组与实验组,并报告变化及
|
|
|
27
27
|
`report` 和 `doctor` 只读这台机器,不调用模型。
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx skillfit@0.16.
|
|
31
|
-
npx skillfit@0.16.
|
|
32
|
-
npx skillfit@0.16.
|
|
33
|
-
npx skillfit@0.16.
|
|
30
|
+
npx skillfit@0.16.2 report
|
|
31
|
+
npx skillfit@0.16.2 doctor
|
|
32
|
+
npx skillfit@0.16.2 doctor --json
|
|
33
|
+
npx skillfit@0.16.2 doctor --strict
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
JSON 输出是 `skillfit.doctor-report` [v1 文档](docs/schemas/doctor-report.schema.json),包含 Agent 检测、Rules/Skills/MCP 检查及一致的汇总计数。默认情况下发现异常仍是建议信息并退出 0;`--strict` 在存在 FAIL 时显式退出 1,未知 Agent 仍退出 2。所有 doctor 模式都保持只读:不调用模型、不连接 MCP,也不修改配置。
|
|
37
37
|
|
|
38
38
|
```console
|
|
39
|
-
$ npx skillfit@0.16.
|
|
39
|
+
$ npx skillfit@0.16.2 report --agent codex
|
|
40
40
|
|
|
41
41
|
codex — 280 session(s), 280 transcript(s)
|
|
42
42
|
skill FIRES SESSIONS LAST SEEN
|
|
@@ -70,9 +70,9 @@ Overall: 17 installed skill(s), 12 observed firing, 5 with no observed fire in r
|
|
|
70
70
|
不需要 agent CLI、不需要登录、不调用模型。以下命令读取包内自带的 bench,几秒即可跑完:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
npx skillfit@0.16.
|
|
74
|
-
npx skillfit@0.16.
|
|
75
|
-
npx skillfit@0.16.
|
|
73
|
+
npx skillfit@0.16.2 bench check code-review
|
|
74
|
+
npx skillfit@0.16.2 bench self-test code-review --suite existing-mock-arms --runs-root ./runs --run-group controls-001 --yes
|
|
75
|
+
npx skillfit@0.16.2 report eval ./runs/controls-001/existing-mock-arms
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
<p align="center">
|
|
@@ -92,8 +92,8 @@ npx skillfit@0.16.0 report eval ./runs/controls-001/existing-mock-arms
|
|
|
92
92
|
## 安装
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
npx skillfit@0.16.
|
|
96
|
-
npx skillfit@0.16.
|
|
95
|
+
npx skillfit@0.16.2 --help
|
|
96
|
+
npx skillfit@0.16.2 doctor
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
需要 Node.js 22+。以上两条命令均离线执行,不调用模型:`--help` 列出九个命令;`doctor` 是只读健康报告,检测你装了哪些受支持的 agent、检查它们的规则文件,并标出无效或冲突的 Skill。[选择构建](docs/README.md#choose-your-build)是包/源码边界、可用性确认与旧版发布文档的唯一入口。
|
|
@@ -132,10 +132,10 @@ The instructions the agent should follow.
|
|
|
132
132
|
然后脚手架一个 case 并预览评测:
|
|
133
133
|
|
|
134
134
|
```bash
|
|
135
|
-
npx skillfit@0.16.
|
|
136
|
-
npx skillfit@0.16.
|
|
137
|
-
npx skillfit@0.16.
|
|
138
|
-
npx skillfit@0.16.
|
|
135
|
+
npx skillfit@0.16.2 bench init my-bench --kind command --dry-run
|
|
136
|
+
npx skillfit@0.16.2 bench init my-bench --kind command --yes
|
|
137
|
+
npx skillfit@0.16.2 bench check ./my-bench --json
|
|
138
|
+
npx skillfit@0.16.2 eval ./my-skill --bench ./my-bench --mode installed --agent codex --trials 1 --max-calls 2 --runs-root ./runs --run-group first-eval --json --dry-run
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
测收益前先把教学用 fixture、prompt、verifier 和 oracle 换成真实任务。预览声明两次调用,实际不调用。检查 `plan.evaluation.agentPreflight.status`;离线登录状态仍未知。case 与运行记录分开放。继续阅读[第一次真实评测](docs/guides/first-real-eval.md)。
|
|
@@ -178,7 +178,7 @@ F1 : 0.20 (no CI: a harmonic mean of two proportions has no clo
|
|
|
178
178
|
```bash
|
|
179
179
|
git clone https://github.com/remote-controlled-man/skillfit.git
|
|
180
180
|
cd skillfit
|
|
181
|
-
git switch --detach
|
|
181
|
+
git switch --detach 5511a67639b87a255031676e6e3703f649f25f7d
|
|
182
182
|
npm ci
|
|
183
183
|
npm run build
|
|
184
184
|
node dist/cli.js --help
|
|
@@ -189,7 +189,7 @@ node dist/cli.js eval skills/skillfit --bench code-review --agent codex --dry-ru
|
|
|
189
189
|
node dist/cli.js install --agent codex --dry-run
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
这个固定提交包含版本比较报告改进,构建后显示本次发布前的版本号 0.16.1。要在自己的检出上开发,请按 [CONTRIBUTING.md](https://github.com/remote-controlled-man/skillfit/blob/main/CONTRIBUTING.md) 操作。
|
|
193
193
|
|
|
194
194
|
校验离线执行;`doctor` 只读,两种预览都只展示计划。适配器覆盖 **Claude Code**、**OpenAI Codex CLI** 与 **Kimi Code**;[当前源码能力表](docs/guides/experiment-workflow.md#executor-capabilities)列出模式、trigger reader、token/cache 限制与验证层级。matrix 声明命令;离线替身不能证明已安装 CLI 的兼容性或登录状态。
|
|
195
195
|
|
|
@@ -231,7 +231,7 @@ node dist/cli.js eval <skill-dir> --bench <bench-dir> --agent codex --input work
|
|
|
231
231
|
node dist/cli.js bench check <bench-dir> --calibrate --agent codex --input workspace --trials 3 --dry-run
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
导入时用 `--prompt-file` 保留 issue 请求,避免修复提交信息泄露答案。参见[真实 OSS 流程](docs/guides/bench-authoring.md)或[固定的 mcp-use 示例](https://github.com/remote-controlled-man/skillfit/blob/
|
|
234
|
+
导入时用 `--prompt-file` 保留 issue 请求,避免修复提交信息泄露答案。参见[真实 OSS 流程](docs/guides/bench-authoring.md)或[固定的 mcp-use 示例](https://github.com/remote-controlled-man/skillfit/blob/17772db9b2f112a1e25d0284a76cf38860f7790b/benches/contrib/oss-mcp-use-utf8/README.md)。
|
|
235
235
|
|
|
236
236
|
### 比较 Skill 修订版本
|
|
237
237
|
|
|
@@ -209,8 +209,10 @@ export class CliExecutor {
|
|
|
209
209
|
return Promise.reject(new Error("CliExecutor has an empty command"));
|
|
210
210
|
}
|
|
211
211
|
const spawnArgv = this.shell ? [command, ...args].map(quoteShellArg) : [command, ...args];
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
// Shell arguments have already been validated and quoted. Supply the command line directly
|
|
213
|
+
// instead of asking Node to concatenate a separate argv, which is deprecated as DEP0190.
|
|
214
|
+
const spawnCommand = this.shell ? spawnArgv.join(" ") : (spawnArgv[0] ?? command);
|
|
215
|
+
const spawnArgs = this.shell ? [] : spawnArgv.slice(1);
|
|
214
216
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
215
217
|
const deadline = new ExecutionDeadline(this.timeoutMs, this.clock);
|
|
216
218
|
const child = spawn(spawnCommand, spawnArgs, {
|
package/dist/bench/authoring.js
CHANGED
|
@@ -677,7 +677,7 @@ if (result.error) {
|
|
|
677
677
|
process.exit(result.status ?? 1);
|
|
678
678
|
`;
|
|
679
679
|
}
|
|
680
|
-
function prepareFromCommit(options, cwd, preparedAt) {
|
|
680
|
+
function prepareFromCommit(options, cwd, preparedAt, reference = false) {
|
|
681
681
|
const issuePrompt = options.prompt ??
|
|
682
682
|
(options.promptFile !== undefined
|
|
683
683
|
? readFileSync(resolve(cwd, options.promptFile), "utf8")
|
|
@@ -751,6 +751,16 @@ function prepareFromCommit(options, cwd, preparedAt) {
|
|
|
751
751
|
content: gitShow(repo, sha, entry.path),
|
|
752
752
|
}));
|
|
753
753
|
const verifierCmd = options.verifierCmd ?? "node --test";
|
|
754
|
+
const referenceFiles = reference
|
|
755
|
+
? nonTests.map((entry) => {
|
|
756
|
+
if (isAbsolute(entry.path) || entry.path.split(/[\\/]/).includes(".."))
|
|
757
|
+
throw new Error(`Invalid reference path: ${entry.path}`);
|
|
758
|
+
return {
|
|
759
|
+
path: entry.path,
|
|
760
|
+
content: entry.status === "D" ? null : gitShow(repo, sha, entry.path).toString("base64"),
|
|
761
|
+
};
|
|
762
|
+
})
|
|
763
|
+
: [];
|
|
754
764
|
return {
|
|
755
765
|
defaultTaskId: `fix-${shortSha}`,
|
|
756
766
|
promptText: issuePrompt ??
|
|
@@ -768,6 +778,20 @@ ${subject}${body !== "" ? `\n\n${body}` : ""}
|
|
|
768
778
|
- Hidden grading runs the project's tests afterward — make the behavior correct, not merely plausible.`,
|
|
769
779
|
verifierSource: verifierForMinedTests(tests, verifierCmd),
|
|
770
780
|
verifierKind: "command",
|
|
781
|
+
...(reference
|
|
782
|
+
? {
|
|
783
|
+
oracleSource: `import { mkdirSync, writeFileSync, rmSync } from 'node:fs';
|
|
784
|
+
import { join, dirname } from 'node:path';
|
|
785
|
+
const root = process.argv[2];
|
|
786
|
+
if (!root) throw new Error('Missing run directory');
|
|
787
|
+
for (const file of ${JSON.stringify(referenceFiles)}) {
|
|
788
|
+
const target = join(root, file.path);
|
|
789
|
+
if (file.content === null) rmSync(target, {force: true});
|
|
790
|
+
else { mkdirSync(dirname(target), {recursive: true}); writeFileSync(target, Buffer.from(file.content, 'base64')); }
|
|
791
|
+
}
|
|
792
|
+
`,
|
|
793
|
+
}
|
|
794
|
+
: {}),
|
|
771
795
|
fixtureFiles,
|
|
772
796
|
groundTruth: `# Ground truth — fix-${shortSha}
|
|
773
797
|
|
|
@@ -932,6 +956,82 @@ function prepareManagement(options) {
|
|
|
932
956
|
},
|
|
933
957
|
});
|
|
934
958
|
}
|
|
959
|
+
/** Mine a complete, fresh bench without writing a teaching task or invoking a drafter. */
|
|
960
|
+
export function prepareCommitBench(options) {
|
|
961
|
+
if (!options.fromCommit || !options.promptFile)
|
|
962
|
+
throw new Error("Commit preparation requires --from-commit and an issue-style --prompt-file.");
|
|
963
|
+
const cwd = options.cwd ?? process.cwd(), dir = resolve(cwd, options.dir), at = new Date();
|
|
964
|
+
const capture = () => prepareFromCommit(options, cwd, at, true);
|
|
965
|
+
const source = capture(), fingerprint = sha256Text(JSON.stringify(source));
|
|
966
|
+
const files = taskFilePaths(source.defaultTaskId);
|
|
967
|
+
const writes = source.fixtureFiles.map((file) => ({
|
|
968
|
+
target: join(dir, files.fixture, file.rel),
|
|
969
|
+
content: file.content,
|
|
970
|
+
}));
|
|
971
|
+
for (const [rel, content] of Object.entries({
|
|
972
|
+
[files.prompt]: source.promptText,
|
|
973
|
+
[files.promptTrigger]: source.promptText,
|
|
974
|
+
[files.verifier]: source.verifierSource,
|
|
975
|
+
[files.oracle]: source.oracleSource,
|
|
976
|
+
[files.rubric]: source.groundTruth.replace("TODO: summarize the correct fix here so future bench edits stay honest.", "The reference oracle applies the fix commit's non-test file changes; the verifier supplies the commit's tests."),
|
|
977
|
+
"bench.json": JSON.stringify({
|
|
978
|
+
schemaVersion: 1,
|
|
979
|
+
name: basename(dir),
|
|
980
|
+
tasks: [
|
|
981
|
+
{
|
|
982
|
+
id: source.defaultTaskId,
|
|
983
|
+
fixture: files.fixture,
|
|
984
|
+
prompt: files.prompt,
|
|
985
|
+
promptTrigger: files.promptTrigger,
|
|
986
|
+
verifier: `node ${files.verifier}`,
|
|
987
|
+
verifierKind: "command",
|
|
988
|
+
oracle: `node ${files.oracle}`,
|
|
989
|
+
rubric: files.rubric,
|
|
990
|
+
},
|
|
991
|
+
],
|
|
992
|
+
}, null, 2) + "\n",
|
|
993
|
+
}))
|
|
994
|
+
writes.push({ target: join(dir, rel), content });
|
|
995
|
+
const assertCurrent = () => {
|
|
996
|
+
try {
|
|
997
|
+
lstatSync(dir);
|
|
998
|
+
throw new Error(`Target directory already exists: ${dir}`);
|
|
999
|
+
}
|
|
1000
|
+
catch (error) {
|
|
1001
|
+
if (error.code !== "ENOENT")
|
|
1002
|
+
throw error;
|
|
1003
|
+
}
|
|
1004
|
+
if (sha256Text(JSON.stringify(capture())) !== fingerprint)
|
|
1005
|
+
throw new Error("Commit source changed; prepare a fresh plan.");
|
|
1006
|
+
};
|
|
1007
|
+
assertCurrent();
|
|
1008
|
+
return prepared({
|
|
1009
|
+
operation: "init",
|
|
1010
|
+
dir,
|
|
1011
|
+
writes,
|
|
1012
|
+
sourceSha256: fingerprint,
|
|
1013
|
+
targetSha256: sha256Text(JSON.stringify(writes)),
|
|
1014
|
+
lines: { before: [], preview: [], after: [] },
|
|
1015
|
+
confirmation: `Create commit-derived bench in ${dir}? [y/N] `,
|
|
1016
|
+
draft: false,
|
|
1017
|
+
result: { dir },
|
|
1018
|
+
assertCurrent,
|
|
1019
|
+
}, {
|
|
1020
|
+
apply: () => {
|
|
1021
|
+
assertCurrent();
|
|
1022
|
+
mkdirSync(dirname(dir), { recursive: true });
|
|
1023
|
+
mkdirSync(dir);
|
|
1024
|
+
try {
|
|
1025
|
+
applyBenchWrites(dir, writes);
|
|
1026
|
+
return { dir };
|
|
1027
|
+
}
|
|
1028
|
+
catch (error) {
|
|
1029
|
+
rmSync(dir, { recursive: true, force: true });
|
|
1030
|
+
throw error;
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
935
1035
|
export function prepareBenchChange(request, dependencies = {}) {
|
|
936
1036
|
if (request.operation === "init")
|
|
937
1037
|
return prepareInit({ ...request.options }, dependencies);
|
package/dist/cli/definition.js
CHANGED
|
@@ -8,6 +8,7 @@ const judgeAgent = option(" --judge-agent <id> Drive a paired eval's blind jud
|
|
|
8
8
|
const mode = option(" --mode <mode> Eval mode: inject (default) | installed (paired complete Skill) | trigger (single arm)");
|
|
9
9
|
const baselineSkill = option(" --baseline-skill <path> With --mode installed, compare a previous Skill version against the target");
|
|
10
10
|
const request = option(" --request <path> Version 1 Skill revision request (JSON output; excludes positional eval options)");
|
|
11
|
+
const prepare = option(" --prepare <dir> Prepare a fresh revision workspace; requires --baseline-skill, --from-commit, --source-dir, --prompt-file and --agent (no model calls)");
|
|
11
12
|
const planSha = option(" --plan-sha <hash> Confirm an eval/calibration/self-test dry-run plan (also needs --run-group)");
|
|
12
13
|
const json = option(" --json Machine output for doctor, bench check/self-test/list/show/edit/remove, report, eval and calibration");
|
|
13
14
|
const spendingBudget = option(" --spending-budget <file> Eval/calibration/drafting: input, cachedInput, uncachedInput, output, durationSeconds stop lines");
|
|
@@ -86,6 +87,7 @@ const COMMAND_HELP = {
|
|
|
86
87
|
mode,
|
|
87
88
|
baselineSkill,
|
|
88
89
|
request,
|
|
90
|
+
prepare,
|
|
89
91
|
planSha,
|
|
90
92
|
json,
|
|
91
93
|
spendingBudget,
|
|
@@ -186,6 +188,7 @@ export const CLI_OPTIONS = {
|
|
|
186
188
|
mode: { type: "string" },
|
|
187
189
|
"baseline-skill": { type: "string" },
|
|
188
190
|
request: { type: "string" },
|
|
191
|
+
prepare: { type: "string" },
|
|
189
192
|
"plan-sha": { type: "string" },
|
|
190
193
|
"spending-budget": { type: "string" },
|
|
191
194
|
"executor-timeout-seconds": { type: "string" },
|
package/dist/cli/eval-report.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { measurementScopeText } from "../evaluation/measurement/scope.js";
|
|
2
2
|
import { renderModelIdentityLines } from "../agents/observation/model-identity.js";
|
|
3
|
-
import { readFileSync, statSync } from "node:fs";
|
|
3
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
4
5
|
import { readEvaluationReport } from "./evaluation-report.js";
|
|
5
6
|
import { agentEnvironmentReportLines } from "../agents/preflight-contract.js";
|
|
6
7
|
import { renderSingleArmReport } from "./eval-single-arm-report.js";
|
|
7
8
|
import { CONCLUSIVE_TASKS, CONCLUSIVE_TRIALS, formatP, formatPp1, } from "../evaluation/measurement/report.js";
|
|
8
|
-
import { renderCostLines } from "../evaluation/measurement/costs.js";
|
|
9
|
+
import { completeCost, renderCostLines, } from "../evaluation/measurement/costs.js";
|
|
9
10
|
import { renderInvocationCostLines } from "../evaluation/measurement/invocation-costs.js";
|
|
10
11
|
import { parseEvalReport, } from "../evaluation/records/manifest.js";
|
|
11
12
|
export { parseEvalReport } from "../evaluation/records/manifest.js";
|
|
@@ -96,12 +97,209 @@ function decisionNotes(report) {
|
|
|
96
97
|
}
|
|
97
98
|
return notes;
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
+
function observedTaskChanges(result) {
|
|
101
|
+
// A failed audit can retain partial pairs; only a verified audit supports trial attribution.
|
|
102
|
+
const pairs = result.evidence.verified ? (result.evidence.pairs ?? []) : [];
|
|
103
|
+
return result.quality.tasks.map((task) => {
|
|
104
|
+
const taskPairs = pairs.filter((pair) => pair.taskId === task.id && pair.graded);
|
|
105
|
+
const checks = (change) => [
|
|
106
|
+
...new Set([
|
|
107
|
+
...(change === "regressed" ? task.regressedFacets : task.improvedFacets).map((f) => f.name),
|
|
108
|
+
...taskPairs.flatMap((pair) => pair.changedChecks.filter((c) => c.change === change).map((c) => c.name)),
|
|
109
|
+
]),
|
|
110
|
+
];
|
|
111
|
+
const regressedChecks = checks("regressed"), improvedChecks = checks("improved");
|
|
112
|
+
const regressed = (task.regressedPairs ?? 0) > 0 ||
|
|
113
|
+
task.deltaPassRate < 0 ||
|
|
114
|
+
(task.scoreDelta ?? 0) < 0 ||
|
|
115
|
+
regressedChecks.length > 0 ||
|
|
116
|
+
taskPairs.some((pair) => (pair.scoreDelta ?? 0) < 0);
|
|
117
|
+
const improved = (task.improvedPairs ?? 0) > 0 ||
|
|
118
|
+
task.deltaPassRate > 0 ||
|
|
119
|
+
(task.scoreDelta ?? 0) > 0 ||
|
|
120
|
+
improvedChecks.length > 0 ||
|
|
121
|
+
taskPairs.some((pair) => (pair.scoreDelta ?? 0) > 0);
|
|
122
|
+
const errors = task.baseline.errors + task.treatment.errors;
|
|
123
|
+
const attributed = task.regressedPairs !== null && task.improvedPairs !== null;
|
|
124
|
+
return { task, regressed, improved, errors, regressedChecks, improvedChecks, attributed };
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function comparisonEvidence(result) {
|
|
128
|
+
if (!result.evidence.verified)
|
|
129
|
+
return [
|
|
130
|
+
"Per-trial evidence is unavailable: native evidence is unverified. No trial paths are inferred from aggregate counts.",
|
|
131
|
+
"",
|
|
132
|
+
];
|
|
133
|
+
const pairs = result.evidence.pairs ?? [];
|
|
134
|
+
const priority = (pair) => pair.graded &&
|
|
135
|
+
((pair.baseline.passed && !pair.treatment.passed) ||
|
|
136
|
+
(pair.scoreDelta ?? 0) < 0 ||
|
|
137
|
+
pair.changedChecks.some((c) => c.change === "regressed"))
|
|
138
|
+
? 0
|
|
139
|
+
: !pair.graded
|
|
140
|
+
? 1
|
|
141
|
+
: 2;
|
|
142
|
+
const lines = [
|
|
143
|
+
"## Run evidence",
|
|
144
|
+
"",
|
|
145
|
+
"Evidence references are relative to [run], the native run directory (inside a portable package: run/).",
|
|
146
|
+
"",
|
|
147
|
+
];
|
|
148
|
+
for (const pair of [...pairs].sort((a, b) => priority(a) - priority(b))) {
|
|
149
|
+
const outcome = (arm) => !arm.executorInvoked
|
|
150
|
+
? "not invoked (ungraded)"
|
|
151
|
+
: arm.error !== null
|
|
152
|
+
? "error (ungraded)"
|
|
153
|
+
: arm.passed
|
|
154
|
+
? "passed"
|
|
155
|
+
: "failed";
|
|
156
|
+
const checks = pair.changedChecks.map((c) => `${escapeMarkdown(c.name)}: ${c.change}`);
|
|
157
|
+
lines.push(`- **${escapeMarkdown(pair.taskId)} / trial ${pair.trial}**: ${outcome(pair.baseline)} → ${outcome(pair.treatment)}${checks.length ? `; ${checks.join("; ")}` : ""}.`);
|
|
158
|
+
for (const arm of ["baseline", "treatment"]) {
|
|
159
|
+
const prefix = `${pair.taskId}/${arm}/trial-${pair.trial}`;
|
|
160
|
+
const references = [
|
|
161
|
+
["receipt", "_result.json"],
|
|
162
|
+
["output", "_output.md"],
|
|
163
|
+
["verifier", "_verifier.txt"],
|
|
164
|
+
["error", "_executor-error.txt"],
|
|
165
|
+
].flatMap(([label, file]) => {
|
|
166
|
+
const relativePath = `${prefix}/${file}`;
|
|
167
|
+
return existsSync(join(result.evidence.runDir, relativePath))
|
|
168
|
+
? [`[${label}](${relativePath})`]
|
|
169
|
+
: [];
|
|
170
|
+
});
|
|
171
|
+
lines.push(` - ${arm}: ${references.join(" · ")}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return [...lines, ""];
|
|
175
|
+
}
|
|
176
|
+
function comparisonCosts(result) {
|
|
177
|
+
const costs = result.costs.populations;
|
|
178
|
+
if (!costs)
|
|
179
|
+
return [
|
|
180
|
+
"### Invocation costs",
|
|
181
|
+
"",
|
|
182
|
+
"All-invocation accounting is unrecorded; no complete token or elapsed comparison is inferred.",
|
|
183
|
+
"",
|
|
184
|
+
];
|
|
185
|
+
const populations = costs.attempts;
|
|
186
|
+
const total = (population, metric) => {
|
|
187
|
+
const measure = population.metrics[metric];
|
|
188
|
+
if (population.runs === 0 || measure.coverage.final + measure.coverage.partial === 0)
|
|
189
|
+
return "unrecorded";
|
|
190
|
+
const value = metric === "durationSeconds" ? measure.knownTotal.toFixed(3) : String(measure.knownTotal);
|
|
191
|
+
return `${completeCost(population, metric) ? "" : ">= "}${value}`;
|
|
192
|
+
};
|
|
193
|
+
const coverage = (population, metric) => {
|
|
194
|
+
const value = population.metrics[metric].coverage;
|
|
195
|
+
return `${value.final}/${value.partial}/${value.unknown}`;
|
|
196
|
+
};
|
|
197
|
+
const lines = [
|
|
198
|
+
"### Invocation costs",
|
|
199
|
+
"",
|
|
200
|
+
"All agent invocations, including errors and excluded partners. Coverage is final/partial/unknown; >= marks a lower bound.",
|
|
201
|
+
`- Invoked B/T: ${populations.baseline.runs}/${populations.treatment.runs}; Not invoked B/T: ${costs.notInvoked.baseline}/${costs.notInvoked.treatment}.`,
|
|
202
|
+
"",
|
|
203
|
+
"| Measure | Baseline | Treatment | Observed total change | Coverage B/T |",
|
|
204
|
+
"|---|---:|---:|---:|---|",
|
|
205
|
+
];
|
|
206
|
+
const metrics = [
|
|
207
|
+
["input", "Input tokens"],
|
|
208
|
+
["cachedInput", "Cached input tokens"],
|
|
209
|
+
["uncachedInput", "Uncached input tokens"],
|
|
210
|
+
["output", "Output tokens"],
|
|
211
|
+
["durationSeconds", "Elapsed seconds"],
|
|
212
|
+
];
|
|
213
|
+
for (const [metric, label] of metrics) {
|
|
214
|
+
const change = result.costs.changes?.attempts?.[metric]?.totalChangeFraction ?? null;
|
|
215
|
+
const delta = change === null ? "n/a" : `${change > 0 ? "+" : ""}${(change * 100).toFixed(1)}%`;
|
|
216
|
+
lines.push(`| ${label} | ${total(populations.baseline, metric)} | ${total(populations.treatment, metric)} | ${delta} | ${coverage(populations.baseline, metric)} / ${coverage(populations.treatment, metric)} |`);
|
|
217
|
+
}
|
|
218
|
+
lines.push("", "Descriptive totals only, not billing or a statistically established efficiency gain. Per-success measures and separate judge usage remain in Cost accounting below.", "");
|
|
219
|
+
return lines;
|
|
220
|
+
}
|
|
221
|
+
function suggestedNextSteps(result, hasRegressions) {
|
|
222
|
+
const actions = [];
|
|
223
|
+
const reasons = new Set(result.acceptance.reasons.map((reason) => reason.code));
|
|
224
|
+
if (reasons.has("EXECUTION_ERRORS"))
|
|
225
|
+
actions.push("inspect the execution/verifier errors and retained receipts; repair the environment or inputs before declaring a fresh run. Keep stopped records intact.");
|
|
226
|
+
else if (result.status === "stopped" || result.status === "incomplete")
|
|
227
|
+
actions.push("inspect the retained session, ledger and stop reason before planning a fresh run. Keep this run intact; do not append replacement samples.");
|
|
228
|
+
if (hasRegressions)
|
|
229
|
+
actions.push("inspect the regressed tasks and checks before accepting this change.");
|
|
230
|
+
if (reasons.has("COST_LIMIT_EXCEEDED"))
|
|
231
|
+
actions.push("review all-invocation spending per successful task against the declared cost limits.");
|
|
232
|
+
if (!result.evidence.verified)
|
|
233
|
+
actions.push("inspect the audit findings; unverified records cannot authorize adoption.");
|
|
234
|
+
if ("quality" in result &&
|
|
235
|
+
(reasons.has("INSUFFICIENT_SCALE") || reasons.has("VALIDATION_NOT_DECLARED")))
|
|
236
|
+
actions.push(`plan a separate independent validation with at least ${result.acceptance.policy.minTasks} tasks × ${result.acceptance.policy.minTrialsPerTask} graded pairs per task, frozen before execution. Authorize its spending separately; do not add trials until significance.`);
|
|
237
|
+
if (result.acceptance.eligibleForUpgrade)
|
|
238
|
+
actions.push("review the candidate within the declared validation scope before any manual adoption.");
|
|
239
|
+
return actions.length
|
|
240
|
+
? actions
|
|
241
|
+
: ["review the adoption conditions below before deciding whether to use this change."];
|
|
242
|
+
}
|
|
243
|
+
function comparisonSummary(result) {
|
|
244
|
+
const tasks = "quality" in result ? observedTaskChanges(result) : [];
|
|
245
|
+
const regressions = tasks.filter((item) => item.regressed);
|
|
246
|
+
const list = (items) => items.length ? items.map(({ task }) => escapeMarkdown(task.id)).join(", ") : "none recorded";
|
|
247
|
+
const lines = [
|
|
248
|
+
"## Comparison summary",
|
|
249
|
+
"",
|
|
250
|
+
`- State: ${result.status}`,
|
|
251
|
+
`- Evidence: ${result.evidence.verified ? "verified" : "unverified"}`,
|
|
252
|
+
`- Acceptance: ${result.acceptance.decision}; eligible for upgrade: ${result.acceptance.eligibleForUpgrade ? "yes" : "no"}; automatic upgrade: no`,
|
|
253
|
+
];
|
|
254
|
+
if (!("quality" in result)) {
|
|
255
|
+
const records = [
|
|
256
|
+
["session", "_session.json"],
|
|
257
|
+
["ledger", "_calls.jsonl"],
|
|
258
|
+
["plan", "_plan.json"],
|
|
259
|
+
];
|
|
260
|
+
const references = records.flatMap(([label, file]) => existsSync(join(result.evidence.runDir, file)) ? [`[${label}](${file})`] : []);
|
|
261
|
+
lines.push("- Graded comparison: unavailable; no completed paired result is retained.", `- Next: ${suggestedNextSteps(result, false)[0]}`, `- Retained records (unverified): ${references.join(" · ") || "none available"}. References are relative to [run], the native run directory.`, "");
|
|
262
|
+
return lines;
|
|
263
|
+
}
|
|
264
|
+
const hasRegressions = regressions.length > 0 || result.quality.regressedPairs > 0;
|
|
265
|
+
const observed = (change) => {
|
|
266
|
+
const items = tasks.filter((item) => (change === "regressed" ? item.regressed : item.improved));
|
|
267
|
+
const pairs = change === "regressed" ? result.quality.regressedPairs : result.quality.improvedPairs;
|
|
268
|
+
if (items.length === 0 && pairs > 0)
|
|
269
|
+
return `task-level attribution unrecorded (${pairs} ${change} pass/fail pairs)`;
|
|
270
|
+
return `${list(items)}${pairs > 0 && tasks.some((item) => !item.attributed) ? "; paired attribution incomplete" : ""}`;
|
|
271
|
+
};
|
|
272
|
+
lines.push(`- Observed regressions: ${observed("regressed")}`, `- Observed improvements: ${observed("improved")}`, `- No observed change: ${list(tasks.filter((item) => item.attributed && !item.regressed && !item.improved && item.task.baseline.trials > 0))}`, ...(tasks.some((item) => !item.attributed)
|
|
273
|
+
? [`- Pair attribution unrecorded: ${list(tasks.filter((item) => !item.attributed))}`]
|
|
274
|
+
: []), `- Next: ${suggestedNextSteps(result, hasRegressions)[0]}`);
|
|
275
|
+
if ("quality" in result) {
|
|
276
|
+
const quality = result.quality;
|
|
277
|
+
const pairs = quality.tasks.reduce((count, task) => count + task.baseline.trials, 0);
|
|
278
|
+
const errors = quality.tasks.reduce((counts, task) => [counts[0] + task.baseline.errors, counts[1] + task.treatment.errors], [0, 0]);
|
|
279
|
+
lines.push(`- Execution/verifier errors B/T: ${errors[0]}/${errors[1]}; excluded from the quality comparison.`, `- Graded pass/fail pairs: ${quality.improvedPairs} improved, ${quality.regressedPairs} regressed, ${pairs - quality.improvedPairs - quality.regressedPairs} unchanged; error pairs excluded.`, `- Statistical quality verdict: ${quality.statisticalVerdict}. Observed changes alone do not establish a Skill effect or equivalence.`, "", "| Task | Observed change | Pass B/T | Errors B/T | Checks to inspect |", "|---|---|---|---|---|");
|
|
280
|
+
const priority = (item) => item.regressed ? 0 : item.errors ? 1 : item.improved ? 2 : 3;
|
|
281
|
+
for (const item of [...tasks].sort((a, b) => priority(a) - priority(b))) {
|
|
282
|
+
const { task } = item;
|
|
283
|
+
const changes = [item.regressed ? "regressed" : "", item.improved ? "improved" : ""]
|
|
284
|
+
.filter(Boolean)
|
|
285
|
+
.join("; ");
|
|
286
|
+
const checks = [
|
|
287
|
+
...item.regressedChecks.map((name) => `${escapeMarkdown(name)}: regressed`),
|
|
288
|
+
...item.improvedChecks.map((name) => `${escapeMarkdown(name)}: improved`),
|
|
289
|
+
];
|
|
290
|
+
lines.push(`| ${escapeMarkdown(task.id)} | ${changes || (task.baseline.trials ? (item.attributed ? "no observed change" : "pair attribution unrecorded") : "ungraded")}${item.errors ? "; execution/verifier errors" : ""} | ${task.baseline.passes}/${task.baseline.trials} / ${task.treatment.passes}/${task.treatment.trials} | ${task.baseline.errors}/${task.treatment.errors} | ${checks.join("; ") || "none recorded"} |`);
|
|
291
|
+
}
|
|
292
|
+
lines.push("", ...comparisonCosts(result), ...comparisonEvidence(result));
|
|
293
|
+
}
|
|
294
|
+
lines.push("## Suggested next steps", "", ...suggestedNextSteps(result, hasRegressions).map((step) => `- ${step}`), "", "## Adoption conditions", "", ...result.acceptance.reasons.map((reason) => `- \`${reason.code}\`: ${escapeMarkdown(reason.message.replaceAll(result.evidence.runDir, "[run]"))}`), "");
|
|
295
|
+
return lines;
|
|
296
|
+
}
|
|
297
|
+
export function renderEvalMarkdown(report, introduction = []) {
|
|
100
298
|
const lines = [`# skillfit evaluation: ${escapeMarkdown(report.target.name)}`, ""];
|
|
101
|
-
lines.push(measurementScopeText(report.measurementScope), "");
|
|
102
299
|
if (report.executor.kind === "mock") {
|
|
103
300
|
lines.push("> **Synthetic harness run.** These numbers do not measure an agent or Skill effect.", "");
|
|
104
301
|
}
|
|
302
|
+
lines.push(...introduction, measurementScopeText(report.measurementScope), "");
|
|
105
303
|
lines.push(`- Run: ${escapeMarkdown(report.runGroup)} (${escapeMarkdown(report.createdAt)})`, `- Target: ${escapeMarkdown(report.target.kind)}; SHA-256 \`${report.target.sha256}\``, ...(report.baselineTarget
|
|
106
304
|
? [
|
|
107
305
|
`- Baseline Skill: ${escapeMarkdown(report.baselineTarget.name)} (previous version); SHA-256 \`${report.baselineTarget.sha256}\``,
|
|
@@ -196,10 +394,10 @@ export async function runEvalReport(inputPath, log = console.log, options = {})
|
|
|
196
394
|
lines.push(renderEvalMarkdown({
|
|
197
395
|
...parseEvalReport(JSON.parse(readFileSync(path, "utf8"))),
|
|
198
396
|
modelIdentities: result.modelIdentities,
|
|
199
|
-
}));
|
|
397
|
+
}, comparisonSummary(result)));
|
|
200
398
|
}
|
|
201
399
|
else {
|
|
202
|
-
lines.push(`# skillfit evaluation: ${result.status} run`, "", `- State: ${result.status}`, "- No completed paired comparison is available. Retained spending is not a quality verdict.");
|
|
400
|
+
lines.push(`# skillfit evaluation: ${result.status} run`, "", ...comparisonSummary(result), `- State: ${result.status}`, "- No completed paired comparison is available. Retained spending is not a quality verdict.");
|
|
203
401
|
if (result.session?.stopReason)
|
|
204
402
|
lines.push(`- Stop reason: ${safe(String(result.session.stopReason))}`);
|
|
205
403
|
if ("startedAgentDispatches" in result.costs)
|
package/dist/cli/main.js
CHANGED
|
@@ -21,6 +21,7 @@ import { runInstall, runMcpApply, runUninstall } from "../composition.js";
|
|
|
21
21
|
import { runMcpCheck } from "./mcp.js";
|
|
22
22
|
import { runReport } from "./report.js";
|
|
23
23
|
import { runCodexSetup } from "../composition.js";
|
|
24
|
+
import { prepareSkillRevision } from "../composition.js";
|
|
24
25
|
import { VERSION } from "../shared/version.js";
|
|
25
26
|
function jsonBenchCommand() {
|
|
26
27
|
const supported = ["check", "self-test", "list", "show", "edit", "remove"];
|
|
@@ -125,6 +126,64 @@ async function main() {
|
|
|
125
126
|
}
|
|
126
127
|
if (values.controls !== undefined || values.suite !== undefined)
|
|
127
128
|
throw new Error("--controls and --suite apply only to bench self-test.");
|
|
129
|
+
if (values.prepare !== undefined) {
|
|
130
|
+
if (values.json && !values["dry-run"] && !values.yes)
|
|
131
|
+
throw new Error("JSON preparation requires --yes; preview first with --dry-run.");
|
|
132
|
+
if (command !== "eval" || positionals.length !== 2)
|
|
133
|
+
throw new Error("--prepare requires eval <candidate-skill>.");
|
|
134
|
+
const allowed = new Set([
|
|
135
|
+
"prepare",
|
|
136
|
+
"baseline-skill",
|
|
137
|
+
"from-commit",
|
|
138
|
+
"source-dir",
|
|
139
|
+
"prompt-file",
|
|
140
|
+
"agent",
|
|
141
|
+
"include",
|
|
142
|
+
"verifier-cmd",
|
|
143
|
+
"spending-budget",
|
|
144
|
+
"executor-timeout-seconds",
|
|
145
|
+
"dry-run",
|
|
146
|
+
"yes",
|
|
147
|
+
"json",
|
|
148
|
+
]);
|
|
149
|
+
for (const [key, value] of Object.entries(values))
|
|
150
|
+
if (value !== undefined && value !== false && !allowed.has(key))
|
|
151
|
+
throw new Error(`--${key} is unsupported with --prepare; no evaluation started.`);
|
|
152
|
+
if (!values["baseline-skill"] ||
|
|
153
|
+
!values["from-commit"] ||
|
|
154
|
+
!values["source-dir"] ||
|
|
155
|
+
!values["prompt-file"] ||
|
|
156
|
+
!values.agent)
|
|
157
|
+
throw new Error("--prepare requires --baseline-skill, --from-commit, --source-dir, --prompt-file and --agent.");
|
|
158
|
+
const result = await prepareSkillRevision({
|
|
159
|
+
candidateSkill: positionals[1],
|
|
160
|
+
baselineSkill: values["baseline-skill"],
|
|
161
|
+
workspace: values.prepare,
|
|
162
|
+
sourceDir: values["source-dir"],
|
|
163
|
+
fromCommit: values["from-commit"],
|
|
164
|
+
promptFile: values["prompt-file"],
|
|
165
|
+
agent: values.agent,
|
|
166
|
+
include: values.include,
|
|
167
|
+
verifierCmd: values["verifier-cmd"],
|
|
168
|
+
dryRun: values["dry-run"],
|
|
169
|
+
yes: values.yes,
|
|
170
|
+
spendingBudget: values["spending-budget"] === undefined
|
|
171
|
+
? undefined
|
|
172
|
+
: parseSpendingBudget(readComponentJson(resolve(values["spending-budget"])).value),
|
|
173
|
+
executorTimeoutSeconds: executorTimeoutArgument(values["executor-timeout-seconds"]),
|
|
174
|
+
log: (line) => (values.json ? console.error(line) : console.log(line)),
|
|
175
|
+
});
|
|
176
|
+
if (values.json)
|
|
177
|
+
console.log(JSON.stringify(result, null, 2));
|
|
178
|
+
else {
|
|
179
|
+
console.log(`Revision workspace: ${result.status}; ${result.files.length} files; 0 model calls.\nRequest: ${result.requestPath}`);
|
|
180
|
+
for (const command of result.nextCommands)
|
|
181
|
+
console.log(` ${command}`);
|
|
182
|
+
}
|
|
183
|
+
if (result.status === "blocked")
|
|
184
|
+
process.exitCode = 2;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
128
187
|
const calibrationCommand = command === "bench" && positionals[1] === "check" && values.calibrate;
|
|
129
188
|
if (values["baseline-skill"] !== undefined && command !== "eval") {
|
|
130
189
|
throw new Error("--baseline-skill applies only to eval --mode installed.");
|
package/dist/composition.js
CHANGED
|
@@ -12,6 +12,10 @@ import { runUninstall as uninstall } from "./configuration/uninstall.js";
|
|
|
12
12
|
import { runMcpApply as mcpApply } from "./configuration/mcp-write.js";
|
|
13
13
|
import { runBundleExport as bundle } from "./configuration/bundle.js";
|
|
14
14
|
import { runCodexSetup as setup } from "./configuration/setup.js";
|
|
15
|
+
import { prepareSkillRevision as prepareRevision, } from "./evaluation/application/preparation.js";
|
|
16
|
+
export function prepareSkillRevision(options) {
|
|
17
|
+
return withEvaluationInterrupts(() => prepareRevision({ ...options, confirm: options.confirm ?? confirm }));
|
|
18
|
+
}
|
|
15
19
|
export function executeEvalPlan(...args) {
|
|
16
20
|
return withEvaluationInterrupts(() => evaluation.executeEvalPlan(...args));
|
|
17
21
|
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
3
|
+
import { prepareCommitBench } from "../../bench/authoring.js";
|
|
4
|
+
import { runOfflineBenchCheck } from "../../bench/gates/check.js";
|
|
5
|
+
import { collectInstalledSkillTarget } from "../../resources/installed-skill.js";
|
|
6
|
+
import { assertSkillRevisionTargets } from "../targets/skill.js";
|
|
7
|
+
import { parseEvalRequest } from "./request.js";
|
|
8
|
+
import { assertTokenBudgetSupport } from "../execution/budget.js";
|
|
9
|
+
/** One fresh development comparison. No executor or user configuration writer is reachable. */
|
|
10
|
+
export async function prepareSkillRevision(options, dependencies = {}) {
|
|
11
|
+
const requested = resolve(options.workspace);
|
|
12
|
+
// Resolve existing ancestors (including macOS /var and /tmp aliases), then pin that parent.
|
|
13
|
+
let ancestor = dirname(requested);
|
|
14
|
+
while (true) {
|
|
15
|
+
try {
|
|
16
|
+
realpathSync(ancestor);
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error.code !== "ENOENT")
|
|
21
|
+
throw error;
|
|
22
|
+
ancestor = dirname(ancestor);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const physicalParent = realpathSync(ancestor);
|
|
26
|
+
const workspace = resolve(physicalParent, relative(ancestor, requested));
|
|
27
|
+
const assertFresh = () => {
|
|
28
|
+
try {
|
|
29
|
+
lstatSync(workspace);
|
|
30
|
+
throw new Error(`Workspace already exists: ${workspace}`);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (error.code !== "ENOENT")
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
for (let parent = dirname(workspace); parent !== physicalParent; parent = dirname(parent)) {
|
|
37
|
+
try {
|
|
38
|
+
if (lstatSync(parent).isSymbolicLink())
|
|
39
|
+
throw new Error(`Workspace parent is a symlink: ${parent}`);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (error.code !== "ENOENT")
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
assertFresh();
|
|
48
|
+
const candidate = collectInstalledSkillTarget(options.candidateSkill);
|
|
49
|
+
const baseline = collectInstalledSkillTarget(options.baselineSkill);
|
|
50
|
+
assertSkillRevisionTargets(candidate, baseline);
|
|
51
|
+
for (const target of [baseline, candidate]) {
|
|
52
|
+
const rel = relative(target.sourceDir, workspace);
|
|
53
|
+
if (rel === "" || (!rel.startsWith("..") && !isAbsolute(rel)))
|
|
54
|
+
throw new Error("Preparation workspace must not be inside an input Skill.");
|
|
55
|
+
}
|
|
56
|
+
const bench = prepareCommitBench({
|
|
57
|
+
dir: join(workspace, "bench"),
|
|
58
|
+
sourceDir: options.sourceDir,
|
|
59
|
+
fromCommit: options.fromCommit,
|
|
60
|
+
promptFile: options.promptFile,
|
|
61
|
+
verifierCmd: options.verifierCmd,
|
|
62
|
+
include: options.include,
|
|
63
|
+
});
|
|
64
|
+
const requestPath = join(workspace, "request.json");
|
|
65
|
+
const body = {
|
|
66
|
+
schemaVersion: 1,
|
|
67
|
+
baselineSkill: "skills/old",
|
|
68
|
+
candidateSkill: "skills/new",
|
|
69
|
+
bench: "bench",
|
|
70
|
+
agent: options.agent,
|
|
71
|
+
purpose: "development",
|
|
72
|
+
pairOrder: "balanced",
|
|
73
|
+
trials: 1,
|
|
74
|
+
maxCalls: 2,
|
|
75
|
+
runsRoot: "runs",
|
|
76
|
+
runGroup: "revision-001",
|
|
77
|
+
...(options.spendingBudget ? { spendingBudget: options.spendingBudget } : {}),
|
|
78
|
+
...(options.executorTimeoutSeconds !== undefined
|
|
79
|
+
? { executorTimeoutSeconds: options.executorTimeoutSeconds }
|
|
80
|
+
: {}),
|
|
81
|
+
};
|
|
82
|
+
const request = parseEvalRequest(body, workspace);
|
|
83
|
+
assertTokenBudgetSupport([], request.executorTimeoutSeconds, request.spendingBudget);
|
|
84
|
+
const writes = bench.writes.map((write) => ({ target: write.target, content: write.content }));
|
|
85
|
+
for (const [target, folder] of [
|
|
86
|
+
[baseline, "old"],
|
|
87
|
+
[candidate, "new"],
|
|
88
|
+
])
|
|
89
|
+
for (const file of target.files)
|
|
90
|
+
writes.push({
|
|
91
|
+
target: join(workspace, "skills", folder, file),
|
|
92
|
+
content: readFileSync(join(target.sourceDir, file)),
|
|
93
|
+
});
|
|
94
|
+
writes.push({ target: requestPath, content: JSON.stringify(body, null, 2) + "\n" });
|
|
95
|
+
// POSIX shells and PowerShell both support single-quoted literal paths (including spaces).
|
|
96
|
+
const quote = (value) => "'" + value.replaceAll("'", process.platform === "win32" ? "''" : "'\\''") + "'";
|
|
97
|
+
const nextCommands = [
|
|
98
|
+
`skillfit bench check ${quote(join(workspace, "bench"))}`,
|
|
99
|
+
`skillfit eval --request ${quote(requestPath)} --dry-run`,
|
|
100
|
+
`skillfit eval --request ${quote(requestPath)} --plan-sha <sha256-from-preview>`,
|
|
101
|
+
];
|
|
102
|
+
const view = {
|
|
103
|
+
schemaVersion: 1,
|
|
104
|
+
kind: "skillfit.revision-preparation",
|
|
105
|
+
workspace,
|
|
106
|
+
requestPath,
|
|
107
|
+
modelCalls: 0,
|
|
108
|
+
maxCalls: 2,
|
|
109
|
+
spendingBudget: request.spendingBudget ?? null,
|
|
110
|
+
executorTimeoutSeconds: request.executorTimeoutSeconds,
|
|
111
|
+
files: writes.map((w) => relative(workspace, w.target)),
|
|
112
|
+
nextCommands,
|
|
113
|
+
};
|
|
114
|
+
options.log?.(`Prepare one development pair (2 task calls when separately executed); token limits: ${JSON.stringify(view.spendingBudget)}; executor deadline: ${request.executorTimeoutSeconds === null ? "disabled" : request.executorTimeoutSeconds + "s"}.`);
|
|
115
|
+
options.log?.(`Verifier command ${JSON.stringify(options.verifierCmd ?? "node --test")} is retained and executed with a shell by bench check and evaluation. Creation runs offline gates; preview does not execute it.`);
|
|
116
|
+
options.log?.("A single development pair cannot authorize adoption. Authentication and ambient agent configuration are checked by the separate evaluation preview.");
|
|
117
|
+
options.log?.(`Workspace plan: ${workspace}`);
|
|
118
|
+
for (const file of view.files)
|
|
119
|
+
options.log?.(` + ${file}`);
|
|
120
|
+
if (options.dryRun)
|
|
121
|
+
return { ...view, status: "preview" };
|
|
122
|
+
if (!options.yes &&
|
|
123
|
+
!(await options.confirm?.(`Create ${writes.length} files in ${workspace} and run local verifier/oracle commands? [y/N] `)))
|
|
124
|
+
return { ...view, status: "cancelled" };
|
|
125
|
+
assertFresh();
|
|
126
|
+
bench.assertCurrent();
|
|
127
|
+
for (const target of [baseline, candidate]) {
|
|
128
|
+
const current = collectInstalledSkillTarget(target.sourceDir);
|
|
129
|
+
if (current.sha256 !== target.sha256)
|
|
130
|
+
throw new Error("Skill inputs changed after preparation; review a fresh plan.");
|
|
131
|
+
}
|
|
132
|
+
mkdirSync(dirname(workspace), { recursive: true });
|
|
133
|
+
mkdirSync(workspace); // Exclusive ownership: do not remove anything unless this succeeded.
|
|
134
|
+
try {
|
|
135
|
+
for (const write of writes) {
|
|
136
|
+
mkdirSync(dirname(write.target), { recursive: true });
|
|
137
|
+
(dependencies.writeFile ?? writeFileSync)(write.target, write.content, { flag: "wx" });
|
|
138
|
+
}
|
|
139
|
+
const checks = await runOfflineBenchCheck({ dir: request.bench, log: options.log });
|
|
140
|
+
return {
|
|
141
|
+
...view,
|
|
142
|
+
status: checks.failures === 0 ? "ready" : "blocked",
|
|
143
|
+
checks,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
rmSync(workspace, { recursive: true, force: true });
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -297,11 +297,12 @@ export async function auditEvaluation(value, runDir, options = {}) {
|
|
|
297
297
|
assert.ok(definition);
|
|
298
298
|
const scratch = mkdtempSync(join(tmpdir(), "skillfit-eval-replay-"));
|
|
299
299
|
try {
|
|
300
|
-
|
|
300
|
+
const replayDir = join(scratch, arm, `trial-${trial}`);
|
|
301
|
+
cpSync(join(root, task.id, arm, `trial-${trial}`), replayDir, {
|
|
301
302
|
recursive: true,
|
|
302
303
|
filter: (path) => basename(path) !== ".git",
|
|
303
304
|
});
|
|
304
|
-
const grade = await runVerifier(bench.dir, definition.verifier,
|
|
305
|
+
const grade = await runVerifier(bench.dir, definition.verifier, replayDir, definition.verifierTimeoutSeconds), summary = verdictFromOutput(grade.output);
|
|
305
306
|
assert.equal(grade.error, null, `Replay verifier failed: ${grade.error}`);
|
|
306
307
|
assert.notEqual(grade.exitCode, null);
|
|
307
308
|
assert.equal(grade.exitCode, r.verifierExitCode);
|
package/docs/README.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Choose your build
|
|
4
4
|
|
|
5
|
-
These pages describe the **0.16.
|
|
5
|
+
These pages describe the **0.16.2 package and current source**; source guides use
|
|
6
6
|
Node >=22, `npm run build` and `node dist/cli.js`. The pinned
|
|
7
|
-
`npx skillfit@0.16.
|
|
7
|
+
`npx skillfit@0.16.2` commands name the version these pages describe; the registry
|
|
8
8
|
is the source of truth for what is currently published. Superseded releases keep
|
|
9
9
|
their own documentation: see the
|
|
10
10
|
[0.13.1 documentation](https://github.com/remote-controlled-man/skillfit/tree/4eaefde80f7e8a6b1e01939d3bd8a8b6418b75d6/docs)
|
|
11
11
|
and its [publication record](https://github.com/remote-controlled-man/skillfit/blob/3a3ff415ccef1a3a45d1e2d2cc00d903ab7db850/docs/releases/0.13.1.md).
|
|
12
12
|
Standalone driver links and unshipped source references use the
|
|
13
|
-
[reviewed source snapshot](https://github.com/remote-controlled-man/skillfit/tree/
|
|
14
|
-
which contains
|
|
13
|
+
[reviewed source snapshot](https://github.com/remote-controlled-man/skillfit/tree/5511a67639b87a255031676e6e3703f649f25f7d),
|
|
14
|
+
which contains the comparison report improvements. Building that commit prints 0.16.1.
|
|
15
15
|
|
|
16
16
|
## Find your task
|
|
17
17
|
|
|
@@ -7,6 +7,45 @@ formats and costs, and [metrics](metrics.md) owns statistical meaning.
|
|
|
7
7
|
Use the [build/version entry](../README.md#choose-your-build) for availability.
|
|
8
8
|
The component never installs or adopts a Skill automatically.
|
|
9
9
|
|
|
10
|
+
## Prepare a first revision comparison
|
|
11
|
+
|
|
12
|
+
With npm 0.16.1 or a built checkout that lists `--prepare` in `eval --help`, start
|
|
13
|
+
from two complete versions of one Skill and a real fix commit, including its regression tests:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
skillfit eval ./skill-new --baseline-skill ./skill-old --prepare ./comparison --from-commit <fix-sha> --source-dir ./project --prompt-file ./issue.md --agent codex --dry-run
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use the original issue-style request in `issue.md`; the fix commit's message is
|
|
20
|
+
kept out of the task prompt. Preview validates inputs and lists destination files
|
|
21
|
+
without writing or executing verifier/oracle/model commands. Remove `--dry-run`
|
|
22
|
+
and use `--yes` (or confirm interactively) to create the workspace and run its
|
|
23
|
+
trusted local checks. `--verifier-cmd` defaults to `node --test`; it is retained
|
|
24
|
+
and run with a shell on future checks/evaluations. `--include` narrows the fixture
|
|
25
|
+
to repository directories using the existing commit import limits.
|
|
26
|
+
|
|
27
|
+
The fresh workspace contains complete `skills/old` and `skills/new` snapshots, a
|
|
28
|
+
commit-derived `bench` and `request.json`. Existing destinations, even empty ones,
|
|
29
|
+
are refused. A write failure removes only the newly created workspace. A failed
|
|
30
|
+
integrity gate instead returns `blocked` and retains inputs for inspection.
|
|
31
|
+
Preparation requires no model call and does not change agent configuration.
|
|
32
|
+
|
|
33
|
+
The request defaults to one balanced development pair (two task invocations),
|
|
34
|
+
the existing 600-second executor deadline and unchanged adoption policy. Optional
|
|
35
|
+
`--spending-budget <file>` and `--executor-timeout-seconds <n|none>` are copied into
|
|
36
|
+
the request after validation. No token cap is implied when the budget is omitted.
|
|
37
|
+
This small run cannot authorize adoption. Inspect the returned next commands:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
skillfit eval --request ./comparison/request.json --dry-run
|
|
41
|
+
skillfit eval --request ./comparison/request.json --plan-sha <sha256-from-preview>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Run only within authorized spending. The separate evaluation preview checks the
|
|
45
|
+
agent environment; a ready workspace does not establish authentication or isolate
|
|
46
|
+
inherited global Skills/rules/MCP. For an already authored bench or larger
|
|
47
|
+
independent validation, use the request contract below. This preparation entry is included in npm 0.16.1; earlier packages do not provide it.
|
|
48
|
+
|
|
10
49
|
## Input and execution
|
|
11
50
|
|
|
12
51
|
Save `request.json` outside the evaluated Skill directories. All paths resolve
|
|
@@ -8,6 +8,39 @@ environment to invent historical usage, identity or claims. Saved format
|
|
|
8
8
|
versions stay owned by the
|
|
9
9
|
[architecture page](../maintainers/architecture.md#format-identity-and-replay-compatibility).
|
|
10
10
|
|
|
11
|
+
## Human comparison summary
|
|
12
|
+
|
|
13
|
+
Starting in 0.16.2, paired human reports start with the saved run state, native audit
|
|
14
|
+
status and existing adoption decision, followed by observed changes. Regressed
|
|
15
|
+
tasks appear before error-only, improved and unchanged tasks. Pass/fail changes,
|
|
16
|
+
named-check changes and score changes remain observations; unchanged outcomes do
|
|
17
|
+
not establish equivalence, and execution/verifier errors are excluded from graded
|
|
18
|
+
pairs rather than counted as quality regressions. An individual audited check
|
|
19
|
+
regression stays visible even when task averages cancel it out.
|
|
20
|
+
Legacy pooled changes without per-task paired outcomes show that task attribution
|
|
21
|
+
is unrecorded instead of reporting no observed regression or improvement.
|
|
22
|
+
|
|
23
|
+
The compact cost table covers all primary Agent invocations, including errors
|
|
24
|
+
and excluded partners, with final/partial/unknown coverage. Partial totals carry
|
|
25
|
+
`>=` and incomplete coverage suppresses percentage changes; missing usage stays
|
|
26
|
+
unrecorded. Per-success costs and separate judge accounting remain in the detailed
|
|
27
|
+
sections. These descriptive numbers are not a bill or a proven efficiency gain.
|
|
28
|
+
|
|
29
|
+
Verified native pairs include references to existing receipts, outputs, verifier
|
|
30
|
+
logs and error files. References resolve relative to the native run directory,
|
|
31
|
+
shown as `[run]`; a portable package keeps that directory under `run/`. Local
|
|
32
|
+
absolute run paths are omitted. An unverified or historical aggregate report
|
|
33
|
+
does not infer trial paths or claim that per-trial evidence was verified. Keep
|
|
34
|
+
derived reports outside sealed runs so their artifact inventories remain intact.
|
|
35
|
+
|
|
36
|
+
Suggested next steps distinguish error recovery, regression inspection, declared
|
|
37
|
+
cost limits, audit findings and a separately planned independent validation.
|
|
38
|
+
Stopped or incomplete runs without a final manifest show recovery steps and
|
|
39
|
+
retained costs without inventing quality counts. Existing session, ledger and
|
|
40
|
+
plan references in that recovery summary are explicitly unverified. Reading a
|
|
41
|
+
report neither resumes a run nor authorizes more calls or automatic adoption. Statistical verdicts,
|
|
42
|
+
adoption policies, saved bytes and the paired JSON contract are unchanged.
|
|
43
|
+
|
|
11
44
|
## Frozen measurement scope
|
|
12
45
|
|
|
13
46
|
Unpublished source records can include optional `measurementScope` v1 in paired,
|
|
@@ -426,7 +459,9 @@ bench, selected task order and native/reviewed plans, and scope without its
|
|
|
426
459
|
required sealed declarations fails rather than taking the historical recovery
|
|
427
460
|
route. Legacy missing metadata stays unrecorded. Current-reader audit and the
|
|
428
461
|
package's pinned `reproduce.mjs` each interpret saved evidence with their own
|
|
429
|
-
runtime.
|
|
462
|
+
runtime. Paired replay preserves each trial's `condition/trial-N` parent layout in
|
|
463
|
+
its disposable copy, so a verifier that derives the arm from the run directory
|
|
464
|
+
observes the same condition as during native execution.
|
|
430
465
|
|
|
431
466
|
For [self-test controls](../guides/bench-authoring.md#test-known-controls), export a native
|
|
432
467
|
suite directory, not its wrapper. It retains a null requested claim, mock identity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillfit",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "A/B testing for agent configuration: paired evaluation of Skills, rules and MCP setups, with deterministic verifiers and replayable evidence.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
],
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@biomejs/biome": "2.6.
|
|
58
|
+
"@biomejs/biome": "2.6.8",
|
|
59
59
|
"@types/node": "^22.0.0",
|
|
60
60
|
"typescript": "^5.6.0"
|
|
61
61
|
}
|
package/skills/skillfit/SKILL.md
CHANGED
|
@@ -10,7 +10,7 @@ truth for all numbers; your job is to pick the right command, run it, and interp
|
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
|
-
Check availability with `npx skillfit@0.16.
|
|
13
|
+
Check availability with `npx skillfit@0.16.2 --version`, or `node dist/cli.js --version` inside a clone.
|
|
14
14
|
If neither works, tell the user to install from https://github.com/remote-controlled-man/skillfit and stop.
|
|
15
15
|
For source-only commands below, set `skillfit_source` to the absolute path of a
|
|
16
16
|
built checkout, then run from the project/study workspace that owns the outputs.
|
|
@@ -24,13 +24,13 @@ and earlier lack them. Registry availability is
|
|
|
24
24
|
separate from source preparation, so inspect the installed version and fall back
|
|
25
25
|
to the reviewed implementing source snapshot when a 0.15.0 package is
|
|
26
26
|
unavailable. Read the
|
|
27
|
-
[capability table](https://github.com/remote-controlled-man/skillfit/blob/
|
|
27
|
+
[capability table](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/experiment-workflow.md#executor-capabilities)
|
|
28
28
|
before promising a mode, strict budget or model provenance, and check the
|
|
29
29
|
installed version before relying on a flag a later release added.
|
|
30
30
|
|
|
31
31
|
Source links in this standalone driver use the
|
|
32
|
-
[reviewed source snapshot](https://github.com/remote-controlled-man/skillfit/tree/
|
|
33
|
-
That snapshot contains
|
|
32
|
+
[reviewed source snapshot](https://github.com/remote-controlled-man/skillfit/tree/5511a67639b87a255031676e6e3703f649f25f7d). They do not follow main.
|
|
33
|
+
That snapshot contains the comparison report improvements and builds as 0.16.1. The npm package includes them starting in 0.16.2.
|
|
34
34
|
For a superseded release such as 0.13.1, use its
|
|
35
35
|
[original documentation](https://github.com/remote-controlled-man/skillfit/tree/4eaefde80f7e8a6b1e01939d3bd8a8b6418b75d6/docs);
|
|
36
36
|
do not substitute that older package for an example requiring 0.15.0 features.
|
|
@@ -42,21 +42,21 @@ do not substitute that older package for an example requiring 0.15.0 features.
|
|
|
42
42
|
| "我的 skill 有没有被用到 / are my skills used at all" | `skillfit report` — read-only, free, instant; start here |
|
|
43
43
|
| "这个配置健不健康" | `skillfit doctor` — read-only; current source supports versioned `--json` output and explicit `--strict` exit 1 on FAIL |
|
|
44
44
|
| "这个 skill 值不值得装 / does this skill help" | Preview `skillfit eval <skill-path> --mode installed --bench <bench> --agent <id> --trials 3 --dry-run`, then run within authorized spending |
|
|
45
|
-
| "新版 Skill 是否值得采用 / evaluate a candidate for a Skill evolution workflow" | With npm 0.9.0 or a current checkout, use `eval --request <request.json> --dry-run`; read the [component contract](https://github.com/remote-controlled-man/skillfit/blob/
|
|
45
|
+
| "新版 Skill 是否值得采用 / evaluate a candidate for a Skill evolution workflow" | With npm 0.9.0 or a current checkout, use `eval --request <request.json> --dry-run`; read the [component contract](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/reference/eval-component.md) for inputs and acceptance policy |
|
|
46
46
|
| "agent 自己想不想得起用它 / does it trigger" | same + `--mode trigger`. Add `--compete-installed` to copy other user Skills; otherwise recall is an upper bound. Codex counts a `SKILL.md` read |
|
|
47
47
|
| "这个 MCP 能不能连上 / is this MCP catalog valid" | Preview `skillfit mcp check <probe.json> --dry-run`, then check explicitly; current source also selects real JSON config with `--agent <id> --server <name> [--project]`. Never calls tools; may start/connect the server. Native Codex TOML selection is unsupported |
|
|
48
48
|
| "添加 / 修改 / 移除一个 MCP 配置" | Preview current-source `skillfit mcp apply --agent <id> --server <name> (--from <probe.json> | --remove) [--project] --dry-run`, then use `--yes`; JSON only, native Codex TOML refuses. No server/model call |
|
|
49
49
|
| "卸载一个托管 Skill / 移除托管规则" | Preview current-source `skillfit uninstall --agent <id> --skill <name> [--project] --dry-run`, then use `--yes`; `--rules` removes only the managed block. Local drift refuses; no usage-based automatic removal |
|
|
50
50
|
| "迁移个人 rules / Skills / MCP" | Preview current-source `skillfit bundle export <new-dir> --agent <codex|kimi-code> [--skill <name> ...] [--allow-symlink-root <dir> ...] [--mcp <name> ...] --dry-run`, then export with `--yes`; run the generated `setup.mjs --dry-run` before `--yes`. Same-Agent migration only; MCP accepts only structurally credential-free JSON declarations, never native Codex TOML. Skill links require explicit containing roots and stay inside the selected Skill; default refuses. No server/model call |
|
|
51
|
-
| "这个 MCP / AGENTS.md 真的有帮助吗" | Preview `skillfit eval <experiment-dir> --bench <bench> --agent <id> --trials 3 --dry-run`; follow the [configuration experiment guide](https://github.com/remote-controlled-man/skillfit/blob/
|
|
52
|
-
| "建一个 bench" | `skillfit bench init [dir]` then `skillfit bench check [dir]`; default schema 1 stays unrecorded; source supports explicit `--schema-version 2` with [claims](https://github.com/remote-controlled-man/skillfit/blob/
|
|
53
|
-
| "花钱前确认流水线能测到预期对照" | 0.15.0 / reviewed source: preview `node "$skillfit_source/dist/cli.js" bench self-test "$skillfit_source/benches/_self-test/example" --runs-root ./runs --run-group controls-001 --json --dry-run` from the owning workspace, then confirm with `--plan-sha <plan.sha256>`; read [self-test](https://github.com/remote-controlled-man/skillfit/blob/
|
|
51
|
+
| "这个 MCP / AGENTS.md 真的有帮助吗" | Preview `skillfit eval <experiment-dir> --bench <bench> --agent <id> --trials 3 --dry-run`; follow the [configuration experiment guide](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/experiment-workflow.md#rules-and-mcp-overlays) |
|
|
52
|
+
| "建一个 bench" | `skillfit bench init [dir]` then `skillfit bench check [dir]`; default schema 1 stays unrecorded; source supports explicit `--schema-version 2` with [claims](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/benches/README.md#claims-and-measurement-scope) |
|
|
53
|
+
| "花钱前确认流水线能测到预期对照" | 0.15.0 / reviewed source: preview `node "$skillfit_source/dist/cli.js" bench self-test "$skillfit_source/benches/_self-test/example" --runs-root ./runs --run-group controls-001 --json --dry-run` from the owning workspace, then confirm with `--plan-sha <plan.sha256>`; read [self-test](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/bench-authoring.md#test-known-controls) for controls, limits and fresh output rules |
|
|
54
54
|
| "做代码修改 case" | `bench init <dir> --kind command --dry-run`, then apply within the authorized scope; replace the teaching case with the real fixture, prompt, verifier and oracle |
|
|
55
55
|
| "给 Agent 看 case 校验失败原因" | `bench check <dir> --json` — offline gate IDs, evidence and remediation; this is the integrity result, not calibration |
|
|
56
56
|
| "先测 case 难度" | Version 0.11.0: `bench check <dir> --calibrate --agent <id> --task <id> --trials 1 --max-calls 1 --run-group <fresh-name> --json --dry-run`; calibrate only within authorized spending |
|
|
57
57
|
| "查看或管理 case" | `bench list <dir> --json`, `bench show <dir> <id> --json`; preview `bench edit <dir> <id> --set field=value --json` or `bench remove <dir> <id> --json` |
|
|
58
58
|
| "只测几个 case" | Repeat `eval --task <id>` or set request `taskIds`; source also supports task selection for calibration/trigger; preview the selected budget and keep validation independent |
|
|
59
|
-
| "把结果交给另一台机器复现" | Preview `report eval <run-dir> --export <new-dir> --json`, then apply within the authorized scope; read the [portable package contract](https://github.com/remote-controlled-man/skillfit/blob/
|
|
59
|
+
| "把结果交给另一台机器复现" | Preview `report eval <run-dir> --export <new-dir> --json`, then apply within the authorized scope; read the [portable package contract](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/reference/evaluation-reports.md) for matching inputs, stopped costs and sharing review |
|
|
60
60
|
| "把这次翻车存成任务" | `skillfit bench add <bench> --freeze --task <id> --prompt "..." --verifier-cmd "<cmd>"` |
|
|
61
61
|
| "帮我起草 verifier" | same but `--decompose --agent <id>` — an agent drafts verifier + oracle; admitted only if the NOP + oracle gates pass |
|
|
62
62
|
|
|
@@ -74,13 +74,28 @@ commands and eval; local paths win. Editing still needs an owned local directory
|
|
|
74
74
|
Git-root benches are supported since 0.12.0, with metadata excluded consistently.
|
|
75
75
|
Keep `--runs-root` outside the bench/Skill/runtime and Git metadata; bad layouts
|
|
76
76
|
are rejected at preview, including aliases. See the
|
|
77
|
-
[first-run guide](https://github.com/remote-controlled-man/skillfit/blob/
|
|
77
|
+
[first-run guide](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/first-real-eval.md).
|
|
78
|
+
|
|
79
|
+
For a first revision comparison, npm 0.16.1 and newer provide `--prepare`; check `eval --help`.
|
|
80
|
+
When available, preview `eval <new-skill> --baseline-skill <old-skill> --prepare
|
|
81
|
+
<fresh-workspace> --from-commit <fix-sha> --source-dir <repo> --prompt-file
|
|
82
|
+
<issue-request> --agent <id> --dry-run`. This validates two complete same-name,
|
|
83
|
+
different-byte Skills and mines the fix plus its tests without model calls.
|
|
84
|
+
Apply within existing local-write authorization using `--yes`; creation executes
|
|
85
|
+
trusted offline verifier/oracle commands, with `--verifier-cmd` retained for later
|
|
86
|
+
runs (default `node --test`). Failed gates retain the workspace as blocked. No
|
|
87
|
+
agent configuration is changed or isolated. The generated request uses one
|
|
88
|
+
balanced development pair with a two-call ceiling; optional spending-budget and
|
|
89
|
+
executor-timeout flags are copied into it. Preview the returned request separately
|
|
90
|
+
and confirm its exact digest only within authorized spending. This entry does not
|
|
91
|
+
prepare independent validation or relax the adoption policy. npm 0.16.0 and
|
|
92
|
+
earlier do not include this preparation entry.
|
|
78
93
|
|
|
79
94
|
Since 0.12.0, `--freeze` selects tracked ordinary files inside Git; outside Git,
|
|
80
95
|
explicit `--include <file-or-dir>` selections are required. Narrow large fixtures
|
|
81
96
|
before importing. For `--decompose`, preview and authorize its single call within
|
|
82
97
|
existing spending permission. Failed/interrupted drafts retain costs and inputs;
|
|
83
|
-
never retry implicitly. See [drafting records](https://github.com/remote-controlled-man/skillfit/blob/
|
|
98
|
+
never retry implicitly. See [drafting records](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/bench-authoring.md).
|
|
84
99
|
|
|
85
100
|
Current-source schema 2 requires explicit `--claim` values for add/freeze/from-commit;
|
|
86
101
|
claims edits use a JSON array and never upgrade schema 1 implicitly. Preview and
|
|
@@ -112,7 +127,7 @@ Dry previews execute no verifier/oracle/agent. Inspect the environment's nested
|
|
|
112
127
|
`status`: a generated `planned` result can still be blocked by a missing CLI.
|
|
113
128
|
Login always remains offline unknown. Live calibration/eval block hard case or
|
|
114
129
|
environment failures; warnings and unknown evidence are not interchangeable.
|
|
115
|
-
See [shared planning](https://github.com/remote-controlled-man/skillfit/blob/
|
|
130
|
+
See [shared planning](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/experiment-workflow.md).
|
|
116
131
|
|
|
117
132
|
Calibration has one no-Skill baseline arm and defaults to two trials; trigger
|
|
118
133
|
has one installed arm, defaults to five and skips unlabeled selected tasks.
|
|
@@ -219,7 +234,7 @@ historical adoption requirement; a declaration mismatch is an integrity error.
|
|
|
219
234
|
source checkout; source-development validation uses OS temporary directories.
|
|
220
235
|
Exclude outputs from that project's Git history; the CLI does not edit its ignore rules.
|
|
221
236
|
Keep derived analysis/scratch outside sealed batches; never edit/prune indexed
|
|
222
|
-
receipts. Follow the [workflow](https://github.com/remote-controlled-man/skillfit/blob/
|
|
237
|
+
receipts. Follow the [workflow](https://github.com/remote-controlled-man/skillfit/blob/5511a67639b87a255031676e6e3703f649f25f7d/docs/guides/experiment-workflow.md#retain-and-clean-up)
|
|
223
238
|
for explicit manual retention/cleanup. This CLI has no automatic GC or generic
|
|
224
239
|
custom process-metric collector.
|
|
225
240
|
- `bench init` / `bench add` show a plan before writing; `bench edit/remove` default
|