skillfit 0.10.0 → 0.11.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 +27 -7
- package/README.zh-CN.md +27 -7
- package/benches/README.md +2 -2
- package/dist/cli.js +146 -36
- package/dist/cli.test.js +94 -0
- package/dist/commands/bench-calibration.js +197 -0
- package/dist/commands/bench-calibration.test.js +237 -0
- package/dist/commands/bench-check-json.test.js +24 -3
- package/dist/commands/bench.js +69 -141
- package/dist/commands/calibration-cli.test.js +145 -0
- package/dist/commands/eval-agent-preflight.test.js +245 -0
- package/dist/commands/eval-cli.js +31 -0
- package/dist/commands/eval-component.js +59 -28
- package/dist/commands/eval-export-modes.test.js +350 -0
- package/dist/commands/eval-export.js +44 -10
- package/dist/commands/eval-export.test.js +165 -8
- package/dist/commands/eval-interruption.test.js +238 -0
- package/dist/commands/eval-plan.js +37 -0
- package/dist/commands/eval-preflight.js +61 -0
- package/dist/commands/eval-preflight.test.js +382 -0
- package/dist/commands/eval-report.js +60 -14
- package/dist/commands/eval-report.test.js +2 -2
- package/dist/commands/eval-single-arm-replay.js +21 -0
- package/dist/commands/eval-single-arm-report.js +223 -0
- package/dist/commands/eval.js +184 -112
- package/dist/commands/evaluation-report.js +5 -0
- package/dist/commands/evaluation-report.test.js +243 -0
- package/dist/commands/replay-cancellation.test.js +105 -0
- package/dist/commands/workflow-entrypoints.test.js +137 -0
- package/dist/harness/agent-preflight.js +180 -0
- package/dist/harness/bench.js +2 -1
- package/dist/harness/command.js +49 -0
- package/dist/harness/eval-audit.js +164 -17
- package/dist/harness/eval-budget.js +46 -2
- package/dist/harness/eval-budget.test.js +30 -3
- package/dist/harness/eval-component.test.js +169 -6
- package/dist/harness/eval-contract.js +11 -5
- package/dist/harness/executors/api.js +14 -4
- package/dist/harness/executors/api.test.js +61 -0
- package/dist/harness/executors/cli.js +24 -3
- package/dist/harness/experiment-session.js +77 -18
- package/dist/harness/experiment-session.test.js +51 -1
- package/dist/harness/input-snapshot.js +150 -0
- package/dist/harness/interruption.js +48 -0
- package/dist/harness/interruption.test.js +31 -0
- package/dist/harness/invocation-costs.js +72 -0
- package/dist/harness/judge-accounting.test.js +216 -0
- package/dist/harness/judge-audit.js +56 -0
- package/dist/harness/judge.js +86 -21
- package/dist/harness/replay-package.js +71 -5
- package/dist/harness/runner.js +92 -44
- package/dist/harness/runner.test.js +23 -0
- package/dist/harness/single-arm-audit.js +436 -0
- package/dist/harness/trigger.js +41 -7
- package/dist/harness/trigger.test.js +12 -0
- package/dist/harness/verifier-error.js +65 -0
- package/dist/harness/verifier.test.js +128 -0
- package/docs/bench-authoring.md +34 -9
- package/docs/bench-check-json.md +36 -6
- package/docs/eval-agent-preflight.md +101 -0
- package/docs/eval-case-preflight.md +115 -0
- package/docs/eval-component.md +65 -9
- package/docs/eval-costs.md +53 -0
- package/docs/eval-planning.md +153 -0
- package/docs/evaluation-input-snapshots.md +125 -0
- package/docs/evaluation-interruption.md +101 -0
- package/docs/evaluation-reports.md +143 -0
- package/docs/experiment-workflow.md +16 -2
- package/docs/first-real-eval.md +55 -5
- package/docs/growth-roadmap-2026-10.md +48 -11
- package/docs/metrics.md +71 -3
- package/docs/plans/2026-10-16-case-workflow-and-release.md +19 -0
- package/docs/plans/2026-10-17-workflow-foundations.md +64 -0
- package/docs/releases/0.10.0-ci-registry-install.json +140 -0
- package/docs/releases/0.10.0-feature-smoke.json +22 -0
- package/docs/releases/0.10.0-feature-smoke.mjs +62 -0
- package/docs/releases/0.10.0-signatures.txt +7 -0
- package/docs/releases/0.10.0-verification.json +76 -0
- package/docs/releases/0.10.0.md +44 -8
- package/docs/releases/0.10.1-ci-registry-install.json +70 -0
- package/docs/releases/0.10.1-feature-smoke.json +28 -0
- package/docs/releases/0.10.1-feature-smoke.mjs +95 -0
- package/docs/releases/0.10.1-local-registry-install.json +60 -0
- package/docs/releases/0.10.1-registry-metadata.json +33 -0
- package/docs/releases/0.10.1-signatures.txt +7 -0
- package/docs/releases/0.10.1-verification.json +90 -0
- package/docs/releases/0.10.1.md +71 -0
- package/docs/releases/0.11.0-feature-smoke.mjs +224 -0
- package/docs/releases/0.11.0.md +47 -0
- package/docs/replay-packages.md +52 -11
- package/docs/schemas/agent-preflight.schema.json +31 -0
- package/docs/schemas/calibration-plan.schema.json +22 -0
- package/docs/schemas/calibration-result.schema.json +17 -0
- package/docs/schemas/eval-preflight.schema.json +57 -0
- package/docs/schemas/eval-request.schema.json +1 -1
- package/docs/schemas/eval-result.schema.json +14 -1
- package/docs/schemas/invocation-costs.schema.json +31 -0
- package/docs/schemas/judge-call.schema.json +22 -0
- package/docs/schemas/single-arm-report.schema.json +20 -0
- package/docs/schemas/verifier-error.schema.json +11 -0
- package/docs/sharing-results.md +8 -2
- package/docs/verifier-contract.md +99 -0
- package/package.json +1 -1
- package/skills/skillfit/SKILL.md +41 -8
package/README.md
CHANGED
|
@@ -65,8 +65,8 @@ The skill fired once in nine in-domain tasks — and the tasks pass 3/3 without
|
|
|
65
65
|
## Install
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npx skillfit@0.
|
|
69
|
-
npx skillfit@0.
|
|
68
|
+
npx skillfit@0.11.0 --help
|
|
69
|
+
npx skillfit@0.11.0 doctor
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
`npx skillfit` installs the published release and needs Node.js 22 or newer. The quick start below uses a source checkout so you can run the benches that ship in this repository. After `npm run build`, `node dist/cli.js` is that checkout's CLI. `skillfit` is the command installed from npm.
|
|
@@ -94,6 +94,10 @@ For eval and baseline calibration, `--trials` must be an integer from 1 to 20. F
|
|
|
94
94
|
|
|
95
95
|
Use `--max-calls <n>` for eval or baseline calibration to reject plans above a call ceiling (including enabled judges). New runs retain a frozen plan, call ledger, session state and artifact hashes; input/config drift or executor failures stop further calls. Partial runs cannot support an installation recommendation. Follow the [bounded experiment workflow](docs/experiment-workflow.md), including its environment limits.
|
|
96
96
|
|
|
97
|
+
Included in 0.10.1: Ctrl+C stops live evaluation processes and subsequent calls, retains available output/usage and seals a stopped run before exit 130. SIGTERM uses exit 143. Partial or unknown usage stays incomplete; interrupted prefixes cannot authorize an upgrade or retry themselves. See [interruption and retained records](docs/evaluation-interruption.md).
|
|
98
|
+
|
|
99
|
+
Also included in 0.10.1: live `eval` checks selected cases offline before any agent/judge call. Hard failures block execution; warnings and unknown evidence are reported separately and retained with the run. Previews declare these checks pending and execute no verifier/oracle. This adds local checking time and zero model calls. See [case preflight](docs/eval-case-preflight.md).
|
|
100
|
+
|
|
97
101
|
Supported agents: **Claude Code**, **OpenAI Codex CLI**, **Kimi Code** ([capability matrix](src/matrix/agents.json) — machine-readable, dated, doc-linked). Trigger-mode capture is currently verified for Kimi Code and Codex CLI.
|
|
98
102
|
|
|
99
103
|
## Build your own cases
|
|
@@ -110,9 +114,13 @@ node dist/cli.js eval skills/skillfit --bench my-bench --agent codex --input wor
|
|
|
110
114
|
|
|
111
115
|
This is a synthetic teaching case, not a Skill benchmark. Replace the fixture, prompt, verifier and oracle with your actual task before measuring benefit. The preview shows two planned calls and starts none. Omit `--kind` (or use `--kind output`) for the existing reply-grading starter. Capture an observed failure with `bench add --freeze`, or import a maintainer fix with `--from-commit`; follow the [authoring guide](docs/bench-authoring.md).
|
|
112
116
|
|
|
113
|
-
Agent callers can use `bench check --json` for versioned gate identifiers, task IDs, locations, failure reasons, remediation suggestions and bounded verifier evidence. stdout is JSON only; exit codes distinguish passed checks, failed checks and errors.
|
|
117
|
+
Agent callers can use `bench check --json` for versioned gate identifiers, task IDs, locations, failure reasons, remediation suggestions and bounded verifier evidence. stdout is JSON only; exit codes distinguish passed checks, failed checks and errors. Without `--calibrate`, this remains an offline integrity check; warnings still need review. Version 0.11.0 also supports a separate `--calibrate --json --dry-run` plan, with explicit hash confirmation before JSON execution. See the [JSON contract](docs/bench-check-json.md).
|
|
118
|
+
|
|
119
|
+
Version 0.11.0 supports quoted verifier/oracle arguments, including script paths with spaces. Recognized grader load/runtime errors and explicit infrastructure-error messages block offline gates or become ungraded evaluation errors, preserving agent costs. Normal task failures and assertions remain graded failures. See [verifier commands and error reporting](docs/verifier-contract.md).
|
|
114
120
|
|
|
115
|
-
|
|
121
|
+
The same source checks the Agent environment in eval and baseline-calibration previews and before dispatch: CLI file availability, matrix capability matching and global same-name Skill conflicts. Known failures block before case probes or model calls; login remains explicitly unknown offline. Checks are sealed with the run and read without probing the current machine during report/replay. See [Agent environment preflight](docs/eval-agent-preflight.md).
|
|
122
|
+
|
|
123
|
+
List and inspect cases, then preview an edit or removal. `--yes` applies a validated manifest change with a backup; removal preserves the case files. Select a smaller paired eval, trigger run or baseline calibration using repeated `--task`, or `taskIds` in a paired JSON request. IDs and order are frozen, budgets count only selected cases, and small samples remain indicative. See [case management](docs/case-management.md).
|
|
116
124
|
|
|
117
125
|
```bash
|
|
118
126
|
node dist/cli.js bench list my-bench --json
|
|
@@ -161,6 +169,10 @@ Requests can also pin `executorTimeoutSeconds` (default 600) for both versions.
|
|
|
161
169
|
|
|
162
170
|
Available in 0.10.0: optional `spendingBudget` sets five absolute batch stop lines. Reaching a line or losing complete final usage stops subsequent calls and retains spending; an in-flight call may overshoot. See the [guard contract](docs/eval-component.md#input-and-execution).
|
|
163
171
|
|
|
172
|
+
Version 0.11.0 unifies ordinary paired/trigger eval planning and paired Agent request plans. Ordinary eval also accepts `--json`, `--spending-budget <file>`, `--executor-timeout-seconds`, `--runs-root` and `--run-group`, plus `--pair-order` for paired runs; JSON execution requires the preview hash. Requests can set `baselineSkill: null` for no Skill installed by the harness in baseline, matching ordinary installed eval without `--baseline-skill`. This measures installation benefit but cannot authorize revision adoption. See [shared settings and confirmation](docs/eval-planning.md).
|
|
173
|
+
|
|
174
|
+
The same source gives baseline calibration and trigger runs JSON previews, frozen task selection, call/spending limits and per-call deadlines. Preview runs no verifier, oracle or agent; hard case/environment failures block live execution. JSON execution needs an explicit fresh group and the exact preview hash (`plan.planSha256` for calibration, `plan.sha256` for eval). Calibration measures baseline difficulty; trigger measures discovery. Neither establishes paired Skill benefit or authorizes adoption.
|
|
175
|
+
|
|
164
176
|
Failed Codex JSON calls can retain identity-bound partial usage from local numeric counters. Private transcript bodies stay out of exports, and partial usage never satisfies the final-cost or adoption gates.
|
|
165
177
|
|
|
166
178
|
```bash
|
|
@@ -197,9 +209,17 @@ Try the synthetic example below, then replace its path with the `Manifest:` path
|
|
|
197
209
|
node dist/cli.js report eval docs/examples/eval-manifest.synthetic.json
|
|
198
210
|
```
|
|
199
211
|
|
|
200
|
-
|
|
212
|
+
In 0.10.1, Markdown and JSON accept the same manifest, native run directory or portable package, including stopped/incomplete batches. Both assess saved evidence and explain acceptance separately from a quality verdict. `--replay`, `--records` and `--policy` work in either format; successful rendering does not authorize an upgrade. See [report inputs and states](docs/evaluation-reports.md).
|
|
213
|
+
|
|
214
|
+
Version 0.11.0 also reads calibration directories/`_calibration.json` and trigger manifests in either format. Completed calibration stays completed and shows baseline difficulty; trigger reports show recall, false-trigger rate, precision, F1 and detection coverage. New sealed single-arm runs support native audit, offline delivery replay and portable export; standalone historical summaries stay unverified. These separate reports cannot authorize adoption or use paired acceptance-policy options. See [report types](docs/evaluation-reports.md#calibration-and-trigger-reports-source-after-npm-0101).
|
|
215
|
+
|
|
216
|
+
New reports separate cached and uncached input, output, and elapsed time, with spending per successful task that includes failed runs. They show surviving pairs alongside all agent invocations, and mark partial or missing timeout usage instead of treating it as zero. Chat-completions API responses retain explicit cached-input counts, including zero; missing or invalid counts stay unknown. Older manifests identify these fields as unrecorded. See [cost accounting](docs/eval-costs.md).
|
|
217
|
+
|
|
218
|
+
Version 0.11.0 records `invocationCosts` for primary Agent, judge and total spending, preserving failed/partial/unknown usage. Optional judge spending shares the batch stop lines; an explicitly enabled API judge with missing credentials fails instead of silently turning off. Historical missing judge receipts stay unknown. See [cost accounting](docs/eval-costs.md).
|
|
219
|
+
|
|
220
|
+
That source can export a supported sealed native paired, calibration or trigger run, including new paired runs with judge receipts, as a portable directory with original receipts, matching inputs, pinned compiled CLI, checksums and a replay entry point. Export previews by default; missing inputs, required receipt/runtime support or an existing destination stop it. The whole package can move to another machine. Replay calls no model, preserves stopped/unknown costs and authorizes no upgrade. Review project data before sharing; see [portable replay packages](docs/replay-packages.md).
|
|
201
221
|
|
|
202
|
-
|
|
222
|
+
Version 0.10.1 seals input copies before dispatch: later edits/deletions of the original Skill, bench or request no longer prevent export/replay. The plan records snapshot integrity, local copy time and storage; a damaged declared snapshot is rejected. Historical runs still need matching recovered inputs. See [sealed evaluation inputs](docs/evaluation-input-snapshots.md).
|
|
203
223
|
|
|
204
224
|
```bash
|
|
205
225
|
node dist/cli.js report eval ./runs/my-run --export ./exports/my-run --json
|
|
@@ -292,7 +312,7 @@ Not affiliated with Anthropic, OpenAI, Moonshot AI, or any agent vendor. Evaluat
|
|
|
292
312
|
- [x] Optional `triggerClass` (`explicit`, `implicit`, `contextual`) on positive tasks. Unlabeled tasks stay in the pooled recall.
|
|
293
313
|
- [x] `--compete-installed` copies other user-level Skills into a trigger trial. System Skills and plugins outside the matrix directories are not copied. `installed` reports a long-body read separately from the task result; that read is not trigger recall.
|
|
294
314
|
- [ ] An installation recommendation. The July 2026 eight-skill study found no robust task-quality gain. The 67-Skill catalog and the 13-Skill starter set are not evaluated as sets.
|
|
295
|
-
- [x] npm publication (`skillfit@0.
|
|
315
|
+
- [x] npm publication (`skillfit@0.10.1`), with [verified CLI/OIDC publication and registry installation](docs/releases/0.10.1-verification.json). `npx skillfit` installs that release. Clone, `npm ci`, and `npm run build` remain valid.
|
|
296
316
|
- [x] Community bench and evidence submissions. Benches go in `benches/contrib`; evidence uses the Evidence submission issue template. CI runs the offline gates and does not call an agent.
|
|
297
317
|
- [ ] Cursor / Gemini CLI / OpenCode adapters
|
|
298
318
|
- [x] Streamable HTTP MCP preflight (`mcp check` transport `http`). It does not call a tool.
|
package/README.zh-CN.md
CHANGED
|
@@ -65,8 +65,8 @@ F1 : 0.20 (no CI: a harmonic mean of two proportions has no clo
|
|
|
65
65
|
## 安装
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npx skillfit@0.
|
|
69
|
-
npx skillfit@0.
|
|
68
|
+
npx skillfit@0.11.0 --help
|
|
69
|
+
npx skillfit@0.11.0 doctor
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
`npx skillfit` 安装的是已发布的版本,需要 Node.js 22 或更新。下面的快速开始用的是源码检出,这样才能跑本仓库自带的 bench。`npm run build` 之后,`node dist/cli.js` 是这份检出的 CLI。`skillfit` 是从 npm 装上的命令。
|
|
@@ -94,6 +94,10 @@ eval 和基线校准的 `--trials` 必须是 1 到 20 的整数。小数、格
|
|
|
94
94
|
|
|
95
95
|
eval 和基线校准可用 `--max-calls <n>` 拒绝超出调用上限的计划(包括启用的裁判调用)。新运行会保留固定计划、调用记录、session 状态和文件哈希;输入或配置变化、执行器失败后停止后续调用。未完成的运行不能支持安装建议。详见[有限且可核查的实验流程](docs/experiment-workflow.md),其中也说明环境控制的边界。
|
|
96
96
|
|
|
97
|
+
0.10.1 已包含:Ctrl+C 会停止正在运行的评测进程和后续调用,保留可用输出与用量,封存中止记录后以 130 退出。SIGTERM 对应 143。部分或未知用量仍不完整;中止批次不能获准升级,也不会自行重试。参见[中断与记录保留](docs/evaluation-interruption.md)。
|
|
98
|
+
|
|
99
|
+
0.10.1 还包含:正式 `eval` 会在任何 agent/裁判调用前离线检查所选 case。硬失败会阻止开跑;警告与未知证据分别报告,并随本批记录保留。预览会标明校验尚未执行,不运行评分器或参考解。它只增加本地校验时间,新增模型调用为零。参见 [case 开跑前校验](docs/eval-case-preflight.md)。
|
|
100
|
+
|
|
97
101
|
支持的 agent:**Claude Code**、**OpenAI Codex CLI**、**Kimi Code**([能力矩阵](src/matrix/agents.json)——机器可读、带验证日期、附官方文档链接)。trigger 模式的捕获目前已在 Kimi Code 和 Codex CLI 上验证过。
|
|
98
102
|
|
|
99
103
|
## 创建自己的 case
|
|
@@ -110,9 +114,13 @@ node dist/cli.js eval skills/skillfit --bench my-bench --agent codex --input wor
|
|
|
110
114
|
|
|
111
115
|
这是用于教格式的合成案例,不是 Skill 基准。在衡量收益前,把初始文件、任务请求、评分器和参考修复一起替换为你的真实任务。预览会显示计划调用两次,实际一次也不会启动。不传 `--kind`(或用 `--kind output`)仍生成原来的回复评分模板。已有失败可用 `bench add --freeze` 固定,维护者修复可用 `--from-commit` 导入;参见[编写指南](docs/bench-authoring.md)。
|
|
112
116
|
|
|
113
|
-
Agent 可以用 `bench check --json` 读取带版本的校验标识、任务 ID、位置、失败原因、处理建议和限长的评分器证据。标准输出只有 JSON
|
|
117
|
+
Agent 可以用 `bench check --json` 读取带版本的校验标识、任务 ID、位置、失败原因、处理建议和限长的评分器证据。标准输出只有 JSON,退出码区分通过、校验失败和执行错误。不加 `--calibrate` 时,它仍是离线完整性校验,警告仍需检查。0.11.0还支持独立的 `--calibrate --json --dry-run` 计划;JSON 正式执行前必须明确确认计划哈希。参见 [JSON 契约](docs/bench-check-json.md)。
|
|
118
|
+
|
|
119
|
+
0.11.0支持给校验器和参考解命令的参数加引号,包括含空格的脚本路径。已识别的评分器加载/运行异常及显式基础设施错误消息会阻止离线校验通过,或记为不参与评分的评测错误,同时保留 Agent 成本。正常任务失败和断言失败仍参与评分。详见[校验命令与错误报告](docs/verifier-contract.md)。
|
|
114
120
|
|
|
115
|
-
|
|
121
|
+
0.11.0 还会在 eval 和基线校准的预览及开跑前检查 Agent 环境:CLI 文件是否可用、能力是否与矩阵声明匹配,以及全局是否存在同名 Skill。已知失败会在 case 探测或模型调用前拦住;登录状态明确标为离线未知。检查结果随运行封存,报告和重放读取当时记录,不探测当前机器。详见 [Agent 环境自检](docs/eval-agent-preflight.md)。
|
|
122
|
+
|
|
123
|
+
可以列出和查看 case,再预览编辑或移除操作。加 `--yes` 才会备份并应用通过校验的清单变更;移除会保留 case 文件。配对评估、触发率测试和基线校准都可重复 `--task` 只选择部分 case;配对 JSON 请求用 `taskIds`。所选 ID 和顺序会固定到计划中,预算只计算所选 case,小样本仍只作参考。参见 [case 管理](docs/case-management.md)。
|
|
116
124
|
|
|
117
125
|
```bash
|
|
118
126
|
node dist/cli.js bench list my-bench --json
|
|
@@ -158,6 +166,10 @@ node dist/cli.js eval ./skill-new --baseline-skill ./skill-old --mode installed
|
|
|
158
166
|
|
|
159
167
|
0.10.0 已包含可选 `spendingBudget`,设置五项整批预算停止线。触线或缺失完整最终用量时停止后续调用并保留花费;正在运行的一次仍可能越线。详见[预算检查契约](docs/eval-component.md#input-and-execution)。
|
|
160
168
|
|
|
169
|
+
0.11.0统一了普通配对/触发率 eval 和配对 Agent 请求的计划生成。普通 eval 也支持 `--json`、`--spending-budget <file>`、`--executor-timeout-seconds`、`--runs-root` 和 `--run-group`,配对实验另可设置 `--pair-order`;JSON 执行必须确认预览指纹。请求可用 `baselineSkill: null` 表示 baseline 不由 harness 安装 Skill,与普通 installed eval 省略 `--baseline-skill` 对应。这能测量安装收益,但不能授权采用某个修订版本。详见[统一设置与确认流程](docs/eval-planning.md)。
|
|
170
|
+
|
|
171
|
+
0.11.0 还为基线校准和触发率测试提供 JSON 预览、固定任务选择、调用/消耗上限及每次调用的超时。预览不执行评分器、参考解或 Agent;case 或环境硬失败会阻止正式开跑。JSON 执行必须指定新的批次名,并提交准确的预览哈希(校准用 `plan.planSha256`,eval 用 `plan.sha256`)。校准测基线难度,触发率测试测发现能力,两者都不能证明配对的 Skill 收益或授权采用。
|
|
172
|
+
|
|
161
173
|
失败的 Codex JSON 调用可从本地数值计数器保留身份匹配的部分用量。导出不包含私有会话正文;部分用量仍不能满足最终成本覆盖或采用门槛。
|
|
162
174
|
|
|
163
175
|
```bash
|
|
@@ -194,9 +206,17 @@ node dist/cli.js eval ./context7-experiment --bench ./my-context7-bench --agent
|
|
|
194
206
|
node dist/cli.js report eval docs/examples/eval-manifest.synthetic.json
|
|
195
207
|
```
|
|
196
208
|
|
|
197
|
-
|
|
209
|
+
0.10.1 中,普通报告和 JSON 都接受同样的 manifest、原生运行目录或复现包,包括中止和未完成批次。两者都会核查已存证据,并把采用决定与质量判定分开解释。`--replay`、`--records` 和 `--policy` 两种格式都能用;成功生成报告不代表获准升级。参见[报告输入和状态](docs/evaluation-reports.md)。
|
|
210
|
+
|
|
211
|
+
0.11.0还支持用两种格式读取校准目录/`_calibration.json` 和触发率 manifest。已完成的校准保持完成状态,展示基线难度;触发率报告展示召回率、误触发率、精确率、F1 和检测覆盖情况。新封存的单组运行支持原生证据审计、离线交付结果重放和便携导出;独立的历史摘要仍未验证。这两种报告不能授权采用,也不能使用配对采用策略选项。参见[报告类型](docs/evaluation-reports.md#calibration-and-trigger-reports-source-after-npm-0101)。
|
|
212
|
+
|
|
213
|
+
新报告分别列出缓存输入、未缓存输入、输出和耗时,并把失败运行的消耗计入每次成功任务的成本。报告同时展示存活配对和全部 agent 调用;超时导致的用量不完整或缺失会单独标记,不会当作零。Chat completions API 明确返回的缓存输入计数(包括零)会被保留;缺失或非法值仍记为未知。旧 manifest 会显示这些字段未记录。详见[成本统计](docs/eval-costs.md)。
|
|
214
|
+
|
|
215
|
+
0.11.0用 `invocationCosts` 分别记录 Agent、裁判和合计消耗,保留失败、部分和未知用量。可选裁判的消耗计入同一批次停线;显式启用 API 裁判却缺少凭据会报错,不会静默关闭。历史缺失的裁判记录仍标未知。参见[成本统计](docs/eval-costs.md)。
|
|
216
|
+
|
|
217
|
+
同一份源码可把受支持且已封存的原生配对、校准和触发率实验(包括带有新裁判记录的配对实验)导出为独立目录,包含原始记录、匹配的输入、当时的编译版 CLI、校验清单和重放入口。默认只预览;缺输入、缺少必需的调用记录/原始运行时支持或目标目录已存在就停止。整个目录可搬到另一台机器,重放不调用模型,保留中止状态和未知成本,也不能授权升级。分享前检查项目数据,参见[可搬走的复现包](docs/replay-packages.md)。
|
|
198
218
|
|
|
199
|
-
|
|
219
|
+
0.10.1 会在调用前封存输入副本:原始 Skill、bench 或请求之后被修改、删除,也不影响导出和重放。计划会记录快照校验信息、本地复制耗时和存储量;已声明的快照损坏就拒绝使用。历史记录仍需找回匹配的原始输入。参见[评测输入封存](docs/evaluation-input-snapshots.md)。
|
|
200
220
|
|
|
201
221
|
```bash
|
|
202
222
|
node dist/cli.js report eval ./runs/my-run --export ./exports/my-run --json
|
|
@@ -289,7 +309,7 @@ node ./personal-codex/setup.mjs --yes
|
|
|
289
309
|
- [x] 正例任务可选 `triggerClass`(`explicit`、`implicit`、`contextual`)。没标类别的任务仍只进汇总召回率。
|
|
290
310
|
- [x] `--compete-installed` 把其他用户级 Skill 复制进 trigger 试验。矩阵目录之外的系统 Skill 和插件不会被复制。`installed` 把「读了长正文」和任务结果分开报告;这次读取不是 trigger 召回率。
|
|
291
311
|
- [ ] 安装建议。2026 年 7 月的 8 个 Skill 实验没有可靠的任务质量增益。67 个 Skill 目录和 13 个入门套装都没有作为一组被评过。
|
|
292
|
-
- [x] 已发布到 npm(`skillfit@0.
|
|
312
|
+
- [x] 已发布到 npm(`skillfit@0.10.1`),并通过 [CLI/OIDC 发布与注册表安装验收](docs/releases/0.10.1-verification.json)。`npx skillfit` 安装的是这个版本。克隆后 `npm ci` 再 `npm run build` 仍然可用。
|
|
293
313
|
- [x] 社区 bench 与 evidence 提交。bench 放在 `benches/contrib`;证据用 Evidence submission issue 模板。CI 只跑离线检查,不调用 agent。
|
|
294
314
|
- [ ] Cursor / Gemini CLI / OpenCode 适配器
|
|
295
315
|
- [x] Streamable HTTP MCP 预检(`mcp check` 的 `http` 传输)。不会调用工具。
|
package/benches/README.md
CHANGED
|
@@ -90,9 +90,9 @@ All paths must stay inside the bench directory.
|
|
|
90
90
|
|
|
91
91
|
The verifier is the heart of a bench. It must be **deterministic**: same run directory in, same verdict out — no network, no clocks, no randomness.
|
|
92
92
|
|
|
93
|
-
- Invocation: `<verifier command> <absolute run directory>`, working directory = bench root. The command is
|
|
93
|
+
- Invocation: `<verifier command> <absolute run directory>`, working directory = bench root. The command is spawned **without a shell**, so its first token must be an executable the operating system can start directly: `node verifiers/x.mjs` works, while a bare `npm test` or a `.cmd`/`.bat` wrapper does not (`ENOENT` / `EINVAL` on Windows). Source after npm 0.10.1 groups quoted arguments, so `node "verifiers/check answer.mjs"` works; malformed quoting fails before execution. No shell expansion runs. See [command and error contract](../docs/verifier-contract.md). If the verdict genuinely comes from a shell command, use `bench add --freeze --verifier-cmd "<cmd>"`, which writes a generated `verifiers/<task-id>.mjs` that node runs and that runs your command under a shell inside. Keeping the harness's own spawn shell-free is deliberate, not an oversight — benches are contributed by third parties, and a shell here would turn `"verifier": "node v.mjs & curl …"` in somebody else's `bench.json` into code execution on your machine.
|
|
94
94
|
- A verifier that produces **no exit code at all** — unspawnable, or killed by the 2-minute timeout — has graded nothing, so it is never read as a verdict: `bench check` fails the task and names the cause, and `eval` excludes that trial *and its paired arm* from the rates rather than scoring a fabricated failure. Without that, a broken verifier command would look like a 0% pass rate in both arms and get reported as "bench too hard".
|
|
95
|
-
- **
|
|
95
|
+
- **For a functioning verifier, exit code 0 = pass, anything else = fail.** Source after npm 0.10.1 separately excludes recognized grader infrastructure errors, including bench-owned Node uncaught exceptions and explicit `skillfit.verifier-error` JSON messages. They cannot satisfy NOP gates or score a model failure merely by exiting nonzero. Candidate failures/assertions retain normal grading; agent spending stays recorded. See [the contract and custom-runtime error channel](../docs/verifier-contract.md).
|
|
96
96
|
- Print a one-line JSON summary as the **last stdout line**. The harness parses it (tolerating surrounding noise) and saves the raw output to `_verifier.txt`:
|
|
97
97
|
- `passed` (boolean) — informational; the exit code is authoritative, and a disagreement is flagged as a warning.
|
|
98
98
|
- `checks` (optional) — `[{"name": "discount-boundary", "pass": true}, ...]`: the acceptance criteria decomposed into 2–8 named programmatic checks. The trial **score** is the fraction of checks passed; scores feed the per-facet table and the paired-bootstrap Δscore CI in the report, letting a bench resolve effects binary pass/fail cannot at small sample sizes. Checks never flip a verdict. Keep them deterministic and outcome-focused. `bench check` reads the count back out of your verifier and warns outside 2–8: one check is binary pass/fail in facet costume and carries none of the graded signal, while a dozen lets whatever those checks happen to measure dominate the score.
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs } from 'node:util';
|
|
3
|
-
import {
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { runBenchAdd, runBenchCheck, runBenchInit, prepareBenchCalibration, runBenchCalibration } from './commands/bench.js';
|
|
4
5
|
import { benchCheckError, benchCheckJson } from './commands/bench-check-report.js';
|
|
5
6
|
import { inspectBench, manageBench } from './commands/bench-manage.js';
|
|
6
7
|
import { exportEvaluation } from './commands/eval-export.js';
|
|
7
8
|
import { runBundleExport } from './commands/bundle.js';
|
|
8
9
|
import { runDoctor } from './commands/doctor.js';
|
|
9
|
-
import { DEFAULT_EVAL_TRIALS
|
|
10
|
+
import { DEFAULT_EVAL_TRIALS } from './commands/eval.js';
|
|
11
|
+
import { runEvalCli } from './commands/eval-cli.js';
|
|
12
|
+
import { readComponentJson } from './harness/eval-contract.js';
|
|
13
|
+
import { parseSpendingBudget } from './harness/eval-budget.js';
|
|
10
14
|
import { runEvalReport } from './commands/eval-report.js';
|
|
11
|
-
import { componentError,
|
|
15
|
+
import { componentError, runEvalComponent } from './commands/eval-component.js';
|
|
16
|
+
import { readEvaluationReport } from './commands/evaluation-report.js';
|
|
12
17
|
import { runInstall } from './commands/install.js';
|
|
13
18
|
import { runMcpCheck } from './commands/mcp.js';
|
|
14
19
|
import { runReport } from './commands/report.js';
|
|
@@ -19,8 +24,8 @@ const USAGE = `skillfit ${VERSION} — evidence-driven configuration for AI codi
|
|
|
19
24
|
Usage:
|
|
20
25
|
skillfit doctor [--agent <id>] Inspect current agent configuration health
|
|
21
26
|
skillfit report [--agent <id>] [--json] Skill usage receipts from local session history (read-only)
|
|
22
|
-
skillfit report eval <
|
|
23
|
-
skillfit report eval <
|
|
27
|
+
skillfit report eval <summary-or-run-dir> Read paired, calibration or trigger reports (read-only)
|
|
28
|
+
skillfit report eval <summary-or-run-dir> --json Return a typed saved-evidence report for an Agent
|
|
24
29
|
skillfit report eval <run-dir> --export <new-dir> Plan a portable offline replay package
|
|
25
30
|
skillfit eval --request <request.json> --dry-run Return a pinned JSON plan without calls
|
|
26
31
|
skillfit eval --request <request.json> --plan-sha <sha256> Run that plan and return JSON evidence
|
|
@@ -41,21 +46,26 @@ Usage:
|
|
|
41
46
|
|
|
42
47
|
Options:
|
|
43
48
|
--agent <id> Target agent: claude-code | codex | kimi-code (default: all detected)
|
|
44
|
-
--judge-agent <id> Drive
|
|
49
|
+
--judge-agent <id> Drive a paired eval's blind judge (prefer a different family than --agent)
|
|
45
50
|
--mode <mode> Eval mode: inject (default) | installed (paired complete Skill) | trigger (single arm)
|
|
46
51
|
--baseline-skill <path> With --mode installed, compare a previous Skill version against the target
|
|
47
52
|
--request <path> Version 1 Skill revision request (JSON output; excludes positional eval options)
|
|
48
|
-
--plan-sha <hash> Confirm
|
|
49
|
-
--json Machine output for bench check/list/show/edit/remove, report, and
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--
|
|
53
|
+
--plan-sha <hash> Confirm an eval/calibration dry-run plan (also needs --run-group)
|
|
54
|
+
--json Machine output for bench check/list/show/edit/remove, report, eval and calibration
|
|
55
|
+
--spending-budget <file> Eval/calibration: input, cachedInput, uncachedInput, output, durationSeconds stop lines
|
|
56
|
+
--executor-timeout-seconds <n> Eval/calibration: executor deadline (integer 1–3600)
|
|
57
|
+
--pair-order <order> Paired eval: baseline-first (default) | balanced
|
|
58
|
+
--runs-root <dir> Eval/calibration output parent (default: ./runs)
|
|
59
|
+
--run-group <name> Fresh eval group; reuse its name when confirming a preview
|
|
60
|
+
--policy <path> With paired report eval, assess against a policy (post-hoc changes cannot authorize adoption)
|
|
61
|
+
--records <dir> With paired report eval, use native evidence from this run directory
|
|
62
|
+
--replay With report eval, audit receipts and regrade cloned deliveries; never call a model
|
|
53
63
|
--export <dir> With report eval, plan a portable package; --yes writes a fresh destination
|
|
54
64
|
--input-root <label=path> With --export, recover pinned inputs from a matching copy (repeatable)
|
|
55
65
|
--compete-installed With --mode trigger, copy other user-level Skills into each trial so recall is not an upper bound
|
|
56
66
|
--input <mode> Paired eval or baseline calibration: snapshot (default) | workspace (CLI only)
|
|
57
67
|
--bench <path> Bench directory for eval (default: bundled benches)
|
|
58
|
-
--task <id> With eval, select cases (repeatable, manifest order); requests use taskIds
|
|
68
|
+
--task <id> With eval/calibration, select cases (repeatable, manifest order); requests use taskIds
|
|
59
69
|
--trials <n> Repetitions per condition for eval (integer 1–20; default: ${DEFAULT_EVAL_TRIALS})
|
|
60
70
|
--max-calls <n> Call ceiling for eval / bench check --calibrate (includes enabled judges)
|
|
61
71
|
Also controls baseline calibration repetitions
|
|
@@ -112,6 +122,11 @@ const CLI_OPTIONS = {
|
|
|
112
122
|
'baseline-skill': { type: 'string' },
|
|
113
123
|
request: { type: 'string' },
|
|
114
124
|
'plan-sha': { type: 'string' },
|
|
125
|
+
'spending-budget': { type: 'string' },
|
|
126
|
+
'executor-timeout-seconds': { type: 'string' },
|
|
127
|
+
'pair-order': { type: 'string' },
|
|
128
|
+
'runs-root': { type: 'string' },
|
|
129
|
+
'run-group': { type: 'string' },
|
|
115
130
|
policy: { type: 'string' },
|
|
116
131
|
records: { type: 'string' },
|
|
117
132
|
replay: { type: 'boolean', default: false },
|
|
@@ -173,6 +188,10 @@ function jsonBenchCommand() {
|
|
|
173
188
|
return args.some(jsonFlag) && command[0] === 'bench' && supported.includes(command[1] ?? '') ? command[1] : null;
|
|
174
189
|
}
|
|
175
190
|
}
|
|
191
|
+
function failureExitCode(fallback) {
|
|
192
|
+
const current = Number(process.exitCode);
|
|
193
|
+
return current === 130 || current === 143 ? current : fallback;
|
|
194
|
+
}
|
|
176
195
|
async function main() {
|
|
177
196
|
const { values, positionals } = parseArgs({
|
|
178
197
|
args: process.argv.slice(2),
|
|
@@ -188,14 +207,15 @@ async function main() {
|
|
|
188
207
|
console.log(USAGE);
|
|
189
208
|
return;
|
|
190
209
|
}
|
|
210
|
+
const calibrationCommand = command === 'bench' && positionals[1] === 'check' && values.calibrate;
|
|
191
211
|
if (values['baseline-skill'] !== undefined && command !== 'eval') {
|
|
192
212
|
throw new Error('--baseline-skill applies only to eval --mode installed.');
|
|
193
213
|
}
|
|
194
214
|
if (values.kind !== undefined && !(command === 'bench' && positionals[1] === 'init')) {
|
|
195
215
|
throw new Error('--kind applies only to bench init.');
|
|
196
216
|
}
|
|
197
|
-
if (values.task !== undefined && command !== 'eval' && !(command === 'bench' && positionals[1] === 'add')) {
|
|
198
|
-
throw new Error('--task applies only to eval or bench add.');
|
|
217
|
+
if (values.task !== undefined && command !== 'eval' && !calibrationCommand && !(command === 'bench' && positionals[1] === 'add')) {
|
|
218
|
+
throw new Error('--task applies only to eval, calibration or bench add.');
|
|
199
219
|
}
|
|
200
220
|
if ((values.set || values.unset) && !(command === 'bench' && positionals[1] === 'edit'))
|
|
201
221
|
throw new Error('--set and --unset apply only to bench edit.');
|
|
@@ -209,10 +229,20 @@ async function main() {
|
|
|
209
229
|
throw new Error('bench add requires exactly one --task.');
|
|
210
230
|
if (values.request !== undefined && command !== 'eval')
|
|
211
231
|
throw new Error('--request applies only to eval.');
|
|
212
|
-
if (values['plan-sha'] !== undefined && (command !== 'eval'
|
|
213
|
-
throw new Error('--plan-sha requires a non-dry-run eval
|
|
214
|
-
|
|
215
|
-
|
|
232
|
+
if (values['plan-sha'] !== undefined && ((command !== 'eval' && !calibrationCommand) || values['dry-run']))
|
|
233
|
+
throw new Error('--plan-sha requires a non-dry-run eval or calibration.');
|
|
234
|
+
const evalSettings = ['spending-budget', 'executor-timeout-seconds', 'pair-order', 'runs-root', 'run-group'];
|
|
235
|
+
if (command !== 'eval' && !calibrationCommand && evalSettings.some(key => values[key] !== undefined))
|
|
236
|
+
throw new Error('Budget, timeout and output settings apply only to eval or calibration.');
|
|
237
|
+
if (calibrationCommand && values['pair-order'] !== undefined)
|
|
238
|
+
throw new Error('--pair-order requires a paired eval.');
|
|
239
|
+
if (calibrationCommand && (values.mode !== undefined || values['judge-agent'] !== undefined || values['baseline-skill'] !== undefined || values['compete-installed'] || values.bench !== undefined)) {
|
|
240
|
+
throw new Error('Calibration is single-arm: --mode, --judge-agent, --baseline-skill, --compete-installed and --bench do not apply; supply the bench directory after check.');
|
|
241
|
+
}
|
|
242
|
+
if (values['runs-root'] !== undefined && (!values['runs-root'].trim() || values['runs-root'].includes('\0')))
|
|
243
|
+
throw new Error('--runs-root must be a non-empty path.');
|
|
244
|
+
if ((values.policy !== undefined || values.records !== undefined || values.replay) && !(command === 'report' && positionals[1] === 'eval')) {
|
|
245
|
+
throw new Error('--policy, --records and --replay require report eval.');
|
|
216
246
|
}
|
|
217
247
|
const common = {
|
|
218
248
|
agent: values.agent,
|
|
@@ -245,8 +275,8 @@ async function main() {
|
|
|
245
275
|
if (positionals[1] === 'eval') {
|
|
246
276
|
if (!positionals[2]) {
|
|
247
277
|
if (values.json)
|
|
248
|
-
throw new Error('report eval --json requires a
|
|
249
|
-
console.error('Usage: skillfit report eval <
|
|
278
|
+
throw new Error('report eval --json requires a saved summary or native run directory.');
|
|
279
|
+
console.error('Usage: skillfit report eval <summary-or-run-dir>');
|
|
250
280
|
process.exitCode = 2;
|
|
251
281
|
return;
|
|
252
282
|
}
|
|
@@ -258,53 +288,79 @@ async function main() {
|
|
|
258
288
|
return;
|
|
259
289
|
}
|
|
260
290
|
if (values.json)
|
|
261
|
-
console.log(JSON.stringify(await
|
|
291
|
+
console.log(JSON.stringify(await readEvaluationReport(positionals[2], {
|
|
262
292
|
policyPath: values.policy, recordsPath: values.records, replay: values.replay, benchDir: values.bench,
|
|
263
293
|
}), null, 2));
|
|
264
294
|
else
|
|
265
|
-
runEvalReport(positionals[2]
|
|
295
|
+
await runEvalReport(positionals[2], undefined, {
|
|
296
|
+
policyPath: values.policy, recordsPath: values.records, replay: values.replay, benchDir: values.bench,
|
|
297
|
+
});
|
|
266
298
|
return;
|
|
267
299
|
}
|
|
268
300
|
await runReport({ agent: values.agent, json: values.json ?? false });
|
|
269
301
|
return;
|
|
270
302
|
case 'eval': {
|
|
271
303
|
if (values.request !== undefined) {
|
|
272
|
-
if (positionals.length !== 1 || ['agent', 'mode', 'baseline-skill', 'bench', 'task', 'trials', 'max-calls', 'input', 'judge-agent'].some(key => values[key] !== undefined) || values['compete-installed']) {
|
|
304
|
+
if (positionals.length !== 1 || ['agent', 'mode', 'baseline-skill', 'bench', 'task', 'trials', 'max-calls', 'input', 'judge-agent', ...evalSettings].some(key => values[key] !== undefined) || values['compete-installed']) {
|
|
273
305
|
throw new Error('--request cannot be combined with a target or positional eval settings; put settings in the request.');
|
|
274
306
|
}
|
|
275
307
|
const result = await runEvalComponent(values.request, { dryRun: values['dry-run'], expectedPlanSha256: values['plan-sha'], log: line => console.error(line) });
|
|
276
308
|
console.log(JSON.stringify(result, null, 2));
|
|
277
309
|
if (result.status === 'stopped')
|
|
278
|
-
process.exitCode = 2;
|
|
310
|
+
process.exitCode = failureExitCode(2);
|
|
279
311
|
return;
|
|
280
312
|
}
|
|
281
|
-
if (values
|
|
282
|
-
throw new Error('eval --
|
|
313
|
+
if (values['plan-sha'] !== undefined && !values['run-group'])
|
|
314
|
+
throw new Error('Positional eval --plan-sha requires --run-group from the dry-run plan.');
|
|
315
|
+
if (values.json && !values['dry-run'] && values['plan-sha'] === undefined)
|
|
316
|
+
throw new Error('JSON eval execution requires --plan-sha from a dry-run and --run-group; no calls started.');
|
|
283
317
|
const skillPath = positionals[1];
|
|
284
318
|
if (!skillPath) {
|
|
319
|
+
if (values.json)
|
|
320
|
+
throw new Error('Usage: skillfit eval <target-path> [options]');
|
|
285
321
|
console.error('Usage: skillfit eval <target-path> [--bench <path>] [--trials <n>] [--agent <id>] [--mode <mode>]');
|
|
286
322
|
process.exitCode = 2;
|
|
287
323
|
return;
|
|
288
324
|
}
|
|
289
325
|
const mode = values.mode ?? 'inject';
|
|
290
326
|
if (mode !== 'inject' && mode !== 'installed' && mode !== 'trigger') {
|
|
327
|
+
if (values.json)
|
|
328
|
+
throw new Error(`Unknown --mode: ${mode} (expected "inject", "installed" or "trigger")`);
|
|
291
329
|
console.error(`Unknown --mode: ${mode} (expected "inject", "installed" or "trigger")`);
|
|
292
330
|
process.exitCode = 2;
|
|
293
331
|
return;
|
|
294
332
|
}
|
|
295
|
-
|
|
333
|
+
if (values['runs-root'] !== undefined && (!values['runs-root'].trim() || values['runs-root'].includes('\0')))
|
|
334
|
+
throw new Error('--runs-root must be a non-empty path.');
|
|
335
|
+
const spendingBudget = values['spending-budget'] === undefined ? undefined : parseSpendingBudget(readComponentJson(resolve(values['spending-budget'])).value);
|
|
336
|
+
const options = {
|
|
296
337
|
...common,
|
|
297
338
|
skillPath,
|
|
298
339
|
baselineSkillPath: values['baseline-skill'],
|
|
299
340
|
bench: values.bench,
|
|
300
341
|
taskIds: values.task,
|
|
301
|
-
mode,
|
|
342
|
+
mode: mode,
|
|
302
343
|
inputMode,
|
|
303
344
|
judgeAgent: values['judge-agent'],
|
|
304
345
|
competeInstalled: values['compete-installed'],
|
|
305
346
|
maxCalls,
|
|
306
347
|
trials,
|
|
307
|
-
|
|
348
|
+
spendingBudget,
|
|
349
|
+
executorTimeoutSeconds: values['executor-timeout-seconds'] === undefined ? undefined : Number(values['executor-timeout-seconds']),
|
|
350
|
+
pairOrder: values['pair-order'],
|
|
351
|
+
runsRoot: values['runs-root'] === undefined ? undefined : resolve(values['runs-root']),
|
|
352
|
+
runGroup: values['run-group'],
|
|
353
|
+
log: values.json ? (line) => console.error(line) : (line) => console.log(line),
|
|
354
|
+
};
|
|
355
|
+
{
|
|
356
|
+
const result = await runEvalCli(options, values['plan-sha']);
|
|
357
|
+
if (values.json)
|
|
358
|
+
console.log(JSON.stringify(result, null, 2));
|
|
359
|
+
else if ('executionError' in result)
|
|
360
|
+
console.error(result.executionError);
|
|
361
|
+
if (result.status === 'stopped')
|
|
362
|
+
process.exitCode = failureExitCode(2);
|
|
363
|
+
}
|
|
308
364
|
return;
|
|
309
365
|
}
|
|
310
366
|
case 'mcp': {
|
|
@@ -389,8 +445,57 @@ async function main() {
|
|
|
389
445
|
return;
|
|
390
446
|
}
|
|
391
447
|
if (subcommand === 'check') {
|
|
392
|
-
if (values.
|
|
393
|
-
|
|
448
|
+
if (values.calibrate) {
|
|
449
|
+
if (values['plan-sha'] !== undefined && !values['run-group'])
|
|
450
|
+
throw new Error('Calibration --plan-sha requires --run-group from the preview.');
|
|
451
|
+
if (values.json && !values['dry-run'] && !values['plan-sha'])
|
|
452
|
+
throw new Error('JSON calibration execution requires --plan-sha and --run-group; no calls started.');
|
|
453
|
+
const calibrate = { agent: values.agent, inputMode: inputMode, maxCalls, trials,
|
|
454
|
+
dryRun: values['dry-run'] ?? false,
|
|
455
|
+
runsRoot: values['runs-root'] === undefined ? undefined : resolve(values['runs-root']),
|
|
456
|
+
runGroup: values['run-group'],
|
|
457
|
+
executorTimeoutSeconds: values['executor-timeout-seconds'] === undefined ? undefined : Number(values['executor-timeout-seconds']),
|
|
458
|
+
spendingBudget: values['spending-budget'] === undefined ? undefined : parseSpendingBudget(readComponentJson(resolve(values['spending-budget'])).value),
|
|
459
|
+
reviewedPlanSha256: values['plan-sha'] };
|
|
460
|
+
const plan = prepareBenchCalibration({ dir: positionals[2], taskIds: values.task, calibrate });
|
|
461
|
+
if (values['dry-run']) {
|
|
462
|
+
if (values.json)
|
|
463
|
+
console.log(JSON.stringify({ schemaVersion: 1, kind: 'skillfit.calibration-result', status: 'planned', plan,
|
|
464
|
+
acceptance: { decision: 'inconclusive', eligibleForUpgrade: false, automaticUpgrade: false } }, null, 2));
|
|
465
|
+
else {
|
|
466
|
+
console.log(`calibration executor: ${plan.executor?.detail ?? plan.executor?.model ?? 'unresolved'}`);
|
|
467
|
+
console.log(`calibration plan: ${plan.bench.taskIds.length} task(s) × ${plan.trials} baseline run(s), input ${plan.inputMode}; ${plan.plannedCalls} calls, ceiling ${plan.maxCalls}`);
|
|
468
|
+
console.log(`Agent environment: ${plan.agentPreflight.status}; login remains offline unknown`);
|
|
469
|
+
console.log(`Executor deadline: ${plan.executorTimeoutSeconds}s; output ${plan.outputDir}`);
|
|
470
|
+
if (plan.spendingBudget)
|
|
471
|
+
console.log(`Spending stop lines: ${JSON.stringify(plan.spendingBudget)}`);
|
|
472
|
+
console.log(`Plan SHA: ${plan.planSha256}`);
|
|
473
|
+
console.log('Dry run: no verifier, oracle or agent started; nothing written.');
|
|
474
|
+
}
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
try {
|
|
478
|
+
const report = await runBenchCalibration({ dir: positionals[2], taskIds: values.task,
|
|
479
|
+
log: values.json ? line => console.error(line) : undefined,
|
|
480
|
+
calibrate: { ...calibrate, runsRoot: plan.runsRoot, runGroup: plan.runGroup, reviewedPlanSha256: plan.planSha256 } });
|
|
481
|
+
if (values.json)
|
|
482
|
+
console.log(JSON.stringify(await readEvaluationReport(plan.outputDir), null, 2));
|
|
483
|
+
if (report.failures > 0)
|
|
484
|
+
process.exitCode = failureExitCode(1);
|
|
485
|
+
}
|
|
486
|
+
catch (error) {
|
|
487
|
+
const { existsSync } = await import('node:fs');
|
|
488
|
+
if (!existsSync(resolve(plan.outputDir, '_plan.json')))
|
|
489
|
+
throw error;
|
|
490
|
+
const report = await readEvaluationReport(plan.outputDir);
|
|
491
|
+
if (values.json)
|
|
492
|
+
console.log(JSON.stringify({ ...report, executionError: error instanceof Error ? error.message : String(error) }, null, 2));
|
|
493
|
+
else
|
|
494
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
495
|
+
process.exitCode = failureExitCode(2);
|
|
496
|
+
}
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
394
499
|
const report = await runBenchCheck({
|
|
395
500
|
dir: positionals[2],
|
|
396
501
|
log: values.json ? () => { } : undefined,
|
|
@@ -454,23 +559,28 @@ async function main() {
|
|
|
454
559
|
}
|
|
455
560
|
main().catch((err) => {
|
|
456
561
|
const benchCommand = jsonBenchCommand();
|
|
562
|
+
if (benchCommand === 'check' && process.argv.includes('--calibrate')) {
|
|
563
|
+
console.log(JSON.stringify(componentError(err), null, 2));
|
|
564
|
+
process.exitCode = failureExitCode(2);
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
457
567
|
if (benchCommand === 'check') {
|
|
458
568
|
console.log(JSON.stringify(benchCheckError(err), null, 2));
|
|
459
|
-
process.exitCode = 2;
|
|
569
|
+
process.exitCode = failureExitCode(2);
|
|
460
570
|
return;
|
|
461
571
|
}
|
|
462
572
|
if (benchCommand) {
|
|
463
573
|
console.log(JSON.stringify({ schemaVersion: 1, kind: 'skillfit.bench-error', status: 'error',
|
|
464
574
|
error: { code: 'INVALID_BENCH_OPERATION', message: err instanceof Error ? err.message : String(err) } }, null, 2));
|
|
465
|
-
process.exitCode = 2;
|
|
575
|
+
process.exitCode = failureExitCode(2);
|
|
466
576
|
return;
|
|
467
577
|
}
|
|
468
578
|
if (process.argv.some(arg => arg === '--request' || arg.startsWith('--request=')) ||
|
|
469
|
-
(process.argv.
|
|
579
|
+
(process.argv.some(arg => arg === '--json' || arg.startsWith('--json=')) && process.argv.includes('eval'))) {
|
|
470
580
|
console.log(JSON.stringify(componentError(err), null, 2));
|
|
471
|
-
process.exitCode = 2;
|
|
581
|
+
process.exitCode = failureExitCode(2);
|
|
472
582
|
return;
|
|
473
583
|
}
|
|
474
584
|
console.error(err instanceof Error ? err.message : String(err));
|
|
475
|
-
process.exitCode = 1;
|
|
585
|
+
process.exitCode = failureExitCode(1);
|
|
476
586
|
});
|